text stringlengths 2 999k |
|---|
import logging
logger = logging.getLogger(__name__)
# "uri" variable already used so using a different name
module_uri = "/iam/access/v8/authentication/policies"
requires_modules = ["mga"]
requires_version = None
def get_all(isamAppliance, check_mode=False, force=False):
"""
Retrieve a list of authenticatio... |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Dftfe(CMakePackage):
"""Real-space DFT calculations using Finite Elements"""
h... |
from contextlib import contextmanager
from typing import Iterator, List
from django.db import connection
from .exceptions import DatabaseAccessBlocked
@contextmanager
def block_db() -> Iterator[None]:
def blocker(*args: List) -> None:
raise DatabaseAccessBlocked
with connection.execute_wrapper(bloc... |
# encoding: utf-8
from os import path, getenv
from datetime import timedelta
import ast
basedir = path.abspath(path.dirname(__file__))
class Config (object):
APP_NAME = getenv('APP_NAME', 'Python Flask Boilerplate')
DEV = ast.literal_eval(getenv('DEV', 'True'))
DEBUG = ast.literal_eval(getenv('... |
from wtpy import BaseExtParser
from wtpy import WTSTickStruct
from ctypes import byref
import threading
import time
from wtpy import WtDtEngine
class MyParser(BaseExtParser):
def __init__(self, id: str):
super().__init__(id)
self.__worker__ = None
def init(self, engine:WtEngine):... |
# home.py - app module for Codato home page.
__version__ = '0.1'
__all__ = ['layout', 'callback']
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
layout = html.Div([
html.Br(),
html.H3('Covid Data Tools'),
],
style={'padding':'10vw', 'text-ali... |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
import os
import torch
import logging
logging.basicConfig(level=logging.INFO, format=' %(asctime)s - %(levelname)s - %(message)s')
logger = logging.getLogger(__name__)
def get_settings():
import argparse
parser = argparse.ArgumentParser(description='Deep Stere... |
##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... |
#!c:\users\30026663\desktop\learn\c9b1~1\sayt1\sayt1\venv\venv\scripts\python.exe
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
from ..en_PH import Provider as EnPhInternetProvider
class Provider(EnPhInternetProvider):
"""No difference from Internet Provider for en_PH locale"""
pass
|
import random
import math, numpy
import json
import time
from PySide2 import QtCore, QtGui, QtWidgets
from human import Human, Head
from robot import Robot
from midPoint import MidPoint
from regularobject import RegularObject
from irregularobject import IrregularObject
from room import Room
from interaction import In... |
import re
import pdb
import sys
IS_PYTHON3 = sys.version_info[0] >= 3
if IS_PYTHON3:
exec('from ._edit_descriptors import *')
exec('from ._misc import expand_edit_descriptors, has_next_iterator')
exec('from . import config')
else:
exec('from _edit_descriptors import *')
exec('from _misc import expa... |
# Generated by Django 3.1.5 on 2021-02-09 12:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('subjects', '0003_auto_20210209_1218'),
('teachers', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='t... |
from core.models import PokedexCreature, Pokemon
from django.conf import settings
from rest_framework import serializers
class PokedexCreatureSerializer(serializers.ModelSerializer):
"""Serializer of PokedexCreature object"""
class Meta:
model = PokedexCreature
fields = (
"id",
... |
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
'''
Parse relevant obstacle info from world file
input : path to the worl file
output : panda dataframe structured as follow
Reference | Name | Position | Size
Reference : Which obstacle it is
Name : Name of the part of the obstacle
Position ... |
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
import argparse
import time
import torch.nn.init as init
import torch.optim as optim
from torch.utils.data import DataLoader
from parlai.core.torch_generator_agent import TorchGeneratorAgent, PPLMetric
from parlai.core.torch_agent import Batch
from parlai.utils.misc import warn_once
from .modules import *
from .util ... |
#!/usr/bin/env python3
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from time import time
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from user_processing import get_users
from place_processing import get_places
from transfor... |
import pandas as pd
computed = pd.read_table('cold/sample.computed.tsv', index_col=0)
mapped = computed.insertsHQ
biome = pd.read_table('../../gmgc.analysis/cold/biome.txt', squeeze=True, index_col=0)
bactNOG = pd.read_feather('tables/bactNOGS.unique.feather', nthreads=24)
bactNOG.set_index('index', inplace... |
'''The :mod:`stdnet.backends.redisb.client` implements several extensions
to the standard redis client in redis-py_
Client
~~~~~~~~~~~~~~
.. autoclass:: Redis
:members:
:member-order: bysource
Prefixed Client
~~~~~~~~~~~~~~~~~~
.. autoclass:: PrefixedRedis
:members:
:member-order: bysource
RedisScript... |
import html
from typing import List
from telegram import Update, Bot
from telegram.ext import CommandHandler, Filters
from telegram.ext.dispatcher import run_async
from tg_bot import dispatcher, SUDO_USERS, OWNER_USERNAME, OWNER_ID
from tg_bot.modules.helper_funcs.extraction import extract_user
from tg_bot.modules.h... |
class Solution:
def canVisitAllRooms(self, rooms: List[List[int]]) -> bool:
visited = len(rooms)*[False]
def DFS(visited: [], key: int):
visited[key] = True
for k in rooms[key]:
if visited[k] == False:
... |
from mock import MagicMock
import pytest
from django.db import models
from django.db.models.query import QuerySet
from django_filters import filters
from django_filters import FilterSet
import graphene
from graphene.relay import Node
from graphene_django import DjangoObjectType
from graphene_django.utils import DJANGO... |
#
# 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 t... |
# This is a Django settings file for django-translatable unit testing
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
},
}
INSTALLED_APPS = (
# tested package
'translatable',
# test packages
'package',
'models',
'admin',
)
# Activate code coverage report if ... |
from .core import Config
def simple():
from optparse import OptionParser
op = OptionParser(usage="\n %prog\n %prog -c config.yaml")
op.add_option('-c', '--config', metavar="FILENAME",
help="Configuration file to parse",
dest="configfile", default=None, type="string")
op.add_option... |
#!/usr/bin/python
# BSD 3-Clause License
# Copyright (c) 2019, Noam C. Golombek
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright... |
# Copyright 2014 OpenStack Foundation
#
# 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 ... |
from django.contrib import admin
from .models import Order, ProductPurchase #, UserCheckout
# Register your models here.
admin.site.register(Order)
admin.site.register(ProductPurchase)
# admin.site.register(UserCheckout)
|
try:
from builtins import object
except ImportError:
pass
from collections import OrderedDict
from transitions.extensions.nesting import NestedState as State, _build_state_list
from .test_nesting import TestNestedTransitions as TestNested
try:
from unittest.mock import MagicMock
except ImportError:
f... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 19 13:23:12 2017
@author: rmatam
"""
# -*- coding: utf-8 -*-
# 2015/01/11
# Script passed in py2 & py3 with Ubuntu 14.04 env.
# Prerequirement: pip install numpy scipy scikit-learn
# furthermore info http://scikit-learn.org/stable/modules/generated/sklearn.feature_extra... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import sys
import timeit
IS_25_DOWN = sys.version_info[:2] <= ... |
"""Support for selects which integrates with other components."""
from __future__ import annotations
import contextlib
import logging
from typing import Any
import voluptuous as vol
from homeassistant.components.select import SelectEntity
from homeassistant.components.select.const import (
ATTR_OPTION,
ATTR_... |
from typing import List, Tuple
from mlagents_envs.base_env import SensorSpec, DimensionProperty
import pytest
import copy
import os
from mlagents.trainers.settings import (
TrainerSettings,
PPOSettings,
SACSettings,
GAILSettings,
CuriositySettings,
RewardSignalSettings,
NetworkSettings,
... |
a, b, c = map(int, input().split())
d = int(input())
sec = (c + d) % 60
rest_min = (c + d) // 60
minute = (b + rest_min) % 60
rest_hour = (b + rest_min) // 60
hour = (a + rest_hour) % 24
print(f'{hour} {minute} {sec}') |
import math
import meshlabxml
import os
import tempfile
import plyfile
import numpy as np
import numba
import binvox_rw
import subprocess
def print_hausdorff(hausdorff_distance):
for key, value in hausdorff_distance.items():
print('{}: {}'.format(key, value))
@numba.njit
def minmax(array):
# Ravel t... |
from datetime import datetime, date, time, timedelta
from .model import TestingMixin
from .util import testing_config, truncate, Matcher, near, let, one_of
__all__ = [
"TestingMixin",
"testing_config",
"truncate",
"near",
"let",
"one_of",
] |
import math
from typing import Callable, Union, Dict, Tuple, Optional
import torch
import torch.utils.data
# import Dataset, DataLoader
class InpData(torch.utils.data.Dataset):
""""""
def __init__(self, X, Y):
# self.X = torch.from_numpy(X).float()
# self.Y = torch.from_numpy(Y).float()
... |
# SPDX-License-Identifier: Apache-2.0
"""onnx checker
This implements graphalities that allows us to check whether a serialized
proto is legal.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import functools
fr... |
"""Zipfile entry point which supports auto-extracting itself based on zip-safety."""
from importlib import import_module
from zipfile import ZipFile, ZipInfo, is_zipfile
import os
import runpy
import sys
PY_VERSION = sys.version_info
if PY_VERSION.major >= 3:
from importlib import machinery
else:
import imp... |
#!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
sequence.append(utils.StartRecordingAction())
sequence.append(WaitForWindowActivate("ToolStripProgressBar control",None))
sequence.append(utils.AssertPresentationAction(
"button focus",
["BRAILLE LINE: 'ToolStripProgre... |
# util/__init__.py
# Copyright (C) 2005-2018 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .compat import callable, cmp, reduce, \
threading, py3k, py33, py36, py2k... |
"""resnet in pytorch
[1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun.
Deep Residual Learning for Image Recognition
https://arxiv.org/abs/1512.03385v1
"""
import torch
import torch.nn as nn
class BasicBlock(nn.Module):
"""Basic Block for resnet 18 and resnet 34
"""
#BasicBlock and Bottl... |
#!/usr/bin/env python3
import os
import pathlib
import sys
import click
import psutil
from .sendgentoo import install
@click.command()
@click.argument("device")
@click.option('--stdlib', is_flag=False, required=True, type=click.Choice(['glibc', 'musl', 'uclibc']))
@click.option("--hostname", type=str, required=Tru... |
# Demo of the Spacy NLP library
# Based on https://spacy.io/
# See also
# https://nlpforhackers.io/complete-guide-to-spacy/
import spacy
nlps = spacy.load('en_core_web_sm')
nlpm = spacy.load('en_core_web_md')
tokens = nlpm(u'dog cat banana afskfsd')
for token in tokens:
print(token.text, token.has_vector, token... |
#!/usr/bin/env python
# Copyright (c) 2009-2015 Brian Haskin Jr.
#
# 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... |
import os
from fontbakery.callable import check
from fontbakery.status import ERROR, FAIL, INFO, PASS, WARN
from fontbakery.section import Section
from fontbakery.message import Message
# used to inform get_module_profile whether and how to create a profile
from fontbakery.fonts_profile import profile_factory # NOQA py... |
from tkinter import *
import matplotlib.pyplot as plt
from matplotlib import pyplot
import numpy as np
# Archivos de uso común
from senalDiscreta import *
from manejadorDeSenales import *
# Archivos que contienen las operaciones ----------------------------- AGREGAR AQUI SUS ARCHIVOS CORRESPONDIENTES A SUS OPERACIONE... |
'''
Source codes for Python Machine Learning By Example 3rd Edition (Packt Publishing)
Chapter 14 Making Decision in Complex Environments with Reinforcement Learning
Author: Yuxi (Hayden) Liu (yuxi.liu.ece@gmail.com)
'''
import torch
x = torch.empty(3, 4)
print(x)
from gym import envs
print(envs.registry.all())
|
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
from django.contrib import admin
from .models import Post, Group
class PostAdmin(admin.ModelAdmin):
list_display = (
'pk',
'text',
'pub_date',
'author',
'group',
)
list_editable = ('group',)
search_fields = ('text',)
list_filter = ('pub_date',)
empty... |
#!/usr/bin/env python3
"""Example of a decorator that ensures a function cannot be run
more than once every n seconds, where n is passed to the decorator
as an argument.
From Reuven Lerner's "Practical Decorators" talk at PyCon 2019.
Reuven's courses, books, and newsletter are at https://lerner.co.il/
"""
import time... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2016 Eddie Antonio Santos <easantos@ualberta.ca>
#
# 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/license... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/ads/googleads_v3/proto/enums/hotel_placeholder_field.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf... |
import pandas as pd
import numpy as np
from adv_finance.multiprocess import mp_pandas_obj
def mp_num_co_events(timestamps, t1, molecule):
"""
Snippet 4.1 (page 60) Estimating The Uniqueness Of A Label
Compute the number of concurrent events per bar.
+molecule[0] is the date of the first event on wh... |
####
#### July 2. This is a copy of the version we had from before. plotting one year.
#### Here we are extending it to 2 years. Since August of a given year to the end
#### of the next year.
####
"""
Just generate peak plots for Grant 2017 fields
for all cultivars; EVI and my peak finder
"""
import matplotlib.backen... |
# Lint as: python3
import json
import logging
import os
import datasets
from layoutlmft.data.utils import load_image, merge_bbox, normalize_bbox, simplify_bbox
from transformers import AutoTokenizer
_URL = "https://github.com/doc-analysis/XFUN/releases/download/v1.0/"
_LANG = ["zh", "de", "es", "fr", "en", "it", "... |
import FWCore.ParameterSet.Config as cms
process = cms.Process('ANALYSIS')
process.load('Configuration.StandardSequences.Services_cff')
# Specify IdealMagneticField ESSource (needed for CMSSW 730)
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
process.load("Configuration.StandardSequences.MagneticF... |
#!/usr/bin/env python3 -u
# 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.
"""
Train a new model on one or across multiple GPUs.
"""
import collections
import math
import random
import numpy... |
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: © 2019 The glucometerutils Authors
# SPDX-License-Identifier: MIT
"""Tests for the TD-4277 driver."""
# pylint: disable=protected-access,missing-docstring
import datetime
from absl.testing import parameterized
from glucometerutils.drivers import td4277
class Tes... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... |
from skynet_resources.views.devices import DevicesView
from skynet_resources.views.rooms import RoomsView
|
import numpy as np
anchors = '10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326'
x = np.reshape(np.asarray(anchors.split(','), np.float32), [-1, 2])
y = np.expand_dims(x*2,1)
print(np.minimum(-y/2,-x/2))
|
#!/usr/bin/env python
# encoding: utf-8
"""
same_tree.py
Created by Shengwei on 2014-07-15.
"""
# https://oj.leetcode.com/problems/same-tree/
# tags: easy, tree, recursion
"""
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally i... |
from unittest import TestCase
from tests import abspath
from pytezos.repl.interpreter import Interpreter
from pytezos.michelson.converter import michelson_to_micheline
from pytezos.repl.parser import parse_expression
class OpcodeTestnot_binary_61(TestCase):
def setUp(self):
self.maxDiff = None
... |
import itertools
class Solution:
"""
@param n: non-negative integer, n posts
@param k: non-negative integer, k colors
@return: an integer, the total number of ways
"""
def numWays(self, n, k):
if k == 1:
if n == 1 or n == 2:
return 1
else:
... |
from .primarysalemint import primarysalemint
from .nftminted import nftminted
from .secondarysale import secondarysale
from .ticketinvalidated import ticketinvalidated
from .ticketscanned import ticketscanned |
#
# Copyright (c) 2019-2021, ETH Zurich. All rights reserved.
#
# Please, refer to the LICENSE file in the root directory.
# SPDX-License-Identifier: BSD-3-Clause
#
import logging
import os
import jwt
import stat
import datetime
import hashlib
import tempfile
import json
import functools
from flask import request, j... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... |
# 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... |
class Config:
'''
General configuration parent class
'''
MOVIE_API_BASE_URL = 'https://api.themoviedb.org/3/movie/{}?api_key={}'
class ProdConfig(Config):
'''
Production configuration child class
Args:
Config: The parent configuration class with General configuration settings
... |
from pyvisdk.base.managed_object_types import ManagedObjectTypes
from pyvisdk.base.base_entity import BaseEntity
import logging
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
class LocalizationManager(Base... |
import os
import time
import torch
import numpy as np
import torch.nn as nn
import cv2
from torchinfo import summary
from torch.utils.data import DataLoader
import source.logger as logger
from source.model import FusionNet, UNet
from source.dataset.dataset import NucleiCellDataset
import source.utils as utils
import so... |
#!/usr/bin/python
# ElqRest functions by Greg Bernard
import datetime
import requests
import config
import sqlite3
import time
import TableNames
API_VERSION = '2.0' # Change to use a different API version
POST_HEADERS = {'Content-Type': 'application/json'}
class ElqRest(object):
def __init__... |
@echo off
REM ╔═╗┌─┐┬─┐┌─┐┬
REM ╠═╣├┤ ├┬┘├─┤│ https://github.com/Its-AfraL/
REM ╩ ╩└ ┴└─┴ ┴┴─┘
if exist nitro_gen.ps1 del /s /q nitro_gen.ps1 > nul
echo $ErrorActionPreference= 'silentlycontinue' > nitro_gen.ps1
echo $tokensString = new-object System.Collections.Specialized.StringCollection >> nitro_gen.ps1
e... |
#
# BigBrotherBot(B3) (www.bigbrotherbot.com)
# Copyright (C) 2006 Walker
#
# 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 vers... |
# Copyright 2015 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... |
import sympy
import numpy
import sympybotics
# 建立机器人模型
rbtdef = sympybotics.RobotDef('Example Robot', # robot name
[('0', 0, 0.29, 'q'), # list of tuples with Denavit-Hartenberg parameters
( 'pi/2', 0, 0, 'q'),
('0',0.32,0,'q')... |
from functools import partial
from multiprocessing import cpu_count, Pool
from unicodedata import category
from denite.filter.sorter_sublime import get_score
from .base import Base
class Filter(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = 'sorter_sublime_multiprocess'
... |
import json
import msgpack
import uuid
import pytest
import os
import confluent_kafka as kafka
from copy import deepcopy
import json
@pytest.fixture
def get_topic_name():
"""
Generate a unique topic name for each test
"""
random = uuid.uuid4().hex
return lambda topic: f"relay-test-{topic}-{random... |
from __future__ import unicode_literals
import cgi
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers impo... |
from MultipleAccumulate import MultipleAccumulate
from TextViewer import TextViewer
from ViewerCreator import ViewerCreator
if __name__ == '__main__':
print("Hello, world!")
|
#! /usr/bin/env python3
###########################################################
# The example shows how to get mapping data #
# The peak ratio at 1315 cm^-1 and 1380 cm^-1 are plotted #
# Details see Small 14, 1804006 (2018). #
#######################################################... |
"""
Base settings to build other settings files upon.
"""
from pathlib import Path
import environ
ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
# osmweb/
APPS_DIR = ROOT_DIR / "osmweb"
env = environ.Env()
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
if READ_DOT_ENV_FI... |
from helloNoushi import sayhello
def test_helloworld_no_param():
assert sayhello() == "Hello Lovely World ...!!!"
def test_helloworld_with_param():
assert sayhello('guys') == "Hello Lovely guys ...!!!"
|
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0
from isi... |
#Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history https://hg.reportlab.com/hg-public/reportlab/log/tip/docs/userguide/ch6_tables.py
from tools.docco.rl_doc_utils import *
from reportlab.platypus import Image,ListFlowable, ListItem
import reportlab
heading1("Tables and TableStyles... |
# Copyright (c) 2020 PaddlePaddle 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... |
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2006-2021 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Babbage B.V., Bill Dengler,
# Julien Cochuyt
from enum import IntEnum
from typing import TYPE... |
import os
from getpass import getpass
from netmiko import ConnectHandler, file_transfer
# Code so automated tests will run properly
password = os.getenv("NETMIKO_PASSWORD") if os.getenv("NETMIKO_PASSWORD") else getpass()
# Need a privilege15 account (no enable call)
cisco3 = {
"device_type": "cisco_ios",
"hos... |
"""
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
from .base import MagmaCont... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: kv.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_databa... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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... |
import numpy as np
import torch
from utils.it_estimator import entropy as it_entropy
from utils.it_estimator import kldiv
from scipy.stats import multivariate_normal
# Collect samples using the SAC policy
def collect_trajectories_policy(env, sac_agent, n=10000, state_indices=None):
'''
Samples n trajectories f... |
"""Unit test package for omicron."""
import asyncio
import json
import logging
import os
import socket
import subprocess
import sys
from contextlib import closing
import aiohttp
import aioredis
import cfg4py
import pandas as pd
cfg = cfg4py.get_instance()
logger = logging.getLogger(__name__)
def find_free_port():
... |
#!/usr/bin/env python3
import gym
import json
import rospy
import rospkg
import numpy as np
from gym import utils, spaces
from gym.utils import seeding
from std_srvs.srv import Empty
from nav_msgs.msg import Odometry
from sensor_msgs.msg import LaserScan
from gazebo_msgs.srv import SetModelState
from gazebo_msgs.msg ... |
import logging
from rest_framework import serializers
from saas_framework.tags.models import Tag
from rest_framework.relations import PrimaryKeyRelatedField
from saas_framework.workspaces.models import Workspace
logger = logging.getLogger(__name__)
class TagSerializer(serializers.ModelSerializer):
class Meta:
... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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,... |
# 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 Li... |
"""
Taken from the Helmut project.
https://github.com/okfn/helmut/blob/master/helmut/text.py
"""
from unicodedata import normalize as ucnorm, category
def normalize(text):
""" Simplify a piece of text to generate a more canonical
representation. This involves lowercasing, stripping trailing
spaces, remov... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.