text stringlengths 3.07k 22.1k |
|---|
from pytest import raises
from Authentication import Client
from CommonServerPython import DemistoException
import demistomock as demisto
BASE_URL = 'https://example.com/v1/'
GET_CREDENTIALS = {
'credential': [
{'username': 'User1', 'password': '<PASSWORD>', 'name': 'DBot Demisto'},
{'username': '... |
## Download data from Quandl, Alpaca
import datetime, requests, os, json
import pandas as pd
import numpy as np
## Quandl API
import quandl
quandl.ApiConfig.api_key = os.environ.get('QUANDL', None)
## Alapca API
Alapca_API_key = os.environ.get('APCA_API_KEY_ID', None)
Alapca_API_secret_key = os.environ.get('A... |
import requests
import os
import json
from lxml import html
import argparse
import datetime
import time
import random
from selenium import webdriver
SUMMARY_RULE = [
'//main[@class="content"]/section/div[@class="qa-arrangement"]/div[@class="qa-arrangement-body"]/div[@class="qa-title"]',
'//main/div[@class="qa-... |
import random
import xlsxwriter
import torch.nn as nn
import gym
from itertools import count
import torch
from torch.distributions import Categorical
import torch.nn.functional as F
import numpy as np
class Actor(nn.Module): # 策略网络
def __init__(self, state_size, action_size):
super(Actor, self).__init__(... |
import asyncio
import random
import typing
from typing import Optional, Union
import disnake
from disnake.ext import commands
from monty.bot import Monty
from monty.constants import ERROR_REPLIES, Colours, Icons
from monty.log import get_logger
from monty.utils.converters import WrappedMessageConverter
from monty.uti... |
#!/usr/bin/env python
#############################################################################
##
# This file is part of Taurus
##
# http://taurus-scada.org
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Taurus is free software: you can redistribute it and/or modify
# it under the terms of t... |
from rest_framework import renderers
from clldutils.dsv import UnicodeWriter
# TODO: add in 'How to cite' here
CSV_PREAMBLE = """
Research that uses data from D-PLACE should cite both the original source(s) of
the data and the paper by Kirby et al. in which D-PLACE was first presented
(e.g., research using cultural ... |
"""The named entity recognizer service"""
import argparse
import logging
import logging.config
import os
import pathlib
from memory_profiler import profile
import aiohttp
import traceback
from aiohttp import web
import yaml
from hu_entity.spacy_wrapper import SpacyWrapper, StopWordSize
from hu_entity.named_entity i... |
# -*- coding: utf-8 -*-
"""
file: config.py
@author: Suhail.Alnahari
@description: This file contains all possible configurations for the [metric_loss.py] file
@created: 2021-04-07T09:33:39.899Z-05:00
@last-modified: 2021-04-19T10:00:01.801Z-05:00
"""
# standard library
import os
# 3rd party packages
from torchvi... |
#!/usr/bin/env python3
import argparse
import json
import pandas as pd
import os
import os.path
from collections import namedtuple
import progressbar
import configparser
import numpy as np
import matplotlib.pyplot as plt
FishBoxDetection = namedtuple(
'FishBoxDetection',
['video_id', 'frame', 'x', 'y', 'width... |
#!/home/cabox/miniconda3/envs/clumio/bin/python3
# conda activate clumio
# pip install -r requirements.txt
'''
Python CLI wrapper for the Clumio API
Usage:
clumio-cli.py getvcs
clumio-cli.py getvms
clumio-cli.py backup <group>
clumio-cli.py groups
clumio-cli.py config
clumio-cli.py (-h | --help)
clumio-... |
from moviepy.editor import *
from PIL import ImageFont, ImageDraw, Image
import random
from time import sleep
import settings
import random
import pandas
from subprocess import *
import subprocess
import re
import pickle
import matplotlib
# from google.cloud import texttospeech
"""
Install AVbin at ... |
# Copyright (c) 2019 <NAME>
#
# 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, s... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
from flatland.envs.rail_trainrun_data_structures import Waypoint
import numpy as np
import warnings
from typing import Tuple, Optional, NamedTuple, List
from attr import attr, attrs, attrib, Factory
from flatland.core.grid.grid4 import Grid4TransitionsEnum
from flatland.envs.timetable_utils import Line
f... |
# 每天爬取一次每只股票的分时图
from selenium import webdriver
import time
import json
import requests
from scrapy.selector import Selector
from requests import RequestException
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
... |
import numpy as np
import matplotlib.pyplot as plt
from pactools.utils.testing import assert_equal, assert_array_almost_equal
from pactools.utils.testing import assert_greater, assert_raises
from pactools.utils.testing import assert_array_not_almost_equal
from pactools.dar_model import DAR, AR, HAR, StableDAR
from pac... |
import os
import shutil
import multiprocessing
import numpy as np
import ConfigSpace as CS
from hpbandster.core.worker import Worker
from pathlib import Path
from src.learna.agent import NetworkConfig, get_network, AgentConfig
from src.learna.environment import RnaDesignEnvironment, RnaDesignEnvironmentConfig
from s... |
import re
def min_not_space(t):
t = t.replace(" ","").replace("-","").replace("_","")
t = t.replace("â","a").replace("á","a").replace("à","a")
return t.lower().replace("é","e").replace("é","e").replace("ê","e")
def filter_iphone(SimpleTilte):
target = re.compile(r'(iphone)').findall(SimpleTilte)
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import logging
import numpy as np
from copy import deepcopy, copy
from beartype import beartype
from multiprocessing import Process
from scipy.optimize import minimize
from ... |
#Importing the stuff we need
import pandas as bamboo_bears
import numpy as np
from matplotlib import pyplot as plt
from LSDMapFigure.PlottingRaster import MapFigure
from LSDMapFigure.PlottingRaster import BaseRaster
from LSDPlottingTools import colours as lsdcolours
from LSDPlottingTools import init_plotting_DV
import ... |
import numpy as np
import pandas as pd
import thecannon as tc
import time
from scipy.interpolate import interp1d
import scipy.signal
from run_trainedmodel_keck_post2004 import *
def interpolate_wavelengths(flux_interp_from, cont_interp_from, wv_interp_from, wv_interp_to):
# ---------------------
#
# INPU... |
import pandas as pd
import numpy as np
def MLprobs(x_old, step_len):
"""Returns the quantile values x['x'] and corresponding bins x['y'].
Called during metalog.__init__ method call.
Args:
x_old (:obj: `numpy.ndarray` of type numeric): Input data to fit the metalog distribution to.
- must be... |
# Create your views here.
import csv
import datetime
import logging
from builtins import Exception
from django.conf import settings
from django.core.paginator import Paginator
from django.db.models import Q
from modules.cnmb.models import Physic, Concentration, \
PrescriptionLevel, RouteAdministration, GroupATC, C... |
import importlib
import json
from datetime import datetime
from pathlib import Path
from time import sleep
from typing import Callable, Tuple, Union
import redis
import traceback
import requests
from redis import AuthenticationError
from requests import HTTPError
from config import config
from enums import SIMOS
fro... |
#!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2022 ruarq
#
# 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, c... |
import numpy as np
import pandas as pd
from sfrmaker.routing import find_path, make_graph
def valid_rnos(rnos):
"""Check that unique reach numbers (rno in MODFLOW 6)
are consecutive and start at 1.
"""
sorted_reaches = sorted(rnos)
consecutive = np.diff(sorted_reaches).sum() \
=... |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils.data import TensorDataset, DataLoader, random_split
import numpy as np
import pandas as pd
import crypten
import argparse
class Setting:
"""Parameters for training"""
def __init__(self):
se... |
# Copyright 2020 IBM 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 writing, ... |
# -*- coding: utf-8 -*-
# Copyright 2020 <NAME>
#
# 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 agr... |
from .output import ListTable
from .meta import copy_option, methoddispatch
from .misc import constant, invert_value_mapping, dataframe_value_mapping, extract_kwarg
from .multinomial import multinomial
from itertools import repeat
from copy import deepcopy, copy
import numpy as np
import pandas as pd
class IdentityV... |
from dataclasses import is_dataclass, fields as dataclass_fields, MISSING
from enum import Enum
import sys
import types
import typing
import warnings
from .utils import issubclass_safe
try:
import dateutil.parser
assert dateutil.parser
HAS_DATEUTIL = True
except Exception:
HAS_DATEUTIL = False
_FROM ... |
# Copyright (c) 2020 <NAME>. 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.
# A copy of the License is located at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license" file accom... |
import os
import json
import pandas as pd
import numpy as np
CURRENT_DIR = os.path.dirname(__file__)
INPUT_DIR = os.path.join(CURRENT_DIR, "input")
GRAPHER_DIR = os.path.join(CURRENT_DIR, "grapher")
OUTPUT_DIR = os.path.join(CURRENT_DIR, "..")
def add_iso_codes(dataframe):
iso_codes = pd.read_csv(
os.pa... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
@FileName : Log.py
@Author : citang
@Date : 2021/7/28 5:58 下午
@Description : description the function of the file
"""
import os
import time
import inspect
import traceback
import base64
from framework import Common, Config
from xml.dom.minid... |
#%%
import os, sys, math, pickle, argparse
import numpy as np
path_eng = "UD_English-EWT"
file_train_eng = "en_ewt-ud-train.conllu"
file_dev_eng = "en_ewt-ud-dev.conllu"
file_test_eng = "en_ewt-ud-test.conllu"
np.seterr(divide = 'ignore')
#%%
class Corpus:
def __init__(self, file):
self.sentences = self.... |
import logging
import sys
from dropbox.client import DropboxClient
from nose.tools import * # noqa
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website.app import init_app
from website.models import User, Node
from website.oauth.models... |
"""Stream type classes for tap-chromedata."""
import csv
from pathlib import Path
from typing import Any, Dict, Optional, Union, List, Iterable
from singer_sdk import typing as th # JSON Schema typing helpers
from singer_sdk.streams import Stream
import re
import ftplib
import io
import json
from zipfile import Zip... |
import pytorch_lightning as pl
import torch
import torch.nn as nn
from pytorch_lightning.metrics import Accuracy
import torchmetrics
import torch.nn.functional as F
from cifar10_models.densenet import densenet121, densenet161, densenet169
from cifar10_models.googlenet import googlenet
from cifar10_models.inception impo... |
""" HTTPFind - search subnet for HTTP servers that match a regular expression """
import time
import random
import asyncio
import aiohttp
import argparse
from concurrent.futures import FIRST_COMPLETED
import logging
import ipaddress
from urllib.parse import urlunsplit, urlsplit
import re
logger = logging.getLogger(__... |
import numpy as np
import copy
class TestResultCollector(object):
def __init__(self):
self.results = {}
def __len__(self):
return len(self.results)
def get_results(self):
return self.results
def get_result(self, result_id: str):
assert isinstance(result_id, str), "... |
"""
MIT License
Copyright (c) 2019-2020 mathsman5133
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, publ... |
# this is a starter in 2020
# read the config file
# ref https://pymotw.com/3/configparser/
import os
import webbrowser
import autoit
import time
from configparser import ConfigParser
import subprocess
from tkinter import * # notice the little t, it's T for python 2.
from tkinter import ttk
# get the config file
Co... |
from bearlibterminal import terminal as blt
from random import randint, random
import variables
# BLT colors by name:
# grey (or gray), red, flame, orange,
# amber, yellow, lime, chartreuse, green,
# sea, turquoise, cyan, sky, azure, blue,
# han, violet, purple, fuchsia, magenta, pink,
# crimson, transparent
dirt_col... |
#!/usr/bin/python3
import numpy as np
from pathlib import Path
import pdb
import torch
from mseg.utils.names_utils import (
load_class_names,
get_universal_class_names,
get_classname_to_dataloaderid_map,
)
from mseg.utils.tsv_utils import read_tsv_column_vals
from mseg.taxonomy.taxonomy_converter import ... |
from enum import IntEnum, unique
@unique
class CTS3ErrorCode(IntEnum):
"""Error codes"""
"""
Generic error codes
"""
RET_OK = 0x0000
RET_UNKNOWN_COMMAND = 0x0001
RET_INVALID_PARAMETER = 0x0003
RET_BAD_PARMS = 0x0006
RET_BAD_POINTER = 0x0011
RET_NOTAVAILABLE = 0x0012
RET_IN... |
import pkg_resources
import logging
import platform
from pathlib import Path
import sys
import os
import time
import fire
from sb.cli.config_cmd import ConfigCmd
from sb.benchmark import Benchmark
from sb.benchmark_spec import BenchmarkSpec, win_vol
from sb.provider import Provider
from sb.aws_trace_analyzer import Aw... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import pytest
import astropy.constants as const
import astropy.units as u
import gwent
from gwent import detector
from gwent import binary
load_directory = gwent.__path__[0] + '/LoadFiles/InstrumentFiles/'
# #################################################... |
from concurrent import futures
import math
import random
import requests
def main():
# Configuration module
POP_SIZE = 300
TOURNAMENT_FACTOR = 0.1
MUTATION_FACTOR = 0.005
ELITIST_FACTOR = 0.2
COMPLETE = True # If True, we face the 384-bit problem; otherwise we are doing the 64-bit
... |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# File : learning.py
# Author : <NAME>
# Email : <EMAIL>
# Date : 09/14/2020
#
# Distributed under terms of the MIT license.
from collections import defaultdict
import tqdm
import random
import time
import numpy as np
from numpy.random import RandomState
from sklea... |
"""
Implementation of a Graph data structure
"""
from uuid import uuid4
from typing import Callable
class Vertex:
"""
Class abstraction representation of a given vertex node
* Class cotainer to hold any given content value for a given vertex
* ID set to reflect a DB model or some UUID that is persis... |
from fractions import Fraction
from math import nan, inf
from typing import Any
from itertools import islice
import pytest
from xenterval.typing import Factors
from xenterval.interval import interval as i, Interval
@pytest.mark.parametrize('ratio', [-3, 0, nan, inf, -inf])
def test_incorrect_init_ratio(ratio: float) ... |
#
# Compression application using adaptive arithmetic coding
#
# Usage: python adaptive-arithmetic-compress.py InputFile OutputFile
# Then use the corresponding adaptive-arithmetic-decompress.py application to recreate the original input file.
# Note that the application starts with a flat frequency table of 257 symb... |
import numpy as np
import re
from pymatgen.analysis.local_env import VoronoiNN
from pymatgen.core.structure import Structure
import math
import os
import csv
import argparse
import sys
import time
parser = argparse.ArgumentParser(description='Orbital Field Matrix')
parser.add_argument('root', help='path to the directo... |
#!/usr/bin/env python3
#
# This analyzes the data collected by the data_logger.py script. It is ran
# automatically after the data_logger.py script is ran, but you can also
# invoke it separately and give it JSON data to analyze.
#
# The analysis and data cleanup is carried out in accordance with the
# specification at... |
#!/usr/bin/python
from liveserial import msg
def examples():
"""Prints examples of using the script to the console using colored output.
"""
script = "LIVE-SERIAL Real-time Serial Port Plotter/Logger"
explain = ("For any device connected to a serial port (including USB), "
"it is useful t... |
"""
Django settings for richie project.
"""
import json
import os
from django.utils.translation import ugettext_lazy as _
import raven
from configurations import Configuration, values
from elasticsearch import Elasticsearch
from richie.apps.search.utils.es_indices import IndicesList
BASE_DIR = os.path.dirname(os.pa... |
import os
import boto3
import datetime
import base64
import time
import pprint
import json
import re
import tokenize
import token
from botocore.exceptions import ClientError
try:
import urllib.request as urllib2
except ImportError:
import urllib2
try:
from StringIO import StringIO
except ImportError:
... |
import numpy as np
from random import randint
from copy import deepcopy
from matplotlib import pyplot as plt
#import math
discount_rate = 0.9
learning_rate = 0.2
grid_rows = 10
grid_cols = 10
#nb_cans = math.floor((grid_rows*grid_cols) / 2)
nb_cans = 50
nb_episodes = 5000
nb_moves = 200
epsilon = 1
epsilon_test = 0.... |
import argparse
import os
from os.path import join as pjoin, exists as pexists
import numpy as np
import pandas as pd
import torch
import torch.nn.functional as F
from captum.attr import (
DeepLift,
DeepLiftShap,
LayerGradCam,
)
from pytorch_lightning import seed_everything
from sklearn.metrics import aver... |
"""
enfnet.py
Block implementation of different autoencoder componentss i.e. encoders, decoders, bottlenecks etc.
in addition to normalizing flows - planar and radial
Author : Abhishek .
"""
# PyTorch imports
from torch import nn
from torch import randn, randn_like, tensor, zeros
from torch import device
from torch ... |
import streamlit as st
import pandas as pd
import numpy as np
from patsy import dmatrices
import statsmodels.api as sm
from sklearn.metrics import r2_score, mean_squared_error, mean_absolute_error
from statsmodels.sandbox.regression.predstd import wls_prediction_std
import matplotlib as mpl
import matplotlib.pyplot a... |
""" imports & globals """
import logging
import urllib.request
import csv
import os
from datetime import datetime, date, timedelta
""" configuration """
from config import config
log = logging.getLogger(config['APPLICATION_MAINLOGGER']+'.'+__name__)
""" azure storage repositories """
from storage.azurestoragewrapper... |
import os
import requests
import getpass
import configargparse
from .progress_bar import CustomProgress
from .metadata import Metadata
from .constants import extensions
class Crawler:
base_url = 'https://www.hackerrank.com/'
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gec... |
"""
Decodes compressed certificates from ECC
"""
import hashlib
import binascii
from datetime import datetime, timezone
from logging import getLogger
#pylint: disable=wrong-import-position
# This module uses pykitcommander:
# Functions in this module make use of the pykitcommander package to:
# - program application ... |
__author__ = 'DafniAntotsiou'
'''This is heavily based on behavior_clone of @openai/baselines.gail'''
'''
The code is used to train BC imitator, or pretrained GAIL imitator
'''
import argparse
import tempfile
import os.path as osp
import gym
import logging
from tqdm import tqdm
import tensorflow as tf
from cat_dau... |
# Copyright 2020 <NAME>.
#
# 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, soft... |
from itertools import zip_longest
from typing import List, Collection
import numpy as np
import skimage.segmentation as segm
import scipy.integrate as integrate
from celltk.utils.filter_utils import outside, inside
def segment_peaks_agglomeration(traces: np.ndarray,
probabilities: np.... |
from __future__ import division
from __future__ import unicode_literals
import logging
import datetime as dt
from pymongo.errors import DuplicateKeyError
from modularodm import Q
from modularodm.storage.base import KeyExistsException
from framework.mongo import database
from framework.analytics import clean_page
fr... |
import datetime
import glob
import logging
import os
from typing import Dict, Generic, List, Literal, NewType, Optional, Tuple, TypeVar, TypedDict, Union
import requests
from telegram import Update
from telegram.ext import CallbackContext, CommandHandler, Updater
from telegram.files.location import Location
from teleg... |
import functools
from abc import abstractmethod
import warp
import warp.constants as constants
from warp.pipes.attributes import Parameter, ParameterFile, Product
# types
from typing import Optional, List, Tuple, Dict, Any, Iterator
StrDict = Dict[str, Any]
SelfType = object
__all__ = [
'Pipe',
'Source']
... |
#!/usr/bin/env python3
# Copyright (c) FIRST and other WPILib contributors.
# Open Source Software; you can modify and/or share it under the terms of
# the WPILib BSD license file in the root directory of this project.
import json
import time
import sys
import cv2
import numpy as np
from cscore import CameraServer, ... |
#!/usr/bin/env python3
"""
Geoscience Australia - Python Geodesy Package
Transform Module
Ref1
http://www.icsm.gov.au/sites/default/files/GDA2020TechnicalManualV1.1.1.pdf
Ref2
http://www.mygeodesy.id.au/documents/Karney-Krueger%20equations.pdf
"""
import datetime
from math import radians
import numpy as np
from geo... |
from IPython.core.display import display
from statsmodels.api import OLS
from sklearn.metrics import r2_score, mean_absolute_error, classification_report, f1_score
from sklearn.model_selection import GridSearchCV, train_test_split
from generator_labeler.FeatureExtraction.PredictorFeatureExtraction import show_feature_... |
"""
Computational Cancer Analysis Library
Authors:
Huwate (Kwat) Yeerna (Medetgul-Ernar)
<EMAIL>
Computational Cancer Analysis Laboratory, UCSD Cancer Center
<NAME>
<EMAIL>
Computational Cancer Analysis Laboratory, UCSD Cancer Center
"""
from numpy import array, isnan, ones, r... |
import os
import logging
from logging import Logger
import hashlib
from pathlib import Path
import _pickle as cPickle
from collections import defaultdict
from typing import List, Dict, Optional, NamedTuple, Union
import numpy as np
from tqdm import tqdm
from torch.utils.data import Dataset
from transformers import Ber... |
# -*- coding: utf-8 -*-
"""
**CFSR**
`Restrictions`
The data and this python file may not be distributed to others without
permission of the WA+ team.
`Description`
This module downloads CFSR (daily or monthly) radiation data from
``ftp://nomads.ncdc.noaa.gov``.
Use the CFSR.daily, CFSRv2.daily, CFSR.monthly, or C... |
import json
import os
import socket
from resotolib.baseresources import BaseResource
from resotolib.config import Config
from resotolib.graph import Graph
from resotolib.utils import RWLock
import resotolib.logger
from typing import Iterable, List, Union, Callable, Any, Dict
from googleapiclient import discovery
from g... |
from typing import Any, Dict, Tuple, Union
import jax
import numpy
from jax import numpy as np
import mcx.compiler as compiler
from mcx.trace import Trace
__all__ = ["predict", "sample_forward"]
# -------------------------------------------------------------------
# == PRIOR & POSTERIOR PREDICTIONS ... |
"""
Design
================================================================================
TODO: first step: forget about lazyness and performance.
Fundamental object: Query.
- Query defined independently of the root(s) it will be applied to.
- Query is a callable ? Once defined, applied with `query(doc)` for
... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import sys
sys.path.append("../")
import gcn3d
class GCN3D(nn.Module):
def __init__(self, class_num, support_num, neighbor_num):
super().__init__()
self.neighbor_num = neighbor_num
self.num_part = class_num
self.neig... |
import csv
from pathlib import Path
import pandas as pd
import numpy as np
import torch as torch
from torch import nn
from torch.nn import functional as F
import sklearn
import time
import wandb
import uuid
import numerapi
import pathlib
import os
import shutil
from functools import reduce
import scipy
from fast_soft_s... |
from typing import Dict, Iterable
import argparse
import logging
import os
import re
import shutil
import torch
from allennlp.commands.evaluate import evaluate
from allennlp.commands.subcommand import Subcommand
from allennlp.common.checks import ConfigurationError, check_for_gpu
from allennlp.common import Params
fr... |
import numpy as np
import scipy as sp
from quaternion import from_rotation_matrix, quaternion, as_rotation_matrix
from rlbench.environment import Environment
from rlbench.action_modes import ArmActionMode, ActionMode
from rlbench.observation_config import ObservationConfig, CameraConfig
from rlbench.tasks import *
fr... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 25 16:45:32 2020
@author: nmontes
@description: Compute Shapley value of individual norms in an optimal
normative system, and the cross-alignment.
"""
import math
import copy
import pickle
import json
from itertools import product, combinations
i... |
#!/usr/bin/python3
#
# Antes de usar, execute o seguinte comando para evitar que o Linux feche
# as conexões TCP abertas por este programa:
#
# sudo iptables -I OUTPUT -p tcp --tcp-flags RST RST -j DROP
#
import asyncio
import socket
import struct
import os
import random
import time
FLAGS_FIN = 1<<0
FLAGS_SYN = 1<<1
... |
# Copyright 2021 Huawei Technologies Co., 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 law or agreed to... |
import os
from fastapi import FastAPI, Depends, Path, Query, Body
from fastapi.logger import logger
from fastapi.middleware.cors import CORSMiddleware
from starlette.responses import StreamingResponse
from fastapi.responses import FileResponse
from typing import List
from bson.json_util import dumps, loads
from zipfil... |
"""
Kolibri Hooks API
-----------------
What are hooks
~~~~~~~~~~~~~~
Hooks are classes that define *something* that happens at one or more places
where the hook is looked for and applied. It means that you can
"hook into a component" in Kolibri and have it do a predefined and
parameterized *thing*. For instance, Kol... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2013 Rackspace Hosting
# 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.apac... |
import urllib, json
import sys
from __builtin__ import raw_input
from termcolor import colored
import os
import glob
import webbrowser
def jumbo():
print(colored(" .::.", "cyan"))
print(colored(" .:' .:", ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Made by Ano.Mobb
# Ruby
# Donate: 1GmQaG9R5NPs3ZzR6XPMD9jZk17F9MuoWn
# -*- coding: utf-8 -*-
import os, binascii, ecdsa, hashlib, base58, random, requests, time
print ("""
------------------------------------------------
| ... |
import argparse
import ast
import inspect
import sys
from typing import Any, List, Optional, Set, Tuple
__all__ = ["pypprint"]
def pypprint(*args, **kwargs): # type: ignore
"""Replacement for ``print`` that special-cases dicts and iterables.
- Dictionaries are printed one line per key-value pair, with key ... |
"""Symbolic array classes."""
from itertools import product
import sympy as sym
from sympy.tensor.array import permutedims
import numpy as np
_sympy_array_types = (sym.NDimArray, sym.MatrixBase)
_array_types = _sympy_array_types + (np.ndarray,)
_scalar_types = (sym.Expr, int, float, complex)
_shape_types = (int, tup... |
"""
This is a plugin-wrapper for plugins from type PluginType.Movie
"""
from core.helpers.config import config
from core.plugins.pluginloader import get_plugins
from core.plugins.plugintype import PluginType
from core.plugins.pluginbase import Movie
#region Private Attributes
_plugins = get_plugins(PluginType.Movie... |
"""
HTTP API server for Funnel Rocket - manage datasets, get metadata, run queries.
For long-running operations, the server supports streaming updates with HTTP chunked encoding.
"""
# Copyright 2021 The Funnel Rocket Maintainers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... |
from flask import Blueprint, request, render_template, session, redirect, url_for
from flask.wrappers import Response
from loguru import logger
from src.utils.common.data_helper import load_data
from src.utils.common.plotly_helper import PlotlyHelper
from src.utils.common.project_report_helper import ProjectReports
imp... |
import gi
import requests
import subprocess
import sched, time
import datetime
import threading
import sys
# bitcoin_api_url = 'https://api.coinmarketcap.com/v1/ticker/bitcoin/'
bitcoin_api_url = 'https://blockchain.info/ticker'
response = requests.get(bitcoin_api_url)
response_json = response.json()
type(resp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import math
import time
import signal
import argparse
import asyncio
import pygazebo
import numpy as np
import cv2
from PIL import Image
from pynput import keyboard
from datetime import datetime
from navigation_model import NavigationModel
''... |
import os
import os.path as osp
import numpy as np
import argparse
import pickle
import cv2
from collections import defaultdict
import time
from transforms3d.axangles import axangle2mat
from skimage import io
from azure_people_unpacked import AzurePeopleUnpackedDataset
from PIL import Image
import config
from cap... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.