text stringlengths 3.07k 12.6k |
|---|
import numpy as np
import piecash
import functools
from . import transaction
import logging
logger = logging.getLogger(__name__)
# from treeinterpreter import treeinterpreter as ti
from sklearn.naive_bayes import GaussianNB
from sklearn.ensemble import RandomForestClassifier
# from treeinterpreter import treeinterp... |
import sys
import json
import os
from os import path, environ
from .printing import *
from .compatibility import *
from .utils import safe_mkdir, strip_home
from .constants import ProjInfo
def get_xdg_config_path() -> str:
"""Returns path to $XDG_CONFIG_HOME, or ~/.config, if it doesn't exist."""
return environ.get... |
'''
The MicroAgent method can be run periodically after a certain period of time or
on a schedule (cron).
Periodic calls are implemented with *asyncio.call_later* chains.
Before each method call, the next call is initiated.
Each call is independent, and previous calls do not affect subsequent calls.
Exceptions are wri... |
from typing import Dict, Optional
from requests_html import HTML, HTMLSession
from nitter_scraper.schema import Profile # noqa: I100, I202
def username_cleaner(username: str) -> str:
"""Strips @ symbol from a username.
Example:
@dgnsrekt -> dgnsrekt
Args:
username: username with @ sym... |
# -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals, absolute_import
import frappe
from frappe import _
import json
from frappe.model.document import Document
from frappe.core.doctype.user.user impo... |
"""
goal is to take the pre trained mask rcnn model and train it on comma10k data, following
this article: https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html
use functions from https://github.com/pytorch/vision.git
model is trained on the coco data set, which has 80 + 1(background) classes. comma10k... |
#!/usr/bin/python
#
# Copyright (c) 2012 <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, including without limitation the rights
# to use, copy, modify... |
from __future__ import division
from builtins import object
from past.utils import old_div
from proteus import *
from proteus.default_p import *
from proteus.mprans import SW2DCV
from proteus.mprans import GN_SW2DCV
from proteus.Domain import RectangularDomain
import numpy as np
from proteus import (Domain, Context, Me... |
# Copyright 2014 - Mirantis, 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 ag... |
import os
import sys
from importlib import import_module
from django.db.models.loading import cache
from django.db.migrations.recorder import MigrationRecorder
from django.db.migrations.graph import MigrationGraph
from django.utils import six
from django.conf import settings
class MigrationLoader(object):
"""
... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=no-member
# pylint:disable=protected-access
# pylint:disable=too-many-arguments
import json
from copy import deepcopy
from typing import Any, Dict, List
from unittest.mock import AsyncMock
import ... |
import random
import torch
from torch import nn
from torch.autograd import Variable
from torch.nn import functional as F
from adet.layers import conv_with_kaiming_uniform
class BidirectionalLSTM(nn.Module):
def __init__(self, nIn, nHidden, nOut):
super(BidirectionalLSTM, self).__init__()
self.r... |
# Latent distance model for neural data
import numpy as np
import numpy.random as npr
from autograd import grad
from hips.inference.hmc import hmc
from pybasicbayes.distributions import Gaussian
from pyglm.utils.utils import expand_scalar, compute_optimal_rotation
from matplotlib import pyplot as plt
import seaborn as ... |
'''
Managing Ruby installations and gemsets with Ruby Version Manager (RVM).
========================================================================
This module is used to install and manage ruby installations and
gemsets with RVM, the Ruby Version Manager. Different versions of ruby
can be installed and gemsets crea... |
# -*- coding: utf-8 -*-
import subprocess
import json
import time
import iota
from iota import Iota, Address, TryteString, Transaction
from iota.crypto.signing import SignatureFragmentGenerator
from iota.crypto.kerl.conv import convertToBytes, convertToTrits, \
trits_to_trytes, trytes_to_trits
from iota.trits impo... |
from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector
from pettingzoo.utils import wrappers
from pettingzoo.utils.conversions import parallel_wrapper_fn
from gym_stag_hunt.envs.harvest import HarvestEnv
from gym.spaces import Box
import cv2
import numpy as np
def env(grid_size=(5, 5), screen_size... |
# MIT License
# Copyright (c) 2020 <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, publish... |
# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import warnings
import numpy as np
import torch
from mmdet.core import bbox2result
from mmdet.models import BaseDetector
class DeployBaseDetector(BaseDetector):
"""DeployBaseDetector."""
def __init__(self, class_names, device_id):
... |
import os
import numpy as np
import pandas as pd
import random
import cv2
import csv
import glob
from sklearn import model_selection
from keras import backend as K
from keras import models, optimizers
from keras.models import Sequential
from keras.layers import Conv2D, Cropping2D, Dense, Dropout, Flatten, Lambda, Acti... |
import MDAnalysis as mda
import numpy as np
from swarmcg import config
def get_AA_bonds_distrib(ns, beads_ids, grp_type, grp_nb):
"""Calculate bonds distribution from AA trajectory.
ns requires:
aa2cg_universe
mda_backend
bw_constraints
bw_bonds
bonds_scaling
... |
from __future__ import print_function
import sys
import time
import PyDAQmx as daq
from PyDAQmx import uInt32, int32, int16, byref
from contextlib import contextmanager
# --------------
# COUNTING STUFF
# --------------
def make_counter(countchan, trig=None):
"""
Configure the given counter to count, maybe wi... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
#
# 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, ... |
r"""Assorted function for use when computing metrics and evals."""
import collections
import os
import numpy as np
import scipy
from scipy import signal
from scipy.ndimage.filters import convolve
import tensorflow.compat.v1 as tf
def _FSpecialGauss(size, sigma):
"""Function to mimic the 'fspecial' gaussian MATLAB ... |
#
# This file is part of LitePCIe.
#
# Copyright (c) 2015-2018 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
# In this high level test, LitePCIeEndpoint is connected to LitePCIeDMAReader and LitePCIeDMAWriter
# frontends with Reader's source connected to Writer's sink. Our Host model is used to emulate a Ho... |
import argparse
import curses
import getpass
import inspect
import logging
import os
import sys
import pkg_resources
import pytoml
# TODO: setup.py and obtain __version__ from rpm.spec
try:
__version__ = pkg_resources.get_distribution('pypodman').version
except Exception:
__version__ = '0.0.0'
class HelpFo... |
# APIs to compute ima power and area stats
import sys
# import dependency files
import config as cfg
import constants as param
# Compute metrics of the ima based on paramaters in config file and dicts in constants file
# Area is computed as the summation of all component area (doesn't consider physical layout)
def c... |
# coding: ** utf-8 **
import requests
import json
import time
import os
import datetime
import logging
from .save import save_json_to_file
logging.basicConfig(filename='download.log', level=logging.DEBUG)
query_str = {
'min_behot_time': '0',
'category': 'video_new',
'utm_source': 'toutiao',
'widen': ... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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
from ... import _utilities, _tables
from... |
import vtk
import numpy as np
from collections import OrderedDict
from vtk.util.colors import lime_green, slate_grey
def octree_to_sparse_vtk_volume(volume, cutoff=0.5, resolution=[1, 1, 1]):
"""
Generate a vtk volume from the blockwise sparse octree. This is a hacky
solution that iterates over evey pixel... |
# 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... |
"""Densnet handler.
Adapted from
https://github.com/pytorch/vision/blob/master/torchvision/models/densenet.py
"""
import functools
import numpy as np
import torch.nn as nn
import torch.nn.functional as F
from models import custom_ops
from models import dense_blocks
from models import model_utils
class DenseNet(n... |
#This submodule contains image analysis routines
from matplotlib.pyplot import *
from numpy import *
from matplotlib.colors import LogNorm
import pdb
def ptov(d):
"""Return the peak to valley of an image"""
return nanmax(d)-nanmin(d)
def rms(d):
"""Return the RMS of an image"""
return sqrt(nanmean((d-... |
import pytest # type: ignore
from app.models import (Card, beats, card_allowed, same_suit)
def test_same_suit__examples():
assert same_suit(Card.Heart2, Card.HeartKing)
assert same_suit(Card.Spade7, Card.Spade10)
assert same_suit(Card.ClubQueen, Card.ClubJack)
assert same_suit(Card.Diamond8, Card.Di... |
import functools
import torch
class TensorList(list):
"""Container mainly used for lists of torch tensors. Extends lists with pytorch functionality."""
def __init__(self, list_of_tensors = None):
if list_of_tensors is None:
list_of_tensors = list()
super(TensorList, self).__init__... |
# NOTE: bad django practice but /ee specifically depends on /posthog so it should be fine
from datetime import datetime, timedelta
from typing import Any, Dict, List, Optional, Tuple
from dateutil.relativedelta import relativedelta
from django.db.models.expressions import F
from django.utils import timezone
from rest_... |
from flask import request
from flask_cors import CORS, cross_origin
from datetime import datetime, timezone
from functools import wraps
import threading, json, time
from googletrans import Translator
from AuthModule.azuread import authProvider
from SearchModule import app
from SearchModule.TextSearchModule import load... |
import mdpopups
import sublime
import sublime_plugin
import webbrowser
from html import escape
from .core.configurations import is_supported_syntax
from .diagnostics import get_point_diagnostics
from .core.registry import session_for_view, LspTextCommand
from .core.protocol import Request, DiagnosticSeverity, Diagnosti... |
"""Calculate test set' accuracy by:
First generate (embeddings,labels) of training set
Then perform k-means for each class and get centroids_per_class, save as npy file
When predicting, generate embedding of test set and perform knn to predict labels
"""
import argparse
import os
import pathlib
import shutil
... |
#!/usr/bin/env python
from __future__ import absolute_import
import json
import os
import os.path
import pkg_resources
import subprocess
import sys
from backports import tempfile
from ansible.module_utils._text import to_bytes
import click
import m9dicts
import yaml
from .model import PowoPlugin
# needed if powo ... |
from __future__ import print_function
import numpy as np
import torch
import torch.utils.data
from torch import nn, optim
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
img_size = 84
n_path = '../data/Hand_Env/vae_model_block_0'
class VAE(n... |
import json
import subprocess
from io import BytesIO
from typing import Any, Dict, List, Optional, Tuple, Union
import numpy as np
from pydantic import (
BaseModel,
ConstrainedFloat,
ConstrainedInt,
ConstrainedList,
validator,
)
class MinLength(ConstrainedInt):
ge = 1
le = 500
strict ... |
# fixtures: Fixtures with cleanups for testing and convenience.
#
# Copyright (c) 2011, <NAME> <<EMAIL>>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import functools
from abc import ABCMeta, abstractmethod
from pyro.distributions.score_parts import ScoreParts
COERCIONS = []
class DistributionMeta(ABCMeta):
def __call__(cls, *args, **kwargs):
for coerce_ in COERC... |
# Perforce source for convert extension.
#
# Copyright 2009, <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.
from mercurial import util
from mercurial.i18n import _
from common import commit, converter_source, ch... |
# -*- coding: utf-8 -*-
"""Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 <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... |
#!/usr/bin/env python3
# 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.
"""Units test for all models in model zoo."""
import datetime
import json
import os
import shutil
import tempfile
imp... |
#########################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# SPDX-License-Identifier: MIT-0 #
# ... |
# Copyright (c) 2017-2020 <NAME>.
# Author: <NAME>
# Email: <EMAIL>
# Update: 2020 - 2 - 12
import numpy as np
from .Utility import to_list
def gaussian_kernel(kernel_size: (int, tuple, list), width: float):
"""generate a gaussian kernel
Args:
kernel_size: the size of generated gaussian kernel. If is... |
from mayavi import mlab
import numpy as np
import linear_algebra as la
import os
import sys
#from Rippe 2001
kl = 289 #Kuhn length (nm)
bpPerKL = 30000. #base pairs per Kuhn length
chromatinDiameter = 30 #diameter of heterochromatin (nm)
default_colors = np.array([[255,0,0], [0,255,238], [255,238,0], [0,102,255], [2... |
#! /usr/bin/env python
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.manual_seed(123)
import numpy as np
np.random.seed(123)
import time
from UGformerV2 import *
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from scipy.sparse import coo_matrix
from util impo... |
#!/usr/bin/env python3
###############################################################################
# Copyright (c) Intel Corporation - All rights reserved. #
# This file is part of the LIBXSMM library. #
# ... |
#
# The Python Imaging Library.
# $Id$
#
# a simple Qt image interface.
#
# history:
# 2006-06-03 fl: created
# 2006-06-04 fl: inherit from QImage instead of wrapping it
# 2006-06-05 fl: removed toimage helper; move string support to ImageQt
# 2013-11-13 fl: add support for Qt5 (<EMAIL>)
#
# Copyright (c) 2006 by Secre... |
"""Synchronous msgpack-rpc session layer."""
import logging
import threading
from collections import deque
from traceback import format_exc
import greenlet
from ..compat import check_async
logger = logging.getLogger(__name__)
error, debug, info, warn = (logger.error, logger.debug, logger.info,
... |
"""
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
Writes a Dockerfile using information from container.yaml - the Dockerfile
results in an image with the actual filesystem tree we care about at
... |
# MODULE: TypeRig / Core / Math (Functions)
# -----------------------------------------------------------
# (C) <NAME>, 2015-2020 (http://www.kateliev.com)
# (C) Karandash Type Foundry (http://www.karandash.eu)
#------------------------------------------------------------
# www.typerig.com
# No warranties. By using... |
"""
GMM related routines
"""
import numpy as np
from ..utils import get_sdss_bands, view_table_as_2d_array
try:
from extreme_deconvolution.extreme_deconvolution import \
extreme_deconvolution
from sklearn.mixture import GaussianMixture
except (ImportError, OSError):
_XDGMM_AVAILABLE = False
else:
... |
# coding: utf-8
# Distributed under the terms of the MIT License.
import unittest
import os
import numpy as np
from ababe.io.vasp import VaspInput, VaspOutput
from ababe.stru.scaffold import GeneralCell
testdata_dir = os.path.join(os.path.dirname(__file__), "test_files")
class TestVaspInput(unittest.TestCase):
... |
# Copyright (c) 2015 Quobyte 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... |
#!/usr/bin/env python3
from distutils.version import StrictVersion
import logging
import os
import subprocess
import sys
from github import Github
from env_helper import TEMP_PATH, REPO_COPY, REPORTS_PATH
from s3_helper import S3Helper
from get_robot_token import get_best_robot_token
from pr_info import PRInfo
from ... |
# -*- coding: utf-8 -*-
# Copyright 2018 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.
"""The Build API entry point."""
from __future__ import print_function
import os
import sys
from chromite.api import api_config... |
# -*- coding: utf-8 -*-
"""
Site frequency spectra.
See also the examples at:
- http://nbviewer.ipython.org/github/alimanfoo/anhima/blob/master/examples/sf.ipynb
""" # noqa
from __future__ import division, print_function, absolute_import
# third party dependencies
import numpy as np
import matplotlib.pyplot as ... |
"""Tests for eliot.dask."""
from unittest import TestCase, skipUnless
from ..testing import capture_logging, LoggedAction, LoggedMessage
from .. import start_action, log_message
try:
import dask
from dask.bag import from_sequence
from dask.distributed import Client
import dask.dataframe as dd
imp... |
"""
env_multi.py
Environment where a single genome gets evaluated over multiple games. This environment will be called in a process.
"""
import sys
from config import Config
from environment.entities.game import get_game
from population.population import Population
from utils.dictionary import D_DONE, D_SENSOR_LIST
... |
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.utils import shuffle
from sklearn.metrics import precision_score, recall_score
from sklearn.neural_network import MLPClassifier
import utils
import json
import argparse
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensor... |
import argparse
import csv
import os
from pprint import pprint
ERROR_STRINGS = {
'uniqueness_error': '"{0} must be unique.".format(fieldname)',
'required_error': '"Required field {0} is missing.".format(fieldname)',
'type_error': '"{0} must be of type {1}.".format(fieldname, data_type)',
'len_error': ... |
from copy import deepcopy
import pytest
from flask_sqlalchemy import SQLAlchemy
from marshmallow import ValidationError
from marshmallow.fields import Integer
from sqlalchemy import Column
from teal.auth import Auth
from teal.config import Config
from teal.db import POLYMORPHIC_ID, POLYMORPHIC_ON
from teal.resource i... |
#!/usr/bin/env python2
"""
count_procs.py
Print a results table.
Input looks like
01-dash
01-dash
01-osh
01-osh
01-osh
...
"""
from __future__ import print_function
import collections
import optparse
import re
import sys
def log(msg, *args):
if args:
msg = msg % args
print(msg, file=sys.stderr)
def Cel... |
"""
Author: https://github.com/saewoonam
"""
import remi.gui as gui
from remi import start, App
import threading
import random
import time
import datetime
import json
class LabelSpinBox(gui.HBox):
def __init__(self, label='label', default_value=0,
min=0, max=100, step=1, labelWidth=100,
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
from enum import IntEnum
from selenium import webdriver
from time import sleep
import argparse
import beepy
import re
import sys
class WeekDay(IntEnum):
Mon = 0
Tue = 1
Wed = 2
Thu = 3
Fri = 4
Sat =... |
import trio
import anyio
import mock
import attr
import copy
import time
from functools import partial
from contextlib import asynccontextmanager, AsyncExitStack
from asyncscope import main_scope
from distkv.default import CFG
from distkv.server import Server
from distkv.codec import unpacker
from distkv.util import ... |
import random
import torch
import torch.nn as nn
from ..util import box_ops
from ..util.misc import NestedTensor
from .deformable_detr import DeformableDETR
from .detr import DETR
class DETRTrackingBase(nn.Module):
def __init__(self,
track_query_false_positive_prob=0.0,
track_... |
#!/usr/bin/env python
from __future__ import print_function
import os
import subprocess
from itertools import chain
import sys
import argparse
import json
import re
platformpath = '{ANDROID_NDK_ROOT}/platforms/{PLATFORM_NAME}/arch-arm'.format(**os.environ)
default_header_path = '{}/usr/include/'.format(platformpath)... |
#!/usr/bin/env python
from __future__ import print_function
import sys
import xml.dom.minidom
import math
import optparse
maxDist = 0.0001
#parse .tiles-File
def readFractions(fileName, materialMap):
result = {}
file = open(fileName,"r")
name = None
dens = None
fractions = {}
for line in file:... |
from sympy import I, symbols, Matrix, eye, Mod, floor
from sympy.matrices import MatrixSymbol, Identity
from sympy.matrices.expressions import det, trace
from sympy.matrices.expressions.kronecker import (KroneckerProduct,
kronecker_product,
... |
import abc
from copy import deepcopy
import numpy as np
from menpo.visualize import AlignmentViewer2d
from menpo.visualize.base import Viewable
class Alignable(object):
r"""
Mixin for Transforms that can be constructed from an
optimisation aligning a source PointCloud to a target PointCloud.
Constru... |
from dataclasses import dataclass
import sys
import typing as tp
from copy import copy
from enum import Enum
from functools import total_ordering
import jax
import jax.numpy as jnp
import jax.tree_util
import numpy as np
if sys.version_info >= (3, 8):
from typing import Protocol, runtime_checkable
else:
from... |
import cirq
import numpy as np
import pytest
import sympy
from .cirq_conversions import convert_from_cirq, convert_to_cirq, make_rotation_factory
from .. import XY
from ...circuit.gates import (
X,
Y,
Z,
RX,
RY,
RZ,
PHASE,
T,
I,
H,
CZ,
CNOT,
CPHASE,
SWAP,
XX,... |
import vrep
import time
import ctypes
import numpy as np
import math
import pdb
import cv2
import array
import QR_finder
from PIL import Image
import matplotlib.pyplot as plt
def save_pic(vision_name,clientID):
if clientID!=-1:
try:
err, camera1 = vrep.simxGetObjectHandle(clientID, vision_n... |
from nni.compression.tensorflow import AGP_Pruner
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def weight_variable(shape):
return tf.Variable(tf.truncated_normal(shape, stddev=0.1))
def bias_variable(shape):
return tf.Variable(tf.constant(0.1, shape=shape))
def conv2d... |
'''
@author <NAME>
'''
import sys
import unittest
import socket
import urllib
IS_JYTHON = sys.platform.find('java') != -1
if IS_JYTHON:
import os
#make it as if we were executing from the directory above this one (so that we can use jycompletionserver
#without the need for it being in the pythonpat... |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# Cadishi --- CAlculation of DIStance HIstograms
#
# Copyright (c) <NAME>, <NAME>
# See the file AUTHORS.rst for the full list of contributors.
#
# Released under the MIT ... |
#!/usr/bin/env python3
import sys
import pickle
import struct
import collections
import qm3.mol
import qm3.fio.dcd
import qm3.engines.mopac
import _mmdec
def to_center( mol ):
box = [ mol.coor[0:3][:], mol.coor[0:3][:] ]
cen = [ .0, .0, .0 ]
for i in range( mol.natm ):
i3 = i * 3
f... |
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... |
from pygments.lexer import (RegexLexer, bygroups, words, using, include,
combined)
from pygments.lexers import BashLexer
from pygments.token import Text, String, Keyword, Name, Operator
from . import options as opt
__all__ = ['HttpPromptLexer']
FLAG_OPTIONS = [name for name, _ in opt.F... |
import os,re,sys
import os.path
import datetime
def usage():
print("Usage:")
print("")
print("photoscan.sh -platform offscreen -r process.py <path to project folder>")
print("")
print("photoscan.sh is the main Agisoft PhotoScan executable")
print("If you remove -platform offscreen, the applicat... |
# main imports
import os, sys
import argparse
import json
import numpy as np
import shutil
# Rawls images
from rawls.rawls import Rawls
# others import
from ipfml import utils
from scipy.signal import savgol_filter
'''
Display progress information as progress bar
'''
def write_progress(progress):
barWidth = 180
... |
# Copyright 2010-2011 OpenStack Foundation
# 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... |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 8 11:15:36 2018
@author: sreimond
"""
import numpy as np
import warnings
from .vectors import Vector
class Matrix( object ):
"""
The `Matrix` class returns a Matrix object (all based on numpy).
"""
def __init__(self,m,n):
self.m = m
self... |
import tensorflow as tf
from baselines.ddpg.ddpg import DDPG
import baselines.common.tf_util as U
class EvaluationStatistics:
def __init__(self, tf_session, tf_writer):
self._build_tf_graph()
self.rewards = []
self.actor_losses = []
self.critic_losses = []
self.tf_session = ... |
# -*- coding: UTF-8 -*-
#
# Copyright 2016 Opsview Ltd.
#
# 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 la... |
import logging
import sys
from pathlib import Path
from typing import List, Optional, Set, Tuple
import click
import ffpb
from tabulate import tabulate
from tqdm import tqdm
from ruvsarpur.hls_downloader import create_ffmpeg_download_command, load_m3u8_available_resolutions
from ruvsarpur.ruv_client import Programs, ... |
#!/usr/bin/env python
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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.or... |
# -*- coding: utf-8 -*-
# Copyright (C) 2012 <NAME>.
import os
import logging
from logging.handlers import TimedRotatingFileHandler
import flask
from quart import Quart, render_template, send_from_directory, current_app
from webassets import Environment, Bundle
import httpkom
from . import version
class default_s... |
# -*- coding: utf-8 -*-
import logging
from collections import defaultdict
import torch
from lichee import config
from lichee import plugin
from lichee.model import model_base
from lichee.utils import storage
class Unit:
def __init__(self, idx, name, inputs, outputs):
self.idx = idx
self.name = ... |
#!/usr/bin/env python3
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.collections import LineCollection, PatchCollection
from matplotlib.patches import Rectangle, Polygon
from matplotlib.transforms import Affine2D
import matplotlib.animation as ani
def move_figure(f, x, y):
"... |
#!/usr/bin/env python3
import re
import sys
from xml.etree.ElementTree import parse
import requests
changed_file_target_type = ["INSTRUCTION", "LINE", "METHOD"]
target_type = ["INSTRUCTION", "LINE", "METHOD", "CLASS"]
def find_pull_request():
response = requests.get(
f"{github_api_url}/repos/{repositor... |
#!/usr/bin/python3
# https://en.wikipedia.org/wiki/Digital_root
# digital sum
"""
wordlist samples:
https://github.com/hackerb9/gwordlist
All the words from Google Books, sorted by frequency
https://github.com/first20hours/google-10000-english
the 10,000 most common English words in order of frequency
https://gith... |
import argparse
import time
import torch
from data import create_fields, nopeak_mask
import torch.nn.functional as F
import pdb
import dill as pickle
import argparse
from model import get_model
import re
import math
# BEAM SEARCH ------------------------------------------------------------------
def init_vars(src, mo... |
# -*- coding: utf-8 -*-
"""
Dataset loader script for CIFAR-10 dataset as initial script to run for main programm
This scripts loads the dataset object, divides this into train & test.
X-Data will be resized into 64x64x3
Furthermore the datasets will be preprocessed by standardizing [ x - mean(x) / sd(x)] in order to ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.