text stringlengths 2 999k |
|---|
"""Tests for inventory from CLI, interactive, with an EE, missing inventory."""
import pytest
from ..._interactions import Command
from ..._interactions import SearchFor
from ..._interactions import UiTestStep
from ..._interactions import add_indices
from ..._interactions import step_id
from .base import TEST_FIXTURE_... |
#!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... |
from setuptools import setup
setup(
name='python-calendarific',
version='1.0.0',
description='Official Python library for the Calendarific Global Holiday API - https://calendarific.com',
url='https://calendarific.com',
author='Calendarific Tech Team',
author_email='info@calendarific.com',
k... |
#!/usr/bin/env python
from __future__ import print_function
from mindmup_as_attack_trees import *
import sys,json
import re
from collections import OrderedDict
import math
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('mupin', nargs='?', help="the mindmup file that will be processed -- transf... |
"""
Extend pandas with custom array types.
"""
from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Type, Union
import numpy as np
from pandas._typing import DtypeObj
from pandas.errors import AbstractMethodError
from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries
if... |
'''
New Integration Test for License.
@author: Quarkonics tianye
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.opera... |
""" User model. """
# Django
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import RegexValidator
# Models
from cride.utils.models import CRideModel
class User(CRideModel, AbstractUser):
""" User model.
Extend from Django's Abstract User, change ... |
import json
from fixtures import blue_service_one, blue_service_two, red_service_one, \
rediscloud_service
import unittest
from cf_app_utils.service_locator import ServiceLocator
class TestServiceLocator(unittest.TestCase):
def setUp(self):
with open("fixtures/vcap_services_example.json") as json_fil... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: Interface to the Senna tagger
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Rami Al-Rfou' <ralrfou@cs.stonybrook.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
A module for interfacing with the SENNA pipeline.
"""
from os impo... |
# import smtplib
# EMAIL_ADDRESS = "shourovcse17@gmail.com"
# PASSWORD = "1112704646"
# send_to = "snydercut.c40@gmail.com"
# subject = "Test subject"
# msg = "Hello there, \nhow are you today?"""
# try:
# server = smtplib.SMTP('smtp.gmail.com',587)
# server.ehlo()
# server.starttls()
# server.login(... |
#
# 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... |
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a lukd node can load multiple wallet files
"""
import os
from test_framework... |
import glob
import os
import sys
import subprocess
from setuptools import setup
from setuptools.command.build_py import build_py as _build_py
from distutils.spawn import find_executable
proto_in_directory = "./proto"
proto_out_directory = "./tester"
protos = glob.glob(proto_in_directory + "/**/*.proto", recursive=Tr... |
#!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the importmulti RPC.
Test importmulti by generating keys on node0, importing the scriptPubKeys an... |
import sys
import maya.OpenMayaMPx as OpenMayaMPx
import maya.OpenMaya as om
import math, traceback, time
class zChooser(OpenMayaMPx.MPxNode):
pluginNodeId = om.MTypeId(0x124748)
def compute(self, plug, dataBlock):
if plug.isElement():
plug = plug.array()
if plug == self.attr_outp... |
from pipenv.patched.notpip._internal.distributions.base import AbstractDistribution
from pipenv.patched.notpip._internal.distributions.sdist import SourceDistribution
from pipenv.patched.notpip._internal.distributions.wheel import WheelDistribution
from pipenv.patched.notpip._internal.req.req_install import InstallRequ... |
# -*- coding: utf-8 -*-
from intercom import segment
from intercom.api_operations.all import All
from intercom.api_operations.find import Find
from intercom.service.base_service import BaseService
class Segment(BaseService, All, Find):
@property
def collection_class(self):
return segment.Segment
|
from __future__ import absolute_import, division, print_function
from xml.parsers.expat import ExpatError
from xml.dom.minidom import Document
from xml.dom.minidom import parseString
import pytest
from sunpy.util import xml
def test_xml_to_dict1():
"""
should return dict of xml string
"""
source_xm... |
#coding=utf-8
import os
from fetch import FetchFile
class StationName(object):
def __init__(self, session, url, station_name_file):
self.session = session
self.url = url
self.station_name_file = station_name_file
def read(self):
if not os.path.isfile(self.station_name_file):
... |
#Finding the amount of lines that start with the word 'from'
file = raw_input('enter file name:\n')
fhand = open(file, 'r')
count = 0
for line in fhand:
line = line.strip()
if not line.startswith('From'): continue
elif line.startswith('From:'): continue
else:
sline = line.split()
print sline[1]
count = count ... |
#*******************************************************************************
# Copyright 2014-2019 Intel Corporation
# All Rights Reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the Li... |
import importlib
import os
import yaml
from inquirer import errors
from lithopscloud.modules.api_key import verify_iam_api_key
from lithopscloud.modules.utils import color_msg, Color, ARG_STATUS, MSG_STATUS, free_dialog, inquire_user
# TODO: change ibm_cos path to cos after cos-package name changes to cos
CONFIGURABLE... |
from app.models import Election
from app.managers.basemanager import BaseManager
#facade
class ElectionManager(BaseManager):
@staticmethod
def get_by_id(election_id):
Election.qeury.filter_by(id=election_id).first() |
# This file is just Python, with a touch of Django which means
# you can inherit and tweak settings to your hearts content.
# For Docker, the following environment variables are supported:
# SENTRY_POSTGRES_HOST
# SENTRY_POSTGRES_PORT
# SENTRY_DB_NAME
# SENTRY_DB_USER
# SENTRY_DB_PASSWORD
# SENTRY_RABBITMQ_HOST
... |
currencies_id = {1: 'aed',
2: 'afn',
3: 'all',
4: 'amd',
5: 'ang',
6: 'aoa',
7: 'ars',
8: 'aud',
9: 'awg',
10: 'azn',
11: 'bam',
12: 'bbd',
13: 'bdt',
14: 'bgn',
15: 'bhd',
16: 'bif',
17: 'bmd',
18: 'bnd',
19: 'bob',
20: 'brl',
21: 'bsd',
22: 'btc',
23: 'btn',
24: 'bwp',
25: 'byn',
26: 'byr',
... |
'''Train CIFAR10 with PyTorch.'''
from __future__ import print_function
import sys
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision
import torchvision.transforms as transforms
import os
import argparse
import time
... |
# Copyright 2019-2020 Intel Corporation
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Funny Experimental Scheduler. Appears better than original kAFL
scheduler especially for slow targets.
Idea is to favorize nodes based on speed, depth, number of new edges. Weights
are tuned such that initial/redq/grim stages are... |
def load(h):
return ({'abbr': 0, 'code': 0, 'title': 'main run'},
{'abbr': 1, 'code': 1, 'title': 'pre-assimilation'},
{'abbr': 2, 'code': 2, 'title': 'assimilation'},
{'abbr': 3, 'code': 3, 'title': 'test'},
{'abbr': 4, 'code': 4, 'title': 'onscreen analysis'},
... |
# -*- coding: utf-8 -*-
# Natural Language Toolkit: A Chart Parser
#
# Copyright (C) 2001-2017 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com>
# Jean Mark Gawron <gawron@mail.sdsu.edu>
# Peter Ljunglöf <peter.ljunglof@heatherleaf.se>
# URL: <http://n... |
# 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... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... |
# Copyright 2020-present NAVER Corp. Under BSD 3-clause license
import os
import os.path as path
import ctypes
import sys
from typing import Optional
import kapture_localization.utils.path_to_kapture # noqa: F401
from kapture.utils.paths import safe_remove_any_path
from kapture.io.features import guess_feature_name_... |
from __future__ import print_function
import time
import argparse
import numpy as np
from finetune_dataset import FinetuneDataset
import MNN
nn = MNN.nn
F = MNN.expr
def load_feature_extractor(model_file):
var_dict = F.load_as_dict(model_file)
input_var = var_dict['input']
output_var = var_dict['Mobilenet... |
import json
import pytest
from streamsets.testframework.decorators import stub
def test_condition(sdc_builder, sdc_executor):
try:
DATA = [dict(name='Al Gore', birthplace='Washington, D.C.'),
dict(name='George W. Bush', birthplace='New Haven, CT')]
EXPECTED_CONDITION_1_DATA = DATA... |
import random
import torch
from math import exp
from torch.fft import rfft, irfft
import numpy as np
from scipy.signal import find_peaks
from scipy.signal.windows import hamming
#from audio import loadAudio, saveAudio
from sys import exit
from pdb import set_trace as bp
import librosa
import time
EPS = 1e-9
def get_o... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from transformers import BertModel
from .layer import AttentionLayer as AL, GlobalAttentionLayer as GoAL, \
StructAttentionLayer as SAL, ResAttentionLayer as RAL, ContAttentionLayer as CAL
from .dataset import get_lm_path
class TranHGAT(nn.Module... |
# -*- coding: utf-8 -*-
# This file was generated
'''Matcher classes used by unit tests in order to set mock expectations.
These work well with our visatype definitions.
'''
import ctypes
import nise._visatype as _visatype
import pprint
pp = pprint.PrettyPrinter(indent=4)
# Base classes
class _ScalarMatcher(objec... |
#!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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 applicabl... |
import csv
from algorithms.agglomer_clustering import AgglomerClustering
from algorithms.birch_clustering import BirchClustering
from algorithms.dbscan_clustering import DBSCANClustering
from algorithms.kmeans_clustering import KMeansClustering
__author__ = "Konstantin Bogdanoski"
__copyright__ = "Copyright 2020, Bla... |
"""
Partition Species
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2008 Mike Hansen <mhansen@gmail.com>,
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope... |
import copy
import logging
import os
import json
import httplib2
from .tenantinfo import TenantInfo, TenantInfoManager
from . import exceptions
USER_AGENT = "ocboot-python-clien"
logger = logging.getLogger(__name__)
class HTTPClient(httplib2.Http):
def __init__(self, timeout, insecure):
super(HTTPCli... |
# -*- coding: utf-8 -*-
import os
import pytest
import pandas as pd
import numpy as np
import scipy
from lifelines import (
NelsonAalenFitter,
KaplanMeierFitter,
CoxPHFitter,
CoxTimeVaryingFitter,
AalenAdditiveFitter,
WeibullFitter,
LogNormalFitter,
LogLogisticFitter,
WeibullAFTFitt... |
from sympy.combinatorics.permutations import Permutation, _af_invert, _af_rmul
from sympy.ntheory import isprime
rmul = Permutation.rmul
_af_new = Permutation._af_new
############################################
#
# Utilities for computational group theory
#
############################################
def _base_or... |
from pathlib import Path
from typing import List, Optional
import pandas as pd
import pytest
from hyperstyle.src.python.review.inspectors.inspector_type import InspectorType
from hyperstyle.src.python.review.inspectors.issue import (
BaseIssue,
CodeIssue,
IssueDifficulty,
IssueType,
LineLenIssue,
... |
from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class TransactionOptions(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.json_seri... |
from dataclasses import dataclass, field
from typing import Dict, List, Union
from config import Config
@dataclass
class CaptioningConfig(Config):
strategy: str = "linewise_scroll"
num_lines: int = 3
characters_per_line: int = 60
enable_highlight: bool = True
punctuation_sensitive: bool = True
... |
import os
from setuptools import find_packages, setup
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='kobodl',
author='Brandon Davis',
version='0.3.7',
author_email='k... |
''' Phabbot's repertoire of learnt behavious.
'''
import asyncio
import re
async def help_prompt(client, phab_url, matches, message):
''' Trigger: r'@phabbot help'
'''
if matches:
response = '''
My name is Phabbot, I'm here to provide a bridge between Discord and
Phabricator. Curre... |
algorithm='ddpg'
env_class='Gym'
model_class='LowDim2x'
environment = {
'name': 'Humanoid-v2',
}
model = {
'state_size': 376,
'action_size': 17,
'fc1_units': 400,
'fc2_units': 300,
}
agent = {
'action_size': 17,
'update_every': 2,
'buffer_size': int(1e5),
'batch_size': 64,
'si... |
from sklearn.metrics import *
import torch
import numpy as np
from keras.utils import to_categorical
import sys
# Utility to return predictions
def return_classes(logits, dim=-1):
#print(logits.shape)
_, predicted = torch.max(logits,dim)
#print(predicted.shape)
return predicted
def return_valsnclasse... |
class LocustNotFoundException(Exception):
pass
class JELoadingTestException(Exception):
pass
class JELoadingTestJsonException(JELoadingTestException):
pass
class JELoadingTestExecuteException(JELoadingTestException):
pass
class JELoadingAssertException(JELoadingTestException):
pass
class H... |
# © 2019 Danimar Ribeiro <danimaribeiro@gmail.com>, Trustcode
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ # pylint: disable=C8101,C8103
'name': 'Plano de Contas para Microempresa e Empresa de Pequeno Porte',
'summary': "Plano de Contas para Microempresa e Empresa de Pequeno Porte",... |
from django.test import RequestFactory, TestCase
from feder.teryt.factories import JSTFactory
from teryt_tree.rest_framework_ext.viewsets import JednostkaAdministracyjnaViewSet
class TerytViewSetTestCase(TestCase):
def setUp(self):
self.factory = RequestFactory()
self.jst = JSTFactory()
def ... |
from adapters.certuk_mod.validation import ValidationStatus, FieldValidationInfo
from observable import ObservableValidationInfo
class MutexValidationInfo(ObservableValidationInfo):
TYPE = 'MutexObjectType'
def __init__(self, observable_data, **field_validation):
super(MutexValidationInfo, self).__... |
"""Database models used by Metricity for statistic collection."""
from datetime import datetime
from typing import Any, Dict, List
from sqlalchemy.dialects.postgresql import insert
from metricity.database import db
class Category(db.Model):
"""Database model representing a Discord category channel."""
__t... |
from setuptools import setup
with open('README.md') as f:
readme = f.read()
setup(
version='1.3.1',
name='Fever-FuelSDK',
description='Fever Salesforce Marketing Cloud Fuel SDK for Python',
long_description=readme,
long_description_content_type="text/markdown",
author='Feverup',
py_mod... |
"""
MIT License
Copyright (c) 2019-present Josh B
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, publish... |
# -*- coding: utf-8 -*-
import copy
import numpy as np
from numpy.linalg import inv, slogdet
from scipy.stats import norm
from statsmodels.compat.pandas import Appender
import statsmodels.base.model as base
import statsmodels.base.wrapper as wrap
from statsmodels.iolib.summary import Summary
from statsmodels.regressi... |
import os
import numpy as np
import pandas as pd
import torch
from torch.utils.data.dataset import Dataset
from PIL import Image, ImageFilter
from Utils import utils
import random
import posixpath
def get_list_from_filenames(file_path):
# input: relative path to .txt file with file names
# output: lis... |
# Copyright 2019 Google LLC. 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... |
import logging
from typing import List, TypeVar
import torch # type: ignore
from transformers import ( # type: ignore
AutoModelForSequenceClassification,
AutoTokenizer,
)
from mosec import Server, Worker
T = TypeVar("T")
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
formatter = logging.Forma... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import u... |
""" This module implements all Text to Speech Services.
You may use any of the speech synthesis services by calling the
respective method.
"""
import logging
import os
import subprocess # nosec #pylint-disable type: ignore
import tempfile
from google_speech import Speech
from watson_developer_cloud import TextToSpeec... |
# if running in Jupyter with InlineBackend, ensure we don't crop or enlarge figures
try:
from traitlets.config import get_config
c = get_config()
c.InlineBackend.print_figure_kwargs = {'bbox_inches': None}
except:
pass
from pydove.regplot import regplot, scatter, fitplot, polyfit
from pydove.figure_man... |
# Generated by Django 4.0.3 on 2022-03-25 19:45
import cloudinary.models
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gallery', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='image',
name='image',
... |
from os import environ as env
# Flask config
IP = env.get('IP', '0.0.0.0')
PORT = env.get('PORT', 8080)
SERVER_NAME = env.get('SERVER_NAME', 'light.csh.rit.edu')
PREFERRED_URL_SCHEME = env.get('PREFERRED_URL_SCHEME', 'https')
# DB Info
SQLALCHEMY_DATABASE_URI = env.get('SQLALCHEMY_DATABASE_URI')
SQLALCHEMY_TRACK_MODI... |
# -*- coding: utf-8 -*-
# file: test_train_atepc.py
# time: 2021/5/26 0026
# author: yangheng <yangheng@m.scnu.edu.cn>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
import math
import os
import pickle
import random
import re
import time
from hashlib import sha256
impo... |
from abc import abstractmethod
from .wrapper_session import WrapperSession, consumes_buffers
from osp.core.session.buffers import BufferContext
class SimWrapperSession(WrapperSession):
def __init__(self, engine, **kwargs):
super().__init__(engine, **kwargs)
self._ran = False
@consumes_buffers... |
import io
from typing import TYPE_CHECKING, Any, Dict, List
import cloudpickle
import pendulum
from slugify import slugify
from prefect.engine.results import S3Result
from prefect.environments.storage import Storage
from prefect.utilities.storage import extract_flow_from_file
if TYPE_CHECKING:
from prefect.core.... |
Mein neuer Code
Code nochmal angepasst |
import numpy as np
import pandas as pd
from joblib import Parallel
from joblib import delayed
from itertools import product
from tqdm import tqdm_notebook as tqdm
from .batch_base import BatchBase
class GridSearch(BatchBase):
"""
Implementation of grid search.
Parameters
----------
:type para_... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
import numpy as np
def results_to_dat(timesteps, results, filename="results.dat"):
"""Generate a .dat with 4 columns : timestep, median value, low and high quantile value.
Args:
timesteps (list): Timesteps.
results (list[list]): The the results from multiple experiences.
filename (str... |
# Name: SpatialJoin_AddField
# Description: Join attributes
# Requirements: os module
# Import system modules
import arcpy
import os
# Set local variables
workspace = "F:\\data_test\\fahui_wang\\"
outWorkspace = "F:\\data_test\\fahui_wang\\"
targetFeatures = os.path.join(workspace, "d_04")
joinFeatures = os.path.joi... |
def find_rightmost_1(number):
if not number: return 0
rightmost_set_bit = 1
while (rightmost_set_bit & number) == 0:
rightmost_set_bit = rightmost_set_bit << 1
return rightmost_set_bit
def find_rightmost_0(number):
if not number: return 0
cnt = 0
while (number & 1) == 1:
nu... |
# -*- coding: utf-8 -*-
"""The definitions."""
from __future__ import unicode_literals
MICROSECONDS_PER_SECOND = 1000000
MICROSECONDS_PER_MINUTE = 60000000
COMPRESSION_FORMAT_NONE = 'none'
COMPRESSION_FORMAT_ZLIB = 'zlib'
COMPRESSION_FORMATS = frozenset([
COMPRESSION_FORMAT_NONE,
COMPRESSION_FORMAT_ZLIB])
... |
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import ast
import logging
import optparse
import re
import sys
from collections import Counter
from collections.abc import Container, Iterable, Iterator, Sequence
from contextlib import contextmanager
from copy import deepcopy
from dataclasses i... |
# from size_measurement.size_measurement import measure_sizes_single
|
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import p... |
# =============================================================================
# Copyright 2020 NVIDIA. 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://ww... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
# Test case ID : C4976194
# Test Case Title : Verify that you can add PhysX Rigid Bodies Physics component to ... |
import unittest
from ..a import add
from ..b import multiply
# what s
class TestAB(unittest.TestCase):
def test_add_and_multiply(self):
"""test adding and multiplying at the same time"""
self.assertEqual(add(2, 3), 5)
self.assertEqual(multiply(2, 3), 6)
|
from blob import Context
from handlers.decorators import OsuEvent
from lib import logger
from packets.OsuPacketID import OsuPacketID
from packets.Reader.PacketResolver import PacketResolver
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from objects.Player import Player
from objects.Channel import Channel... |
/usr/local/lib/python3.5/stat.py |
import re
from typing import List
DOCSTRING_REGEX_TOKENIZER = re.compile(
r"[^\s,'\"`.():\[\]=*;>{\}+-/\\]+|\\+|\.+|\(\)|{\}|\[\]|\(+|\)+|:+|\[+|\]+|{+|\}+|=+|\*+|;+|>+|\++|-+|/+")
def tokenize_docstring_from_string(docstr: str) -> List[str]:
return [t for t in DOCSTRING_REGEX_TOKENIZER.findall(docstr) if t ... |
# Copyright 2019 Uber Technologies, Inc. All Rights Reserved.
# Modifications copyright Microsoft
#
# 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/LICENS... |
# Generated by Django 3.0 on 2020-07-13 15:13
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'... |
import datetime
import time
class Clock:
def __init__(self, datetime_obj=datetime.datetime, date_obj=datetime.date):
self.datetime_obj = datetime_obj
self.date_obj = date_obj
def today(self):
return self.date_obj.today()
def now(self):
return self.datetime_obj.now()
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 17 12:33:39 2021
@author: Clement
"""
import pandas
import PyPDF2
import os
import sys
import docx
from docxtpl import DocxTemplate
from docx2pdf import convert
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from gen... |
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# License: BSD 3 clause
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from .... |
from django.apps import apps
from django.contrib import admin
def registerAdminSite(appName, excludeModels=[]):
"""Registers the models of the app with the given "appName" for the admin site"""
for model in apps.get_app_config(appName).get_models():
if model not in excludeModels:
admin.sit... |
#!/usr/bin/python3
"""Exports Dyson Pure Hot+Cool (DysonLink) statistics as Prometheus metrics."""
import argparse
import functools
import logging
import sys
import time
import threading
from typing import Callable, Dict, List
import prometheus_client
import libdyson
import libdyson.dyson_device
import libdyson.exce... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('team', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='team',
name='campus',
... |
import smartnet as sn
import smartnet.layers as layer
import smartnet.optims as optim
import numpy as np
import unittest
class SmartNetTest(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
@classmethod
def setUpClass(cls):
nsamples = 100
cls.x = sn.T... |
import io
import debugpy
import logging
import socketserver
from threading import Condition
from http import server
LOGGER = logging.getLogger("tmv.streamer")
class StreamingOutput(object):
def __init__(self):
self.frame = None
self.buffer = io.BytesIO()
self.condition = Condition()
... |
from abc import ABC, abstractmethod
class FaceDetectorBase(ABC):
def __init__(self):
"""
Participants should define their own initialization process.
During this process you can set up your network. The time cost for this step will
not be counted in runtime evaluation
"""
... |
from math import ceil, floor
from typing import List
def smallestDivisor(nums: List[int], threshold: int) -> int:
"""Return smallest divisor such that sum of `nums` normalised
with respect to the divisor is at most `threshold`."""
lo = 1
hi = max(nums)
while lo < hi:
mid = floor((lo +... |
# Copyright 2016-2020 Blue Marble Analytics 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 ag... |
import torch
from flexinfer.misc import registry
from .base_meshgrid import BaseMeshGrid
@registry.register_module('meshgrid')
class PointAnchorMeshGrid(BaseMeshGrid):
def __init__(self, strides):
super().__init__(strides)
def gen_anchor_mesh(self,
featmap_sizes,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.