text stringlengths 2 999k |
|---|
# Copyright 2019 The Bazel 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 applicable la... |
from .download_utils import download_decorator, download_file, unzip_func
from .main_utils import import_module
from .lib_decorators import get_from_config, expand_input, get_elapsed_time, rgb2bgr, cast_kwargs_dict
from .decorators import get_method_time, get_func_time
|
# Copyright (c) Facebook, Inc. and its affiliates.
from .build import PROPOSAL_GENERATOR_REGISTRY, build_proposal_generator
from .rpn import RPN_HEAD_REGISTRY, build_rpn_head, RPN
__all__ = list(globals().keys())
|
from setuptools import setup
setup(
name='markdown-index-autogen',
version='0.1.0'
) |
"""
Simple test case for testing the grid sampling in the subpixel correlation layer compared to conventional shifting.
"""
from unittest import TestCase
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.subpixel_corr import SubpixelCorrelation
class TestSubpixelCorrelation(TestCase):
... |
# 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
# d... |
import json
import logging
from pprint import pprint
import requests
from json.decoder import JSONDecodeError
from response import success, ApiBadRequest, ApiInternalError
from config import ExternalAPI
from services import convert_class_time_table
import json
class RouteHandler:
async def get_time_table(self, r... |
from math import trunc
n=float(input('digite um numero real'))
p=trunc(n)
print(' a porção interira do numero fica: {}'.format(p)) |
from urllib.parse import urlparse
from urllib.request import urlopen
__author__ = 'David Moreno García'
def read(url):
if urlparse(url).scheme == '':
# Assume that this is a file and use 'file:' scheme
schemed_url = 'file:{}'.format(url)
try:
content = urlopen(schemed_url).read().deco... |
VARNISH_SERVERS = ['http://127.0.0.1:8080']
ENABLE_VARNISH = True
ENABLE_ESI = False
|
import sbol2
# This example uses the SBOL Validator (http://synbiodex.github.io/SBOL-Validator/)
# to convert an SBOL document to a GenBank file.
# Create a new Document and read the SBOL file
doc = sbol2.Document('data/BBa_I0462.xml')
# Export the document in 'GenBank' format.
# Write the output to the destination ... |
import os
import paramiko
"""
"""
class SFTP:
def __init__(self, logger=None):
paramiko.util.log_to_file("paramiko.log")
self.logger = logger
self.transport = None
def sftp_connect(self, uri, username, password, port=22):
"""
Connect to SFTP server without a host ke... |
import os
import re
from typing import Callable, List
import click
from demisto_sdk.commands.common.constants import (KNOWN_FILE_STATUSES,
PACKS_PACK_META_FILE_NAME,
TESTS_AND_DOC_DIRECTORIES,
... |
import os
import pdb
from .test_gpt_plugin import TestGPTPlugin
class TestOdoo(TestGPTPlugin):
plugin = "odoo"
def test_load_plugin(self):
gpt = self.gpt()
gpt.gptconfig_settings("plugin", self.plugin)
gpt.gptconfig_set(self.plugin, "url",os.getenv("GP_TRACKING_ODOO_URL", "")... |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Tests microvm start with configuration file as command line parameter."""
import json
import os
import re
import shutil
from retry.api import retry_call
import pytest
from framework import utils
def ... |
from .. import switch
import threading
import time
import random
import unittest
class AttrTest(object):
def __init__(self):
super(AttrTest, self).__init__()
self.a = 0
self.b = 1
self.c = 2
def d(self):
self.d_value = True
def e(self, e, e1):
... |
import tqdm
import time
import cProfile
import numpy as np
from apex import amp
import torch
from torch import nn
from transformers import BertTokenizer, BertConfig, BertModel
from transformers import RobertaModel, RobertaConfig, RobertaTokenizer
from transformers import XLNetTokenizer, XLNetModel, XLNetCo... |
"""
MP2
"""
import time
import numpy as np
import psi4
def mp2(mol, basis="aug-cc-pvdz", ):
print('\nStarting MP2...')
# Memory for Psi4 in GB
psi4.set_memory('2 GB')
psi4.core.set_output_file('output.dat', False)
# Memory for numpy in GB
numpy_memory = 2
psi4.set_options({'basis': basi... |
#coding:utf-8
"""
合并排序
时间复杂度: O(n log n)
空间复杂度:O(n)
"""
def merge(left, right):
result = []
n, m = 0, 0
while n < len(left) and m < len(right):
if left[n] <= right[m]:
result.append(left[n])
n += 1
else:
result.append(right[m])
m +... |
# Copyright 2016 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 ag... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from matplotlib import pylab
from Ska.Matplotlib import hist_outline
if __name__ == "__main__":
binsIn = np.arange(0, 1, 0.1)
angle = pylab.rand(50)
pylab.subplot(121)
pylab.hist(angle,binsIn)
... |
# © Copyright 2020 HP Development Company, L.P.
# SPDX-License-Identifier: MIT
import psycopg2
import configparser
CONFIG_FILE = r'c:\keys\sales.properties'
def my_connect():
config = configparser.RawConfigParser()
config.read(CONFIG_FILE)
db_username=config.get('database', 'login')
db_password=confi... |
from BaseObjects import BaseEDAPage
from EDA import eda_lex_locators
from cumulusci.robotframework.pageobjects import BasePage
from cumulusci.robotframework.pageobjects import pageobject
from selenium.webdriver.common.keys import Keys
@pageobject("Affiliations", "HEDA_Settings")
class AffiliationsSettingsPage(BaseEDA... |
from collections import namedtuple
GameParameters = namedtuple("GameParameters",
["launch_probability", # How likely a bee will be launched from a hive in each turn
"initial_energy", # Initial energy that a newly launched bee has
"... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import time
import unittest
import ray
from ray.rllib import _register_all
from ray.tune import Trainable, TuneError
from ray.tune import register_env, register_trainable, run_experiments
from ray.t... |
# -*- coding: utf-8 -*-
#
# BKT documentation build configuration file, created by
# sphinx-quickstart on Tue Jan 12 21:11:15 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... |
# Copyright 2018 The Oppia 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 applicable ... |
from __experimental__ import nobreak_keyword
def test_nobreak():
x = 1
for i in range(3):
x += 1
nobreak:
x = 42
assert x == 42
x = 1
for i in range(3):
if i == 1:
break
nobreak:
x = 42
assert x == 1
if __name__ == "__main__":
test_nobre... |
# -----------------------------------------------------------
# Behave Step Definitions for Aries DIDComm File and MIME Types, RFC 0044:
# https://github.com/hyperledger/aries-rfcs/blob/main/features/0044-didcomm-file-and-mime-types/README.md
#
# -----------------------------------------------------------
from behave ... |
#!/usr/bin/env python
# Copyright 2016 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... |
"""
byceps.blueprints.site.ticketing.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2014-2022 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from flask import abort, g, request
from flask_babel import gettext
from ....services.orga_team import service as orga_team_service
f... |
# @file aggregate.py
# @brief One script to rule them all.
#
# Downloads schedule data for a specific semester, including course
# meeting times, course descriptions, pre/corequisites, FCEs, and so on.
# @author Justin Gallagher (jrgallag@andrew.cmu.edu)
# @since 2015-04-07
import json
import os.path
fro... |
import cbpro, json
import pandas as pd
from datetime import datetime, timezone
from utils import timedelta, candle_list_to_dataframe, compute_end_timestamp
from .crypto_assets import CryptoAssetInfo, CryptoInstrumentPairInfo
# API used: https://github.com/danpaquin/coinbasepro-python
def format_account_dict(a):
f... |
from typing import Any, Dict, List, Tuple
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from ee.clickhouse.client import sync_execute
from ee.clickhouse.models.element import get_elements_by_elements_hashes
from ee.clickhouse.models.event import ClickhouseEventSerializer
from ee.c... |
__all__ = [
'booking',
'channel',
'chat',
'check_in',
'client',
'crypto_manager',
'http_api',
'packet',
'writer']
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import scrape_common as sc
import scrape_nw_common as snc
url, soup = snc.get_nw_page()
td = sc.TestData(canton='NW', url=url)
item = soup.find(text=re.compile('Anzahl F.lle')).find_parent('p')
assert item, f"Could not find title item in {url}"
date = sc.fin... |
import torch.nn as nn
from torch.autograd import Variable
from collections import defaultdict
from .layers.PRM import Residual as ResidualPyramid
from .layers.Residual import Residual as Residual
from common.arguments import sppe_args
opt = sppe_args()
class Hourglass(nn.Module):
def __init__(self, n, nFeats, ... |
# Copyright 2014 Mirantis 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... |
from enum import Enum
import logging
from weconnect.addressable import AddressableAttribute
from weconnect.elements.generic_status import GenericStatus
LOG = logging.getLogger("weconnect")
class GenericRequestStatus(GenericStatus):
def __init__(
self,
vehicle,
parent,
statusId,
... |
import os
import json
import random
import subprocess
import time
from chaosindy.common import *
from chaosindy.execute.execute import FabricExecutor, ParallelFabricExecutor
from chaosindy.probes.validator_info import get_validator_info, detect_primary
from chaosindy.probes.validator_state import get_current_validator_... |
from panda3d.core import Vec2, LVecBase2i
from DebugObject import DebugObject
class ShadowAtlas(DebugObject):
""" This class manages the shadow atlas, used by LightManager. It supports
reordering the atlas for gaining more space, and also helps by fitting all
shadow maps most efficiently into the atla... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.36
#
# Don't modify this file, modify the SWIG interface instead.
# This file is compatible with both classic and new-style classes.
import _client
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,c... |
import theano
import theano.tensor as T
import lasagne as nn
from lasagne.layers import batch_norm as bn
import os
import utils as u
def build_fcn_segmenter(input_var, shape, version=1):
ret = {}
if version == 1: #for size 256
ret['input'] = layer = nn.layers.InputLayer(shape, input_var)
... |
from hexagon.support.hooks import HexagonHooks
from hexagon.support.yaml import display_yaml_errors
from prompt_toolkit.validation import ValidationError
from hexagon.support.execute.action import execute_action
from hexagon.support.wax import search_by_name_or_alias, select_env, select_tool
from hexagon.domain.tool im... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
# 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... |
# The Main file that controls and calling of other functions. This imports all other files.
import CRC_Calculation # File names
import Device_Number
import Open_Port
import ast
#import Device_Status
#import Signal_Strength
import Sensor_Information
import time
# CREATE A CONDITION WHEN NOTHING IS BEING SEN... |
"""
Django settings for trydjango project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
f... |
#!/usr/bin/env python3
import os
import re
import shutil
from urllib import request
from distutils.version import StrictVersion
MIN_VERSION = "4.3"
with open("templates/Dockerfile-env", "r") as tmpfile:
ENV_CONTENT = tmpfile.read()
with open("templates/Dockerfile-run", "r") as tmpfile:
RUN_CONTENT = tmpfile.... |
# -*- coding: utf-8 -*-
import sys
import make_sentence
def change_ab(text,local):
start = text.find("【" + local + "】")
text_list = list(text)
del text_list[0:start]
text = "".join(text_list)
end = text.find("】")
text_list = list(text)
del text_list[0:end + 1]
text = "".join(text_list)... |
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
"""defines a class that writes :class:`code_creators.module_t` to single file"""
import os
import writer
class sing... |
import math
from copy import deepcopy
from random import random
from typing import List, Tuple
from libraries.cg_lib import diagonal_difference, in_convex_square
from solutions.hill_climbing import flip_edge, randomise_solution
from structures.edge import Edge
class PSOParticle:
"""
Class representing a sing... |
# coding=utf-8
import socket
import gc
import uos
import prometheus
import prometheus.server.socketserver as socketserver
import prometheus.logging as logging
import prometheus.psocket
gc.collect()
shell_enabled = True
class TcpSocketServer(socketserver.SocketServer):
def __init__(self, instance, socketwrapper=N... |
import numpy as np
import tensorflow as tf
import cv2
import matplotlib
import matplotlib.pyplot as plt
from tensorflow.keras.models import load_model
model = load_model('saved_model')
def get_prediction(img):
# checking is the images is database image of real life image.
if type(img) is str:
... |
#*****************************************************************************
# Copyright 2004-2008 Steve Menard
#
# 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... |
from django.urls import path
from .views import PageListView, PageDetailView, PageCreateView, PageUpdateView, PageDeleteView
pages_patterns = ([
path('', PageListView.as_view(), name='pages'),
path('<int:pk>/<slug:slug>/', PageDetailView.as_view(), name='page'),
path('create/', PageCreateView.as_view... |
# -*- coding: utf-8 -*-
import requests
import json
from converters.exceptions import ConversionError
currency = {
"name": "Currency",
"general_method": lambda money, from_unit, to_unit: cur_to_cur(money, from_unit, to_unit),
"units": [
{
"name": "Australian dollars",
"si": ... |
class Engine():
def __init__(self, displacement=1000):
self.displacement = displacement
class EngineWithWheels(Engine):
def __init__(self, displacement=1000, nWheels=4, pressure=100):
super().__init__(displacement)
self.nWheels = nWheels
self.wheels_pressure = pressure
class C... |
from cybereason.exceptions import authz, min_version
import pytest
class Test:
version = 0, 1
@authz('')
@min_version(0, 0)
async def asyncgen(self):
yield True
@min_version(0, 0)
@authz('')
async def asynccorofunc(self):
return True
@pytest.mark.asyncio
async def test_... |
import io
import os
import subprocess
from datetime import datetime
from urllib.parse import urlparse
from rastervision2.pipeline.file_system import (FileSystem, NotReadableError,
NotWritableError)
AWS_S3 = 'aws_s3'
# Code from https://alexwlchan.net/2017/07/listing-s... |
"""The SSDP integration."""
import asyncio
from datetime import timedelta
import logging
from urllib.parse import urlparse
from xml.etree import ElementTree
import aiohttp
from netdisco import ssdp, util
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.generated.ssdp import SSDP
D... |
import pytest
from stackformation.aws.stacks import (vpc, eip)
from stackformation import Infra
import troposphere
@pytest.fixture
def prod_infra():
infra = Infra("test")
prod_infra = infra.create_sub_infra("prod")
return (infra, prod_infra)
def test_vpc_stack(prod_infra):
infra = prod_infra[0]
... |
from abc import ABCMeta, abstractmethod
from lib.Logger import Logger
class engine(object):
__metaclass__ = ABCMeta
def __init__(self):
self.conf = None
self.sql = None
self.metrics = {}
self.logger = Logger('./log/benchmark.log', 'engine')
@abstractmethod
def launch(... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import turtle
n = int(input())
t = turtle.Pen()
t.color('#808782')
t.fillcolor('#abb3ad')
t.up()
t.backward(100)
t.down()
i = 0
t.begin_fill()
while i < n:
t.left(90)
t.forward(50)
t.right(45)
t.forward(10)
t.right(90)
t.forward(10)
t.right(45)
t.forward(50)
t.left(90)
i += 1
t... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
"""PQI
Usage:
pqi ls
pqi use <name>
pqi show
pqi add <name> <url>
pqi remove <name>
pqi (-h | --help)
pqi (-v | --version)
Options:
-h --help Show this screen.
-v --version Show version.
"""
"""
_ __ _,.---._ .=-.-.
.-`." ,`. ,-." - , `. /==/_ /
/==/, - \/==/ , - ... |
from gnpy.core.elements import Transceiver, Fiber, Edfa, Roadm
from gnpy.core.utils import db2lin, lin2db, automatic_nch
from gnpy.core.info import create_input_spectral_information
from gnpy.core.network import build_network
from gnpy.tools.json_io import load_equipment, network_from_json
from networkx import neighbor... |
import datetime
import pytest
from jmm.crawlers import AirAvCrawler
@pytest.mark.parametrize(
'number, title, outline, keywords, studio, release_date', [
(
'SSNI-412',
'軽蔑目光驚慌失措露內褲 夢乃愛華',
'被清純的女孩子嫌棄著給你看內褲的激情興奮180分鐘。一遍特地卷起長裙一遍輕蔑的給你看內褲,陪酒女孩的閉嘴輕蔑露內褲做愛!神女的替身謝罪輕蔑露內褲乳交!學生的強求輕... |
NUM_PLAYERS = 423
NUM_MARBLES = 7194400 # 100x larger than 72061 from Part A. Woof.
circle = [0]
scores = {}
current_pos = 0
for marble in range(1, NUM_MARBLES + 1):
if marble % 100000 == 0: print marble
if marble % 23 is 0:
scores[marble % NUM_PLAYERS] = scores.get(marble % NUM_PLAYERS, 0) + marble
... |
import json
import os
import sqlite3
class DataBase:
def __init__(self, archivo):
# creamos archivo donde guardaremos base de datos
self.conn = sqlite3.connect(archivo)
def readFile(self):
# abrimos archivo donde esta el json
with open('users.json') as file:
data = ... |
"""
Django settings for issue_to_impact_app project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/re... |
import gevent
import simplejson as json
import os
import socket
import logging
from jadi import component
from time import time
from itsdangerous.url_safe import URLSafeTimedSerializer
from itsdangerous.exc import SignatureExpired, BadTimeSignature
import aj
from aj.api.http import url, HttpPlugin
from aj.api.mail imp... |
from ..schema.literature.models import *
from .generic import GenericService
__all__ = ['DocumentService']
class DocumentService(GenericService):
__model__ = Document
|
from arcas.tools import Api
from xml.etree import ElementTree
class Nature(Api):
def __init__(self):
self.standard = 'http://www.nature.com/opensearch/request?&query='
def create_url_search(self, parameters):
"""Creates the search url, combining the standard url and various
search par... |
import xml.etree.ElementTree as etree
import pandas as pd
data = []
tree = etree.parse('/Users/sydnimeyer/Downloads/metadata/journal-article-10.13169_worlrevipoliecon.8.4.0542.xml')
root = tree.getroot()
keywords = []
#creating structure for Pandas dataframe
df_cols = ['publication year', 'keywords']
rows = []
#def... |
# -*- coding: utf-8 -*-
from django.urls import path
from . import views
from .views import (ReportListView,
DocListView,
PatListView,
ReportDetailView,
ReportCreateView,
ReportUpdateView,
... |
from behave.fixture import use_fixture_by_tag
from selenium import webdriver
import os
from configparser import ConfigParser
from selenium.webdriver.common.keys import Keys
import time
from behave.fixture import use_fixture_by_tag
from helper.helper_web import get_browser
caps = {}
def before_all(context):
caps['... |
# Copyright 2014 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 ag... |
from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name='s3-tar',
packages=['s3_tar'],
version='0.1.11',
description='Tar (and compress) files in s3',
long_description=long_description,
long_description_content_type='text/markdown',
autho... |
"""
WSGI config for gsn project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_... |
import json
import threading
import paho.mqtt.client as mqtt
class MessageReceiver:
def __init__(self, data_saver):
with open('communication.json', 'r') as json_file:
config = json.load(json_file)
self.update_topic = config["BASE_TOPIC"] + config["UPDATE_TOPIC_SUFFIX"]
... |
#!/usr/bin/env python
"""
config.py for project-NN-pytorch/projects
Usage:
For training, change Configuration for training stage
For inference, change Configuration for inference stage
"""
import os
__author__ = "Xin Wang"
__email__ = "wangxin@nii.ac.jp"
__copyright__ = "Copyright 2020, Xin Wang"
###############... |
from database import db
# Module to get blocks from the database
def getblock(qtype):
# specific type of data demanding code
# lang resp need
# can be defined more precisely
# block returning code
qtype = str(qtype)
allBlocks = db.child(qtype).get()
return allBlocks
|
import unittest
from programy.storage.stores.sql.dao.map import Map
class MapTests(unittest.TestCase):
def test_init(self):
lookup1 = Map(name='map', key="key", value="value")
self.assertIsNotNone(lookup1)
self.assertEqual("<Map(id='n/a', name='map', key='key', value='value')>", str(loo... |
import argparse
import compile_sandbox
import default_nemesis_proto
import logging
import nemesis_pb2
import os
import runner
import shutil
import tempfile
class Judger(object):
def __init__(self, conf, logger):
self.conf = conf
self.logger = logger
self.checker_path = None
self.w... |
import pytest
from ssz import (
DeserializationError,
SerializationError,
decode,
encode,
)
from ssz.sedes import (
List,
boolean,
bytes32,
bytes48,
bytes96,
bytes_sedes,
empty_list,
uint32,
)
boolean_list = List(boolean)
bytes32_list = List(bytes32)
bytes48_list = List... |
import pkg_resources
import contextlib
import sys
import inspect
import os
import shutil
import appuselfbot
import glob
import math
from PythonGists import PythonGists
from discord.ext import commands
from io import StringIO
from traceback import format_exc
from cogs.utils.checks import *
# Common impor... |
# pylint: disable=redefined-outer-name
import json
import keras
import numpy as np
import pytest
import tensorflow as tf
import bentoml
from tests.integration.utils import (
build_api_server_docker_image,
export_service_bundle,
run_api_server_docker_container,
)
TF2 = tf.__version__.startswith('2')
if ... |
import logging
import unittest
import unittest.mock
from tests.base import LoggingTestsMixin, _CaptureLogHandler
class LoggingTestCase(LoggingTestsMixin, unittest.TestCase):
pass
class LoggingTestCaseTests(unittest.TestCase):
"""Tests for the LoggingTestCase."""
@classmethod
def setUpClass(cls):
... |
# encoding: UTF-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2019 yutiansut/QUANTAXIS
#
# 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... |
import os
def findpath(refpath, cwd = os.getcwd(), depth=10):
currpath = os.path.abspath(cwd)
while depth > 0:
if os.path.exists(os.path.join(currpath, refpath)):
return currpath
depth -= 1
currpath = os.path.abspath(os.path.join(currpath, os.pardir))
return None
|
# Copyright 2017 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.
"""Generates a list of all files in a directory.
This script takes in a directory and an output file name as input.
It then reads the directory and creates a... |
import vnc_api_test
from cfgm_common.exceptions import NoIdError
from tcutils.util import get_random_name, retry
class ServiceGroupFixture(vnc_api_test.VncLibFixture):
'''Fixture to handle service group object
Optional:
:param name : name of the service group
:param uuid : UUID of the service group
... |
import time
import typing as ty
from functools import wraps
F = ty.TypeVar("F", bound=ty.Callable)
def expo(length: int = -1, y: float = 1.0,) -> ty.Iterator[float]:
"""Ends iteration after 'length'.
If you want infinite exponential values, pass a negative number for 'length'.
"""
count = 0
whil... |
from common import *
#from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d.art3d import juggle_axes
from mpl_toolkits.axes_grid1 import make_axes_locatable
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
from matplotlib import colors
from matplotlib.ticker import MaxNLocator
def setup_wra... |
def expression_matter(a: int, b: int, c: int) -> int:
"""Kata url: https://www.codewars.com/kata/5ae62fcf252e66d44d00008e."""
return max(
(a + b) * c,
a + b * c,
a * b + c,
a * (b + c),
a + b + c,
a * b * c
)
|
#!/usr/bin/python3
"""
Prerequisities:
1. pip3 install PyYAML requests
2. set TX_TOKEN env.var. to your API token obtained at https://www.transifex.com/user/settings/api/
Add new language, e.g. Polish:
l10n.py --l10n ..\Release\ConEmu\ConEmu.l10n --add-lng pl Polskie --write-l10n
Download all translations from Trans... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import os
import sys
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..', '..', "common")))
from env_indigo import *
indigo = Indigo()
indigo.setOption("ignore-stereochemistry-errors", "1")
indigo.setOption("ignore-noncritical-query-features", "true")
indigo.setOption("ignore-bad-valenc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.