text stringlengths 3.07k 22.1k |
|---|
#!/usr/bin/env python
#
# Copyright (C) 2021 Learning Algorithms and Systems Laboratory, EPFL, Switzerland
# Authors:
# <NAME> (<EMAIL>)
# <NAME> (<EMAIL>) [Maintainer]
# Website: lasa.epfl.ch
#
# This file is part of `allegro_hand_gazebo`.
#
# This program is free software: you can redistribute it and/or modify
# it... |
import math
import signal
from kivy.app import App
from kivy.core.window import Window
from kivy.graphics import *
from kivy.uix.widget import Widget
from board import Move
from controller import Config
from kivyutils import *
STONE_COLORS = Config.get("ui")["stones"]
OUTLINE_COLORS = Config.get("ui").get("outline",... |
from __future__ import absolute_import, division, unicode_literals
from io import open
import os
import tempfile
from wsgiref.util import FileWrapper
from celery import states
from celery.exceptions import Ignore
from celery.task import task
from celery.utils.log import get_task_logger
from django.conf import settings
... |
#!/usr/bin/env python
__all__ = ['qq_download']
from .qie import download as qieDownload
from .qie_video import download_by_url as qie_video_download
from ..common import *
def qq_download_by_vid(vid, title, output_dir='.', merge=True, info_only=False):
# http://v.sports.qq.com/#/cover/t0fqsm1y83r8v5j/a0026nvw... |
import os
from flask import Flask, render_template, request, Response
import torch
import random
import numpy as np
from utils import header, add_content, box
from wtforms import Form, TextField, IntegerField, DecimalField, BooleanField, validators, SubmitField, SelectField
from wtforms.fields.html5 import IntegerRange... |
import math
from math import cos, fabs, radians, sin, sqrt
import hypothesis.strategies as st
import pytest # type: ignore
from hypothesis import assume, example, given, note
from ppb_vector import Vector
from utils import angle_isclose, angles, floats, isclose, vectors
data_exact = [
(Vector(1, 1), -90, Vecto... |
import pywikibot
import toolforge
import re
import pywikibot, re, os, time, sys, json
import toolforge
from datetime import date, datetime, timedelta, timezone
from pytz import timezone
conn = toolforge.connect('frwiki_p','analytics')
utc_timezone = timezone("UTC")
lva_timezone = timezone("Europe/Riga")
... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os
import tempfile
from enum import Enum
from glob import glob
import requests
from resync import ResourceList
from resync.sitemap import Sitemap
from rspub.core.transport import ResourceAuditor
from rspub.util import defaults
from rspub.util.obser... |
from collections import deque
from PyQt5 import QtCore
from PyQt5.QtWidgets import *
import envi.qt.memcanvas as e_memcanvas_qt
import envi.memcanvas.renderers as e_render
import vqt.tree as vq_tree
import vqt.hotkeys as vq_hotkey
import vqt.saveable as vq_save
from vqt.main import *
from vqt.common import *
class... |
from org.transcrypt.stubs.browser import __pragma__
class Matrix:
def __init__ (self, nRows, nCols, elements = []):
self.nRows = nRows
self.nCols = nCols
if len (elements):
self._ = elements
else:
self._ = [[0 for col in range (nCols)] for ... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import os
import sys
import glob
import math
import shutil
import signal
import progressbar
import subprocess
import json
import pybel
import numpy as np
from debug import BColors
def custom_pbar(fd=sys.stdout, *args, **kwargs):
pbar_fmt = [
progressbar.Form... |
from __future__ import print_function #ts print error in env_var
from flask import render_template, flash, redirect
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_appbuilder import ModelView, expose, BaseView
from flask_appbuilder.actions import action
from app import appbuilder, db, app
fr... |
# Copyright 2019 1QBit
#
# 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 ... |
"""
This code optimizes the offsets on top of SMPL.
This code requires that SMPL be already aligned with the scans.
Author: Bharat
Code taken from: Combining Implicit Function Learning and Parametric Models for 3D Human Reconstruction, ECCV'20
Cite: LoopReg: Self-supervised Learning of Implicit Surface Correspondences,... |
# Copyright 2021, Google 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 in writing... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""
A simple tool to manipulate data from/to ascii files.
"""
import copy as cp
import numpy as np
import fnmatch as fnm
#-----------------------------------------------------------------------------------------
class AsciiTable():
def __init__(self, header=[]):
... |
#!/usr/bin/env python
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in co... |
#!/usr/bin/env python3
#
# (C) 2018-2020 <NAME>
import sys, argparse
import numpy as np
sys.path.append('../')
import PetscBinaryIO # may need link
def readcoordinates(io,vech):
objecttype = io.readObjectType(vech)
if objecttype == 'Vec':
xy = io.readVec(vech)
N = len(xy)
if N % 2 != ... |
from __future__ import absolute_import, print_function, division
import os
import urwid
import urwid.util
import six
import netlib
from mitmproxy import flow
from mitmproxy import utils
from mitmproxy.console import signals
from netlib import human
try:
import pyperclip
except:
pyperclip = False
VIEW_FLOW... |
# -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Module for receiving stock and currency prices from Alphavantage
#
# by <NAME>
# References: https://www.alphavantage.co/
#
# Copyright 2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... |
# coding: utf-8
from __future__ import unicode_literals, division
"""
Created on Jun 1, 2012
"""
__author__ = "<NAME>"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__date__ = "Jun 1, 2012"
import unittest
from custodian.ansible.interpr... |
#!/usr/bin/python3.6
import multiprocessing as mp
from functools import partial
import numpy as np
import pandas as pd
import scipy
from sofa_config import *
from sofa_print import *
def overlap(pa, pb, pc, pd):
if pb - pc >= 0 and pd - pa >= 0:
return min(pb, pd) - max(pa, pc)
def partial_sum(df):
... |
"""
USAGE:
To convert markdown docs into html docs:
$ python generate_html_pages.py /path/to/gh-pages/dir
To generate pygments code highlighting stylesheet:
$ pygmentize -f html -S [STYLE_NAME] -a .highlight > /path/to/gh-pages/stylesheets/dir/pygments_style.css
To list available style names (at python prompt)
>>> f... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from utils import *
import math
from datetime import timedelta
class Protection(object):
# 2 = Alarm, 1 = Warning, 0 = Normal
def __init__(self):
self.voltage_high = None
self.voltage_low ... |
# Copyright 2022 The T5X Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import numpy as np
import random
import os
from PIL import Image
## Just for development
import pdb
import time
import matplotlib.pyplot as plt
plt.ion()
class ObjectsAndBackgroundsDataset(Dataset):
'''
Im... |
from django.test import TestCase
from ..models import TaxSaveInputs, WorkerNodesCounter
from ..models import convert_to_floats
from ..helpers import (expand_1D, expand_2D, expand_list, package_up_vars,
format_csv, arrange_totals_by_row, default_taxcalc_data,
default_policy)
fr... |
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.files import File
from django.db import models
from django.urls import reverse
from django.utils import t... |
############################################################################
# Copyright(c) Open Law Library. All rights reserved. #
# See ThirdPartyNotices.txt in the project root for additional notices. #
# #
# Licensed u... |
import torch
from torch import nn
from operator import itemgetter
from torch.autograd.function import Function
from torch.utils.checkpoint import get_device_states, set_device_states
# following example for saving and setting rng here https://pytorch.org/docs/stable/_modules/torch/utils/checkpoint.html
class Determini... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import yaml
import datetime
import platform
import numpy as np
from easydict import EasyDict as edict
# create dict
__C = edict()
cfg = __C
# Dataset
__C.DATASET = edict()
# Dataset Options: 'Completion3D', 'ShapeNet', 'ShapeNetCars',... |
from django.test import TestCase
from casexml.apps.case.models import CommCareCase
from casexml.apps.case.tests import delete_all_cases
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import get_case_ids_in_domain, get_cases_in_domain
from corehq.apps.importer.tasks import do_import... |
"""
legacyhalos.ellipse
===================
Code to do ellipse fitting on the residual coadds.
"""
from __future__ import absolute_import, division, print_function
import os, pdb
import time, warnings
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
import legacyhalos.io
def ellipsefit_mul... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/MessageDefinition) on 2017-03-22.
# 2017, SMART Health IT.
from . import domainresource
class MessageDefinition(domainresource.DomainResource):
""" A resource that defines a type of messag... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 4 18:51:20 2018
@author: cham
"""
import emcee
# %pylab qt5
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
from scipy.stats import skewtest, skew, anderson
"""
teff, logg, feh, mags(W1)
varpi, sigma_varp... |
from abc import ABCMeta, abstractmethod
import six
import os
import sys
import time
from sklearn.svm import OneClassSVM
from sklearn.pipeline import Pipeline, Parallel
from sklearn.ensemble import IsolationForest
from sklearn.neighbors import LocalOutlierFactor
import numpy as np
import pandas as pd
from sklearn.bas... |
#!/usr/bin/env python
"""Parapred - neural network-based paratope predictor.
Parapred works on parts of antibody's amino acid sequence that correspond to the
CDR and two extra residues on the either side of it. The program will output
binding probability for every residue in the input. The program accepts two
kinds of... |
# Copyright (c) 2010-2020 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Descriptor,
Alias,
Typed,
Bool,
Integer,
NoneSet,
String,
Sequence,
)
from openpyxl.descriptors.excel import ExtensionList, CellRange
from openpyxl.descriptor... |
# ##########################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# File Author: <NAME> (c) #
# Date: 3/10/2019 #
# MIT Licence #
# ############################... |
# coding: utf-8
import tensorflow as tf
#OMP_NUM_THREADS=1
tf.config.threading.set_inter_op_parallelism_threads(0)
tf.config.threading.set_intra_op_parallelism_threads(0)
map_kwargs = {"fn_output_signature" : tf.float32, "parallel_iterations" : 30, "swap_memory" : True}
jit_compile = True
# ---------- No changes be... |
"""
Weighted Integer Vectors
AUTHORS:
- <NAME> (2007): initial version, ported from MuPAD-Combinat
- <NAME> (2010-10-30): WeightedIntegerVectors(weights) + cleanup
"""
#*****************************************************************************
# Copyright (C) 2007 <NAME> <<EMAIL>>
# 2010 <NAME> <nt... |
"""
https://coolkit-technologies.github.io/apiDocs/#/en/APICenter
"""
import asyncio
import base64
import hashlib
import hmac
import json
import logging
import time
from typing import Optional, Callable, List
from aiohttp import ClientSession, WSMsgType, ClientConnectorError, \
WSMessage, ClientWebSocketResponse
f... |
#!/usr/bin/env python
# Copyright (c) PLUMgrid, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# This program implements a topology likes below:
# pem: physical endpoint manager, implemented as a bpf program
#
# vm1 <--------+ +----> bridge1 <----+
# V V ... |
# This module was written under the assumption that the arm data is extremely uniform ... whell its not, so its bett
# to write an opener for each separately
#
# from atmPy.data_archives.arm._netCDF import ArmDataset as _Dataset
import os as _os
from atmPy.data_archives.arm import _tdmasize,_tdmaapssize,_tdmahyg,_aosac... |
# -*- coding: utf-8 -*-
__all__ = ["optimize"]
import os
import sys
import numpy as np
import pymc3 as pm
import theano
from pymc3.blocking import ArrayOrdering, DictToArrayBijection
from pymc3.model import Point
from pymc3.theanof import inputvars
from pymc3.util import (
get_default_varnames,
get_untransfo... |
from __future__ import unicode_literals
import json
import re
from django import forms
from django.core.exceptions import ValidationError
from django.core.validators import validate_email
from django.utils import six
from django.utils.six.moves.urllib.error import HTTPError, URLError
from django.utils.six.moves.urlli... |
import itertools
import json
import os
from collections import Counter
from pytorch_pretrained_bert.tokenization import BertTokenizer
from probing.data_utils.dataset import Dataset
from probing.globals import BERT_MODEL_NAME, SPR_PROPERTIES
from probing.helpers import retokenize
bert_tokenizer = BertTokenizer.from_p... |
# Code adapted from "upfirdn" python library with permission:
#
# Copyright (c) 2009, Motorola, Inc
#
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source co... |
"""
MIT License
Copyright (c) 2017 liukuang
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 withx restriction, including withx limitation the rights
to use, copy, modify, merge, publish, distribu... |
"""
API that are reported to numba.cuda
"""
from __future__ import print_function, absolute_import
import contextlib
import numpy as np
from .cudadrv import devicearray, devices, driver
from .args import In, Out, InOut
try:
long
except NameError:
long = int
# NDarray device helper
require_context = devi... |
from markupsafe import Markup
from wtforms.widgets.core import html_params
from .internals import xmlattr
def _add_description(field, **kwargs):
rv = ''
if field.description:
rv += f'<small id="{ field.name }Help" class="form-text text-muted">'
rv += field.description
rv += '</small... |
import numpy as np
import tensorflow as tensor
from keras.models import Sequential, Model, model_from_json
from keras.optimizers import Adam
from keras.layers.core import Dense, Activation, Flatten, Dropout
from keras import backend as K
from json import dump
import random
import argparse
import timeit
import os
import... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from math import sin, cos, pi, copysign, floor
from asciimatics.effects import Effect
from asciimatics.event import KeyboardEvent
from asciimatics.exceptions import ResizeScreenError, StopApplication
from asciimatics.screen import Screen
from asciimatics.scene ... |
import numpy as np
import condor
"""
The idea of comparing two sets of quaternions in this way originates from <NAME>.
"""
def compare_two_sets_of_quaternions(q1,q2,full_output=False,n_samples=100,q1_is_extrinsic=False,q2_is_extrinsic=False,sigma=2):
"""
Compares two sets of quaternions based on a comparison ... |
from functools import partial
from insomniac.action_runners.actions_runners_manager import ActionState
from insomniac.actions_impl import interact_with_user, ScrollEndDetector, open_likers, iterate_over_likers, \
is_private_account, InteractionStrategy, do_have_story
from insomniac.actions_types import InteractAct... |
import argparse
import logging
import time
import pandas as pd
import jinja2
import time
import matplotlib.pyplot as plt
import numpy as np
plt.rcParams['font.sans-serif'] = [u'Songti SC']
plt.rcParams['axes.unicode_minus'] = False
parser = argparse.ArgumentParser()
parser.add_argument('--drop', nargs='?', const=1, ty... |
# @Time : 2020/7/7
# @Author : <NAME>
# @Email : <EMAIL>
# UPDATE
# @Time : 2020/10/22, 2020/9/23
# @Author : <NAME>, <NAME>
# @email : <EMAIL>, <EMAIL>
"""
recbole.data.dataloader.abstract_dataloader
################################################
"""
import math
import copy
from logging import getLogger
im... |
# search.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# A... |
from django import forms
from django.forms import ModelForm
from django.conf import settings
from django.contrib.auth.models import User
from django.forms.models import model_to_dict
from django.utils.translation import gettext_lazy as _
from .models import Application, DataAuthorization, DatasetAuthorization, Profile... |
"""
A compiler from a Relay expression to TVM's graph runtime.
The compiler is built from a few pieces.
First we define a compiler from a single Relay expression to the
graph langauge. We require the expression to be a function.
The function's parameters correpond to the placeholder/inputs
and model parameters found ... |
import numpy as np
from numpy.random import f
import tensortools as tt
import matplotlib.colors as mcolors
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
import sys
import copy
import matplotlib
matplotlib.use('Agg')
def plotting_factors(U, method_name, components, replicate, save_data_dir, mark... |
# this file is for python2.7, not python3
import sys
import string
from collections import defaultdict, OrderedDict
import operator, logging
"""
This library provides a function "tagStormFromFile" to parse tagStorm files to
a list of nested dictionaries. The key "children" has a special meaning,
it point... |
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 13 21:09:01 2019
@author: <NAME> (<EMAIL>)
"""
'''
Utility functions to make regression plots
'''
import os
import numpy as np
from sklearn.metrics import mean_squared_error, r2_score
from scipy.stats import norm
import seaborn as sns
#matplotlib.use('Agg') # Must be be... |
import pandas as pd
import datetime
import os.path
import simplejson
from libs.us_state_abbrev import US_STATE_ABBREV
from libs.datasets import FIPSPopulation
from libs.datasets import CommonFields
from libs.datasets import can_model_output_schema as schema
from libs.datasets.can_model_output_schema import (
CAN_M... |
# Copyright 2019 DeepMind Technologies Limited. 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 ... |
import logging
import tkinter as tk
from pathlib import Path
from tkinter import ttk
from typing import TYPE_CHECKING, Optional, Set
from PIL.ImageTk import PhotoImage
from core.gui import nodeutils
from core.gui.appconfig import ICONS_PATH, CustomNode
from core.gui.dialogs.dialog import Dialog
from core.gui.images i... |
# -*- coding: utf-8 -*-
'''
Fileserver backend which serves files pushed to the Master
The :mod:`cp.push <salt.modules.cp.push>` function allows Minions to push files
up to the Master. Using this backend, these pushed files are exposed to other
Minions via the Salt fileserver.
To enable minionfs, :conf_master:`file_r... |
# -*- coding: utf-8 -*-
# This module contains all the Proxy session classes for use with the MIT
# Core Concept Catalog (MC3) Handcar service.
from dlkit.abstract_osid.proxy import rules as abc_proxy_rules
from ..osid import rules as osid_rules
from ..primitives import Id
from ..osid.osid_errors import *
class Pro... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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, Dict, List, Mapping, Optional, Tuple, Union
from ... import _utilities, _tables
from ... i... |
# -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... |
# pylint: disable=no-member
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
import pytorch_lightning as pl
from PCM.utils import CensoredMSELoss
from scipy import stats
from sklearn.metrics import r2_score
class PCM_MT(pl.LightningModule):
def __init__(self, hparams):
su... |
import pytest
import tubular.testing.test_data as d
import tubular.testing.helpers as h
import pandas as pd
import numpy as np
import tubular
from tubular.nominal import MeanResponseTransformer
class TestInit(object):
"""Tests for MeanResponseTransformer.init()."""
def test_arguments(self):
"""Test... |
#!/usr/bin/python3
# coding: utf-8
# @Time : 2020/10/29 17:37
import numpy as np
import random
import torch
import torch.nn as nn
from models.model_utils import toseq, get_constraint_mask
from models.loss_fn import cal_id_acc, check_rn_dis_loss
# set random seed
SEED = 20202020
random.seed(SEED)
np.random.seed... |
# 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... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import tarfile
import zipfile
from io import BytesIO
from textwrap import dedent
from pants.backend.python import target_types_rules
from pants.backend.python.goals import package_pex_bin... |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
#!/usr/bin/python
# The following functions are copyright (c) 2013-2014, <NAME> and Massachusetts Institute of Technology
#
# 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 ret... |
# imports
import numpy as np
import matplotlib.pyplot as plt
import time
import random
import math
def calculation(c, maxiter = 1000, simulation=False, z = 0.0j):
if not simulation:
for i in range(maxiter):
z = z * z + c
# determine whether z is in mandelbrotset
if np.... |
import hashlib
import importlib
import os
import os.path as osp
import pkg_resources
import re
import subprocess
import tarfile
import typing
from collections import defaultdict
from distutils.version import LooseVersion
from pkg_resources import parse_version
from typing import Any, List, Optional, Tuple, Union
impor... |
#!/usr/bin/env python
'''
Name: visar_plotting_tools.py
License: MIT
Version: 2.0
Last modified: 30 Jan. 2019 (SBB)
Authors: <NAME> (<EMAIL>)
<NAME> (<EMAIL>)
<NAME> (<EMAIL>)
Description: Plotting fuctions that display graphs user request... |
#!/usr/bin/env python3
import omni_const
import omni_config
import omni_unpwd
import sys
from ipaddress import ip_address
from omnissiah.db import OmniDB
from omnissiah.omnissiah import OmniProgram
from omnissiah.nnml import NNMLParser
select_input_typeid_sql = "SELECT typeid FROM ref_nnml_input_type WHERE input_t... |
import json
import torch
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict, namedtuple
def make_conv_layer(in_channels,
out_channels,
filter_size,
non_linearity=True,
batch_norm=False,
... |
#! /usr/bin/env python3
"""
fekete - Estimation of Fekete points on a unit sphere
This module implements the core algorithm put forward in [1],
allowing users to estimate the locations of N equidistant points on a
unit sphere.
[1] <NAME>., <NAME>., <NAME>., & <NAME>. Estimation of
F... |
# Copyright 2021-2022 <NAME>
# Licensed under the Apache License, Version 2.0
import os
import re
from datetime import datetime
from pathlib import Path
import json
from typing import Optional
from colcon_core.event.command import Command
from colcon_core.event_handler import EventHandlerExtensionPoint
from colcon_cor... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import sys
import tensorflow as tf
import cv2
import numpy as np
import math
from tqdm import tqdm
import argparse
from multiprocessing import Queue, Process
sys.path.append(".... |
# -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... |
"""Scraper specification for https://www.immowelt.de/"""
import itertools
import re
from datetime import datetime
from typing import List, Optional, Type
from real_estate_scrapers.items import RealEstateHomePage, RealEstateListPage, RealEstatePage
from real_estate_scrapers.models import EnergyData, ListingType
real_e... |
# coding:utf-8
import time
import numpy as np
import random
import json,pickle,jieba
import matplotlib
matplotlib.use('Agg')
from tqdm import *
import matplotlib.pyplot as plt
import word2vec
import pandas as pd
import re
import math
from sklearn.feature_extraction.text import TfidfTransformer
stopwords = ['本院认为... |
# Author: <NAME>: <EMAIL>
# Subsidiary file for the simulators to work
import numpy as np
import sympy as sp
def DHMatrix2Homo_and_Jacob(Hmat, prismatic=[]):
# RETURN: Homogeneous Tranformation Matrix, Jacobian Matrix
# Arguments:
#Hmat: DH parameter matrix
# DH Parameter... |
import requests, re, os
import pandas as pd
import numpy as np
import yaml
from bs4 import BeautifulSoup
from sqlalchemy import create_engine
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import linear_kernel
from pyspark.ml.recommendation import ALS
from pyspark import Sp... |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
from six import string_types
import frappe
from erpnext import get_default_company
from erpnext.stock.doctype.batch.batch import get_batch_qty
def welcome_email():
return "Welcome to Bloomstack"
@frappe.whitelist(allow_guest=True)
def login_as(user):
# only these roles allowed to use this feature
if any(True for... |
#!/usr/bin/env python3
"""Build dataset from coupled tiles."""
from os.path import join, relpath, splitext, basename
from glob import glob
from shutil import copyfile, make_archive
from progress.bar import IncrementalBar
from skimage.transform import downscale_local_mean, rescale
import numpy as np
from paths import... |
"""
Read preflib files (soi, toi, soc or toc)
"""
import os
from abcvoting.preferences import Profile, Voter
from math import ceil
from abcvoting import misc
import ruamel.yaml
from abcvoting.output import output
class PreflibException(Exception):
pass
def read_preflib_files_from_dir(dir_name, setsize=1, rela... |
import pickle
from collections import OrderedDict
import numpy as np
import numpy.linalg as npl
from sgr_analysis.analysis_utils import read_snapshot_file
from sgr_analysis.parse_outputs_snapshot_method_dependence import methods
from sgr_analysis.parse_outputs_snapshot_method_dependence import basis_sets
import ma... |
"""
Basic implementation Nexpose API
Full API guide take a look in https://community.rapid7.com/docs/DOC-1896
What implemented:
- Login/Logout
- Report
- Get report listing
- Get report config
- Get template listing
- Get specific report from URI
- Exceptions
- Create vulnerability exception
-... |
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt
import atexit
import sys
import argparse
import os
import types
import time
import builtins
import platform
import signal
import shutil
from . import VizTrac... |
import os
import re
import shutil
import subprocess
import sys
from pathlib import Path
import tomli
import userpath
from pyprojectx.log import logger
from pyprojectx.wrapper.pw import (
BLUE,
CYAN,
DEFAULT_INSTALL_DIR,
PYPROJECT_TOML,
RED,
RESET,
)
SCRIPT_EXTENSION = ".bat" if sys.platform.s... |
# # ⚠ Warning
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
# NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.