content stringlengths 0 1.55M |
|---|
##########################################################################
#
# Copyright (c) 2010-2012, 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... |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__="biotite"<line_sep>__author__="<NAME>"<line_sep>__all__=["Copyable"]<import_stmt>abc<class_stmt>Copyable(metaclass=abc.ABCMeta)<block_start>"""
Base cla... |
<import_stmt>pytest<import_stmt>numpy<as>np<import_stmt>copy<import_from_stmt>numpy.testing assert_allclose<import_from_stmt>keras.utils CustomObjectScope<import_from_stmt>keras.layers wrappers Input Layer<import_from_stmt>keras.layers RNN<import_from_stmt>keras layers<import_from_stmt>keras.models Sequential Model mod... |
"""Lowest-common-denominator implementations of platform functionality."""<import_from_future_stmt> absolute_import division print_function with_statement<import_stmt>errno<import_stmt>socket<import_from_stmt>tornado.platform interface<class_stmt>Waker(interface.Waker)<block_start>"""Create an OS independent asynchrono... |
"""
Basic usage
===========
This example presents the basic usage of brokenaxes
"""<import_stmt>matplotlib.pyplot<as>plt<import_from_stmt>brokenaxes brokenaxes<import_stmt>numpy<as>np<line_sep>fig=plt.figure(figsize=(5 2))<line_sep>bax=brokenaxes(xlims=((0 .1) (.4 .7)) ylims=((-1 .7) (.79 1)) hspace=.05)<line_sep>x=n... |
<import_stmt>clpy<import_stmt>clpy.sparse.base<line_sep>_preamble_atomic_add='''
#if __CUDA_ARCH__ < 600
__device__ double atomicAdd(double* address, double val) {
unsigned long long* address_as_ull =
(unsigned long long*)address;
unsigned long long old = *address_as_ul... |
<import_from_stmt>pytest raises<import_from_stmt>discopy.cartesian *<def_stmt>test_Box_repr <block_start>f=Box('f' 1 2 <lambda>x:(x x))<assert_stmt>"Box('f', 1, 2"<in>repr(f)<block_end><def_stmt>test_Function_str <block_start>f=Function(2 1 <lambda>x y:x+y)<assert_stmt>'Function(dom=2, cod=1,'<in>str(f)<block_end><def_... |
<import_stmt>os<import_stmt>sys<import_stmt>shutil<line_sep>cwd_path=os.getcwd()<line_sep>sys.path.append(os.path.join(os.path.dirname(cwd_path) 'rt-thread' 'tools'))<line_sep># BSP dist function
<def_stmt>dist_do_building BSP_ROOT dist_dir<block_start><import_from_stmt>mkdist bsp_copy_files<import_stmt>rtconfig<line_s... |
# -*- coding: utf-8 -*-
<import_stmt>os<import_stmt>json<import_from_stmt>splash defaults<import_from_stmt>splash.utils to_bytes path_join_secure<import_from_stmt>splash.errors BadOption<class_stmt>RenderOptions(object)<block_start>"""
Options that control how to render a response.
"""<line_sep>_REQUIRED=object... |
# Set up configuration variables
__all__=['custom_viewer' 'qglue' 'test']<import_stmt>os<import_stmt>sys<import_from_stmt>pkg_resources get_distribution DistributionNotFound<try_stmt><block_start>__version__=get_distribution('glue-core').version<block_end><except_stmt>DistributionNotFound<block_start>__version__='undef... |
<import_stmt>requests<import_from_stmt>allauth.socialaccount.providers.oauth2.views OAuth2Adapter OAuth2CallbackView OAuth2LoginView <import_from_stmt>.provider DropboxOAuth2Provider<class_stmt>DropboxOAuth2Adapter(OAuth2Adapter)<block_start>provider_id=DropboxOAuth2Provider.id<line_sep>access_token_url="https://api.dr... |
"""
3D visualization primitives based on Plotly.
We might want to instead use a more powerful library like Open3D.
Plotly however supports animations, buttons and sliders.
1) Initialize a figure with `fig = init_figure()`
2) Plot points, cameras, lines, or create a slider animation.
3) Call `fig.show()` to render the ... |
# Copyright 2020 - 2021 MONAI Consortium
# 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 wri... |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... |
#coding:utf8
'''
Created on 2013-8-21
@author: lan (www.9miao.com)
'''<import_stmt>itertools<import_stmt>datetime<def_stmt>safeunicode obj encoding='utf-8'<block_start>r"""
Converts any given object to unicode string.
>>> safeunicode('hello')
u'hello'
>>> safeunicode(2)
u'2'
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2013 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... |
# Copyright (c) 1999-2008 <NAME> and <NAME>
# Copyright (c) 2009 The Hewlett-Packard Development Company
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retai... |
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__="biotite"<line_sep>__author__="<NAME>"<line_sep>__all__=["File" "TextFile" "InvalidFileError"]<import_stmt>abc<import_stmt>io<import_stmt>warnings<import_fr... |
<import_stmt>FWCore.ParameterSet.Config<as>cms<line_sep>#
# module to make the MaxSumPtWMass jet combination
#
findTtSemiLepJetCombMaxSumPtWMass=cms.EDProducer("TtSemiLepJetCombMaxSumPtWMass" ## jet input
jets=cms.InputTag("selectedPatJets") ## lepton input
leps=cms.InputTag("selectedPatMuons") ## maximum number of j... |
<import_from_stmt>libsaas http parsers<import_from_stmt>libsaas.services base<import_from_stmt>libsaas.services.twilio resource<class_stmt>ApplicationsBase(resource.TwilioResource)<block_start>path='Applications'<block_end><class_stmt>Application(ApplicationsBase)<block_start><def_stmt>create self *args **kwargs<block_... |
<import_from_stmt>vyper ast<as>vy_ast<def_stmt>test_output_class <block_start>old_node=vy_ast.parse_to_ast("foo = 42")<line_sep>new_node=vy_ast.Int.from_node(old_node value=666)<assert_stmt>isinstance(new_node vy_ast.Int)<block_end><def_stmt>test_source <block_start>old_node=vy_ast.parse_to_ast("foo = 42")<line_sep>new... |
# This example shows how to read or modify the Axes Optimization settings using the RoboDK API and a JSON string.
# You can select "Axes optimization" in a robot machining menu or the robot parameters to view the axes optimization settings.
# It is possible to update the axes optimization settings attached to a robot o... |
'''
This file contains test cases for tflearn
'''<import_stmt>tensorflow.compat.v1<as>tf<import_stmt>tflearn<import_stmt>unittest<class_stmt>TestActivations(unittest.TestCase)<block_start>'''
This class contains test cases for the functions in tflearn/activations.py
'''<line_sep>PLACES=4# Number of plac... |
# This file is part of Patsy
# Copyright (C) 2013 <NAME> <<EMAIL>>
# See file LICENSE.txt for license information.
# Regression tests for fixed bugs (when not otherwise better covered somewhere
# else)
<import_from_stmt>patsy EvalEnvironment dmatrix build_design_matrices PatsyError Origin <def_stmt>test_issue_11 # Give... |
<class_stmt>Foo<block_start><pass><block_end><class_stmt>Bar(Foo)<block_start><def_stmt>__init__ self<block_start>super(Bar self).__init__()<block_end><block_end># [super-with-arguments]
<class_stmt>Baz(Foo)<block_start><def_stmt>__init__ self<block_start>super().__init__()<block_end><block_end><class_stmt>Qux(Foo)<blo... |
<import_stmt>logging<line_sep>logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s' datefmt='%Y/%m/%d %H:%M:%S' level=logging.INFO )<line_sep>logger=logging.getLogger("Main")<import_stmt>os random<import_stmt>numpy<as>np<import_stmt>torch<import_from_stmt>processing convert_examples_to_feat... |
"""The Ray autoscaler uses tags/labels to associate metadata with instances."""<line_sep># Tag for the name of the node
TAG_RAY_NODE_NAME="ray-node-name"<line_sep># Tag for the kind of node (e.g. Head, Worker). For legacy reasons, the tag
# value says 'type' instead of 'kind'.
TAG_RAY_NODE_KIND="ray-node-type"<line_sep... |
<import_from_future_stmt> with_statement<import_from_stmt>.. Lock NeedRegenerationException<import_from_stmt>..util NameRegistry<import_from_stmt>. exception<import_from_stmt>..util PluginLoader memoized_property coerce_string_conf<import_from_stmt>.util function_key_generator function_multi_key_generator<import_from_s... |
<import_stmt>os<import_stmt>unittest<import_stmt>torch<import_stmt>torch.distributed<as>dist<import_from_stmt>torch.multiprocessing Process<import_stmt>torch.nn<as>nn<import_from_stmt>machina.optims DistributedAdamW<def_stmt>init_processes rank world_size function backend='tcp'<block_start>os.environ['MASTER_ADDR']='12... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
<import_stmt>torch<import_from_stmt>neuralcompression.functional soft_round soft_round_inverse<def_stmt>test_soft_round_inverse <block_start>... |
# Lint as: python3
# Copyright 2019 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 ... |
<import_stmt>oblate<import_stmt>numpy<as>np<import_stmt>pytest<line_sep># TODO!
|
<import_from_stmt>CommonServerPython *<line_sep>''' IMPORTS '''<import_stmt>re<import_stmt>requests<line_sep># Disable insecure warnings
requests.packages.urllib3.disable_warnings()<line_sep>''' GLOBALS/PARAMS '''<line_sep>VENDOR='Have I Been Pwned? V2'<line_sep>MAX_RETRY_ALLOWED=demisto.params().get('max_retry_time' -... |
<import_from_stmt>moshmosh.extension Extension<import_from_stmt>moshmosh.ast_compat ast<class_stmt>PipelineVisitor(ast.NodeTransformer)<block_start>"""
`a | f -> f(a)`, recursively
"""<def_stmt>__init__ self activation<block_start>self.activation=activation<block_end><def_stmt>visit_BinOp self n:ast.BinOp<block... |
<import_from_stmt>itertools product<import_stmt>numpy<as>np<import_stmt>pytest<import_from_stmt>alibi_detect.utils.discretizer Discretizer<line_sep>x=np.random.rand(10 4)<line_sep>n_features=x.shape[1]<line_sep>feature_names=[str(_)<for>_ range(n_features)]<line_sep>categorical_features=[[] [1 3]]<line_sep>percentiles=... |
<import_stmt>logging<import_stmt>unittest<import_from_stmt>pyinstrument Profiler<import_from_stmt>nuplan.planning.scenario_builder.nuplan_db.test.nuplan_scenario_test_utils get_test_nuplan_scenario<import_from_stmt>nuplan.planning.simulation.history.simulation_history_buffer SimulationHistoryBuffer<import_from_stmt>nup... |
<import_stmt>os sys<import_from_stmt>os.path dirname<as>d<import_from_stmt>os.path abspath join<line_sep>root_dir=d(d(d(abspath(__file__))))<line_sep>sys.path.append(root_dir)<import_from_stmt>openprompt.data_utils.conditional_generation_dataset PROCESSORS<line_sep>base_path=os.path.join(root_dir "datasets/CondGen")<de... |
<import_from_stmt>PhysicsTools.Heppy.analyzers.core.Analyzer Analyzer<import_from_stmt>PhysicsTools.Heppy.analyzers.core.AutoHandle AutoHandle<import_from_stmt>PhysicsTools.Heppy.physicsobjects.Tau Tau<import_from_stmt>PhysicsTools.HeppyCore.utils.deltar deltaR matchObjectCollection3<import_stmt>PhysicsTools.HeppyCore.... |
#
# 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_from_stmt>rlstructures logging<import_from_stmt>rlstructures.env_wrappers GymEnv GymEnvInf<import_from_stmt>rlstructures.tools weig... |
<import_from_stmt>openid.consumer.discover OpenIDServiceEndpoint<import_stmt>datadriven<class_stmt>BadLinksTestCase(datadriven.DataDrivenTestCase)<block_start>cases=['' "http://not.in.a.link.tag/" '<link rel="openid.server" href="not.in.html.or.head" />' ]<def_stmt>__init__ self data<block_start>datadriven.DataDrivenTe... |
<import_from_stmt>sklearn.linear_model LogisticRegression<import_from_stmt>fightchurn.listings.chap8.listing_8_2_logistic_regression prepare_data save_regression_model<import_from_stmt>fightchurn.listings.chap8.listing_8_2_logistic_regression save_regression_summary save_dataset_predictions<def_stmt>regression_cparam d... |
"""Sensor for data from Austrian Zentralanstalt für Meteorologie."""<import_from_future_stmt> annotations<import_stmt>logging<import_stmt>voluptuous<as>vol<import_from_stmt>homeassistant.components.weather ATTR_WEATHER_HUMIDITY ATTR_WEATHER_PRESSURE ATTR_WEATHER_TEMPERATURE ATTR_WEATHER_WIND_BEARING ATTR_WEATHER_WIND_S... |
<import_stmt>os<import_stmt>numpy<as>np<import_stmt>tensorflow<as>tf<def_stmt>get_train_data train_dir batch_size<block_start>train_images=np.load(os.path.join(train_dir 'train_images.npy'))<line_sep>train_labels=np.load(os.path.join(train_dir 'train_labels.npy'))<line_sep>print('train_images' train_images.shape 'train... |
"""
The Tornado Framework
By <NAME>
University of Ottawa, Ontario, Canada
E-mail: apesaran -at- uottawa -dot- ca / alipsgh -at- gmail -dot- com
"""<import_stmt>re<import_from_stmt>data_structures.attribute Attribute<import_from_stmt>dictionary.tornado_dictionary TornadoDic<class_stmt>ARFFReader<block_start>"""This... |
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# 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 us... |
_base_=['../_base_/base_tensorrt_static-300x300.py']<line_sep> |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. 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... |
# Ported to Python 3
# Originally from https://github.com/DeprecatedCode/oauth2lib/blob/d161b010f8a596826050a09e5e94d59443cc12d9/oauth2lib/provider.py
<import_stmt>json<import_stmt>logging<import_from_stmt>requests Response<import_from_stmt>io StringIO<try_stmt><block_start><import_from_stmt>werkzeug.exceptions Unautho... |
# Copyright (c) 2021 GradsFlow. 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 ... |
# -*- coding: utf-8 -*-
"""Utilities common to CIFAR10 and CIFAR100 datasets.
"""<import_from_future_stmt> absolute_import<import_from_future_stmt> division<import_from_future_stmt> print_function<import_stmt>sys<import_from_stmt>six.moves cPickle<def_stmt>load_batch fpath label_key='labels'<block_start>"""Internal uti... |
<import_from_stmt>freight.api.serializer serialize<import_from_stmt>freight.testutils TestCase<class_stmt>UserSerializerTest(TestCase)<block_start><def_stmt>test_simple self<block_start>user=self.create_user()<line_sep>result=serialize(user)<assert_stmt>result["id"]<eq>str(user.id)<assert_stmt>result["name"]<eq>user.na... |
<import_stmt>os<import_stmt>pytest<import_stmt>torch<import_from_stmt>hivemind RemoteExpert<import_from_stmt>hivemind.moe.server background_server<line_sep>CUSTOM_EXPERTS_PATH=os.path.join(os.path.dirname(__file__) "test_utils" "custom_networks.py")<line_sep>@pytest.mark.forked<def_stmt>test_custom_expert hid_dim=16<bl... |
'''
Largest rectangle area in a histogram::
Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars.
For simplicity, assume that all bars have same width and the width is 1 unit.
'''<def_stmt>max_area_histogram histogram<block_start>stack=l... |
# Copyright <NAME> 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt)
<import_from_stmt>b2.build type<def_stmt>register <block_start>type.register_type('OBJ' ['obj'] <none> ['NT' 'CYGWIN'])<line_sep>type.register_typ... |
""" Checkpoint Saver
Track top-n training checkpoints and maintain recovery checkpoints on specified intervals.
Hacked together by / Copyright 2020 <NAME>
"""<import_stmt>glob<import_stmt>operator<import_stmt>os<import_stmt>logging<import_stmt>torch<import_from_stmt>.model unwrap_model get_state_dict<line_sep>_logger... |
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
<import_from_stmt>abc ABCMeta abstractmethod<import_from_stmt>pathlib Path<import_from_stmt>textwrap dedent<import_from_stmt>typing ClassVar Iterable List Optional Tuple Type<import_from_st... |
# 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.
"""
BART: Denoising Sequence-to-Sequence Pre-training for
Natural Language Generation, Translation, and Comprehension
"""<import_stmt>torch.nn<... |
<import_from_stmt>typing Dict Optional List Any<import_stmt>torch<import_stmt>torch.nn.functional<as>F<import_from_stmt>allennlp.data Vocabulary<import_from_stmt>allennlp.models.model Model<import_from_stmt>allennlp.modules FeedForward TextFieldEmbedder Seq2SeqEncoder<import_from_stmt>allennlp.nn InitializerApplicator ... |
#
# -*- coding: utf-8 -*-
"""Development related tasks to be run with 'invoke'"""<import_stmt>os<import_stmt>pathlib<import_stmt>shutil<import_stmt>invoke<line_sep>TASK_ROOT=pathlib.Path(__file__).resolve().parent<line_sep>TASK_ROOT_STR=str(TASK_ROOT)<line_sep># shared function
<def_stmt>rmrf items verbose=<true><block... |
<import_stmt>stl_path<class_stmt>MyNDRPlugin()<block_start><def_stmt>__init__ self<block_start><pass><block_end><def_stmt>pre_iteration self finding_max_rate run_results=<none> **kwargs<block_start>""" Function ran before each iteration.
:parameters:
finding_max_rate: boolean
... |
<import_stmt>argparse<import_stmt>logging<import_stmt>torch<import_stmt>torch.nn.functional<as>F<import_stmt>numpy<as>np<import_from_stmt>torch nn<import_from_stmt>torch.autograd Variable<import_from_stmt>transformers GPT2Config<import_from_stmt>transformers GPT2LMHeadModel GPT2Tokenizer BertTokenizer<import_from_stmt>... |
# Copyright 2019 Atalaya Tech, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, sof... |
# encoding: utf-8
<import_stmt>os<import_stmt>roms<def_stmt>console_roms_directory configuration console<block_start>"""
If the user has specified a custom ROMs directory in consoles.txt then
return that.
Otherwise, append the shortname of the console to the default ROMs
directory given by config.txt.
"""<if... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
<import_from_stmt>benchmarks smoothness thread_times<import_stmt>page_sets<import_from_stmt>telemetry benchmark<line_sep># pylint: disable=protected-access
<d... |
<import_stmt>base64<import_stmt>operator<import_stmt>struct<import_stmt>time<import_stmt>pytest<import_stmt>six<import_stmt>consul<import_stmt>consul.std<line_sep>Check=consul.Check<class_stmt>TestHTTPClient(object)<block_start><def_stmt>test_uri self<block_start>http=consul.std.HTTPClient()<assert_stmt>http.uri('/v1/k... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
<import_stmt>warnings<import_stmt>pulumi<import_stmt>pulumi.runtime<import_from_stmt>typing Any Mapping Optional Sequence Union overload<import_from_stmt>... _utilitie... |
<import_from_stmt>lemur database<def_stmt>rotate_certificate endpoint new_cert<block_start>"""
Rotates a certificate on a given endpoint.
:param endpoint:
:param new_cert:
:return:
"""<line_sep># ensure that certificate is available for rotation
endpoint.source.plugin.update_endpoint(endpoint new_c... |
# Copyright 2016 EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
<import_stmt>network<def_stmt>conncb task<block_start>print("[{}] Connected".format(task))<block_end><def_stmt>disconncb task<block_start>print("[{}] Disconnected".format(task))<block_end><def_stmt>subscb task<block_start>print("[{}] Subscribed".format(task))<block_end><def_stmt>pubcb pub<block_start>print("[{}] Publis... |
# Copyright (c) 2020. <NAME>, <EMAIL>
<import_stmt>os open3d numpy<as>np<line_sep>File_=open('ModelNet_flist_short.txt' 'w')<if_stmt>__name__<eq>"__main__"<block_start>root_dir="../data/ModelNet_subset/"<for_stmt>root,dirs,files os.walk(root_dir topdown=<false>)<block_start><for_stmt>file files<block_start><if_stmt>'.... |
##########################################################################
#
# Copyright (c) 2013, <NAME>. 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 the f... |
# 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_from_stmt>.provider Provider<import_from_stmt>.adapter Adapter<import_from_stmt>.device Device<import_from_stmt>.gatt GattService GattCharacteristic GattDescriptor<line_sep> |
# Copyright 2021 TUNiB inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... |
<import_from_stmt>.core EqualityHashKey unzip<import_from_stmt>.parallel fold<line_sep> |
# Original work Copyright 2018 The Google AI Language Team Authors.
# Modified work Copyright 2019 <NAME>
#
# 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 -*-
# Thanks to @skelsec for his awesome tool Pypykatz
# Checks his project here: https://github.com/skelsec/pypykatz
<import_stmt>codecs<import_stmt>traceback<import_from_stmt>lazagne.config.module_info ModuleInfo<import_from_stmt>lazagne.config.constant constant<import_from_stmt>pypykatz.pypyka... |
# Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... |
<import_stmt>operator_benchmark<as>op_bench<import_stmt>torch<import_stmt>numpy<import_from_stmt>. configs<line_sep>"""EmbeddingBag Operator Benchmark"""<class_stmt>EmbeddingBagBenchmark(op_bench.TorchBenchmarkBase)<block_start><def_stmt>init self embeddingbags dim mode input_size offset sparse include_last_offset devi... |
"""Python interfaces to DGL farthest point sampler."""<import_from_stmt>dgl._ffi.base DGLError<import_stmt>numpy<as>np<import_from_stmt>.._ffi.function _init_api<import_from_stmt>.. backend<as>F<import_from_stmt>.. ndarray<as>nd<def_stmt>_farthest_point_sampler data batch_size sample_points dist start_idx result<block_... |
"""
Copyright (c) 2018-2022 Intel Corporation
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 wri... |
# Copyright 2013 <NAME> and individual contributors
#
# 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... |
<import_from_stmt>pyspark.sql Row<import_from_stmt>snorkel.labeling.lf labeling_function<import_from_stmt>snorkel.labeling.lf.nlp_spark spark_nlp_labeling_function<import_from_stmt>snorkel.preprocess preprocessor<import_from_stmt>drybell_lfs load_celebrity_knowledge_base<line_sep>ABSTAIN=-1<line_sep>NEGATIVE=0<line_sep... |
# terrascript/resource/sematext.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:26:36 UTC)
#
# For imports without namespace, e.g.
#
# >>> import terrascript.resource.sematext
#
# instead of
#
# >>> import terrascript.resource.sematext.sematext
#
# This is only available for 'official' and 'partne... |
# 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 or agreed to in writing, ... |
<import_stmt>ssg.utils<def_stmt>preprocess data lang<block_start>data["arg_name_value"]=data["arg_name"]+"="+data["arg_value"]<if_stmt>lang<eq>"oval"# escape dot, this is used in oval regex
<block_start>data["escaped_arg_name_value"]=data["arg_name_value"].replace("." "\\.")<line_sep># replace . with _, this is used in... |
# Author: <NAME>
# Copyright (c) 2019, <NAME>
# All rights reserved.
# based on github.com/ClementPinard/SfMLearner-Pytorch
<import_from_future_stmt> division<import_stmt>torch<import_from_stmt>torch.autograd Variable<line_sep>pixel_coords=<none><def_stmt>set_id_grid depth<block_start><global>pixel_coords<line_sep>b,h,... |
# This file shows how to implement a single hidden layer neural network for
# performing binary classification on the GPU using cudamat.
<import_from_future_stmt> division<import_stmt>pdb<import_stmt>time<import_stmt>numpy<as>np<import_stmt>cudamat<as>cm<import_from_stmt>cudamat learn<as>cl<import_stmt>util<line_sep># ... |
'''Entry point into the pommerman module'''<import_stmt>gym<import_stmt>inspect<import_from_stmt>. agents<import_from_stmt>. configs<import_from_stmt>. constants<import_from_stmt>. forward_model<import_from_stmt>. helpers<import_from_stmt>. utility<import_from_stmt>. network<line_sep>gym.logger.set_level(40)<line_sep>R... |
"""Provide common mysensors fixtures."""<import_from_future_stmt> annotations<import_from_stmt>collections.abc AsyncGenerator Callable Generator<import_stmt>json<import_from_stmt>typing Any<import_from_stmt>unittest.mock AsyncMock MagicMock patch<import_from_stmt>mysensors BaseSyncGateway<import_from_stmt>mysensors.per... |
#! usr/bin/env python3
# -*- coding:utf-8 -*-
"""
@Author:<NAME>
Usage:
node_embeddings = tf.random.normal(shape=(5, 3))
adjacency_lists = [
tf.constant([[0, 1], [2, 4], [2, 4]], dtype=tf.int32),
tf.constant([[0, 1], [2, 4], [2, 4]], dtype=tf.int32)
]
layer = RG... |
"""
Implement transformation on Numba IR
"""<import_from_future_stmt> absolute_import print_function<import_from_stmt>collections namedtuple defaultdict<import_stmt>logging<import_from_stmt>numba.analysis compute_cfg_from_blocks find_top_level_loops<import_from_stmt>numba ir errors ir_utils<import_from_stmt>numba.analy... |
<import_stmt>frappe<def_stmt>execute <block_start>frappe.delete_doc_if_exists("DocType" "Web View")<line_sep>frappe.delete_doc_if_exists("DocType" "Web View Component")<line_sep>frappe.delete_doc_if_exists("DocType" "CSS Class")<block_end> |
<import_stmt>numpy<as>np<import_from_stmt>skimage.transform resize<import_from_stmt>skimage measure<import_from_stmt>skimage.measure regionprops<class_stmt>OCROnObjects()<block_start><def_stmt>__init__ self license_plate<block_start>character_objects=self.identify_boundary_objects(license_plate)<line_sep>self.get_regio... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... |
<import_from_stmt>paddle.vision.transforms ToTensor RandomHorizontalFlip RandomResizedCrop SaturationTransform Compose HueTransform BrightnessTransform ContrastTransform RandomCrop Normalize RandomRotation <import_from_stmt>paddle.vision.datasets Cifar100<import_from_stmt>paddle.io DataLoader<import_from_stmt>paddle.op... |
__version__='7.8.0'<line_sep>_optional_dependencies=[{'name':'CuPy' 'packages':['cupy-cuda120' 'cupy-cuda114' 'cupy-cuda113' 'cupy-cuda112' 'cupy-cuda111' 'cupy-cuda110' 'cupy-cuda102' 'cupy-cuda101' 'cupy-cuda100' 'cupy-cuda92' 'cupy-cuda91' 'cupy-cuda90' 'cupy-cuda80' 'cupy' ] 'specifier':'>=7.7.0,<8.0.0' 'help':'htt... |
<import_from_stmt>contextlib contextmanager<import_from_stmt>django.db DatabaseError<import_from_stmt>..core.tracing traced_atomic_transaction<line_sep>@contextmanager<def_stmt>transaction_with_commit_on_errors <block_start>"""Perform transaction and raise an error in any occurred."""<line_sep>error=<none><with_stmt>tr... |
# Copyright 2018 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... |
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.