text stringlengths 3.07k 22.1k |
|---|
from __future__ import absolute_import, division, print_function
from cctbx.development import random_structure
from cctbx.sgtbx import space_group_info
import boost.python
from six.moves import range
ext = boost.python.import_ext("cctbx_asymmetric_map_ext")
from cctbx_asymmetric_map_ext import *
from cctbx.array_famil... |
# File: R (Python 2.4)
from pandac.PandaModules import Vec3, Vec4, Point3
class VariableContainer:
def __init__(self):
pass
AI = VariableContainer()
AI.goldRewardRange = (15, 35)
AI.goldRewardMultiplier = [
(14.0, 3.0),
(18.0, 2.5),
(24.0, 2.0),
(36.0, 1.6000000000000001),
(52.0... |
# Author: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# License: BSD 3 clause
from __future__ import print_function
# private tools
import sys
sys.path.append("..")
from tools.handledata import load_data
from sklearn.decomposition import TruncatedSVD
from sklearn.feature_extraction.text import TfidfVectorizer
from ... |
"""Metadata and associated objects"""
from csv import DictReader, DictWriter
from html.parser import HTMLParser
from io import IOBase
from itertools import groupby, zip_longest
from json import (
dump as json_dump,
dumps as json_dumps,
load as json_load,
loads as json_loads
)
from logging import getLog... |
# -*- coding: utf-8 -*-
"""No Proxy
===============
The :mod:`darc.proxy.null` module contains the auxiliary functions
around managing and processing normal websites with no proxy.
"""
import gzip
import io
import json
import os
from typing import TYPE_CHECKING
import bs4
import requests
from darc._compat import R... |
import tensorflow as tf
import numpy as np
class ConvNetMixin(object):
def _conv_layer_with_relu(self, bottom, filter_size, filter_num, scope_name, bottom_channel=None, padding='SAME'):
out = self._conv_layer(bottom, filter_size, filter_num, scope_name, bottom_channel, padding)
with tf.variable_scope(scope_... |
import math
import torch
import torch.nn as nn
from pytracking import TensorList
from ltr.models.layers import activation
class GNSteepestDescent(nn.Module):
"""General module for steepest descent based meta learning."""
def __init__(self, residual_module, num_iter=1, compute_losses=False, detach_length=float... |
import time
from options.test_options import TestOptions
from data.custom_dataset_data_loader import Multitask_DatasetDataLoader
from models.models import ModelsFactory
from collections import OrderedDict
import os
import numpy as np
import torch
from sklearn.metrics import f1_score
from PATH import PATH
import pandas ... |
"Test autocomplete, coverage 87%."
import unittest
from unittest.mock import Mock, patch
from test.support import requires
from tkinter import Tk, Text
import os
import __main__
import idlelib.autocomplete as ac
import idlelib.autocomplete_w as acw
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.m... |
import numpy as np
class BaseBuffer(object):
def __init__(self, buffer_size, obs_dim, action_dim, n_envs=1):
super(BaseBuffer, self).__init__()
self.buffer_size = buffer_size
self.obs_dim = obs_dim
self.action_dim = action_dim
self.pos = 0
self.full = False
... |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2015,2016
import sys
import uuid
import json
import inspect
import pickle
try:
import dill
dill.settings['recurse'] = True
except ImportError:
dill = pickle
import types
import base64
import streamsx.topology.dependency
import streamsx.topology... |
# -*- coding: utf-8 -*-
"""
Classes to build submission scripts.
"""
import os as _os
import sys as _sys
import inspect as _inspect
import cloudpickle as _pickle
###############################################################################
# Import Ourself ... |
#!/usr/bin/env python3
import locale
import os
import re
import subprocess
import sys
import click
# List of services not to restart automatically
NO_AUTORESTART = {"dbus.service": "reboot required",
"systemd-logind.service": "will log all users out"}
FILE_BLACKLIST = []
EXT_BLACKLIST = [".cache", ".gresour... |
from ._integrand import Integrand
from . import Keister, CustomFun
from ..stopping_criterion import CubQMCNetG
from ..util import ParameterError
from ..true_measure import Uniform
from ..discrete_distribution import DigitalNetB2
from numpy import *
class SobolIndices(Integrand):
"""
Sobol' Indicies in QMCPy. ... |
import tensorflow as tf
def compute_sym_blk_tridiag(AA, BB, iia=None, iib=None):
"""
Symbolically compute block tridiagonal terms of the inverse of a
*symmetric* block tridiagonal matrix.
All input & output assumed to be stacked theano tensors.
Note that the function expects the off-diagonal bloc... |
import warnings
import numpy as np
import scipy.optimize as optim
from scipy.interpolate import InterpolatedUnivariateSpline
def numerical_diff(fn, x, dx=1e-6):
return (fn(x + dx) - fn(x - dx)) / (2.0 * dx)
def numerical_jacobian(fn, parameter_vector, dx=1e-6):
finite_difference_jacobian = np.zeros((len(par... |
from typing import Dict, Any
import os
import json
CONFIG_LOCATION = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, "data", "path_config.json"))
with open(CONFIG_LOCATION) as _json_file:
CONFIG = json.load(_json_file)
os.environ["OMP_NUM_THREADS"] = "1"
import logging
from collections import defau... |
import os
import numpy as np
import torch
import torchvision
from torch import nn, optim
from torch.utils.data.sampler import SequentialSampler, SubsetRandomSampler
from common import train, test, save_state, save_data, draw_line_graph, draw_multi_lines_graph
# model
class MnistClassifierSigmoid(nn.Modu... |
import numpy as np
import pandas as pd
import datetime
def create_user_df(usage_df): # 유저 목록 생성
user_df = usage_df[["user_id"]].drop_duplicates()
user_df.reset_index(inplace = True)
del user_df["index"]
return user_df
def analyze_usage_date(user_df, usage_df):
grouped = usage_df[["user_id", "ba... |
"""Data structures for holding geometry data."""
from collections.abc import Sized
from typing import Any, Dict, Iterable, Iterator, Optional, Sequence, Tuple, Union
from pwproc.geometry.util import Basis, Species, Tau
# TODO: validate data fields more consistently (consider `ensure` package; descriptor interface
# ... |
'''Split It!: Reformat spreadsheet of inventory results from Caltech.tind.io
Authors
-------
<NAME> <<EMAIL>> -- Caltech Library
Copyright
---------
Copyright (c) 2019 by the California Institute of Technology. This code is
open-source software released under a 3-clause BSD license. Please see the
file "LICENSE" ... |
# Generate a nautilus shell from triangles
# This method is based in the one described in Origami4
# "Paper Nautili: A Model for Three Dimensional Planispiral Growth"
# by <NAME>
# Starting with a right triangle ABC where A is the origin,
# B is up and C is to the side. The goal is to calculate
# the next triangle BD... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# A simplified Word2Vec implementation in Tensorflow
import tensorflow as tf
import nltk
import math
import os
import time
import numpy as np
from collections import defaultdict
from tensorflow.contrib.tensorboard.plugins import projector
def ensure_dir(f):
if not ... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#
# Released under t... |
""" Server IO
This module is basically a high level interface to the central server.
The module contains three communication classes: 1) The
NodeClient provides an interface from the Node to the central
server, 2) The UserClient provides an interface for users/
researchers and finally 3) The ContainerClient which pro... |
# Copyright 2020 Makani Technologies 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 agreed to... |
from __future__ import print_function
from optparse import OptionParser
import sys
import motmot.FlyMovieFormat.FlyMovieFormat as FMF
import numpy
import fcntl, os
import time
if 1:
import signal
# Restore the default SIGPIPE handler (Python sets a handler to
# raise an exception).
signal.signal(signa... |
from dpn_pyutils.exceptions import FileOperationError
import pytest
import datetime as dt
from pathlib import Path
from colorama import Fore
from dpn_pyutils import cli
from dpn_pyutils import crypto
from dpn_pyutils import common
from dpn_pyutils import file
from dpn_pyutils import money
#
# Module tests: cli
#
d... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Estimate joint feature vector of the speaker pair using GMM
"""
import argparse
import os
import sys
from sprocket.model.GMM import GMMConvertor, GMMTrainer
from sprocket.util import HDF5, estimate_twf, melcd
from sprocket.util import static_delta, align_data
fro... |
from abc import ABC, abstractmethod
import tqdm
import autograd.numpy as np
from scipy.stats import t as tdist
from viabel.approximations import MFGaussian
__all__ = [
'Optimizer',
'StochasticGradientOptimizer',
'RMSProp',
'AdaGrad',
'SASA'
]
class Optimizer(ABC):
"""An abstract class for op... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
# -------------------------------------------------------------------
import cv2
import numpy as np
import time
from enum import Enum
# =============================================================================
# Ref. design
# https://github.com/Xilinx/Vitis-AI/blob/v1.1/mpsoc/vitis_ai_dnndk_samples/tf_yolov3_voc_p... |
import numpy as np
import cv2
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
import zipfile
import pafy
from collections import defaultdict
from io import StringIO
from matplotlib import pyplot as plt
from PIL import Image
import random
import time
sys.path.append("..")
fr... |
"""
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
This script takes a list of GeoTIFFs containing per-pixel poultry barn predictions and
performs the following steps on each:
- Groups sets of contiguous predicted positive pixels into polygons
- For each predicted polygon, c... |
import pandas as pd
import numpy as np
import utils.config as conf
from multiprocessing import Queue
from typing import Union, io
from sklearn.metrics import roc_curve
from sklearn.utils import resample
from tensorflow.keras import models
from tensorflow.keras.preprocessing.image import Iterator
from tensorflow.kera... |
import os
import shutil
from copy import deepcopy
from download import download
from .downloader import git_download
from .util import file_md5
from .vba_renaming import NameTransformer, cls_renaming_dict, do_renaming, bas_create_namespaced_classes, \
vba_module_name, write_tokens
import inspect
from typing impor... |
import os
import pandas as pd
import numpy as np
import pytest
from resqpy.well.well_object_funcs import add_wells_from_ascii_file, well_name, add_blocked_wells_from_wellspec, add_logs_from_cellio, lookup_from_cellio
import resqpy.well
from resqpy.grid import RegularGrid
def test_add_wells_from_ascii_file(example_mo... |
import gym
from gym import spaces
import numpy as np
import random
import Image, ImageDraw, ImageColor
import cv2
xmax = 8; ymax = 8
PIXELS_PER_INDEX = 4
noise=True
class BlockWalkerEnv(gym.Env):
metadata = {'render.modes': ['human', 'training']}
action_space = spaces.Discrete(4)
observation_space = spac... |
import time
import tqdm
from torch.utils.tensorboard import SummaryWriter
from typing import Dict, List, Union, Callable, Optional
from Collect import MyCollector
from tianshou.policy import BasePolicy
from tianshou.utils import tqdm_config, MovAvg
from Utils import test_episode, gather_info
def total_class... |
# -*- coding: utf-8 -*-
"""
Copyright [2009-2017] EMBL-European Bioinformatics Institute
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... |
#!/usr/bin/env python3
# encoding: utf-8
import json
import os
class _JsonRegisterClass():
def __init__(self, name_zydis, name_editor, description, groups):
self.name_zydis = name_zydis
self.name_editor = name_editor
self.description = description
self.groups = list(map(lambda x: ... |
from pathhack import pkg_path
import os
import pickle
import numpy as np
from os.path import join
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.patches as patches
from matplotlib.animation import FuncAnimation
plt.rc('xtick', labelsize=15)
pl... |
"""
JbossDomainServerLog - file ``$JBOSS_SERVER_LOG_DIR/server.log*``
=================================================================
Parser for the JBoss Domain Server Log File.
"""
from .. import LogFileOutput, parser
import re
from datetime import time
from insights.specs import Specs
class JbossDomainLog(LogF... |
__author__ = 'Will@PCVG'
# an implementation based on "lizhengwei1992"'s DeepLabV3+ pytorch version
# Utils used with tensorflow implemetation
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import copy
import functools
from ops_dup import *
import tensor... |
#!/usr/bin/python
# take a matching gtf to bedfile and adds annotations
import argparse
import os
import re
import subprocess as sp
from time import time
import warnings
from intervaltree import Interval, IntervalTree
import pandas as pd
from tqdm import tqdm
def load_bed(infile_path: str):
"""
Load and parse ... |
#!/usr/bin/env python
from __future__ import division, absolute_import, print_function
"""
Interpolate between colours in RGB space; make continuous colour maps.
Definition
----------
Calculates colour between two given colors in RGB space
def rgb_blend(col1, col2, fraction=0.5):
n interpolated colours between tw... |
import numpy as np
import pandas as pd
import random
import time
from sklearn.utils import shuffle
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import random
from torch.utils.data import DataLoader
from torch.nn.functional import relu,leaky_relu
from torch.nn import Lin... |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2022 Technische Universität Graz
#
# invenio-imoox is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Converter Module to facilitate conversion of metadata."""
from functools import wraps
de... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import asyncio
import base64
import os
import sys
from binascii import hexlify
from queue import Empty
from functools import partial
from traceback import format_tb
from tornado.ioloop import IOLoop
import zmq
from zmq.asyncio import Context
from .kernelbase import Kernel
from ipykernel.kernelapp import IPKernelApp... |
#!/usr/bin/env python3
# ---------------------------------------------------------------------------
# This software is in the public domain, furnished "as is", without technical
# support, and with no warranty, express or implied, as to its usefulness for
# any purpose.
#
# Author: <NAME> <<EMAIL>>
# ----------------... |
# Lint as: python3
#!/usr/bin/env python
# Copyright 2013 The CARFAC Authors. All Rights Reserved.
#
# This file is part of an implementation of Lyon's cochlear model:
# "Cascade of Asymmetric Resonators with Fast-Acting Compression"
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use... |
from sieve_common.common import *
import json
from pathlib import PurePath
from sieve_oracle.checker_common import *
from sieve_common.k8s_event import (
APIEventTypes,
SIEVE_API_EVENT_MARK,
parse_api_event,
extract_generate_name,
is_generated_random_name,
)
def masked_resource_key_for_state_updat... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, <NAME> <<EMAIL>>
# Copyright: (c) 2016, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADAT... |
from sklearn.model_selection import train_test_split
import numpy as np
import os, fnmatch
import random
# packages
from scipy.special import logsumexp
dataDir = '/u/cs401/A3/data/'
# dataDir = './subdata/'
class theta:
def __init__(self, name, M=8,d=13):
self.name = name
self.omega = np.zeros((... |
import argparse
import time
import os
import os.path as osp
os.environ["CUDA_VISIBLE_DEVICES"] = '7'
import torch
import torch.nn as nn
import torch.utils.data
import torch.backends.cudnn as cudnn
import torch.optim
from datetime import datetime
from tensorboardX import SummaryWriter
from progress.bar import Bar
fro... |
#benchmark_alpha.py
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.path as path
from matplotlib.animation import FuncAnimation
from timeit import default_timer as timer
def column(array, i):
return [row[i] for row in array]
#configuration
size = int(input("Nu... |
"""
Implementation of existing algorithms.
"""
from typing import List, Set, Union
from .stp import *
from . import bool_algebra as ba
import time
class GYQSolver:
"""
Guo, Yuqian, <NAME>, <NAME>, and <NAME>. "Set stability and set stabilization of Boolean control networks
based on invariant subsets." Au... |
# -*- coding: utf-8 -*-
import cv2
import os
import numpy as np
import sys
print("python version : {version}".format(version=sys.version))
'''
요구 사항
1. Image Load & Search in directory
- 현재 폴더 출력 : done
- 현재 폴더의 이미지 출력 (확장자는 확장성 있게) : done
- 현재 폴더의 이미지 개수 출력 : done
- 현재 폴더의 이미지에서 숫자를 입력하면, 해당 파일이 open되도... |
import sys
sys.path.append(".")
from query_representation.query import *
from evaluation.eval_fns import *
from cardinality_estimation.featurizer import *
from cardinality_estimation.algs import *
from cardinality_estimation.fcnn import FCNN
from cardinality_estimation.mscn import MSCN
import glob
import argparse
impo... |
import torch
import os
import numpy as np
from typing import List, Tuple, Any, Dict
import torchvision as tv
import torchvision.models as models
import configparser
import data_handle as dh
import torch.nn as nn
from collections import namedtuple
import torch.nn.functional as F
import torch.optim as optim
import Networ... |
import os
#os.environ['OPENBLAS_NUM_THREADS'] = '1'
import numpy as np
import os
import subprocess
import shutil
import bluepyopt as bpop
import struct
import time
import pandas as pd
import efel_ext
import time
import glob
import ctypes
import matplotlib.pyplot as plt
import bluepyopt.deapext.algorithms as algo
from ... |
#!/usr/bin/env python
"""taXaminer main script
Runs the pipeline by subsequently calling the submodules. Reads
path to raw config file, extracts and prepares information on this
basis and calls necessary processing steps.
Expects path to raw config file
"""
__author__ = "<NAME>"
__version__ = "0.6.0"
# package spe... |
#
# (C) Copyright <NAME> and <NAME> 2021, 2022.
#
# 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 derivative works ... |
import json
import urllib.request
import re
from bs4 import BeautifulSoup
from pprint import pprint
# 넥슨 메이플에서 캐릭터 정보 검색
# 개선 필요 . 현재 코드는 함수 세번 호출로 속도가 저하됨
def NexonMaple(MapleName):
# 넥슨 메이플스토리 랭킹 검색 페이지 URL
NexonMapleData_URL = "https://maplestory.nexon.com/Ranking/World/Total?c="
NexonMapleHome_URL = "h... |
#!BPY
"""
Name: 'Stanford PLY (*.ply)...'
Blender: 241
Group: 'Export'
Tooltip: 'Export active object to Stanford PLY format'
"""
import bpy
import Blender
from Blender import Mesh, Scene, Window, sys, Image, Draw
import BPyMesh
__author__ = "<NAME>"
__version__ = "0.93"
__bpydoc__ = """\
This script exports Stanfor... |
#!/usr/bin/env python3
import sys
import json
import csv
import regex # not re, because we need .captures()
def get_data(filename):
with open(filename, newline='') as fp:
for row in csv.DictReader(fp):
# Fix some inconsistent casing
if 'Supertype' in row:
row['SuperType'] = row.pop('Supertype')
if 'Su... |
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ObjectDoesNotExist
from django.db.models import Q
from django.http import HttpResponseRedirect, HttpResponseFo... |
# -*- coding:utf-8 -*-
"""
File Name: base_net.py
Description : res18+unet的基网络部分
Author : royce.mao
date: 2019/05/06
"""
import torch
from torch import nn
class BasicBlock(nn.Module):
"""
resnet基础block;包含两层卷积(conv-relu-bn)
"""
def __init__(self, in_channels, out_cha... |
"""Module providing various functions for advanced handling of pandas dataframes."""
import re
from typing import Callable, Optional, Sequence, Union
import numpy as np
import pandas as pd
from biopsykit.utils._datatype_validation_helper import _assert_has_columns, _assert_has_index_levels, _assert_is_dtype
from biop... |
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# TODO(littlecvr): return different format specified by "request_format"
# variable.
import os
from django.http import StreamingHttpRes... |
import os
import json
import click
import pkg_resources
from ugetcli.uget import UGetCli
# Helper method for a command and pre-load value from the config file
def _create_command_class(config_option_key, config_path_option_key):
"""Creates click.Command subclass that overrides values from config file at the provi... |
import warnings
from typing import Union
import re
import pandas as pd
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.compose import ColumnTransformer, make_column_selector
from sklearn import metrics
from feature_engine.imputation import (
CategoricalImputer,
AddMissingIndicator,
Mea... |
import os
import numpy as np
import argparse
import random
import tensorflow as tf
import pickle
from models.model_MC import MOE
from utils.processData_moe import getData_OvA, getData_nway
parser = argparse.ArgumentParser()
parser.add_argument('data_path', metavar='DATA',
help='path to data')
parser.add_argument(... |
""" Interface to other subsystems
- Data validation
- Operations on projects
- are NOT handlers, therefore do not return web.Response
- return data and successful HTTP responses (or raise them)
- upon failure raise errors that can be also HTTP reponses
"""
# pylint: disable=too-many-arg... |
import sys
from PIL import Image
import numpy
import time
import cv2
import pysrt
import curses
ASCII_CHAR_ARRAY = (
" .:-=+*#%@",
" .,:ilwW",
" ▏▁░▂▖▃▍▐▒▀▞▚▌▅▆▊▓▇▉█",
" `^|1aUBN",
" .`!?xyWN",
)
ASCII_CHARS = ASCII_CHAR_ARRAY[3]
MAX_PIXEL_VALUE = 255
def vid_render(st_matrix, st, ed, option):
... |
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import pytest
import numpy as np
import scipy.constants as sc
from astropy.convolution import convolve_fft
from astropy.convolution import Gaussian2DKernel
import bettermoments.methods as bm
@pytest.fixture
def mock_data(Nchan=64, Npix=128):
... |
"""Widget implementations (adaptors) for the Qt backend."""
from typing import Any, Iterable, Optional, Tuple, Union
import qtpy
from qtpy import QtWidgets as QtW
from qtpy.QtCore import QEvent, QObject, Qt, QTimer, Signal
from magicgui.types import FileDialogMode
from magicgui.widgets import _protocols
from magicgui... |
"""
Creates a subwindow that displays a DICOM image's metadata.
"""
from PyQt5.QtCore import Qt, pyqtSignal, QObject
from PyQt5.QtWidgets import (QAction, QApplication, QFileDialog, QLineEdit,
QMdiArea, QMessageBox, QWidget, QGridLayout, QVBoxLayout, QSpinBox,
QMdiSubWin... |
# noinspection PyPep8Naming
import Levenshtein as lv
import datetime
import steampi.calendar
import steampi.text_distances
import steamspypi
from parse_wiki import build_dictionary
def list_all_games(bundles):
game_names = set()
for bundle_content in bundles.values():
for game_name in bundle_content:... |
import itertools
import logging
import math
import random
from typing import Tuple, Optional
import click
import numpy as np
from shapely.affinity import rotate, translate
from shapely.geometry import MultiLineString, Polygon
from shapely.ops import unary_union
import vpype as vp
RectType = Tuple[float, float, float,... |
from TwitterAPI import TwitterAPI, TwitterConnectionError, TwitterRequestError, TwitterPager
from dateutil import parser as date_parser
import time
import logging
import chatter.dbutil as db
from chatter.custom_twitter_pager import CustomTwitterPager
import chatter.config as config
from chatter.util import get_domain_... |
from google.protobuf.message import Message
from google.protobuf.descriptor import Descriptor, FileDescriptor, FieldDescriptor, EnumDescriptor, EnumValueDescriptor
from google.protobuf.descriptor_pb2 import FileDescriptorProto
from google.protobuf.reflection import GeneratedProtocolMessageType
from io.A4_pb2 import f... |
from bed_reader import open_bed
from typing import List, Tuple
import pandas
import numpy
import zarr
def get_variant_mask(gwas_results_path: str, limit: int):
results = pandas.read_table(gwas_results_path)
results.loc[:, 'ind'] = numpy.arange(results.shape[0])
sorted_results = results.loc[:, ['ind', ... |
import torch
import torch_geometric.io
import scipy.io
from scipy import sparse
import numpy as np
from torch_geometric.nn import fps, knn_graph
from matplotlib.tri import Triangulation
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from param import *
from arap_potential import arap_vert
impor... |
#
# django imports
#
from django.conf import settings
from django.forms import Form
from django.contrib import messages
from django.template.context_processors import csrf
from django.http import HttpResponseRedirect, Http404, HttpResponse
from django.shortcuts import render
from django.views.generic.edit import FormV... |
"""
JSON has become popular method for exchange of structured information over a
network and sharing information across platforms.
It is basically text with some structure and saving it as .json
It stores data as key:value pairs.
Anything before : is called key and after : is called value.
This is very similar to ... |
import ctypes
from ctypes import POINTER, c_int, c_float
import os.path
# extract cuda_fshape_scp function pointer in the shared object cuda_fshape_scp_*.so
def get_cuda_fshape_scp_dx(name_geom, name_sig, name_var):
"""
Loads the routine from the compiled .so file.
"""
name = name_geom + name_sig + nam... |
from simulate_game import *
from simulate_game_all import *
import matplotlib.colors as mcolors
label_name_dict = {'keymove': "Keyboard-Triggered Move", 'jump': "Jump", 'costopall': "Collision-Triggered-Stop-All",
'wrap': "Wrap On Screen", 'cochangescore': "Collision-Triggered Change Score",
... |
"""Utilities for working with the CFG."""
import collections
import itertools
# Limit on how many argument combinations we allow before aborting.
# For a sample of 16664 (sane) source files without imports, these are the
# quantiles that were below the given number of argument combinations:
# 50% 75% 90% 99% ... |
"""
########
BadgeBot
########
by <NAME>
based on a design by <NAME>
Coded using Drawbot <http://drawbot.readthedocs.org> and, of course, Input <http://input.fontbureau.com>
It makes badges for awesome conferences, like @TypographicsNYC!
Learn more: <http://djr.com/misc/typographicsbadge>
This was designed to be use... |
#!/usr/bin/env python
#
# Copyright 2015 Airbus
# Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
#
# 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
#
# ... |
from __future__ import print_function, division
import torch
import torch.nn as nn
import matplotlib.pyplot as plt
import numpy as np
import os
import datetime
import logging
import sys
import argparse
parser = argparse.ArgumentParser(description='Tension Estimator Trainer.')
parser.add_argument('--seq_len', type=int,... |
import json
import requests
import datetime
import time
from playsound import playsound
import smtplib, ssl
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import sys
# Refresh once every 5 secs
REFRESH_FREQ = 5
def send_email(user_name, email_id, center, center_session):
# En... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
release_group property
"""
import copy
from rebulk import Rebulk, Rule, AppendMatch, RemoveMatch
from rebulk.match import Match
from ..common import seps
from ..common.expected import build_expected_function
from ..common.comparators import marker_sorted
from ..common... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
---------------------------------------------... |
from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseBadRequest, HttpResponse
from bootcamp.results.models import Result
from bootcamp.tasks.models import Task
from bootcamp.inventories.models import Inventory
from django.core.paginator import Paginator, EmptyPage, PageNo... |
"""
Downloads firebase files found in markdown files (MD) exported from
RoamResearch and then replace the original firebase links by a local
one. All in parallel.
Cronological History:
=====================
https://github.com/renerocksai/rj2obs implemented the r2o.py (Roam JSON
to Obsidian Converter).
https://githu... |
"""Collection of boto3 calls to AWS resources for the analyzer function."""
import json
import logging
import boto3
LOGGER = logging.getLogger()
SNS_PUBLISH_SUBJECT_MAX_SIZE = 99
def download_from_s3(bucket_name, object_key, download_path):
"""Download an object from S3 into local /tmp storage.
Args:
... |
"""
This script generates a train/test database on the basis of the given percentage
it takes the images and the annotations written on the same folder, it shuffles them,
then copy into the upper train/test folders and create a relative csv file to manipulate
with TensorFlow.
More details are coming with the code.
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.