text stringlengths 3.07k 22.1k |
|---|
import copy
import matplotlib.pyplot as plt
import pandas as pd
plt.rcParams['font.family'] = 'Arial' # Set font family to Arial for plot
category_list = ['PP', 'st', 'PB', 'R', 'RB', 'bp']
category_dict = {'PP': ['PP0', 'PP1', 'PP2', 'PP3'],
'st': ['st'],
'PB': ['PB', 'RR'],
... |
#!/usr/bin/python
import math
import time
import random
from roberta import Hal
h = Hal()
from roberta import FaceRecognitionModule
faceRecognitionModule = FaceRecognitionModule("faceRecognitionModule")
___numberVar = 0
___booleanVar = True
___stringVar = ""
___colourVar = 0xff0000
___numberList = [0, 0]
___boolean... |
import subprocess
from subprocess import Popen, PIPE
import sys
import os
import math
import re
import decimal
import json
# exiftool.exe and cs2cs.exe must be installed
# set PROJ_LIB= {{folder with epsg file}}
# http://svn.osgeo.org/metacrs/proj/trunk/proj/nad/epsg
# create a new context for this task
ctx = decima... |
#!/usr/bin/python3
"""
File: watch_proc_stats.py
Description: Monitors searches for processes with names containing a \
given string and monitors those processes statistics continuously
"""
# pylint: disable=C0325,R0902,R0903,E1101,F0401
# import os
import sys
import time
import logging
import threading
import subproce... |
import argparse
import cv2
import numpy as np
import torch
from torch.autograd import Function
from torchvision import models
import torch.nn as nn
from model import *
import matplotlib.pyplot as plt
class FeatureExtractor():
""" Class for extracting activations and
registering gradients from targetted interme... |
import math
import itertools
import torch
# Define EPS for numerical stability
eps = 7.0/3 - 4.0/3 - 1
def getloss(muG, sigmaG, muM, sigmaM):
r"""PROPEL Loss function
Implements the following equations:
In forward pass:
.. math::
L = -\log\underbrace{\left[ \frac{2}{I} \sum_{i=1}^{I} G(P_{gt... |
# date: 2021.03.29
# author: <NAME> (<EMAIL>)
# Modified by <NAME> (<EMAIL>)
import os
import json
import openml as oml
import cv2
import numpy as np
from PIL import ImageFont, ImageDraw, Image
from markdown import markdown
#####################################################################
'''
*** Function: write ... |
#!/usr/bin/python
VERSION = 0.92
#---------------------------------
# BAGEL: Bayesian Analysis of Gene EssentaLity for python 3
# (c) <NAME>, 02/2015.
# modified 12/2019 for random seed option
# Free to modify and redistribute with attribtuion
#---------------------------------
from numpy import *
import scipy.st... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2006-2009 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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; e... |
import concurrent.futures
import logging
import socket
from typing import Dict, List, Tuple
import requests
from django.core.exceptions import ImproperlyConfigured
from eth_tester import EthereumTester
from requests.exceptions import ConnectionError
from web3 import HTTPProvider, IPCProvider, Web3
from web3.exceptions... |
"""
Authors: <NAME>, <NAME>.
Copyright:
Copyright (c) 2020 Microsoft Research
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, ... |
from sklearn import metrics, logger
from keras.datasets import imdb
from six import StringIO
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.tree import DecisionTreeClassifier
from nltk.tokenize import TweetTokenizer, word_tokenize
from nltk.util import ngrams
from nltk.corpus import stopwords
... |
#
# BSD 3-Clause License
#
# Copyright (c) 2020, <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... |
# -*- coding: utf-8 -*-
"""
Functions for generating QC images and an HTML report for outputs from the
ANTs longitudinal cortical thickness pipeline
"""
import argparse
import os
import pathlib
import re
import jinja2
import nibabel as nib
from niworkflows.viz.utils import (compose_view, plot_segs,
... |
import random
import string
import csv
import csvdiff3.merge3
from csvdiff3.output import *
# Define a custom Random class which:
#
# * Always starts with a specified seed
# * Provides the random string/choice methods we use to determine
# behaviour of the random file streams
class Random(random.Random):
def __... |
import os
from tqdm import tqdm, trange
from torch.utils.data import Dataset
import random
from io import open
import pickle
from pathlib import Path
import multiprocessing
from multiprocessing import Pool
import time
import torch
import logging
logger = logging.getLogger(__name__)
import numpy as np
import shutil
_C... |
#******************************************************************************
# (C) 2008-2013 Ableton AG
#******************************************************************************
from io import StringIO
import errno
import tempfile
import time
import stat
from unittest import TestCase
from abl.util import L... |
__author__="JeremyNelson, <NAME>"
import argparse
import datetime
import requests
import rdflib
import json
from elasticsearch import Elasticsearch
from elasticsearch import helpers
from sparql.general import*
from sparql.languages import workflow as languages
from sparql.subjects import workflow as subjects
from spar... |
#!/usr/bin/python3
from src.AccuracyCalculator import *
import tensorflow as tf
import time
import numpy as np
import settings.DataSettings as dataSettings
# maxCount = 8
netPrediction_1 = np.array( [[ [0.9, 0.1], [0.7, 0.3], [0.6, 0.4], [0.4, 0.6], [0.3, 0.7],
[0.2, 0.8], [0.1, 0.9], [0.2, 0.8], [0.1, 0.9], [0... |
import os
import re
import json
import stat
import glob
from pathlib import Path
import jinja2
from git import Repo
from git.exc import NoSuchPathError
from git.exc import InvalidGitRepositoryError
import hypergol
from hypergol import DatasetFactory
from hypergol import RepoData
from hypergol.utils import Mode
from h... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 3 19:01:13 2017
@author: sebalander
"""
# %%
import numpy as np
# %%
N = int(5e1) # number of data, degrees of freedom
M = int(1e5) # number of realisations
P = 2 # size of matrices
mu = np.array([7, 10]) # mean of data
c = np.array([[5, 3],... |
import csv
import math
import os
import sys
from itertools import islice
from os import path
import numpy as np
import tensorflow as tf
from PIL import Image
TRAINING_SHARDS = 60
VALIDATION_SHARDS = 30
TRAIN_DIRECTORY = 'train'
VALIDATION_DIRECTORY = 'validation'
# List of folders for training, validation and test.
... |
"""
Library of functions to compute entropy of words after fixating on a certain position.
The fixation model used is McConkie et al. 1989
Used in Alhama et al. 2019 (cogsci proceedings); see archival folder "cogsci" for frozen files and computations.
"""
__author__ = '<NAME>'
import sys, os, inspect
fro... |
import sys
import click
# import re
import os
# import fnmatch
from .gpm import GPM
from . import version, APPLICATIONS, EXPORT_URL
from .helpers import generate_samples, write_file_run_bcl2fastq, write_file_run_cellranger_mkfastq, copyfromdata, show_tree, move_igv, tar_exports, export_empty_folder
# from pathlib impor... |
# -*- coding: utf-8 -*-
import argparse
import ipaddress
import logging
import random
import requests
import textwrap
from bs4 import BeautifulSoup
from cliff.command import Command
from cliff.lister import Lister
from psec.utils import get_output
from psec.utils import get_netblock
logger = logging.getLogger(__nam... |
import os
import pymongo
import sys
import argparse
import requests
import json
import time, datetime, threading
from requests.auth import HTTPBasicAuth
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from socialcar.utils import generate_custom_objectid, str_to_oid, oid_to_str
MONGO_HOST = os.e... |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
from tqdm import tnrange, tqdm_notebook
import collections
import math
import numpy as np
from collections import defaultdict
import threading
import networkx as nx
import pandas as pd
import operator
def graph_dict():
'''
We first choose to use a dictionary f... |
import web3
import web3.contract
from lib import w3
from ChunkedFilesValidator import VALIDATOR_ABI, VALIDATOR_SOL
import math
from Crypto.Hash import keccak
import os
import pickle
import random
class Solver:
CHUNK_SIZE = 10
@staticmethod
def init_validator(address):
ValidatorCon... |
# -*- coding: utf-8 -*-
from flask import Flask, request, render_template, jsonify, redirect, url_for
from flask_cors import CORS
import os
import json
from datetime import datetime
import uuid
import morph
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from flask_marshmallow.fields i... |
"""
The main test program for quality assurance in randomgen
"""
from collections import defaultdict
import itertools
import json
from multiprocessing import Manager
import os
import random
import time
from configuration import (
ALL_BIT_GENS,
DEFAULT_ENTOPY,
DSFMT_WRAPPER,
JUMPABLE,
OUTPUT,
SP... |
import argparse
import os
import shutil
import subprocess as sp
import re
try:
import ast_utils as au
except Exception:
from . import ast_utils as au
from time import time
from tqdm import tqdm
builtin = set([
'int', 'char', 'long', 'short', 'float', 'double'
])
line_pattern = re.c... |
"""Target for Intel ISPC."""
from __future__ import division, absolute_import
__copyright__ = "Copyright (C) 2015 <NAME>"
__license__ = """
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 withou... |
#
# Copyright 2022 DMetaSoul
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
"""
Copyright (c) 2019 <NAME> (<EMAIL>), <NAME>, <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, pu... |
from __future__ import absolute_import
from collections import OrderedDict
import logging
log = logging.getLogger(__name__)
class IssueLabel(object):
def __init__(self, label):
self.label = label
def remove(self, pull_request):
try:
pull_request.remove_label(self.label)
... |
"""Understand the hierarchy of classes in the symbol table as an ontology."""
from typing import (
Sequence,
Optional,
Set,
Final,
Mapping,
MutableMapping,
List,
cast,
Tuple,
)
import sortedcontainers
from icontract import require, ensure
from aas_core_codegen import parse
from aas... |
# ============================================================================
# Copyright (c) 2007 <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, inc... |
import scrapelib
import datetime
import os
import re
from collections import defaultdict
from billy.scrape import ScrapeError
from billy.scrape.bills import BillScraper, Bill
from billy.scrape.votes import Vote
from billy.scrape.utils import convert_pdf
import lxml.html
def action_type(action):
# http://www.scs... |
from pioneer.common.linalg import fit_cubic
from pioneer.common.types.calibration import SaturationCalibration
from enum import Enum
from scipy.signal import convolve2d
from typing import List
import numpy as np
class TraceProcessing():
def __init__(self, priority:int=0):
self.priority = priority
d... |
#!/usr/bin/env python
""" LBR iiwa poke an object tracked by RealSense D435
Depend on:
roslaunch iiwa_gazebo iiwa_gazebo_with_sunrise.launch (tf defined in 'iiwa_gazebo' package)
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import os
import time
import ... |
# Copyright (C) [2022] by Cambricon, Inc.
#
# 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, publish... |
import re
from datetime import date
from random import randint
from time import sleep
import requests
TELEGRAM_BOT_ID = 'Insert here your telegram bot ID'
LUIS_APP_KEY = 'Insert here your LUIS application key'
LUIS_SUBSCRIPTION_KEY = 'Insert here subscription key for your application'
YANDEX_WEATHER_API_KEY = 'Inse... |
import pytest
from fancy_dict import FancyDict
from fancy_dict.errors import NoMergeMethodApplies
from fancy_dict.merger import MergeMethod, add
from fancy_dict.annotations import Annotations
def fancy_dict_with_merge_methods(*methods, extend=False):
base = FancyDict.MERGE_METHODS if extend else ()
class _F... |
# roulette
import random
import time
a = 0
bet = 0
bet2 = 0
bet3 = 0
bet4 = 0
bet2a = 0
bet3a = 0
bet4a = 0
list1 = []
blacknumbers = [1, 3, 5, 7, 9, 12, 14, 16, 18, 21, 23, 25, 27, 30, 32, 34, 36]
rednumbers = [2, 4, 6, 8, 10, 11, 13, 15, 17, 20, 22, 24, 26, 28, 29, 31, 33, 35]
nspin = 0
bankbalance = 2... |
#!/usr/bin/env python
# coding=utf-8
'''
Waterbug
Waterbug is a command-line tool for accessing water-usage data from
San Francisco Public Utilities Commission. By default, the script returns
the most recent ten days of usage. Default output is text to the terminal.
Use the '-g' flag to output a termgraph like the ... |
#! -*- coding:utf-8 -*-
# 三元组抽取任务,tplinker, cat方式实体部分收敛较快,关系部分收敛较慢
# 官方链接:https://github.com/131250208/TPlinker-joint-extraction
# 数据集:http://ai.baidu.com/broad/download?dataset=sked
import json
from bert4torch.tokenizers import Tokenizer
from bert4torch.models import build_transformer_model, BaseModel
from bert4torch... |
import numpy as np
import open3d as o3d
import os
import trimesh
from bricks_modeling.bricks.bricktemplate import BrickTemplate
from bricks_modeling.connections.connpoint import CPoint
from bricks_modeling.connections.conn_type import compute_conn_type
from bricks_modeling.database.ldraw_colors import color_phraser
imp... |
import sys
import cv2
import numpy as np
#####################################
# #
# Contour analysis and shape matching ######
#####################################
# Extract reference contour from the image
def get_ref_contour(img):... |
"""
This module implements the core classes of the social planning search problem:
* User: a user of the program
* Party: a group of users planning to go out together.
It also implements the similarity function, which generates successors to a
given plan by striving for a diversity of options.
"""
import config # mak... |
import os
import os.path
import sys
import torch
import torch.utils.data as data
import cv2
import random
import numpy as np
cv2.setNumThreads(0)
class WiderFaceDetection(data.Dataset):
def __init__(self, txt_path, own_txt_path, pattern, preproc=None):
self.preproc = preproc
self.imgs_path = []
... |
from __future__ import print_function
import math
from .base_pair_types import BasePairType, setup_base_pair_type, get_base_pair_types_for_tag, get_base_pair_type_for_tag
from .util.constants import KT_IN_KCAL
from .motif_types import MotifType, get_motif_type_for_tag, make_motif_type_tag, parse_motif_type_tag, check_e... |
"""
Divergence metric between two scores based on size of subgraph isomorphism. If
two DAGs are the exact same, the subgraph isomorphism will be of maximum size
and node divergence and edge divergence will be zero.
"""
import sys
import os
import json
import argparse
import numpy as np
import networkx as nx
def ge... |
import numpy as np
import pytest
from numpy.testing import assert_almost_equal as aae
from spectra import SticksSpectrum
def setup():
pass
def teardown():
pass
def test_init():
energies, intensities = np.arange(10), np.arange(10)
s1 = SticksSpectrum("Hello World", energies, intensities, units="ms... |
#!/usr/bin/env python3
# ----------------------------------------------------------------------------
# Copyright 2019 Drunella
#
# 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:/... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\gsi_handlers\interaction_archive_handlers.py
# Compiled at: 2020-04-14 19:43:42
# Size of source mod... |
from sys import argv
from random import random, sample
from math import exp, pi, sqrt
from numpy.random import chisquare, normal
__extra_productions = 2
__number_non_terminals = 0
__terminal_ratios = 0.0
__productions_length = 1
__tree_depth = 0
def generate_grammar(number_non_terminals = None,
extra_... |
# -*- coding: utf-8 -*-
# Copyright © tandemdude 2021-present
from __future__ import annotations
__all__ = [
"Implements",
"Checks",
"ErrorHandler",
"Aliases",
"Guilds",
"Subcommands",
"Parser",
"CooldownManager",
"HelpGetter",
"AutoDefer",
"Ephemeral",
"CheckExempt",
... |
import numpy as np
import copy
import cv2
from parameter import *
class BoundBox:
def __init__(self, class_num):
self.x, self.y, self.w, self.h, self.c = 0., 0., 0., 0., 0.
self.probs = np.zeros((class_num,))
def iou(self, box):
intersection = self.intersect(box)
union = self.w... |
# -*- coding: utf-8 -*-
# Zinc Grid dumper
# See the accompanying LICENSE Apache V2.0 file.
# (C) 2018 VRT Systems
# (C) 2021 Engie Digital
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
"""
Save a `Grid` in Zinc file, conform with the specification describe
here (https://www.project-haystack.org/doc/Zinc)
"""
from __futur... |
from __future__ import print_function
from syllable import ESyl
from syllable import TSyl
from syllable import syllable_split
import utility
map_onset = utility.load_dict('dict_onset_v01')
map_nucleus = utility.load_dict('dict_nucleus_v01')
map_coda = utility.load_dict('dict_coda_v01')
map_rules = []
vowel = 'aeuio'
... |
import decimal
import json
import cloudinary
import cloudinary.uploader
import environ
import requests
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.exceptions import ValidationError
from... |
import string
import argparse
import cv2
import torch
import torch.backends.cudnn as cudnn
import torch.utils.data
import torch.nn.functional as F
import time
from utils import CTCLabelConverter, AttnLabelConverter
from dataset import RawDataset, AlignCollate
from model import Model
from collections import OrderedDict
... |
from curses import endwin
import math
from typing import List
from pyhcl.ir.low_ir import *
from pyhcl.passes.wir import DuplexFlow, Flow, SinkFlow, SourceFlow, UnknownFlow
from pyhcl.passes._pass import PassException
# CheckForm utils
class ModuleGraph:
nodes: Dict[str, set] = {}
def add(self, parent: s... |
# 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 python3
__title__ = 'Script to add hosts to a Host Group based on IP'
__version__ = '2.0'
__author__ = '<EMAIL>'
__copyright__ = 'Vectra AI, Inc.'
__status__ = 'Production'
'''
Opens a list of IPs or subnets formatted one per line, collects Cognito hosts with those IPs, adds the hosts
in turn to the gr... |
# Source : https://github.com/GuessWhatGame/generic/tree/master/data_provider
import os
from PIL import Image
import numpy as np
import h5py
from data_provider.image_preprocessors import resize_image, scaled_crop_and_pad
# Why doing an image builder/loader?
# Well, there are two reasons:
# - first you want to abstr... |
from matplotlib.path import Path
import pytz
from datetime import datetime
from dateutil.parser import parse
from dateutil.utils import default_tzinfo
from dateutil import tz
import numpy as np
from scipy import interpolate
from scipy.io import loadmat
DATETIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
JAN_FIRST = datetime(2000,... |
"""
cfg_helper.py
Utility to help with determining colstarts, rowstarts, color_order and inversion settings for
for a display.
Set the `HEIGHT` and `WIDTH` constants to the physical size of your display or use the {Cc} keys
to set the number of columns and the {Rr} keys to set the number of rows for y... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
from cStringIO import StringIO
import posixpath
import traceback
from zipfile import ZipFile
import appengine_blobstore as blobst... |
from django.contrib import messages
import re
from prplatform.users.models import StudentGroup
from prplatform.submissions.models import Answer
from prplatform.exercises.models import ReviewExercise
def handle_group_file(request, ctx, form):
cd = form.cleaned_data
try:
contents = cd['group_file'].rea... |
# Classes for image and mask manipulation.
import os
import re
import glob
import cv2
import torch
import models
import numpy as np
from parser import Annotation
class Mask:
def __init__(self, height, width, boxes):
# Image dimensions.
self.height = height
self.width = width
# B... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from modules.conv_tbc import ConvTBC
from data_iterator import dataIterator
import torch.utils.data as data
import numpy as np
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def CausalConv1d(in_channels, out_channels, kerne... |
import numpy as np
black_list = [106, 114, 117, 120, 12, 130, 134, 136, 138, 142, 153, 158, 170, 174, 20, 26, 2, 33, 40, 41, 42, 43, 44, 54, 58, 5, 63, 65, 6, 74, 86, 89, 94, 98]
black_list = list(map(lambda x: "query_{}".format(x), black_list))
def compute_overhead(suffix, metric=4):
def predicate(df):
... |
"""
clone
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
import numpy
from mcedit2.command import SimpleRevisionCommand
from mcedit2.editortools import EditorTool
from mcedit2.imports import PendingImportNode, PendingImport
from mcedit2.rendering.scenegraph i... |
#!/usr/bin/env python
# Copyright (C) 2018 The University of Leeds.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... |
# -*- coding: utf-8 -*-
# Copyright (c) 2018 the Pockets team, see AUTHORS.
# Licensed under the BSD License, see LICENSE for details.
"""A pocket full of useful string manipulation tools!"""
from __future__ import absolute_import, print_function
import re
import six
from pockets.collections import is_listy, listi... |
import time
import torch.nn.parallel
import torch.optim
from ops.models import TSN
from ops.transforms import *
from tools.metric import ConfusionMatrix
from opts import parser
args = parser.parse_args()
if args.dataset == 'drive':
from ops.drive_dataset_with_keypoint import Drive as dataset
elif args.dataset =... |
import streamlit as st
import pandas as pd
import numpy as np
from datetime import datetime
import folium
from streamlit_folium import folium_static
from folium.plugins import MarkerCluster
import plotly.express as px
st.set_page_config(layout='wide')
st.title('House Rocket Company')
st.markdown('Welcome to House Rock... |
import torch
from torch import nn
import gym
from gym.spaces import Box, Discrete, Space
from copy import copy, deepcopy
import numpy as np
from typing import Optional, Union, Iterable, List, Dict, Tuple, Any
from numbers import Real, Integral
from .runningstat import RunningStat
from .misc import (
fill_parameters... |
#!/usr/bin/env python3
########################
#Author: <NAME>
#Copyright 2016
######################
import argparse
import isce
import isceobj
import os
import gdal
import xml.etree.ElementTree as ET
def createParser():
'''
Create command line parser.
'''
parser = argparse.ArgumentParser( descripti... |
#!/usr/bin/env python3
import unittest
import shutil # rmtree, copy
import os # chdir, listdir, makedirs, path, remove
from subprocess import run, PIPE
if __name__ == '__main__':
import sys
sys.path[0] = os.path.dirname(sys.path[0])
from icnsutil import RawData, PIL_ENABLED, __version__
def main():
# en... |
import numpy as np
import tensorflow as tf
from read_data import DataSet
from mytensorflow import padded_reshape
def argmax(x):
return np.unravel_index(x.argmax(), x.shape)
class Evaluation(object):
def __init__(self, data_type, global_step, idxs, yp, tensor_dict=None):
self.data_type = data_type
... |
import datetime
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from time import *
from pandas.plotting import scatter_matrix
# def Scatter plot matrix画图:矩阵图:
def matrixplot(df1):
plt.rcParams["font.sans-serif"] = ["SimHei"] # 用来正常显示中文标签
plt.rcParams["axes.unicode_minus"] = Fa... |
"""
TODO:
Translation, Derivatives, and Subdevatives
Translating polynumbers and the Derivative | Arithmetic and Geometry Math Foundations 69 | https://www.youtube.com/watch?v=vyRFz8J4Y_M&list=PL5A714C94D40392AB&index=72
L_beta(p) = p(beta + alpha) = p(alpha + beta)
"""
import numpy as np
import fractions
im... |
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 18 14:19:48 2022
@author: <NAME>
"""
import warnings
import pdb
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import numpy as np
import tensorflow as tf
from keras.models import Model
from keras.layers import Input, c... |
"""
"""
from cddm.map import k_indexmap, rfft2_grid
from cddm.fft import rfft2_crop
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
#diffusion constant
from examples.paper.one_component.conf import D, DATA_PATH, KIMAX, KJMAX
from examples.paper.one_component.conf import *
fr... |
#!/usr/bin/env python2
import os
import argparse
import numpy as np
from matplotlib import rc
import matplotlib.pyplot as plt
from colorama import init, Fore
from PIL import Image
import yaml
init(autoreset=True)
rc('font', **{'serif': ['Cardo'], 'size': 25})
rc('text', usetex=True)
def _xyToRGB(u, v):
ang = ... |
# coding: utf-8
import logging
from enum import IntEnum, auto
from PyQt5 import uic
from PyQt5.QtCore import (QAbstractTableModel, QModelIndex, Qt)
from PyQt5.QtWidgets import (QHeaderView,
QDataWidgetMapper)
from mhw_armor_edit.assets import Assets
from mhw_armor_edit.editor.models impor... |
"""Chromosome diagram drawing functions.
This uses and abuses Biopython's BasicChromosome module. It depends on
ReportLab, too, so we isolate this functionality here so that the rest of CNVkit
will run without it. (And also to keep the codebase tidy.)
"""
import collections
import math
import warnings
from Bio.Graphi... |
import numpy as np
import pytest
from chainer_chemistry.dataset.preprocessors import wle as WLE # NOQA
from chainer_chemistry.datasets.numpy_tuple_dataset import NumpyTupleDataset
@pytest.fixture
def small_datasets():
N_1 = 3
N_2 = 5
# one-hot atom labels: 1 tp N
atom_array_1 = np.aran... |
import asyncio
import curses
import traceback
from pynput import keyboard
from client.appstate import AppState
from client.websocket import GameEventEmitter
from game.engine import Engine
from game.entities.ball import Ball
from game.entities.entity_type import EntityType
from game.entities.player import P... |
# -*- coding: utf-8 -*-
from copy import deepcopy
try:
# py >= 3.3
from unittest.mock import patch
except ImportError:
# py < 3.3
from mock import patch
import numpy as np
import pytest
from pygam import *
from pygam.utils import check_X, check_y, check_X_y, sig_code, check_iterable_depth
# TODO ch... |
from __future__ import annotations
import re
import warnings
from typing import TYPE_CHECKING, Any, Dict, List, Optional
import pandas as pd
from dateutil import parser
from cimsparql.query_support import combine_statements, unionize
if TYPE_CHECKING: # pragma: no cover
from cimsparql.model import CimModel
as... |
from ..css_matcher import scan, split_value, TokenType
from .utils import push_range, SelectItemModel
class CSSSection:
__slots__ = ('start', 'end', 'body_start', 'body_end', 'properties')
def __init__(self, start: int, end: int, body_start: int, body_end: int, properties: list=None):
self.start = sta... |
# ==============================================================================
# Copyright (c) 2018, Yamagishi Laboratory, National Institute of Informatics
# Author: <NAME> (<EMAIL>)
# All rights reserved.
# ==============================================================================
""" """
import os, sys
from ... |
'''
<NAME>
Author: <NAME>
This contains code to read data from the SQL database, and put it in figures
'''
#import pandas as pd
import numpy as np
from numpy import random
import matplotlib.pyplot as plt
#import scipy
#import sklearn
import time
#import sys
#import re
import sqlite3 as lite
#Note: SQL has the followi... |
# Copyright 2017 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
import argparse
import myvariant
import itertools
import pandas as pd
import numpy as np
import os
import time
from multiprocessing import Process, Manager, cpu_count
def merge_files(output, file_locs, debug):
print("\nmerge myvariant info annotations to "+output)
files = os.listdir(file_locs)
keep_columns... |
# MIT License
#
# Copyright (C) 2018 <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,
# publi... |
#!/usr/bin/env python3
import sys
import doctest
import utilities as util
pylevenshtein = __import__('Levenshtein')
"""TODO add title"""
""" CONSTANTS """
BAD_WORD_LIST_FILEPATH = 'data/bad_words_cmu.txt' #TODO switch to the master and combine the bad word files
LEETSPEAK_TO_ENGLISH_DICT = {'0':'o',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.