text
stringlengths
2
999k
import argparse import time import ray ray.init(address="auto") parser = argparse.ArgumentParser() parser.add_argument( "num_nodes", type=int, help="Wait for this number of nodes (includes head)" ) parser.add_argument("max_time_s", type=int, help="Wait for this number of seconds") parser.add_argument( "--f...
import itertools from multiprocessing import Manager from pyaugmecon.options import Options class Flag(object): def __init__(self, opts: Options): self.opts = opts if self.opts.shared_flag: self.flag = Manager().dict() else: self.flag = {} def set(self, flag_r...
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import os from setuptools import setup, find_packages __version__ = '3.1.0' requirements_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'requirements.txt') with open(requirements_path) as requirements_file: ...
# coding: utf-8 """ Mailchimp Marketing API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: 3.0.74 Contact: apihelp@mailchimp.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import...
from optparse import OptionParser import json def main(): usage = "" # TODO parser = OptionParser(usage=usage) #parser.add_option("-a", "--a_descrip", action="store_true", help="This is a flat") #parser.add_option("-b", "--b_descrip", help="This is an argument") (options, args) = parser.parse_args...
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: contact.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 message as _message from google.protobuf import reflection as _refle...
import netbox_agent.dmidecode as dmidecode from netbox_agent.config import config from netbox_agent.config import netbox_instance as nb from netbox_agent.inventory import Inventory from netbox_agent.location import Datacenter, Rack, Tenant from netbox_agent.misc import create_netbox_tags, get_device_role, get_device_ty...
#!/usr/bin/env python3 import aiy.audio import aiy.cloudspeech import aiy.voicehat import RPi.GPIO as GPIO def main(): recognizer = aiy.cloudspeech.get_recognizer() recognizer.expect_phrase('turn on the light') recognizer.expect_phrase('turn off the light') button = aiy.voicehat.get_button() aiy....
test = { 'name': 'q3_1_8', 'points': 1, 'suites': [ { 'cases': [ { 'code': r""" >>> genre_and_distances.labels == ('Genre', 'Distance') True """, 'hidden': False, 'locked': False }, { 'code': r""" >>>...
#!/usr/bin/env python3 # Copyright 2020 Stanford University # # 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 applicab...
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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 applicab...
# -*- 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...
""" ASGI config for CongoCart project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SET...
import pygame """ levels.py Houses all possible levels for the game to choose from. Selection occurs by invoking the selected level and by having a return tuple of (pad_sprite, trophies, car[x,y]). Must still be rendered into the main game. """ class PadSprite(pygame.sprite.Sprite): def __in...
''' 3. Criar 2 matrizes 3x4 somar seus valores e armazenar o resultado em uma terceira matriz 3x4.'''
# # Copyright (c) European Synchrotron Radiation Facility (ESRF) # # 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,...
# -*- coding: utf-8 -*- import scrapy import re from rkpass.items import dzswMorningItem # 电子商务设计师上午题 class DzswmorningspiderSpider(scrapy.Spider): name = 'dzswMorningSpider' allowed_domains = ['www.rkpass.cn'] start_urls = [] paperId_list = ['612', '541', '477', '453', '281', '280', '279', '278', '277...
def decoupling_regularization_prepare(graph, sigma_square,lambda_input): # get W matrix, Z(for row sum) and Z_prime(for col sum), and A_tilde # get matrix W: A = np.array(nx.adjacency_matrix(graph).todense()) d = np.sum(A, axis=1) D = np.diag(d) n = len(D) # Alternative way(19): set Sigma_s...
# coding: utf8 from __future__ import unicode_literals from ..char_classes import ALPHA, ALPHA_LOWER, ALPHA_UPPER, QUOTES, HYPHENS from ..char_classes import LIST_ELLIPSES, LIST_ICONS _hyphens_no_dash = HYPHENS.replace('-', '').strip('|').replace('||', '') _infixes = (LIST_ELLIPSES + LIST_ICONS + ...
# -*- coding: utf-8 -*- # Copyright (c) 2020 Felix Fontein <felix@fontein.de> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type class ModuleDocFragment(object): DOCUMENTATION = r'''...
#!/usr/bin/env python3 from pyxdc.exceptions import ( ProviderError, BalanceError, APIError, AddressError, InvalidURLError, ClientError, NotFoundError, UnitError ) import pytest def test_exceptions(): with pytest.raises(ProviderError, match="error"): raise ProviderError("error") with pytest...
# coding: utf-8 # ----------------------------------------------------------------------------------- # <copyright company="Aspose Pty Ltd"> # Copyright (c) 2003-2021 Aspose Pty Ltd # </copyright> # <summary> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and ass...
import numpy as np import scipy.sparse as sp import torch def encode_onehot(labels): classes = set(labels) classes_dict = {c: np.identity(len(classes))[i, :] for i, c in enumerate(classes)} labels_onehot = np.array(list(map(classes_dict.get, labels)), dtype...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** 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, overload from ... import _utilities fro...
import ast with open('./test.txt',"r") as f: #设置文件对象 str = f.read() #可以是随便对文件的操作 print(str) frame_list = ast.literal_eval(str) for frame in frame_list: print(frame)
""" Package-level constants """ from strenum import StrEnum class SummaryLevel(StrEnum): """ Values for the SUMLEV column in PL94 data """ STATE = "040" STATE_COUNTY = "050" STATE_COUNTY_TRACT = "140" STATE_COUNTY_TRACT_BLOCKGROUP = "150" STATE_COUNTY_TRACT_BLOCKGROUP_BLOCK = "750"
import _initpath import pyradox #result = pyradox.txt.parse_file('D:/Steam/steamapps/common/Europa Universalis IV/common/prices/00_prices.txt') #print(result) result = pyradox.parse(""" regular_group = { 1 2 3 } empty_tree = {} mixed_group = { 10 {} { a = 1 b = 2 } 20 } player_countries={ ITA={ ...
""" This is a plugin created by ShiN0 Copyright (c) 2020 ShiN0 <https://www.github.com/mgaertne/minqlx-plugin-tests> You are free to modify this plugin to your own one. """ import minqlx from minqlx import Plugin from minqlx.database import Redis import os import math import time import random import itertools impo...
""" Module imports for templates.python.business_logic.my_project.my_app.migrations This file is automatically generated by ./scripts/empty_pyinit.sh DO NOT EDIT IT MANUALLY """
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. # The simplest Django settings possible # support for Django < 1.5 DATABASE_ENGINE = 'django.db.backends.sqlite3' DATABASE_NAME = ':memory:' # support for Django >= 1.5 SECRET_KEY = 'unittest' DATABASES = { 'default': { 'ENGINE': DATABASE...
# Copyright (c) 2021, Manfred Moitzi # License: MIT License import copy import math from typing import Iterable, List, Optional, Tuple from ezdxf import colors from ezdxf.entities import MText from ezdxf.lldxf import const from ezdxf.math import Matrix44, Vec3 from ezdxf.render.abstract_mtext_renderer import Abstrac...
# -*- coding: utf-8 -*- # # Unless explicitly stated otherwise all files in this repository are licensed # under the Apache 2 License. # # This product includes software developed at Datadog # (https://www.datadoghq.com/). # # Copyright 2018 Datadog, Inc. # """database.py Testing utils for creating database records ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('postcode_api', '0003_populate_postcode_area'), ] operations = [ migrations.CreateModel( name='LocalAuthority', ...
# coding: utf-8 from collections import namedtuple from supervisely_lib.api.module_api import ApiField, ModuleApi from supervisely_lib._utils import camel_to_snake class PluginApi(ModuleApi): _info_sequence = [ApiField.ID, ApiField.NAME, ApiField.DESCRIPTION, ...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the 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. import torch import torch.nn as nn...
# from resolve import resolve #################################### #################################### # 以下にプラグインの内容をペーストする # import sys from io import StringIO import unittest class TestClass(unittest.TestCase): def assertIO(self, input, output): stdout, stdin = sys.stdout, sys.stdin sys.stdout...
from catalyst.contrib.datasets.misc_cv import ImageClassificationDataset class Imagewang(ImageClassificationDataset): """ `Imagewang <https://github.com/fastai/imagenette#image%E7%BD%91>`_ Dataset. .. note:: catalyst[cv] required for this dataset. """ name = "imagewang" resources = [...
# # 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 us...
import unittest from src.google_foobar.P008_carrotland.solution_01 import answer class TestSolution(unittest.TestCase): def testcase_001(self): vertices = [[2, 3], [6, 9], [10, 160]] expected = 289 self.assertEqual(answer(vertices), expected) def testcase_002(self): vertices ...
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
from keras.layers import Input from keras.layers.merge import Concatenate from keras.models import Model from keras.optimizers import Adam from .keras_base import KerasBaseExp from .keras_base import exp_bag_of_strokes from .blocks import fc_branch, final_type1 class mlp_type1(KerasBaseExp): def initialize_mode...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021 Infoblox, Inc. # Authors: Amit Mishra (@amishra2-infoblox), Vedant Sethia (@vedantsethia) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) try: ...
# Copyright © 2019 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
"""Autocorrelation plot of data.""" from ..data import convert_to_dataset from ..labels import BaseLabeller from ..sel_utils import xarray_var_iter from ..rcparams import rcParams from ..utils import _var_names from .plot_utils import default_grid, filter_plotters_list, get_plotting_function def plot_autocorr( da...
# -*- encoding: utf-8 -*- """ Copyright (c) 2019 - present AppSeed.us """ from django.contrib import admin # Register your models here. from django.contrib import admin from .models import RemOrganization, RemRole, RemUser, Nursery, NurseryPlantsHistory, MotherTree, Plantation, BeninYield, AlteiaData, DeptSatellite,...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License. from __future__ import print_function import contextlib import glob import json import os import re import shutil import stat import subprocess import sys import tempfile import time import unittest import zipfile from da...
from ptypes import * class Header(pstruct.type): _fields_ = [ (dyn.block(3), 'Signature'), (dyn.block(3), 'Version'), ] class LogicalScreenDescriptor(pstruct.type): class _Flags(pbinary.struct): _fields_ = [(1, 'Global Color Table'), (3, 'Color Resolution'), (1, 'Sort'), (3, 'Size'...
import dis import re import sys import textwrap import unittest from test.support import cpython_only from test.bytecode_helper import BytecodeTestCase class TestTranforms(BytecodeTestCase): def test_unot(self): # UNARY_NOT POP_JUMP_IF_FALSE --> POP_JUMP_IF_TRUE' def unot(x): if not...
# -*- coding: utf-8 -*- __author__ = 'Matt Makai' __email__ = 'mmakai@twilio.com' __version__ = '0.1.0'
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pytest from numpy.testing import assert_allclose from .. import Parameter, Parameters, optimize_iminuit pytest.importorskip("iminuit") def fcn(parameters): x = parameters["x"].value y = parameters["y"].value z = parameters["z"].value ...
m = int(input()) m /= 1000 if m < 0.1: print('00') elif 0.1 <= m and m <= 5: m = str(int(10 * m)) if len(m) == 1: m = '0' + m print(m) elif 6 <= m and m <= 30: print(int(m) + 50) elif 35 <= m and m <= 70: print((int(m) - 30) // 5 + 80) else: print('89')
import torch import torch.nn as nn import torch.nn.functional as F import torch.distributions as td class Flow(nn.Module): """ Building both normalizing flows and neural flows. Example: >>> import stribor as st >>> torch.manual_seed(123) >>> dim = 2 >>> flow = st.Flow(st.UnitN...
#!/usr/bin/env python3 # Copyright (c) 2017-2018 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 external signer. Verify that a blinkhashd node can use an external signer command. See also walle...
import pandas as pd import pathlib from fairness.results import local_results_path BASE_DIR = local_results_path() PACKAGE_DIR = pathlib.Path(__file__).parents[2] RAW_DATA_DIR = PACKAGE_DIR / 'data' / 'raw' PROCESSED_DATA_DIR = BASE_DIR / 'data' / 'preprocessed' # Joosje: BASE_DIR used to be PACKAGE_DIR RESULT_DIR = B...
from django.core.urlresolvers import reverse from django.http import Http404 from django.test import TestCase, override_settings import mock from rest_framework.exceptions import APIException, PermissionDenied from rest_framework.request import Request from rest_framework.response import Response from rest_framework....
import os, sys, urllib.request from tkinter import * from tkinter.messagebox import * __version__ = 3 __filename__ = "ImageRenaming" __basename__ = os.path.basename(sys.argv[0]) __savepath__ = os.path.join(os.environ['APPDATA'], "QuentiumPrograms") __iconpath__ = __savepath__ + "/{}.ico".format(__filename__) try:urll...
# Generated by Django 3.1.4 on 2021-01-24 04:42 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('exam', '0006_exam_duration'), ] operations = [ migrations.AlterField( model_name='exam', name='duration', ...
import asyncio import inspect import json import os import random import unittest from unittest.mock import Mock import aiohttp import aiohttp.web from aiohttp.test_utils import unittest_run_loop, setup_test_loop, teardown_test_loop import pep8 import jsonrpc_base import jsonrpc_websocket.jsonrpc from jsonrpc_websock...
r""" Incidence structures (i.e. hypergraphs, i.e. set systems) An incidence structure is specified by a list of points, blocks, or an incidence matrix ([1]_, [2]_). :class:`IncidenceStructure` instances have the following methods: {METHODS_OF_IncidenceStructure} REFERENCES: .. [1] Block designs and incidence struct...
# -*- coding: utf-8 -*- # Define source file encoding to support raw unicode characters in Python 2 import sys # Third party import pytest # Project from ddtrace.compat import to_unicode, PY2, reraise, get_connection_response # Use different test suites for each Python version, this allows us to test the expected #...
# 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. import contextlib import copy import importlib.util import logging import math import os import sys import warnings from collections import de...
from numpy.core.fromnumeric import reshape import torch import numpy as np import pickle from itertools import combinations, permutations from sklearn.decomposition import PCA from sklearn.manifold import MDS, TSNE from scipy.stats import pearsonr, ttest_ind import statsmodels.api as sm from dataset import get_loaders...
from hummingbot.client.config.config_var import ConfigVar from hummingbot.client.config.config_validators import ( validate_exchange, validate_market_trading_pair, ) from hummingbot.client.settings import ( required_exchanges, EXAMPLE_PAIRS, ) from typing import Optional def symbol_prompt(): excha...
from django.views.generic import View from django.http import HttpResponse from django.conf import settings import os class ReactAppView(View): def get(self, request): try: with open(os.path.join(str(settings.ROOT_DIR), 'frontend', 'build', 'index.html')) as file: return HttpR...
# Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='ProductMain']/div[@class='product-title']/h1", 'price' : "//div[@class='Row Price']/div[@class='ProductPrice VariationPr...
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Copyright (c) 2017 The Ravencoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test using named arguments for RPCs.""" from test_framew...
# coding: utf-8 """ """ import pandas as pd import numpy as np import cv2 # Used to manipulated the images from scipy.signal import wiener np.random.seed(1207) # The seed I used - pick your own or comment out for a random seed. A constant seed allows for better comparisons though # Import Keras from keras.mo...
#!/usr/bin/env python # -*- coding: utf-8 -*- from concurrent import futures def naehere_pi_an(n): pi_halbe = 1 zaehler, nenner = 2.0, 1.0 for i in range(n): pi_halbe *= zaehler / nenner if i % 2: zaehler += 2 else: nenner += 2 return 2...
#!/usr/bin/env python __all__ = ['nicovideo_download'] from ..common import * def nicovideo_login(user, password): data = "current_form=login&mail=" + user +"&password=" + password + "&login_submit=Log+In" response = request.urlopen(request.Request("https://secure.nicovideo.jp/secure/login?site=niconico", he...
import pytest from .base import TestBaseClass # flake8: noqa W291 - we want to explicitly test trailing whitespace here class TestClassOelintVarsValueQuoted(TestBaseClass): @pytest.mark.parametrize('id', ['oelint.vars.valuequoted']) @pytest.mark.parametrize('occurrence', [2]) @pytest.mark.parametrize('in...
# See: https://packaging.python.org/en/latest/distributing/#standards-compliance-for-interoperability __version__ = '0.9.0'
#!/usr/bin/python3 # --- 001 > U5W1P1_Task1_w1 def solution(s): # print( ''.join(reversed(s)) ) if( s==''.join(reversed(s))): return bool(True) return bool(False) if __name__ == "__main__": print('----------start------------') s = "zork" print(solution( s )) print('------------en...
# -*- coding: utf-8 -*- """ Created on Sat Mar 9 10:51:35 2019 @author: levy.he """ import ctypes from . import vxlapy def stringify(cobj, indent=2): s = "%s\n" % type(cobj) if issubclass(type(cobj), ctypes.Union): cobj = getattr(cobj, cobj._fields_[0][0]) if issubclass(type(cobj), ctypes.Struct...
import pandas as pd import numpy as np from time import time import sys class StateBasedBucketer(object): def __init__(self, encoder): self.encoder = encoder self.dt_states = None self.n_states = 0 def fit(self, X, y=None): dt_encoded = self....
""" Test cases for .hist method """ import numpy as np import pytest import pandas.util._test_decorators as td from pandas import DataFrame, Index, Series, to_datetime import pandas._testing as tm from pandas.tests.plotting.common import TestPlotBase, _check_plot_works pytestmark = pytest.mark.slow @td.skip_if_no...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class BillDingBizOrderSum(object): def __init__(self): self._biz_date = None self._expenses = None self._income = None @property def biz_date(self): return self...
class Calculator: def __init__(self): pass def add(self, a, b): return a + b def divide(self, a, b): return b / a # Todo: Add subtract option # def root(a): # return math.sqrt() def greetings(name): print('Hello ' + name + '!') def goodbye(): print('Good...
# 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...
""" MIT License Copyright (c) 2019 Yoga Suhas Kuruba Manjunath 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, m...
import numpy as np import theano import theano.tensor as TT from rllab.core.serializable import Serializable from rllab.misc import ext from rllab.misc import krylov from rllab.misc import logger from rllab.misc.ext import sliced_fun class PerlmutterHvp(Serializable): def __init__(self, num_slices=1): S...
# coding: utf-8 import pprint import re import six class TemplateCddl: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is js...
from flask import Flask, render_template, redirect, url_for, flash, request, abort from functions import UserLogin, UserRegistration, NewExpense from flask_sqlalchemy import SQLAlchemy from sqlalchemy import func from datetime import datetime, timedelta, date from flask_bcrypt import Bcrypt from flask_login import Logi...
import unittest import mock import numpy import pytest import cupy from cupy import testing from cupyx.scipy import sparse @testing.parameterize(*testing.product({ 'dtype': [numpy.float32, numpy.float64, numpy.complex64, numpy.complex128], 'format': ['csr', 'csc', 'coo'], 'm': [3], 'n': [None, 3, 2]...
import torch import numpy as np; from torch.autograd import Variable def normal_std(x): return x.std() * np.sqrt((len(x) - 1.)/(len(x))) class Data_utility(object): # train and valid is the ratio of training set and validation set. test = 1 - train - valid def __init__(self, dSet, train, valid, cuda, hor...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2021, Cisco Systems # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) DOCUMENTATION = r""" --- module: device_administration_dictionary_attributes_policy_set_info short_description: Information module for Device Admin...
########################################################################## # # Copyright (c) 2011, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
# buildifier: disable=module-docstring load("@rules_foreign_cc//tools/build_defs/shell_toolchain/toolchains:function_and_call.bzl", "FunctionAndCall") _REPLACE_VALUE = "BAZEL_GEN_ROOT" def os_name(): return "Fancy" def pwd(): return "$(pwd)" def echo(text): return "printf \"{text}\"".format(text = text)...
import re import uuid from django.db import transaction from django.utils import timezone from django.urls import reverse from django.contrib.auth import get_user_model from django.contrib.sites.models import Site from django.core.files import File from django.utils.translation import gettext_lazy as _ from django.con...
""" Django settings for Gallery project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os ...
"""SwaggerToSdk core tools. """ from enum import Enum, unique import json import logging import os import re import tempfile from pathlib import Path import requests from github import Github, UnknownObjectException from .autorest_tools import ( autorest_latest_version_finder, autorest_bootstrap_version_find...
import torch from ptstat.core import RandomVariable, _to_v class Categorical(RandomVariable): """ Categorical over 0,...,N-1 with arbitrary probabilities, 1-dimensional rv, long type. """ def __init__(self, p=None, p_min=1E-6, size=None, cuda=False): super(Categorical, self).__init__() ...
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from .__about__ import __version__ from .http_check import HTTPCheck __all__ = ['__version__', 'HTTPCheck']
import unittest from localstack.utils.aws import aws_stack class SSMTest(unittest.TestCase): def test_describe_parameters(self): ssm_client = aws_stack.connect_to_service("ssm") response = ssm_client.describe_parameters() self.assertIn("Parameters", response) self.assertIsInstanc...
import json import os import sys from . import uploader from . import processing from . import exif_read def verify_mapillary_tag(filepath): filepath_keep_original = processing.processed_images_rootpath(filepath) if os.path.isfile(filepath_keep_original): filepath = filepath_keep_original """ ...
import re import click from cloup import option, option_group from ... import logger def validate_scene_range(ctx, param, value): try: start = int(value) return (start,) except Exception: pass if value: try: start, end = map(int, re.split(r"[;,\-]", value)) ...
from setuptools import setup, find_packages setup( name="intent_classifier", version="0.2.0", packages=find_packages(), include_package_data=True, install_requires=["numpy", "scipy", "PyMySQL", "scikit-learn==0.20.3"] )
from django.contrib import admin from application.models import Profile # Register your models here. admin.site.register(Profile)
#!/usr/local/bin/python ''' pyAero_geometry Holds the Python Aerodynamic Analysis Classes (base and inherited). Copyright (c) 2008 by Dr. Ruben E. Perez All rights reserved. Not to be used for commercial purposes. Revision: 1.1 $Date: 21/05/2008 21:00$ Developers: ----------- - Dr. Ruben E. Perez (RP) History --...
from orchespy import device from orchespy.devicetype import CUDAGPU, Host, VE import sys import pytest import numpy as np if "cupy" in sys.modules: import cupy as cp if "nlcpy" in sys.modules: import nlcpy as vp no_nlcpy = pytest.mark.skipif( "nlcpy" not in sys.modules, reason=' test require nlcpy. '...
# !/usr/local/python/bin/python # -*- coding: utf-8 -*- # (C) Wu Dong, 2021 # All rights reserved # @Author: 'Wu Dong <wudong@eastwu.cn>' # @Time: '6/29/21 10:49 AM' # sys import typing as t from threading import Lock from threading import get_ident # 3p import sqlalchemy from sqlalchemy import ( orm, schema, )...