uid
stringlengths
24
24
split
stringclasses
1 value
category
stringclasses
2 values
content
stringlengths
5
482k
signature
stringlengths
1
14k
suffix
stringlengths
1
482k
prefix
stringlengths
9
14k
prefix_token_count
int64
3
5.01k
prefix_token_budget
int64
64
256
element_token_count
int64
1
292k
signature_token_count
int64
1
5.01k
prefix_context_token_count
int64
0
255
repo
stringlengths
7
112
path
stringlengths
4
208
language
stringclasses
1 value
name
stringlengths
1
218
qualname
stringlengths
1
218
start_line
int64
1
26.7k
end_line
int64
1
26.7k
signature_start_line
int64
1
26.7k
signature_end_line
int64
1
26.7k
source_hash
stringlengths
40
40
source_dataset
stringclasses
1 value
source_split
stringclasses
1 value
cc1c3f80de4f07603b837adf
train
class
class Tests: # Game Mode 2 enter_game_mode_2 = ("Entered game mode 2", "Failed to enter game mode 2") sphere_found_2 = ("Test 2: Sphere was found", "Test 2: Sphere was not found") terrain_found_2 = ("Test 2: Terrrain Entity found", "Tes...
class Tests: # Game Mode 2
enter_game_mode_2 = ("Entered game mode 2", "Failed to enter game mode 2") sphere_found_2 = ("Test 2: Sphere was found", "Test 2: Sphere was not found") terrain_found_2 = ("Test 2: Terrrain Entity found", "Test 2: Terrain Entity was not fou...
""" 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 : C15096732 # Test Case Title : Verify Default material library works across different levels ...
85
155
519
10
74
fromasmtodisasm/o3de
AutomatedTesting/Gem/PythonTests/physics/material/C15096732_Material_DefaultLibraryUpdatedAcrossLevels_after.py
Python
Tests
Tests
13
36
13
14
2d02fe3927db25a2c92d2ae3b0d007664ce6fb21
bigcode/the-stack
train
11645c40f1c623e23c220c43
train
function
def check_manifest(arch, manifest): current_package = {} for line in manifest: if line.isspace(): package_name = current_package['Package'] package_version = current_package['Version'] if not package_name in version_map: # Skip sub-package ...
def check_manifest(arch, manifest):
current_package = {} for line in manifest: if line.isspace(): package_name = current_package['Package'] package_version = current_package['Version'] if not package_name in version_map: # Skip sub-package continue latest_vers...
, PIPE version_map = {} any_error = False pipe = Popen('./scripts/list-versions.sh', stdout=PIPE) for line in pipe.stdout: (name, version) = line.decode().strip().split('=') version_map[name] = version def check_manifest(arch, manifest):
64
64
145
8
55
waruqi/termux-pentest
scripts/check-built-packages.py
Python
check_manifest
check_manifest
32
47
32
32
2f674c6ff3b7ca9b6c62e207cad45988b7c50083
bigcode/the-stack
train
9db31b0122df9b10c7b7b5a0
train
function
def main(argv): # graph_data() if len(argv) == 0: print('You must pass some parameters. Use \"-h\" to help.') return if len(argv) == 1 and argv[0] == '-h': __tool_logo() print(""" \n""" + colored(" Examples:\n", "green") + """ """ + colored('# Get tweets by username\n', '...
def main(argv): # graph_data()
if len(argv) == 0: print('You must pass some parameters. Use \"-h\" to help.') return if len(argv) == 1 and argv[0] == '-h': __tool_logo() print(""" \n""" + colored(" Examples:\n", "green") + """ """ + colored('# Get tweets by username\n', 'green') + """ ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import getopt import parser import sqlite3 import sys from termcolor import colored conn = sqlite3.connect('TweetAnalysis.db') conn.row_factory = lambda cursor, row: row[1] c = conn.cursor() hash_list = [] c.execute("CREATE TABLE IF NOT EXISTS Location (locationid, pla...
180
256
999
9
171
mdgrotheer/twitter-intelligence
tracking.py
Python
main
main
24
132
24
25
c3e9e96b267ae70a2a60046b01dc55997a5a9c40
bigcode/the-stack
train
ea6e1223bb62b4e0ad1a2f21
train
function
def __tool_logo(): print(colored('''\n\t\t\033[1m ___________ .__.__ __ \__ ___/_ _ _|__|__|/ |_ ___________ | | \ \/ \/ / | \ __\/ __ \_ __ \ ...
def __tool_logo():
print(colored('''\n\t\t\033[1m ___________ .__.__ __ \__ ___/_ _ _|__|__|/ |_ ___________ | | \ \/ \/ / | \ __\/ __ \_ __ \ | | \...
conn.commit() print(colored('\n[+] %d tweet received...\n' % len(tweets), 'green')) parser.operation.TweetManager.get_tweets(tweet_criteria, receive_buffer, location_search=location_value) except arg: print('You must pass some parameters. Use \"-h\" to help.' + arg) ...
102
102
343
5
97
mdgrotheer/twitter-intelligence
tracking.py
Python
__tool_logo
__tool_logo
135
155
135
135
e451317d5127eaaccd1f308be5e0a7558fcaebd3
bigcode/the-stack
train
fee682a16eb6be86860753d6
train
class
class Migration(migrations.Migration): dependencies = [ ('ReclamaCaicoApp', '0005_auto_20190903_1904'), ] operations = [ migrations.RemoveField( model_name='reclamacao', name='Ncasa', ), migrations.AlterField( model_name='reclamacao', ...
class Migration(migrations.Migration):
dependencies = [ ('ReclamaCaicoApp', '0005_auto_20190903_1904'), ] operations = [ migrations.RemoveField( model_name='reclamacao', name='Ncasa', ), migrations.AlterField( model_name='reclamacao', name='bairro', fiel...
# Generated by Django 2.2.2 on 2019-09-03 22:43 from django.db import migrations, models class Migration(migrations.Migration):
38
68
229
7
30
WesleyVitor/ReclamaCaico
Application/ReclamaCaicoProject/ReclamaCaicoApp/migrations/0006_auto_20190903_1943.py
Python
Migration
Migration
6
37
6
7
379bd627850a70fecc1d8c927e16f1c62eefa7d7
bigcode/the-stack
train
9257ebea4d8252244a17c772
train
function
def hwPart5(): myfilename="housing.data.txt" retLine="" newlist = [] print("\n ~ ~ ~ Part 5 ~ ~ ~") open('part5.txt', 'w').close() with open(myfilename, 'r') as file_handle: for line in file_handle.readlines(): line_clean = line.replace(' ',' ').replace(' ',' ' ) ...
def hwPart5():
myfilename="housing.data.txt" retLine="" newlist = [] print("\n ~ ~ ~ Part 5 ~ ~ ~") open('part5.txt', 'w').close() with open(myfilename, 'r') as file_handle: for line in file_handle.readlines(): line_clean = line.replace(' ',' ').replace(' ',' ' ) line_...
print (float(value), end=" ") with open("part1.txt", "a") as f2: f2.write('{:>10}'.format(value)) with open("part1.txt", "a") as f2: f2.write("\n") def hwPart5():
64
64
158
5
59
allys-99/class4
our_csv_parser_file.py
Python
hwPart5
hwPart5
28
42
28
28
405c7682277d0a4152675c069420d2d535951b6b
bigcode/the-stack
train
5a5501a215b8d5d13f461f49
train
function
def PrintNice(alist): f5=open("part5.txt","a") for value in alist: if '.' not in value: print(int(value), end=" ") else: print(float(value), end=" ") f5.write('{:>10}'.format(value)) f5.write("\n") print("\n",end=" ")
def PrintNice(alist):
f5=open("part5.txt","a") for value in alist: if '.' not in value: print(int(value), end=" ") else: print(float(value), end=" ") f5.write('{:>10}'.format(value)) f5.write("\n") print("\n",end=" ")
(" ") newlist.append(values) listTranspose = [[row[i] for row in newlist] for i in range( len(newlist[0]) ) ] for idx, value in enumerate(listTranspose): PrintNice(value) #print("\n") def PrintNice(alist):
64
64
78
6
58
allys-99/class4
our_csv_parser_file.py
Python
PrintNice
PrintNice
45
54
45
45
e688b6c90d68e4b8c16f64b5e3b030ea26ba327f
bigcode/the-stack
train
9c05096012731d9515173c4a
train
function
def hwPart1(): myfilename="housing.data.txt" print(" ~ ~ ~ Part 1 ~ ~ ~") open('part1.txt', 'w').close() with open(myfilename, 'r') as file_handle: for line in file_handle.readlines(): line_clean = line.replace(' ',' ').replace(' ',' ' ) line_clean =line_clean.s...
def hwPart1():
myfilename="housing.data.txt" print(" ~ ~ ~ Part 1 ~ ~ ~") open('part1.txt', 'w').close() with open(myfilename, 'r') as file_handle: for line in file_handle.readlines(): line_clean = line.replace(' ',' ').replace(' ',' ' ) line_clean =line_clean.strip() ...
#!/usr/bin/env python import os def hwPart1():
14
64
191
5
8
allys-99/class4
our_csv_parser_file.py
Python
hwPart1
hwPart1
5
25
5
6
fe057aedf3d79acf659544bfedf624e56b953eba
bigcode/the-stack
train
ef43053675ed546bf7727382
train
class
class KeyPairs(horizon.Panel): name = _("Key Pairs") slug = 'key_pairs' permissions = ('openstack.services.compute',) policy_rules = (("compute", "os_compute_api:os-keypairs:index"), ("compute", "os_compute_api:os-keypairs:create"),)
class KeyPairs(horizon.Panel):
name = _("Key Pairs") slug = 'key_pairs' permissions = ('openstack.services.compute',) policy_rules = (("compute", "os_compute_api:os-keypairs:index"), ("compute", "os_compute_api:os-keypairs:create"),)
an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from django.utils.translation import gettext_lazy as _ import horizon class KeyPairs(horizon.Panel):
64
64
65
7
56
hemantsonawane95/horizon-apelby
openstack_dashboard/dashboards/project/key_pairs/panel.py
Python
KeyPairs
KeyPairs
20
25
20
20
7796fa47bfd4346983970375ffb6e4b66c8ab352
bigcode/the-stack
train
6e27f6d87148668be44280f2
train
function
def split(df, group): data = namedtuple('data', ['filename', 'object']) gb = df.groupby(group) return [data(filename, gb.get_group(x)) for filename, x in zip(gb.groups.keys(), gb.groups)]
def split(df, group):
data = namedtuple('data', ['filename', 'object']) gb = df.groupby(group) return [data(filename, gb.get_group(x)) for filename, x in zip(gb.groups.keys(), gb.groups)]
as pd csv_path='/media/mayank_sati/DATA/datasets/one_shot_datasets/Farmington/images/2019-09-27-14-39-41_test_scaled_eval_farm.csv' data = pd.read_csv(csv_path) print(data.head()) def split(df, group):
64
64
52
6
58
mayanks888/QATM_pytorch_ros2
version_v6_for_eval_multitemplate/prac.py
Python
split
split
8
11
8
8
a3dc755b636f45c7cd10cb01934626df6356fd9a
bigcode/the-stack
train
c804acbc3743392714691eab
train
function
def generate_image_encoding(): face_picture = face_recognition.load_image_file("app/tabishGroup.jpeg") face_locations = face_recognition.face_locations(face_picture,model='hog') return face_recognition.face_encodings(face_picture, face_locations)
def generate_image_encoding():
face_picture = face_recognition.load_image_file("app/tabishGroup.jpeg") face_locations = face_recognition.face_locations(face_picture,model='hog') return face_recognition.face_encodings(face_picture, face_locations)
import face_recognition import os print("==============================") print(os.getcwd()) print("==============================") def generate_image_encoding():
25
64
52
5
20
Ubaid-Manzoor/Attendance-APP
version_II/app/helpers/image_helper.py
Python
generate_image_encoding
generate_image_encoding
9
12
9
9
a5f2f1470d0d197bf182a6f16b348759c63c7245
bigcode/the-stack
train
4997c3dd246d820fe678c3bc
train
class
class ImportOpsUtilTest(LiteTest): def testGetPotentiallySupportedOps(self): self.assertIsNotNone(lite.get_potentially_supported_ops())
class ImportOpsUtilTest(LiteTest):
def testGetPotentiallySupportedOps(self): self.assertIsNotNone(lite.get_potentially_supported_ops())
_model) interpreter.allocate_tensors() input_details = interpreter.get_input_details() self.assertLen(input_details, 2) self.assertEqual('Placeholder', input_details[0]['name']) self.assertEqual('Const', input_details[1]['name']) class ImportOpsUtilTest(LiteTest):
64
64
34
9
55
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
ImportOpsUtilTest
ImportOpsUtilTest
2,155
2,158
2,155
2,156
61d3ba59d79cbf46888e03169abad33cb96f5c2e
bigcode/the-stack
train
549f5b956ce3db38af7b3b6c
train
class
class MyAddLayer(keras.layers.Layer): def __init__(self, increment, **kwargs): super(MyAddLayer, self).__init__(**kwargs) self._increment = increment def call(self, inputs): return inputs + self._increment def get_config(self): config = super(MyAddLayer, self).get_config() config['increment...
class MyAddLayer(keras.layers.Layer):
def __init__(self, increment, **kwargs): super(MyAddLayer, self).__init__(**kwargs) self._increment = increment def call(self, inputs): return inputs + self._increment def get_config(self): config = super(MyAddLayer, self).get_config() config['increment'] = self._increment return config
.""" saved_model_dir = self._createSavedModel(shape=[1, 16, 16, 3]) converter = lite.TFLiteConverter.from_saved_model(saved_model_dir) converter.convert() self.assertValidDebugInfo(converter._debug_info) class MyAddLayer(keras.layers.Layer):
64
64
89
9
55
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
MyAddLayer
MyAddLayer
1,705
1,717
1,705
1,706
231607d58d82dc86b2b9f6960f3be52c9e97f4b1
bigcode/the-stack
train
6248a1f4b8830c1a192bfa10
train
class
class FromKerasFile(TestModels, parameterized.TestCase): def setUp(self): super(FromKerasFile, self).setUp() self._keras_file = None self._custom_objects = None if not context.executing_eagerly(): keras.backend.clear_session() def tearDown(self): if self._keras_file: os.remove(self...
class FromKerasFile(TestModels, parameterized.TestCase):
def setUp(self): super(FromKerasFile, self).setUp() self._keras_file = None self._custom_objects = None if not context.executing_eagerly(): keras.backend.clear_session() def tearDown(self): if self._keras_file: os.remove(self._keras_file) super(FromKerasFile, self).tearDown() ...
1, 16, 16, 3]) # Convert model and ensure model is not None. converter = lite.TocoConverter.from_saved_model(saved_model_dir) tflite_model = converter.convert() self.assertTrue(tflite_model) # Ensure the model is able to load. interpreter = Interpreter(model_content=tflite_model) interpret...
256
256
3,416
13
242
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromKerasFile
FromKerasFile
1,720
2,089
1,720
1,721
7d28a354f15335acd37bf8fb8cf58a2859cff499
bigcode/the-stack
train
c233c28c9bfacf0f2a7cb1eb
train
class
class FromConstructor(TestModels): # Tests invalid constructors using a dummy value for the GraphDef. def testInvalidConstructor(self): message = ('If input_tensors and output_tensors are None, both ' 'input_arrays_with_shape and output_arrays must be defined.') # `output_arrays` is not def...
class FromConstructor(TestModels): # Tests invalid constructors using a dummy value for the GraphDef.
def testInvalidConstructor(self): message = ('If input_tensors and output_tensors are None, both ' 'input_arrays_with_shape and output_arrays must be defined.') # `output_arrays` is not defined. with self.assertRaises(ValueError) as error: lite.TFLiteConverter( None, None, ...
file_names = set() for file_path in debug_info.files: file_names.add(os.path.basename(file_path)) # To make the test independent on how the nodes are created, we only assert # the name of this test file. self.assertIn('lite_test.py', file_names) self.assertNotIn('lite_v2_test.py', file_nam...
99
99
331
20
79
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromConstructor
FromConstructor
89
125
89
91
ae7671d15384425b4dee233f3f6d954baa0a8783
bigcode/the-stack
train
5c3d7d93a91a79455985a44e
train
class
class FromSavedModelTest(TestModels): def _createSavedModel(self, shape): """Create a simple SavedModel.""" saved_model_dir = os.path.join(self.get_temp_dir(), 'simple_savedmodel') with ops.Graph().as_default(): with session.Session() as sess: in_tensor_1 = array_ops.placeholder( ...
class FromSavedModelTest(TestModels):
def _createSavedModel(self, shape): """Create a simple SavedModel.""" saved_model_dir = os.path.join(self.get_temp_dir(), 'simple_savedmodel') with ops.Graph().as_default(): with session.Session() as sess: in_tensor_1 = array_ops.placeholder( shape=shape, dtype=dtypes.float32, na...
.assertTrue(([1] == output_details[3]['shape']).all()) def testTFLiteGraphDefMissingShape(self): # Tests invalid cases for the model that cannot be loaded in TensorFlow. self._initObjectDetectionArgs() # Missing `input_shapes`. with self.assertRaises(ValueError) as error: lite.TFLiteConverter....
256
256
1,994
8
248
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromSavedModelTest
FromSavedModelTest
1,520
1,702
1,520
1,521
7d63e4b24a4a88f077a5bac7ba6dde2ccd87f523
bigcode/the-stack
train
1e8cc530b8ba56654df3bde6
train
class
class FromSessionTest(TestModels, parameterized.TestCase): def testFloat(self): with ops.Graph().as_default(): in_tensor = array_ops.placeholder( shape=[1, 16, 16, 3], dtype=dtypes.float32) out_tensor = in_tensor + in_tensor sess = session.Session() # Convert model and ensure mod...
class FromSessionTest(TestModels, parameterized.TestCase):
def testFloat(self): with ops.Graph().as_default(): in_tensor = array_ops.placeholder( shape=[1, 16, 16, 3], dtype=dtypes.float32) out_tensor = in_tensor + in_tensor sess = session.Session() # Convert model and ensure model is not None. converter = lite.TFLiteConverter.from_se...
, None, [], input_arrays_with_shape=[('input', [3, 9])]) self.assertEqual(message, str(error.exception)) # `input_arrays_with_shape` is not defined. with self.assertRaises(ValueError) as error: lite.TFLiteConverter(None, [], None, output_arrays=['output']) self.assertEqual(message, str(error.exce...
256
256
11,344
12
244
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromSessionTest
FromSessionTest
128
1,241
128
129
4e337b8c8b7a23cf24bdb03926b656a13d90bf44
bigcode/the-stack
train
39c98fe50c7ea1f34a1457ec
train
class
class LiteTest(test_util.TensorFlowTestCase): """Base class of all the tests in this module.""" def setUp(self): # Some cases are broken when we enable the new converter by default. # Explicitly disabling it for now. # TODO(b/145763157): Investigate if these are real issues. self._original_use_expe...
class LiteTest(test_util.TensorFlowTestCase):
"""Base class of all the tests in this module.""" def setUp(self): # Some cases are broken when we enable the new converter by default. # Explicitly disabling it for now. # TODO(b/145763157): Investigate if these are real issues. self._original_use_experimental_new_converter = ( lite._USE_E...
.ops.variables import global_variables_initializer as _global_variables_initializer from tensorflow.python.platform import gfile from tensorflow.python.platform import resource_loader from tensorflow.python.platform import test from tensorflow.python.saved_model import saved_model from tensorflow.python.training.traini...
64
64
160
10
53
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
LiteTest
LiteTest
58
73
58
58
11665ffd6cc1da98d78bcaf77620af26f2c27fde
bigcode/the-stack
train
a815f05bedcbf10f6f8e0936
train
class
class FromFrozenGraphObjectDetection(LiteTest): def _initObjectDetectionArgs(self): # Initializes the arguments required for the object detection model. # Looks for the model file which is saved in a different location internally # and externally. filename = resource_loader.get_path_to_datafile('test...
class FromFrozenGraphObjectDetection(LiteTest):
def _initObjectDetectionArgs(self): # Initializes the arguments required for the object detection model. # Looks for the model file which is saved in a different location internally # and externally. filename = resource_loader.get_path_to_datafile('testdata/tflite_graph.pb') if not os.path.exists(...
and ensure model is not None. converter = lite.TocoConverter.from_frozen_graph(graph_def_file, ['Placeholder'], ['add']) tflite_model = converter.convert() self.assertTrue(tflite_model) # Ensure the model is able to load. interpreter = Interpret...
256
256
908
10
246
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromFrozenGraphObjectDetection
FromFrozenGraphObjectDetection
1,430
1,517
1,430
1,431
42d0620be44a566affa0b404191c8d68dc49d133
bigcode/the-stack
train
ee2bc00e068ab0997c9454d5
train
class
class TestModels(LiteTest): def assertValidDebugInfo(self, debug_info): """Verify the DebugInfo is valid.""" file_names = set() for file_path in debug_info.files: file_names.add(os.path.basename(file_path)) # To make the test independent on how the nodes are created, we only assert # the na...
class TestModels(LiteTest):
def assertValidDebugInfo(self, debug_info): """Verify the DebugInfo is valid.""" file_names = set() for file_path in debug_info.files: file_names.add(os.path.basename(file_path)) # To make the test independent on how the nodes are created, we only assert # the name of this test file. sel...
VERTER = False super(LiteTest, self).setUp() def tearDown(self): super(LiteTest, self).tearDown() lite._USE_EXPERIMENTAL_NEW_CONVERTER = ( self._original_use_experimental_new_converter) class TestModels(LiteTest):
64
64
106
7
57
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
TestModels
TestModels
76
86
76
77
5e6b3eae62574b8178518fb385b7277f1c1b5200
bigcode/the-stack
train
cc38a4943ff0c6d57d7ab600
train
class
class FromFrozenGraphFile(LiteTest): def testFloat(self): with ops.Graph().as_default(): in_tensor = array_ops.placeholder( shape=[1, 16, 16, 3], dtype=dtypes.float32) _ = in_tensor + in_tensor sess = session.Session() # Write graph to file. graph_def_file = os.path.join(self...
class FromFrozenGraphFile(LiteTest):
def testFloat(self): with ops.Graph().as_default(): in_tensor = array_ops.placeholder( shape=[1, 16, 16, 3], dtype=dtypes.float32) _ = in_tensor + in_tensor sess = session.Session() # Write graph to file. graph_def_file = os.path.join(self.get_temp_dir(), 'model.pb') write...
2], [2, 2]], dtype=np.int32)) interpreter.invoke() def testGraphDebugInfo(self): """Test a session has debug info captured.""" @def_function.function def plus_placeholder(x, placeholder): return x + placeholder with ops.Graph().as_default(): placeholder = array_ops.placeholder( ...
256
256
1,706
9
247
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
FromFrozenGraphFile
FromFrozenGraphFile
1,244
1,427
1,244
1,245
a70d16ae6fd419f927dcceec8ba83471945cc55c
bigcode/the-stack
train
ef8d4b2b41be7d9b3b0bcadc
train
class
class GrapplerTest(TestModels, parameterized.TestCase): def testConstantFolding(self): ops.disable_eager_execution() # Constant folding handles the tf.broadcast_to operation which was not # supported by the TFLite at the time this test was added. with ops.Graph().as_default(): in_tensor = array...
class GrapplerTest(TestModels, parameterized.TestCase):
def testConstantFolding(self): ops.disable_eager_execution() # Constant folding handles the tf.broadcast_to operation which was not # supported by the TFLite at the time this test was added. with ops.Graph().as_default(): in_tensor = array_ops.placeholder(shape=[3, 3], dtype=dtypes.float32) ...
Sequential tf.keras model with deprecated TocoConverter.""" self._getSequentialModel() converter = lite.TocoConverter.from_keras_model_file(self._keras_file) tflite_model = converter.convert() self.assertTrue(tflite_model) # Ensure the model is able to load. interpreter = Interpreter(model_co...
186
186
620
12
174
faustomorales/tensorflow
tensorflow/lite/python/lite_test.py
Python
GrapplerTest
GrapplerTest
2,092
2,153
2,092
2,093
c2347496051010130cecfadae26b03986178eb77
bigcode/the-stack
train
24624d54746130f14137d290
train
class
class ModifyChaptersPP(FFmpegPostProcessor): def __init__(self, downloader, remove_chapters_patterns=None, remove_sponsor_segments=None, remove_ranges=None, *, sponsorblock_chapter_title=DEFAULT_SPONSORBLOCK_CHAPTER_TITLE, force_keyframes=False): FFmpegPostProcessor.__init__(self, downloade...
class ModifyChaptersPP(FFmpegPostProcessor):
def __init__(self, downloader, remove_chapters_patterns=None, remove_sponsor_segments=None, remove_ranges=None, *, sponsorblock_chapter_title=DEFAULT_SPONSORBLOCK_CHAPTER_TITLE, force_keyframes=False): FFmpegPostProcessor.__init__(self, downloader) self._remove_chapters_patterns = s...
import copy import heapq import os from .common import PostProcessor from .ffmpeg import FFmpegPostProcessor, FFmpegSubtitlesConvertorPP from .sponsorblock import SponsorBlockPP from ..utils import PostProcessingError, orderedSet, prepend_extension _TINY_CHAPTER_DURATION = 1 DEFAULT_SPONSORBLOCK_CHAPTER_TITLE = '[Spo...
98
256
3,701
11
87
olipfei/yt-dlp
yt_dlp/postprocessor/modify_chapters.py
Python
ModifyChaptersPP
ModifyChaptersPP
14
332
14
14
1bc16d8ff07b1b020af87c0068ed6ea3d9af553b
bigcode/the-stack
train
15c60c0e9a7666b2a879151f
train
function
def toolbar_tween_factory(handler, registry, _logger=None, _dispatch=None): """ Pyramid tween factory for the debug toolbar """ # _logger and _dispatch are passed for testing purposes only if _logger is None: _logger = logger if _dispatch is None: _dispatch = lambda app, request: request...
def toolbar_tween_factory(handler, registry, _logger=None, _dispatch=None):
""" Pyramid tween factory for the debug toolbar """ # _logger and _dispatch are passed for testing purposes only if _logger is None: _logger = logger if _dispatch is None: _dispatch = lambda app, request: request.get_response(app) settings = registry.settings def sget(opt, defau...
= debug_toolbar_url(request, request.pdtb_id) button_style = get_setting(request.registry.settings, 'button_style', '') css_path = request.static_url( STATIC_PATH + 'toolbar/toolbar_button.css') toolbar_html = toolbar_html_template % { ...
256
256
1,403
17
239
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
toolbar_tween_factory
toolbar_tween_factory
145
318
145
145
0bee6ec93618ffbba1422d65218091a2c283221c
bigcode/the-stack
train
7cb8cdc48afd1a030ce686c2
train
class
class IToolbarWSGIApp(Interface): """ Marker interface for the toolbar WSGI application.""" def __call__(environ, start_response): pass
class IToolbarWSGIApp(Interface):
""" Marker interface for the toolbar WSGI application.""" def __call__(environ, start_response): pass
import make_subrequest from pyramid_debugtoolbar.utils import resolve_panel_classes from pyramid_debugtoolbar.utils import replace_insensitive from pyramid_debugtoolbar.utils import STATIC_PATH from pyramid_debugtoolbar.utils import ToolbarStorage html_types = ('text/html', 'application/xhtml+xml') class IToolbarWSGI...
64
64
35
9
55
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
IToolbarWSGIApp
IToolbarWSGIApp
28
32
28
28
ef6d7ef9b255d60428933e1a8fa813dd5ffe1cfc
bigcode/the-stack
train
3870940120aa10f85535d3fd
train
function
def beforerender_subscriber(event): request = event.get('request') if request is None: request = get_current_request() if getattr(request, 'debug_toolbar', None) is not None: for panel in request.debug_toolbar.panels: panel.process_beforerender(event)
def beforerender_subscriber(event):
request = event.get('request') if request is None: request = get_current_request() if getattr(request, 'debug_toolbar', None) is not None: for panel in request.debug_toolbar.panels: panel.process_beforerender(event)
, bytes_('</body>'), toolbar_html + bytes_('</body>') ) def process_traceback(info): return get_traceback( info=info, skip=1, show_hidden_frames=False, ignore_system_exceptions=True, ) def beforerender_subscriber(event):
64
64
64
9
55
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
beforerender_subscriber
beforerender_subscriber
136
142
136
136
568c9e757d690b09d439dfaee5fc1871df59ee72
bigcode/the-stack
train
9dc2769cfbd0c833b9a9da53
train
function
def process_traceback(info): return get_traceback( info=info, skip=1, show_hidden_frames=False, ignore_system_exceptions=True, )
def process_traceback(info):
return get_traceback( info=info, skip=1, show_hidden_frames=False, ignore_system_exceptions=True, )
css_path': css_path, 'toolbar_url': toolbar_url} toolbar_html = toolbar_html.encode(response.charset or 'utf-8') response.body = replace_insensitive( response_html, bytes_('</body>'), toolbar_html + bytes_('</body>') ) def process_traceback(info):
64
64
37
6
58
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
process_traceback
process_traceback
127
133
127
127
c81a2eeb16a9bb0b54ce65a9ed7be513d9cff155
bigcode/the-stack
train
d635fc6295ad8cab557cbb4c
train
class
class IPanelMap(Interface): """ Marker interface for the set of known panels."""
class IPanelMap(Interface):
""" Marker interface for the set of known panels."""
from pyramid_debugtoolbar.utils import ToolbarStorage html_types = ('text/html', 'application/xhtml+xml') class IToolbarWSGIApp(Interface): """ Marker interface for the toolbar WSGI application.""" def __call__(environ, start_response): pass class IPanelMap(Interface):
64
64
18
7
56
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
IPanelMap
IPanelMap
35
36
35
35
d562827b1f8d8a5e7de5299ee8070a530219d428
bigcode/the-stack
train
1f3546cd817ccca65a98af07
train
class
class DebugToolbar(object): def __init__(self, request, panel_classes, global_panel_classes, default_active_panels): self.panels = [] self.global_panels = [] self.request = request self.status_int = 200 self.default_active_panels = default_active_panels ...
class DebugToolbar(object):
def __init__(self, request, panel_classes, global_panel_classes, default_active_panels): self.panels = [] self.global_panels = [] self.request = request self.status_int = 200 self.default_active_panels = default_active_panels self.visible = False ...
from pyramid_debugtoolbar.utils import logger from pyramid_debugtoolbar.utils import make_subrequest from pyramid_debugtoolbar.utils import resolve_panel_classes from pyramid_debugtoolbar.utils import replace_insensitive from pyramid_debugtoolbar.utils import STATIC_PATH from pyramid_debugtoolbar.utils import ToolbarS...
168
169
566
5
163
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
DebugToolbar
DebugToolbar
50
124
50
51
8ccc1adddb95f95535a3c5dac262b35db0fa39aa
bigcode/the-stack
train
2cdc4c9e802329869a09c257
train
class
class IRequestAuthorization(Interface): def __call__(request): """ Toolbar per-request authorization. Should return bool values whether toolbar is permitted to monitor the provided request. """
class IRequestAuthorization(Interface):
def __call__(request): """ Toolbar per-request authorization. Should return bool values whether toolbar is permitted to monitor the provided request. """
application/xhtml+xml') class IToolbarWSGIApp(Interface): """ Marker interface for the toolbar WSGI application.""" def __call__(environ, start_response): pass class IPanelMap(Interface): """ Marker interface for the set of known panels.""" class IRequestAuthorization(Interface):
63
64
40
6
57
captain-c00keys/pyramid-stocks
ENV/lib/python3.6/site-packages/pyramid_debugtoolbar/toolbar.py
Python
IRequestAuthorization
IRequestAuthorization
39
47
39
39
d32eb88f878f9b454ca8ebfb62fe7493552d5759
bigcode/the-stack
train
824a2304a8dc6b23326c9080
train
class
class Review(models.Model): VOTE_TYPE = ( ('up', 'Up Vote'), ('down', 'Down Vote') ) owner = models.ForeignKey(Profile, on_delete=models.CASCADE, null=True) project = models.ForeignKey(Project, on_delete=models.CASCADE) body = models.TextField(null=True, blank=True) value = model...
class Review(models.Model):
VOTE_TYPE = ( ('up', 'Up Vote'), ('down', 'Down Vote') ) owner = models.ForeignKey(Profile, on_delete=models.CASCADE, null=True) project = models.ForeignKey(Project, on_delete=models.CASCADE) body = models.TextField(null=True, blank=True) value = models.CharField(max_length=200, ...
= self.review_set.all() totalVotes = reviews.count() upVotes = reviews.filter(value='up').count() ratio = (upVotes / totalVotes) * 100 self.vote_ratio = ratio self.vote_total = totalVotes self.save() class Review(models.Model):
64
64
157
5
59
michelmarcondes/django-study-with-docker
app/projects/models.py
Python
Review
Review
54
72
54
54
9e4e0dd8f09820babd63d036f740bc57d2a53ad3
bigcode/the-stack
train
118eb7033395bd4c3d127932
train
class
class Project(models.Model): owner = models.ForeignKey(Profile, null=True, blank=True, on_delete=models.SET_NULL) title = models.CharField(max_length=200) description = models.TextField(null=True, blank=True) featured_image = models.ImageField(null=True, blank=True, default='default.jpg') demo_link ...
class Project(models.Model):
owner = models.ForeignKey(Profile, null=True, blank=True, on_delete=models.SET_NULL) title = models.CharField(max_length=200) description = models.TextField(null=True, blank=True) featured_image = models.ImageField(null=True, blank=True, default='default.jpg') demo_link = models.CharField(max_length...
from email.policy import default from django.db import models import uuid from users.models import Profile # Create your models here. class Project(models.Model):
32
111
370
5
27
michelmarcondes/django-study-with-docker
app/projects/models.py
Python
Project
Project
7
50
7
7
bf17ae42dfca2ccff8ad42a2e1f5f48c7924f52a
bigcode/the-stack
train
1211c858ffea8460fccd0f3b
train
class
class Tag(models.Model): name = models.CharField(max_length=200) created = models.DateTimeField(auto_now_add=True) id = models.UUIDField(default=uuid.uuid4, unique=True, primary_key=True, editable=False) #show title on admin panel def __str__(self): return self.name
class Tag(models.Model):
name = models.CharField(max_length=200) created = models.DateTimeField(auto_now_add=True) id = models.UUIDField(default=uuid.uuid4, unique=True, primary_key=True, editable=False) #show title on admin panel def __str__(self): return self.name
) id = models.UUIDField(default=uuid.uuid4, unique=True, primary_key=True, editable=False) class Meta: unique_together = [['owner', 'project']] #show title on admin panel def __str__(self): return self.value class Tag(models.Model):
64
64
69
5
58
michelmarcondes/django-study-with-docker
app/projects/models.py
Python
Tag
Tag
75
82
75
75
bcfca3b63609011fc9b82f42c08d7a1c63d42065
bigcode/the-stack
train
967d06c7c47988bcba6ea5f9
train
function
def test_object_namespace(): class Object: namespace = "main" obj = Object() tag = namespaced(obj, "root") assert tag == "{main}root"
def test_object_namespace():
class Object: namespace = "main" obj = Object() tag = namespaced(obj, "root") assert tag == "{main}root"
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl from ..namespace import namespaced def test_no_namespace(): obj = object() tag = namespaced(obj, "root") assert tag == "root" def test_object_namespace():
62
64
39
5
57
dangqhuy/openpyxl
openpyxl/descriptors/tests/test_namespace.py
Python
test_object_namespace
test_object_namespace
14
23
14
15
91f7c3ead65acd64f9f12549d4cc94484671188b
bigcode/the-stack
train
74b9fcab698397d218028758
train
function
def test_overwrite_namespace(): obj = object() tag = namespaced(obj, "root", "main") assert tag == "{main}root"
def test_overwrite_namespace():
obj = object() tag = namespaced(obj, "root", "main") assert tag == "{main}root"
object() tag = namespaced(obj, "root") assert tag == "root" def test_object_namespace(): class Object: namespace = "main" obj = Object() tag = namespaced(obj, "root") assert tag == "{main}root" def test_overwrite_namespace():
64
64
33
6
58
dangqhuy/openpyxl
openpyxl/descriptors/tests/test_namespace.py
Python
test_overwrite_namespace
test_overwrite_namespace
26
31
26
27
864f58b6954a257eb067758ad1756385eca40a3d
bigcode/the-stack
train
b8fb00bf92113196dfa5d462
train
function
def test_no_namespace(): obj = object() tag = namespaced(obj, "root") assert tag == "root"
def test_no_namespace():
obj = object() tag = namespaced(obj, "root") assert tag == "root"
from __future__ import absolute_import # Copyright (c) 2010-2019 openpyxl from ..namespace import namespaced def test_no_namespace():
35
64
27
5
29
dangqhuy/openpyxl
openpyxl/descriptors/tests/test_namespace.py
Python
test_no_namespace
test_no_namespace
7
11
7
7
43044af54f491f4f7afc364eaffb61a0c2dba0c7
bigcode/the-stack
train
cbe41448e78467a0ce25252c
train
class
class TestUpdateSubscriptionPayload(unittest.TestCase): """UpdateSubscriptionPayload unit test stubs""" def setUp(self): pass def tearDown(self): pass def testUpdateSubscriptionPayload(self): """Test UpdateSubscriptionPayload""" # FIXME: construct object with mandatory...
class TestUpdateSubscriptionPayload(unittest.TestCase):
"""UpdateSubscriptionPayload unit test stubs""" def setUp(self): pass def tearDown(self): pass def testUpdateSubscriptionPayload(self): """Test UpdateSubscriptionPayload""" # FIXME: construct object with mandatory attributes with example values # model = Update...
: v0.0.1-alpha.93 Contact: support@ory.sh Generated by: https://openapi-generator.tech """ import sys import unittest import ory_client from ory_client.model.update_subscription_payload import UpdateSubscriptionPayload class TestUpdateSubscriptionPayload(unittest.TestCase):
64
64
83
9
54
ALTELMA/sdk
clients/client/python/test/test_update_subscription_payload.py
Python
TestUpdateSubscriptionPayload
TestUpdateSubscriptionPayload
19
32
19
19
b979beffc99771a37a11e33ee7e5c75d2afe4040
bigcode/the-stack
train
1c6698019e8e08e47bedf36b
train
class
class AddressUpdateForm(_AddressBaseForm): pass
class AddressUpdateForm(_AddressBaseForm):
pass
: if not super().validate(): return False if not self.ip_address.data and not self.hostname.data.strip(): self.form_errors.append( gettext('Provide at least an IP address or a hostname.') ) return False return True class AddressUp...
64
64
12
9
54
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
AddressUpdateForm
AddressUpdateForm
107
108
107
107
977b0cc6f02645b2295a62cb6a75823a75d253e7
bigcode/the-stack
train
b460dab38ab341c5b740b8f1
train
class
class _AddressBaseForm(LocalizedForm): ip_address = StringField( lazy_gettext('IP address'), validators=[Optional(), IPAddress(ipv6=True)], ) hostname = StringField( lazy_gettext('Hostname'), validators=[Optional(), Length(max=20), Regexp(HOSTNAME_REGEX)], ) netmask =...
class _AddressBaseForm(LocalizedForm):
ip_address = StringField( lazy_gettext('IP address'), validators=[Optional(), IPAddress(ipv6=True)], ) hostname = StringField( lazy_gettext('Hostname'), validators=[Optional(), Length(max=20), Regexp(HOSTNAME_REGEX)], ) netmask = StringField( lazy_gettext('Net...
approved'), validators=[Optional()]) class ServerUpdateForm(LocalizedForm): notes_admin = TextAreaField( lazy_gettext('Notes by admin'), validators=[Optional()] ) approved = BooleanField(lazy_gettext('approved'), validators=[Optional()]) class _AddressBaseForm(LocalizedForm):
63
64
124
9
55
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
_AddressBaseForm
_AddressBaseForm
76
90
76
76
a9b1413bac0ac1d6612cc166fa1fc0a3b78b3939
bigcode/the-stack
train
121f1de2578c523cd8d525be
train
class
class SettingUpdateForm(LocalizedForm): netmask = StringField( lazy_gettext('Netmask'), validators=[Optional(), IPAddress(ipv6=True)] ) gateway = StringField( lazy_gettext('Gateway'), validators=[Optional(), IPAddress(ipv6=True)] ) dns_server1 = StringField( lazy_gettext('DNS...
class SettingUpdateForm(LocalizedForm):
netmask = StringField( lazy_gettext('Netmask'), validators=[Optional(), IPAddress(ipv6=True)] ) gateway = StringField( lazy_gettext('Gateway'), validators=[Optional(), IPAddress(ipv6=True)] ) dns_server1 = StringField( lazy_gettext('DNS server') + ' 1', validators=[Op...
BooleanField, StringField, TextAreaField from wtforms.validators import ( InputRequired, IPAddress, Length, Optional, Regexp, ) from ....util.forms import UserScreenNameField from ....util.l10n import LocalizedForm class SettingUpdateForm(LocalizedForm):
64
64
148
8
55
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
SettingUpdateForm
SettingUpdateForm
25
40
25
25
52ed402be0cac294231c8bc154c1af1d3c63035b
bigcode/the-stack
train
c446444007c61b2b6d304c09
train
class
class ServerCreateForm(LocalizedForm): owner = UserScreenNameField(lazy_gettext('Owner'), [InputRequired()]) ip_address = StringField( lazy_gettext('IP address'), validators=[Optional(), IPAddress(ipv6=True)], ) hostname = StringField( lazy_gettext('Hostname'), validators...
class ServerCreateForm(LocalizedForm):
owner = UserScreenNameField(lazy_gettext('Owner'), [InputRequired()]) ip_address = StringField( lazy_gettext('IP address'), validators=[Optional(), IPAddress(ipv6=True)], ) hostname = StringField( lazy_gettext('Hostname'), validators=[Optional(), Length(max=20), Regexp(HO...
2', validators=[Optional(), IPAddress(ipv6=True)], ) domain = StringField(lazy_gettext('Domain'), validators=[Optional()]) HOSTNAME_REGEX = re.compile('^[A-Za-z][A-Za-z0-9-]+$') class ServerCreateForm(LocalizedForm):
64
64
187
8
56
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
ServerCreateForm
ServerCreateForm
46
66
46
46
125d38073a20d28cf95bcaafe52e064a1a5110ef
bigcode/the-stack
train
b02c40fc4e90eafc4f6a6ff3
train
class
class ServerUpdateForm(LocalizedForm): notes_admin = TextAreaField( lazy_gettext('Notes by admin'), validators=[Optional()] ) approved = BooleanField(lazy_gettext('approved'), validators=[Optional()])
class ServerUpdateForm(LocalizedForm):
notes_admin = TextAreaField( lazy_gettext('Notes by admin'), validators=[Optional()] ) approved = BooleanField(lazy_gettext('approved'), validators=[Optional()])
IPAddress(ipv6=True)] ) notes_admin = TextAreaField( lazy_gettext('Notes by admin'), validators=[Optional(), Length(max=1000)], ) approved = BooleanField(lazy_gettext('approved'), validators=[Optional()]) class ServerUpdateForm(LocalizedForm):
63
64
47
8
56
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
ServerUpdateForm
ServerUpdateForm
69
73
69
69
c044624feb2a82eaab455e5014e7de1f597dfaf6
bigcode/the-stack
train
fce5c8ba2826e64a390064d1
train
class
class AddressCreateForm(_AddressBaseForm): def validate(self) -> bool: if not super().validate(): return False if not self.ip_address.data and not self.hostname.data.strip(): self.form_errors.append( gettext('Provide at least an IP address or a hostname.') ...
class AddressCreateForm(_AddressBaseForm):
def validate(self) -> bool: if not super().validate(): return False if not self.ip_address.data and not self.hostname.data.strip(): self.form_errors.append( gettext('Provide at least an IP address or a hostname.') ) return False ...
) netmask = StringField( lazy_gettext('Netmask'), validators=[Optional(), IPAddress(ipv6=True)] ) gateway = StringField( lazy_gettext('Gateway'), validators=[Optional(), IPAddress(ipv6=True)] ) class AddressCreateForm(_AddressBaseForm):
64
64
71
9
55
homeworkprod/byceps
byceps/blueprints/admin/guest_server/forms.py
Python
AddressCreateForm
AddressCreateForm
93
104
93
93
deb6d5019fa0feef962bf4b037570caec2057aff
bigcode/the-stack
train
94e09ac9c5cd7ab0b96c2783
train
function
def DenseNetImageNet169(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
def DenseNetImageNet169(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
return DenseNet(input_shape, depth=169, nb_dense_block=4, growth_rate=32, nb_filter=64, nb_layers_per_block=[6, 12, 32, 32], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, inc...
def DenseNetImageNet169(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
67
64
166
67
0
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetImageNet169
DenseNetImageNet169
384
398
384
393
01185bbd8b61a9300f815c40fd6e16499fe7b949
bigcode/the-stack
train
a45481ef3ff48a4fbabc798b
train
function
def DenseNetImageNet201(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
def DenseNetImageNet201(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
return DenseNet(input_shape, depth=201, nb_dense_block=4, growth_rate=32, nb_filter=64, nb_layers_per_block=[6, 12, 48, 32], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, inc...
def DenseNetImageNet201(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
65
64
164
65
0
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetImageNet201
DenseNetImageNet201
401
415
401
410
b7736809cbd7a29e90c391d3719f42008202e6c4
bigcode/the-stack
train
7981aa604db6f32ec9720bf4
train
function
def __dense_block(x, nb_layers, nb_filter, growth_rate, bottleneck=False, dropout_rate=None, weight_decay=1e-4, grow_nb_filters=True, return_concat_list=False): ''' Build a dense_block where the output of each conv_block is fed to subsequent ones Args: x: keras tensor nb_layers...
def __dense_block(x, nb_layers, nb_filter, growth_rate, bottleneck=False, dropout_rate=None, weight_decay=1e-4, grow_nb_filters=True, return_concat_list=False):
''' Build a dense_block where the output of each conv_block is fed to subsequent ones Args: x: keras tensor nb_layers: the number of layers of conv_block to append to the model. nb_filter: number of filters growth_rate: growth rate bottleneck: bottleneck block dro...
_filter, (3, 3), kernel_initializer='he_normal', padding='same', use_bias=False)(x) if dropout_rate: x = Dropout(dropout_rate)(x) return x def __dense_block(x, nb_layers, nb_filter, growth_rate, bottleneck=False, dropout_rate=None, weight_decay=1e-4, grow_nb_filters=True, return_conca...
86
86
288
42
43
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__dense_block
__dense_block
482
513
482
483
2cbc991d89e94e519e50e3f623561b1a80832ff9
bigcode/the-stack
train
81032b05dd915d9b8d77f04a
train
function
def __transition_block(ip, nb_filter, compression=1.0, weight_decay=1e-4): ''' Apply BatchNorm, Relu 1x1, Conv2D, optional compression, dropout and Maxpooling2D Args: ip: keras tensor nb_filter: number of filters compression: calculated as 1 - reduction. Reduces the number of feature map...
def __transition_block(ip, nb_filter, compression=1.0, weight_decay=1e-4):
''' Apply BatchNorm, Relu 1x1, Conv2D, optional compression, dropout and Maxpooling2D Args: ip: keras tensor nb_filter: number of filters compression: calculated as 1 - reduction. Reduces the number of feature maps in the transition block. dropout_rate: dropou...
x = concatenate([x, cb], axis=concat_axis) if grow_nb_filters: nb_filter += growth_rate if return_concat_list: return x, nb_filter, x_list else: return x, nb_filter def __transition_block(ip, nb_filter, compression=1.0, weight_decay=1e-4):
75
75
250
23
51
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__transition_block
__transition_block
516
535
516
516
3d1116718197063cbc5baf988a3783e5056eef6d
bigcode/the-stack
train
ff952022a49cdf1f5fe8c2b3
train
function
def preprocess_input(x, data_format=None): """Preprocesses a tensor encoding a batch of images. # Arguments x: input Numpy tensor, 4D. data_format: data format of the image tensor. # Returns Preprocessed tensor. """ if data_format is None: data_format = K.image_data...
def preprocess_input(x, data_format=None):
"""Preprocesses a tensor encoding a batch of images. # Arguments x: input Numpy tensor, 4D. data_format: data format of the image tensor. # Returns Preprocessed tensor. """ if data_format is None: data_format = K.image_data_format() assert data_format in {'chann...
_161_WEIGHTS_PATH_NO_TOP = r'https://github.com/titu1994/DenseNet/releases/download/v3.0/DenseNet-BC-161-48-no-top.h5' DENSENET_169_WEIGHTS_PATH_NO_TOP = r'https://github.com/titu1994/DenseNet/releases/download/v3.0/DenseNet-BC-169-32-no-top.h5' def preprocess_input(x, data_format=None):
93
93
310
9
84
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
preprocess_input
preprocess_input
40
77
40
40
303d6515f5e9bd96a05ac9e748560b41301eb041
bigcode/the-stack
train
3480e33e47542a42fa2cfb48
train
function
def DenseNet(input_shape=None, depth=40, nb_dense_block=3, growth_rate=12, nb_filter=-1, nb_layers_per_block=-1, bottleneck=False, reduction=0.0, dropout_rate=0.0, weight_decay=1e-4, subsample_initial_block=False, include_top=True, weights=None, input_tensor=None, classes=10, acti...
def DenseNet(input_shape=None, depth=40, nb_dense_block=3, growth_rate=12, nb_filter=-1, nb_layers_per_block=-1, bottleneck=False, reduction=0.0, dropout_rate=0.0, weight_decay=1e-4, subsample_initial_block=False, include_top=True, weights=None, input_tensor=None, classes=10, acti...
'''Instantiate the DenseNet architecture, optionally loading weights pre-trained on CIFAR-10. Note that when using TensorFlow, for best performance you should set `image_data_format='channels_last'` in your Keras config at ~/.keras/keras.json. The model and the weight...
103.939 x[1, :, :] -= 116.779 x[2, :, :] -= 123.68 else: x = x[:, ::-1, ...] x[:, 0, :, :] -= 103.939 x[:, 1, :, :] -= 116.779 x[:, 2, :, :] -= 123.68 else: # 'RGB'->'BGR' x = x[..., ::-1] # Zero-center by mean ...
256
256
1,894
88
167
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNet
DenseNet
80
243
80
83
ab7c3525cacc6a09362b5a9f4fff327045a6be6f
bigcode/the-stack
train
fb197aed3c3589e0779969f7
train
function
def __create_dense_net(nb_classes, img_input, include_top, depth=40, nb_dense_block=3, growth_rate=12, nb_filter=-1, nb_layers_per_block=-1, bottleneck=False, reduction=0.0, dropout_rate=None, weight_decay=1e-4, subsample_initial_block=False, activation='softmax'): ''' ...
def __create_dense_net(nb_classes, img_input, include_top, depth=40, nb_dense_block=3, growth_rate=12, nb_filter=-1, nb_layers_per_block=-1, bottleneck=False, reduction=0.0, dropout_rate=None, weight_decay=1e-4, subsample_initial_block=False, activation='softmax'):
''' Build the DenseNet model Args: nb_classes: number of classes img_input: tuple of shape (channels, rows, columns) or (rows, columns, channels) include_top: flag to include the final Dense layer depth: number or layers nb_dense_block: number of dense blocks to add to en...
== 'upsampling': x = UpSampling2D()(ip) elif type == 'subpixel': x = Conv2D(nb_filters, (3, 3), activation='relu', padding='same', kernel_regularizer=l2(weight_decay), use_bias=False, kernel_initializer='he_normal')(ip) x = SubPixelUpscaling(scale_factor=2)(x) x =...
256
256
1,129
76
179
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__create_dense_net
__create_dense_net
563
662
563
565
6d4a9b556c68ac0f005f506f9481b1434bd080e5
bigcode/the-stack
train
c9523d759702024aa67f16ba
train
function
def DenseNetImageNet161(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
def DenseNetImageNet161(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
return DenseNet(input_shape, depth=161, nb_dense_block=4, growth_rate=48, nb_filter=96, nb_layers_per_block=[6, 12, 36, 24], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, inc...
def DenseNetImageNet161(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
67
64
166
67
0
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetImageNet161
DenseNetImageNet161
435
449
435
444
e004fec99f4119e2aa8c513e8923401638908dfc
bigcode/the-stack
train
1ecbc100efcae3eeda5c5457
train
function
def __conv_block(ip, nb_filter, bottleneck=False, dropout_rate=None, weight_decay=1e-4): ''' Apply BatchNorm, Relu, 3x3 Conv2D, optional bottleneck block and dropout Args: ip: Input keras tensor nb_filter: number of filters bottleneck: add bottleneck block dropout_rate: dropout r...
def __conv_block(ip, nb_filter, bottleneck=False, dropout_rate=None, weight_decay=1e-4):
''' Apply BatchNorm, Relu, 3x3 Conv2D, optional bottleneck block and dropout Args: ip: Input keras tensor nb_filter: number of filters bottleneck: add bottleneck block dropout_rate: dropout rate weight_decay: weight decay factor Returns: keras tensor with batch_norm, ...
nb_layers_per_block=[6, 12, 36, 24], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, include_top=include_top, weights=weights, input_tensor=input_tensor, classes=classes, activati...
96
96
323
25
71
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__conv_block
__conv_block
452
479
452
452
19e93d260ac7c67a769b49ad00e0c789a631c01f
bigcode/the-stack
train
1a9b671a51b8899311c36ed1
train
function
def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5, growth_rate=12, reduction=0.0, dropout_rate=None, weight_decay=1e-4, nb_layers_per_block=4, nb_upsampling_conv=128, upsampling_type='upsampling', init_conv_fi...
def __create_fcn_dense_net(nb_classes, img_input, include_top, nb_dense_block=5, growth_rate=12, reduction=0.0, dropout_rate=None, weight_decay=1e-4, nb_layers_per_block=4, nb_upsampling_conv=128, upsampling_type='upsampling', init_conv_fi...
''' Build the DenseNet model Args: nb_classes: number of classes img_input: tuple of shape (channels, rows, columns) or (rows, columns, channels) include_top: flag to include the final Dense layer nb_dense_block: number of dense blocks to add to end (generally = 3) growth...
ottleneck, dropout_rate=dropout_rate, weight_decay=weight_decay) # add transition_block x = __transition_block(x, nb_filter, compression=compression, weight_decay=weight_decay) nb_filter = int(nb_filter * compression) # The last dense_block does not have...
256
256
1,405
85
170
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__create_fcn_dense_net
__create_fcn_dense_net
665
790
665
668
4b140151f781f02401a0b0b66e8805f935457e65
bigcode/the-stack
train
32711703a207b31e253ae391
train
function
def DenseNetFCN(input_shape, nb_dense_block=5, growth_rate=16, nb_layers_per_block=4, reduction=0.0, dropout_rate=0.0, weight_decay=1e-4, init_conv_filters=48, include_top=True, weights=None, input_tensor=None, classes=1, activation='softmax', upsampling_conv=128, upsampl...
def DenseNetFCN(input_shape, nb_dense_block=5, growth_rate=16, nb_layers_per_block=4, reduction=0.0, dropout_rate=0.0, weight_decay=1e-4, init_conv_filters=48, include_top=True, weights=None, input_tensor=None, classes=1, activation='softmax', upsampling_conv=128, upsampl...
'''Instantiate the DenseNet FCN architecture. Note that when using TensorFlow, for best performance you should set `image_data_format='channels_last'` in your Keras config at ~/.keras/keras.json. # Arguments nb_dense_block: number of dense blocks to add to end (ge...
19e8276cfd10585d5fadc1df6859e') model.load_weights(weights_path) weights_loaded = True if weights_loaded: if K.backend() == 'theano': convert_all_kernels_in_model(model) if K.image_data_format() == 'channels_first' and K.backend() == 'tensorflow'...
256
256
1,343
89
166
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetFCN
DenseNetFCN
246
364
246
249
11404404300b25e164befc6c5c01864e767a6200
bigcode/the-stack
train
2c95c4e6dfdc6621ef392b60
train
function
def __transition_up_block(ip, nb_filters, type='deconv', weight_decay=1E-4): ''' SubpixelConvolutional Upscaling (factor = 2) Args: ip: keras tensor nb_filters: number of layers type: can be 'upsampling', 'subpixel', 'deconv'. Determines type of upsampling performed weight_decay:...
def __transition_up_block(ip, nb_filters, type='deconv', weight_decay=1E-4):
''' SubpixelConvolutional Upscaling (factor = 2) Args: ip: keras tensor nb_filters: number of layers type: can be 'upsampling', 'subpixel', 'deconv'. Determines type of upsampling performed weight_decay: weight decay factor Returns: keras tensor, after applying upsampling ope...
(nb_filter * compression), (1, 1), kernel_initializer='he_normal', padding='same', use_bias=False, kernel_regularizer=l2(weight_decay))(x) x = AveragePooling2D((2, 2), strides=(2, 2))(x) return x def __transition_up_block(ip, nb_filters, type='deconv', weight_decay=1E-4):
85
85
284
23
61
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
__transition_up_block
__transition_up_block
538
560
538
538
724a3b9402540ca4e1b9aa0b16b7de28db3211ad
bigcode/the-stack
train
93bbd033f7750685e4d23712
train
function
def DenseNetImageNet264(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
def DenseNetImageNet264(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
return DenseNet(input_shape, depth=201, nb_dense_block=4, growth_rate=32, nb_filter=64, nb_layers_per_block=[6, 12, 64, 48], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, inc...
def DenseNetImageNet264(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights=None, input_ten...
65
64
164
65
0
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetImageNet264
DenseNetImageNet264
418
432
418
427
b8c1da82f75e7853b479626a2114f295bf930e19
bigcode/the-stack
train
7149b717bc83a8704309ecd1
train
function
def DenseNetImageNet121(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
def DenseNetImageNet121(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
return DenseNet(input_shape, depth=121, nb_dense_block=4, growth_rate=32, nb_filter=64, nb_layers_per_block=[6, 12, 24, 16], bottleneck=bottleneck, reduction=reduction, dropout_rate=dropout_rate, weight_decay=weight_decay, subsample_initial_block=True, inc...
def DenseNetImageNet121(input_shape=None, bottleneck=True, reduction=0.5, dropout_rate=0.0, weight_decay=1e-4, include_top=True, weights='imagenet', inp...
67
64
166
67
0
garymm/tensorflow-onnx
tests/keras2onnx_applications/model_source/densenet_1/densenet_1.py
Python
DenseNetImageNet121
DenseNetImageNet121
367
381
367
376
133ac6fc366f017725078c7db0785597565fc9c4
bigcode/the-stack
train
2f5ece6f3ff5f8cf0a783b61
train
class
class ServerPropertiesForReplica(ServerPropertiesForCreate): """The properties to create a new replica. All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', '10', '10.0', '10.2', '11' :type version: str or ~azu...
class ServerPropertiesForReplica(ServerPropertiesForCreate):
"""The properties to create a new replica. All required parameters must be populated in order to send to Azure. :param version: Server version. Possible values include: '9.5', '9.6', '10', '10.0', '10.2', '11' :type version: str or ~azure.mgmt.rdbms.postgresql.models.ServerVersion :param ssl_...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
98
122
408
10
87
tzhanl/azure-sdk-for-python
sdk/rdbms/azure-mgmt-rdbms/azure/mgmt/rdbms/postgresql/models/server_properties_for_replica.py
Python
ServerPropertiesForReplica
ServerPropertiesForReplica
15
52
15
15
aa3bc8fa9a7199aeed27107da79f3d379ef7a246
bigcode/the-stack
train
fae83dde135ff8b0049a9365
train
function
def stark_finder(s, first, last): try: start = s.index(first) + len(first) end = s.index(last, start) return s[start:end] except ValueError: return ""
def stark_finder(s, first, last):
try: start = s.index(first) + len(first) end = s.index(last, start) return s[start:end] except ValueError: return ""
# hnn import random import string # String Finder def stark_finder(s, first, last):
24
64
47
10
13
vikas04599/Fire-X
firebot/function/simplefunction.py
Python
stark_finder
stark_finder
7
13
7
7
2a19a6bc37c7e9f9773fa21eee1ccbd8dce58db3
bigcode/the-stack
train
57aaef36382f3c9aad56d013
train
function
def id_generator(size=64, chars=string.ascii_uppercase + string.digits): return "".join(random.choice(chars) for _ in range(size))
def id_generator(size=64, chars=string.ascii_uppercase + string.digits):
return "".join(random.choice(chars) for _ in range(size))
, last): try: start = s.index(first) + len(first) end = s.index(last, start) return s[start:end] except ValueError: return "" # Id Generator def id_generator(size=64, chars=string.ascii_uppercase + string.digits):
64
64
33
19
44
vikas04599/Fire-X
firebot/function/simplefunction.py
Python
id_generator
id_generator
17
18
17
17
779498b072caecaa6e9194e4cc6f6e60f96f8ecf
bigcode/the-stack
train
5285c905ef47b0a8fd191965
train
class
class TestGroup: def test_init(self): group = Group("id", "name", ["device"]) assert group.identifier == "id" assert "device" in group.devices def test_eq(self): assert Group("id", "name", ["device"]) == Group("id", "name1", ["device"]) def test_not_eq(self): assert...
class TestGroup:
def test_init(self): group = Group("id", "name", ["device"]) assert group.identifier == "id" assert "device" in group.devices def test_eq(self): assert Group("id", "name", ["device"]) == Group("id", "name1", ["device"]) def test_not_eq(self): assert Group("id", "nam...
"""Tests for the Group class.""" from onyx_client.group.group import Group class TestGroup:
20
64
93
4
15
muhlba91/onyx-client
tests/group/test_group.py
Python
TestGroup
TestGroup
6
16
6
6
b11486f043346589d452892bbb3bd670f60bbc83
bigcode/the-stack
train
7a28f2eb0dda86a12cca4118
train
class
class CategoryChangeAssetNameActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeAssetNameAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( ...
class CategoryChangeAssetNameActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeAssetNameAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) name = L...
=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryAddAssetAction(**data) class CategoryChangeAssetNameActionSchema(CategoryUpdateActionSchema):
64
64
144
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeAssetNameActionSchema
CategoryChangeAssetNameActionSchema
301
318
301
301
f78f4a0cc540694120755035749b0d081793280d
bigcode/the-stack
train
b45d7587a701f4a625605675
train
class
class CategorySetCustomFieldActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetCustomFieldAction`.""" name = marshmallow.fields.String(allow_none=True) value = marshmallow.fields.Raw(allow_none=True, missing=None) class Meta: unknown = ma...
class CategorySetCustomFieldActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetCustomFieldAction`.""" name = marshmallow.fields.String(allow_none=True) value = marshmallow.fields.Raw(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, ...
=None ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetTagsAction(**data) class CategorySetCustomFieldActionSchema(CategoryUpdateActionSchema):
64
64
109
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetCustomFieldActionSchema
CategorySetCustomFieldActionSchema
547
559
547
547
51bbda312a89880c3a90ab6cce56c1dbe0a31342
bigcode/the-stack
train
4b21aa6ca04bf1b5a460e900
train
class
class CategoryChangeSlugActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeSlugAction`.""" slug = LocalizedStringField(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **k...
class CategoryChangeSlugActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeSlugAction`.""" slug = LocalizedStringField(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryCh...
allow_none=True, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeParentAction(**data) class CategoryChangeSlugActionSchema(CategoryUpdateActionSchema):
64
64
91
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeSlugActionSchema
CategoryChangeSlugActionSchema
383
394
383
383
565fc91bc59e95d4b78de84e5136a7948b228760
bigcode/the-stack
train
61447c9a978d5fe8d6ae49fa
train
class
class CategorySetAssetCustomFieldActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetCustomFieldAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String...
class CategorySetAssetCustomFieldActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetCustomFieldAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) name...
Key" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryRemoveAssetAction(**data) class CategorySetAssetCustomFieldActionSchema(CategoryUpdateActionSchema):
64
64
162
13
51
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetCustomFieldActionSchema
CategorySetAssetCustomFieldActionSchema
416
434
416
416
9c6f57a3e5c41e38a8dc5f0ee145374218a33f06
bigcode/the-stack
train
89eaccde9147380af416f36e
train
class
class CategorySetKeyActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetKeyAction`.""" key = marshmallow.fields.String(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self,...
class CategorySetKeyActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetKeyAction`.""" key = marshmallow.fields.String(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return ty...
externalId" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetExternalIdAction(**data) class CategorySetKeyActionSchema(CategoryUpdateActionSchema):
64
64
94
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetKeyActionSchema
CategorySetKeyActionSchema
612
623
612
612
8d70563b919cfb8b5090b1a0685a0279f271bc16
bigcode/the-stack
train
72f083f20f784d6d2342e445
train
class
class CategorySetCustomTypeActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetCustomTypeAction`.""" type = helpers.LazyNestedField( nested="commercetools._schemas._type.TypeResourceIdentifierSchema", unknown=marshmallow.EXCLUDE, al...
class CategorySetCustomTypeActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetCustomTypeAction`.""" type = helpers.LazyNestedField( nested="commercetools._schemas._type.TypeResourceIdentifierSchema", unknown=marshmallow.EXCLUDE, allow_none=True, missing=None, ) fields = FieldContaine...
, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetCustomFieldAction(**data) class CategorySetCustomTypeActionSchema(CategoryUpdateActionSchema):
64
64
141
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetCustomTypeActionSchema
CategorySetCustomTypeActionSchema
562
579
562
562
846e8aebefad3e5019dd11f5a44056f23346715f
bigcode/the-stack
train
1036724e73b8a1dfe38188d1
train
class
class CategorySetAssetTagsActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetTagsAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allo...
class CategorySetAssetTagsActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetTagsAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) tags = mars...
=True, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetSourcesAction(**data) class CategorySetAssetTagsActionSchema(CategoryUpdateActionSchema):
64
64
155
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetTagsActionSchema
CategorySetAssetTagsActionSchema
525
544
525
525
c10bd5be1409974a9839cb997928864a232d5fa2
bigcode/the-stack
train
e64fdf95f1e4075f307adbcf
train
class
class CategorySetMetaTitleActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetMetaTitleAction`.""" meta_title = LocalizedStringField( allow_none=True, missing=None, data_key="metaTitle" ) class Meta: unknown = marshmallow.EXCLUDE ...
class CategorySetMetaTitleActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetMetaTitleAction`.""" meta_title = LocalizedStringField( allow_none=True, missing=None, data_key="metaTitle" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): ...
Keywords" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetMetaKeywordsAction(**data) class CategorySetMetaTitleActionSchema(CategoryUpdateActionSchema):
64
64
107
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetMetaTitleActionSchema
CategorySetMetaTitleActionSchema
658
671
658
658
702a896693ec57490d22c79e33e5c1bf5925a84a
bigcode/the-stack
train
65c091e12674b0d655adbe9b
train
class
class CategoryRemoveAssetActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryRemoveAssetAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_...
class CategoryRemoveAssetActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryRemoveAssetAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) class Meta:...
Field(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeSlugAction(**data) class CategoryRemoveAssetActionSchema(CategoryUpdateActionSchema):
64
64
129
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryRemoveAssetActionSchema
CategoryRemoveAssetActionSchema
397
413
397
397
bf71301a6497c02311a11b56f258a97d41c4e843
bigcode/the-stack
train
c3284b3a300f03761785817e
train
class
class CategorySetAssetDescriptionActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetDescriptionAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String...
class CategorySetAssetDescriptionActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetDescriptionAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) desc...
missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetCustomTypeAction(**data) class CategorySetAssetDescriptionActionSchema(CategoryUpdateActionSchema):
64
64
147
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetDescriptionActionSchema
CategorySetAssetDescriptionActionSchema
463
480
463
463
2ed2974aed89a14632fd4870573e10c7b49c3c2d
bigcode/the-stack
train
1400ed0801c40ae00934c9e4
train
class
class CategoryChangeParentActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeParentAction`.""" parent = helpers.LazyNestedField( nested="commercetools._schemas._category.CategoryResourceIdentifierSchema", unknown=marshmallow.EXCLUDE, ...
class CategoryChangeParentActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeParentAction`.""" parent = helpers.LazyNestedField( nested="commercetools._schemas._category.CategoryResourceIdentifierSchema", unknown=marshmallow.EXCLUDE, allow_none=True, ) class Meta: unknown = mars...
_key="orderHint") class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeOrderHintAction(**data) class CategoryChangeParentActionSchema(CategoryUpdateActionSchema):
64
64
120
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeParentActionSchema
CategoryChangeParentActionSchema
365
380
365
365
41ff0313b42971dce0e4c377e5dead7f010dd562
bigcode/the-stack
train
fac60be5c8cc637a750f77d2
train
class
class CategorySetAssetCustomTypeActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetCustomTypeAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( ...
class CategorySetAssetCustomTypeActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetCustomTypeAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) type ...
=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetCustomFieldAction(**data) class CategorySetAssetCustomTypeActionSchema(CategoryUpdateActionSchema):
64
64
195
13
51
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetCustomTypeActionSchema
CategorySetAssetCustomTypeActionSchema
437
460
437
437
4ded386b00284941001036ffae0109c7dc1bc2a4
bigcode/the-stack
train
f52e381e4a0d1ed6aafc0673
train
class
class CategorySetMetaDescriptionActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetMetaDescriptionAction`.""" meta_description = LocalizedStringField( allow_none=True, missing=None, data_key="metaDescription" ) class Meta: unknown...
class CategorySetMetaDescriptionActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetMetaDescriptionAction`.""" meta_description = LocalizedStringField( allow_none=True, missing=None, data_key="metaDescription" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self,...
=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetKeyAction(**data) class CategorySetMetaDescriptionActionSchema(CategoryUpdateActionSchema):
64
64
107
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetMetaDescriptionActionSchema
CategorySetMetaDescriptionActionSchema
626
639
626
626
51088ab8b235993143c2d8542ae06f820480dd8c
bigcode/the-stack
train
6dcbd68dc643227ba37ffdc6
train
class
class CategoryChangeOrderHintActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeOrderHintAction`.""" order_hint = marshmallow.fields.String(allow_none=True, data_key="orderHint") class Meta: unknown = marshmallow.EXCLUDE @marshmallow....
class CategoryChangeOrderHintActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeOrderHintAction`.""" order_hint = marshmallow.fields.String(allow_none=True, data_key="orderHint") class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["ac...
(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeNameAction(**data) class CategoryChangeOrderHintActionSchema(CategoryUpdateActionSchema):
64
64
101
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeOrderHintActionSchema
CategoryChangeOrderHintActionSchema
351
362
351
351
2d74c91e29ddb5c3161f19dc44df2f1528720a34
bigcode/the-stack
train
8bbfb581c97ee8a3b128f1a5
train
class
class CategoryUpdateSchema(marshmallow.Schema): """Marshmallow schema for :class:`commercetools.types.CategoryUpdate`.""" version = marshmallow.fields.Integer(allow_none=True) actions = marshmallow.fields.List( helpers.Discriminator( discriminator_field=("action", "action"), ...
class CategoryUpdateSchema(marshmallow.Schema):
"""Marshmallow schema for :class:`commercetools.types.CategoryUpdate`.""" version = marshmallow.fields.Integer(allow_none=True) actions = marshmallow.fields.List( helpers.Discriminator( discriminator_field=("action", "action"), discriminator_schemas={ "addAss...
._common.AssetSchema", unknown=marshmallow.EXCLUDE, allow_none=True, many=True, missing=None, ) key = marshmallow.fields.String(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs...
181
181
606
10
171
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryUpdateSchema
CategoryUpdateSchema
237
279
237
237
53de542e51e40288025a100ae3d86adf6a03a999
bigcode/the-stack
train
18e43f1802248ff4dd21e49b
train
class
class CategoryChangeNameActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeNameAction`.""" name = LocalizedStringField(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **k...
class CategoryChangeNameActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeNameAction`.""" name = LocalizedStringField(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryCh...
assetOrder" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeAssetOrderAction(**data) class CategoryChangeNameActionSchema(CategoryUpdateActionSchema):
64
64
91
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeNameActionSchema
CategoryChangeNameActionSchema
337
348
337
337
23be98bb20f6890e68500dfab0a325116b0a56ee
bigcode/the-stack
train
9daf89a36bbe85d639424c9a
train
class
class CategorySetExternalIdActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetExternalIdAction`.""" external_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="externalId" ) class Meta: unknown = marshmallow....
class CategorySetExternalIdActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetExternalIdAction`.""" external_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="externalId" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **k...
=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetDescriptionAction(**data) class CategorySetExternalIdActionSchema(CategoryUpdateActionSchema):
64
64
107
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetExternalIdActionSchema
CategorySetExternalIdActionSchema
596
609
596
596
ef7a2f89ac822075bb282d701a720d8c8345a930
bigcode/the-stack
train
d15857ce4b4535a0c33e4434
train
class
class CategoryChangeAssetOrderActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryChangeAssetOrderAction`.""" asset_order = marshmallow.fields.List( marshmallow.fields.String(allow_none=True), data_key="assetOrder" ) class Meta: unkno...
class CategoryChangeAssetOrderActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryChangeAssetOrderAction`.""" asset_order = marshmallow.fields.List( marshmallow.fields.String(allow_none=True), data_key="assetOrder" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(s...
allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategoryChangeAssetNameAction(**data) class CategoryChangeAssetOrderActionSchema(CategoryUpdateActionSchema):
64
64
109
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryChangeAssetOrderActionSchema
CategoryChangeAssetOrderActionSchema
321
334
321
321
4e828502d86d1e5d79b95b7269e953c87b1596e8
bigcode/the-stack
train
c56d901c3269c72ca26755f9
train
class
class CategoryUpdateActionSchema(marshmallow.Schema): """Marshmallow schema for :class:`commercetools.types.CategoryUpdateAction`.""" action = marshmallow.fields.String(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): ...
class CategoryUpdateActionSchema(marshmallow.Schema):
"""Marshmallow schema for :class:`commercetools.types.CategoryUpdateAction`.""" action = marshmallow.fields.String(allow_none=True) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.Categor...
key = marshmallow.fields.String(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): return types.Category(**data) class CategoryUpdateActionSchema(marshmallow.Schema):
64
64
89
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryUpdateActionSchema
CategoryUpdateActionSchema
223
234
223
223
100d15d7dc10e2ce694347bc3d10059e729c2ca2
bigcode/the-stack
train
0c88c64bd458e3ae08623f56
train
class
class CategorySetAssetSourcesActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetSourcesAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( ...
class CategorySetAssetSourcesActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetSourcesAction`.""" asset_id = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetId" ) asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) sources ...
Key" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetKeyAction(**data) class CategorySetAssetSourcesActionSchema(CategoryUpdateActionSchema):
64
64
176
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetSourcesActionSchema
CategorySetAssetSourcesActionSchema
500
522
500
500
69af0b8faf6ca22bce00954061e4f09db38a0e22
bigcode/the-stack
train
05b206a4db4428318ed38fd4
train
class
class CategorySetDescriptionActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetDescriptionAction`.""" description = LocalizedStringField(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load ...
class CategorySetDescriptionActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetDescriptionAction`.""" description = LocalizedStringField(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] ...
=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetCustomTypeAction(**data) class CategorySetDescriptionActionSchema(CategoryUpdateActionSchema):
64
64
94
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetDescriptionActionSchema
CategorySetDescriptionActionSchema
582
593
582
582
4bf43a5c000f662f1f6045431ba66a0e3033c15b
bigcode/the-stack
train
98d2225daf32ce8d1e4e6919
train
class
class CategoryReferenceSchema(ReferenceSchema): """Marshmallow schema for :class:`commercetools.types.CategoryReference`.""" obj = helpers.LazyNestedField( nested="commercetools._schemas._category.CategorySchema", unknown=marshmallow.EXCLUDE, allow_none=True, missing=None, )...
class CategoryReferenceSchema(ReferenceSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryReference`.""" obj = helpers.LazyNestedField( nested="commercetools._schemas._category.CategorySchema", unknown=marshmallow.EXCLUDE, allow_none=True, missing=None, ) class Meta: unknown = marshmallow....
mallow.EXCLUDE, allow_none=True, many=True, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): return types.CategoryPagedQueryResponse(**data) class CategoryReferenceSchema(ReferenceSchema):
64
64
116
8
56
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryReferenceSchema
CategoryReferenceSchema
118
134
118
118
aff6862aab64d1b69bd5e1f78f01c4422d0565f7
bigcode/the-stack
train
6d08615b5d411c60574caf96
train
class
class CategorySetAssetKeyActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetAssetKeyAction`.""" asset_id = marshmallow.fields.String(allow_none=True, data_key="assetId") asset_key = marshmallow.fields.String( allow_none=True, missing=None, dat...
class CategorySetAssetKeyActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetAssetKeyAction`.""" asset_id = marshmallow.fields.String(allow_none=True, data_key="assetId") asset_key = marshmallow.fields.String( allow_none=True, missing=None, data_key="assetKey" ) class Meta: unknown = marshmall...
, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetAssetDescriptionAction(**data) class CategorySetAssetKeyActionSchema(CategoryUpdateActionSchema):
64
64
126
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetAssetKeyActionSchema
CategorySetAssetKeyActionSchema
483
497
483
483
7285f9251d400ce1f09d5b6b1af5a97e5c4178e0
bigcode/the-stack
train
81415525bea8477f6cac0c84
train
class
class CategoryResourceIdentifierSchema(ResourceIdentifierSchema): """Marshmallow schema for :class:`commercetools.types.CategoryResourceIdentifier`.""" class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["type_id"] retu...
class CategoryResourceIdentifierSchema(ResourceIdentifierSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryResourceIdentifier`.""" class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["type_id"] return types.CategoryResourceIdentifier(**data)
_none=True, missing=None, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["type_id"] return types.CategoryReference(**data) class CategoryResourceIdentifierSchema(ResourceIdentifierSchema):
64
64
76
9
55
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryResourceIdentifierSchema
CategoryResourceIdentifierSchema
137
146
137
137
dd15b6cd8d6ba21404fde42be59a5de71be6c1fd
bigcode/the-stack
train
5a2475ff43ab31dc7aae6849
train
class
class CategoryAddAssetActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategoryAddAssetAction`.""" asset = helpers.LazyNestedField( nested="commercetools._schemas._common.AssetDraftSchema", unknown=marshmallow.EXCLUDE, allow_none=True, ...
class CategoryAddAssetActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategoryAddAssetAction`.""" asset = helpers.LazyNestedField( nested="commercetools._schemas._common.AssetDraftSchema", unknown=marshmallow.EXCLUDE, allow_none=True, ) position = marshmallow.fields.Integer(allow_none=True, mis...
allow_none=True, ), allow_none=True, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): return types.CategoryUpdate(**data) class CategoryAddAssetActionSchema(CategoryUpdateActionSchema):
64
64
134
11
53
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryAddAssetActionSchema
CategoryAddAssetActionSchema
282
298
282
282
0b23819b7592755bcf895599b6359ed04b828b74
bigcode/the-stack
train
1a50f085ca6ce593cf7082c9
train
class
class CategoryDraftSchema(marshmallow.Schema): """Marshmallow schema for :class:`commercetools.types.CategoryDraft`.""" name = LocalizedStringField(allow_none=True) slug = LocalizedStringField(allow_none=True) description = LocalizedStringField(allow_none=True, missing=None) parent = helpers.LazyNe...
class CategoryDraftSchema(marshmallow.Schema):
"""Marshmallow schema for :class:`commercetools.types.CategoryDraft`.""" name = LocalizedStringField(allow_none=True) slug = LocalizedStringField(allow_none=True) description = LocalizedStringField(allow_none=True, missing=None) parent = helpers.LazyNestedField( nested="commercetools._schem...
ActionSchema", "CategorySetAssetSourcesActionSchema", "CategorySetAssetTagsActionSchema", "CategorySetCustomFieldActionSchema", "CategorySetCustomTypeActionSchema", "CategorySetDescriptionActionSchema", "CategorySetExternalIdActionSchema", "CategorySetKeyActionSchema", "CategorySetMetaDe...
115
115
385
10
105
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryDraftSchema
CategoryDraftSchema
46
93
46
46
702019bdee4851650b13b1ea61aaae5198db3ff4
bigcode/the-stack
train
e43d3af04f4eaf1d8d088ccb
train
class
class CategoryPagedQueryResponseSchema(marshmallow.Schema): """Marshmallow schema for :class:`commercetools.types.CategoryPagedQueryResponse`.""" limit = marshmallow.fields.Integer(allow_none=True) count = marshmallow.fields.Integer(allow_none=True) total = marshmallow.fields.Integer(allow_none=True, m...
class CategoryPagedQueryResponseSchema(marshmallow.Schema):
"""Marshmallow schema for :class:`commercetools.types.CategoryPagedQueryResponse`.""" limit = marshmallow.fields.Integer(allow_none=True) count = marshmallow.fields.Integer(allow_none=True) total = marshmallow.fields.Integer(allow_none=True, missing=None) offset = marshmallow.fields.Integer(allow_n...
= marshmallow.fields.String(allow_none=True, missing=None) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): return types.CategoryDraft(**data) class CategoryPagedQueryResponseSchema(marshmallow.Schema):
64
64
168
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategoryPagedQueryResponseSchema
CategoryPagedQueryResponseSchema
96
115
96
96
92251030b82da04ca458a98d0bd87decf313ddd8
bigcode/the-stack
train
4c347bf43cf7df2a585bbac2
train
class
class CategorySchema(BaseResourceSchema): """Marshmallow schema for :class:`commercetools.types.Category`.""" id = marshmallow.fields.String(allow_none=True) version = marshmallow.fields.Integer(allow_none=True) created_at = marshmallow.fields.DateTime(allow_none=True, data_key="createdAt") last_mo...
class CategorySchema(BaseResourceSchema):
"""Marshmallow schema for :class:`commercetools.types.Category`.""" id = marshmallow.fields.String(allow_none=True) version = marshmallow.fields.Integer(allow_none=True) created_at = marshmallow.fields.DateTime(allow_none=True, data_key="createdAt") last_modified_at = marshmallow.fields.DateTime( ...
.types.CategoryReference`.""" obj = helpers.LazyNestedField( nested="commercetools._schemas._category.CategorySchema", unknown=marshmallow.EXCLUDE, allow_none=True, missing=None, ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_lo...
177
177
591
7
170
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySchema
CategorySchema
149
220
149
149
786e136da729fb6544c98a169e66d3123a46f824
bigcode/the-stack
train
48149baad61761440cd9f25d
train
class
class CategorySetMetaKeywordsActionSchema(CategoryUpdateActionSchema): """Marshmallow schema for :class:`commercetools.types.CategorySetMetaKeywordsAction`.""" meta_keywords = LocalizedStringField( allow_none=True, missing=None, data_key="metaKeywords" ) class Meta: unknown = marshmall...
class CategorySetMetaKeywordsActionSchema(CategoryUpdateActionSchema):
"""Marshmallow schema for :class:`commercetools.types.CategorySetMetaKeywordsAction`.""" meta_keywords = LocalizedStringField( allow_none=True, missing=None, data_key="metaKeywords" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **...
Description" ) class Meta: unknown = marshmallow.EXCLUDE @marshmallow.post_load def post_load(self, data, **kwargs): del data["action"] return types.CategorySetMetaDescriptionAction(**data) class CategorySetMetaKeywordsActionSchema(CategoryUpdateActionSchema):
64
64
107
12
52
jeroenubbink/commercetools-python-sdk
src/commercetools/_schemas/_category.py
Python
CategorySetMetaKeywordsActionSchema
CategorySetMetaKeywordsActionSchema
642
655
642
642
e2466f3ec7ca8a19ada660d8a6e24542aa20dc6e
bigcode/the-stack
train
e09b4fdfab6b8aeda9ba85d8
train
function
def run(): def refresh_data(): # Ensure we’re fetch the latest data, by hitting the # _update_lists endpoint a few times. # # For more details, see: # https://github.com/OpenDataServices/org-ids/issues/256 refresh_url = 'https://org-id.guide/_update_lists' for...
def run():
def refresh_data(): # Ensure we’re fetch the latest data, by hitting the # _update_lists endpoint a few times. # # For more details, see: # https://github.com/OpenDataServices/org-ids/issues/256 refresh_url = 'https://org-id.guide/_update_lists' for x in range...
from time import sleep from .helpers import Importer, fetch def run():
17
111
370
3
13
codeforIATI/IATI-Codelists-NonEmbedded-updater
importers/organisation_registration_agency.py
Python
run
run
6
44
6
6
55441e747a91cf6896d013526902ef3110689147
bigcode/the-stack
train
5e1453aa7b7a0f1e3e4126b7
train
class
class ModelUpdater(abc.ABC): @abc.abstractmethod def update(self, loop_state: LoopState) -> None: """ Updates the training data of the model. Chooses whether to update hyper-parameters and how to do it :param loop_state: Object that contains current state of the loop """ ...
class ModelUpdater(abc.ABC): @abc.abstractmethod
def update(self, loop_state: LoopState) -> None: """ Updates the training data of the model. Chooses whether to update hyper-parameters and how to do it :param loop_state: Object that contains current state of the loop """ pass
its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import abc from typing import Callable from . import LoopState from ..interfaces import IModel import logging _log = logging.getLogger(__name__) class ModelUpdater(abc.ABC): @abc.abstractmethod
64
64
73
14
50
aaronkl/emukit
emukit/core/loop/model_updaters.py
Python
ModelUpdater
ModelUpdater
16
24
16
17
39c6305b3b42f4381507980256b4ae6edfe33cbd
bigcode/the-stack
train
f96420183ffda6fead46eac4
train
class
class FixedIntervalUpdater(ModelUpdater): """ Updates hyper-parameters every nth iteration, where n is defined by the user """ def __init__(self, model: IModel, interval: int=1, targets_extractor_fcn: Callable=None) -> None: """ :param model: Emukit emulator model :param interval: Number...
class FixedIntervalUpdater(ModelUpdater):
""" Updates hyper-parameters every nth iteration, where n is defined by the user """ def __init__(self, model: IModel, interval: int=1, targets_extractor_fcn: Callable=None) -> None: """ :param model: Emukit emulator model :param interval: Number of function evaluations between optimizin...
Updater(abc.ABC): @abc.abstractmethod def update(self, loop_state: LoopState) -> None: """ Updates the training data of the model. Chooses whether to update hyper-parameters and how to do it :param loop_state: Object that contains current state of the loop """ pass class...
78
78
260
7
70
aaronkl/emukit
emukit/core/loop/model_updaters.py
Python
FixedIntervalUpdater
FixedIntervalUpdater
27
52
27
27
f26cd612cfd1b1dfc16e8baacdd8db0a33efbd63
bigcode/the-stack
train
5b1e3488d8eaba601188eabd
train
function
def isPrime(n): if n>1: for i in range(2,int(sqrt(n))+1): if n%i == 0: return False return True else: return False
def isPrime(n):
if n>1: for i in range(2,int(sqrt(n))+1): if n%i == 0: return False return True else: return False
have 3 Fibonacci prime numbers : 2,3,5 Given the count of prime numbers needed by Henry , compute the series for him. ''' from math import sqrt # function isPrime # takes in an integer n # returns True if the integer is a prime number def isPrime(n):
64
64
48
5
58
jduchimaza/A-December-of-Algorithms-2019
December-06/python_jduchimaza_fibonacci.py
Python
isPrime
isPrime
20
27
20
20
772f3699c29fb28c0f0de4c674763798f3d5c32c
bigcode/the-stack
train
d99925b8b1a6960f9b1c8d01
train
function
def primeFib(n): seq = [] a=1 b=1 i = 1 while len(seq)!=n: fib = b b = b+a a = fib if(isPrime(fib)): seq.append(fib) i+=1 return seq
def primeFib(n):
seq = [] a=1 b=1 i = 1 while len(seq)!=n: fib = b b = b+a a = fib if(isPrime(fib)): seq.append(fib) i+=1 return seq
,int(sqrt(n))+1): if n%i == 0: return False return True else: return False # function primeFib # takes in an integer n # returns a Fibonacci sequence with length n # that includes only prime numbers def primeFib(n):
64
64
70
5
58
jduchimaza/A-December-of-Algorithms-2019
December-06/python_jduchimaza_fibonacci.py
Python
primeFib
primeFib
34
46
34
34
aa2368c717c15bd7d7865945110052594b70655b
bigcode/the-stack
train
d721e2eafb79e2535d337dbd
train
class
class OCR_detect: # construct funtion of the ocr def __init__(self, imgpath, sample_size): ''' :param imgpath: the folder path of screenshots :param sample_size: the number of screenshots ''' self.imgpath = imgpath self.sample_size = sample_size s...
class OCR_detect: # construct funtion of the ocr
def __init__(self, imgpath, sample_size): ''' :param imgpath: the folder path of screenshots :param sample_size: the number of screenshots ''' self.imgpath = imgpath self.sample_size = sample_size self.config = { 'appId': '',# Your id ...
import uiautomator2 as u2 import time import glob import os import re import sqlite3 from aip import AipOcr class OCR_detect: # construct funtion of the ocr
48
256
2,633
14
33
LinkedInFinder/Python-UiAutomator2
AutomatedControllingAndroid.py
Python
OCR_detect
OCR_detect
10
295
10
11
f525874f620c328d4f7877586372449b23aebe84
bigcode/the-stack
train
23c5944252400555d5acb12c
train
function
def main(): startup_prog, eval_program, place, config, _ = program.preprocess() feeded_var_names, target_vars, fetches_var_name = program.build_export( config, eval_program, startup_prog) eval_program = eval_program.clone(for_test=True) exe = fluid.Executor(place) exe.run(startup_prog) ...
def main():
startup_prog, eval_program, place, config, _ = program.preprocess() feeded_var_names, target_vars, fetches_var_name = program.build_export( config, eval_program, startup_prog) eval_program = eval_program.clone(for_test=True) exe = fluid.Executor(place) exe.run(startup_prog) init_model(...
not take any effect. set_paddle_flags( FLAGS_eager_delete_tensor_gb=0, # enable GC to save memory ) import program from paddle import fluid from ppocr.utils.utility import initial_logger logger = initial_logger() from ppocr.utils.save_load import init_model def main():
65
65
218
3
61
happog/PaddleOCR
tools/export_model.py
Python
main
main
47
71
47
47
5577e5c1f513d83665427cd0fee0eda641fac672
bigcode/the-stack
train
ef5ef43b33aa21d60d99f34b
train
function
def set_paddle_flags(**kwargs): for key, value in kwargs.items(): if os.environ.get(key, None) is None: os.environ[key] = str(value)
def set_paddle_flags(**kwargs):
for key, value in kwargs.items(): if os.environ.get(key, None) is None: os.environ[key] = str(value)
__future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys __dir__ = os.path.dirname(__file__) sys.path.append(__dir__) sys.path.append(os.path.join(__dir__, '..')) def set_paddle_flags(**kwargs):
63
64
38
8
55
happog/PaddleOCR
tools/export_model.py
Python
set_paddle_flags
set_paddle_flags
26
29
26
26
015017da7096c0a48d504b0fde0a879c6ddf9f3d
bigcode/the-stack
train
26fc11bbf715b866c40c2771
train
function
def make_check(cls, *, alt_name=None, **vars): '''Create a new test from class `cls`. :arg cls: the class of the test. 'arg alt_name: an alternative name to be given to the test class :arg vars: variables to set in the test upon creation ''' if alt_name: cls = make_test(alt_name, (cls,...
def make_check(cls, *, alt_name=None, **vars):
'''Create a new test from class `cls`. :arg cls: the class of the test. 'arg alt_name: an alternative name to be given to the test class :arg vars: variables to set in the test upon creation ''' if alt_name: cls = make_test(alt_name, (cls,), {}) for k, v in vars.items(): c...
try: next(gen) except StopIteration: pass except KeyError: # no target function found; use the original one fn(*args, **kwargs) return _wrapped return _dispatch_deco def make_check(cls, *, alt...
64
64
108
13
50
jacwah/reframe
unittests/utility.py
Python
make_check
make_check
165
179
165
165
7ccbde837f85b9240593b9a211d6d51932db0b68
bigcode/the-stack
train
16b90ac9fd6a9b6d2d17cf7b
train
function
def has_sane_modules_system(): return not isinstance(rt.runtime().modules_system.backend, (modules.NoModImpl, modules.SpackImpl))
def has_sane_modules_system():
return not isinstance(rt.runtime().modules_system.backend, (modules.NoModImpl, modules.SpackImpl))
for p in rt.runtime().system.partitions: if p.name == name: return p return None def environment_by_name(name, partition): for e in partition.environs: if e.name == name: return e return None def has_sane_modules_system():
64
64
30
7
56
jacwah/reframe
unittests/utility.py
Python
has_sane_modules_system
has_sane_modules_system
81
83
81
81
d7140854fb51fcad6f061f46249799435ddf75e1
bigcode/the-stack
train