content stringlengths 0 1.55M |
|---|
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
<import_stmt>re<class_stmt>Autoconf(AutotoolsPackage GNUMirrorPackage)<block_start>"""Autoconf -- system configuration part... |
<class_stmt>myIntSynthProvider(object)<block_start><def_stmt>__init__ self valobj dict<block_start>self.valobj=valobj<line_sep>self.val=self.valobj.GetChildMemberWithName("theValue")<block_end><def_stmt>num_children self<block_start><return>0<block_end><def_stmt>get_child_at_index self index<block_start><return><none><... |
<import_stmt>math<line_sep># Modify the parameters here
UNROLL_FACTOR=32<line_sep>DATA_T='unsigned short'<line_sep># Generate the code
data_type=DATA_T<line_sep>level=int(math.log2(UNROLL_FACTOR))<for_stmt>layer range(level-1 -1 -1)<block_start>pair=int(math.pow(2 layer))<for_stmt>i range(pair)# data_t tmp_[layer]_[pai... |
<import_from_stmt>. depth<import_from_stmt>. outliers<import_from_stmt>. stats<import_from_stmt>. visualization<line_sep> |
<import_stmt>FWCore.ParameterSet.Config<as>cms<line_sep>process=cms.Process("PAT")<line_sep># initialize MessageLogger and output report
process.load("FWCore.MessageLogger.MessageLogger_cfi")<line_sep>process.MessageLogger.cerr.threshold='INFO'<line_sep>process.MessageLogger.cerr.INFO=cms.untracked.PSet(default=cms.unt... |
<import_from_stmt>datetime datetime<line_sep># string to datetime object
datetime_str='09/19/18 13:55:26'<line_sep>datetime_object=datetime.strptime(datetime_str '%m/%d/%y %H:%M:%S')<line_sep>print(type(datetime_object))<line_sep>print(datetime_object)# printed in default format
# string to date object
date_str='09-19-... |
"""
235. Lowest Common Ancestor of a Binary Search Tree
"""<line_sep># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
<class_stmt>Solution(object)<block_start><def_stmt>lowestCommonAncestor s... |
<import_from_stmt>functools wraps<import_from_stmt>collections Iterable<import_from_stmt>django.conf settings<import_from_stmt>django.shortcuts render<import_from_stmt>django.core.exceptions PermissionDenied<import_from_stmt>django.utils.decorators available_attrs<import_from_stmt>django.utils.encoding force_str<import... |
"""
Generate coulomb matrices for molecules.
See Montavon et al., _New Journal of Physics_ __15__ (2013) 095003.
"""<import_stmt>numpy<as>np<import_from_stmt>typing Any List Optional<import_from_stmt>deepchem.utils.typing RDKitMol<import_from_stmt>deepchem.utils.data_utils pad_array<import_from_stmt>deepchem.feat.base... |
# pylint: disable=no-self-use,invalid-name
<import_from_future_stmt> division<import_from_future_stmt> absolute_import<import_stmt>pytest<import_from_stmt>allennlp.data.dataset_readers SnliReader<import_from_stmt>allennlp.common.util ensure_list<import_from_stmt>allennlp.common.testing AllenNlpTestCase<class_stmt>TestS... |
<import_from_stmt>flask Flask<import_from_stmt>flask_restful_swagger.swagger SwaggerRegistry<try_stmt><block_start><import_from_stmt>unittest.mock patch<block_end><except_stmt>ImportError<block_start><import_from_stmt>mock patch<block_end>@patch("flask_restful_swagger.swagger._get_current_registry")@patch("flask_restfu... |
<import_from_stmt>netCDF4 Dataset<import_stmt>matplotlib<import_stmt>matplotlib.pyplot<as>plt<import_from_stmt>matplotlib.patches Polygon<import_from_stmt>matplotlib.collections PatchCollection<import_stmt>matplotlib.cm<as>cm<import_stmt>numpy<as>np<line_sep>#------------------------------------------------------------... |
# (c) Copyright 2014,2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... |
####
# This script demonstrates how to use the Tableau Server Client
# to create new projects, both at the root level and how to nest them using
# parent_id.
#
#
# To run the script, you must have installed Python 3.6 or later.
####
<import_stmt>argparse<import_stmt>logging<import_stmt>sys<import_stmt>tableauserverclie... |
<import_from_stmt>threading Thread<import_stmt>time<import_stmt>unittest<import_stmt>rasterio<as>rio<import_from_stmt>rasterio.env get_gdal_config<class_stmt>TestThreading(unittest.TestCase)<block_start><def_stmt>test_multiopen self<block_start>"""
Open a file from different threads.
Regression test fo... |
<import_stmt>os<import_stmt>angr<line_sep>test_location=os.path.join(os.path.dirname(os.path.realpath(__file__)) '..' '..' 'binaries' 'tests')<def_stmt>test_vtable_extraction_x86_64 <block_start>p=angr.Project(os.path.join(test_location "x86_64" "cpp_classes") auto_load_libs=<false>)<line_sep>vtables_sizes={0x403cb0:24... |
"""JSON (de)serialization framework.
The framework presented here is somewhat based on `Go's "json" package`_
(especially the ``omitempty`` functionality).
.. _`Go's "json" package`: http://golang.org/pkg/encoding/json/
"""<import_stmt>abc<import_stmt>binascii<import_stmt>logging<import_stmt>OpenSSL<import_stmt>six<... |
"""add run_type
Revision ID: 5dd2ba8222b1
Revises: 079a74c15e8b
Create Date: 2021-07-22 23:53:04.043651
"""<import_from_stmt>alembic op<import_stmt>sqlalchemy<as>sa<import_from_stmt>sqlalchemy.dialects postgresql<line_sep># revision identifiers, used by Alembic.
revision='5dd2ba8222b1'<line_sep>down_revision='079a74c... |
<import_from_stmt>.config add_panopticfcn_config<import_from_stmt>.panoptic_seg PanopticFCN<import_from_stmt>.build_solver build_lr_scheduler<line_sep> |
##
# Copyright (c) 2010-2017 Apple 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 l... |
# Copyright 2015, Ansible, Inc.
# <NAME> <<EMAIL>>
#
# 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>tensorflow<as>tf<import_stmt>numpy<as>np<import_from_stmt>ares.attack.base BatchAttack<import_from_stmt>ares.attack.utils get_xs_ph get_ys_ph maybe_to_array get_unit<class_stmt>BIM(BatchAttack)<block_start>''' Basic Iterative Method (BIM). A white-box iterative constraint-based method. Require a differenti... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
<import_from_stmt>numpy.testing assert_allclose<import_from_stmt>astropy.time Time<import_from_stmt>gammapy.data FixedPointingInfo PointingInfo<import_from_stmt>gammapy.utils.testing assert_time_allclose requires_data<line_sep>@requires_data()<class_stmt>T... |
# 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_stmt>time<import_from_stmt>typing Dict Optional<import_stmt>sacremoses# type: ignore
<import_from_stmt>cc_net jsonql text_normalizer<... |
<import_stmt>cv2<line_sep>cv2.setNumThreads(0)<line_sep>cv2.ocl.setUseOpenCL(<false>)<import_stmt>numpy<as>np<import_stmt>math<import_from_stmt>functools wraps<def_stmt>clip img dtype maxval<block_start><return>np.clip(img 0 maxval).astype(dtype)<block_end><def_stmt>clipped func<block_start>"""
wrapper to clip res... |
<import_stmt>django.conf<class_stmt>Settings<block_start>"""
This is a simple class to take the place of the global settings object. An
instance will contain all of our settings as attributes, with default values
if they are not specified by the configuration.
"""<line_sep>defaults={'OTP_LOGIN_URL':djan... |
<import_from_stmt>.test_tensorboard_rest_api TestTensorboardRestAPI<import_from_stmt>.test_tensorboard_server TestTensorboardServer<import_from_stmt>.test_tensorboard_endpoints TestTensorboardEndpoint<line_sep> |
<import_from_stmt>loguru logger<line_sep># See "test_catch_exceptions.py" for extended testing
<def_stmt>test_backtrace writer<block_start>logger.add(writer format="{message}" backtrace=<true>)<try_stmt><block_start>1/0<block_end><except_stmt>Exception<block_start>logger.exception("")<block_end>result_with=writer.read(... |
<import_stmt>io<import_stmt>pytest<import_stmt>pytorch_pfn_extras<as>ppe<import_from_stmt>pytorch_pfn_extras.training.extensions _ipython_module_available<import_from_stmt>pytorch_pfn_extras.training.extensions.log_report _pandas_available<line_sep>@pytest.mark.skipif(<not>_ipython_module_available<or><not>_pandas_avai... |
<import_stmt>string<import_from_stmt>...errors SimValueError<import_from_stmt>. MemoryMixin<class_stmt>HexDumperMixin(MemoryMixin)<block_start><def_stmt>hex_dump self start size word_size=4 words_per_row=4 endianness="Iend_BE" symbolic_char='?' unprintable_char='.' solve=<false> extra_constraints=<none> inspect=<false>... |
# Copyright 2011 The scales Authors.
#
# 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 w... |
#MenuTitle: Steal Kerning Groups from Font
"""Copy kerning groups from one font to another."""<import_from_future_stmt> print_function<import_stmt>vanilla<class_stmt>GroupsCopy(object)<block_start>"""GUI for copying kerning groups from one font to another"""<def_stmt>__init__ self<block_start>self.w=vanilla.FloatingWin... |
<import_stmt>idaapi<import_from_stmt>idaapi *<line_sep>inifinite_loops=[b"\x00\xbf\xfd\xe7" # loop: nop; b loop
b"\xfe\xe7" # loop: b loop
]<line_sep>whitelist=["Reset_Handler" "main"]<def_stmt>detect_noret_funcs <block_start>exit_locs_name_pairs=[]<for_stmt>func_addr Functions()<block_start><if_stmt>get_func_flags(fun... |
# encoding: utf-8
<import_stmt>datetime<import_stmt>numpy<as>np<import_stmt>pandas<as>pd<def_stmt>get_next_period_day current period n=1 extra_offset=0<block_start>"""
Get the n'th day in next period from current day.
Parameters
----------
current : int
Current date in format "%Y%m%d".
peri... |
<class_stmt>Acl(object)<block_start><def_stmt>__init__ self read_acl<block_start>self.read_acl=read_acl<block_end>@staticmethod<def_stmt>from_acl_response acl_response<block_start>'''Takes JSON response from API and converts to ACL object'''<if_stmt>'read'<in>acl_response<block_start>read_acl=AclType.from_acl_response(... |
<import_stmt>os<import_from_stmt>pathlib Path<import_from_stmt>ament_index_python.packages get_package_share_directory<import_from_stmt>launch LaunchDescription<import_from_stmt>launch.actions IncludeLaunchDescription SetEnvironmentVariable Shutdown<import_from_stmt>launch.launch_description_sources PythonLaunchDescrip... |
<import_stmt>pygame<import_from_stmt>pygame.locals *<class_stmt>ControlScheme<block_start><def_stmt>__init__ self<block_start>self.up=K_UP<line_sep>self.down=K_DOWN<block_end><block_end><class_stmt>Bat<block_start><def_stmt>__init__ self start_pos control_scheme court_size<block_start>self.control_scheme=control_scheme... |
"""
An image store representing Rackspace specific images
"""<import_from_future_stmt> absolute_import division unicode_literals<import_stmt>attr<import_from_stmt>six iteritems<import_from_stmt>mimic.model.rackspace_images RackspaceWindowsImage RackspaceCentOSPVImage RackspaceCentOSPVHMImage RackspaceCoreOSImage Racksp... |
<import_stmt>os<import_from_stmt>functools lru_cache<import_stmt>numpy<as>np<import_from_stmt>qtpy.QtCore Qt<import_from_stmt>qtpy QtCore QtGui QtWidgets<import_from_stmt>matplotlib.colors ColorConverter<import_from_stmt>glue.utils.qt get_qapp<import_from_stmt>glue.config viewer_tool<import_from_stmt>glue.core BaseData... |
# Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
<import_stmt>unittest<import_stmt>os<import_stmt>tempfile<import_stmt>shutil<import_stmt>contextlib<import_from_stmt>pytest warns<import_from_stmt>scrapy.exceptions ScrapyDeprecationWarning<import_from_stmt>scrapy.utils.project data_path get_project_settings<line_sep>@contextlib.contextmanager<def_stmt>inside_a_project... |
<import_from_stmt>trainer.normal NormalTrainer<import_from_stmt>config cfg<def_stmt>get_trainer <block_start>pair={'normal':NormalTrainer}<assert_stmt>(cfg.train.trainer<in>pair)<line_sep><return>pair[cfg.train.trainer]()<block_end> |
# Copyright 2017 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 agre... |
<import_stmt>_plotly_utils.basevalidators<class_stmt>ConnectorValidator(_plotly_utils.basevalidators.CompoundValidator)<block_start><def_stmt>__init__ self plotly_name="connector" parent_name="waterfall" **kwargs<block_start>super(ConnectorValidator self).__init__(plotly_name=plotly_name parent_name=parent_name data_cl... |
<import_stmt>json<import_stmt>regex<import_stmt>nltk.data<import_from_stmt>nltk.tokenize word_tokenize<import_stmt>sys<line_sep>sent_detector=nltk.data.load('tokenizers/punkt/english.pickle')<def_stmt>tokenize string<block_start><return>word_tokenize(string)<block_end><def_stmt>split_paragraphs text<block_start>"""
... |
<import_stmt>re<import_from_stmt>.._compat integer_types long<import_from_stmt>.base SQLAdapter<import_from_stmt>. adapters<line_sep>@adapters.register_for("sapdb")<class_stmt>SAPDB(SQLAdapter)<block_start>dbengine="sapdb"<line_sep>drivers=("sapdb" )<line_sep>REGEX_URI=("^(?P<user>[^:@]+)(:(?P<password>[^@]*))?"<concat... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
# -*- coding: utf-8 -*-
"""
Created on 2017-4-25
@author: cheng.li
"""<import_stmt>datetime<as>dt<import_stmt>numpy<as>np<import_from_stmt>sklearn.linear_model LinearRegression<import_from_stmt>alphamind.data.neutralize neutralize<def_stmt>benchmark_neutralize n_samples:int n_features:int n_loops:int<arrow><none>... |
# coding: utf-8
# DJANGO IMPORTS
<import_from_stmt>django.conf settings<line_sep># Admin Site Title
ADMIN_HEADLINE=getattr(settings "GRAPPELLI_ADMIN_HEADLINE" 'Grappelli')<line_sep>ADMIN_TITLE=getattr(settings "GRAPPELLI_ADMIN_TITLE" 'Grappelli')<line_sep># Link to your Main Admin Site (no slashes at start and end)
ADM... |
<import_from_stmt>..utils run<import_stmt>logging<line_sep>logger=logging.getLogger(__name__)<def_stmt>process_one_package path package python_version="3"<block_start>"""Get details about one precise python package in the given image.
:param path: path were the docker image filesystem is expanded.
:type pa... |
'''
Test redirection behavior to invalid addresses
'''<line_sep># 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 u... |
<import_stmt>unittest<import_stmt>mock<import_from_stmt>...management.stats Stats<class_stmt>TestStats(unittest.TestCase)<block_start><def_stmt>test_init_with_optionals self<block_start>t=Stats(domain='domain' token='<PASSWORD>' telemetry=<false> timeout=(10 2))<line_sep>self.assertEqual(t.client.options.timeout (10 2)... |
# Author: <NAME> <<EMAIL>>
# A core-attachment based method to detect protein complexes in PPI networks
# <NAME>, Kwoh, Ng (2009)
# http://www.biomedcentral.com/1471-2105/10/169
<import_from_stmt>collections defaultdict<import_from_stmt>itertools combinations<import_stmt>functools<line_sep># return average degree and d... |
##########################################################################
#
# Copyright (c) 2016, 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:
#
# * Redistrib... |
<import_stmt>math<import_from_stmt>collections namedtuple<import_from_stmt>. geohash<line_sep>Box=namedtuple("Box" ["s" "w" "n" "e"])<def_stmt>geohash_bbox gh<block_start>ret=geohash.bbox(gh)<line_sep><return>Box(ret["s"] ret["w"] ret["n"] ret["e"])<block_end><def_stmt>bbox lat lon radius<block_start>lat_delta=radius<t... |
"""Use TIMESTAMP column for latest submission
Revision ID: eff<PASSWORD>0<PASSWORD>
Revises: <PASSWORD>
Create Date: 2017-01-08 22:20:43.814375
"""<line_sep># revision identifiers, used by Alembic.
revision='eff<PASSWORD>'<line_sep>down_revision='<PASSWORD>'<import_from_stmt>alembic op# lgtm[py/unused-import]
<import... |
# Copyright (c) 2018, NVIDIA CORPORATION. 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 retain the above copyright
# notice, this list of conditions a... |
# 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>.main main<as>run# noqa: F401
__version__='0.0.3'<line_sep> |
# Copyright (c) OpenMMLab. All rights reserved.
<import_from_stmt>.darts_backbone DartsBackbone<import_from_stmt>.searchable_mobilenet SearchableMobileNet<import_from_stmt>.searchable_shufflenet_v2 SearchableShuffleNetV2<line_sep>__all__=['DartsBackbone' 'SearchableShuffleNetV2' 'SearchableMobileNet']<line_sep> |
<import_stmt>sys<import_from_stmt>. app<line_sep>sys.path.append(str(app.config['LIB_PATH']))<import_from_stmt>musicautobot.music_transformer *<import_from_stmt>musicautobot.config *<import_from_stmt>flask Response send_from_directory send_file request jsonify<import_from_stmt>.save to_s3<import_stmt>torch<import_stmt>... |
<import_from_future_stmt> absolute_import division print_function<import_from_stmt>tests.core mock<import_from_stmt>trakt Trakt<import_from_stmt>httmock HTTMock<import_stmt>pytest<def_stmt>test_likes <block_start><with_stmt>HTTMock(mock.fixtures mock.unknown)<block_start><with_stmt>Trakt.configuration.auth('mock' 'mock... |
# coding=utf-8
# 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 ... |
<import_from_stmt>reikna.core.signature Type Annotation Parameter Signature<import_from_stmt>reikna.core.computation Computation<import_from_stmt>reikna.core.transformation Transformation Indices<line_sep> |
<import_from_future_stmt> absolute_import<import_from_future_stmt> print_function<import_from_future_stmt> division<def_stmt>Shape visitor node<block_start>input=visitor.visit(node.input[0])<line_sep>shape=input.shape<if_stmt>(input.get_layout()<is><not><none><and>input.get_onnx_layout()<is><not><none><and>input.get_la... |
<import_from_future_stmt> print_function<import_stmt>json<import_stmt>os<class_stmt>Data()<block_start>shared_state={}<def_stmt>__init__ self<block_start>self.__dict__=self.shared_state<line_sep>self.set_checklist(<none>)<line_sep>self.set_issues()<block_end><def_stmt>set_checklist self file_name<block_start>is_empty=f... |
# Convenience test module to run all of the XML-related tests in the
# standard library.
<import_stmt>sys<import_stmt>test.test_support<line_sep>test.test_support.verbose=0<def_stmt>runtest name<block_start>__import__(name)<line_sep>module=sys.modules[name]<if_stmt>hasattr(module "test_main")<block_start>module.test_ma... |
<import_stmt>pytest<import_stmt>os<import_stmt>memcnn.experiment.factory<import_from_stmt>memcnn.config Config<def_stmt>test_get_attr_from_module <block_start>a=memcnn.experiment.factory.get_attr_from_module('memcnn.experiment.factory.get_attr_from_module')<assert_stmt>a<is>memcnn.experiment.factory.get_attr_from_modul... |
##############################################################################
# Copyright 2016-2017 Rigetti Computing
#
# 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... |
<import_stmt>datetime<line_sep>s='2018-12-31'<line_sep>d=datetime.date.fromisoformat(s)<line_sep>print(d)<line_sep># 2018-12-31
print(type(d))<line_sep># <class 'datetime.date'>
# print(datetime.date.fromisoformat('2018-12'))
# ValueError: Invalid isoformat string: '2018-12'
print(datetime.date.fromisoformat('2018-01-0... |
"""
Summarize a column total cases column and total deaths column
Country by country data in columns, sum up and match global totals
"""<import_stmt>csv<import_stmt>pandas<line_sep>pandas.set_option("display.max_rows" <none> "display.max_columns" <none>)<line_sep>col_list=["Total Cases" "Country/ Other" "Total Deaths"... |
<import_from_stmt>insights.parsers.zipl_conf ZiplConf<import_from_stmt>insights.tests context_wrap<import_from_stmt>insights.parsers ParseException<import_stmt>pytest<line_sep>ZIPL_CONF="""
[defaultboot]
defaultauto
prompt=1
timeout=5
default=linux
target=/boot
[linux]
image=/boot/vmlinuz-3.10.0-693.el7.s390x
r... |
<import_from_future_stmt> absolute_import print_function division<import_stmt>unittest<import_from_stmt>pony.orm.core *<import_from_stmt>pony.orm.core local<import_from_stmt>pony.orm.tests.testutils *<import_from_stmt>pony.orm.tests setup_database teardown_database<class_stmt>TestGeneratorDbSession(unittest.TestCase)<b... |
"""
Define authorization predicates.
These are functions which accept an `Identity` object and a context object and
return a truthy value. These represent building blocks of our permission map
which define when people do, or don't have permissions.
For example a predicate might define "group_created_by_user" which is... |
<import_stmt>os<import_stmt>sys<import_stmt>gc<import_stmt>ctypes<import_stmt>psutil<import_stmt>pytest<import_stmt>warnings<import_stmt>threading<import_from_stmt>time sleep<import_from_stmt>multiprocessing util current_process<import_from_stmt>pickle PicklingError UnpicklingError<import_from_stmt>distutils.version Lo... |
# Copyright (c) 2020 NVIDIA Corporation. All rights reserved.
# This work is licensed under the NVIDIA Source Code License - Non-commercial. Full
# text can be found in LICENSE.md
<import_from_stmt>setuptools setup dist<import_stmt>wheel<import_stmt>os<line_sep># required to geneerate a platlib folder required by audit... |
# Run this script to create stopwords.py based on stopwords.txt
<import_stmt>json<def_stmt>generate input_txt output_py# Read line by line
<block_start>txt_file=open(input_txt)<line_sep>words=set([])<for_stmt>raw_line txt_file<block_start>line=raw_line.strip()<line_sep># Skip empty line
<if_stmt>len(line)<l>1<block_sta... |
"""
(c) 2013 LinkedIn Corp. 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 agreed to in writing... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
<import_from_stmt>sequana.tools bam_to_mapped_unmapped_fastq reverse_complement StatsBAM2Mapped<import_from_stmt>sequana sequana_data<import_from_stmt>sequana.tools bam_get_paired_distance GZLineCounter PairedFastQ<import_from_stmt>sequana.tools genbank_features_parser<def_stmt>test_StatsBAM2Mapped <block_start>data=se... |
_base_=['./rotated-detection_static.py' '../_base_/backends/tensorrt.py']<line_sep>onnx_config=dict(output_names=['dets' 'labels'] input_shape=<none> dynamic_axes={'input':{0:'batch' 2:'height' 3:'width'} 'dets':{0:'batch' 1:'num_dets' } 'labels':{0:'batch' 1:'num_dets' } } )<line_sep>backend_config=dict(common_config=... |
<import_stmt>numpy<as>np<def_stmt>load_mnist # the data, shuffled and split between train and test sets
<block_start><import_from_stmt>keras.datasets mnist<line_sep>(x_train y_train),(x_test y_test)=mnist.load_data()<line_sep>x=np.concatenate((x_train x_test))<line_sep>y=np.concatenate((y_train y_test))<line_sep>x=x.re... |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. 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>pytest<import_from_stmt>astropy.io fits<import_stmt>numpy<as>np<import_from_stmt>lightkurve.io.kepseismic read_kepseismic_lightcurve<import_from_stmt>lightkurve.io.detect detect_filetype<line_sep>@pytest.mark.remote_data<def_stmt>test_detect_kepseismic <block_start>"""Can we detect the correct format for K... |
# -*- coding: utf-8 -*-
<import_from_stmt>django forms<import_from_stmt>django.utils.translation gettext_lazy<as>_<import_from_stmt>django.utils.encoding smart_bytes<import_from_stmt>django.utils timezone<import_from_stmt>..core utils<import_from_stmt>..core.utils.forms NestedModelChoiceField<import_from_stmt>..categor... |
<import_stmt>unittest<import_stmt>os<import_from_stmt>six StringIO<import_from_stmt>package_manager util<line_sep>CHECKSUM_TXT="1915adb697103d42655711e7b00a7dbe398a33d7719d6370c01001273010d069"<line_sep>DEBIAN_JESSIE_OS_RELEASE="""PRETTY_NAME="Distroless"
NAME="Debian GNU/Linux"
ID="debian"
VERSION_ID="8"
VERSION="Debi... |
"""Support for SmartHab device integration."""<import_from_stmt>datetime timedelta<import_stmt>logging<import_stmt>pysmarthab<import_from_stmt>requests.exceptions Timeout<import_from_stmt>homeassistant.components.light LightEntity<import_from_stmt>. DATA_HUB DOMAIN<line_sep>_LOGGER=logging.getLogger(__name__)<line_sep>... |
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
<import_from_future_stmt> annotations<import_from_stmt>textwrap dedent<import_from_stmt>typing Any ContextManager<import_stmt>pytest<import_from_stmt>pants.backend.docker.goals package_imag... |
<import_from_stmt>.model DeepLabResNetModel<import_from_stmt>.hc_deeplab HyperColumn_Deeplabv2<import_from_stmt>.image_reader ImageReader read_data_list get_indicator_mat get_batch_1chunk read_an_image_from_disk tf_wrap_get_patch get_batch<import_from_stmt>.utils decode_labels inv_preprocess prepare_label<line_sep> |
# coding: utf-8
"""
joplin-web
"""<import_from_stmt>django.conf settings<import_from_stmt>django.http.response JsonResponse<import_from_stmt>django.urls reverse<import_from_stmt>joplin_api JoplinApiSync<import_from_stmt>joplin_web.utils nb_notes_by_tag nb_notes_by_folder<import_stmt>logging<import_from_stmt>rich con... |
<import_from_stmt>.base *<class_stmt>Input(Layer)<block_start><def_stmt>__init__ self input_shape:Union[List Tuple] **kwargs<block_start>super(Input self).__init__(input_shape=input_shape **kwargs)<line_sep>self._shape=input_shape<block_end><def_stmt>call self x:F.Tensor *args **kwargs<arrow>F.Tensor<block_start>self._... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
<import_stmt>torchx.examples.apps.lightning_classy_vision.component<as>lightning_classy_vision<import_from_stmt>... |
<import_from_stmt>os.path join dirname<import_stmt>numpy<as>np<import_from_stmt>.text put_text<import_from_stmt>.. const<import_from_stmt>..os makedirs<import_from_stmt>..imprt preset_import<import_from_stmt>..log get_logger<line_sep>logger=get_logger()<def_stmt>make_video imgs fps=24 outpath=<none> method='matplotlib'... |
<import_stmt>logging<class_stmt>BaseConfig(object)<block_start>"""BaseConfig provides a common interface for nested access for all Config objects in CCI."""<line_sep>defaults={}<def_stmt>__init__ self config=<none> keychain=<none><block_start><if_stmt>config<is><none><block_start>self.config={}<block_end><else_stmt><bl... |
# -*- coding: utf-8 -*-
<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<import_stmt>numpy<as>np<line_sep># Func1: change density map into count map
# density map: batch size * 1 * w * h
<def_stmt>get_local_count density_map psize pstride<block_start>IF_gpu=torch.cuda.is_available()... |
<import_stmt>a<as>b<import_stmt>b.c<as>e<line_sep>b.foo(1)<line_sep>e.baz(1)<line_sep> |
"""Issue #712"""<import_from_stmt>nbformat.v4.nbbase new_code_cell new_notebook<import_from_stmt>jupytext reads writes<import_from_stmt>jupytext.cell_to_text three_backticks_or_more<import_from_stmt>jupytext.compare compare compare_notebooks<import_from_stmt>.utils requires_myst<def_stmt>test_three_backticks_or_more <b... |
''' This file provides a wrapper class for Fast_AT (https://github.com/locuslab/fast_adversarial) model for CIFAR-10 dataset. '''<import_stmt>sys<import_stmt>os<import_stmt>torch<import_stmt>torch.nn<as>nn<import_stmt>torch.nn.functional<as>F<import_stmt>tensorflow<as>tf<import_from_stmt>ares.model.pytorch_wrapper pyto... |
<import_from_stmt>mayan.apps.testing.tests.base GenericViewTestCase<import_from_stmt>..events event_smart_link_edited<import_from_stmt>..permissions permission_smart_link_edit<import_from_stmt>.mixins SmartLinkConditionViewTestMixin SmartLinkTestMixin SmartLinkViewTestMixin <class_stmt>SmartLinkConditionViewTestCase(Sm... |
<import_from_stmt>container.base TimeBase<import_from_stmt>container.array TimeArray TimeDtype<import_from_stmt>container.timeseries TimeSeries<import_from_stmt>container.timeframe TimeFrame<line_sep> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.