text stringlengths 6.04k 39.5k |
|---|
# ref: https://github.com/prince-ph0en1x/QuASeR/blob/819fcfa85a3a9486ee27a95808f245e51ab1d5de/QA_DeNovoAsb/denovo_009.py
"""
Explore embedding
"""
import numpy as np
import math
import matplotlib.pyplot as plt
import networkx as nx
import sys
import itertools
import random
import time
import dimod
import minorminer
... |
# -*- coding: utf-8 -*-
"""
Project: Psychophysics_exps
Creator: Miao
Create time: 2021-01-05 19:14
IDE: PyCharm
Introduction:
"""
import pandas as pd
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt
from src.analysis.exp1_local_density_analysis import dict_pix_to_deg, get_result_dict, int... |
#!/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.
import numpy as np
import habitat
from habitat import make_dataset
from habitat.config.default import get_config
from h... |
'''
(c) 2010-2012 <NAME>
License: BSD-2-Clause
'''
from pymol import cmd, CmdException
def _assert_package_import():
if not __name__.endswith('.creating'):
raise CmdException("Must do 'import psico.creating' instead of 'run ...'")
def join_states(name, selection='all', discrete=-1, zoom=0, quiet=1, *, _... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Widget that handles communications between a console in debugging
mode and Spyder
"""
# Standard library imports
import pdb
import re
# Third-party imports
from... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
"""Implement models for EFS resources.
See AWS docs for details:
https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html
"""
import json
import time
from copy import deepcopy
from hashlib import md5
from moto.core import ACCOUNT_ID, BaseBackend, BaseModel, CloudFormationModel
from moto.core.utils import (
camel... |
import matplotlib
from matplotlib.lines import Line2D
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
import fit_scaling_law
import matplotlib.font_manager
# FYI if tex is not installed, some of the plotting will break.
def setup_fonts(use_tex=True):
matplotlib.rcParams['pdf.fonttype'] =... |
from typing import List, Optional, Dict
import numpy as np
import tensorflow as tf
from itertools import chain
from tensorflow.keras.preprocessing.sequence import pad_sequences
from hotpot.configurable import Configurable
from hotpot.data_handling.qa_training_data import SpanQuestionAndParagraphs
from hotpot.data_han... |
import os
import sys
import json
import argparse
import time
from collections import defaultdict
from easydict import EasyDict
from tqdm import tqdm
import torch
import torch.nn.functional as F
import torch.distributed as dist
from transformers import AutoTokenizer, PretrainedConfig
from transformers import AutoModel... |
import numpy as np
import os
import logging
import numbers
import tempfile
import time
import torch
import torch.distributed as dist
import ray
from ray.tune import Trainable
from ray.tune.trial import Resources
from ray.util.sgd.torch.distributed_torch_runner import (
DistributedTorchRunner)
from ray.util.sgd im... |
"""This module uses multiple techniques to gain insight about known entity usage"""
import ast
import importlib
import inspect
from importlib import util # A python bug makes this necessary
from pathlib import Path
from astunparse import unparse
from logzero import logger
from plinko.deep import code_parser
from plin... |
"""
Copyright (c) 2019-present NAVER Corp.
MIT License
"""
# -*- coding: utf-8 -*-
import sys
import os
import time
import argparse
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
from PIL import Image
import cv2
from skimage import io
import numpy as np
i... |
import sys, os
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import omnifig as fig
import numpy as np
# %matplotlib tk
from matplotlib import cm
import omnilearn as learn
from omnilearn import util
@fig.Component('point-enc')
class PointEncoder(learn.Encodable, learn.Visual... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.github
~~~~~~~~~~~~~~~~~~~
Custom lexers for GitHub.com
:copyright: Copyright 2012 by GitHub, Inc
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
using, Delegating... |
######################################################################################
# Elliptic Curve
# Elliptic curves in reduced Weierstrass form over prime order fields
# Author: <NAME>, <<EMAIL>>
# Date: 17 Feb, 2018
# Version 0.26
# License: Simplified BSD (see details at bottom)
#########################... |
from imp import reload
import os.path, re, socket, ssl, traceback
import common, ircparser, interpretor, markov
from time import time, sleep
import datetime, random, string
def log(text, type='general'):
try:
common.log(text, type)
except:
ts = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:... |
# -*- coding: utf-8 -*-
import re
from cached_property import cached_property
from dateutil.relativedelta import relativedelta
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ObjectDoesNotExist
from django.core.validators import ValidationError
from django.db import mo... |
import io
import os
import tempfile
import pytest
from baize.datastructures import (
URL,
ContentType,
Cookie,
FormData,
Headers,
MediaType,
MutableHeaders,
MutableMultiMapping,
QueryParams,
UploadFile,
)
def test_url():
u = URL("https://example.org:123/path/to/somewhere?... |
from builtins import str
from builtins import range
from builtins import object
import os
from math import *
import numpy as np
import gdal
from gdalconst import *
# 2D Array coordinates
class ArrCoord(object):
def __init__(self, ival, jval):
self.i = ival
self.j = jval
def get_i(self):
... |
"""
Title: Deep Q-Learning for Atari Breakout
Author: [<NAME>](https://twitter.com/jacoblchapman) and [<NAME>](https://twitter.com/MLech20)
Date created: 2020/05/23
Last modified: 2020/06/17
Description: Play Atari Breakout with a Deep Q-Network.
"""
"""
## Introduction
This script shows an implementation of Deep Q-Lea... |
# Copyright 2018-2020 MobiledgeX, Inc. All rights and licenses reserved.
# MobiledgeX, Inc. 156 2nd Street #408, San Francisco, CA 94105
#
# 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
#
# ... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import itchat, threading, requests, json, time
from flask import Flask
from flask import request
from multiprocessing import Process, Queue
"""消息类型常量"""
add_friend_request_type = 1 # 他人添加机器人为好友请求
msg_request_open_room = 2 # '开房'关键字请求待开房
msg_request_open_room_type = 3 # '开... |
#
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import os
import shutil
import tempfile
import time
from collections import defaultdict
from concurrent.futures.thread import ... |
# *****************************************************************************
# © Copyright IBM Corp. 2021. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/l... |
#!/bin/env python3
"""
Convert a Ibutsu's MongoDB to PSQL
python3 mongo2postgres.py
mongodb://localhost/test_artifacts postgresql://ibutsu:ibutsu@localhost:5432/ibutsu -v
"""
import os
from argparse import ArgumentParser
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from datetime ... |
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from scipy.stats import expon
from scipy.stats import pearsonr
import neurodsp as ndsp
#from neurodsp.timefrequency import _hilbert_ignore_nan
from . import utils
import time
# object that has attributes for taking any segment/ time-series data
cl... |
"""
Copyright (C) 2013 <NAME>
parallel.py is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
parallel.py is distributed in the hope that ... |
import numpy as np
import os
import time
from rlgpu.utils.torch_jit_utils import *
from rlgpu.tasks.base.base_task import BaseTask
from isaacgym import gymtorch
from isaacgym import gymapi
import torch
#from torch.tensor import Tensor
from typing import Tuple, Dict
class Foos(BaseTask):
def __init__(self, cfg,... |
# Copyright (C) 2020, 2022 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This... |
"""
The various serializers.
Pyro - Python Remote Objects. Copyright by <NAME> (<EMAIL>).
"""
import array
import builtins
import uuid
import logging
import struct
import datetime
import decimal
import numbers
import inspect
import marshal
import json
import serpent
import msgpack
from . import errors
__all__ = ["S... |
# Leo colorizer control file for rib mode.
# This file is in the public domain.
# Properties for rib mode.
properties = {
"doubleBracketIndent": "false",
"indentNextLines": "Begin|WorldBegin|FrameBegin|TransformBegin|AttributeBegin|SolidBegin|ObjectBegin|MotionBegin",
"lineComment": "#",
"lineU... |
from sympy import Integer,Symbol,symbols,simplify,Rational,sign,Function,srepr,sin,cos,exp,log,Abs,Add,Mul,Pow,preorder_traversal,N,Float,S,var,sympify
import re, sys
# For debugging purposes, Part 1:
# Basic arithmetic operations
def ConstSIMD_check(a):
return Float(a,34)
def AbsSIMD_check(a):
return Abs(a)
d... |
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will ... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... |
# 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... |
from __future__ import absolute_import, division, print_function
import iotbx.pdb
import mmtbx.utils
from scitbx.array_family import flex
import mmtbx.refinement.real_space.explode_and_refine
from libtbx.test_utils import approx_equal
from libtbx.utils import null_out
import mmtbx.refinement.real_space.individual_sites... |
#! /usr/bin/env python
"""
LLSG (Gomez Gonzalez et al. 2016)
"""
__author__ = '<NAME>'
__all__ = ['llsg']
import numpy as np
from scipy.linalg import qr
from multiprocessing import cpu_count
from astropy.stats import median_absolute_deviation
from ..conf import time_ini, timing
from ..preproc import cube_derotate, ... |
# import unittest
import pytest
from exchangelib import Message, FileAttachment, Account, Folder, FolderCollection
from exchangelib.restriction import Q
from fn_exchange.util.exchange_utils import exchange_utils, parse_time, FolderError, get_config_option, str_to_bool
try:
from unittest.mock import patch
except Im... |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... |
#-*- encoding: utf-8 -*-
import sys
import os.path
import platform
major = sys.version_info[0]
minor = sys.version_info[1]
path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(os.path.join(path, "source/module"))
sys.path.append(
os.path.join(path,
"build/lib.{}-{}-{}.{}".f... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from copy import deepcopy
import numpy as np
import pandas as pd
import matplotlib.pylab as plt
import statsmodels.api as sm
from scipy.stats import chi2
from gmeterpy.core.relative import RelativeReadings
from gmeterpy.core.relative import Ties
from gmeterpy.core.gvalues... |
# boto3 implementation of
# https://gist.github.com/shadiakiki1986/f6e676d1ab5800fcf7899b6a392ab821
# Docs
# https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudtrail.html#CloudTrail.Client.get_paginator
#
# Requirements: pip3 install boto3 tqdm pandas
# Run: python3 t2.py
#
# Edit 2019-09-1... |
# -*- coding: utf-8 -*-
#
# Copyright 2017-2018 Spotify AB
#
# 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... |
import argparse
import json
import os
import pickle
import time
import typing
from datetime import datetime
from decimal import Decimal
import dateutil
import pandas as pd
from google.cloud import bigquery
from web3 import Web3
from action import Action
from coingecko import add_prices_from_coingecko
from tradingview... |
#! /usr/bin/python
from __future__ import print_function
import sys
import errno
import argparse
from armoryengine.Block import *
from armoryengine.ArmoryUtils import *
from armoryengine.PyBtcAddress import *
from armoryengine.Transaction import *
from armoryengine.MultiSigUtils import *
from CppBlockUtils import Block... |
import torch
from os.path import join
from os.path import isfile
import numpy as np
import pandas as pd
import itertools
from collections import Counter
import tqdm
from torch_geometric.data import InMemoryDataset, download_url
from torch_geometric.io import read_ml
from torch_geometric.data import Data, extract_zip
... |
# standart modules
import time
import os
# blender modules
import bpy
# addon modules
from . import utility
from .. import utils
from .. import details
from .. import version_utils
from .. import skls_browser
# details properties
slots_meshes_props = {
'mesh_0': bpy.props.StringProperty(),
'mesh_1': bpy.pr... |
'''
Copyright 2020 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Wed Oct 21 2020
File : report_data.py
'''
import logging
import os
import hashlib
import uuid
import mimetypes
import CodeInsight_RESTAPIs.project.get_project_inventory
import Code... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import nmap
import datetime
import os
from nose.tools import assert_equals
from nose.tools import raises
from nose import with_setup
from multiprocessing import Value
"""
test_nmap.py - tests cases for python-nmap
Source code : https://bitbucket.org/xael/python-nmap
... |
import logging
import functools
from typing import Dict, Text, Any, List, Optional
from rasa_addons.core.actions.required_slots_graph_parser import (
RequiredSlotsGraphParser,
)
from rasa_addons.core.actions.slot_rule_validator import validate_with_rule
from rasa_addons.core.actions.submit_form_to_botfront import s... |
# -*- coding: utf-8 -*-
"""
These are some useful functions used in sKCSD methods,
This was written by :
<NAME>, <NAME>, <NAME>
Laboratory of Neuroinformatics,
Nencki Institute of Experimental Biology, Warsaw.
N-D Bresenham line algo Copyright 2012 <NAME>
Permission is hereby granted, free of charge, to any person ob... |
from math import ceil
from compas.utilities import average
from compas.utilities import standard_deviation
from compas_singular.datastructures.mesh_quad_pseudo_coarse.mesh_quad_pseudo_coarse import CoarsePseudoQuadMesh
from compas_singular.datastructures.mesh_quad_pseudo.mesh_quad_pseudo import PseudoQuadMesh
from co... |
#!/usr/bin/env python
# Copyright 2018 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
# Government retains certain rights in this software.
import os, sys
import re
###################################################################... |
# coding: utf-8
import os
import time
import logging
from flask import request, make_response, render_template, jsonify
from flask.ext.restful import Resource, abort
from werkzeug import secure_filename
from werkzeug.exceptions import HTTPException
from ..config import Config
from ..utils import udefault
from ..auth ... |
# Copyright (c) 2020 Intel Corporation
#
# 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... |
from typing import cast, Sequence
import unittest
import contextlib
from unittest import mock
import numpy as np
try:
import tek_awg
except ImportError as err:
raise unittest.SkipTest("tek_awg not present") from err
import qupulse.hardware.awgs.tektronix as tektronix
from qupulse.hardware.awgs.tektronix impo... |
# Copyright (c) 2022 Toposware, Inc.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to... |
import multiprocessing as mp
import numpy as np
import tensorflow as tf
import util
_DATA_FORMAT = None
_DTYPE = None
TRAIN = 0
VALID = 1
TEST = 2
def expand_dims(arr, axes):
"""Inserts new dimensions of size 1 into a tensor's shape at the given positions `axes`.
The positions are all intepreted w.r.t. th... |
import tensorflow as tf
@tf.function
def find_change_indices(y):
# y = tf.reshape(y, [-1])
if y.get_shape()[0] == 0:
return tf.constant([], dtype='int32')
shifted = tf.concat([y[:1], y[:-1]], 0)
changes = tf.where(tf.reshape(shifted != y, [-1]))
return tf.cast(tf.reshape(changes, [-1]), ... |
# -*- coding: utf-8 -*-
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Spyder Language Server Protocol Client implementation.
This client implements the calls and procedures required to
communicate with a v3.0 Language Server Protoco... |
# Modified work:
# ------------------------------------------------------------------------
# Copyright (c) 2018 Preferred Networks, Inc.
# ------------------------------------------------------------------------
# Original works of CUDA kernel in forward_gpu and forward_gpu:
# ----------------------------------------... |
#!/usr/local/sci/bin/python
# PYTHON2.7
#
# Author: <NAME>
# Created: 31 January 2017
# Last update: 7 February 2018
# Location: /data/local/hadkw/HADCRUH2/UPDATE2015/PROGS/HADISDH_BUILD/
# GitHub: https://github.com/Kate-Willett/HadISDH_Build
# -----------------------
# CODE PURPOSE AND OUTPUT
# ---------------... |
# cog odc
'''
This script contains similar functions to cog but uses the odc-stac module
instead of a modified version of stackstac. This is considered a superior
module to stackstac.
https://odc-stac.readthedocs.io/en/latest/
Contacts:
<NAME>: <EMAIL>
'''
# import required libraries
import numpy as np
import xarray... |
import gammalib
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
import pdb
def format_ax(ax):
for tick in ax.xaxis.get_major_ticks():
tick.label.set_fontsize(14)
for tick in ax.yaxis.get_major_ticks():
tick.label.set_fontsize(14)
ax.xaxis.set_ticks_position('b... |
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019 Mellanox Technologies, Inc . All rights reserved. See COPYING file
import unittest
import tempfile
import random
import errno
import stat
import os
from pyverbs.qp import QPCap, QPInitAttrEx, QPInitAttr, QPAttr, QP
from pyverbs.pyverbs_error im... |
"""Action to support type hints."""
import inspect
import os
import re
import warnings
import yaml
from argparse import Action, Namespace
from collections.abc import Iterable as abcIterable
from collections.abc import Mapping as abcMapping
from collections.abc import MutableMapping as abcMutableMapping
from collection... |
import time
import tqdm
import colors
import pytube
import random
import requests
import selenium
import prettytable
from colors import color
from pytube import YouTube
from string import ascii_lowercase
from prettytable import PrettyTable
from selenium.webdriver.common.keys import Keys
from social_media.utils import ... |
import DeepFried2 as df
def expand_dims(a, axis):
idx = [slice(None)]*(a.ndim+1)
idx[axis] = None
return a[tuple(idx)]
class TripletCriterion(df.Criterion):
def __init__(self, margin):
df.Criterion.__init__(self)
self.margin = margin
def symb_forward(self, symb_batch, symb_limit... |
# Copyright 2004-2019 <NAME> <<EMAIL>>
# 2008-2018 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later v... |
from math import tau, sqrt, sin, cos, atan2, hypot
import pkgutil
from dataclasses import dataclass
from itertools import chain
from random import uniform
from contextlib import contextmanager
from collections import Counter
import moderngl
from wasabi2d.allocators.packed import PackedBuffer
from wasabi2d import clock... |
"""
Core - drainage runoff / peak flow evaluation module
The functions here is called from ArcToolbox script tools and the CLI
---
# Some notes
- Inlets: these are iteratively created prior to running the tool
- Slope Raster: one time for entire study area, *derived from non-corrected DEM*
- Curve No. Raster: thi... |
# Copyright 2020 <NAME>. All rights reserved.
# This file is licensed to you 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... |
"""
How to create munchable files:
* Create your characters, objects, terrain, and put them into a
collection.
* Give them a property `instance` with a unique value. It will be used
as the filename for the de-duplicated instances.
* Give them a property `entity_type` with a value of `character` or
`map`.... |
import os
import argparse
import pdb
import shutil
from typing import List
import matplotlib.pyplot as plt
import imageio
from copy import deepcopy
from tempfile import TemporaryDirectory
from contextlib import nullcontext
import numpy as np
import nibabel as nib
from asldro.containers.image import NiftiImageContainer
... |
"""
Download and process board game data from BoardGameGeek (BGG).
"""
import itertools
import json
import os
import sys
import threading
from collections import deque
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
from io import BytesIO
from typing import (
Any,
Dict,
... |
import os
import re
import sys
import string
import json
import itertools
import argparse
import multiprocessing
from functools import partial
from collections import Counter
import numpy as np
import pandas as pd
from scipy import sparse
from scipy.io import savemat
from gensim.utils import chunkize
import file_hand... |
#!/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.
import math
from typing import Any, List
import numpy as np
from habitat.config import Config
from habitat.core.dataset... |
import copy
import os
from typing import List
from lxml import objectify, etree # type: ignore
from discopop_explorer.PETGraphX import NodeType, PETGraphX
from discopop_explorer.pattern_detectors.task_parallelism.tp_utils import line_contained_in_region
def cu_xml_preprocessing(cu_xml: str) -> str:
"""Execute... |
import torch
import torch.nn as nn
from torch.nn import init
def make_mlp(dim_list, activation='relu', batch_norm=True, dropout=0):
layers = []
for dim_in, dim_out in zip(dim_list[:-1], dim_list[1:]):
layers.append(nn.Linear(dim_in, dim_out))
if batch_norm:
layers.append(nn... |
# Try to drive Neopixel/ws2812 from the MINDSTORMS Robot Inventor Hub
# Using the SPI class from machine
# THIS DIDN'T WORK. I DIDN'T DEBUG IT WITH A SCOPE.
"""
`neopixel_spi`
================================================================================
SPI driven CircuitPython driver for NeoPixels.
* Author(s): ... |
import abc
import os
import pymongo
import threading
import weakref
from contextlib import suppress
from warnings import warn
from uuid import uuid4
from glob import glob
from bson.objectid import ObjectId
from pymongo.errors import ConnectionFailure
from pocs.utils import current_time
from pocs.utils import serialize... |
import math
import traceback
import wx
import wx.grid
from db import DB_CONN
from .child_window import ChildFrame
from .grid import MyGrid
from .textctrl import MyTextCtrl
from .panel import MyPanel
class MainFrame(wx.Frame):
def __init__(self, title, size):
super(MainFrame, self).__init__(parent=None,... |
# ---------------------------------------------------------------
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# This work is licensed under the NVIDIA Source Code License
# for OSCAR. To view a copy of this license, see the LICENSE file.
# -----------------------------------------------------------... |
import random
import socket
from scapy.fields import ShortField, BitField, ByteField, IntField
from scapy.packet import Packet, bind_layers
from scapy.layers.l2 import LLC
from scapy.compat import raw
from scapy.sendrecv import sendp
from clnp import CLNP
from tpkt import TPKT
from ether import EtherRaw
# Timeout walu... |
__author__ = 'H'
import os
import random
from .CGTArrangeHelper import ArrangeFunction
from .IOparse import search as findfirstraw
import bpy
import string
import types as typemod
def format_filename(s):
valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
filename = ''.join(c for c in s if c i... |
""" Generates CLI commands from parsed swagger file
MIT License
(C) Copyright [2020] Hewlett Packard Enterprise Development LP
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... |
"""
Various Treemaps Generation Algorithms
----
Squarified Treemap Layout
by <NAME>, <EMAIL>
Implements algorithm from Bruls, Huizing, van Wijk, "Squarified Treemaps"
(but not using their pseudocode)
----
Weight Balanced Treemap Layout
by <NAME>, <EMAIL>
Implements a regular one-level treemap generation ... |
#!/usr/bin/env python
# Copyright (c) 2020 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
# Allows controlling a vehicle with a keyboard.
"""
Welcome to CARLA manual ... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. 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 cop... |
######################################################################
#
# Software Name : Cloudnet TOSCA toolbox
# Version: 1.0
# SPDX-FileCopyrightText: Copyright (c) 2020-21 Orange
# SPDX-License-Identifier: Apache-2.0
#
# This software is distributed under the Apache License 2.0
# the text of which is available at ... |
# -*- coding: utf-8 -*-
"""
asdasdasdas
"""
from sklearn import linear_model
from sklearn import preprocessing
from sklearn.preprocessing import PolynomialFeatures
from sklearn.model_selection import learning_curve
from sklearn.model_selection import train_test_split
from sklearn.model_selection import ShuffleSplit
fr... |
'''A Tk-based spectrum viewer that integrates :mod:`ms_deisotope`'s spectrum processing
features.
'''
import sys
import os
import array
import matplotlib as mpl
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,)
from matplotlib.widgets import SpanSelector
import n... |
#!/usr/bin/python
import sys
import klampt
from klampt import vis
from klampt.robotsim import setRandomSeed
from klampt.vis.glcommon import GLWidgetPlugin
from klampt import RobotPoser
from klampt.model import ik,coordinates,config,trajectory,collide
from klampt.math import vectorops,so3,se3
from klampt.vis import GLS... |
import os
import shutil
import json
import threading
import time
from xml.dom.minidom import parseString
from instagram_private_api import ClientConnectionError
from instagram_private_api import ClientError
from instagram_private_api import ClientThrottledError
from instagram_private_api_extensions import live
from i... |
import os
from tqdm import tqdm
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from modeling.backbone.mobilenet import MobileNetV2
from modeling.assp import ASPP
from modeling.domian import DomainClassifer
from modeling.decoder... |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... |
#!/usr/bin/env python
# This file generates Go files from the open-adventure dungeon file.
# It consumes a YAML description of the dungeon and outputs a
# defines.go and dungeon.go pair of Go code files.
#
# This script was created from open_adventure's make_dungeon.py file.
# That original script is:
# Copyright (c... |
import numpy as np
from joblib import Parallel, delayed
import numbers
import time
from sklearn import ensemble
from tqdm import tqdm
import os
from sklearn.metrics import accuracy_score
from scipy.special import softmax
from sklearn.tree import DecisionTreeClassifier
from .PruningClassifier import PruningClassifier
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.