text stringlengths 3.07k 22.1k |
|---|
#
# This file is part of pysnmp-apps software.
#
# Copyright (c) 2005-2017, <NAME> <<EMAIL>>
# License: http://snmplabs.com/pysnmp/license.html
#
from pysnmp_apps.cli import base
from pysnmp.entity import config
from pysnmp import error
authProtocols = {
'MD5': config.usmHMACMD5AuthProtocol,
'SHA': config.usm... |
import asyncio
import sys
import aiohttp
import botocore.retryhandler
import botocore.endpoint
from aiohttp.client_reqrep import ClientResponse
from botocore.endpoint import EndpointCreator, Endpoint, DEFAULT_TIMEOUT
from botocore.exceptions import EndpointConnectionError, ConnectionClosedError
from botocore.utils im... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""High-level interface to a opus decoder functions"""
__author__ = '<NAME> <<EMAIL>>'
__copyright__ = 'Copyright (c) 2012, SvartalF'
__license__ = 'BSD 3-Clause License'
import opuslib.api.decoder
import opuslib.api.encoder
import opuslib.api.ctl
import opuslib.constan... |
"""
Server classes for the AIRC
"""
import re
import abc
import asyncio
import logging
import websockets
from .enums import ReplyCode, EventType
from .errors import *
from .events import Event
from .utils import insort, LineBuffer, SortedHandler, IRCPrefix
__all__ = ("Server", "DefaultServer")
log = logging.... |
import time
import datetime as dt
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_admin import Admin
db = SQLAlchemy()
admin = Admin(template_mode='bootstrap3')
app = Flask(__name__)
app.config['SECRET_KEY'] = '123456790'
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['FLAS... |
#! /usr/bin/env python2
import sys,os
import argparse
import subprocess
MRFLOW_HOME = os.environ['MRFLOW_HOME']
sys.path.append(MRFLOW_HOME)
import dataset_parameters
def generate_paths(dataset, arg):
""" Generate paths for either Sintel or Kitti
Requires the following environment variables to be set:
... |
"""
The String encoding method is used for a segment that appears as an alphanumeric string
in the URI, and as an ISO 646 (ASCII) encoded bit string in the binary encoding.
"""
_character_map = {
# Symbol: (Hex Value, URI Form)
'!': (0x21, '!'), '"': (0x22, '%22'), '%': (0x25, '%25'), '&': (0x26, '%26'),
'... |
#
# Copyright (C) 2022 Codethink Limited
#
# 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 agre... |
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Any, ClassVar, Optional
from dataclasses import dataclass
from numbers import Real
import cv2 as cv
import numpy as np
from util import cvimage as Image
from util.richlog import get_logger
from . import imgops
... |
# Much of this code is from version dr6.rc1.2 of legacypipe:
# https://github.com/legacysurvey/legacypipe
# The files from which this code was derived
# (legacypipe/survey.py) and (legacypipe/utils.py)
# are licensed under the BSD-3 license as of
# version dr6.rc1.2 of legacypipe (git hash e8a188a).
"""
===============... |
#!/usr/bin/env python
__all__ = ['letv_download', 'letvcloud_download', 'letvcloud_download_by_vu']
import json
import random
import xml.etree.ElementTree as ET
import base64, hashlib, urllib, time, re
from ..common import *
#@DEPRECATED
def get_timestamp():
tn = random.random()
url = 'http://api.letv.com/t... |
from cobras_ts.querier import Querier
from tornado import gen
from bokeh.plotting import figure
from bokeh.layouts import row, column
from bokeh.models import Button, Toggle
from bokeh.models.widgets import Div
from functools import partial
import time
import numpy as np
import pandas as pd
import datashader
colors... |
import csv
import numpy as np
import copy # based on python documentation on how to
# copy lists
import sys
import pickle
from scipy.io import arff
class Node:
def __init__(self, children, splitFeature,
splitChildren, output, label = None, depth = 0):
self.children = children
sel... |
from statsmodels.tsa.stattools import adfuller
from statsmodels.stats.diagnostic import acorr_breusch_godfrey
from statsmodels.regression.linear_model import RegressionResultsWrapper
from pandas import Series, DataFrame
def adf_test(series, terms='c', title=''):
"""
Pass in a time series and an optional title... |
# -*- coding: utf-8 -*-
# Copyright 2020 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... |
import os
import random
import calendar
import datetime
import textwrap
import cgi
import urllib.parse
import operator
import contextlib
import functools
from py31compat.functools import lru_cache
import cherrypy
import importlib_resources
import jinja2.loaders
import pytz
import inflect
import pmxbot.core
import pm... |
#!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, 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 a... |
import cv2
import sqlite3
import numpy as np
import os
import threading
import time
import PIL.Image
import PIL.ExifTags
import datetime
from shutil import copyfile
import subprocess
from upload_video import upload_video
imagePath = '/timelapse/'
hdrPath = '/timelapse/hdr/'
weekTemp = '/timelapse/tmp/week... |
# Copyright 2016 <NAME>
# Copyright 2012-2014 Gentoo Foundation
# Copyright 2012-2014 <NAME> <<EMAIL>>
# Copyright 2012-2014 The Chromium OS Authors
# Use of this source code is governed by a BSD-style license (BSD-3)
# Original version available from:
# https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-projects/p... |
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding 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 require... |
from math import prod
from dataclasses import dataclass
########
# PART 1
@dataclass
class Packet:
version: int
type_id: int
def __init__(self, version, type_id) -> None:
self.version = version
self.type_id = type_id
def parse_hex(hex_string):
bits = []
for ch in he... |
# Copyright (c) 2008 Divmod. See LICENSE for details.
"""
Tests for L{epsilon.amprouter}.
"""
import six
from zope.interface import implementer
from zope.interface.verify import verifyObject
from twisted.python.failure import Failure
from twisted.protocols.amp import IBoxReceiver, IBoxSender
from twisted.trial.unit... |
# importing Python packages
from datetime import datetime, timedelta
import requests, json
# imports custom exceptions from exceptions.py
from exceptions import *
# Base class to handle logs and caches
class BaseLog:
# Init method
# Saves the specified file path
# Keeps a time stamp of when the log class ... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import base64
import urlparse
from recipe_engine import recipe_api
class Gitiles(recipe_api.RecipeApi):
"""Module for polling a git repository using the... |
from __future__ import print_function
import json
import pickle
import timeit
import sys
import numpy as np
import torch
import torch.nn as nn
from torch import cat
import torch.nn.init as init
import math
import sys
sys.path.append('Utils')
#from .LinearModel import alex_net_complete
import torch.nn as nn
from torc... |
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PRO... |
from gridded_noise_nofg import core_eor, core_instr, likelihood, model_name
from py21cmmc.mcmc.mcmc import build_computation_chain
import pickle
import numpy as np
import matplotlib.pyplot as plt
import multiprocessing
nrealisations = 400
nthreads = 4
def _produce_mock(i):
"""Produces a mock power spectrum for pu... |
# Licensed to Modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The Modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "License"); you may not u... |
"""This module provides abstractions for Git repositories.
For ordinary Git repositories, a GitRepository class is provided. Unity project
related specifics are abstracted into a UnityGitRepository class.
"""
from pathlib import Path, PurePath
from typing import Tuple, Collection, Mapping
from subprocess import check_... |
#!/usr/bin/env python
# Lint as: python3
"""Prometheus-based statistics collection."""
import collections
from typing import Dict, Text
import prometheus_client
import six
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import stats as rdf_stats
from grr_response_core.lib.util import co... |
import os
import time
import logging
import numpy as np
from sklearn.metrics import roc_auc_score
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from . import mlp_model
from . import utils_experiment as utils
from .dataloader import Hit_Pair_Dataset
######################################... |
#INTERNET CODE
from fractions import Fraction
class NumberTypeclass:
def zero(self): return 0
def one(self): return 1
def positive(self,x): return x > 0
def iszero(self,x): return x == 0
def nonnegative(self,x): return self.positive(x) or self.iszero(x)
def coerce(self, x): return x
def coer... |
# this code is actually really disgusting
# and I'm ashamed to say that I wrote it
# Raymond
import os
import re
import argparse
from typing import Sequence
import requests
import bs4
from bs4 import BeautifulSoup as bs
import util
# for those epic gamer moments
from epic_gamer_moment import get_epic_gamer_moment
DE... |
# importing libraries
import argparse
import logging
import os
import pickle
from random import sample
import boto3
# tqdm.pandas()
# pandarallel.initialize(progress_bar=True)
# bucket = os.environ.get("BUCKET_NAME", " ")
# raw_data_folder = os.environ.get("RAW_DATA", " ")
logger = logging.getLogger()
logger.setLevel... |
def get_H_matrix(a,b,c,alpha,beta,gamma):
return np.matrix([[a*np.sin(beta), b*np.sin(alpha)*np.cos(gamma),0.],
[0., b*np.sin(alpha)*np.sin(gamma), 0.],
[a*np.cos(beta), b*np.cos(alpha), c]])
def replicate(coordinates, abc, lmn, alpha=90.,gamma=90.,beta=90.):
'''
:p... |
#!/usr/bin/python3
import logging
import argparse
import os
import socket
import subprocess
import sys
import traceback
import time
import shutil
import re
import htcondor
import classad
logger = logging.getLogger("register")
logger.setLevel(logging.ERROR + 10)
DEFAULT_PORT = "9618"
WEBAPP_HOST = "os-registry.opens... |
"""
Documentation testing
Inspired by:
https://github.com/cprogrammer1994/ModernGL/blob/master/tests/test_documentation.py
by <NAME>
This version is simplified:
* Only test if the attribute or method is present in the class. Function parameters are not inspected.
* Include ignore pattern in the implemented set
... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
# Copyright 2020 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... |
#!/usr/bin/env python
# Copyright 2016 <NAME>
# 2016 <NAME>
# Apache 2.0.
# we're using python 3.x style print but want it to work in python 2.x,
from __future__ import print_function
from collections import defaultdict
import argparse
import sys
class StrToBoolAction(argparse.Action):
""" A custom a... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from torch.optim import lr_scheduler
from torch.autograd import Variable
def squash(x):
lengths2 = x.pow(2).sum(dim=2)
lengths = lengths2.sqrt()
x = x * (lengths2 / (1 + lengths2) / lengt... |
import math
from argparse import ArgumentParser
from datetime import timedelta as delta
import numpy as np
import pytest
from parcels import AdvectionEE
from parcels import AdvectionRK4
from parcels import AdvectionRK45
from parcels import FieldSet
from parcels import JITParticle
from parcels import ParticleSet
from ... |
from keras import backend as K
import keras
import tensorflow as tf
import numpy as np
from random import shuffle
from utils import backend
from PIL import Image
from keras.utils.data_utils import get_file
import cv2
def preprocess_input(image):
image /= 255
mean=(0.406, 0.456, 0.485)
std=(0.225, 0.224, 0.... |
import copy
import hashlib
import time
from json import JSONDecodeError
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.plugins.clients.deluge import OutputDeluge
from flexget.plugins.clients.transmission import PluginTransmission
from flexget.utils import json
f... |
import os
import sys
import json
import torch
import logging
from tqdm import tqdm
from . import loader_utils
from ..constant import BOS_WORD, EOS_WORD
logger = logging.getLogger()
# -------------------------------------------------------------------------------------------
# preprocess label
# ----------------------... |
#!/usr/bin/env python3
import json
import os, argparse
import logging, logging.config
from db import Db
from albumParser import AlbumParser
from flask import Flask, redirect, request, url_for, render_template, send_file, make_response, send_from_directory, session
from oauthlib.oauth2 import WebApplicationClient
imp... |
# -*- coding: utf-8 -*-
import os
import logging
import time
from .utils import debounced, flush, gather, kernel_tick, interactive_selection, interactive_cleanup # noqa
import vaex
import IPython.display
base_path = os.path.dirname(__file__)
logger = logging.getLogger("vaex.jupyter")
def _add_toolbar(viz):
fro... |
import copy
import os
import warnings
import yaml
import topside as top
from topside.pdl import exceptions, utils
# imports is a dict of {package name: path to file}, used to locate files to load
# on requested import.
# TODO: make importing more efficent by having a YAML file storing the self.importable_files dict... |
# ==================================================================================================
# Copyright 2011 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
#!/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.
from parlai.core.opt import Opt
from parlai.utils.misc import Timer, round_sigfigs, set_namedtuple_defaults, nice_report... |
#!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... |
# Copyright (C) 2018 AT&T
# Copyright (C) 2016 Midokura SARL.
# Copyright (C) 2015 Ericsson AB
# Copyright (c) 2015 Gigamon
#
# 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 json
import sha3
import rlp
from eth_utils.hexadecimal import remove_0x_prefix
from platon_account import (
Account,
)
from platon_account.internal.transactions import bech32_address_bytes
from eth_utils import (
apply_to_return_value,
is_checksum_address,
is_string,
)
from hexbytes import (
... |
import matplotlib.pyplot as plt
from graphviz import Digraph
from matplotlib.collections import PolyCollection
def draw_DAG(dag, name=None, view=False):
"""
Draws a DAG that represents the repeater protocol to be executed
:param dag: type DAGTask
The DAGTask representing the repeater protocol to e... |
import datetime
from abc import ABCMeta, abstractmethod
from pprint import pprint
from ..Utils import SQL
################################################################################
################################################################################
yest = datetime.date.today() - datetime.timedel... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from dataclasses import dataclass, field
from pathlib import PurePath
from typing import Any, List, Optional, Type, cast
from dataclasses_json import dataclass_json
from lisa import schema
from lisa.node import Node
from lisa.operating_system ... |
"""Generic entity for the HomematicIP Cloud component."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any, Generic, cast
from hahomematic.const import HmEntityUsage
from hahomematic.entity import (
CallbackEntity,
CustomEntity,
GenericEntity,
Gen... |
import voluptuous as vol
from esphome import pins
from esphome.components import light
from esphome.components.light import AddressableLight
from esphome.components.power_supply import PowerSupplyComponent
import esphome.config_validation as cv
from esphome.const import CONF_CLOCK_PIN, CONF_COLOR_CORRECT, CONF_DATA_PI... |
import logging
from datetime import datetime, timezone
from flask import current_app as app
from flask import Blueprint, flash, render_template, request, redirect, url_for
from flask_login import login_required
from flask_paginate import Pagination
from iso8601 import parse_date
from structlog import wrap_logger
from... |
#!/usr/bin/env python3
# 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
# "L... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__: "Dengqi"
import itertools
import math
import sys
import ctypes
import os
import sys
# Try to locate the .so file in the same directory as this file
_file = 'libzhe.so'
_path = os.path.join(*(os.path.split(__file__)[:-1] + (_file, )))
_mod = ctypes.cdll.LoadLib... |
from src.extract_old_site.modules import feature_descriptions as desc
import pytest
from unittest import mock
import pathlib
import os
# Test Data
# Sidebar
index0_html_str = """
<html><body>
<b>Descriptions</b><p>
<a target="body" href="../split/report53.html">Burial 1 Description</a><br>
<a target="body" href="../sp... |
# -*- coding: utf-8 -*-
from operator import attrgetter
import random
from bs4 import BeautifulSoup
from django.utils.translation import ugettext as _
from natsort import natsorted
from reportlab.lib import colors
from reportlab.lib.units import cm
from reportlab.platypus import PageBreak, Paragraph, Spacer, Table, T... |
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 13 09:58:20 2018
scheduling app - providing GUI for reviewing the courses
@author: zhes
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output, State
import PostSolution as ps
#from dash.dependenci... |
import os
import time
import random
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
import torchvision.models as models
import torch.backends.cudnn as... |
# System Imports
import os
import requests
import json
import time
import datetime
# API Tokens
# Add api keys to Heroku config vars to access them
# Using Openweather API
open_weather_token = os.environ.get('WEATHER_KEY')
# DS Logic imports
import pandas as pd
import numpy as np
from math import radians, cos, sin,... |
#!/usr/bin/env python
# coding=utf-8
# The MIT License (MIT)
#
# Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file).
#
# 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 with... |
#!/usr/bin/env python3
## Copyright 2009-2021 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
import sys
import shutil
from glob import glob
from shutil import which
import argparse
from common import *
MODEL_VERSION='v1.4.0'
# Parse the command-line arguments
parser = argparse.ArgumentParser(description=... |
############################################################################
# Original work Copyright 2017 Palantir Technologies, Inc. #
# Original work licensed under the MIT License. #
# See ThirdPartyNotices.txt in the project root for license information. #
# All modifi... |
"""
Make sure that we can build using buildah builder.
"""
import json
import logging
import os
import re
import subprocess
from pathlib import Path
import pytest
from ansible_bender.builders.buildah_builder import buildah, inspect_resource, \
podman_run_cmd
from ..conftest import ab
from ..spellbook import basic... |
from PIL import Image
import numpy as np
import glob
import os
from util import image_augmenter as ia
class Loader(object):
def __init__(self, dir_original, dir_segmented, init_size=(256, 256), one_hot=True):
self._data = Loader.import_data(dir_original, dir_segmented, init_size, one_hot)
... |
"""
Defines all the types in the LambdaDCS language for WikitablesQuestions in Pasupat and Liang (2015).
"""
from typing import List, Optional, Set
from overrides import overrides
from nltk.sem.logic import Type, BasicType, ANY_TYPE, ComplexType as NltkComplexType
from allennlp.semparse.type_declarations.type_declara... |
#!/usr/bin/env python
#
# Copyright 2019 DFKI GmbH.
#
# 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, merg... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for `awesim` module."""
from copy import copy
import unittest
from pkg_resources import resource_filename
import numpy as np
import astropy.units as q
import astropy.constants as ac
import batman
from awesimsoss import TSO, BlackbodyTSO, TestTSO, STAR_DATA, PLAN... |
# -*- mode: python; coding: utf-8 -*-
# Copyright 2017 the HERA Collaboration
# Licensed under the BSD License.
"""Integration with the HERA on-site monitor-and-control (M&C) system.
This module is imported even if M&C reporting is disabled. If that's the case,
the various calls are all no-ops, as tested by seeing if... |
#!/usr/bin/env python3
#
# Author:
# <NAME> (@skelsec)
#
# TODO: implement this better, the ExceptionInformation definition is missing on msdn :(
import io
import enum
from minidump.common_structs import *
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms680368(v=vs.85).aspx
class MINIDUMP_EXCEPTION_STR... |
import enum
import time
from datetime import timedelta
from uuid import uuid4
import boto3
from celery.decorators import periodic_task
from celery.schedules import crontab
from django.conf import settings
from django.core.files.storage import default_storage
from django.core.mail import EmailMessage
from django.templa... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import paddle
import paddle.fluid as fluid
from src.utils.config import cfg
from src.models.libs.model_libs import scope, name_scope
from src.models.libs.model_libs import bn, bn_relu, relu, FC... |
################################################################################
# Copyright (C) 2013-2014 by gempa GmbH
#
# HTTP -- Utility methods which generate HTTP result strings
#
# Author: <NAME>
# Email: <EMAIL>
################################################################################
from __future__... |
import pytest
from topgg import types
d: dict = {
"defAvatar": "6debd47ed13483642cf09e832ed0bc1b",
"invite": "",
"website": "https://top.gg",
"support": "KYZsaFb",
"github": "https://github.com/top-gg/Luca",
"longdesc": "Luca only works in the **Discord Bot List** server. \nPrepend commands... |
# -*- coding: utf-8 -*-
#
# Copyright 2020 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... |
#!/usr/bin/env python
import sys
import rospy
import math
import rospkg # For get param at /service_setting
import yaml # For get param at /service_setting
from std_msgs.msg import String # for map_id
from geometry_msgs.msg import (
Pose,
PoseArray, # for fake_obstacle_layer on costmap
PoseStamped, # Old
... |
import json
import time
from asyncio import TimeoutError
from datetime import timedelta
from json.decoder import JSONDecodeError
from random import choice
from typing import Union
import discord
from discord.ext import commands, tasks
from discord.ext.commands import Cog, command
from lib import (FutureTime,
... |
#!/home/daniel/anaconda3/bin/python
# -*- coding: utf-8 -*-
"""
================================================
main_extract_trt
================================================
This program extracts individual TRT cell data from the original files
and puts it in a separate file for each cell
"""
# Author: fvj
# L... |
# -*- coding: utf-8 -*-
import requests, json, textwrap, time, os, glob, random, hashlib
from random import randint
from PIL import Image, ImageDraw, ImageFont, ImageStat, ImageFilter, ImageEnhance
import nltk
from resizeimage import resizeimage
from tinydb import TinyDB, Query
from time import sleep
from selenium impo... |
# Copyright (C) 2019 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for Program."""
import datetime
import ddt
from ggrc.models import all_models
from ggrc.utils import errors
from integration.ggrc import api_helper
from integration.ggrc.models import... |
import gym
import gym_reacher
import time
import os
import numpy as np
import pandas as pd
import optuna
import yaml
from pathlib import Path
from stable_baselines import A2C, ACKTR, DDPG, PPO1, PPO2, SAC, TRPO, TD3
from stable_baselines import results_plotter
from stable_baselines.results_plotter import load_result... |
import abc
import copy
import warnings
from typing import Any, Dict, Optional, cast # noqa
import dataproperty
import typepy
from dataproperty import DataProperty
from tabledata import TableData
from typepy import Integer
from .._common import import_error_msg_template
from ._excel_workbook import ExcelWorkbookInter... |
import json
import hashlib
import os
import tarfile
import rocketbase.exceptions
# --- CONSTANTS ---
# List of all the required information
LIST_REQUIRED_INFO = [
'username',
'modelName',
'family',
'trainingDataset',
'isTrainable',
'rocketRepoUrl',
'originRepoUrl',
'description',
'... |
import numpy as np
import scipy.integrate as integrate
# from numba import jit
# Parameter set:
# p.g = 9.81;
# p.k10 = 30;
# p.alpha = pi/9;
# p.m = 80;
# p.beta0 = 170/180*pi; % resting angle. Cannot be n*pi
# p.l1 = sqrt(1/(2*(1-cos(p.beta0))));
# p.l2 = p.l1;
# p.l0 = sqrt(p.l1^2 + p.l2^2 - 2*p.l1*p.l2*np.cos(p.be... |
# MIT License
#
# Copyright (c) 2017 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pub... |
# Copyright 2021 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... |
"""
Module for the SOAR/Goodman instrument
.. include:: ../include/links.rst
"""
from IPython.terminal.embed import embed
from pkg_resources import resource_filename
import numpy as np
from astropy.time import Time
from pypeit import msgs
from pypeit import telescopes
from pypeit import io
from pypeit.core import f... |
"""Tests with the ATTAS aircraft short-period mode estimation."""
import collections
import os
import attrdict
import jax
import jax.numpy as jnp
import jax.scipy as jsp
import numpy as np
import scipy.io
import scipy.linalg
from scipy import optimize
import riccati
jax.config.update("jax_enable_x64", True)
cla... |
# Copyright 2018 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
import dataclasses
import io
import logging
from collections import namedtuple
from decimal import Decimal
from difflib import ndiff
from pathlib import Path
from typing import Any, Callable, DefaultDict, Iterator, List, Optional, Set, Union
import click
import pytest
from rich.console import Console, RenderableType
f... |
# Copyright (c) 2020.
# MIT License
#
# Copyright (c) 2019 YumeNetwork
#
# 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
# ... |
import os
from os.path import join as jp
from collections import defaultdict
from tqdm import tqdm
import numpy as np
import pandas as pd
from skimage.measure import label
from dpipe.io import load_json, save_json, load_pred
from dpipe.medim.metrics import dice_score, fraction
from dpipe.commands import load_from_fol... |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.