text stringlengths 6.04k 39.5k |
|---|
# Copyright (C) 2013 Intel Corporation
#
# Released under the MIT license (see COPYING.MIT)
# Main unittest module used by testimage.bbclass
# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
# It also has some helper functions and it's responsible for actually star... |
from __future__ import annotations
import logging
import os
from threading import Timer
from typing import List
import pygame
import snecs
from snecs import Component
from snecs.world import default_world
import scripts.engine.core.matter
from scripts.engine.core import hourglass, state, system, utility, world
from ... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 18 08:39:44 2021
@author: pvrma
"""
import numpy as np
import math
import os
import matplotlib
import matplotlib.pyplot as plt
from scipy.spatial.transform import Rotation as R
from tqdm import tqdm
from time import time as time
def voxelize_sq_par(par_x,p... |
from elegantrl.train.run_parallel import *
from elegantrl.train.run_tutorial import *
import random as rd
'''run.py'''
def train_and_evaluate_em(args): # keep
args.init_before_training() # necessary!
args_cwd = args.cwd
process = list()
mp.set_start_method(method='spawn', force=True) # force all t... |
import autograd.scipy.special as special
import autograd.numpy as np
import wh, wp
import util
import gtilde
from scipy.integrate import quad
from scipy.stats import multivariate_normal
from autograd import primitive
import matplotlib.pyplot as plt
__nugget_scalar = 1e-7
__nugget = lambda n: __nugget_scalar * np.eye(n)... |
import logging
import os
import shutil
from collections import OrderedDict
from copy import copy
from datetime import datetime
from wa.framework.configuration.core import JobSpec, Status
from wa.framework.configuration.execution import CombinedConfig
from wa.framework.exception import HostError
from wa.framework.run i... |
from plotly.subplots import make_subplots
import plotly.graph_objects as go
from tinydb import TinyDB, Query
from datetime import datetime
from datetime import time
from retrying import retry
import matplotlib as plt
import pandas_ta as ta
from time import sleep
from tqdm import tqdm
import datetime as dt
import pandas... |
##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
# coding=utf-8
'''
@ Summary: 获取网络节点中间变量值
@ Update:
@ file: models_rebuild.py
@ version: 1.0.0
@ Author: <EMAIL>
@ Date: 2020/5/6 下午6:29
'''
import tensorflow as tf
import math
def prepare_model_settings(label_count, sample_rate, clip_duration_ms,
window_size_ms, window_stride_m... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file belong to https://github.com/snolfi/evorobotpy
and has been written by <NAME> and <NAME>, <EMAIL>, <EMAIL>
policy.py takes care of the creation and evaluation of the policy
Requires the net.so library that can be obtained by compiling with cython the... |
"""
Lark Parser Generator
================
REPL calculator shows how to write a basic calculator with variables.
"""
from lark import Lark, Transformer, v_args, visitors
import sys, os
import json
from typing import List, Callable
import logging
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
log = logging... |
import json
import nltk
import os
from tqdm import tqdm
import numpy as np
from absl import flags
from absl import app
import util
import sys
import glob
import data
from sklearn.feature_extraction.text import CountVectorizer
import stanfordnlp
# from spacy_stanfordnlp import StanfordNLPLanguage
FLAGS = flags.FLAGS
i... |
import argparse
import copy
import glob
import json
import logging
import os
import shutil
from pathlib import Path
from typing import List
import numpy as np
from PIL import Image, ImageFile
from tqdm import tqdm
from data_utils import S2S_ORIGINAL_CATEGORIES as ORIGINAL_CATEGORIES
from data_utils import (
creat... |
class AStarNode():
"""A node class for holding multiple data like parent index etc..."""
def __init__(self, parent=None, index=None):
# parent of current node
self.parent = parent
# index position of current node in list
self.index = index
# path cost
self.g = 0... |
#!/usr/bin/env python3
"""
crypto.py
<NAME>, Saowakon, Swanson 2019
Contains an implementation of the threshold decryption variant of the Damgard-Jurik cryptosystem.
"""
from functools import lru_cache
from math import factorial
from secrets import randbelow
from typing import Any, List, Tuple
from gmpy2 import mpz
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@file : OntoNotes_trainer.py
@author: <NAME>
@contact : <EMAIL>
@date : 2021/06/30 17:28
@version: 1.0
@desc :
"""
import os
import re
import json
import argparse
import logging
from functools import partial
from collections import namedtuple
from datasets.collate... |
"Usage: unparse.py <path to source file>"
import sys
import math
import ast
import tokenize
import io
import os
# Large float and imaginary literals get turned into infinities in the AST.
# We unparse those infinities to INFSTR.
INFSTR = "1e" + repr(sys.float_info.max_10_exp + 1)
def interleave(inter, f, seq):
""... |
"""Define word-based embedders."""
import abc
import collections
import os
import numpy as np
import tensorflow as tf
from tensorboard.plugins import projector
from google.protobuf import text_format
from opennmt import constants, tokenizers
from opennmt.data import dataset as dataset_util
from opennmt.data import ... |
from toposort import toposort
import contextlib
import numpy as np
import tensorflow as tf
import tensorflow.contrib.graph_editor as ge
import time
import sys
sys.setrecursionlimit(10000)
# refers back to current module if we decide to split helpers out
util = sys.modules[__name__]
# getting rid of "WARNING:tensorflow... |
from __future__ import unicode_literals
import filecmp
import logging
import os
import posixpath
import shutil
import time
import colorama
import pytest
from mock import patch
import dvc
from dvc.exceptions import DvcException
from dvc.exceptions import RecursiveAddingWhileUsingFilename
from dvc.exceptions import St... |
import tkinter as tk
from tkinter import ttk
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2Tk
from matplotlib.patches import Circle, Rectangle, PathPatch
from matplotlib.lines import Line2D
from matplotlib import path, patch... |
"""This module defines miscellaneous utility functions."""
import re
from numpy import unique, linalg, diag, sqrt, dot, chararray, divide, zeros_like, zeros, allclose, ceil
from numpy import diff, where, insert, nan, isnan, loadtxt, array, round, average, min, max, delete, vstack
from numpy import sign, arange, asarra... |
from mrtarget.Settings import Config
from mrtarget.constants import Const
from addict import Dict
def _get_evidence_string_generic_mapping():
mmap = Dict()
# it was previously required True
# better approach
# mmap._routing.required = True
# mmap._routing.path = "<target_path>" # to change to a re... |
#!/usr/bin/env python
"""
Weighted Principal Component Analysis using Expectation Maximization
Classic PCA is great but it doesn't know how to handle noisy or missing
data properly. This module provides Weighted Expectation Maximization PCA,
an iterative method for solving PCA while properly weighting data.
Missing ... |
#
# Copyright (c) 2009-2015 <NAME> <<EMAIL>> and
# <NAME>
#
# See the file LICENSE.txt for your full rights.
#
"""Utilities for installing and removing extensions"""
# As an example, here are the names of some reference directories for the
# extension pmon (process monitor):
# -user/ ... |
# testing/fixtures.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import contextlib
import re
import sys
import sqlalchemy as sa
from... |
# File: T (Python 2.4)
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.task.Task import Task
from direct.interval.IntervalGlobal import *
from pirates.piratesgui import PiratesGuiGlobals
from pirates.piratesgui import InventoryPage
from pirates.pirate import TitleGlobals
from pirates.u... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
import os
import tempfile
import pandas as pd
import numpy as np
import itertools
from .base import _PlotBase
#try:
#import exptools
#exptools.load_software('palettable')
#exptools.load_software('descartes')
#exptools.load_software('mizani')
#exptools.load_software('patsy')
#exptools.load_softwa... |
from __future__ import print_function # Python2 compat
from functools import (wraps, update_wrapper, WRAPPER_UPDATES,
WRAPPER_ASSIGNMENTS)
from collections.abc import Mapping, Iterable
import inspect
import sys
import logging
logger = logging.getLogger(__name__)
class Try(object):
''' Try c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 1 18:36:22 2017
@author: pietro
"""
from __future__ import print_function
import atexit
import os
import shutil
import subprocess
import sys
import tempfile as tmpfile
if sys.version_info[0] >= 3:
from shutil import which
else:
# lazy impo... |
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.11.4
# kernelspec:
# display_name: Python 3 (ipykernel)
# language: python
# name: python3
# ---
# %% [ma... |
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
r"""
This module contains classes useful for analyzing ferroelectric candidates.
The Polarization class can recover the spontaneous polarization using
multiple calculations along a nonpolar to polar ferroelectric distortion.
T... |
from dexy.filters.process import SubprocessExtToFormatFilter
from dexy.filters.process import SubprocessFilter
from dexy.filters.process import SubprocessFormatFlagFilter
from dexy.filters.process import SubprocessInputFilter
from dexy.filters.process import SubprocessStdoutFilter
from dexy.utils import file_exists
imp... |
"""Dataset handling and related yuck."""
import random
import itertools
import time
import sys
import numpy as np
from spinn.data import T_SHIFT, T_REDUCE, T_SKIP
# With loaded embedding matrix, the padding vector will be initialized to zero
# and will not be trained. Hopefully this isn't a problem. It seems bette... |
"""
XMLEdit GUI-onafhankelijke code
"""
import os
# import pathlib
## import sys
import shutil
import xml.etree.ElementTree as et
# import logging
from .shared import ELSTART, log
from .gui import Gui
TITEL = "Albert's (Simple) XML editor"
NEW_ROOT = '(new root)'
def find_in_flattened_tree(data, search_args, revers... |
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals, division
import sys
import math
from time import sleep
from random import choice as randchoice
from pprint import pprint
import pygame
from pygame import *
from pygame import font, display, gfxdraw
from utils import ujoin, range1, enumer... |
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:<EMAIL>
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by th... |
import sys, os
import os.path
import shutil
from rpython.translator.translator import TranslationContext
from rpython.translator.tool.taskengine import SimpleTaskEngine
from rpython.translator.goal import query
from rpython.translator.goal.timing import Timer
from rpython.annotator.listdef import s_list_of_strings
fro... |
# Copyright 2016 Google 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
import argparse
import math
import h5py
import numpy as np
import tensorflow as tf
import socket
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)
sys.path.append(BASE_DIR)
sys.path.append(ROOT_DIR)
sys.path.append(os.path.join(ROOT_DIR, 'utils'))
import pr... |
import hashlib
import json
import pickle
import redis
import requests
from cache import parse
from crawler import webap_crawler
from utils import config, error_code
from utils.config import REDIS_URL
from utils.session import get_session
red_string = redis.StrictRedis.from_url(
url=REDIS_URL, db=4, charset="utf... |
"""
An RDF/XML parser for RDFLib
"""
from xml.sax import make_parser
from xml.sax.handler import ErrorHandler
from xml.sax.saxutils import handler, quoteattr, escape
from six.moves.urllib.parse import urldefrag, urljoin
from rdflib.namespace import RDF, is_ncname
from rdflib.term import URIRef
from rdflib.term impor... |
# Copyright 2016-2020 Blue Marble Analytics 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
import math
import json
import scoresheetsHtml
import pickle
import csv
################################################################################
# Printing Instructions
def printIntro():
'''
Prints program name and instructions for the user
'''
print('CubeToaster - Heat Generator')
print('... |
import os
import numpy as np
import argparse
## tf1.x or tf2.x
# import tensorflow as tf
import tensorflow.compat.v1 as tf
import pickle
import time
import math
import scipy.io as scio
import gc
from load_data import loading_data
from net_structure_img import img_net_strucuture
from net_structure_txt import txt_net_... |
# adventureEngine.py
# Copyright 2005-2006, <NAME>
#
# Updated 2012 - latest pyparsing API
#
from pyparsing import *
import random
import string
def aOrAn( item ):
if item.desc[0] in "aeiou":
return "an " + item.desc
else:
return "a " + item.desc
def enumerateItems(l):
... |
import sys
import os
import glob
import csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import tensorflow as tf
from matplotlib import patches
from matplotlib.pyplot import figure
from datetime import timedelta, date
from sklearn.metrics import confusion_matrix, classification_report, accura... |
import glob
import json
import os
import re
import subprocess
import sys
import tempfile
from core import constants
def catch_exceptions(*exc_types):
def catch_exceptions_inner1(f):
def catch_exceptions_inner2(*args, **kwargs):
try:
return f(*args, **kwargs)
except... |
#!/usr/bin/env python -u
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import hashlib
import logging
import os
import shutil
import sys
from argparse import Namespace
from datac... |
import inspect
import inspect
from abc import ABC
from typing import List, Union, Optional, Callable
from tiger_interpreter.lexer import (
Token,
Keyword,
TigerLexer,
Punctuation,
Operator as OpToken,
)
"""
# Grammar Reference
program → exp
dec → tyDec | varDec | funDec
tyDec → type tyId = ty
ty ... |
from itertools import cycle
import random
import sys
import pygame
from pygame.locals import *
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
FPS = 30
SCREENWIDTH = 288.0
SCREENHEIGHT = 512.0
# amount by which base can maximum shift to left
PIPEGAPSIZE = 100 # gap between up... |
# coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
qsiprep reports builder
^^^^^^^^^^^^^^^^^^^^^^^^
"""
from pathlib import Path
import json
import re
import html
import jinja2
from nipype.utils.filemani... |
# Copyright (C) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import itertools
import os
import sys
from re import findall
import rq
import re
import shutil
from traceback import print_exception
from urllib import error as urlerror
from urllib import parse as urlparse
from urllib import request as urlr... |
from decimal import (
Decimal,
)
import re
from eth_utils import (
decode_hex,
)
from eth_abi.utils.padding import (
zpad32_right,
)
WORD_DESC_RE = re.compile(r'^(([0f])<)?([0-9a-f]+)(>([0f]))?( \(([0-9]+) wide\))?$')
def make_word(description: str) -> bytes:
r"""
Converts a "description" of an... |
import copy
import os
import shlex
import sys
import textwrap
from functools import wraps
def bash_quote(w, quote):
'''
Quote word *w* with quote character *quote* which may be empty, single quote or double quote.
'''
assert quote in ('', '"', "'")
if quote == "'":
w = w.replace("'", quote... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
from PyQt5.QtCore import QCoreApplication, Qt
import random
import numpy as np
import pandas as pd
from GUI_classes.utils_gui import choose_dataset, pause_execution
from GUI_classes.generic_gui import StartingGui
from base import appctxt
class CLARA_class(StartingGui):
def __init__(self):
super(CLARA_cl... |
# This file is part of the clacks framework.
#
# http://clacks-project.org
#
# Copyright:
# (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de
#
# License:
# GPL-2: http://www.gnu.org/licenses/gpl-2.0.html
#
# See the LICENSE file in the project's top-level directory for details.
import re
import os
import ... |
import torch
from torch.utils.data import Dataset, DataLoader
import torchvision
from pytorch_pretrained_bert import BertTokenizer
#import stanfordnlp
import os
from glob import glob
import random
import pickle
import json
import numpy as np
#import scipy.io
from PIL import Image, ImageDraw
from tqdm import tqdm
from ... |
"""
API for the image classification package
Date: September 2018
Author: <NAME>
Email: <EMAIL>
Github: ignacioheredia
Notes: Based on https://github.com/indigo-dc/plant-classification-theano/blob/package/plant_classification/api.py
Descriptions:
The API will use the model files inside ../models/api. If not found it... |
#!/usr/bin/env python
##
# \addtogroup scripts
# Simulation scripts and other tools for pre and postprocessing files
#
#
#
# \file parun
# @{
# \ingroup scripts
# \brief A driver for both single and mult-model simulations
#
#
from __future__ import print_function
from builtins import zip
from builtins import str
... |
import argparse
import logging
import time
import cv2
import numpy as np
from estimator import TfPoseEstimator
from networks import get_graph_path, model_wh
#====================
from socket import socket, AF_INET, SOCK_STREAM
import threading
import time
from tkinter import *
import tkinter as tk
import os
from PIL... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from gym.spaces import Discrete
import numpy as np
from scipy.stats import entropy
import ray
from ray.rllib.agents.dqn.distributional_q_model import DistributionalQModel
from ray.rllib.agents.dqn.simple_q_pol... |
import utils
import os
import unittest
import sys
from test_format_bcif import MockMsgPack, MockFh
if sys.version_info[0] >= 3:
from io import StringIO, BytesIO
else:
from io import BytesIO
StringIO = BytesIO
TOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
utils.set_search_paths(TO... |
# hgweb/hgweb_mod.py - Web interface for a repository.
#
# Copyright 21 May 2005 - (c) 2005 <NAME> <<EMAIL>>
# Copyright 2005-2007 <NAME> <<EMAIL>>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import contextlib
import os
fro... |
from typing import Any, Dict, NoReturn, Type, Optional, TypeVar
from .types import ResponseBody, ResponseHeaders, StrURL
from .response import Response, HTTPStatus
__all__ = (
'HTTPException',
'Continue',
'SwitchingProtocols',
'Processing',
'EarlyHints',
'OK',
'Created',
'Accepted',
... |
#!/usr/bin/env python
#
# Modified based on MINDO/3 implementation in PyQuante-1.6
#
'''
MINDO/3
Ref:
[1] <NAME>, <NAME>, <NAME>, J. Am. Chem. Soc., 97, 1285 (1975)
[2] <NAME>, Chem. Rev. 86, 1111 (1986).
'''
import copy
import numpy
from pyscf import lib
from pyscf.lib import logger
from pyscf import gto
from pyscf... |
# -----------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -----------------------------------------------------------------------------
""... |
# Lint as: python3
# 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 ... |
import os.path
import typing
import sys
from time import time
import logging
import math
import cv2
from tqdm import tqdm
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import LabelEncoder
from d3m.primitive_interfaces.supervised_learning import S... |
import csv
import datetime
import math
import os
import typing as T
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats as stats
import seaborn as sns
from const import OUTPUT_PATH_PLOTS_DETAIL, STAT_SIGNIFICANCE_CUTOFF
# line below suppresses annoying SettingWithCopyWarning
pd.... |
#!/usr/bin/env python
u"""
reanalysis_inverse_barometer.py
Written by <NAME> (10/2021)
Reads hourly mean sea level pressure fields from reanalysis and
calculates the inverse-barometer response
INPUTS:
Reanalysis model to run
ERA-Interim: http://apps.ecmwf.int/datasets/data/interim-full-moda
ERA5: http:... |
"""pandasなどなど関連。"""
from __future__ import annotations
import html
import typing
import warnings
import numpy as np
import pandas as pd
import sklearn.utils
import pytoolkit as tk
def safe_apply(s: pd.Series, fn) -> pd.Series:
"""nan以外にのみapply"""
return s.apply(lambda x: x if pd.isnull(x) else fn(x))
def... |
# -*- coding: utf-8 -*-
""" Shelter (Camp) Registry, model
@copyright: 2009-2013 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software ... |
# coding: utf-8
from __future__ import print_function, division
from __future__ import absolute_import
from .logger import logger
import copy
import json
import string
import six.moves.urllib.request, six.moves.urllib.parse, six.moves.urllib.error
import os
from .catalog import Catalog
from .export import coords2geoj... |
import json
from stats import find_times, _normalize_last_played
DEFAULT = None
class StatCardMock(object):
def __init__(self, name, display_name, time_format=False, value=None, unit='Seconds', last_modified=None):
self.name = name
self.display_name = display_name
self.format = 'LongTim... |
import logging
import logging as log
import os
import threading
import time
from bisect import bisect_left
from typing import List, NamedTuple, Tuple
from odf.components import Data, Device, Mode, State
from odf.events import Event_RT_REC_DATA, Event_RT_TRS_CMD, Event_WORD_REC
from odf.sabotage import *
from odf.sys i... |
import numpy as np
import xlrd
from sklearn import svm
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
from sklearn.decomposition import TruncatedSVD
from sklearn.datasets import make_friedman1
from sklearn.feature_selection import RFE,RFECV
from sklearn.svm import SVR, SVC
from sklearn.model_sele... |
"""
Basic statistics module.
This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.
Calculating averages
--------------------
================== ==================================================
Function Description
=================... |
#!/usr/bin/env python
# Copyright (C) 2018 <NAME>
import numpy as np
import crispy as cy
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from natsort import natsorted
from scipy.stats import ttest_ind
from analysis.DataImporter import DataImporter
from statsmodels.stats.multitest import multi... |
'''Front-end code for HARMONI simulator
This handles the GUI and command line interfaces.
'''
import os
import sys
import argparse
import configparser
import multiprocessing as mp
import collections
from src.config import config_data
def get_version_number():
try:
dir_path = os.path.dirname(os.path.realpath(__fi... |
import requests
import xml.etree.ElementTree as ET
import urllib.parse
from datetime import datetime, timedelta
import argparse
import textwrap
import xml.dom.minidom
from decimal import *
VERSION = '0.1'
verbose = False
debug_mode = False
debug_filename = 'debug_{}_{}.xml'
def print_parameters(pa... |
"""
demo_image_repo.py
Demonstration code handling an Image Repository.
Use:
import demo.demo_image_repo as di
di.clean_slate()
See README.md for more details.
<Demo Interface Provided Via XMLRPC>
XMLRPC interface presented TO THE DEMO WEBSITE:
add_target_to_image_repo(target_filepath, filepat... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
from __future__ import division, print_function, absolute_import
import numpy as np
from dipy.testing import assert_true, assert_false
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_equal, assert_almost_equal)
from dipy.tracking import metrics as tm
from dip... |
"""jc - JSON Convert `ping` command output parser
Supports `ping` and `ping6` output.
Usage (cli):
Note: Use the ping `-c` (count) option, otherwise data will not be
piped to `jc`.
$ ping -c 3 1.2.3.4 | jc --ping
or
$ jc ping -c 3 1.2.3.4
Usage (module):
import jc
result = jc... |
import torch
from torch import nn
from torch.nn.functional import fold, unfold
from . import norms, activations
from ..utils import has_arg
class Conv1DBlock(nn.Module):
"""One dimensional convolutional block, as proposed in [1].
Args:
in_chan (int): Number of input channels.
hid_chan (int):... |
#!/usr/bin/env python3
# Modified MIT License
# Software Copyright (c) 2019 OpenAI
# We don’t claim ownership of the content you create with GPT-2, so it is yours to do with as you please.
# We only ask that you use GPT-2 responsibly and clearly indicate your content was created using GPT-2.
# Permission is hereby ... |
# coding: utf8
import os
import re
import sublime
import sublime_plugin
import difflib
import tempfile
import subprocess
from fnmatch import fnmatch
import codecs
if sublime.platform() == "windows":
from subprocess import Popen
class FileDiffMenuCommand(sublime_plugin.TextCommand):
def run(self, edit, cmd=... |
"""Contains the Flask app that serves distributey's API."""
from pathlib import Path
import json
import os
from os import getpid
from typing import Tuple, Dict
import inspect
from webargs.flaskparser import use_args
from markupsafe import escape
from flask import Flask, Response, abort, session
from dy_trace import tr... |
import pandas as pd
import sys, re, math, gzip
import numpy as np
cellLine = sys.argv[1]
doseResponse = sys.argv[2]
screenedComponents = sys.argv[3]
RACS = sys.argv[4]
variants = sys.argv[5]
expressionIn = sys.argv[6]
clinicalOut = sys.argv[7]
tmpExpression = sys.argv[8]
finalExpression = sys.argv[9]
def readSheetT... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright (c) 2018 FIRST. All Rights Reserved.
# Open Source Software - may be modified and shared by FRC teams. The code
# must be accompanied by the FIRST BSD license file in the root directory of
# the project.
# ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 13 11:16:45 2020
@author: Likxx00
"""
# Generated by Django 3.1 on 2020-11-13 02:41
from django.core.management.base import BaseCommand, CommandError
import os
import pandas as pd
import numpy as np
import csv
from datetime import datetime
from staffs.models import (Sta... |
import numpy as np
import os
import random
from utility import *
import tensorflow as tf
def generate_batch_skip_gram(data, batch_size, num_skips):
'''
Batch generator for Skip-gram
'''
data_index = 0
assert batch_size % num_skips == 0
batch = np.ndarray(shape=(batch_size), dtype=np.int32)
... |
#########################################################
##
## Global Post Processing Settings dialog box
##
## This script is an addon to the post processing manager plugin
##
##
## Author <NAME> (Neill3d) 2018
## e-mail to: <EMAIL>
## www.neill3d.com
##
## Special for les Androids Associes
##
###########... |
#!/usr/bin/env python3
import tensorflow as tf
import numpy as np
from context import libspn as spn
import time
import argparse
import colorama as col
import sys
from tensorflow.python.client import timeline
import os
col.init()
red = col.Fore.RED
blue = col.Fore.BLUE
green = col.Fore.GREEN
yellow = col.Fore.YELLOW
m... |
# -*- coding: utf-8 -*-
# test_commit.py
# Copyright (C) 2008, 2009 <NAME> (<EMAIL>) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from __future__ import print_function
from datetime import datetime
from io import Bytes... |
from __future__ import print_function
import glob
import logging
logging.basicConfig(level=logging.INFO)
_logger = logging.getLogger(__name__)
from fuse import ElasticAugment, Misalign, SimpleAugment, Snapshot, DefectAugment
from gunpowder import ArrayKey, Hdf5Source, Coordinate, BatchRequest, Normalize, Pad, RandomL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.