blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
97a367d4cdb88faaccf67b56591dd958245f9850
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn FileEvidence()", "from .alert_evidence import AlertEvidence\nfrom .detection_status import DetectionStatus\nfrom .file_details import FileDetails\nfrom .alert_evidence import AlertEvidence\nfrom .detection_status import DetectionStatus...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return FileEvidence() <|end_body_0|> <|body_start_1|> from .alert_evidence import AlertEvidence from .detection_status import DetectionStatus from .file_details import FileDetails ...
FileEvidence
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FileEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_36k_train_028600
2,997
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: FileEvidence", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(...
3
stack_v2_sparse_classes_30k_train_001491
Implement the Python class `FileEvidence` described below. Class description: Implement the FileEvidence class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FileEvidence: Creates a new instance of the appropriate class based on discriminator value Ar...
Implement the Python class `FileEvidence` described below. Class description: Implement the FileEvidence class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FileEvidence: Creates a new instance of the appropriate class based on discriminator value Ar...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class FileEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FileEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileEvidence: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> FileEvidence: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: FileEvidence""...
the_stack_v2_python_sparse
msgraph/generated/models/security/file_evidence.py
microsoftgraph/msgraph-sdk-python
train
135
4d004c220ff1b2bfdcaf17e323e9356184086ef7
[ "self.keys_to_features = {'image/encoded': tf.FixedLenFeature((), tf.string, default_value=''), 'image/format': tf.FixedLenFeature((), tf.string, default_value='jpeg'), 'image/filename': tf.FixedLenFeature((), tf.string, default_value=''), 'image/key/sha256': tf.FixedLenFeature((), tf.string, default_value=''), 'im...
<|body_start_0|> self.keys_to_features = {'image/encoded': tf.FixedLenFeature((), tf.string, default_value=''), 'image/format': tf.FixedLenFeature((), tf.string, default_value='jpeg'), 'image/filename': tf.FixedLenFeature((), tf.string, default_value=''), 'image/key/sha256': tf.FixedLenFeature((), tf.string, de...
Tensorflow Example proto decoder.
TfExampleDecoder
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TfExampleDecoder: """Tensorflow Example proto decoder.""" def __init__(self): """Constructor sets keys_to_features and items_to_handlers.""" <|body_0|> def decode(self, tf_example_string_tensor): """Decodes serialized tensorflow example and returns a tensor dicti...
stack_v2_sparse_classes_36k_train_028601
8,543
permissive
[ { "docstring": "Constructor sets keys_to_features and items_to_handlers.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Decodes serialized tensorflow example and returns a tensor dictionary. Args: tf_example_string_tensor: a string tensor holding a serialized tensorfl...
2
null
Implement the Python class `TfExampleDecoder` described below. Class description: Tensorflow Example proto decoder. Method signatures and docstrings: - def __init__(self): Constructor sets keys_to_features and items_to_handlers. - def decode(self, tf_example_string_tensor): Decodes serialized tensorflow example and r...
Implement the Python class `TfExampleDecoder` described below. Class description: Tensorflow Example proto decoder. Method signatures and docstrings: - def __init__(self): Constructor sets keys_to_features and items_to_handlers. - def decode(self, tf_example_string_tensor): Decodes serialized tensorflow example and r...
0f7adb97a93ec3e3485c261d030c507eb16b33e4
<|skeleton|> class TfExampleDecoder: """Tensorflow Example proto decoder.""" def __init__(self): """Constructor sets keys_to_features and items_to_handlers.""" <|body_0|> def decode(self, tf_example_string_tensor): """Decodes serialized tensorflow example and returns a tensor dicti...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TfExampleDecoder: """Tensorflow Example proto decoder.""" def __init__(self): """Constructor sets keys_to_features and items_to_handlers.""" self.keys_to_features = {'image/encoded': tf.FixedLenFeature((), tf.string, default_value=''), 'image/format': tf.FixedLenFeature((), tf.string, def...
the_stack_v2_python_sparse
models/official/retinanet/object_detection/tf_example_decoder.py
tensorflow/tpu
train
5,627
950ccfb7d0a3b3f8c782bc5eaa62dcc3e829e050
[ "try:\n input_stream_names = [ACTIVITY_STREAM, LIGHT_STREAM, PHONE_SCREEN_STREAM, AUDIO_ENERGY_STREAM]\n input_streams = []\n streams = self.CC.get_user_streams(user_id)\n if streams:\n for stream_name, stream_metadata in streams.items():\n if stream_name in input_stream_names:\n ...
<|body_start_0|> try: input_stream_names = [ACTIVITY_STREAM, LIGHT_STREAM, PHONE_SCREEN_STREAM, AUDIO_ENERGY_STREAM] input_streams = [] streams = self.CC.get_user_streams(user_id) if streams: for stream_name, stream_metadata in streams.items(): ...
Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from these stream's data.
SleepTime
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SleepTime: """Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from these stream's data.""" def listi...
stack_v2_sparse_classes_36k_train_028602
4,629
permissive
[ { "docstring": "Produce and save the list of sleep time intervals according to day in one stream :param str user_id: UUID of the stream owner :param List(str) all_days: All days of the user in the format 'YYYYMMDD'", "name": "listing_all_sleep_times", "signature": "def listing_all_sleep_times(self, user...
2
null
Implement the Python class `SleepTime` described below. Class description: Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from...
Implement the Python class `SleepTime` described below. Class description: Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from...
73f5ea2430bc7c23de422dccb7b65ef9f8917595
<|skeleton|> class SleepTime: """Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from these stream's data.""" def listi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SleepTime: """Produce feature from these four streams: 1. CU_IS_SCREEN_ON--edu.dartmouth.eureka 2. ACTIVITY_TYPE--org.md2k.phonesensor--PHONE 3. AMBIENT_LIGHT--org.md2k.phonesensor--PHONE 4. CU_AUDIO_ENERGY--edu.dartmouth.eureka Sleep time is calculated from these stream's data.""" def listing_all_sleep_...
the_stack_v2_python_sparse
core/feature/sleep_time/sleep_time.py
MD2Korg/CerebralCortex-DataAnalysis
train
1
2dd1cd36090e98e25c5dc7243914f88d2a33bcf7
[ "Block.__init__(self, scenario, args)\nif self.language is None:\n raise LoadingException('Language must be defined!')", "if not re.search('(:1|drop)$', tnode.formeme) or tnode.is_member:\n return\nif tnode.t_lemma == 'ten' and (not tnode.parent.t_lemma in ['být', 'znamenat']):\n self.drop_anode(tnode)\n...
<|body_start_0|> Block.__init__(self, scenario, args) if self.language is None: raise LoadingException('Language must be defined!') <|end_body_0|> <|body_start_1|> if not re.search('(:1|drop)$', tnode.formeme) or tnode.is_member: return if tnode.t_lemma == 'ten' ...
Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree
DropSubjPersProns
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DropSubjPersProns: """Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree""" def __init__(self, scenario, args): """Constructor, just checking the a...
stack_v2_sparse_classes_36k_train_028603
2,839
permissive
[ { "docstring": "Constructor, just checking the argument values", "name": "__init__", "signature": "def __init__(self, scenario, args)" }, { "docstring": "Check if the a-node corresponding to the given t-node should be dropped, and do so where appropriate.", "name": "process_tnode", "sign...
3
stack_v2_sparse_classes_30k_test_000357
Implement the Python class `DropSubjPersProns` described below. Class description: Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree Method signatures and docstrings: - def __init_...
Implement the Python class `DropSubjPersProns` described below. Class description: Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree Method signatures and docstrings: - def __init_...
73af644ec35c8a1cd0c37cd478c2afc1db717e0b
<|skeleton|> class DropSubjPersProns: """Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree""" def __init__(self, scenario, args): """Constructor, just checking the a...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DropSubjPersProns: """Remove the Czech pro-drop subject personal pronouns (or demonstrative "to") from the a-tree. Arguments: language: the language of the target tree selector: the selector of the target tree""" def __init__(self, scenario, args): """Constructor, just checking the argument value...
the_stack_v2_python_sparse
alex/components/nlg/tectotpl/block/t2a/cs/dropsubjpersprons.py
oplatek/alex
train
0
516737dca3465c39b1d0c27f9d564a28f7a6218e
[ "super(S3APITest, cls).setUpClass()\nsession = openstack_utils.get_overcloud_keystone_session()\nks_client = openstack_utils.get_keystone_session_client(session)\ntoken_data = ks_client.tokens.get_token_data(session.get_token())\nproject_id = token_data['token']['project']['id']\nuser_id = token_data['token']['user...
<|body_start_0|> super(S3APITest, cls).setUpClass() session = openstack_utils.get_overcloud_keystone_session() ks_client = openstack_utils.get_keystone_session_client(session) token_data = ks_client.tokens.get_token_data(session.get_token()) project_id = token_data['token']['proj...
Test object storage S3 API.
S3APITest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class S3APITest: """Test object storage S3 API.""" def setUpClass(cls): """Run class setup for running tests.""" <|body_0|> def test_901_s3_list_buckets(self): """Use S3 API to list buckets.""" <|body_1|> <|end_skeleton|> <|body_start_0|> super(S3APIT...
stack_v2_sparse_classes_36k_train_028604
19,089
permissive
[ { "docstring": "Run class setup for running tests.", "name": "setUpClass", "signature": "def setUpClass(cls)" }, { "docstring": "Use S3 API to list buckets.", "name": "test_901_s3_list_buckets", "signature": "def test_901_s3_list_buckets(self)" } ]
2
stack_v2_sparse_classes_30k_train_019602
Implement the Python class `S3APITest` described below. Class description: Test object storage S3 API. Method signatures and docstrings: - def setUpClass(cls): Run class setup for running tests. - def test_901_s3_list_buckets(self): Use S3 API to list buckets.
Implement the Python class `S3APITest` described below. Class description: Test object storage S3 API. Method signatures and docstrings: - def setUpClass(cls): Run class setup for running tests. - def test_901_s3_list_buckets(self): Use S3 API to list buckets. <|skeleton|> class S3APITest: """Test object storage...
3b17ad9d97c57b6e62797d4e3333e4b83e43a447
<|skeleton|> class S3APITest: """Test object storage S3 API.""" def setUpClass(cls): """Run class setup for running tests.""" <|body_0|> def test_901_s3_list_buckets(self): """Use S3 API to list buckets.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class S3APITest: """Test object storage S3 API.""" def setUpClass(cls): """Run class setup for running tests.""" super(S3APITest, cls).setUpClass() session = openstack_utils.get_overcloud_keystone_session() ks_client = openstack_utils.get_keystone_session_client(session) ...
the_stack_v2_python_sparse
zaza/openstack/charm_tests/swift/tests.py
openstack-charmers/zaza-openstack-tests
train
7
1b7575a64366b7da437ac0ffd9fddd6860b639ac
[ "self.cutoff = cutoff\nself.angle_cutoff = angle_cutoff\nself.box_width = box_width\nself.voxel_width = voxel_width", "if 'complex' in kwargs:\n datapoint = kwargs.get('complex')\n raise DeprecationWarning('Complex is being phased out as a parameter, please pass \"datapoint\" instead.')\ntry:\n fragments...
<|body_start_0|> self.cutoff = cutoff self.angle_cutoff = angle_cutoff self.box_width = box_width self.voxel_width = voxel_width <|end_body_0|> <|body_start_1|> if 'complex' in kwargs: datapoint = kwargs.get('complex') raise DeprecationWarning('Complex is...
Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For each atom, localize this salt bridge in the voxel in which it originated to create a l...
PiStackVoxelizer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PiStackVoxelizer: """Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For each atom, localize this salt bridge in th...
stack_v2_sparse_classes_36k_train_028605
27,676
permissive
[ { "docstring": "Parameters ---------- cutoff: float, optional (default 4.4) The distance in angstroms within which atoms must be to be considered for a cation-pi interaction between them. angle_cutoff: float, optional (default 30.0) Angle cutoff. Max allowed deviation from the ideal (0 deg) angle between ring n...
2
null
Implement the Python class `PiStackVoxelizer` described below. Class description: Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For eac...
Implement the Python class `PiStackVoxelizer` described below. Class description: Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For eac...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class PiStackVoxelizer: """Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For each atom, localize this salt bridge in th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PiStackVoxelizer: """Localize Pi stacking interactions between atoms in macromolecular complexes. Given a macromolecular complex made up of multiple constitutent molecules, compute pi-stacking interactions between atoms in the macromolecular complex. For each atom, localize this salt bridge in the voxel in wh...
the_stack_v2_python_sparse
deepchem/feat/complex_featurizers/grid_featurizers.py
deepchem/deepchem
train
4,876
cc0b6cad0ab1c6dbf319ff15aeb8925cd015c7b4
[ "conn, cursor = get_db_cursor()\nbuild = 'toy_build'\ntranscript_dict = init_refs.make_transcript_dict(cursor, build)\nconn.close()\nedges = frozenset({1, 3, 4, 5})\ngene_ID, transcript = talon.search_for_transcript(edges, transcript_dict)\nassert gene_ID == None\nassert transcript == None", "conn, cursor = get_d...
<|body_start_0|> conn, cursor = get_db_cursor() build = 'toy_build' transcript_dict = init_refs.make_transcript_dict(cursor, build) conn.close() edges = frozenset({1, 3, 4, 5}) gene_ID, transcript = talon.search_for_transcript(edges, transcript_dict) assert gene_I...
TestSearchForTranscript
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestSearchForTranscript: def test_find_no_match(self): """Example where the toy transcript database contains no matches for the edge set.""" <|body_0|> def test_find_match(self): """Example where the toy transcript database contains exactly one match for the transcri...
stack_v2_sparse_classes_36k_train_028606
1,481
permissive
[ { "docstring": "Example where the toy transcript database contains no matches for the edge set.", "name": "test_find_no_match", "signature": "def test_find_no_match(self)" }, { "docstring": "Example where the toy transcript database contains exactly one match for the transcript.", "name": "t...
2
stack_v2_sparse_classes_30k_val_000291
Implement the Python class `TestSearchForTranscript` described below. Class description: Implement the TestSearchForTranscript class. Method signatures and docstrings: - def test_find_no_match(self): Example where the toy transcript database contains no matches for the edge set. - def test_find_match(self): Example w...
Implement the Python class `TestSearchForTranscript` described below. Class description: Implement the TestSearchForTranscript class. Method signatures and docstrings: - def test_find_no_match(self): Example where the toy transcript database contains no matches for the edge set. - def test_find_match(self): Example w...
8014faed5f982e5e106ec05239e47d65878e76c3
<|skeleton|> class TestSearchForTranscript: def test_find_no_match(self): """Example where the toy transcript database contains no matches for the edge set.""" <|body_0|> def test_find_match(self): """Example where the toy transcript database contains exactly one match for the transcri...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestSearchForTranscript: def test_find_no_match(self): """Example where the toy transcript database contains no matches for the edge set.""" conn, cursor = get_db_cursor() build = 'toy_build' transcript_dict = init_refs.make_transcript_dict(cursor, build) conn.close() ...
the_stack_v2_python_sparse
testing_suite/test_search_for_transcript.py
kopardev/TALON
train
0
13d78cf5f8808108331fe88d77d2a91ac2a29dc6
[ "self.capacity = capacity\nself.cache = []\nself.dict = {}", "try:\n self.dict[key]\n self.cache.append(key)\n if len(self.cache) > self.capacity:\n self.cache = self.cache[1:]\n return self.dict[key]\nexcept KeyError:\n return -1", "try:\n self.dict[key]\n self.dict[key] = value\n ...
<|body_start_0|> self.capacity = capacity self.cache = [] self.dict = {} <|end_body_0|> <|body_start_1|> try: self.dict[key] self.cache.append(key) if len(self.cache) > self.capacity: self.cache = self.cache[1:] return self...
LRUCache
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k_train_028607
1,115
permissive
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: void", "name": "pu...
3
null
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void
Implement the Python class `LRUCache` described below. Class description: Implement the LRUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void <|sk...
22be8c8417b28b2888be5aee82ccfe47f57f1945
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LRUCache: def __init__(self, capacity): """:type capacity: int""" self.capacity = capacity self.cache = [] self.dict = {} def get(self, key): """:type key: int :rtype: int""" try: self.dict[key] self.cache.append(key) if ...
the_stack_v2_python_sparse
lru_cache/solytion.py
andriiglukhyi/leetcode
train
1
889ad2019fd55a5a32e9e22ae9c078073ad8b362
[ "self.dark_image_picture = data\nself.aperture = aperture\nself.create_plot()", "if self.dark_image_picture is not None:\n if os.path.isfile(self.dark_image_picture):\n view = read_png(self.dark_image_picture)\n ydim, xdim = view.shape\n dim = max(xdim, ydim)\n self.plot = figure(x_...
<|body_start_0|> self.dark_image_picture = data self.aperture = aperture self.create_plot() <|end_body_0|> <|body_start_1|> if self.dark_image_picture is not None: if os.path.isfile(self.dark_image_picture): view = read_png(self.dark_image_picture) ...
Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure created by the dark monitor plot : bokeh.figure Figure containing the dark current i...
DarkImagePlot
[ "Python-2.0", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DarkImagePlot: """Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure created by the dark monitor plot : bokeh.fi...
stack_v2_sparse_classes_36k_train_028608
32,336
permissive
[ { "docstring": "Create the figure", "name": "__init__", "signature": "def __init__(self, data, aperture)" }, { "docstring": "Takes the input filename, reads it in, and places it in a figure. If the given filename doesn't exist, or if no filename is given, it produces an empty figure that can be ...
2
null
Implement the Python class `DarkImagePlot` described below. Class description: Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure crea...
Implement the Python class `DarkImagePlot` described below. Class description: Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure crea...
d5a6dbe1a1772a1d0d77af88d4e7deb2374e55c4
<|skeleton|> class DarkImagePlot: """Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure created by the dark monitor plot : bokeh.fi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DarkImagePlot: """Creates a figure that displays a mean dark current image held in a png file Attributes ---------- aperture : str Name of aperture (e.g. NRCA1_FULL) dark_image_picture : str Name of png file containing the mean dark current image figure created by the dark monitor plot : bokeh.figure Figure c...
the_stack_v2_python_sparse
jwql/website/apps/jwql/monitor_pages/monitor_dark_bokeh.py
spacetelescope/jwql
train
70
2501aeb7c1d544958d038dd101de797b0c52793a
[ "self.vehicle_id = int(vehicle_id)\nself.vehicle_states = np.asarray([[], [], [], [], []])\nrospy.Subscriber('/world_state', WorldState, self.update_state)", "self.vehicle_states = np.asarray([[], [], [], [], []])\nfor vs in ws.vehicle_states:\n self.vehicle_states = np.concatenate((self.vehicle_states, [[vs.v...
<|body_start_0|> self.vehicle_id = int(vehicle_id) self.vehicle_states = np.asarray([[], [], [], [], []]) rospy.Subscriber('/world_state', WorldState, self.update_state) <|end_body_0|> <|body_start_1|> self.vehicle_states = np.asarray([[], [], [], [], []]) for vs in ws.vehicle_s...
Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription.
BaseSensor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseSensor: """Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription.""" def __init__(self, vehicle_id): """Initialize class BaseSensor. @param vehicle_id: I{(int)} ID of the vehicle thi...
stack_v2_sparse_classes_36k_train_028609
5,525
no_license
[ { "docstring": "Initialize class BaseSensor. @param vehicle_id: I{(int)} ID of the vehicle this sensor belongs to.", "name": "__init__", "signature": "def __init__(self, vehicle_id)" }, { "docstring": "Callback function for topic 'world_state'.", "name": "update_state", "signature": "def...
2
stack_v2_sparse_classes_30k_train_015431
Implement the Python class `BaseSensor` described below. Class description: Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription. Method signatures and docstrings: - def __init__(self, vehicle_id): Initialize class Base...
Implement the Python class `BaseSensor` described below. Class description: Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription. Method signatures and docstrings: - def __init__(self, vehicle_id): Initialize class Base...
a759b0336b80b5647cc858d99d1fa40a0a9d826d
<|skeleton|> class BaseSensor: """Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription.""" def __init__(self, vehicle_id): """Initialize class BaseSensor. @param vehicle_id: I{(int)} ID of the vehicle thi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseSensor: """Base class for sensors. New sensors inherit from this class which implements the subsciption to the world state and the processing of this subscription.""" def __init__(self, vehicle_id): """Initialize class BaseSensor. @param vehicle_id: I{(int)} ID of the vehicle this sensor belo...
the_stack_v2_python_sparse
sml_world/scripts/sml_modules/sensor_models.py
marinarantanen/sml_world
train
1
f30709aa75a0139b2d7c46e2fda1e7a074c1f1af
[ "if username is None:\n raise Exception('USERNAME parameter was not specified')\nif password is None:\n raise Exception('PASSWORD parameter was not specified')\nself.__username = username\nself.__password = password", "async with asyncssh.connect(host, username=self.__username, password=self.__password) as ...
<|body_start_0|> if username is None: raise Exception('USERNAME parameter was not specified') if password is None: raise Exception('PASSWORD parameter was not specified') self.__username = username self.__password = password <|end_body_0|> <|body_start_1|> ...
A command executor, that executes commands remotely via SSH.
CommandExecutor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CommandExecutor: """A command executor, that executes commands remotely via SSH.""" def __init__(self, username, password): """Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Password of the SSH user. Raises: Exception: If username or p...
stack_v2_sparse_classes_36k_train_028610
1,979
no_license
[ { "docstring": "Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Password of the SSH user. Raises: Exception: If username or password were not specified.", "name": "__init__", "signature": "def __init__(self, username, password)" }, { "docstring": "...
2
stack_v2_sparse_classes_30k_train_007695
Implement the Python class `CommandExecutor` described below. Class description: A command executor, that executes commands remotely via SSH. Method signatures and docstrings: - def __init__(self, username, password): Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Pass...
Implement the Python class `CommandExecutor` described below. Class description: A command executor, that executes commands remotely via SSH. Method signatures and docstrings: - def __init__(self, username, password): Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Pass...
72f407f8c8862e59383bfb913edf55e367d4f45a
<|skeleton|> class CommandExecutor: """A command executor, that executes commands remotely via SSH.""" def __init__(self, username, password): """Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Password of the SSH user. Raises: Exception: If username or p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CommandExecutor: """A command executor, that executes commands remotely via SSH.""" def __init__(self, username, password): """Constructor of the CommandExecutor. Args: username (str): Name of the SSH user. password (str): Password of the SSH user. Raises: Exception: If username or password were ...
the_stack_v2_python_sparse
statscrawler/remote.py
gorolykmaxim/loadbalancer
train
0
df1ef78c6479f5da68addb41e3f82c2f3815efa1
[ "if not v:\n raise ValueError('courier_id is required')\nif type(v) != int:\n raise ValueError('courier_id must be integer')\nif v < 0 or v > 9223372036854775807:\n raise ValueError('courier_id out of allowed range')\nreturn v", "excess_fields = set(values.keys()).difference({'courier_id'})\nif excess_fi...
<|body_start_0|> if not v: raise ValueError('courier_id is required') if type(v) != int: raise ValueError('courier_id must be integer') if v < 0 or v > 9223372036854775807: raise ValueError('courier_id out of allowed range') return v <|end_body_0|> <|...
Описывает стрктуру данных для назначения заказов
AssignDataModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AssignDataModel: """Описывает стрктуру данных для назначения заказов""" def validate_courier_id(cls, v: int) -> int: """Валидирует courier_id""" <|body_0|> def validate_excess_fields(cls, values: Dict) -> Dict: """Валидирует отсутствие лишних полей""" <|b...
stack_v2_sparse_classes_36k_train_028611
8,762
no_license
[ { "docstring": "Валидирует courier_id", "name": "validate_courier_id", "signature": "def validate_courier_id(cls, v: int) -> int" }, { "docstring": "Валидирует отсутствие лишних полей", "name": "validate_excess_fields", "signature": "def validate_excess_fields(cls, values: Dict) -> Dict"...
2
stack_v2_sparse_classes_30k_train_010907
Implement the Python class `AssignDataModel` described below. Class description: Описывает стрктуру данных для назначения заказов Method signatures and docstrings: - def validate_courier_id(cls, v: int) -> int: Валидирует courier_id - def validate_excess_fields(cls, values: Dict) -> Dict: Валидирует отсутствие лишних...
Implement the Python class `AssignDataModel` described below. Class description: Описывает стрктуру данных для назначения заказов Method signatures and docstrings: - def validate_courier_id(cls, v: int) -> int: Валидирует courier_id - def validate_excess_fields(cls, values: Dict) -> Dict: Валидирует отсутствие лишних...
f1a908e5d6b30b826c38d24c52a721764f056fde
<|skeleton|> class AssignDataModel: """Описывает стрктуру данных для назначения заказов""" def validate_courier_id(cls, v: int) -> int: """Валидирует courier_id""" <|body_0|> def validate_excess_fields(cls, values: Dict) -> Dict: """Валидирует отсутствие лишних полей""" <|b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AssignDataModel: """Описывает стрктуру данных для назначения заказов""" def validate_courier_id(cls, v: int) -> int: """Валидирует courier_id""" if not v: raise ValueError('courier_id is required') if type(v) != int: raise ValueError('courier_id must be int...
the_stack_v2_python_sparse
candyapi/orders/validators.py
IntAlgambra/candyapi
train
0
57474f741122cacaf3046fe9a52a6ed6e8d9b111
[ "def helper(root, ans):\n if not root:\n ans.append('X')\n return\n ans.append(str(root.val))\n helper(root.left, ans)\n helper(root.right, ans)\nans = []\nhelper(root, ans)\nreturn '_'.join(ans)", "def helper(data):\n num = data.pop(0)\n if num == 'X':\n return None\n ro...
<|body_start_0|> def helper(root, ans): if not root: ans.append('X') return ans.append(str(root.val)) helper(root.left, ans) helper(root.right, ans) ans = [] helper(root, ans) return '_'.join(ans) <|end_body_...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_028612
869
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
d438f9b826816ecb1ca3e404b6914563d182eea0
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" def helper(root, ans): if not root: ans.append('X') return ans.append(str(root.val)) helper(root.left, ans) ...
the_stack_v2_python_sparse
leetcode/0297. 二叉树的序列化与反序列化.py
zhoulukuan/leetcode_python
train
0
66a0e6b0271323cc100c788251c1907cbb03e11a
[ "current_user = get_jwt_identity()\nif current_user:\n user = User.query.filter_by(email=current_user).first()\n helpers.abort_if_unknown_user(user)\n projects = ProjectModel.query.filter(or_(ProjectModel.members.any(Membership.user_id == user.id), ProjectModel.is_public)).order_by(ProjectModel.id.desc())....
<|body_start_0|> current_user = get_jwt_identity() if current_user: user = User.query.filter_by(email=current_user).first() helpers.abort_if_unknown_user(user) projects = ProjectModel.query.filter(or_(ProjectModel.members.any(Membership.user_id == user.id), ProjectMod...
Mapped to: /api/projects/
Projects
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Projects: """Mapped to: /api/projects/""" def get(): """The projects the JWT user is a member of, otherwise all public projects.""" <|body_0|> def post(self): """CREATE a project where sessions can be created""" <|body_1|> <|end_skeleton|> <|body_start_...
stack_v2_sparse_classes_36k_train_028613
3,609
no_license
[ { "docstring": "The projects the JWT user is a member of, otherwise all public projects.", "name": "get", "signature": "def get()" }, { "docstring": "CREATE a project where sessions can be created", "name": "post", "signature": "def post(self)" } ]
2
stack_v2_sparse_classes_30k_train_001925
Implement the Python class `Projects` described below. Class description: Mapped to: /api/projects/ Method signatures and docstrings: - def get(): The projects the JWT user is a member of, otherwise all public projects. - def post(self): CREATE a project where sessions can be created
Implement the Python class `Projects` described below. Class description: Mapped to: /api/projects/ Method signatures and docstrings: - def get(): The projects the JWT user is a member of, otherwise all public projects. - def post(self): CREATE a project where sessions can be created <|skeleton|> class Projects: ...
716fa5a6e905380cb206c57868e87556805f2b7f
<|skeleton|> class Projects: """Mapped to: /api/projects/""" def get(): """The projects the JWT user is a member of, otherwise all public projects.""" <|body_0|> def post(self): """CREATE a project where sessions can be created""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Projects: """Mapped to: /api/projects/""" def get(): """The projects the JWT user is a member of, otherwise all public projects.""" current_user = get_jwt_identity() if current_user: user = User.query.filter_by(email=current_user).first() helpers.abort_if_u...
the_stack_v2_python_sparse
gabber/api/projects.py
joseplj/GabberAPI
train
0
4d46a01e4af37c89607d2dcfe9d0b41844c4ce82
[ "try:\n return self.data.CapacityMiB\nexcept AttributeError:\n return 'Not available'", "try:\n return self.data.Raid\nexcept AttributeError:\n return 'Not available'" ]
<|body_start_0|> try: return self.data.CapacityMiB except AttributeError: return 'Not available' <|end_body_0|> <|body_start_1|> try: return self.data.Raid except AttributeError: return 'Not available' <|end_body_1|>
Class to manage redfish hpe oem LogicalDrives data.
LogicalDrives
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogicalDrives: """Class to manage redfish hpe oem LogicalDrives data.""" def get_capacity(self): """Get Logical drive capacity :returns: Logical drive capacity or "Not available" :rtype: string""" <|body_0|> def get_raid(self): """Get Logical drive raid configura...
stack_v2_sparse_classes_36k_train_028614
6,341
permissive
[ { "docstring": "Get Logical drive capacity :returns: Logical drive capacity or \"Not available\" :rtype: string", "name": "get_capacity", "signature": "def get_capacity(self)" }, { "docstring": "Get Logical drive raid configuration :returns: Logical drive raid configuration or \"Not available\" ...
2
stack_v2_sparse_classes_30k_train_018251
Implement the Python class `LogicalDrives` described below. Class description: Class to manage redfish hpe oem LogicalDrives data. Method signatures and docstrings: - def get_capacity(self): Get Logical drive capacity :returns: Logical drive capacity or "Not available" :rtype: string - def get_raid(self): Get Logical...
Implement the Python class `LogicalDrives` described below. Class description: Class to manage redfish hpe oem LogicalDrives data. Method signatures and docstrings: - def get_capacity(self): Get Logical drive capacity :returns: Logical drive capacity or "Not available" :rtype: string - def get_raid(self): Get Logical...
41115bc5982a2f2d4e9eb7106880dc3bbdfebc54
<|skeleton|> class LogicalDrives: """Class to manage redfish hpe oem LogicalDrives data.""" def get_capacity(self): """Get Logical drive capacity :returns: Logical drive capacity or "Not available" :rtype: string""" <|body_0|> def get_raid(self): """Get Logical drive raid configura...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LogicalDrives: """Class to manage redfish hpe oem LogicalDrives data.""" def get_capacity(self): """Get Logical drive capacity :returns: Logical drive capacity or "Not available" :rtype: string""" try: return self.data.CapacityMiB except AttributeError: ret...
the_stack_v2_python_sparse
redfish/oem/hpe.py
bcornec/python-redfish
train
10
1ec2140b0d0d8684d8559ae8d4b5904b19f54611
[ "fields = {}\nfor field_desc in fields_desc:\n field_name, pack_type, field_length = field_desc[:3]\n field_data = fields_stream.read(field_length)\n if len(field_desc) > 3:\n convert_option = field_desc[3]\n if convert_option == 'raw':\n value = field_data\n elif convert_op...
<|body_start_0|> fields = {} for field_desc in fields_desc: field_name, pack_type, field_length = field_desc[:3] field_data = fields_stream.read(field_length) if len(field_desc) > 3: convert_option = field_desc[3] if convert_option == '...
对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds = FieldsSerializer().parse_fields(str_io, filelds_desc)
FieldsSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FieldsSerializer: """对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds = FieldsSerializer().parse_fields(str_...
stack_v2_sparse_classes_36k_train_028615
4,617
no_license
[ { "docstring": "根据字段描述,将流中的字段转化为一个词典 PARAMTERS: fields_stream : 要转换的数据流 fields_desc : 字段描述,对流中数据的描述,用于转换,如下结构 [ (fileld_name, pack_type, field_length, convert_option(可选)), ... ] RETURNS: filelds dict() 转化后的字段", "name": "parse_fields", "signature": "def parse_fields(self, fields_stream, fields_desc)" }...
2
stack_v2_sparse_classes_30k_train_003122
Implement the Python class `FieldsSerializer` described below. Class description: 对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds...
Implement the Python class `FieldsSerializer` described below. Class description: 对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds...
6193e250ce09172f38c6646b1bad0b6b8ed34713
<|skeleton|> class FieldsSerializer: """对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds = FieldsSerializer().parse_fields(str_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FieldsSerializer: """对字段进行序列化和反序列化 Example: a = { "a" : 1, "b" : "abc", "c" : 3 } filelds_desc = [ ("a", "!i", 4), ("b", None, 32, "gb2312"), ("c", "!i", 4,) ] str_io = StringIO() FieldsSerializer().dumps_fields(str_io, a, filelds_desc) str_io.seek(0) fileds = FieldsSerializer().parse_fields(str_io, filelds_d...
the_stack_v2_python_sparse
medusa/utils/fields.py
tangyi1989/game_client
train
1
43ad6498ff3815c9f66c9145e63b5c8a6d23ac5b
[ "super().__init__(items, embeddings)\nself.PAD = pad\nself.UNK = unk", "if word not in self._dict:\n return self.__getitem__(self.UNK)\nreturn super().__getitem__(word)" ]
<|body_start_0|> super().__init__(items, embeddings) self.PAD = pad self.UNK = unk <|end_body_0|> <|body_start_1|> if word not in self._dict: return self.__getitem__(self.UNK) return super().__getitem__(word) <|end_body_1|>
Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token
WordEmbeddings
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WordEmbeddings: """Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token""" def __init__(self, words, embeddings, pad='<pad>', unk='<unk>'): """Initialize word embeddings Args: words (list): Words embeddings...
stack_v2_sparse_classes_36k_train_028616
12,577
permissive
[ { "docstring": "Initialize word embeddings Args: words (list): Words embeddings (ndarray): Word embeddings (vectors) pad (str, optional): Label for the padding token, usually filled in empty places in a string having fewer words than the required sequence length unk (str, optional): Label for the unknown tokens...
2
stack_v2_sparse_classes_30k_train_002393
Implement the Python class `WordEmbeddings` described below. Class description: Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token Method signatures and docstrings: - def __init__(self, words, embeddings, pad='<pad>', unk='<unk>'): Initia...
Implement the Python class `WordEmbeddings` described below. Class description: Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token Method signatures and docstrings: - def __init__(self, words, embeddings, pad='<pad>', unk='<unk>'): Initia...
4b7f027f339d5c4c20d0f215e6c770ce7296069c
<|skeleton|> class WordEmbeddings: """Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token""" def __init__(self, words, embeddings, pad='<pad>', unk='<unk>'): """Initialize word embeddings Args: words (list): Words embeddings...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WordEmbeddings: """Class for collection of word embeddings. Attributes: PAD (str): Label for the padding token UNK (str): Label for the unknown token""" def __init__(self, words, embeddings, pad='<pad>', unk='<unk>'): """Initialize word embeddings Args: words (list): Words embeddings (ndarray): W...
the_stack_v2_python_sparse
core/representations.py
fairhopeweb/pqai
train
0
b1d466989a7d70fa5f42d095e8801aace6a2361c
[ "question = question_services.get_question_by_id(question_id, strict=False)\nif question is None:\n raise self.PageNotFoundException(\"The question with the given id doesn't exist.\")\nassociated_skill_dicts = [skill.to_dict() for skill in skill_services.get_multi_skills(question.linked_skill_ids)]\nself.values....
<|body_start_0|> question = question_services.get_question_by_id(question_id, strict=False) if question is None: raise self.PageNotFoundException("The question with the given id doesn't exist.") associated_skill_dicts = [skill.to_dict() for skill in skill_services.get_multi_skills(qu...
A data handler for questions which supports writing.
EditableQuestionDataHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EditableQuestionDataHandler: """A data handler for questions which supports writing.""" def get(self, question_id): """Gets the data for the question overview page.""" <|body_0|> def put(self, question_id): """Updates properties of the given question.""" ...
stack_v2_sparse_classes_36k_train_028617
7,706
permissive
[ { "docstring": "Gets the data for the question overview page.", "name": "get", "signature": "def get(self, question_id)" }, { "docstring": "Updates properties of the given question.", "name": "put", "signature": "def put(self, question_id)" }, { "docstring": "Handles Delete reque...
3
null
Implement the Python class `EditableQuestionDataHandler` described below. Class description: A data handler for questions which supports writing. Method signatures and docstrings: - def get(self, question_id): Gets the data for the question overview page. - def put(self, question_id): Updates properties of the given ...
Implement the Python class `EditableQuestionDataHandler` described below. Class description: A data handler for questions which supports writing. Method signatures and docstrings: - def get(self, question_id): Gets the data for the question overview page. - def put(self, question_id): Updates properties of the given ...
899b9755a6b795a8991e596055ac24065a8435e0
<|skeleton|> class EditableQuestionDataHandler: """A data handler for questions which supports writing.""" def get(self, question_id): """Gets the data for the question overview page.""" <|body_0|> def put(self, question_id): """Updates properties of the given question.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EditableQuestionDataHandler: """A data handler for questions which supports writing.""" def get(self, question_id): """Gets the data for the question overview page.""" question = question_services.get_question_by_id(question_id, strict=False) if question is None: raise...
the_stack_v2_python_sparse
core/controllers/question_editor.py
import-keshav/oppia
train
4
a478ca2d7f14f8d34aef812294010aa3734eb9cc
[ "ctx = _request_ctx_stack.top\ncurrent_user = ctx.user\nuser = User.get_by_id(current_user.id)\npage = request.args.get('page', 1, type=int)\nreturn response_paginate_accounts(user, page)", "ctx = _request_ctx_stack.top\ncurrent_user = ctx.user\nrequest_body = request.get_json()\nname = request_body.get('name')\n...
<|body_start_0|> ctx = _request_ctx_stack.top current_user = ctx.user user = User.get_by_id(current_user.id) page = request.args.get('page', 1, type=int) return response_paginate_accounts(user, page) <|end_body_0|> <|body_start_1|> ctx = _request_ctx_stack.top cu...
Accounts
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Accounts: def get(self): """@api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authenticated user (10 accounts per page) @apiHeader {String} Authorization Users auth token @apiHeader ...
stack_v2_sparse_classes_36k_train_028618
6,784
no_license
[ { "docstring": "@api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authenticated user (10 accounts per page) @apiHeader {String} Authorization Users auth token @apiHeader {String} Content-Type=\"application/...
2
stack_v2_sparse_classes_30k_train_019568
Implement the Python class `Accounts` described below. Class description: Implement the Accounts class. Method signatures and docstrings: - def get(self): @api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authent...
Implement the Python class `Accounts` described below. Class description: Implement the Accounts class. Method signatures and docstrings: - def get(self): @api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authent...
8640cde9e6c7a8ea7f581dee29ed7fa440a5034a
<|skeleton|> class Accounts: def get(self): """@api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authenticated user (10 accounts per page) @apiHeader {String} Authorization Users auth token @apiHeader ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Accounts: def get(self): """@api {GET} /api/v1/accounts Get all accounts of an user @apiVersion 0.0.1 @apiName GetAllAccounts @apiGroup Accounts @apiDescription Get all accounts of an authenticated user (10 accounts per page) @apiHeader {String} Authorization Users auth token @apiHeader {String} Conte...
the_stack_v2_python_sparse
backend/app/api/v1/account/accounts.py
zinzinhust96/sea_7
train
0
e1f2c067e1b18b0688adaa425b177c218225e8e7
[ "super(Block, self).__init__()\nself.units = units\nself.units_cells = nn.CellList(units)\nself.intermediate = intermediate", "out = feature\nout_intermediate = intermediate\nfor i, cell in enumerate(self.units_cells, 1):\n out = cell(out)\n if self.intermediate is not None and self.intermediate == i:\n ...
<|body_start_0|> super(Block, self).__init__() self.units = units self.units_cells = nn.CellList(units) self.intermediate = intermediate <|end_body_0|> <|body_start_1|> out = feature out_intermediate = intermediate for i, cell in enumerate(self.units_cells, 1): ...
Resnet block consisted of Bottlenecks
Block
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Block: """Resnet block consisted of Bottlenecks""" def __init__(self, units, intermediate=None): """Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermediate value""" <|body_0|> def construct(self, f...
stack_v2_sparse_classes_36k_train_028619
11,719
permissive
[ { "docstring": "Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermediate value", "name": "__init__", "signature": "def __init__(self, units, intermediate=None)" }, { "docstring": "Args: feature: feature intermediate: interm...
2
null
Implement the Python class `Block` described below. Class description: Resnet block consisted of Bottlenecks Method signatures and docstrings: - def __init__(self, units, intermediate=None): Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermedia...
Implement the Python class `Block` described below. Class description: Resnet block consisted of Bottlenecks Method signatures and docstrings: - def __init__(self, units, intermediate=None): Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermedia...
eab643f51336dbf7d711f02d27e6516e5affee59
<|skeleton|> class Block: """Resnet block consisted of Bottlenecks""" def __init__(self, units, intermediate=None): """Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermediate value""" <|body_0|> def construct(self, f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Block: """Resnet block consisted of Bottlenecks""" def __init__(self, units, intermediate=None): """Args: units: Bottlenecks intermediate: if is not None, the result of corresponding Bottlenecks will be returned as a intermediate value""" super(Block, self).__init__() self.units =...
the_stack_v2_python_sparse
research/cv/ArtTrack/src/model/resnet/resnet.py
mindspore-ai/models
train
301
52d70a8f60e2f3eef71df13091f12b87e7f479d0
[ "self.actuatorData = ActuatorData.ActuatorData()\nself.senseHat = SenseHatLedActivator.SenseHatLedActivator()\nself.senseHat.start()", "if sensorType == 'temp':\n if self.actuatorData != actuatorData:\n if actuatorData.getValue() > 0:\n self.senseHat.setEnableLedFlag(True)\n self.s...
<|body_start_0|> self.actuatorData = ActuatorData.ActuatorData() self.senseHat = SenseHatLedActivator.SenseHatLedActivator() self.senseHat.start() <|end_body_0|> <|body_start_1|> if sensorType == 'temp': if self.actuatorData != actuatorData: if actuatorData.g...
Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class
TempActuatorAdaptor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TempActuatorAdaptor: """Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class""" def __init__(self): """Constructor""" <|body_0|> def updateActuator(self, actuatorData, se...
stack_v2_sparse_classes_36k_train_028620
2,670
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "compare actuator data and sensor type received and accordingly show the message on the sensehat LED Matrix", "name": "updateActuator", "signature": "def updateActuator(self, actuatorDat...
2
stack_v2_sparse_classes_30k_train_013870
Implement the Python class `TempActuatorAdaptor` described below. Class description: Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class Method signatures and docstrings: - def __init__(self): Constructor - def updat...
Implement the Python class `TempActuatorAdaptor` described below. Class description: Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class Method signatures and docstrings: - def __init__(self): Constructor - def updat...
660a6f1a4a69eb74a6c9dfb8d972753d4bcd3307
<|skeleton|> class TempActuatorAdaptor: """Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class""" def __init__(self): """Constructor""" <|body_0|> def updateActuator(self, actuatorData, se...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TempActuatorAdaptor: """Actuator emulator, process the actuator data @param actuatorData: instance of actuator data class @param senseHat: instance of SenseHatledActivator class""" def __init__(self): """Constructor""" self.actuatorData = ActuatorData.ActuatorData() self.senseHat ...
the_stack_v2_python_sparse
apps/labs/module05/MultiActuatorAdaptor.py
deepak-lokwani/iot-device
train
2
0e948718d4ff1c8c259ad628234d6de9e65ec1aa
[ "if order.state >= TeamOrder.OrderState.WAIT_BUYER_PAY.value or order.state <= TeamOrder.OrderState.WAIT_PAY_RETURN.value:\n return True\nraise ApiException(422, '订单已支付无需重复支付')", "try:\n order = TeamOrder.select().where(TeamOrder.order_no == order_no).get()\nexcept TeamOrder.DoesNotExist:\n msg = '订单不存在'...
<|body_start_0|> if order.state >= TeamOrder.OrderState.WAIT_BUYER_PAY.value or order.state <= TeamOrder.OrderState.WAIT_PAY_RETURN.value: return True raise ApiException(422, '订单已支付无需重复支付') <|end_body_0|> <|body_start_1|> try: order = TeamOrder.select().where(TeamOrder.o...
TeamOrderCallbackMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TeamOrderCallbackMixin: def check_state(self, order: TeamOrder): """校验订单状态 :param order: :return:""" <|body_0|> def get_order(self, order_no: str) -> Union[TeamOrder, None]: """获取 TeamOrder :param order_no: :return:""" <|body_1|> def _finish_order(self, ...
stack_v2_sparse_classes_36k_train_028621
10,601
no_license
[ { "docstring": "校验订单状态 :param order: :return:", "name": "check_state", "signature": "def check_state(self, order: TeamOrder)" }, { "docstring": "获取 TeamOrder :param order_no: :return:", "name": "get_order", "signature": "def get_order(self, order_no: str) -> Union[TeamOrder, None]" }, ...
3
stack_v2_sparse_classes_30k_test_000320
Implement the Python class `TeamOrderCallbackMixin` described below. Class description: Implement the TeamOrderCallbackMixin class. Method signatures and docstrings: - def check_state(self, order: TeamOrder): 校验订单状态 :param order: :return: - def get_order(self, order_no: str) -> Union[TeamOrder, None]: 获取 TeamOrder :p...
Implement the Python class `TeamOrderCallbackMixin` described below. Class description: Implement the TeamOrderCallbackMixin class. Method signatures and docstrings: - def check_state(self, order: TeamOrder): 校验订单状态 :param order: :return: - def get_order(self, order_no: str) -> Union[TeamOrder, None]: 获取 TeamOrder :p...
49c31d9cce6ca451ff069697913b33fe55028a46
<|skeleton|> class TeamOrderCallbackMixin: def check_state(self, order: TeamOrder): """校验订单状态 :param order: :return:""" <|body_0|> def get_order(self, order_no: str) -> Union[TeamOrder, None]: """获取 TeamOrder :param order_no: :return:""" <|body_1|> def _finish_order(self, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TeamOrderCallbackMixin: def check_state(self, order: TeamOrder): """校验订单状态 :param order: :return:""" if order.state >= TeamOrder.OrderState.WAIT_BUYER_PAY.value or order.state <= TeamOrder.OrderState.WAIT_PAY_RETURN.value: return True raise ApiException(422, '订单已支付无需重复支付') ...
the_stack_v2_python_sparse
PaiDuiGuanJia/yiyun/handlers/rest/order.py
haoweiking/image_tesseract_private
train
0
44456eba309e5b94c27bf629b021840591fb923e
[ "Base.__init__(self, target, opts)\nself.host, self.port, self.scheme, self.path = self._parse_url(self.target)\nreturn", "opts = f'-w {self.target} -S -F -v'\nself._run_tool('spipscan', opts)\nreturn" ]
<|body_start_0|> Base.__init__(self, target, opts) self.host, self.port, self.scheme, self.path = self._parse_url(self.target) return <|end_body_0|> <|body_start_1|> opts = f'-w {self.target} -S -F -v' self._run_tool('spipscan', opts) return <|end_body_1|>
SPIP CMS module
SPIP
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SPIP: """SPIP CMS module""" def __init__(self, target, opts): """init""" <|body_0|> def spipscan(self): """DESCR: Scan SPIP CMS site for installed plugins, themes, possible vulns, etc. (ext) TOOLS: spipscan""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_028622
1,980
no_license
[ { "docstring": "init", "name": "__init__", "signature": "def __init__(self, target, opts)" }, { "docstring": "DESCR: Scan SPIP CMS site for installed plugins, themes, possible vulns, etc. (ext) TOOLS: spipscan", "name": "spipscan", "signature": "def spipscan(self)" } ]
2
stack_v2_sparse_classes_30k_train_012566
Implement the Python class `SPIP` described below. Class description: SPIP CMS module Method signatures and docstrings: - def __init__(self, target, opts): init - def spipscan(self): DESCR: Scan SPIP CMS site for installed plugins, themes, possible vulns, etc. (ext) TOOLS: spipscan
Implement the Python class `SPIP` described below. Class description: SPIP CMS module Method signatures and docstrings: - def __init__(self, target, opts): init - def spipscan(self): DESCR: Scan SPIP CMS site for installed plugins, themes, possible vulns, etc. (ext) TOOLS: spipscan <|skeleton|> class SPIP: """SP...
ddc052c8d7d43a60fc00ea40d85111d5bd7a282e
<|skeleton|> class SPIP: """SPIP CMS module""" def __init__(self, target, opts): """init""" <|body_0|> def spipscan(self): """DESCR: Scan SPIP CMS site for installed plugins, themes, possible vulns, etc. (ext) TOOLS: spipscan""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SPIP: """SPIP CMS module""" def __init__(self, target, opts): """init""" Base.__init__(self, target, opts) self.host, self.port, self.scheme, self.path = self._parse_url(self.target) return def spipscan(self): """DESCR: Scan SPIP CMS site for installed plugins...
the_stack_v2_python_sparse
src/modules/web/spip.py
noptrix/nullscan
train
52
0edde025936976aa089bd6cf642279cdd08c7033
[ "super().__init__()\nself.image = None\nself.name = ''\nself.color = ''\nself.screen = chess_game.screen\nself.x, self.y = (0.0, 0.0)", "self.rect = self.image.get_rect()\nself.rect.topleft = (self.x, self.y)\nself.screen.blit(self.image, self.rect)" ]
<|body_start_0|> super().__init__() self.image = None self.name = '' self.color = '' self.screen = chess_game.screen self.x, self.y = (0.0, 0.0) <|end_body_0|> <|body_start_1|> self.rect = self.image.get_rect() self.rect.topleft = (self.x, self.y) ...
Represents a chess piece.
Piece
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Piece: """Represents a chess piece.""" def __init__(self, chess_game): """Initialize attributes to represent a ches piece.""" <|body_0|> def blitme(self): """Draw the piece at its current location.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_028623
2,009
permissive
[ { "docstring": "Initialize attributes to represent a ches piece.", "name": "__init__", "signature": "def __init__(self, chess_game)" }, { "docstring": "Draw the piece at its current location.", "name": "blitme", "signature": "def blitme(self)" } ]
2
stack_v2_sparse_classes_30k_test_000480
Implement the Python class `Piece` described below. Class description: Represents a chess piece. Method signatures and docstrings: - def __init__(self, chess_game): Initialize attributes to represent a ches piece. - def blitme(self): Draw the piece at its current location.
Implement the Python class `Piece` described below. Class description: Represents a chess piece. Method signatures and docstrings: - def __init__(self, chess_game): Initialize attributes to represent a ches piece. - def blitme(self): Draw the piece at its current location. <|skeleton|> class Piece: """Represents...
2cb4b45dd14a230aa0e800042e893f8dfb23beda
<|skeleton|> class Piece: """Represents a chess piece.""" def __init__(self, chess_game): """Initialize attributes to represent a ches piece.""" <|body_0|> def blitme(self): """Draw the piece at its current location.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Piece: """Represents a chess piece.""" def __init__(self, chess_game): """Initialize attributes to represent a ches piece.""" super().__init__() self.image = None self.name = '' self.color = '' self.screen = chess_game.screen self.x, self.y = (0.0, ...
the_stack_v2_python_sparse
MY_REPOS/Lambda-Resource-Static-Assets/2-resources/BLOG/Python/pcc_2e-master/beyond_pcc/chess_game/chess_set.py
bgoonz/UsefulResourceRepo2.0
train
10
ea8ad6ff1c8eb443684dcf7e4ba8e560c1242348
[ "lender = self.rate_quote_request.get_par_lender(term, amortization)\nscenarios = self.rate_quote_request.get_scenarios(term, amortization)\npar_lender = self.serializer(lender).data\ndata = self.serializer(scenarios, many=True).data\nresults = {'par_lender': par_lender if par_lender else None, 'request_uuid': self...
<|body_start_0|> lender = self.rate_quote_request.get_par_lender(term, amortization) scenarios = self.rate_quote_request.get_scenarios(term, amortization) par_lender = self.serializer(lender).data data = self.serializer(scenarios, many=True).data results = {'par_lender': par_lend...
Returns rate quote request and rate quote view results.
RateQuoteMixin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RateQuoteMixin: """Returns rate quote request and rate quote view results.""" def get_results(self, term=None, amortization=None): """Returns rate quote results. Every result object includes the par_lender and matching scenarios. :param term: str, term :param amortization: str, amort...
stack_v2_sparse_classes_36k_train_028624
14,021
no_license
[ { "docstring": "Returns rate quote results. Every result object includes the par_lender and matching scenarios. :param term: str, term :param amortization: str, amortization :return: rate quotes :rtype: `dict`", "name": "get_results", "signature": "def get_results(self, term=None, amortization=None)" ...
2
stack_v2_sparse_classes_30k_train_006953
Implement the Python class `RateQuoteMixin` described below. Class description: Returns rate quote request and rate quote view results. Method signatures and docstrings: - def get_results(self, term=None, amortization=None): Returns rate quote results. Every result object includes the par_lender and matching scenario...
Implement the Python class `RateQuoteMixin` described below. Class description: Returns rate quote request and rate quote view results. Method signatures and docstrings: - def get_results(self, term=None, amortization=None): Returns rate quote results. Every result object includes the par_lender and matching scenario...
f1a8cd8268d032ea8321e1588e226da09925b7aa
<|skeleton|> class RateQuoteMixin: """Returns rate quote request and rate quote view results.""" def get_results(self, term=None, amortization=None): """Returns rate quote results. Every result object includes the par_lender and matching scenarios. :param term: str, term :param amortization: str, amort...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RateQuoteMixin: """Returns rate quote request and rate quote view results.""" def get_results(self, term=None, amortization=None): """Returns rate quote results. Every result object includes the par_lender and matching scenarios. :param term: str, term :param amortization: str, amortization :retu...
the_stack_v2_python_sparse
website/apps/mortgage_profiles/views.py
protoprojects/worksample
train
0
1707b7899a0068f2ad718b419dfa1dc376813e6a
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')" ]
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
This service manages the permissions of a user on a given customer.
CustomerUserAccessServiceServicer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomerUserAccessServiceServicer: """This service manages the permissions of a user on a given customer.""" def GetCustomerUserAccess(self, request, context): """Returns the CustomerUserAccess in full detail.""" <|body_0|> def MutateCustomerUserAccess(self, request, con...
stack_v2_sparse_classes_36k_train_028625
5,813
permissive
[ { "docstring": "Returns the CustomerUserAccess in full detail.", "name": "GetCustomerUserAccess", "signature": "def GetCustomerUserAccess(self, request, context)" }, { "docstring": "Updates, removes permission of a user on a given customer. Operation statuses are returned.", "name": "MutateC...
2
null
Implement the Python class `CustomerUserAccessServiceServicer` described below. Class description: This service manages the permissions of a user on a given customer. Method signatures and docstrings: - def GetCustomerUserAccess(self, request, context): Returns the CustomerUserAccess in full detail. - def MutateCusto...
Implement the Python class `CustomerUserAccessServiceServicer` described below. Class description: This service manages the permissions of a user on a given customer. Method signatures and docstrings: - def GetCustomerUserAccess(self, request, context): Returns the CustomerUserAccess in full detail. - def MutateCusto...
969eff5b6c3cec59d21191fa178cffb6270074c3
<|skeleton|> class CustomerUserAccessServiceServicer: """This service manages the permissions of a user on a given customer.""" def GetCustomerUserAccess(self, request, context): """Returns the CustomerUserAccess in full detail.""" <|body_0|> def MutateCustomerUserAccess(self, request, con...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomerUserAccessServiceServicer: """This service manages the permissions of a user on a given customer.""" def GetCustomerUserAccess(self, request, context): """Returns the CustomerUserAccess in full detail.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details(...
the_stack_v2_python_sparse
google/ads/google_ads/v6/proto/services/customer_user_access_service_pb2_grpc.py
VincentFritzsche/google-ads-python
train
0
895182bf4dc872bc1378bc6a4ea8d07eb5023930
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn DocumentSetContent()", "from .content_type_info import ContentTypeInfo\nfrom .content_type_info import ContentTypeInfo\nfields: Dict[str, Callable[[Any], None]] = {'contentType': lambda n: setattr(self, 'content_type', n.get_object_val...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return DocumentSetContent() <|end_body_0|> <|body_start_1|> from .content_type_info import ContentTypeInfo from .content_type_info import ContentTypeInfo fields: Dict[str, Callable[[Any...
DocumentSetContent
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DocumentSetContent: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DocumentSetContent: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the obje...
stack_v2_sparse_classes_36k_train_028626
3,285
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: DocumentSetContent", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_...
3
null
Implement the Python class `DocumentSetContent` described below. Class description: Implement the DocumentSetContent class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DocumentSetContent: Creates a new instance of the appropriate class based on disc...
Implement the Python class `DocumentSetContent` described below. Class description: Implement the DocumentSetContent class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DocumentSetContent: Creates a new instance of the appropriate class based on disc...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class DocumentSetContent: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DocumentSetContent: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the obje...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DocumentSetContent: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DocumentSetContent: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: Do...
the_stack_v2_python_sparse
msgraph/generated/models/document_set_content.py
microsoftgraph/msgraph-sdk-python
train
135
6b914d2d05aa8965de3cb9676c420d51a2758717
[ "super().__init__(*args, **kwargs)\nself.full_model_name = full_model_name\nself.app_name, self.related_model_name = full_model_name.split('.')\nself.label = full_model_name\nself.known_models = RegisteredModels()", "if isinstance(value, Model):\n return value\nif isinstance(value, int):\n model_class = sel...
<|body_start_0|> super().__init__(*args, **kwargs) self.full_model_name = full_model_name self.app_name, self.related_model_name = full_model_name.split('.') self.label = full_model_name self.known_models = RegisteredModels() <|end_body_0|> <|body_start_1|> if isinstance...
Field representing a model. ForeignKey relation is modeled with this field.
ModelField
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ModelField: """Field representing a model. ForeignKey relation is modeled with this field.""" def __init__(self, full_model_name: str, *args, **kwargs): """Initialize.""" <|body_0|> def to_python(self, value): """Return the python object representing the field.""...
stack_v2_sparse_classes_36k_train_028627
19,131
permissive
[ { "docstring": "Initialize.", "name": "__init__", "signature": "def __init__(self, full_model_name: str, *args, **kwargs)" }, { "docstring": "Return the python object representing the field.", "name": "to_python", "signature": "def to_python(self, value)" }, { "docstring": "Conve...
3
stack_v2_sparse_classes_30k_val_001019
Implement the Python class `ModelField` described below. Class description: Field representing a model. ForeignKey relation is modeled with this field. Method signatures and docstrings: - def __init__(self, full_model_name: str, *args, **kwargs): Initialize. - def to_python(self, value): Return the python object repr...
Implement the Python class `ModelField` described below. Class description: Field representing a model. ForeignKey relation is modeled with this field. Method signatures and docstrings: - def __init__(self, full_model_name: str, *args, **kwargs): Initialize. - def to_python(self, value): Return the python object repr...
25c0c45235ef37beb45c1af4c917fbbae6282016
<|skeleton|> class ModelField: """Field representing a model. ForeignKey relation is modeled with this field.""" def __init__(self, full_model_name: str, *args, **kwargs): """Initialize.""" <|body_0|> def to_python(self, value): """Return the python object representing the field.""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ModelField: """Field representing a model. ForeignKey relation is modeled with this field.""" def __init__(self, full_model_name: str, *args, **kwargs): """Initialize.""" super().__init__(*args, **kwargs) self.full_model_name = full_model_name self.app_name, self.related_m...
the_stack_v2_python_sparse
resolwe/process/models.py
genialis/resolwe
train
35
dd37921bff2b13e5679212df0e0548c519441e6a
[ "display_session = self.kwargs.get('display_session', None)\ndisplay_date = self.kwargs.get('display_date', None)\nsessions = decide_session(sess=display_session, display_date=display_date)\nself.kwargs['sessions'] = sessions\nq = self.model.objects.filter(classoffer__session__in=sessions)\nq = q.order_by(*self.que...
<|body_start_0|> display_session = self.kwargs.get('display_session', None) display_date = self.kwargs.get('display_date', None) sessions = decide_session(sess=display_session, display_date=display_date) self.kwargs['sessions'] = sessions q = self.model.objects.filter(classoffer_...
This is a report for which students are in which classes.
Checkin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Checkin: """This is a report for which students are in which classes.""" def get_queryset(self): """List all the students from all the classes sorted according to the class property query_order_by. Student list should be grouped in days, then in start_time order, and then alphabetica...
stack_v2_sparse_classes_36k_train_028628
26,158
no_license
[ { "docstring": "List all the students from all the classes sorted according to the class property query_order_by. Student list should be grouped in days, then in start_time order, and then alphabetical first name.", "name": "get_queryset", "signature": "def get_queryset(self)" }, { "docstring": ...
2
stack_v2_sparse_classes_30k_train_010592
Implement the Python class `Checkin` described below. Class description: This is a report for which students are in which classes. Method signatures and docstrings: - def get_queryset(self): List all the students from all the classes sorted according to the class property query_order_by. Student list should be groupe...
Implement the Python class `Checkin` described below. Class description: This is a report for which students are in which classes. Method signatures and docstrings: - def get_queryset(self): List all the students from all the classes sorted according to the class property query_order_by. Student list should be groupe...
cd03dbbc45e2337464f5d2a41aafaccd658dc662
<|skeleton|> class Checkin: """This is a report for which students are in which classes.""" def get_queryset(self): """List all the students from all the classes sorted according to the class property query_order_by. Student list should be grouped in days, then in start_time order, and then alphabetica...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Checkin: """This is a report for which students are in which classes.""" def get_queryset(self): """List all the students from all the classes sorted according to the class property query_order_by. Student list should be grouped in days, then in start_time order, and then alphabetical first name....
the_stack_v2_python_sparse
web/classwork/views.py
SeattleChris/hepcat
train
2
a2e0ba27220fbd9824b88068a36f8662ab20da74
[ "processed_dict = {}\nfor key, value in request.GET.items():\n processed_dict[key] = value\nsign = processed_dict.pop('sign', None)\nalipay = AliPay(appid='2016091700530193', app_notify_url='http://123.206.43.75:8080/alipay/return/', app_private_key_path=private_key_path, alipay_public_key_path=ali_pub_key_path,...
<|body_start_0|> processed_dict = {} for key, value in request.GET.items(): processed_dict[key] = value sign = processed_dict.pop('sign', None) alipay = AliPay(appid='2016091700530193', app_notify_url='http://123.206.43.75:8080/alipay/return/', app_private_key_path=private_ke...
AlipayView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlipayView: def get(self, request): """处理支付宝的return_url的返回 :param request: :return:""" <|body_0|> def post(self, request): """处理支付宝的notify_url :param request: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> processed_dict = {} for k...
stack_v2_sparse_classes_36k_train_028629
6,503
no_license
[ { "docstring": "处理支付宝的return_url的返回 :param request: :return:", "name": "get", "signature": "def get(self, request)" }, { "docstring": "处理支付宝的notify_url :param request: :return:", "name": "post", "signature": "def post(self, request)" } ]
2
null
Implement the Python class `AlipayView` described below. Class description: Implement the AlipayView class. Method signatures and docstrings: - def get(self, request): 处理支付宝的return_url的返回 :param request: :return: - def post(self, request): 处理支付宝的notify_url :param request: :return:
Implement the Python class `AlipayView` described below. Class description: Implement the AlipayView class. Method signatures and docstrings: - def get(self, request): 处理支付宝的return_url的返回 :param request: :return: - def post(self, request): 处理支付宝的notify_url :param request: :return: <|skeleton|> class AlipayView: ...
4447903730466ef88442c3019c33a4117544c2a1
<|skeleton|> class AlipayView: def get(self, request): """处理支付宝的return_url的返回 :param request: :return:""" <|body_0|> def post(self, request): """处理支付宝的notify_url :param request: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AlipayView: def get(self, request): """处理支付宝的return_url的返回 :param request: :return:""" processed_dict = {} for key, value in request.GET.items(): processed_dict[key] = value sign = processed_dict.pop('sign', None) alipay = AliPay(appid='2016091700530193', ap...
the_stack_v2_python_sparse
python/restframework项目/apps/trade/views.py
neverqaz/code
train
1
2e9a3a07b7d32bbe35ad945ef2f107fac83a362a
[ "source_map = defaultdict(lambda: 'USD')\ncost_models = CostModel.objects.all().values('uuid', 'currency').distinct()\ncm_to_currency = {row['uuid']: row['currency'] for row in cost_models}\nmapping = CostModelMap.objects.all().values('provider_uuid', 'cost_model_id')\nsource_map |= {row['provider_uuid']: cm_to_cur...
<|body_start_0|> source_map = defaultdict(lambda: 'USD') cost_models = CostModel.objects.all().values('uuid', 'currency').distinct() cm_to_currency = {row['uuid']: row['currency'] for row in cost_models} mapping = CostModelMap.objects.all().values('provider_uuid', 'cost_model_id') ...
OCP forecasting class.
OCPForecast
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OCPForecast: """OCP forecasting class.""" def source_to_currency_map(self): """OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency. returns: dict: {source_uuid: currency}""" <|body...
stack_v2_sparse_classes_36k_train_028630
26,653
permissive
[ { "docstring": "OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency. returns: dict: {source_uuid: currency}", "name": "source_to_currency_map", "signature": "def source_to_currency_map(self)" }, { "do...
2
stack_v2_sparse_classes_30k_train_004364
Implement the Python class `OCPForecast` described below. Class description: OCP forecasting class. Method signatures and docstrings: - def source_to_currency_map(self): OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency....
Implement the Python class `OCPForecast` described below. Class description: OCP forecasting class. Method signatures and docstrings: - def source_to_currency_map(self): OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency....
0416e5216eb1ec4b41c8dd4999adde218b1ab2e1
<|skeleton|> class OCPForecast: """OCP forecasting class.""" def source_to_currency_map(self): """OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency. returns: dict: {source_uuid: currency}""" <|body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OCPForecast: """OCP forecasting class.""" def source_to_currency_map(self): """OCP sources do not have costs associated, so we need to grab the base currency from the cost model, and create a mapping of source_uuid to currency. returns: dict: {source_uuid: currency}""" source_map = defaul...
the_stack_v2_python_sparse
koku/forecast/forecast.py
project-koku/koku
train
225
f0bad99e0ba3078c8a58181b37bc0a097170e001
[ "self.modis_id = modis_id\nself.variable_list = variable_list\nself.start_date = start_date\nself.end_date = end_date\nself.daynightboth = daynightboth\nself.grid = grid\nself.grid_fill = grid_fill\nself.use_long_name = use_long_name\nif modis_platform.lower() == 'terra':\n self.modis_platform = 'MOD'\nelif modi...
<|body_start_0|> self.modis_id = modis_id self.variable_list = variable_list self.start_date = start_date self.end_date = end_date self.daynightboth = daynightboth self.grid = grid self.grid_fill = grid_fill self.use_long_name = use_long_name if mo...
Data Fetcher for MODIS data
DataFetcher
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataFetcher: """Data Fetcher for MODIS data""" def __init__(self, ap_paramList, modis_platform, modis_id, variable_list, start_date, end_date, daynightboth='D', grid=None, grid_fill=np.nan, use_long_name=False): """Construct Data Fetcher object @param ap_paramList[lat]: Search latitu...
stack_v2_sparse_classes_36k_train_028631
4,630
permissive
[ { "docstring": "Construct Data Fetcher object @param ap_paramList[lat]: Search latitude @param ap_paramList[lon]: Search longitude @param modis_platform: Platform (Either \"Terra\" or \"Aqua\") @param modis_id: Product string (e.g. '06_L2') @param variable_list: List of variables to fetch @param start_date: Sta...
2
stack_v2_sparse_classes_30k_train_015364
Implement the Python class `DataFetcher` described below. Class description: Data Fetcher for MODIS data Method signatures and docstrings: - def __init__(self, ap_paramList, modis_platform, modis_id, variable_list, start_date, end_date, daynightboth='D', grid=None, grid_fill=np.nan, use_long_name=False): Construct Da...
Implement the Python class `DataFetcher` described below. Class description: Data Fetcher for MODIS data Method signatures and docstrings: - def __init__(self, ap_paramList, modis_platform, modis_id, variable_list, start_date, end_date, daynightboth='D', grid=None, grid_fill=np.nan, use_long_name=False): Construct Da...
935bfd54149abd9542fe38e77b7eabab48b1c3a1
<|skeleton|> class DataFetcher: """Data Fetcher for MODIS data""" def __init__(self, ap_paramList, modis_platform, modis_id, variable_list, start_date, end_date, daynightboth='D', grid=None, grid_fill=np.nan, use_long_name=False): """Construct Data Fetcher object @param ap_paramList[lat]: Search latitu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DataFetcher: """Data Fetcher for MODIS data""" def __init__(self, ap_paramList, modis_platform, modis_id, variable_list, start_date, end_date, daynightboth='D', grid=None, grid_fill=np.nan, use_long_name=False): """Construct Data Fetcher object @param ap_paramList[lat]: Search latitude @param ap_...
the_stack_v2_python_sparse
skdaccess/geo/modis/stream/data_fetcher.py
MITHaystack/scikit-dataaccess
train
41
fe1cc95e1389adb73dd967b81a4e4041d0e6fa9a
[ "super(MixedLoss, self).__init__(mode)\nif not isinstance(losses, list):\n raise TypeError('`losses` must be a list!')\nif not isinstance(coef, list):\n raise TypeError('`coef` must be a list!')\nlen_losses = len(losses)\nlen_coef = len(coef)\nif len_losses != len_coef:\n raise ValueError('The length of `l...
<|body_start_0|> super(MixedLoss, self).__init__(mode) if not isinstance(losses, list): raise TypeError('`losses` must be a list!') if not isinstance(coef, list): raise TypeError('`coef` must be a list!') len_losses = len(losses) len_coef = len(coef) ...
Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting coefficient of multiple loss Returns: A callable object of MixedLoss.
MixedLoss
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MixedLoss: """Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting coefficient of multiple loss Returns: ...
stack_v2_sparse_classes_36k_train_028632
2,624
permissive
[ { "docstring": "init", "name": "__init__", "signature": "def __init__(self, mode, losses, coef)" }, { "docstring": "分类", "name": "__clas__", "signature": "def __clas__(self, logits, labels, info=None)" }, { "docstring": "分割", "name": "__seg__", "signature": "def __seg__(s...
3
stack_v2_sparse_classes_30k_train_000338
Implement the Python class `MixedLoss` described below. Class description: Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting...
Implement the Python class `MixedLoss` described below. Class description: Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting...
f3932a934404899249f80098134df4b2d24e7d4e
<|skeleton|> class MixedLoss: """Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting coefficient of multiple loss Returns: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MixedLoss: """Weighted computations for multiple Loss. The advantage is that mixed loss training can be achieved without changing the networking code. Args: losses (list[nn.Layer]): A list consisting of multiple loss classes coef (list[float|int]): Weighting coefficient of multiple loss Returns: A callable ob...
the_stack_v2_python_sparse
CV/Effective Transformer-based Solution for RSNA Intracranial Hemorrhage Detection/easymia/optimizer/losses/mixed_loss.py
Weili-NLP/Research
train
0
76eb0249b1a88019a1a5036f28eec7bfb4b8620a
[ "if len(sequence) <= 1:\n return sequence\nelse:\n pivot = sequence.pop()\nlesser = []\ngreater = []\nfor item in sequence:\n if item > pivot:\n greater.append(item)\n else:\n lesser.append(item)\nreturn self.quick_sort(lesser) + [pivot] + self.quick_sort(greater)", "sequence = []\nnode ...
<|body_start_0|> if len(sequence) <= 1: return sequence else: pivot = sequence.pop() lesser = [] greater = [] for item in sequence: if item > pivot: greater.append(item) else: lesser.append(item) ...
LinkedListSort object extends the base LinkedList class
LinkedListQuickSort
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinkedListQuickSort: """LinkedListSort object extends the base LinkedList class""" def quick_sort(self, sequence): """recursive quicksort method""" <|body_0|> def sort(self): """this method converts the linked list into a python list object to pass into the quick...
stack_v2_sparse_classes_36k_train_028633
2,182
no_license
[ { "docstring": "recursive quicksort method", "name": "quick_sort", "signature": "def quick_sort(self, sequence)" }, { "docstring": "this method converts the linked list into a python list object to pass into the quicksort recursive method and then rewrites the data on the linked list in the now ...
2
stack_v2_sparse_classes_30k_train_002809
Implement the Python class `LinkedListQuickSort` described below. Class description: LinkedListSort object extends the base LinkedList class Method signatures and docstrings: - def quick_sort(self, sequence): recursive quicksort method - def sort(self): this method converts the linked list into a python list object t...
Implement the Python class `LinkedListQuickSort` described below. Class description: LinkedListSort object extends the base LinkedList class Method signatures and docstrings: - def quick_sort(self, sequence): recursive quicksort method - def sort(self): this method converts the linked list into a python list object t...
b24eeb751d6238d5ac2075c47469aa8548440c8d
<|skeleton|> class LinkedListQuickSort: """LinkedListSort object extends the base LinkedList class""" def quick_sort(self, sequence): """recursive quicksort method""" <|body_0|> def sort(self): """this method converts the linked list into a python list object to pass into the quick...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinkedListQuickSort: """LinkedListSort object extends the base LinkedList class""" def quick_sort(self, sequence): """recursive quicksort method""" if len(sequence) <= 1: return sequence else: pivot = sequence.pop() lesser = [] greater = [] ...
the_stack_v2_python_sparse
code-samples/python/linked_lists/quicksort.py
dlenwell/interview-prep-notes
train
0
8955e4d760170830be988301c685e4bfab43c91c
[ "params = kwarg['params']\ncmd = 'if{} '.format(command)\nif 'options' in params:\n cmd += '{} '.format(params['options'])\nif 'exclude_iface' in params:\n for e in params['exclude_iface']:\n cmd += '-X {} '.format(e)\nif 'force' in params and params['force']:\n cmd += '-f '\nif 'iface' in params:\n...
<|body_start_0|> params = kwarg['params'] cmd = 'if{} '.format(command) if 'options' in params: cmd += '{} '.format(params['options']) if 'exclude_iface' in params: for e in params['exclude_iface']: cmd += '-X {} '.format(e) if 'force' in p...
ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration
LinuxInterfaceImpl
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinuxInterfaceImpl: """ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration""" def format_up_down(self, command, *argv, **k...
stack_v2_sparse_classes_36k_train_028634
5,487
permissive
[ { "docstring": "ifup [-h] [-a] [-v] [-d] [--allow CLASS] [--with-depends] [-X EXCLUDEPATS] [-f] [-n] [-s] [--print-dependency {list,dot}] [IFACE [IFACE ...]] positional arguments: IFACE interface list separated by spaces. IFACE list and '-a' argument are mutually exclusive. optional arguments: -a, --all process...
3
stack_v2_sparse_classes_30k_train_015013
Implement the Python class `LinuxInterfaceImpl` described below. Class description: ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration Method signa...
Implement the Python class `LinuxInterfaceImpl` described below. Class description: ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration Method signa...
e4c8221e18cd94e7424c30e12eb0fb82f7767267
<|skeleton|> class LinuxInterfaceImpl: """ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration""" def format_up_down(self, command, *argv, **k...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinuxInterfaceImpl: """ifupdown - network interface management commands ifup - bring a network interface up ifdown - take a network interface down ifquery - query network interface configuration ifreload - reload network interface configuration""" def format_up_down(self, command, *argv, **kwarg): ...
the_stack_v2_python_sparse
Amazon_Framework/DentOsTestbedLib/src/dent_os_testbed/lib/interfaces/linux/linux_interface_impl.py
tld3daniel/testing
train
0
93b29bf2d107f9c98747df3513335765abdf702a
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn UserSimulationDetails()", "from .attack_simulation_user import AttackSimulationUser\nfrom .user_simulation_event_info import UserSimulationEventInfo\nfrom .user_training_event_info import UserTrainingEventInfo\nfrom .attack_simulation_...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return UserSimulationDetails() <|end_body_0|> <|body_start_1|> from .attack_simulation_user import AttackSimulationUser from .user_simulation_event_info import UserSimulationEventInfo f...
UserSimulationDetails
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserSimulationDetails: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UserSimulationDetails: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
stack_v2_sparse_classes_36k_train_028635
6,089
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: UserSimulationDetails", "name": "create_from_discriminator_value", "signature": "def create_from_discriminat...
3
null
Implement the Python class `UserSimulationDetails` described below. Class description: Implement the UserSimulationDetails class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UserSimulationDetails: Creates a new instance of the appropriate class base...
Implement the Python class `UserSimulationDetails` described below. Class description: Implement the UserSimulationDetails class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UserSimulationDetails: Creates a new instance of the appropriate class base...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class UserSimulationDetails: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UserSimulationDetails: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserSimulationDetails: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> UserSimulationDetails: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Retur...
the_stack_v2_python_sparse
msgraph/generated/models/user_simulation_details.py
microsoftgraph/msgraph-sdk-python
train
135
aa4c911080a2b16c3b1ca2ff1c583e5a7b4a32a6
[ "nums.sort()\nn = len(nums)\nresidual = float('inf')\nfor i in range(n - 2):\n j = i + 1\n k = n - 1\n while j < k:\n if nums[i] + nums[j] + nums[k] > target:\n new_residual = abs(nums[i] + nums[j] + nums[k] - target)\n if new_residual < residual:\n residual = ne...
<|body_start_0|> nums.sort() n = len(nums) residual = float('inf') for i in range(n - 2): j = i + 1 k = n - 1 while j < k: if nums[i] + nums[j] + nums[k] > target: new_residual = abs(nums[i] + nums[j] + nums[k] - tar...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def threeSumClosest(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def threeSumClosest1(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_st...
stack_v2_sparse_classes_36k_train_028636
2,553
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "threeSumClosest", "signature": "def threeSumClosest(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "threeSumClosest1", "signature": "def threeSumClosest1(...
2
stack_v2_sparse_classes_30k_val_000733
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSumClosest(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def threeSumClosest1(self, nums, target): :type nums: List[int] :type target: int :...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSumClosest(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def threeSumClosest1(self, nums, target): :type nums: List[int] :type target: int :...
c55b0cfd2967a2221c27ed738e8de15034775945
<|skeleton|> class Solution: def threeSumClosest(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def threeSumClosest1(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def threeSumClosest(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" nums.sort() n = len(nums) residual = float('inf') for i in range(n - 2): j = i + 1 k = n - 1 while j < k: if ...
the_stack_v2_python_sparse
PycharmProjects/leetcode/Find/16最接近的三数之和.py
crystal30/DataStructure
train
0
ae655e6d2331210a2a9fe58cfced49745b925ace
[ "for path in sys.path:\n if path.endswith('categories'):\n _category_dir = path\n elif path.endswith('model'):\n _config_path = os.path.join(path, 'config.xml')\n_found_cats = self._scan_model(_category_dir)\n_order = self._read_configs(_config_path)\nself.cats_container = self._instantiate_cats...
<|body_start_0|> for path in sys.path: if path.endswith('categories'): _category_dir = path elif path.endswith('model'): _config_path = os.path.join(path, 'config.xml') _found_cats = self._scan_model(_category_dir) _order = self._read_confi...
ExtensionLoader
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ExtensionLoader: def __init__(self): """public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for categories | *_config_path*: a path to config.xml | *_found_cats*: a list of category paths | *_order*: a li...
stack_v2_sparse_classes_36k_train_028637
4,765
permissive
[ { "docstring": "public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for categories | *_config_path*: a path to config.xml | *_found_cats*: a list of category paths | *_order*: a list of available categories taken from config Ret...
4
null
Implement the Python class `ExtensionLoader` described below. Class description: Implement the ExtensionLoader class. Method signatures and docstrings: - def __init__(self): public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for cate...
Implement the Python class `ExtensionLoader` described below. Class description: Implement the ExtensionLoader class. Method signatures and docstrings: - def __init__(self): public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for cate...
0dc9becc09da22af3edac90b81b1dd9b1f44fd5b
<|skeleton|> class ExtensionLoader: def __init__(self): """public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for categories | *_config_path*: a path to config.xml | *_found_cats*: a list of category paths | *_order*: a li...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ExtensionLoader: def __init__(self): """public Attributes: | *cats_container*: a dict with Category names and instances private Attributes: | *_category_dir*: a directory path for categories | *_config_path*: a path to config.xml | *_found_cats*: a list of category paths | *_order*: a list of availabl...
the_stack_v2_python_sparse
nefi2/model/ext_loader.py
andreasfirczynski/NetworkExtractionFromImages
train
0
5515edd6251b34dee0b3e9c86d49f33b64eda1c1
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn DelegatedPermissionClassification()", "from .entity import Entity\nfrom .permission_classification_type import PermissionClassificationType\nfrom .entity import Entity\nfrom .permission_classification_type import PermissionClassificati...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return DelegatedPermissionClassification() <|end_body_0|> <|body_start_1|> from .entity import Entity from .permission_classification_type import PermissionClassificationType from .enti...
DelegatedPermissionClassification
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DelegatedPermissionClassification: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DelegatedPermissionClassification: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discrimin...
stack_v2_sparse_classes_36k_train_028638
3,149
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: DelegatedPermissionClassification", "name": "create_from_discriminator_value", "signature": "def create_from...
3
null
Implement the Python class `DelegatedPermissionClassification` described below. Class description: Implement the DelegatedPermissionClassification class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DelegatedPermissionClassification: Creates a new in...
Implement the Python class `DelegatedPermissionClassification` described below. Class description: Implement the DelegatedPermissionClassification class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DelegatedPermissionClassification: Creates a new in...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class DelegatedPermissionClassification: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DelegatedPermissionClassification: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discrimin...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DelegatedPermissionClassification: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DelegatedPermissionClassification: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and...
the_stack_v2_python_sparse
msgraph/generated/models/delegated_permission_classification.py
microsoftgraph/msgraph-sdk-python
train
135
9654ec15c2865b73528d6169c39f6580b43deb0d
[ "self.available_filters = {}\nself.available_filters['leet'] = LeetFilter()\nself.available_filters['robber'] = RobberFilter()", "if args == None or args == '' or len(args.split(' ')) < 2:\n return 'Insufficient information, please check help.'\nlanguage = args.split(' ')[0].lower()\ntext = ' '.join(args.split...
<|body_start_0|> self.available_filters = {} self.available_filters['leet'] = LeetFilter() self.available_filters['robber'] = RobberFilter() <|end_body_0|> <|body_start_1|> if args == None or args == '' or len(args.split(' ')) < 2: return 'Insufficient information, please ch...
A plugin to filter text.
Filter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Filter: """A plugin to filter text.""" def _on_register(self): """Register available filters.""" <|body_0|> def handle_filter(self, command, args, msg): """Parses the text through a filter""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.ava...
stack_v2_sparse_classes_36k_train_028639
4,266
permissive
[ { "docstring": "Register available filters.", "name": "_on_register", "signature": "def _on_register(self)" }, { "docstring": "Parses the text through a filter", "name": "handle_filter", "signature": "def handle_filter(self, command, args, msg)" } ]
2
stack_v2_sparse_classes_30k_train_008136
Implement the Python class `Filter` described below. Class description: A plugin to filter text. Method signatures and docstrings: - def _on_register(self): Register available filters. - def handle_filter(self, command, args, msg): Parses the text through a filter
Implement the Python class `Filter` described below. Class description: A plugin to filter text. Method signatures and docstrings: - def _on_register(self): Register available filters. - def handle_filter(self, command, args, msg): Parses the text through a filter <|skeleton|> class Filter: """A plugin to filter...
6690cc9f644d5b0c9f8eb6e3540eea336ed61847
<|skeleton|> class Filter: """A plugin to filter text.""" def _on_register(self): """Register available filters.""" <|body_0|> def handle_filter(self, command, args, msg): """Parses the text through a filter""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Filter: """A plugin to filter text.""" def _on_register(self): """Register available filters.""" self.available_filters = {} self.available_filters['leet'] = LeetFilter() self.available_filters['robber'] = RobberFilter() def handle_filter(self, command, args, msg): ...
the_stack_v2_python_sparse
sleekbot/plugins/filter.py
hgrecco/SleekBot
train
2
2190faf1dba8c9a34582b93824a41e8f7d5c099b
[ "self.nodes = nodes\nself.dist = dist\nself.size = size\nself.blacklist = blacklist", "for node in self.nodes:\n if self.blacklist and node.is_in(self.blacklist):\n continue\n yield node", "candidates = deque()\nprev = None\nnode_count = 0\nfor node in self.filter_nodes():\n node_count += 1\n ...
<|body_start_0|> self.nodes = nodes self.dist = dist self.size = size self.blacklist = blacklist <|end_body_0|> <|body_start_1|> for node in self.nodes: if self.blacklist and node.is_in(self.blacklist): continue yield node <|end_body_1|> ...
GenomeSLINK
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GenomeSLINK: def __init__(self, nodes, dist, size=1, blacklist=None): """Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNodes sorted by chrA, posA dist : int Maximum clustering distance. size : int Minimum cluster size. Re...
stack_v2_sparse_classes_36k_train_028640
8,944
no_license
[ { "docstring": "Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNodes sorted by chrA, posA dist : int Maximum clustering distance. size : int Minimum cluster size. Recommended to use 1 for call/variant clustering, scale up for read pair clustering...
5
stack_v2_sparse_classes_30k_train_014777
Implement the Python class `GenomeSLINK` described below. Class description: Implement the GenomeSLINK class. Method signatures and docstrings: - def __init__(self, nodes, dist, size=1, blacklist=None): Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNo...
Implement the Python class `GenomeSLINK` described below. Class description: Implement the GenomeSLINK class. Method signatures and docstrings: - def __init__(self, nodes, dist, size=1, blacklist=None): Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNo...
3214cac465ee46e531c3cf5d78258b7aba4319a4
<|skeleton|> class GenomeSLINK: def __init__(self, nodes, dist, size=1, blacklist=None): """Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNodes sorted by chrA, posA dist : int Maximum clustering distance. size : int Minimum cluster size. Re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GenomeSLINK: def __init__(self, nodes, dist, size=1, blacklist=None): """Graph-based single-linkage clustering of genomic coordinates. Parameters ---------- nodes : iterable of GSNode GSNodes sorted by chrA, posA dist : int Maximum clustering distance. size : int Minimum cluster size. Recommended to u...
the_stack_v2_python_sparse
svtk/genomeslink.py
xuefzhao/svtk
train
2
4022a86d614484bafe7548750f4e12f6a51dd300
[ "try:\n self.key = RSA.import_key(private_key)\n self.cipher = PKCS1_OAEP.new(self.key)\n self.signer = pkcs1_15.new(self.key)\nexcept (ValueError, TypeError):\n print('导入私钥出错: %s' % private_key)", "signature = None\ntry:\n result = self.cipher.decrypt(msg)\nexcept (ValueError, TypeError):\n res...
<|body_start_0|> try: self.key = RSA.import_key(private_key) self.cipher = PKCS1_OAEP.new(self.key) self.signer = pkcs1_15.new(self.key) except (ValueError, TypeError): print('导入私钥出错: %s' % private_key) <|end_body_0|> <|body_start_1|> signature = ...
这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。
PrivateCipher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrivateCipher: """这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。""" def __init__(self, private_key: bytes): """根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。""" <|body_0|> def decrypt_sign_message(self, msg: bytes)...
stack_v2_sparse_classes_36k_train_028641
3,452
no_license
[ { "docstring": "根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。", "name": "__init__", "signature": "def __init__(self, private_key: bytes)" }, { "docstring": "对收到的msg用私钥进行解密,同时用私钥对解密后的信息进行数字签名。 @param msg: 需要解密的信息。 @returns: (解密后的信息,数字签名信息)", "name": "decrypt_sign_message", "...
2
stack_v2_sparse_classes_30k_train_020240
Implement the Python class `PrivateCipher` described below. Class description: 这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。 Method signatures and docstrings: - def __init__(self, private_key: bytes): 根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。 - def decryp...
Implement the Python class `PrivateCipher` described below. Class description: 这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。 Method signatures and docstrings: - def __init__(self, private_key: bytes): 根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。 - def decryp...
8e012855cce61fb53437758021416e5f6deb02ea
<|skeleton|> class PrivateCipher: """这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。""" def __init__(self, private_key: bytes): """根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。""" <|body_0|> def decrypt_sign_message(self, msg: bytes)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PrivateCipher: """这个类包含对应的私钥创建的cipher,包含用私钥对信息进行解密和用私钥对信息进行签名的功能。 一般来讲,这部分应该是在服务器端处调用,用私钥解密收到的信息和对返回的信息进行签名。""" def __init__(self, private_key: bytes): """根据提供的private_key初始化PrivateCipher. @param private_key: 私钥输入。""" try: self.key = RSA.import_key(private_key) sel...
the_stack_v2_python_sparse
DEMO/auth_server/authantication/cipher.py
hanhiver/PythonBasic
train
0
23ebb021b8f9ecc032743cc21fdfdb1d39e6db0e
[ "if not email:\n raise ValueError(_('The Email must be set'))\nemail = self.normalize_email(email)\nuser = self.model(email=email, **extra_fields)\nuser.set_password(password)\nuser.save()\nreturn user", "extra_fields.setdefault('is_staff', True)\nextra_fields.setdefault('is_superuser', True)\nextra_fields.set...
<|body_start_0|> if not email: raise ValueError(_('The Email must be set')) email = self.normalize_email(email) user = self.model(email=email, **extra_fields) user.set_password(password) user.save() return user <|end_body_0|> <|body_start_1|> extra_fi...
Custom user model manager where email is the unique identifiers for authentication instead of usernames.
CustomUserManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Cate and save a User with the given email and password.""" <|body_0|> def create_s...
stack_v2_sparse_classes_36k_train_028642
4,083
permissive
[ { "docstring": "Cate and save a User with the given email and password.", "name": "create_user", "signature": "def create_user(self, email, password, **extra_fields)" }, { "docstring": "Create and save a SuperUser with the given email and password.", "name": "create_superuser", "signatur...
2
stack_v2_sparse_classes_30k_train_007716
Implement the Python class `CustomUserManager` described below. Class description: Custom user model manager where email is the unique identifiers for authentication instead of usernames. Method signatures and docstrings: - def create_user(self, email, password, **extra_fields): Cate and save a User with the given em...
Implement the Python class `CustomUserManager` described below. Class description: Custom user model manager where email is the unique identifiers for authentication instead of usernames. Method signatures and docstrings: - def create_user(self, email, password, **extra_fields): Cate and save a User with the given em...
6fc70264f3eb848582b765247c9900dbfa4f0693
<|skeleton|> class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Cate and save a User with the given email and password.""" <|body_0|> def create_s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Cate and save a User with the given email and password.""" if not email: raise ValueErro...
the_stack_v2_python_sparse
backend/models.py
sorinburghiu2323/Conffiliate
train
2
6eda2f8fd265f2ddc4a318ae10980feba688cc61
[ "self._toc_node = node\nself._toc_limit = limit\nself._toc_level = level", "if name.startswith('_toc_'):\n return object.__getattribute__(self, name)\nif name in ['tableofcontents', 'fulltableofcontents']:\n if self._toc_level < self._toc_limit:\n return [type(self)(x._toc_node, self._toc_limit, self...
<|body_start_0|> self._toc_node = node self._toc_limit = limit self._toc_level = level <|end_body_0|> <|body_start_1|> if name.startswith('_toc_'): return object.__getattribute__(self, name) if name in ['tableofcontents', 'fulltableofcontents']: if self._...
Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the depth limit has been reached, no more table of contents entries are returned.
TableOfContents
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TableOfContents: """Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the depth limit has been reached, no more tab...
stack_v2_sparse_classes_36k_train_028643
10,872
permissive
[ { "docstring": "Instantiate a table of contents object Arguments: node -- the node to retrieve the table of contents from limit -- the number of levels to display level -- the current level", "name": "__init__", "signature": "def __init__(self, node, limit, level=1)" }, { "docstring": "Proxy all...
2
null
Implement the Python class `TableOfContents` described below. Class description: Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the de...
Implement the Python class `TableOfContents` described below. Class description: Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the de...
a882a62b81e6ae7b8c9454ae2b222ef5c2c14bb1
<|skeleton|> class TableOfContents: """Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the depth limit has been reached, no more tab...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TableOfContents: """Table of Contents object The table of contents object is a proxy object that limits the depth of a table of contents entry. Each time the `tableofcontents' attribute is accessed on the given node, the depth level is increased. Once the depth limit has been reached, no more table of content...
the_stack_v2_python_sparse
plasTeX/Base/LaTeX/Sectioning.py
plastex/plastex
train
129
bb4ed7ecc38c0ddad08851cd79753922faff89e4
[ "assert input.size() == target.size()\nloss = (target - input).pow(2).mean()\nreturn loss", "assert input.size() == target.size()\nN = input.numel()\ngrad = input - target\nassert grad.size() == input.size()\nreturn 2 / N * grad" ]
<|body_start_0|> assert input.size() == target.size() loss = (target - input).pow(2).mean() return loss <|end_body_0|> <|body_start_1|> assert input.size() == target.size() N = input.numel() grad = input - target assert grad.size() == input.size() return ...
Class representing mean square error loss.
LossMSE
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LossMSE: """Class representing mean square error loss.""" def forward(self, input, target): """Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- tensor of size (N, D) Returns: loss -- mse loss between in...
stack_v2_sparse_classes_36k_train_028644
2,642
permissive
[ { "docstring": "Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- tensor of size (N, D) Returns: loss -- mse loss between input and target", "name": "forward", "signature": "def forward(self, input, target)" }, { "d...
2
stack_v2_sparse_classes_30k_train_009509
Implement the Python class `LossMSE` described below. Class description: Class representing mean square error loss. Method signatures and docstrings: - def forward(self, input, target): Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- t...
Implement the Python class `LossMSE` described below. Class description: Class representing mean square error loss. Method signatures and docstrings: - def forward(self, input, target): Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- t...
056b1be878b77c5a7dd5cff8d29ecb390be8b5de
<|skeleton|> class LossMSE: """Class representing mean square error loss.""" def forward(self, input, target): """Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- tensor of size (N, D) Returns: loss -- mse loss between in...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LossMSE: """Class representing mean square error loss.""" def forward(self, input, target): """Computes the mean square error loss between the input tensor and the target tensor. Args: input -- tensor of size (N, D) target -- tensor of size (N, D) Returns: loss -- mse loss between input and targe...
the_stack_v2_python_sparse
Proj2/modules/Losses.py
jouvemax/DeepLearning
train
0
1c087679dc934be42a06dfa335cf6029f0609ea2
[ "self.cluster_info = cluster_info\nself.is_top_level = is_top_level\nself.license_types = license_types\nself.name = name\nself.mtype = mtype\nself.uuid = uuid\nself.version_tuple = version_tuple\nself.volume_info = volume_info\nself.vserver_info = vserver_info", "if dictionary is None:\n return None\ncluster_...
<|body_start_0|> self.cluster_info = cluster_info self.is_top_level = is_top_level self.license_types = license_types self.name = name self.mtype = mtype self.uuid = uuid self.version_tuple = version_tuple self.volume_info = volume_info self.vserve...
Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp Object of type kCluster. is_top_level (bool): Specifies if this Object is a top level Obj...
NetappProtectionSource
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NetappProtectionSource: """Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp Object of type kCluster. is_top_level (...
stack_v2_sparse_classes_36k_train_028645
5,023
permissive
[ { "docstring": "Constructor for the NetappProtectionSource class", "name": "__init__", "signature": "def __init__(self, cluster_info=None, is_top_level=None, license_types=None, name=None, mtype=None, uuid=None, version_tuple=None, volume_info=None, vserver_info=None)" }, { "docstring": "Creates...
2
null
Implement the Python class `NetappProtectionSource` described below. Class description: Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp ...
Implement the Python class `NetappProtectionSource` described below. Class description: Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp ...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class NetappProtectionSource: """Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp Object of type kCluster. is_top_level (...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NetappProtectionSource: """Implementation of the 'NetappProtectionSource' model. Specifies a Protection Source in a NetApp environment. Attributes: cluster_info (NetappClusterInfo): Specifies information about a NetApp cluster and is only valid for a NetApp Object of type kCluster. is_top_level (bool): Specif...
the_stack_v2_python_sparse
cohesity_management_sdk/models/netapp_protection_source.py
cohesity/management-sdk-python
train
24
3a065c9d87311e23898e17edad7f1dc1226657f1
[ "for attr_name, attr_value in attrs.items():\n if isinstance(attr_value, types.FunctionType):\n attrs[attr_name] = cls.deco(attr_value)\nreturn super(LoggerMeta, cls).__new__(cls, name, bases, attrs)", "@wraps(func)\ndef wrapper(*args, **kwargs):\n \"\"\"Wrapper function that parses the calling funct...
<|body_start_0|> for attr_name, attr_value in attrs.items(): if isinstance(attr_value, types.FunctionType): attrs[attr_name] = cls.deco(attr_value) return super(LoggerMeta, cls).__new__(cls, name, bases, attrs) <|end_body_0|> <|body_start_1|> @wraps(func) def...
LoggerMeta
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoggerMeta: def __new__(cls, name, bases, attrs): """Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be instantiated(LoggerMeta) :type cls: Class :param name: name of the new Class instantiated :type name: ...
stack_v2_sparse_classes_36k_train_028646
11,023
permissive
[ { "docstring": "Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be instantiated(LoggerMeta) :type cls: Class :param name: name of the new Class instantiated :type name: Class :param bases: Tuple of base parent classes :type bases:...
2
null
Implement the Python class `LoggerMeta` described below. Class description: Implement the LoggerMeta class. Method signatures and docstrings: - def __new__(cls, name, bases, attrs): Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be ins...
Implement the Python class `LoggerMeta` described below. Class description: Implement the LoggerMeta class. Method signatures and docstrings: - def __new__(cls, name, bases, attrs): Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be ins...
100521fde1fb67536682cafecc2f91a6e2e8a6f8
<|skeleton|> class LoggerMeta: def __new__(cls, name, bases, attrs): """Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be instantiated(LoggerMeta) :type cls: Class :param name: name of the new Class instantiated :type name: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LoggerMeta: def __new__(cls, name, bases, attrs): """Magic method to create instance object reference. Using this method you can customize the instance creation. :param cls: Class to be instantiated(LoggerMeta) :type cls: Class :param name: name of the new Class instantiated :type name: Class :param b...
the_stack_v2_python_sparse
boardfarm/lib/bft_logging.py
mattsm/boardfarm
train
45
7fef7122ed837c879ffcc096445fe5236ae5c5d6
[ "self.url = url\nself.site = site\nself.keyword = keyword\nself.view = view", "info('%s -> start search keyword %s data......' % (self.site, self.keyword))\nresponse = requests.get(self.url % self.keyword, headers=self.headers)\nresponse.encoding = 'UTF-8'\ndebug('%s -> send request URL: ' % response.url)\ndebug(...
<|body_start_0|> self.url = url self.site = site self.keyword = keyword self.view = view <|end_body_0|> <|body_start_1|> info('%s -> start search keyword %s data......' % (self.site, self.keyword)) response = requests.get(self.url % self.keyword, headers=self.headers) ...
搜索器父类
TorrentSearcher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TorrentSearcher: """搜索器父类""" def __init__(self, site, url, keyword, view='TEXT'): """初始化方法,完成必要参数收集初始化""" <|body_0|> def search(self): """搜索方法,完成搜索请求""" <|body_1|> def parser(self, content): """转换方法,完成搜索结果转换统一标准 将结果提取到数据数据集合列表:[{title, magnet...
stack_v2_sparse_classes_36k_train_028647
9,557
no_license
[ { "docstring": "初始化方法,完成必要参数收集初始化", "name": "__init__", "signature": "def __init__(self, site, url, keyword, view='TEXT')" }, { "docstring": "搜索方法,完成搜索请求", "name": "search", "signature": "def search(self)" }, { "docstring": "转换方法,完成搜索结果转换统一标准 将结果提取到数据数据集合列表:[{title, magnet, size,...
6
null
Implement the Python class `TorrentSearcher` described below. Class description: 搜索器父类 Method signatures and docstrings: - def __init__(self, site, url, keyword, view='TEXT'): 初始化方法,完成必要参数收集初始化 - def search(self): 搜索方法,完成搜索请求 - def parser(self, content): 转换方法,完成搜索结果转换统一标准 将结果提取到数据数据集合列表:[{title, magnet, size, date}] ...
Implement the Python class `TorrentSearcher` described below. Class description: 搜索器父类 Method signatures and docstrings: - def __init__(self, site, url, keyword, view='TEXT'): 初始化方法,完成必要参数收集初始化 - def search(self): 搜索方法,完成搜索请求 - def parser(self, content): 转换方法,完成搜索结果转换统一标准 将结果提取到数据数据集合列表:[{title, magnet, size, date}] ...
1fe2960a710dec60ab640370eee0d60c8222523e
<|skeleton|> class TorrentSearcher: """搜索器父类""" def __init__(self, site, url, keyword, view='TEXT'): """初始化方法,完成必要参数收集初始化""" <|body_0|> def search(self): """搜索方法,完成搜索请求""" <|body_1|> def parser(self, content): """转换方法,完成搜索结果转换统一标准 将结果提取到数据数据集合列表:[{title, magnet...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TorrentSearcher: """搜索器父类""" def __init__(self, site, url, keyword, view='TEXT'): """初始化方法,完成必要参数收集初始化""" self.url = url self.site = site self.keyword = keyword self.view = view def search(self): """搜索方法,完成搜索请求""" info('%s -> start search keywo...
the_stack_v2_python_sparse
app_mini_tools/magnet-searcher/torrent-search.py
hooj0/python-examples
train
1
1be590a2591b413cd2518e80d23f5480055fb0e7
[ "context = super().get_context(request, *args, **kwargs)\nevent_page = EventPage.objects.live().public()\nprint('event_page =====> ', event_page)\ncontext['events'] = event_page\nreturn context", "today = timezone.localtime(timezone.now()).date()\nevents_past = EventPage.objects.all().filter(end__lt=today)\nfor e...
<|body_start_0|> context = super().get_context(request, *args, **kwargs) event_page = EventPage.objects.live().public() print('event_page =====> ', event_page) context['events'] = event_page return context <|end_body_0|> <|body_start_1|> today = timezone.localtime(timezo...
Events page class.
EventsPage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventsPage: """Events page class.""" def get_context(self, request, *args, **kwargs): """Adding custom stuff to our context.""" <|body_0|> def send_data_to_resources_page(): """copy the data found in the events table and the sends in the resource tables""" ...
stack_v2_sparse_classes_36k_train_028648
5,508
no_license
[ { "docstring": "Adding custom stuff to our context.", "name": "get_context", "signature": "def get_context(self, request, *args, **kwargs)" }, { "docstring": "copy the data found in the events table and the sends in the resource tables", "name": "send_data_to_resources_page", "signature"...
3
null
Implement the Python class `EventsPage` described below. Class description: Events page class. Method signatures and docstrings: - def get_context(self, request, *args, **kwargs): Adding custom stuff to our context. - def send_data_to_resources_page(): copy the data found in the events table and the sends in the reso...
Implement the Python class `EventsPage` described below. Class description: Events page class. Method signatures and docstrings: - def get_context(self, request, *args, **kwargs): Adding custom stuff to our context. - def send_data_to_resources_page(): copy the data found in the events table and the sends in the reso...
08fae9c919b6376239c150697dc9719520c06b1c
<|skeleton|> class EventsPage: """Events page class.""" def get_context(self, request, *args, **kwargs): """Adding custom stuff to our context.""" <|body_0|> def send_data_to_resources_page(): """copy the data found in the events table and the sends in the resource tables""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EventsPage: """Events page class.""" def get_context(self, request, *args, **kwargs): """Adding custom stuff to our context.""" context = super().get_context(request, *args, **kwargs) event_page = EventPage.objects.live().public() print('event_page =====> ', event_page) ...
the_stack_v2_python_sparse
events/models.py
youpiyoful/pythonclassmates
train
0
73ca4a2b12aa08cca8fd79dbc1c793caf754d412
[ "request = Request(request)\nresponse = RestResponse()\nuser_repository = UserRepository()\nrequest_serializer_manager = SerializerManager(GetUserSerializer)\nresponse_serializer_manager = SerializerManager(UserSerializer)\nuser_finder_controller = UserFinderController(request, response, user_repository, request_se...
<|body_start_0|> request = Request(request) response = RestResponse() user_repository = UserRepository() request_serializer_manager = SerializerManager(GetUserSerializer) response_serializer_manager = SerializerManager(UserSerializer) user_finder_controller = UserFinderCo...
User Api
UserApi
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserApi: """User Api""" def get(self, request, _id: str=None): """Get User @param request: @type request: @param _id: @type _id: @return: @rtype:""" <|body_0|> def post(self, request, _id: str=None): """Post User @param request: request @type request: response @p...
stack_v2_sparse_classes_36k_train_028649
4,604
permissive
[ { "docstring": "Get User @param request: @type request: @param _id: @type _id: @return: @rtype:", "name": "get", "signature": "def get(self, request, _id: str=None)" }, { "docstring": "Post User @param request: request @type request: response @param _id: user id @type _id: int @return: post resp...
4
stack_v2_sparse_classes_30k_train_005910
Implement the Python class `UserApi` described below. Class description: User Api Method signatures and docstrings: - def get(self, request, _id: str=None): Get User @param request: @type request: @param _id: @type _id: @return: @rtype: - def post(self, request, _id: str=None): Post User @param request: request @type...
Implement the Python class `UserApi` described below. Class description: User Api Method signatures and docstrings: - def get(self, request, _id: str=None): Get User @param request: @type request: @param _id: @type _id: @return: @rtype: - def post(self, request, _id: str=None): Post User @param request: request @type...
8055927cb460bc40f3a2651c01a9d1da696177e8
<|skeleton|> class UserApi: """User Api""" def get(self, request, _id: str=None): """Get User @param request: @type request: @param _id: @type _id: @return: @rtype:""" <|body_0|> def post(self, request, _id: str=None): """Post User @param request: request @type request: response @p...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserApi: """User Api""" def get(self, request, _id: str=None): """Get User @param request: @type request: @param _id: @type _id: @return: @rtype:""" request = Request(request) response = RestResponse() user_repository = UserRepository() request_serializer_manager =...
the_stack_v2_python_sparse
had/app/views/api/v1/users/user_api.py
eduardolujan/hexagonal_architecture_django
train
5
3d727342e706e426f0caaedef1cae0e7363776b9
[ "self._pid = PID(kp, ki, kd, **kwargs)\nBetterColorSensor.__init__(self, port_cs)\nself.grey_soll = (127.5 - black) / (white - black) * 255\nself.avgsize_c = avgsize_c\nself.black = black\nself.white = white", "if self.avgsize_c > 1:\n grey = self.grey_avg\nelse:\n grey = self.grey\ngrey = (grey - self.blac...
<|body_start_0|> self._pid = PID(kp, ki, kd, **kwargs) BetterColorSensor.__init__(self, port_cs) self.grey_soll = (127.5 - black) / (white - black) * 255 self.avgsize_c = avgsize_c self.black = black self.white = white <|end_body_0|> <|body_start_1|> if self.avgs...
Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt
LineKeep
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LineKeep: """Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt""" def __init__(self, port_cs, kp, ki=0, kd=0, avgsize_c=1, white=255, bl...
stack_v2_sparse_classes_36k_train_028650
8,924
no_license
[ { "docstring": "INIT-PARAM: kp, ki, kd:Konstanten des PID-Reglers port_cs:Port des FarbSensors avgsize_c: zu mittelnde Farbwerte( koennte sinnvoll sein wg Schwankungen, default = 1) white: Farbe des Untergrunds(default:255) black: Farbe der Linie(default:0)", "name": "__init__", "signature": "def __init...
3
stack_v2_sparse_classes_30k_train_013707
Implement the Python class `LineKeep` described below. Class description: Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt Method signatures and docstrings: - de...
Implement the Python class `LineKeep` described below. Class description: Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt Method signatures and docstrings: - de...
a9a7160bf7fb3b528716ebabd4c16b4482d8d9cf
<|skeleton|> class LineKeep: """Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt""" def __init__(self, port_cs, kp, ki=0, kd=0, avgsize_c=1, white=255, bl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LineKeep: """Berechnet die noetige Aenderung der Geschwindigkeit(dv) um auf der Linie zu bleiben TODO:Um die PID-Parameter bei sich aendernden Bedingungen gleich zuhalten, wird der soll und ist-Wert auf 0...255 gemappt""" def __init__(self, port_cs, kp, ki=0, kd=0, avgsize_c=1, white=255, black=0, **kwar...
the_stack_v2_python_sparse
node/ev3con/linienverfolgung/control.py
Fuzzyma/network-controlled-line-follower
train
0
23e4b14a5f6f34cc9d5b2970f6740700684a6ec2
[ "if axis < 0:\n axis += data.ndim\ndata = np.moveaxis(data, [axis], [0])\nif len(data) != len(arr_weights):\n raise ValueError('Weights shape does not match data')\ngrid_shape = data.shape[2:]\ngrid_points = np.prod(grid_shape, dtype=int)\nflattened_shape = [data.shape[0], data.shape[1], grid_points]\ndata = ...
<|body_start_0|> if axis < 0: axis += data.ndim data = np.moveaxis(data, [axis], [0]) if len(data) != len(arr_weights): raise ValueError('Weights shape does not match data') grid_shape = data.shape[2:] grid_points = np.prod(grid_shape, dtype=int) f...
Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geographic point in the cube we take the percentile threshold's values across the percentile dimensi...
PercentileBlendingAggregator
[ "BSD-3-Clause", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PercentileBlendingAggregator: """Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geographic point in the cube we take the per...
stack_v2_sparse_classes_36k_train_028651
30,444
permissive
[ { "docstring": "Function to blend percentile data over a given dimension. The input percentile data must be provided with the blend coord as the first axis and the percentile coord as the second (these are re-ordered after aggregator initialisation at the start of this function). Weights data must be provided w...
2
stack_v2_sparse_classes_30k_train_006205
Implement the Python class `PercentileBlendingAggregator` described below. Class description: Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geogr...
Implement the Python class `PercentileBlendingAggregator` described below. Class description: Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geogr...
cd2c9019944345df1e703bf8f625db537ad9f559
<|skeleton|> class PercentileBlendingAggregator: """Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geographic point in the cube we take the per...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PercentileBlendingAggregator: """Class for the percentile blending aggregator This class implements the method described by Combining Probabilities by Caroline Jones, 2017. This method implements blending in probability space. The steps are: 1. At each geographic point in the cube we take the percentile thres...
the_stack_v2_python_sparse
improver/blending/weighted_blend.py
metoppv/improver
train
101
15ed22f7fffd066270fb8d0534cc859287a9c769
[ "super().__init__(x, y)\nself.fill_color = QtCore.Qt.red\nself.line_color = QtCore.Qt.white\nself.dx = random.randint(2, 5)", "self.x += self.dx\nif self.x > w + Bird.SIZE * 8:\n self.x = -Bird.SIZE\n self.y = random.choice([-1, 1]) * random.randint(Bird.SIZE, Bird.SIZE * 3) + self.y" ]
<|body_start_0|> super().__init__(x, y) self.fill_color = QtCore.Qt.red self.line_color = QtCore.Qt.white self.dx = random.randint(2, 5) <|end_body_0|> <|body_start_1|> self.x += self.dx if self.x > w + Bird.SIZE * 8: self.x = -Bird.SIZE self.y = ...
Class to represent a Cardinal.
Cardinal
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cardinal: """Class to represent a Cardinal.""" def __init__(self, x, y): """Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero.""" <|body_0|> def move(self, w, h): ...
stack_v2_sparse_classes_36k_train_028652
13,878
no_license
[ { "docstring": "Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero.", "name": "__init__", "signature": "def __init__(self, x, y)" }, { "docstring": "A Cardinal flies straight across the aviary, lef...
2
stack_v2_sparse_classes_30k_val_000501
Implement the Python class `Cardinal` described below. Class description: Class to represent a Cardinal. Method signatures and docstrings: - def __init__(self, x, y): Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero. ...
Implement the Python class `Cardinal` described below. Class description: Class to represent a Cardinal. Method signatures and docstrings: - def __init__(self, x, y): Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero. ...
0e3470085083012f893adb22aa46d46039016965
<|skeleton|> class Cardinal: """Class to represent a Cardinal.""" def __init__(self, x, y): """Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero.""" <|body_0|> def move(self, w, h): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cardinal: """Class to represent a Cardinal.""" def __init__(self, x, y): """Create a new Cardinal with the given x and y values. :param int x: The x-coordinate; default is zero. :param int y: The y-coordinate; default is zero.""" super().__init__(x, y) self.fill_color = QtCore.Qt....
the_stack_v2_python_sparse
CS_210 (Introduction to Programming)/Labs/Lab34_AviaryApp.py
JacobOrner/USAFA
train
0
36abf8c1e5baa99cc40dfce7f15fd15b0a60104f
[ "super(SetSegmentationRosParam, self).__init__(outcomes=['done'])\nself.ValueTable = ValueTableSegmentation\nself.ValueObject = ValueObjectSegmentation", "if self.ValueTable:\n rospy.set_param('/process_table_segmentation', self.ValueTable)\nelif rospy.has_param('/process_table_segmentation'):\n rospy.delet...
<|body_start_0|> super(SetSegmentationRosParam, self).__init__(outcomes=['done']) self.ValueTable = ValueTableSegmentation self.ValueObject = ValueObjectSegmentation <|end_body_0|> <|body_start_1|> if self.ValueTable: rospy.set_param('/process_table_segmentation', self.Value...
Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. ># ValueObjectSegmentation object The rosparam to set for object segmentation. <= done The r...
SetSegmentationRosParam
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SetSegmentationRosParam: """Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. ># ValueObjectSegmentation object The ros...
stack_v2_sparse_classes_36k_train_028653
1,486
permissive
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, ValueTableSegmentation, ValueObjectSegmentation)" }, { "docstring": "Execute this state", "name": "execute", "signature": "def execute(self, userdata)" } ]
2
null
Implement the Python class `SetSegmentationRosParam` described below. Class description: Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. >#...
Implement the Python class `SetSegmentationRosParam` described below. Class description: Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. >#...
fcb55d274331915cd39d7d444546f17a39f85a44
<|skeleton|> class SetSegmentationRosParam: """Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. ># ValueObjectSegmentation object The ros...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SetSegmentationRosParam: """Set the Rosparams /process_table_segmentation and /process_object_segmentation to true or false to activate/desactivate the table/object segmentation. ># ValueTableSegmentation object The rosparam to set for table segmentation. ># ValueObjectSegmentation object The rosparam to set ...
the_stack_v2_python_sparse
sara_flexbe_states/src/sara_flexbe_states/SetSegmentationRosParam.py
WalkingMachine/sara_behaviors
train
5
a747b26132a9985cb268768ca59fefae3861752c
[ "self.start = start\nself.end = end\nself.amount = amount", "current_date = current_time().date()\nif self.start == current_date:\n if self.end:\n return f\"jusqu'au {format_date(self.end)}: {format_currency(self.amount)}\"\n return ''\nif self.end:\n return f'{format_date_range(self.start, self.e...
<|body_start_0|> self.start = start self.end = end self.amount = amount <|end_body_0|> <|body_start_1|> current_date = current_time().date() if self.start == current_date: if self.end: return f"jusqu'au {format_date(self.end)}: {format_currency(self.a...
Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose
PriceDateInterval
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PriceDateInterval: """Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose""" def __init__(self, start: datetime.date, end: datetime.date, amount: decimal.Decimal=None): """Constructor :param date: st...
stack_v2_sparse_classes_36k_train_028654
8,739
no_license
[ { "docstring": "Constructor :param date: start date of the interval (inclusive) :param end: End date of the interval (inclusive) :param amount: Charged amount for the duration of the interval", "name": "__init__", "signature": "def __init__(self, start: datetime.date, end: datetime.date, amount: decimal...
2
stack_v2_sparse_classes_30k_train_009272
Implement the Python class `PriceDateInterval` described below. Class description: Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose Method signatures and docstrings: - def __init__(self, start: datetime.date, end: datetime.date, a...
Implement the Python class `PriceDateInterval` described below. Class description: Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose Method signatures and docstrings: - def __init__(self, start: datetime.date, end: datetime.date, a...
1ae05ae9029a28fd0656c06a2092f67a87a93dcd
<|skeleton|> class PriceDateInterval: """Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose""" def __init__(self, start: datetime.date, end: datetime.date, amount: decimal.Decimal=None): """Constructor :param date: st...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PriceDateInterval: """Class describing a date interval for which a charged amount applies. Used to build the timeline of future prices for informative purpose""" def __init__(self, start: datetime.date, end: datetime.date, amount: decimal.Decimal=None): """Constructor :param date: start date of t...
the_stack_v2_python_sparse
collectives/utils/payment.py
Club-Alpin-Annecy/collectives
train
12
c31addfe8449ea7885b74c326ea777b979dc6e60
[ "self.proj_dir = project_directory\nif not exists(self.proj_dir):\n raise TypeError(f\"Project directory '{self.proj_dir}' does not exist.\")\nif not exists(self.proj_dir + '/structure.pickle'):\n raise TypeError(f'Project directory `{self.proj_dir}` does not contain `structure.pickle`.')\nwith open(self.proj...
<|body_start_0|> self.proj_dir = project_directory if not exists(self.proj_dir): raise TypeError(f"Project directory '{self.proj_dir}' does not exist.") if not exists(self.proj_dir + '/structure.pickle'): raise TypeError(f'Project directory `{self.proj_dir}` does not cont...
RestoreIntermediatePass
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RestoreIntermediatePass: def __init__(self, project_directory: str, load_blocks: bool=True): """Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path to the checkpoint block files. This directory must also contain a valid "structure.pickle" file. load_blocks (b...
stack_v2_sparse_classes_36k_train_028655
7,234
permissive
[ { "docstring": "Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path to the checkpoint block files. This directory must also contain a valid \"structure.pickle\" file. load_blocks (bool): If True, blocks in the project directory will be loaded to the block_list during the constructor...
3
null
Implement the Python class `RestoreIntermediatePass` described below. Class description: Implement the RestoreIntermediatePass class. Method signatures and docstrings: - def __init__(self, project_directory: str, load_blocks: bool=True): Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path...
Implement the Python class `RestoreIntermediatePass` described below. Class description: Implement the RestoreIntermediatePass class. Method signatures and docstrings: - def __init__(self, project_directory: str, load_blocks: bool=True): Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path...
c89112d15072e8ffffb68cf1757b184e2aeb3dc8
<|skeleton|> class RestoreIntermediatePass: def __init__(self, project_directory: str, load_blocks: bool=True): """Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path to the checkpoint block files. This directory must also contain a valid "structure.pickle" file. load_blocks (b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RestoreIntermediatePass: def __init__(self, project_directory: str, load_blocks: bool=True): """Constructor for the RestoreIntermediatePass. Args: project_directory (str): Path to the checkpoint block files. This directory must also contain a valid "structure.pickle" file. load_blocks (bool): If True,...
the_stack_v2_python_sparse
bqskit/passes/io/intermediate.py
BQSKit/bqskit
train
54
749fe9e8944ad9b1c66f40e96fe36d46dabec0d2
[ "token = b2a_base64(urandom(blength))[:-1]\nif isinstance(token, str):\n return token.translate(_smap)[:blength]\nreturn token.decode('utf-8').translate(_smap)[:blength]", "h = hashlib.sha256()\npasswordString = password + salt\nh.update(bytes(passwordString, encoding='utf-8'))\nreturn h.hexdigest()" ]
<|body_start_0|> token = b2a_base64(urandom(blength))[:-1] if isinstance(token, str): return token.translate(_smap)[:blength] return token.decode('utf-8').translate(_smap)[:blength] <|end_body_0|> <|body_start_1|> h = hashlib.sha256() passwordString = password + salt...
EncipherLibrary
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EncipherLibrary: def gen_token(cls, blength=36): """:param blength: :return:""" <|body_0|> def encrypt(cls, password, salt): """加密密码 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> token = b2a_base64(urandom(blength))[:-1] if isinst...
stack_v2_sparse_classes_36k_train_028656
1,160
permissive
[ { "docstring": ":param blength: :return:", "name": "gen_token", "signature": "def gen_token(cls, blength=36)" }, { "docstring": "加密密码 :return:", "name": "encrypt", "signature": "def encrypt(cls, password, salt)" } ]
2
stack_v2_sparse_classes_30k_train_007063
Implement the Python class `EncipherLibrary` described below. Class description: Implement the EncipherLibrary class. Method signatures and docstrings: - def gen_token(cls, blength=36): :param blength: :return: - def encrypt(cls, password, salt): 加密密码 :return:
Implement the Python class `EncipherLibrary` described below. Class description: Implement the EncipherLibrary class. Method signatures and docstrings: - def gen_token(cls, blength=36): :param blength: :return: - def encrypt(cls, password, salt): 加密密码 :return: <|skeleton|> class EncipherLibrary: def gen_token(c...
148139eeca0f3cd8a8c2196ae2a6f8cea519d9b5
<|skeleton|> class EncipherLibrary: def gen_token(cls, blength=36): """:param blength: :return:""" <|body_0|> def encrypt(cls, password, salt): """加密密码 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EncipherLibrary: def gen_token(cls, blength=36): """:param blength: :return:""" token = b2a_base64(urandom(blength))[:-1] if isinstance(token, str): return token.translate(_smap)[:blength] return token.decode('utf-8').translate(_smap)[:blength] def encrypt(cls,...
the_stack_v2_python_sparse
torstack/library/encipher.py
longniao/torstack
train
8
2806fa7460376790bad5b7f88f1026b4a91dff9f
[ "self.__base_size = base_size\nself.__scale = np.array(size) / np.array(self.__base_size)\nself.__module = cv2.createBackgroundSubtractorMOG2(detectShadows=True)\nself.__filter_size = np.array(filter_size)", "frame = cv2.resize(frame, self.__base_size)\nif frame.shape[-1] != 1:\n frame = cv2.cvtColor(frame, cv...
<|body_start_0|> self.__base_size = base_size self.__scale = np.array(size) / np.array(self.__base_size) self.__module = cv2.createBackgroundSubtractorMOG2(detectShadows=True) self.__filter_size = np.array(filter_size) <|end_body_0|> <|body_start_1|> frame = cv2.resize(frame, se...
GrabObject
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GrabObject: def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20)): """size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大小""" <|body_0|> def grab(self, frame: np.ndarray): """抓取动态物体 frame: 图片帧 return...
stack_v2_sparse_classes_36k_train_028657
1,954
no_license
[ { "docstring": "size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大小", "name": "__init__", "signature": "def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20))" }, { "docstring": "抓取动态物体 frame: 图片帧 return: [((x, y), (x2, y2)), .....
2
null
Implement the Python class `GrabObject` described below. Class description: Implement the GrabObject class. Method signatures and docstrings: - def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20)): size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大...
Implement the Python class `GrabObject` described below. Class description: Implement the GrabObject class. Method signatures and docstrings: - def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20)): size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大...
bb598c7606de1492c5ccbf0a338e8914d25d405c
<|skeleton|> class GrabObject: def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20)): """size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大小""" <|body_0|> def grab(self, frame: np.ndarray): """抓取动态物体 frame: 图片帧 return...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GrabObject: def __init__(self, size: (int, int), base_size=(400, 400), filter_size=(20, 20)): """size: 图片的实际大小 base_size: 在进行背景建模时,图片将被缩放到该大小 filter_size: 小于该大小的物体将被忽略,该大小是居于base_size,而不是原大小""" self.__base_size = base_size self.__scale = np.array(size) / np.array(self.__base_size) ...
the_stack_v2_python_sparse
farAwaySFE/seniorChen/SmokeDetector/SFE/GrabObject.py
bandy101/my_git_respository
train
0
1e3d0238448e0867bd40ec49bfd8b443dbbcbbf5
[ "super().__init__()\nself.name = bucket\nself.storage = storage_client if storage_client != None else storage.Client()\nself.bucket = self.storage.get_bucket(self.name)", "blob = self.bucket.blob(name)\nblob.upload_from_string(file)\nreturn True", "try:\n blob = self.bucket.get_blob(name)\n file_obj = blo...
<|body_start_0|> super().__init__() self.name = bucket self.storage = storage_client if storage_client != None else storage.Client() self.bucket = self.storage.get_bucket(self.name) <|end_body_0|> <|body_start_1|> blob = self.bucket.blob(name) blob.upload_from_string(fil...
Storage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Storage: def __init__(self, bucket, storage_client=None) -> None: """The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the bucket storage (google.cloud.storage.client): A storage client object Returns: None""" <|...
stack_v2_sparse_classes_36k_train_028658
1,966
no_license
[ { "docstring": "The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the bucket storage (google.cloud.storage.client): A storage client object Returns: None", "name": "__init__", "signature": "def __init__(self, bucket, storage_client=None...
4
stack_v2_sparse_classes_30k_train_006770
Implement the Python class `Storage` described below. Class description: Implement the Storage class. Method signatures and docstrings: - def __init__(self, bucket, storage_client=None) -> None: The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the b...
Implement the Python class `Storage` described below. Class description: Implement the Storage class. Method signatures and docstrings: - def __init__(self, bucket, storage_client=None) -> None: The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the b...
7e1b37dc33c1957fc482eaa52e6fd2decb9872eb
<|skeleton|> class Storage: def __init__(self, bucket, storage_client=None) -> None: """The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the bucket storage (google.cloud.storage.client): A storage client object Returns: None""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Storage: def __init__(self, bucket, storage_client=None) -> None: """The constructor for the Storage class. Used to instantiate a Bucket reference object. Args: bucket (str): the name of the bucket storage (google.cloud.storage.client): A storage client object Returns: None""" super().__init__...
the_stack_v2_python_sparse
biit_server/storage.py
biit-407/biit-server
train
1
1359553cc3287a820189fbf4d8e567261500f703
[ "self.uid = uid\nself.first_army = []\nself.second_army = []\nself.result = []\nself.is_success = 0", "for i, card in enumerate(first_army):\n solider = Soldier(self, card)\n solider.position = '1_' + str(i)\n self.first_army.append(solider)", "for i, card in enumerate(second_army):\n solider = Sold...
<|body_start_0|> self.uid = uid self.first_army = [] self.second_army = [] self.result = [] self.is_success = 0 <|end_body_0|> <|body_start_1|> for i, card in enumerate(first_army): solider = Soldier(self, card) solider.position = '1_' + str(i) ...
战斗
Dungeon
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dungeon: """战斗""" def __init__(self, uid): """初始化战场数据""" <|body_0|> def load_first_army(self, first_army): """加载第一军队""" <|body_1|> def load_second_army(self, second_army): """加载第二军队""" <|body_2|> def is_dungeon_finish(self): ...
stack_v2_sparse_classes_36k_train_028659
1,875
permissive
[ { "docstring": "初始化战场数据", "name": "__init__", "signature": "def __init__(self, uid)" }, { "docstring": "加载第一军队", "name": "load_first_army", "signature": "def load_first_army(self, first_army)" }, { "docstring": "加载第二军队", "name": "load_second_army", "signature": "def load_...
5
null
Implement the Python class `Dungeon` described below. Class description: 战斗 Method signatures and docstrings: - def __init__(self, uid): 初始化战场数据 - def load_first_army(self, first_army): 加载第一军队 - def load_second_army(self, second_army): 加载第二军队 - def is_dungeon_finish(self): 判断战斗是否结束 - def run(self): 开始战斗
Implement the Python class `Dungeon` described below. Class description: 战斗 Method signatures and docstrings: - def __init__(self, uid): 初始化战场数据 - def load_first_army(self, first_army): 加载第一军队 - def load_second_army(self, second_army): 加载第二军队 - def is_dungeon_finish(self): 判断战斗是否结束 - def run(self): 开始战斗 <|skeleton|>...
aa0a3ed1a316d8afc9482f072f2aa57cffe9a10f
<|skeleton|> class Dungeon: """战斗""" def __init__(self, uid): """初始化战场数据""" <|body_0|> def load_first_army(self, first_army): """加载第一军队""" <|body_1|> def load_second_army(self, second_army): """加载第二军队""" <|body_2|> def is_dungeon_finish(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Dungeon: """战斗""" def __init__(self, uid): """初始化战场数据""" self.uid = uid self.first_army = [] self.second_army = [] self.result = [] self.is_success = 0 def load_first_army(self, first_army): """加载第一军队""" for i, card in enumerate(first_a...
the_stack_v2_python_sparse
apps/models/virtual/dungeon.py
leigeng2014/sango2
train
0
9d361efb99ae09a96378c046fc787a0acd038748
[ "if not root:\n return '[]'\nres = []\nqueue = collections.deque()\nqueue.append(root)\nwhile queue:\n node = queue.popleft()\n if node:\n queue.append(node.left)\n queue.append(node.right)\n res.append(node.val)\n else:\n res.append(None)\nwhile res[-1] is None:\n res.pop...
<|body_start_0|> if not root: return '[]' res = [] queue = collections.deque() queue.append(root) while queue: node = queue.popleft() if node: queue.append(node.left) queue.append(node.right) res....
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_028660
3,120
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
null
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
a5b8dec9dafa970a9596a06e9e48b8d3812e1460
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return '[]' res = [] queue = collections.deque() queue.append(root) while queue: node = queue.popleft() i...
the_stack_v2_python_sparse
专题/二叉树/297 二叉树的序列化与反序列化/1.py
cookie-rabbit/LeetCode_practice
train
1
d125d1c00c803b863e27690c8a4a7fc7a124c533
[ "self.fallback_user_id_mapping_info = fallback_user_id_mapping_info\nself.unix_root_sid = unix_root_sid\nself.user_id_mapping_info = user_id_mapping_info", "if dictionary is None:\n return None\nfallback_user_id_mapping_info = cohesity_management_sdk.models.user_id_mapping.UserIdMapping.from_dictionary(diction...
<|body_start_0|> self.fallback_user_id_mapping_info = fallback_user_id_mapping_info self.unix_root_sid = unix_root_sid self.user_id_mapping_info = user_id_mapping_info <|end_body_0|> <|body_start_1|> if dictionary is None: return None fallback_user_id_mapping_info = ...
Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is used when an ID mapping for a user is not found via the above IdMappingInfo. On...
IdMappingInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IdMappingInfo: """Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is used when an ID mapping for a user is ...
stack_v2_sparse_classes_36k_train_028661
2,803
permissive
[ { "docstring": "Constructor for the IdMappingInfo class", "name": "__init__", "signature": "def __init__(self, fallback_user_id_mapping_info=None, unix_root_sid=None, user_id_mapping_info=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary):...
2
null
Implement the Python class `IdMappingInfo` described below. Class description: Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is...
Implement the Python class `IdMappingInfo` described below. Class description: Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class IdMappingInfo: """Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is used when an ID mapping for a user is ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IdMappingInfo: """Implementation of the 'IdMappingInfo' model. Specifies the params required to update the user id mapping info of an Active Directory. Attributes: fallback_user_id_mapping_info (UserIdMapping): Specifies the fallback id mapping info which is used when an ID mapping for a user is not found via...
the_stack_v2_python_sparse
cohesity_management_sdk/models/id_mapping_info.py
cohesity/management-sdk-python
train
24
9f91fddd0a7c0241137975e43c5dbad92dd20ff3
[ "from django.contrib.auth.password_validation import validate_password\nvalidate_password(attrs['password'])\nreturn super(SignupSerializer, self).validate(attrs)", "user = super().create(validated_data)\nuser.set_password(validated_data['password'])\nuser.save()\nreturn user" ]
<|body_start_0|> from django.contrib.auth.password_validation import validate_password validate_password(attrs['password']) return super(SignupSerializer, self).validate(attrs) <|end_body_0|> <|body_start_1|> user = super().create(validated_data) user.set_password(validated_data...
SignupSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SignupSerializer: def validate(self, attrs): """Validate password as per AUTH_PASSWORD_VALIDATORS in settings""" <|body_0|> def create(self, validated_data): """set_password is used to hash password in database""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_028662
1,408
no_license
[ { "docstring": "Validate password as per AUTH_PASSWORD_VALIDATORS in settings", "name": "validate", "signature": "def validate(self, attrs)" }, { "docstring": "set_password is used to hash password in database", "name": "create", "signature": "def create(self, validated_data)" } ]
2
stack_v2_sparse_classes_30k_train_012519
Implement the Python class `SignupSerializer` described below. Class description: Implement the SignupSerializer class. Method signatures and docstrings: - def validate(self, attrs): Validate password as per AUTH_PASSWORD_VALIDATORS in settings - def create(self, validated_data): set_password is used to hash password...
Implement the Python class `SignupSerializer` described below. Class description: Implement the SignupSerializer class. Method signatures and docstrings: - def validate(self, attrs): Validate password as per AUTH_PASSWORD_VALIDATORS in settings - def create(self, validated_data): set_password is used to hash password...
4d2ffcad58c9da5a79bfef63be7e2becda09b760
<|skeleton|> class SignupSerializer: def validate(self, attrs): """Validate password as per AUTH_PASSWORD_VALIDATORS in settings""" <|body_0|> def create(self, validated_data): """set_password is used to hash password in database""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SignupSerializer: def validate(self, attrs): """Validate password as per AUTH_PASSWORD_VALIDATORS in settings""" from django.contrib.auth.password_validation import validate_password validate_password(attrs['password']) return super(SignupSerializer, self).validate(attrs) ...
the_stack_v2_python_sparse
apps/users/serializers/request_serializers.py
pnaoum/promos_api
train
0
682a1f34cc6491c2f5a6c4bd391a8d443ee3ea19
[ "record_query = session.query(HelperInfo)\nif helper_uin:\n record_query = record_query.filter(HelperInfo.HelperUin == helper_uin)\nif status is not None:\n record_query = record_query.filter(HelperInfo.Status == status)\nif allocation is not None:\n record_query = record_query.filter(HelperInfo.Allocation...
<|body_start_0|> record_query = session.query(HelperInfo) if helper_uin: record_query = record_query.filter(HelperInfo.HelperUin == helper_uin) if status is not None: record_query = record_query.filter(HelperInfo.Status == status) if allocation is not None: ...
HelperInfo
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HelperInfo: def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None): """获取助手列表 :return:""" <|body_0|> def update_allocation_by_uin(cls, session, helper_uin, allocation=None): """更新助手分配状态 :return:""" <|body_...
stack_v2_sparse_classes_36k_train_028663
4,037
no_license
[ { "docstring": "获取助手列表 :return:", "name": "get_helper_info_list", "signature": "def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None)" }, { "docstring": "更新助手分配状态 :return:", "name": "update_allocation_by_uin", "signature": "def updat...
5
null
Implement the Python class `HelperInfo` described below. Class description: Implement the HelperInfo class. Method signatures and docstrings: - def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None): 获取助手列表 :return: - def update_allocation_by_uin(cls, session, hel...
Implement the Python class `HelperInfo` described below. Class description: Implement the HelperInfo class. Method signatures and docstrings: - def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None): 获取助手列表 :return: - def update_allocation_by_uin(cls, session, hel...
902e54bf143a0967dccd1b8884c3164317ff8568
<|skeleton|> class HelperInfo: def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None): """获取助手列表 :return:""" <|body_0|> def update_allocation_by_uin(cls, session, helper_uin, allocation=None): """更新助手分配状态 :return:""" <|body_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HelperInfo: def get_helper_info_list(cls, session, helper_uin, page_index=1, page_size=10, status=None, allocation=None): """获取助手列表 :return:""" record_query = session.query(HelperInfo) if helper_uin: record_query = record_query.filter(HelperInfo.HelperUin == helper_uin) ...
the_stack_v2_python_sparse
wxrobot/helperServer/weixin_helper/common/db_model/user_db/helper_info.py
immortalChensm/python-project
train
0
d88947e27fdd1a8c278236eb2b65749632dce0e3
[ "box1 = '2x3x4'\nbox2 = '1x1x10'\nself.assertEquals(58, puzzle2.square_feet_for_box(box1))\nself.assertEquals(43, puzzle2.square_feet_for_box(box2))\nself.assertEquals(58 + 43, puzzle2.process_box_list([box1, box2]))", "box1 = '2x3x4'\nbox2 = '1x1x10'\nself.assertEquals(34, puzzle2b.ribbon_required_for_box(box1))...
<|body_start_0|> box1 = '2x3x4' box2 = '1x1x10' self.assertEquals(58, puzzle2.square_feet_for_box(box1)) self.assertEquals(43, puzzle2.square_feet_for_box(box2)) self.assertEquals(58 + 43, puzzle2.process_box_list([box1, box2])) <|end_body_0|> <|body_start_1|> box1 = '2x...
Tests for puzzle 2.
TestPuzzle2
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestPuzzle2: """Tests for puzzle 2.""" def test_puzzle2(self): """Tests for puzzle 2.""" <|body_0|> def test_puzzle2b(self): """Tests for puzzle 2b.""" <|body_1|> <|end_skeleton|> <|body_start_0|> box1 = '2x3x4' box2 = '1x1x10' s...
stack_v2_sparse_classes_36k_train_028664
839
no_license
[ { "docstring": "Tests for puzzle 2.", "name": "test_puzzle2", "signature": "def test_puzzle2(self)" }, { "docstring": "Tests for puzzle 2b.", "name": "test_puzzle2b", "signature": "def test_puzzle2b(self)" } ]
2
null
Implement the Python class `TestPuzzle2` described below. Class description: Tests for puzzle 2. Method signatures and docstrings: - def test_puzzle2(self): Tests for puzzle 2. - def test_puzzle2b(self): Tests for puzzle 2b.
Implement the Python class `TestPuzzle2` described below. Class description: Tests for puzzle 2. Method signatures and docstrings: - def test_puzzle2(self): Tests for puzzle 2. - def test_puzzle2b(self): Tests for puzzle 2b. <|skeleton|> class TestPuzzle2: """Tests for puzzle 2.""" def test_puzzle2(self): ...
99d1f68ddf92b989ff775c270d315eb8df4dbd55
<|skeleton|> class TestPuzzle2: """Tests for puzzle 2.""" def test_puzzle2(self): """Tests for puzzle 2.""" <|body_0|> def test_puzzle2b(self): """Tests for puzzle 2b.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestPuzzle2: """Tests for puzzle 2.""" def test_puzzle2(self): """Tests for puzzle 2.""" box1 = '2x3x4' box2 = '1x1x10' self.assertEquals(58, puzzle2.square_feet_for_box(box1)) self.assertEquals(43, puzzle2.square_feet_for_box(box2)) self.assertEquals(58 + ...
the_stack_v2_python_sparse
puzzle2/python/test_puzzle2.py
jramaswami/Advent-Of-Code-2015
train
0
880c4bfa5a2c4678276d210901be43bf4da1ea96
[ "monthly_params = {'position': 0, 'average_purchase_price': None, 'total_amount_purchase': 0, 'total_amount_sale': 0, 'total_units_purchase': 0, 'total_units_sale': 0, 'cgs': None, 'irrf': 0}\nfor operation in operations:\n operation_month = operation.date.strftime('%m/%Y')\n if operation_month == year_month ...
<|body_start_0|> monthly_params = {'position': 0, 'average_purchase_price': None, 'total_amount_purchase': 0, 'total_amount_sale': 0, 'total_units_purchase': 0, 'total_units_sale': 0, 'cgs': None, 'irrf': 0} for operation in operations: operation_month = operation.date.strftime('%m/%Y') ...
To hander day_trade financial operation class
DayTradeCalculate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DayTradeCalculate: """To hander day_trade financial operation class""" def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: str) -> dict: """To calcule params of day_trade operations in a reference year_month, indexed by operat...
stack_v2_sparse_classes_36k_train_028665
3,720
no_license
[ { "docstring": "To calcule params of day_trade operations in a reference year_month, indexed by operation type and ticker", "name": "_calcule_day_trade_operation_monthly_params", "signature": "def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: s...
2
stack_v2_sparse_classes_30k_train_009435
Implement the Python class `DayTradeCalculate` described below. Class description: To hander day_trade financial operation class Method signatures and docstrings: - def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: str) -> dict: To calcule params of day_trad...
Implement the Python class `DayTradeCalculate` described below. Class description: To hander day_trade financial operation class Method signatures and docstrings: - def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: str) -> dict: To calcule params of day_trad...
d005bdca7b141dee6d862bf50002df1b14c58434
<|skeleton|> class DayTradeCalculate: """To hander day_trade financial operation class""" def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: str) -> dict: """To calcule params of day_trade operations in a reference year_month, indexed by operat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DayTradeCalculate: """To hander day_trade financial operation class""" def _calcule_day_trade_operation_monthly_params(self, operations: list, year_month: str, ticker: str, broker: str) -> dict: """To calcule params of day_trade operations in a reference year_month, indexed by operation type and ...
the_stack_v2_python_sparse
simplecapp_calculation_engine/operation_classes/day_trade.py
GustavoRonconi/simplecapp_calculation_engine
train
0
a83b782a2d028aeeb4ba26be36d0761443a344a4
[ "seen = set()\nseen_add = seen.add\nreturn [x for x in _list if x not in seen and (not seen_add(x))]", "for listItem in _list:\n if len(listItem) == 0:\n _list.remove(listItem)\nreturn _list" ]
<|body_start_0|> seen = set() seen_add = seen.add return [x for x in _list if x not in seen and (not seen_add(x))] <|end_body_0|> <|body_start_1|> for listItem in _list: if len(listItem) == 0: _list.remove(listItem) return _list <|end_body_1|>
A subclass of MokaUtils pertaining to 'list' objects.
list
[ "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class list: """A subclass of MokaUtils pertaining to 'list' objects.""" def uniqify(_list): """Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The list to modify. @type _list: list @return: The modified li...
stack_v2_sparse_classes_36k_train_028666
41,263
permissive
[ { "docstring": "Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The list to modify. @type _list: list @return: The modified list. @rtype: list", "name": "uniqify", "signature": "def uniqify(_list)" }, { "docstri...
2
stack_v2_sparse_classes_30k_train_008722
Implement the Python class `list` described below. Class description: A subclass of MokaUtils pertaining to 'list' objects. Method signatures and docstrings: - def uniqify(_list): Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The l...
Implement the Python class `list` described below. Class description: A subclass of MokaUtils pertaining to 'list' objects. Method signatures and docstrings: - def uniqify(_list): Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The l...
06867037842e2a074ae5ed3b0bdf4bf016a231a5
<|skeleton|> class list: """A subclass of MokaUtils pertaining to 'list' objects.""" def uniqify(_list): """Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The list to modify. @type _list: list @return: The modified li...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class list: """A subclass of MokaUtils pertaining to 'list' objects.""" def uniqify(_list): """Returns only unique elements in a list, while preserving order: From: http://www.peterbe.com/plog/uniqifiers-benchmark @param _list: The list to modify. @type _list: list @return: The modified list. @rtype: l...
the_stack_v2_python_sparse
XNATSlicer/XnatSlicerLib/ext/MokaUtils/MokaUtils.py
NrgXnat/XNATSlicer
train
4
6586a07641134eceb072ff59c6a2be3353eafd7c
[ "name_int = 'classlabels_int64s' if hasattr(self, 'classlabels_int64s') else 'classlabels_ints'\nif hasattr(self, 'classlabels_strings') and len(self.classlabels_strings) > 0:\n if hasattr(self, name_int) and len(getattr(self, name_int)) != 0:\n raise RuntimeError(f\"'{name_int}' must be empty if 'classla...
<|body_start_0|> name_int = 'classlabels_int64s' if hasattr(self, 'classlabels_int64s') else 'classlabels_ints' if hasattr(self, 'classlabels_strings') and len(self.classlabels_strings) > 0: if hasattr(self, name_int) and len(getattr(self, name_int)) != 0: raise RuntimeError(...
Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings.
_ClassifierCommon
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _ClassifierCommon: """Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings.""" def _post_process_label_attributes(self): """Replaces string labels by int64 labe...
stack_v2_sparse_classes_36k_train_028667
1,743
permissive
[ { "docstring": "Replaces string labels by int64 labels. It creates attributes *_classlabels_int64s_string*.", "name": "_post_process_label_attributes", "signature": "def _post_process_label_attributes(self)" }, { "docstring": "Replaces int64 predicted labels by the corresponding strings.", "...
2
null
Implement the Python class `_ClassifierCommon` described below. Class description: Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings. Method signatures and docstrings: - def _post_process_lab...
Implement the Python class `_ClassifierCommon` described below. Class description: Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings. Method signatures and docstrings: - def _post_process_lab...
27d6da4ecdd76e18292f265fde61d19b66937a5c
<|skeleton|> class _ClassifierCommon: """Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings.""" def _post_process_label_attributes(self): """Replaces string labels by int64 labe...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _ClassifierCommon: """Labels strings are not natively implemented in C++ runtime. The class stores the strings labels, replaces them by integer, calls the C++ codes and then replaces them by strings.""" def _post_process_label_attributes(self): """Replaces string labels by int64 labels. It create...
the_stack_v2_python_sparse
mlprodict/onnxrt/ops_cpu/_op_classifier_string.py
sdpython/mlprodict
train
60
1690392b6837024688c7ee5594f3beaf14883101
[ "d = {}\nfor i in range(len(order)):\n d[order[i]] = i\nmaxLenSoFar = 0\nfor word in words:\n maxLenSoFar = max(maxLenSoFar, len(word))\nfor i in range(len(words) - 1):\n cur = words[i]\n nxt = words[i + 1]\n ln = max(len(cur), len(nxt))\n for j in range(ln):\n if j >= len(nxt):\n ...
<|body_start_0|> d = {} for i in range(len(order)): d[order[i]] = i maxLenSoFar = 0 for word in words: maxLenSoFar = max(maxLenSoFar, len(word)) for i in range(len(words) - 1): cur = words[i] nxt = words[i + 1] ln = max(...
https://leetcode.com/problems/verifying-an-alien-dictionary/description/
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """https://leetcode.com/problems/verifying-an-alien-dictionary/description/""" def isAlienSorted(self, words, order): """:type words: List[str] :type order: str :rtype: bool""" <|body_0|> def isAlienSorted2(self, words, order): """:type words: List[str]...
stack_v2_sparse_classes_36k_train_028668
2,919
no_license
[ { "docstring": ":type words: List[str] :type order: str :rtype: bool", "name": "isAlienSorted", "signature": "def isAlienSorted(self, words, order)" }, { "docstring": ":type words: List[str] :type order: str :rtype: bool", "name": "isAlienSorted2", "signature": "def isAlienSorted2(self, ...
3
null
Implement the Python class `Solution` described below. Class description: https://leetcode.com/problems/verifying-an-alien-dictionary/description/ Method signatures and docstrings: - def isAlienSorted(self, words, order): :type words: List[str] :type order: str :rtype: bool - def isAlienSorted2(self, words, order): :...
Implement the Python class `Solution` described below. Class description: https://leetcode.com/problems/verifying-an-alien-dictionary/description/ Method signatures and docstrings: - def isAlienSorted(self, words, order): :type words: List[str] :type order: str :rtype: bool - def isAlienSorted2(self, words, order): :...
54d3d9530b25272d4a2e5dc33e7035c44f506dc5
<|skeleton|> class Solution: """https://leetcode.com/problems/verifying-an-alien-dictionary/description/""" def isAlienSorted(self, words, order): """:type words: List[str] :type order: str :rtype: bool""" <|body_0|> def isAlienSorted2(self, words, order): """:type words: List[str]...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """https://leetcode.com/problems/verifying-an-alien-dictionary/description/""" def isAlienSorted(self, words, order): """:type words: List[str] :type order: str :rtype: bool""" d = {} for i in range(len(order)): d[order[i]] = i maxLenSoFar = 0 ...
the_stack_v2_python_sparse
old/Session002/TopInterviewQuestions/VerifyinganAlienDictionary.py
MaxIakovliev/algorithms
train
0
7f193ea3b27e25e34fd214422066a0a15e910e96
[ "solutions = []\nself.backtrack([], solutions, 0, 0, n)\nreturn solutions", "if len(solution) < n * 2:\n if left < n:\n solution.append('(')\n left += 1\n self.backtrack(solution, solutions, left, right, n)\n left -= 1\n solution.pop()\n if right < left:\n solution....
<|body_start_0|> solutions = [] self.backtrack([], solutions, 0, 0, n) return solutions <|end_body_0|> <|body_start_1|> if len(solution) < n * 2: if left < n: solution.append('(') left += 1 self.backtrack(solution, solutions, l...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def generateParenthesis(self, n): """:type n: int :rtype: List[str]""" <|body_0|> def backtrack(self, solution, solutions, left, right, n): """`solution` is a growing list of '(' and ')' that can be potentially completed as a valid set of parentheses. `left...
stack_v2_sparse_classes_36k_train_028669
3,514
no_license
[ { "docstring": ":type n: int :rtype: List[str]", "name": "generateParenthesis", "signature": "def generateParenthesis(self, n)" }, { "docstring": "`solution` is a growing list of '(' and ')' that can be potentially completed as a valid set of parentheses. `left`: count of '(' in `solution`. `rig...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def generateParenthesis(self, n): :type n: int :rtype: List[str] - def backtrack(self, solution, solutions, left, right, n): `solution` is a growing list of '(' and ')' that can ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def generateParenthesis(self, n): :type n: int :rtype: List[str] - def backtrack(self, solution, solutions, left, right, n): `solution` is a growing list of '(' and ')' that can ...
69a960dd8f39e9c8435a3678852071e1085fcb72
<|skeleton|> class Solution: def generateParenthesis(self, n): """:type n: int :rtype: List[str]""" <|body_0|> def backtrack(self, solution, solutions, left, right, n): """`solution` is a growing list of '(' and ')' that can be potentially completed as a valid set of parentheses. `left...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def generateParenthesis(self, n): """:type n: int :rtype: List[str]""" solutions = [] self.backtrack([], solutions, 0, 0, n) return solutions def backtrack(self, solution, solutions, left, right, n): """`solution` is a growing list of '(' and ')' that can...
the_stack_v2_python_sparse
python/dp/1d/lc22.py
chao-ji/LeetCode
train
1
184397e1208d1ff6d2b9eadb44702e7b44781524
[ "self.api = None\nself._base_url = None\nself._username = None\nself._password = None\nself._existing_entry = None\nself._description_placeholders = None", "errors = {}\nif user_input is None:\n return self._show_setup_form(user_input, errors)\nreturn await self._validate_and_create_entry(user_input, 'user')",...
<|body_start_0|> self.api = None self._base_url = None self._username = None self._password = None self._existing_entry = None self._description_placeholders = None <|end_body_0|> <|body_start_1|> errors = {} if user_input is None: return self...
Handle a FireServiceRota config flow.
FireServiceRotaFlowHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FireServiceRotaFlowHandler: """Handle a FireServiceRota config flow.""" def __init__(self): """Initialize config flow.""" <|body_0|> async def async_step_user(self, user_input=None): """Handle a flow initiated by the user.""" <|body_1|> async def _va...
stack_v2_sparse_classes_36k_train_028670
4,479
permissive
[ { "docstring": "Initialize config flow.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Handle a flow initiated by the user.", "name": "async_step_user", "signature": "async def async_step_user(self, user_input=None)" }, { "docstring": "Check if config ...
6
stack_v2_sparse_classes_30k_train_006243
Implement the Python class `FireServiceRotaFlowHandler` described below. Class description: Handle a FireServiceRota config flow. Method signatures and docstrings: - def __init__(self): Initialize config flow. - async def async_step_user(self, user_input=None): Handle a flow initiated by the user. - async def _valida...
Implement the Python class `FireServiceRotaFlowHandler` described below. Class description: Handle a FireServiceRota config flow. Method signatures and docstrings: - def __init__(self): Initialize config flow. - async def async_step_user(self, user_input=None): Handle a flow initiated by the user. - async def _valida...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class FireServiceRotaFlowHandler: """Handle a FireServiceRota config flow.""" def __init__(self): """Initialize config flow.""" <|body_0|> async def async_step_user(self, user_input=None): """Handle a flow initiated by the user.""" <|body_1|> async def _va...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FireServiceRotaFlowHandler: """Handle a FireServiceRota config flow.""" def __init__(self): """Initialize config flow.""" self.api = None self._base_url = None self._username = None self._password = None self._existing_entry = None self._description...
the_stack_v2_python_sparse
homeassistant/components/fireservicerota/config_flow.py
home-assistant/core
train
35,501
42ba469dc749b3fe8d7e0418e34e0f4cb1b38fe9
[ "self.name = name\nself.unit_set = unit_set\nself.unit_name = units_of_quantities[self.name]\nunit_expr = sm.sympify(self.unit_name)\nunit_expr = unit_expr.subs(derived_units)\nself.symbolic_value = sm.sympify(str(unit_expr))\natoms = self.symbolic_value.atoms(sm.Symbol)\nself.def_units = [Unit(atom.name) for atom ...
<|body_start_0|> self.name = name self.unit_set = unit_set self.unit_name = units_of_quantities[self.name] unit_expr = sm.sympify(self.unit_name) unit_expr = unit_expr.subs(derived_units) self.symbolic_value = sm.sympify(str(unit_expr)) atoms = self.symbolic_value...
A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quantity('stress', unit_set) >>> q1() '1.0 Pa' Show its unit using various prefi...
Quantity
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Quantity: """A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quantity('stress', unit_set) >>> q1() '1.0 P...
stack_v2_sparse_classes_36k_train_028671
8,377
permissive
[ { "docstring": "Create a quantity in the given unit set. The name must be listed in the units_of_quantities dictionary.", "name": "__init__", "signature": "def __init__(self, name, unit_set)" }, { "docstring": "Get auxiliary dictionaries for a unit set.", "name": "_get_dicts", "signature...
3
stack_v2_sparse_classes_30k_train_006656
Implement the Python class `Quantity` described below. Class description: A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quant...
Implement the Python class `Quantity` described below. Class description: A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quant...
0c2d1690e764b601b2687be1e4261b82207ca366
<|skeleton|> class Quantity: """A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quantity('stress', unit_set) >>> q1() '1.0 P...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Quantity: """A physical quantity in a given set of basic units. Examples -------- Construct the stress quantity: >>> from sfepy.mechanics.units import Unit, Quantity >>> units = ['m', 's', 'kg', 'C'] >>> unit_set = [Unit(key) for key in units] >>> q1 = Quantity('stress', unit_set) >>> q1() '1.0 Pa' Show its u...
the_stack_v2_python_sparse
sfepy/mechanics/units.py
sfepy/sfepy
train
651
72c3835d959005f7b0756e4dcb680d50b2a476f3
[ "super(World, self).__init__(**kwargs)\nself.contact_network = contact_network\nself.agent_list = agent_list", "assert agent in self.agent_list, 'agent is not in agent_list'\nindex = self.agent_list.index(agent)\nisolated = True\ni = 0\nn = self.contact_network[0].size\nwhile isolated and i < n:\n if self.cont...
<|body_start_0|> super(World, self).__init__(**kwargs) self.contact_network = contact_network self.agent_list = agent_list <|end_body_0|> <|body_start_1|> assert agent in self.agent_list, 'agent is not in agent_list' index = self.agent_list.index(agent) isolated = True ...
Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters.
World
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class World: """Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters.""" def __init__(self, *, contact_network=None, agent_list=[], **kwargs): """Initialize an instance of World. Parameters ---------- agent_l...
stack_v2_sparse_classes_36k_train_028672
3,999
permissive
[ { "docstring": "Initialize an instance of World. Parameters ---------- agent_list", "name": "__init__", "signature": "def __init__(self, *, contact_network=None, agent_list=[], **kwargs)" }, { "docstring": "Return True if agent has a neighbor and False if not. Parameters ---------- agent Agent: ...
5
null
Implement the Python class `World` described below. Class description: Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters. Method signatures and docstrings: - def __init__(self, *, contact_network=None, agent_list=[], **kwargs): Initi...
Implement the Python class `World` described below. Class description: Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters. Method signatures and docstrings: - def __init__(self, *, contact_network=None, agent_list=[], **kwargs): Initi...
c5741080db35713ff469d19698519499c46583ca
<|skeleton|> class World: """Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters.""" def __init__(self, *, contact_network=None, agent_list=[], **kwargs): """Initialize an instance of World. Parameters ---------- agent_l...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class World: """Define properties of exploit_social_learning.world. Inherits from I.World as the interface with all necessary variables and parameters.""" def __init__(self, *, contact_network=None, agent_list=[], **kwargs): """Initialize an instance of World. Parameters ---------- agent_list""" ...
the_stack_v2_python_sparse
pycopancore/model_components/exploit_social_learning/implementation/world.py
vishalbelsare/pycopancore
train
0
228be976e061fa94685b5e75caadee4501baf123
[ "queue = deque([root])\ncur_lv = []\nwhile queue:\n cur_lv = []\n for i in range(len(queue)):\n cnode = queue.popleft()\n if not cur_lv:\n cur_lv.append(cnode.val)\n if cnode.left:\n queue.append(cnode.left)\n if cnode.right:\n queue.append(cnode.ri...
<|body_start_0|> queue = deque([root]) cur_lv = [] while queue: cur_lv = [] for i in range(len(queue)): cnode = queue.popleft() if not cur_lv: cur_lv.append(cnode.val) if cnode.left: q...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findBottomLeftValueDFS(self, root: TreeNode) -> int: """BFS Solution with queue""" <|body_0|> def findBottomLeftValueBFS(self, root: TreeNode) -> int: """DFS Solution with stack""" <|body_1|> <|end_skeleton|> <|body_start_0|> queue = d...
stack_v2_sparse_classes_36k_train_028673
1,730
permissive
[ { "docstring": "BFS Solution with queue", "name": "findBottomLeftValueDFS", "signature": "def findBottomLeftValueDFS(self, root: TreeNode) -> int" }, { "docstring": "DFS Solution with stack", "name": "findBottomLeftValueBFS", "signature": "def findBottomLeftValueBFS(self, root: TreeNode)...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findBottomLeftValueDFS(self, root: TreeNode) -> int: BFS Solution with queue - def findBottomLeftValueBFS(self, root: TreeNode) -> int: DFS Solution with stack
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findBottomLeftValueDFS(self, root: TreeNode) -> int: BFS Solution with queue - def findBottomLeftValueBFS(self, root: TreeNode) -> int: DFS Solution with stack <|skeleton|> ...
c07b555127ee89d6f461cea7cd87811c382086ff
<|skeleton|> class Solution: def findBottomLeftValueDFS(self, root: TreeNode) -> int: """BFS Solution with queue""" <|body_0|> def findBottomLeftValueBFS(self, root: TreeNode) -> int: """DFS Solution with stack""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findBottomLeftValueDFS(self, root: TreeNode) -> int: """BFS Solution with queue""" queue = deque([root]) cur_lv = [] while queue: cur_lv = [] for i in range(len(queue)): cnode = queue.popleft() if not cur_lv:...
the_stack_v2_python_sparse
Leetcode/week_5/p0513_find_bottom_left_tree_value.py
scohen40/wallbreakers_projects
train
0
9c62560105cc0cce95532315a357d22d164ece7d
[ "queryset = EventCategory.objects.filter(parent=None)\nserializer = EventCategoryChildrenSerializer(queryset, many=True, context={'request': request})\nreturn Response(serializer.data)", "queryset = EventCategory.objects.all()\ncategory = get_object_or_404(queryset, pk=pk)\nserializer = EventCategoryChildrenSeria...
<|body_start_0|> queryset = EventCategory.objects.filter(parent=None) serializer = EventCategoryChildrenSerializer(queryset, many=True, context={'request': request}) return Response(serializer.data) <|end_body_0|> <|body_start_1|> queryset = EventCategory.objects.all() category ...
EventCategoryViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventCategoryViewSet: def list(self, request): """Returns the tree of all event categories via GET. Allows any.""" <|body_0|> def retrieve(self, request, pk): """Returns a particular branch of event categories via GET. Allows any.""" <|body_1|> <|end_skeleto...
stack_v2_sparse_classes_36k_train_028674
9,571
no_license
[ { "docstring": "Returns the tree of all event categories via GET. Allows any.", "name": "list", "signature": "def list(self, request)" }, { "docstring": "Returns a particular branch of event categories via GET. Allows any.", "name": "retrieve", "signature": "def retrieve(self, request, p...
2
stack_v2_sparse_classes_30k_train_003883
Implement the Python class `EventCategoryViewSet` described below. Class description: Implement the EventCategoryViewSet class. Method signatures and docstrings: - def list(self, request): Returns the tree of all event categories via GET. Allows any. - def retrieve(self, request, pk): Returns a particular branch of e...
Implement the Python class `EventCategoryViewSet` described below. Class description: Implement the EventCategoryViewSet class. Method signatures and docstrings: - def list(self, request): Returns the tree of all event categories via GET. Allows any. - def retrieve(self, request, pk): Returns a particular branch of e...
78ef668111d7552c98795c8aa07698b642cf09a5
<|skeleton|> class EventCategoryViewSet: def list(self, request): """Returns the tree of all event categories via GET. Allows any.""" <|body_0|> def retrieve(self, request, pk): """Returns a particular branch of event categories via GET. Allows any.""" <|body_1|> <|end_skeleto...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EventCategoryViewSet: def list(self, request): """Returns the tree of all event categories via GET. Allows any.""" queryset = EventCategory.objects.filter(parent=None) serializer = EventCategoryChildrenSerializer(queryset, many=True, context={'request': request}) return Respons...
the_stack_v2_python_sparse
backend/core/views.py
lawrencejberry/bridge
train
0
769a44c9d325a1bbc356c9db97a6e338a4e2bcd5
[ "if not s or not wordDict:\n return []\nn = len(s)\nf = [[] for i in range(n)]\nfor i in range(n - 1, -1, -1):\n for j in range(i + 1, n + 1):\n if s[i:j] in wordDict:\n if j == n or len(f[j]) > 0:\n f[i].append(j)\nprint(f)\nreturn self.dfs(0, s, f, '', [])", "if p == len(s...
<|body_start_0|> if not s or not wordDict: return [] n = len(s) f = [[] for i in range(n)] for i in range(n - 1, -1, -1): for j in range(i + 1, n + 1): if s[i:j] in wordDict: if j == n or len(f[j]) > 0: f...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def wordBreak(self, s, wordDict): """利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,来加块之后的搜索""" <|body_0|> def dfs(self, p, s, f, now, res): """深度优先搜索,当前单词搜索完之后...
stack_v2_sparse_classes_36k_train_028675
2,910
no_license
[ { "docstring": "利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,来加块之后的搜索", "name": "wordBreak", "signature": "def wordBreak(self, s, wordDict)" }, { "docstring": "深度优先搜索,当前单词搜索完之后,从结束为止下一个字符开始搜索", ...
2
stack_v2_sparse_classes_30k_train_016192
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordBreak(self, s, wordDict): 利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def wordBreak(self, s, wordDict): 利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,...
95dddb78bccd169d9d219a473627361fe739ab5e
<|skeleton|> class Solution: def wordBreak(self, s, wordDict): """利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,来加块之后的搜索""" <|body_0|> def dfs(self, p, s, f, now, res): """深度优先搜索,当前单词搜索完之后...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def wordBreak(self, s, wordDict): """利用f[i]记录以i为起点的每个片段的终点j,并且片段要在在字典中, 然后从0开始搜索,每次给当前片段加上空格,然后以当前片段的末尾作为 下一次搜索的头部,避免不必要的搜索 深度优先搜索的思想不是体现在字符搜索上,而是单词搜索上 所以要先找出以各个位置字符为开始的单词通过记录最后的位置,来加块之后的搜索""" if not s or not wordDict: return [] n = len(s) f = [[] for i in...
the_stack_v2_python_sparse
BFS&DFS/wordBreak2.py
Philex5/codingPractice
train
0
755736cbfcedd7616f93d2b7c4a148e5548063e4
[ "gini = GiniFile(filename_or_obj)\ngini_attrs = gini.get_attrs()\ncoords = dict(gini._make_coord_vars() + [gini._make_time_var()])\ncoords['time'] = CFDatetimeCoder().decode(coords['time'])\n(proj_name, proj_var), (data_name, data_var) = gini._make_data_vars()\ndata_var.attrs.pop('coordinates')\ndecoded_data_var = ...
<|body_start_0|> gini = GiniFile(filename_or_obj) gini_attrs = gini.get_attrs() coords = dict(gini._make_coord_vars() + [gini._make_time_var()]) coords['time'] = CFDatetimeCoder().decode(coords['time']) (proj_name, proj_var), (data_name, data_var) = gini._make_data_vars() ...
Entry point for direct reading of GINI data into Xarray.
GiniXarrayBackend
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GiniXarrayBackend: """Entry point for direct reading of GINI data into Xarray.""" def open_dataset(self, filename_or_obj, *, drop_variables=None): """Open the GINI datafile as a Xarray dataset. This is the main entrypoint for plugging into Xarray read support.""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_028676
18,582
permissive
[ { "docstring": "Open the GINI datafile as a Xarray dataset. This is the main entrypoint for plugging into Xarray read support.", "name": "open_dataset", "signature": "def open_dataset(self, filename_or_obj, *, drop_variables=None)" }, { "docstring": "Try to guess whether we can read this file. T...
2
stack_v2_sparse_classes_30k_val_000383
Implement the Python class `GiniXarrayBackend` described below. Class description: Entry point for direct reading of GINI data into Xarray. Method signatures and docstrings: - def open_dataset(self, filename_or_obj, *, drop_variables=None): Open the GINI datafile as a Xarray dataset. This is the main entrypoint for p...
Implement the Python class `GiniXarrayBackend` described below. Class description: Entry point for direct reading of GINI data into Xarray. Method signatures and docstrings: - def open_dataset(self, filename_or_obj, *, drop_variables=None): Open the GINI datafile as a Xarray dataset. This is the main entrypoint for p...
c7124e6f375eb5810ce49d53c9d5501c2efdfb75
<|skeleton|> class GiniXarrayBackend: """Entry point for direct reading of GINI data into Xarray.""" def open_dataset(self, filename_or_obj, *, drop_variables=None): """Open the GINI datafile as a Xarray dataset. This is the main entrypoint for plugging into Xarray read support.""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GiniXarrayBackend: """Entry point for direct reading of GINI data into Xarray.""" def open_dataset(self, filename_or_obj, *, drop_variables=None): """Open the GINI datafile as a Xarray dataset. This is the main entrypoint for plugging into Xarray read support.""" gini = GiniFile(filename_...
the_stack_v2_python_sparse
src/metpy/io/gini.py
Unidata/MetPy
train
1,041
0e92fc0cc31387f1ae59ac44028ba37d9a2d664e
[ "convid = kwargs['convid']\nsender = kwargs['sender']\nlocation = kwargs['location']\nconv = Conversation.objects.get(convid=convid)\nassert sender in conv.members, f'sender_error {convid} {sender}'\nkwargs['location'] = location if isinstance(location, dict) else {}\nkwargs['symbol'] = kwargs.get('symbol') or conv...
<|body_start_0|> convid = kwargs['convid'] sender = kwargs['sender'] location = kwargs['location'] conv = Conversation.objects.get(convid=convid) assert sender in conv.members, f'sender_error {convid} {sender}' kwargs['location'] = location if isinstance(location, dict) e...
MessageManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MessageManager: def _msg_create(self, **kwargs): """消息创建""" <|body_0|> def trigger_msg_add(self, contact, trigger, content, symbol, location=None, **kwargs): """触发消息添加""" <|body_1|> def stay_msg_add(self, contact, content, location=None): """留言消息...
stack_v2_sparse_classes_36k_train_028677
25,386
no_license
[ { "docstring": "消息创建", "name": "_msg_create", "signature": "def _msg_create(self, **kwargs)" }, { "docstring": "触发消息添加", "name": "trigger_msg_add", "signature": "def trigger_msg_add(self, contact, trigger, content, symbol, location=None, **kwargs)" }, { "docstring": "留言消息", "...
4
null
Implement the Python class `MessageManager` described below. Class description: Implement the MessageManager class. Method signatures and docstrings: - def _msg_create(self, **kwargs): 消息创建 - def trigger_msg_add(self, contact, trigger, content, symbol, location=None, **kwargs): 触发消息添加 - def stay_msg_add(self, contact...
Implement the Python class `MessageManager` described below. Class description: Implement the MessageManager class. Method signatures and docstrings: - def _msg_create(self, **kwargs): 消息创建 - def trigger_msg_add(self, contact, trigger, content, symbol, location=None, **kwargs): 触发消息添加 - def stay_msg_add(self, contact...
b7ed6588e13d2916a4162d56509d2794742a1eb1
<|skeleton|> class MessageManager: def _msg_create(self, **kwargs): """消息创建""" <|body_0|> def trigger_msg_add(self, contact, trigger, content, symbol, location=None, **kwargs): """触发消息添加""" <|body_1|> def stay_msg_add(self, contact, content, location=None): """留言消息...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MessageManager: def _msg_create(self, **kwargs): """消息创建""" convid = kwargs['convid'] sender = kwargs['sender'] location = kwargs['location'] conv = Conversation.objects.get(convid=convid) assert sender in conv.members, f'sender_error {convid} {sender}' ...
the_stack_v2_python_sparse
server/applibs/convert/models/contact.py
fanshuai/kubrick
train
0
b5e97b34b7b58e6f7e5e008d440401792011b40b
[ "if reference is not None and query is not None:\n raise ValueError('Both reference and query params provided')\nif reference is not None:\n sieve = ItemImplicitSieve(data, reference)\nif query is not None:\n sieve = ItemExplicitSieve(data, query)\nreturn sieve", "if isinstance(reference_query_sieve, (li...
<|body_start_0|> if reference is not None and query is not None: raise ValueError('Both reference and query params provided') if reference is not None: sieve = ItemImplicitSieve(data, reference) if query is not None: sieve = ItemExplicitSieve(data, query) ...
ItemSievesFactory
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ItemSievesFactory: def from_ref_and_query(data, reference=None, query=None): """Both reference and query must not be provided at the same time :param data: DataSet of the sieve :param reference: A list of item keys :param query: An explicit query""" <|body_0|> def from_rqs(d...
stack_v2_sparse_classes_36k_train_028678
12,842
no_license
[ { "docstring": "Both reference and query must not be provided at the same time :param data: DataSet of the sieve :param reference: A list of item keys :param query: An explicit query", "name": "from_ref_and_query", "signature": "def from_ref_and_query(data, reference=None, query=None)" }, { "doc...
2
stack_v2_sparse_classes_30k_train_014867
Implement the Python class `ItemSievesFactory` described below. Class description: Implement the ItemSievesFactory class. Method signatures and docstrings: - def from_ref_and_query(data, reference=None, query=None): Both reference and query must not be provided at the same time :param data: DataSet of the sieve :para...
Implement the Python class `ItemSievesFactory` described below. Class description: Implement the ItemSievesFactory class. Method signatures and docstrings: - def from_ref_and_query(data, reference=None, query=None): Both reference and query must not be provided at the same time :param data: DataSet of the sieve :para...
76761cf513a438a7bc24f6ffa748c9ccacb6e4b4
<|skeleton|> class ItemSievesFactory: def from_ref_and_query(data, reference=None, query=None): """Both reference and query must not be provided at the same time :param data: DataSet of the sieve :param reference: A list of item keys :param query: An explicit query""" <|body_0|> def from_rqs(d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ItemSievesFactory: def from_ref_and_query(data, reference=None, query=None): """Both reference and query must not be provided at the same time :param data: DataSet of the sieve :param reference: A list of item keys :param query: An explicit query""" if reference is not None and query is not No...
the_stack_v2_python_sparse
indyva/dynamics/sieve.py
crispamares/indyva
train
1
b6969e4e9fe516cd33731f20e9f48af65813b018
[ "super().__init__()\nself.num_classes = num_classes\nself.utterance_proj = nn.Linear(embedding_dim, embedding_dim)\nself.activation = nn.functional.gelu\nself.layer1 = nn.Linear(embedding_dim, num_classes)", "utterance_embedding = self.utterance_proj(encoded_utterance)\nutterance_embedding = self.activation(utter...
<|body_start_0|> super().__init__() self.num_classes = num_classes self.utterance_proj = nn.Linear(embedding_dim, embedding_dim) self.activation = nn.functional.gelu self.layer1 = nn.Linear(embedding_dim, num_classes) <|end_body_0|> <|body_start_1|> utterance_embedding =...
LogitsQA
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogitsQA: def __init__(self, num_classes: int, embedding_dim: int): """Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes for which logits are to be generated. embedding_dim: hidden size of the BERT Returns: A tensor of ...
stack_v2_sparse_classes_36k_train_028679
7,653
permissive
[ { "docstring": "Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes for which logits are to be generated. embedding_dim: hidden size of the BERT Returns: A tensor of shape (batch_size, num_classes) containing the logits.", "name": "__init__"...
2
null
Implement the Python class `LogitsQA` described below. Class description: Implement the LogitsQA class. Method signatures and docstrings: - def __init__(self, num_classes: int, embedding_dim: int): Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes f...
Implement the Python class `LogitsQA` described below. Class description: Implement the LogitsQA class. Method signatures and docstrings: - def __init__(self, num_classes: int, embedding_dim: int): Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes f...
c20a16ea8aa2a9d8e31a98eb22178ddb9d5935e7
<|skeleton|> class LogitsQA: def __init__(self, num_classes: int, embedding_dim: int): """Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes for which logits are to be generated. embedding_dim: hidden size of the BERT Returns: A tensor of ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LogitsQA: def __init__(self, num_classes: int, embedding_dim: int): """Get logits for elements by conditioning on input embedding. Args: num_classes: An int containing the number of classes for which logits are to be generated. embedding_dim: hidden size of the BERT Returns: A tensor of shape (batch_s...
the_stack_v2_python_sparse
nemo/collections/nlp/modules/dialogue_state_tracking/sgd_decoder.py
NVIDIA/NeMo
train
7,957
0960020f36e83c50446ef6ea1006b6c5531c6f8d
[ "import cppyy\ncppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 {}')\ncppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 { class PyCpp12_A {}; int PyCpp12_f() {return 32;}; }')\nself.assertTrue(cppyy.gbl.PyCpp12_ns_test1.PyCpp12_A())\nself.assertEqual(cppyy.gbl.PyCpp12_ns_test1.PyCpp12_f()...
<|body_start_0|> import cppyy cppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 {}') cppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 { class PyCpp12_A {}; int PyCpp12_f() {return 32;}; }') self.assertTrue(cppyy.gbl.PyCpp12_ns_test1.PyCpp12_A()) self.as...
Cpp12NamespaceLazyFunctions
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cpp12NamespaceLazyFunctions: def test1NamespaceLazyFunctions(self): """Lazy lookup of late created functions""" <|body_0|> def test2NamespaceOverloadedLazyFunctions(self): """Lazy lookup of late created overloaded functions""" <|body_1|> <|end_skeleton|> <|...
stack_v2_sparse_classes_36k_train_028680
30,462
no_license
[ { "docstring": "Lazy lookup of late created functions", "name": "test1NamespaceLazyFunctions", "signature": "def test1NamespaceLazyFunctions(self)" }, { "docstring": "Lazy lookup of late created overloaded functions", "name": "test2NamespaceOverloadedLazyFunctions", "signature": "def tes...
2
stack_v2_sparse_classes_30k_train_014259
Implement the Python class `Cpp12NamespaceLazyFunctions` described below. Class description: Implement the Cpp12NamespaceLazyFunctions class. Method signatures and docstrings: - def test1NamespaceLazyFunctions(self): Lazy lookup of late created functions - def test2NamespaceOverloadedLazyFunctions(self): Lazy lookup ...
Implement the Python class `Cpp12NamespaceLazyFunctions` described below. Class description: Implement the Cpp12NamespaceLazyFunctions class. Method signatures and docstrings: - def test1NamespaceLazyFunctions(self): Lazy lookup of late created functions - def test2NamespaceOverloadedLazyFunctions(self): Lazy lookup ...
134508460915282a5d82d6cbbb6e6afa14653413
<|skeleton|> class Cpp12NamespaceLazyFunctions: def test1NamespaceLazyFunctions(self): """Lazy lookup of late created functions""" <|body_0|> def test2NamespaceOverloadedLazyFunctions(self): """Lazy lookup of late created overloaded functions""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cpp12NamespaceLazyFunctions: def test1NamespaceLazyFunctions(self): """Lazy lookup of late created functions""" import cppyy cppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 {}') cppyy.gbl.gInterpreter.ProcessLine('namespace PyCpp12_ns_test1 { class PyCpp12_A {}; ...
the_stack_v2_python_sparse
python/cpp/PyROOT_advancedtests.py
root-project/roottest
train
41
3ec7aaee6646079936a9e3da7a8c87cefbfcc538
[ "bindptr = BINDPTR()\ndesckind = DESCKIND()\nti = POINTER(ITypeInfo)()\nself.__com_Bind(name, lHashVal, flags, byref(ti), byref(desckind), byref(bindptr))\nkind = desckind.value\nif kind == DESCKIND_FUNCDESC:\n fd = bindptr.lpfuncdesc[0]\n fd.__ref__ = weakref.ref(fd, lambda dead: ti.ReleaseFuncDesc(bindptr.l...
<|body_start_0|> bindptr = BINDPTR() desckind = DESCKIND() ti = POINTER(ITypeInfo)() self.__com_Bind(name, lHashVal, flags, byref(ti), byref(desckind), byref(bindptr)) kind = desckind.value if kind == DESCKIND_FUNCDESC: fd = bindptr.lpfuncdesc[0] f...
ITypeComp
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ITypeComp: def Bind(self, name, flags=0, lHashVal=0): """Bind to a name""" <|body_0|> def BindType(self, name, lHashVal=0): """Bind a type, and return both the typeinfo and typecomp for it.""" <|body_1|> <|end_skeleton|> <|body_start_0|> bindptr = B...
stack_v2_sparse_classes_36k_train_028681
31,098
permissive
[ { "docstring": "Bind to a name", "name": "Bind", "signature": "def Bind(self, name, flags=0, lHashVal=0)" }, { "docstring": "Bind a type, and return both the typeinfo and typecomp for it.", "name": "BindType", "signature": "def BindType(self, name, lHashVal=0)" } ]
2
null
Implement the Python class `ITypeComp` described below. Class description: Implement the ITypeComp class. Method signatures and docstrings: - def Bind(self, name, flags=0, lHashVal=0): Bind to a name - def BindType(self, name, lHashVal=0): Bind a type, and return both the typeinfo and typecomp for it.
Implement the Python class `ITypeComp` described below. Class description: Implement the ITypeComp class. Method signatures and docstrings: - def Bind(self, name, flags=0, lHashVal=0): Bind to a name - def BindType(self, name, lHashVal=0): Bind a type, and return both the typeinfo and typecomp for it. <|skeleton|> c...
c2d0098a309b6ce8c756ff840bfb53fb291747b6
<|skeleton|> class ITypeComp: def Bind(self, name, flags=0, lHashVal=0): """Bind to a name""" <|body_0|> def BindType(self, name, lHashVal=0): """Bind a type, and return both the typeinfo and typecomp for it.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ITypeComp: def Bind(self, name, flags=0, lHashVal=0): """Bind to a name""" bindptr = BINDPTR() desckind = DESCKIND() ti = POINTER(ITypeInfo)() self.__com_Bind(name, lHashVal, flags, byref(ti), byref(desckind), byref(bindptr)) kind = desckind.value if kin...
the_stack_v2_python_sparse
virt/Lib/site-packages/comtypes/typeinfo.py
JoaoSevergnini/metalpy
train
3
8c6c7b820e394fb0f2ebbd4c3eb37090ca3d68a7
[ "self._syntax_analyzer = syntax_analyzer\nself._semantic_analyzer = semantic_analyzer\nself._logger = logging.getLogger(__name__)", "with io.open(input_file_path, 'r', encoding=encoding) as input_file:\n manifest_json = self.get_manifest_json(input_file)\n manifest = self._syntax_analyzer.analyze(manifest_j...
<|body_start_0|> self._syntax_analyzer = syntax_analyzer self._semantic_analyzer = semantic_analyzer self._logger = logging.getLogger(__name__) <|end_body_0|> <|body_start_1|> with io.open(input_file_path, 'r', encoding=encoding) as input_file: manifest_json = self.get_manif...
Base class for RWPM-compatible parsers.
DocumentParser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DocumentParser: """Base class for RWPM-compatible parsers.""" def __init__(self, syntax_analyzer, semantic_analyzer): """Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: syntax.SyntaxAnalyzer :param semantic_analyzer: Semantic ...
stack_v2_sparse_classes_36k_train_028682
23,409
permissive
[ { "docstring": "Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: syntax.SyntaxAnalyzer :param semantic_analyzer: Semantic analyser :type semantic_analyzer: semantic.SemanticAnalyzer", "name": "__init__", "signature": "def __init__(self, syntax_ana...
6
stack_v2_sparse_classes_30k_test_000652
Implement the Python class `DocumentParser` described below. Class description: Base class for RWPM-compatible parsers. Method signatures and docstrings: - def __init__(self, syntax_analyzer, semantic_analyzer): Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: ...
Implement the Python class `DocumentParser` described below. Class description: Base class for RWPM-compatible parsers. Method signatures and docstrings: - def __init__(self, syntax_analyzer, semantic_analyzer): Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: ...
662cc7e0721d0153857c8c17a37e2a6df86f8ce6
<|skeleton|> class DocumentParser: """Base class for RWPM-compatible parsers.""" def __init__(self, syntax_analyzer, semantic_analyzer): """Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: syntax.SyntaxAnalyzer :param semantic_analyzer: Semantic ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DocumentParser: """Base class for RWPM-compatible parsers.""" def __init__(self, syntax_analyzer, semantic_analyzer): """Initialize a new instance of Parser class. :param syntax_analyzer: Syntax analyzer :type syntax_analyzer: syntax.SyntaxAnalyzer :param semantic_analyzer: Semantic analyser :typ...
the_stack_v2_python_sparse
core/util/webpub_manifest_parser/core/parsers.py
NYPL-Simplified/circulation
train
20
56134ef0a34c12035d17c7023066f2a4676ac77a
[ "serializer = self.get_serializer(data=request.data)\nserializer.is_valid(raise_exception=True)\nserializer.save()\nreturn Response(serializer.data, status=status.HTTP_201_CREATED)", "username = request.data.get('username')\npassword = request.data.get('password')\nqueryset = Users.queryset.all().filter(Q(usernam...
<|body_start_0|> serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) serializer.save() return Response(serializer.data, status=status.HTTP_201_CREATED) <|end_body_0|> <|body_start_1|> username = request.data.get('username') passw...
Users
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Users: def register(self, request, *args, **kwargs): """创建用户接口 :param request: :param args: :param kwargs: :return:""" <|body_0|> def login(self, request, *args, **kwargs): """登录接口 :param request: :param args: :param kwargs: :return:""" <|body_1|> def ge...
stack_v2_sparse_classes_36k_train_028683
4,176
no_license
[ { "docstring": "创建用户接口 :param request: :param args: :param kwargs: :return:", "name": "register", "signature": "def register(self, request, *args, **kwargs)" }, { "docstring": "登录接口 :param request: :param args: :param kwargs: :return:", "name": "login", "signature": "def login(self, requ...
3
stack_v2_sparse_classes_30k_train_000462
Implement the Python class `Users` described below. Class description: Implement the Users class. Method signatures and docstrings: - def register(self, request, *args, **kwargs): 创建用户接口 :param request: :param args: :param kwargs: :return: - def login(self, request, *args, **kwargs): 登录接口 :param request: :param args:...
Implement the Python class `Users` described below. Class description: Implement the Users class. Method signatures and docstrings: - def register(self, request, *args, **kwargs): 创建用户接口 :param request: :param args: :param kwargs: :return: - def login(self, request, *args, **kwargs): 登录接口 :param request: :param args:...
03328eed92b3facac442f9c29eb64f906075b745
<|skeleton|> class Users: def register(self, request, *args, **kwargs): """创建用户接口 :param request: :param args: :param kwargs: :return:""" <|body_0|> def login(self, request, *args, **kwargs): """登录接口 :param request: :param args: :param kwargs: :return:""" <|body_1|> def ge...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Users: def register(self, request, *args, **kwargs): """创建用户接口 :param request: :param args: :param kwargs: :return:""" serializer = self.get_serializer(data=request.data) serializer.is_valid(raise_exception=True) serializer.save() return Response(serializer.data, status...
the_stack_v2_python_sparse
apps/users/views.py
yycarry1994/fccTestPlatform
train
2
89f507bc0e205ae3fc33ab4b8d80c3be9424c360
[ "print('Loading weights to MidasNet: ', path)\nsuper(MidasNet, self).__init__()\nuse_pretrained = False if path else True\nself.pretrained, self.scratch = _make_encoder(backbone, features, use_pretrained)\nself.scratch.refinenet4 = FeatureFusionBlock(features)\nself.scratch.refinenet3 = FeatureFusionBlock(features)...
<|body_start_0|> print('Loading weights to MidasNet: ', path) super(MidasNet, self).__init__() use_pretrained = False if path else True self.pretrained, self.scratch = _make_encoder(backbone, features, use_pretrained) self.scratch.refinenet4 = FeatureFusionBlock(features) ...
Network for monocular depth estimation.
MidasNet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MidasNet: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256, backbone='resnet50', non_negative=True): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. back...
stack_v2_sparse_classes_36k_train_028684
13,019
permissive
[ { "docstring": "Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, optional): Backbone network for encoder. Defaults to resnet50", "name": "__init__", "signature": "def __init__(self, path=None, features=...
2
stack_v2_sparse_classes_30k_train_003845
Implement the Python class `MidasNet` described below. Class description: Network for monocular depth estimation. Method signatures and docstrings: - def __init__(self, path=None, features=256, backbone='resnet50', non_negative=True): Init. Args: path (str, optional): Path to saved model. Defaults to None. features (...
Implement the Python class `MidasNet` described below. Class description: Network for monocular depth estimation. Method signatures and docstrings: - def __init__(self, path=None, features=256, backbone='resnet50', non_negative=True): Init. Args: path (str, optional): Path to saved model. Defaults to None. features (...
a00c3619bf4042e446e1919087f0b09fe9fa3a65
<|skeleton|> class MidasNet: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256, backbone='resnet50', non_negative=True): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. back...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MidasNet: """Network for monocular depth estimation.""" def __init__(self, path=None, features=256, backbone='resnet50', non_negative=True): """Init. Args: path (str, optional): Path to saved model. Defaults to None. features (int, optional): Number of features. Defaults to 256. backbone (str, op...
the_stack_v2_python_sparse
nasws/cnn/search_space/monodepth/models/midas_net.py
kcyu2014/nas-landmarkreg
train
10
0568df2675059755847813b3a420f0ae7504994b
[ "if mr.shard_id is None:\n return {'message': 'Cannot proceed without a valid shard_id.'}\nuser_id = mr.specified_logged_in_user_id\nauth = authdata.AuthData.FromUserID(mr.cnxn, user_id, self.services)\nproject_id = mr.specified_project_id\nproject = self.services.project.GetProject(mr.cnxn, project_id)\nperms =...
<|body_start_0|> if mr.shard_id is None: return {'message': 'Cannot proceed without a valid shard_id.'} user_id = mr.specified_logged_in_user_id auth = authdata.AuthData.FromUserID(mr.cnxn, user_id, self.services) project_id = mr.specified_project_id project = self.se...
JSON servlet for getting issue IDs that the specified user cannot view.
BackendNonviewable
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BackendNonviewable: """JSON servlet for getting issue IDs that the specified user cannot view.""" def HandleRequest(self, mr): """Get all the user IDs that the specified user cannot view. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary {project_...
stack_v2_sparse_classes_36k_train_028685
5,020
permissive
[ { "docstring": "Get all the user IDs that the specified user cannot view. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary {project_id: [issue_id]} in JSON format.", "name": "HandleRequest", "signature": "def HandleRequest(self, mr)" }, { "docstring": "Retur...
4
null
Implement the Python class `BackendNonviewable` described below. Class description: JSON servlet for getting issue IDs that the specified user cannot view. Method signatures and docstrings: - def HandleRequest(self, mr): Get all the user IDs that the specified user cannot view. Args: mr: common information parsed fro...
Implement the Python class `BackendNonviewable` described below. Class description: JSON servlet for getting issue IDs that the specified user cannot view. Method signatures and docstrings: - def HandleRequest(self, mr): Get all the user IDs that the specified user cannot view. Args: mr: common information parsed fro...
b5d4783f99461438ca9e6a477535617fadab6ba3
<|skeleton|> class BackendNonviewable: """JSON servlet for getting issue IDs that the specified user cannot view.""" def HandleRequest(self, mr): """Get all the user IDs that the specified user cannot view. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary {project_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BackendNonviewable: """JSON servlet for getting issue IDs that the specified user cannot view.""" def HandleRequest(self, mr): """Get all the user IDs that the specified user cannot view. Args: mr: common information parsed from the HTTP request. Returns: Results dictionary {project_id: [issue_id...
the_stack_v2_python_sparse
appengine/monorail/search/backendnonviewable.py
xinghun61/infra
train
2
f0c70892e1d24be8bbb1e7328e3ea37404aad208
[ "dictionary = dict()\nfor i in range(len(nums)):\n if nums[i] in dictionary:\n nums[i].append(i)\n if any(lambda x: x >= abs(i - k) and x <= i + k, nums):\n return True\n else:\n dictionary[nums[i]] = [i]\nreturn False", "tracker = dict()\nfor i in range(len(nums)):\n if t...
<|body_start_0|> dictionary = dict() for i in range(len(nums)): if nums[i] in dictionary: nums[i].append(i) if any(lambda x: x >= abs(i - k) and x <= i + k, nums): return True else: dictionary[nums[i]] = [i] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_0|> def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start...
stack_v2_sparse_classes_36k_train_028686
1,257
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: bool", "name": "containsNearbyDuplicate", "signature": "def containsNearbyDuplicate(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: bool", "name": "containsNearbyDuplicate", "signature": "def contain...
2
stack_v2_sparse_classes_30k_train_005574
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtype: bool - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtyp...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtype: bool - def containsNearbyDuplicate(self, nums, k): :type nums: List[int] :type k: int :rtyp...
d40c24736a6fee43b56aa1c80150c5f14be4ff22
<|skeleton|> class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_0|> def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def containsNearbyDuplicate(self, nums, k): """:type nums: List[int] :type k: int :rtype: bool""" dictionary = dict() for i in range(len(nums)): if nums[i] in dictionary: nums[i].append(i) if any(lambda x: x >= abs(i - k) and x <= i...
the_stack_v2_python_sparse
LeetCodePractice/219. Contains Duplicate II.py
deepika087/CompetitiveProgramming
train
10
1551cf21b02340673adabca151988a906dc0f1ae
[ "length = len(array) - 1\nfor _ in range(length):\n for i in range(length):\n if array[i] > array[i + 1]:\n array[i], array[i + 1] = (array[i + 1], array[i])", "for passes in range(len(array) - 1, 0, -1):\n for i in range(passes):\n if array[i] > array[i + 1]:\n array[i],...
<|body_start_0|> length = len(array) - 1 for _ in range(length): for i in range(length): if array[i] > array[i + 1]: array[i], array[i + 1] = (array[i + 1], array[i]) <|end_body_0|> <|body_start_1|> for passes in range(len(array) - 1, 0, -1): ...
Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort
Bubble
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Bubble: """Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort""" def bubble_naive(array): """A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes Time complexity: always O(n^2)""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_028687
14,101
no_license
[ { "docstring": "A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes Time complexity: always O(n^2)", "name": "bubble_naive", "signature": "def bubble_naive(array)" }, { "docstring": "Performs much better than the naive implementation by itterating th...
4
stack_v2_sparse_classes_30k_train_012056
Implement the Python class `Bubble` described below. Class description: Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort Method signatures and docstrings: - def bubble_naive(array): A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes ...
Implement the Python class `Bubble` described below. Class description: Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort Method signatures and docstrings: - def bubble_naive(array): A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes ...
c88059dc66297af577ad2b8afa4e0ac0ad622915
<|skeleton|> class Bubble: """Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort""" def bubble_naive(array): """A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes Time complexity: always O(n^2)""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Bubble: """Contains various bubble sort implementations. http://en.wikipedia.org/wiki/Bubble_sort""" def bubble_naive(array): """A standard bubble sort implementation with no optimizations. Very bad and very slow. Inplace: Yes Time complexity: always O(n^2)""" length = len(array) - 1 ...
the_stack_v2_python_sparse
codes/BuildLinks1.02/test_input/sort_codes/pysort.py
DaHuO/Supergraph
train
2
33463450a2f3e02e9b94cd8155c27db424ffe7f2
[ "self.min = np.array([0.0, 0.0])\nself.value = 0.0\nself.domain = np.array([[-5.0, 5.0], [-5.0, 5.0]])\nself.n = 2\nself.smooth = True\nself.info = [True, True, True]\nself.latex_name = 'Three Hump Camel Function'\nself.latex_type = 'Valley Shaped'\nself.latex_cost = '\\\\[ f(\\\\mathbf{x}) = 2x_0^{2} - 1.05x_0^{4}...
<|body_start_0|> self.min = np.array([0.0, 0.0]) self.value = 0.0 self.domain = np.array([[-5.0, 5.0], [-5.0, 5.0]]) self.n = 2 self.smooth = True self.info = [True, True, True] self.latex_name = 'Three Hump Camel Function' self.latex_type = 'Valley Shaped...
Three Hump Camel Function.
ThreeHumpCamel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ThreeHumpCamel: """Three Hump Camel Function.""" def __init__(self): """Constructor.""" <|body_0|> def cost(self, x): """Cost function.""" <|body_1|> def grad(self, x): """Grad function.""" <|body_2|> def hess(self, x): "...
stack_v2_sparse_classes_36k_train_028688
1,572
no_license
[ { "docstring": "Constructor.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Cost function.", "name": "cost", "signature": "def cost(self, x)" }, { "docstring": "Grad function.", "name": "grad", "signature": "def grad(self, x)" }, { "doc...
4
stack_v2_sparse_classes_30k_train_002918
Implement the Python class `ThreeHumpCamel` described below. Class description: Three Hump Camel Function. Method signatures and docstrings: - def __init__(self): Constructor. - def cost(self, x): Cost function. - def grad(self, x): Grad function. - def hess(self, x): Hess function.
Implement the Python class `ThreeHumpCamel` described below. Class description: Three Hump Camel Function. Method signatures and docstrings: - def __init__(self): Constructor. - def cost(self, x): Cost function. - def grad(self, x): Grad function. - def hess(self, x): Hess function. <|skeleton|> class ThreeHumpCamel...
f2a74df3ab01ac35ea8d80569da909ffa1e86af3
<|skeleton|> class ThreeHumpCamel: """Three Hump Camel Function.""" def __init__(self): """Constructor.""" <|body_0|> def cost(self, x): """Cost function.""" <|body_1|> def grad(self, x): """Grad function.""" <|body_2|> def hess(self, x): "...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ThreeHumpCamel: """Three Hump Camel Function.""" def __init__(self): """Constructor.""" self.min = np.array([0.0, 0.0]) self.value = 0.0 self.domain = np.array([[-5.0, 5.0], [-5.0, 5.0]]) self.n = 2 self.smooth = True self.info = [True, True, True] ...
the_stack_v2_python_sparse
ctf/functions2d/three_hump_camel.py
cntaylor/ctf
train
1
d5a55efd4830497d20281ac9a049b8c32ce863c2
[ "data = {'ok': False, 'message': exception.message}\nresult = dumps(data) + '\\n'\nresp = make_response(result, exception.code)\nresp.headers['Content-Type'] = self.content_type\nreturn resp", "method = getattr(self, request.method.lower(), None)\nif method is None and request.method == 'HEAD':\n method = geta...
<|body_start_0|> data = {'ok': False, 'message': exception.message} result = dumps(data) + '\n' resp = make_response(result, exception.code) resp.headers['Content-Type'] = self.content_type return resp <|end_body_0|> <|body_start_1|> method = getattr(self, request.method...
自定义 View 类 json 序列化,异常处理,装饰器支持
RestView
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RestView: """自定义 View 类 json 序列化,异常处理,装饰器支持""" def handler_error(self, exception): """处理异常""" <|body_0|> def dispatch_request(self, *args, **kwargs): """重写父类方法,支持数据自动序列化""" <|body_1|> def unpack(value): """解析视图方法返回值""" <|body_2|> <|e...
stack_v2_sparse_classes_36k_train_028689
3,102
permissive
[ { "docstring": "处理异常", "name": "handler_error", "signature": "def handler_error(self, exception)" }, { "docstring": "重写父类方法,支持数据自动序列化", "name": "dispatch_request", "signature": "def dispatch_request(self, *args, **kwargs)" }, { "docstring": "解析视图方法返回值", "name": "unpack", ...
3
stack_v2_sparse_classes_30k_train_004890
Implement the Python class `RestView` described below. Class description: 自定义 View 类 json 序列化,异常处理,装饰器支持 Method signatures and docstrings: - def handler_error(self, exception): 处理异常 - def dispatch_request(self, *args, **kwargs): 重写父类方法,支持数据自动序列化 - def unpack(value): 解析视图方法返回值
Implement the Python class `RestView` described below. Class description: 自定义 View 类 json 序列化,异常处理,装饰器支持 Method signatures and docstrings: - def handler_error(self, exception): 处理异常 - def dispatch_request(self, *args, **kwargs): 重写父类方法,支持数据自动序列化 - def unpack(value): 解析视图方法返回值 <|skeleton|> class RestView: """自定义 ...
655bb48711537efb7856a50dcab55f2380ea127a
<|skeleton|> class RestView: """自定义 View 类 json 序列化,异常处理,装饰器支持""" def handler_error(self, exception): """处理异常""" <|body_0|> def dispatch_request(self, *args, **kwargs): """重写父类方法,支持数据自动序列化""" <|body_1|> def unpack(value): """解析视图方法返回值""" <|body_2|> <|e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RestView: """自定义 View 类 json 序列化,异常处理,装饰器支持""" def handler_error(self, exception): """处理异常""" data = {'ok': False, 'message': exception.message} result = dumps(data) + '\n' resp = make_response(result, exception.code) resp.headers['Content-Type'] = self.content_typ...
the_stack_v2_python_sparse
rmon/common/rest.py
lvsoso/rmon
train
0
3738d7458510fbd7d475de636ce435bcc2c8b73d
[ "settings.addListsToRepository('skeinforge_tools.analyze_plugins.skeinview.html', '', self)\nself.fileNameInput = settings.FileNameInput().getFromFileName([('Gcode text files', '*.gcode')], 'Open File to Skeinview', self, '')\nself.openWikiManualHelpPage = settings.HelpPage().getOpenFromAbsolute('http://www.bitsfro...
<|body_start_0|> settings.addListsToRepository('skeinforge_tools.analyze_plugins.skeinview.html', '', self) self.fileNameInput = settings.FileNameInput().getFromFileName([('Gcode text files', '*.gcode')], 'Open File to Skeinview', self, '') self.openWikiManualHelpPage = settings.HelpPage().getOp...
A class to handle the skeinview settings.
SkeinviewRepository
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SkeinviewRepository: """A class to handle the skeinview settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Write button has been clicked.""" <|body_1|> <|end_skeleton|> <|...
stack_v2_sparse_classes_36k_train_028690
27,017
no_license
[ { "docstring": "Set the default settings, execute title & settings fileName.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Write button has been clicked.", "name": "execute", "signature": "def execute(self)" } ]
2
null
Implement the Python class `SkeinviewRepository` described below. Class description: A class to handle the skeinview settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Write button has been clicked.
Implement the Python class `SkeinviewRepository` described below. Class description: A class to handle the skeinview settings. Method signatures and docstrings: - def __init__(self): Set the default settings, execute title & settings fileName. - def execute(self): Write button has been clicked. <|skeleton|> class Sk...
fd69d8e856780c826386dc973ceabcc03623f3e8
<|skeleton|> class SkeinviewRepository: """A class to handle the skeinview settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" <|body_0|> def execute(self): """Write button has been clicked.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SkeinviewRepository: """A class to handle the skeinview settings.""" def __init__(self): """Set the default settings, execute title & settings fileName.""" settings.addListsToRepository('skeinforge_tools.analyze_plugins.skeinview.html', '', self) self.fileNameInput = settings.File...
the_stack_v2_python_sparse
skeinforge_tools/analyze_plugins/skeinview.py
bmander/skeinforge
train
34
a1c7738a20bfac9a155142396f8be911c4bde380
[ "concept_parsers.ConceptParser([flags.GetReplicationPresentationSpec('The Replication to update.')]).AddToParser(parser)\nreplications_flags.AddReplicationVolumeArg(parser)\nreplications_flags.AddReplicationReplicationScheduleArg(parser, required=False)\nflags.AddResourceAsyncFlag(parser)\nflags.AddResourceDescript...
<|body_start_0|> concept_parsers.ConceptParser([flags.GetReplicationPresentationSpec('The Replication to update.')]).AddToParser(parser) replications_flags.AddReplicationVolumeArg(parser) replications_flags.AddReplicationReplicationScheduleArg(parser, required=False) flags.AddResourceAsy...
Update a Cloud NetApp Volume Replication.
Update
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Update: """Update a Cloud NetApp Volume Replication.""" def Args(parser): """Add args for updating a Replication.""" <|body_0|> def Run(self, args): """Update a Cloud NetApp Volume Replication in the current project.""" <|body_1|> <|end_skeleton|> <|bod...
stack_v2_sparse_classes_36k_train_028691
4,645
permissive
[ { "docstring": "Add args for updating a Replication.", "name": "Args", "signature": "def Args(parser)" }, { "docstring": "Update a Cloud NetApp Volume Replication in the current project.", "name": "Run", "signature": "def Run(self, args)" } ]
2
null
Implement the Python class `Update` described below. Class description: Update a Cloud NetApp Volume Replication. Method signatures and docstrings: - def Args(parser): Add args for updating a Replication. - def Run(self, args): Update a Cloud NetApp Volume Replication in the current project.
Implement the Python class `Update` described below. Class description: Update a Cloud NetApp Volume Replication. Method signatures and docstrings: - def Args(parser): Add args for updating a Replication. - def Run(self, args): Update a Cloud NetApp Volume Replication in the current project. <|skeleton|> class Updat...
392abf004b16203030e6efd2f0af24db7c8d669e
<|skeleton|> class Update: """Update a Cloud NetApp Volume Replication.""" def Args(parser): """Add args for updating a Replication.""" <|body_0|> def Run(self, args): """Update a Cloud NetApp Volume Replication in the current project.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Update: """Update a Cloud NetApp Volume Replication.""" def Args(parser): """Add args for updating a Replication.""" concept_parsers.ConceptParser([flags.GetReplicationPresentationSpec('The Replication to update.')]).AddToParser(parser) replications_flags.AddReplicationVolumeArg(p...
the_stack_v2_python_sparse
lib/surface/netapp/volumes/replications/update.py
google-cloud-sdk-unofficial/google-cloud-sdk
train
9
3505f4923bd00babdac466dac702d10ef371021c
[ "if not isinstance(detMap, pfs.datamodel.SplinedDetectorMap):\n raise RuntimeError(f'Wrong type: {detMap}')\nbbox = detMap.box.toLsst()\ncenterKnots = [ss.knots for ss in detMap.xSplines]\ncenterValues = [ss.values for ss in detMap.xSplines]\nwavelengthKnots = [ss.knots for ss in detMap.wavelengthSplines]\nwavel...
<|body_start_0|> if not isinstance(detMap, pfs.datamodel.SplinedDetectorMap): raise RuntimeError(f'Wrong type: {detMap}') bbox = detMap.box.toLsst() centerKnots = [ss.knots for ss in detMap.xSplines] centerValues = [ss.values for ss in detMap.xSplines] wavelengthKnots...
SplinedDetectorMap
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SplinedDetectorMap: def fromDatamodel(cls, detMap): """Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel representation of SplinedDetectorMap. Returns ------- self : `pfs.drp.stella.SplinedDetectorMap` drp_stella r...
stack_v2_sparse_classes_36k_train_028692
3,045
no_license
[ { "docstring": "Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel representation of SplinedDetectorMap. Returns ------- self : `pfs.drp.stella.SplinedDetectorMap` drp_stella representation of SplinedDetectorMap.", "name": "fromDatamod...
2
null
Implement the Python class `SplinedDetectorMap` described below. Class description: Implement the SplinedDetectorMap class. Method signatures and docstrings: - def fromDatamodel(cls, detMap): Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel re...
Implement the Python class `SplinedDetectorMap` described below. Class description: Implement the SplinedDetectorMap class. Method signatures and docstrings: - def fromDatamodel(cls, detMap): Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel re...
85602eea2485ac24e0831046dc74f1b2d1a3d89f
<|skeleton|> class SplinedDetectorMap: def fromDatamodel(cls, detMap): """Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel representation of SplinedDetectorMap. Returns ------- self : `pfs.drp.stella.SplinedDetectorMap` drp_stella r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SplinedDetectorMap: def fromDatamodel(cls, detMap): """Construct from the pfs.datamodel representation Parameters ---------- detMap : `pfs.datamodel.SplinedDetectorMap` datamodel representation of SplinedDetectorMap. Returns ------- self : `pfs.drp.stella.SplinedDetectorMap` drp_stella representation ...
the_stack_v2_python_sparse
python/pfs/drp/stella/SplinedDetectorMapContinued.py
Subaru-PFS/drp_stella
train
3
56ef9c3dc71951a7aacce7117f10b88c0eb5c452
[ "query_params = defaultdict(dict)\nquery_params['path_type'] = path_type.value\nif band_gap:\n query_params.update({'band_gap_min': band_gap[0], 'band_gap_max': band_gap[1]})\nif efermi:\n query_params.update({'efermi_min': efermi[0], 'efermi_max': efermi[1]})\nif magnetic_ordering:\n query_params.update({...
<|body_start_0|> query_params = defaultdict(dict) query_params['path_type'] = path_type.value if band_gap: query_params.update({'band_gap_min': band_gap[0], 'band_gap_max': band_gap[1]}) if efermi: query_params.update({'efermi_min': efermi[0], 'efermi_max': efermi...
BandStructureRester
[ "LicenseRef-scancode-generic-cla", "LicenseRef-scancode-hdf5", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BandStructureRester: def search_bandstructure_summary(self, path_type: BSPathType=BSPathType.setyawan_curtarolo, band_gap: Optional[Tuple[float, float]]=None, efermi: Optional[Tuple[float, float]]=None, magnetic_ordering: Optional[Ordering]=None, is_gap_direct: bool=None, is_metal: bool=None, so...
stack_v2_sparse_classes_36k_train_028693
14,062
permissive
[ { "docstring": "Query band structure summary data in electronic structure docs using a variety of search criteria. Arguments: path_type (BSPathType): k-path selection convention for the band structure. band_gap (Tuple[float,float]): Minimum and maximum band gap in eV to consider. efermi (Tuple[float,float]): Mi...
3
stack_v2_sparse_classes_30k_train_020250
Implement the Python class `BandStructureRester` described below. Class description: Implement the BandStructureRester class. Method signatures and docstrings: - def search_bandstructure_summary(self, path_type: BSPathType=BSPathType.setyawan_curtarolo, band_gap: Optional[Tuple[float, float]]=None, efermi: Optional[T...
Implement the Python class `BandStructureRester` described below. Class description: Implement the BandStructureRester class. Method signatures and docstrings: - def search_bandstructure_summary(self, path_type: BSPathType=BSPathType.setyawan_curtarolo, band_gap: Optional[Tuple[float, float]]=None, efermi: Optional[T...
e2dc71934baecd1a85621f7f7f6ff85f96cbd684
<|skeleton|> class BandStructureRester: def search_bandstructure_summary(self, path_type: BSPathType=BSPathType.setyawan_curtarolo, band_gap: Optional[Tuple[float, float]]=None, efermi: Optional[Tuple[float, float]]=None, magnetic_ordering: Optional[Ordering]=None, is_gap_direct: bool=None, is_metal: bool=None, so...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BandStructureRester: def search_bandstructure_summary(self, path_type: BSPathType=BSPathType.setyawan_curtarolo, band_gap: Optional[Tuple[float, float]]=None, efermi: Optional[Tuple[float, float]]=None, magnetic_ordering: Optional[Ordering]=None, is_gap_direct: bool=None, is_metal: bool=None, sort_field: Opti...
the_stack_v2_python_sparse
src/mp_api/routes/electronic_structure/client.py
hhaoyan/api
train
0
aacc938aa8b2bf3924693cf4d29bc212a8cfc314
[ "try:\n from config_parser import config_parser\n self.conf_file = current_file_path + '/../../conf/appviewx.conf'\n self.conf_data = config_parser(self.conf_file)\n self.hostname = socket.gethostbyname(socket.gethostname())\n self.path = self.conf_data['ENVIRONMENT']['path'][self.conf_data['ENVIRONM...
<|body_start_0|> try: from config_parser import config_parser self.conf_file = current_file_path + '/../../conf/appviewx.conf' self.conf_data = config_parser(self.conf_file) self.hostname = socket.gethostbyname(socket.gethostname()) self.path = self.co...
Class to initialize Log4jelk.
Log4jelk
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Log4jelk: """Class to initialize Log4jelk.""" def __init__(self): """Init function for Log4jelk.""" <|body_0|> def find_and_replace(filename, partial, replacement): """.""" <|body_1|> def web_log4jelk(self): """.""" <|body_2|> de...
stack_v2_sparse_classes_36k_train_028694
3,798
no_license
[ { "docstring": "Init function for Log4jelk.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": ".", "name": "find_and_replace", "signature": "def find_and_replace(filename, partial, replacement)" }, { "docstring": ".", "name": "web_log4jelk", "signa...
4
stack_v2_sparse_classes_30k_train_013141
Implement the Python class `Log4jelk` described below. Class description: Class to initialize Log4jelk. Method signatures and docstrings: - def __init__(self): Init function for Log4jelk. - def find_and_replace(filename, partial, replacement): . - def web_log4jelk(self): . - def initialize(self, component): .
Implement the Python class `Log4jelk` described below. Class description: Class to initialize Log4jelk. Method signatures and docstrings: - def __init__(self): Init function for Log4jelk. - def find_and_replace(filename, partial, replacement): . - def web_log4jelk(self): . - def initialize(self, component): . <|skel...
e513224364dce05ea4d17ac25ecfa981238b1311
<|skeleton|> class Log4jelk: """Class to initialize Log4jelk.""" def __init__(self): """Init function for Log4jelk.""" <|body_0|> def find_and_replace(filename, partial, replacement): """.""" <|body_1|> def web_log4jelk(self): """.""" <|body_2|> de...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Log4jelk: """Class to initialize Log4jelk.""" def __init__(self): """Init function for Log4jelk.""" try: from config_parser import config_parser self.conf_file = current_file_path + '/../../conf/appviewx.conf' self.conf_data = config_parser(self.conf_fi...
the_stack_v2_python_sparse
scripts_avx/scripts/scripts/Commons/log4j_elk.py
Poonammahunta/Integration
train
0
5bb8e80b26a31ade95dc92363750d788d32e1277
[ "name = self.__class__.__name__\nsuper().__init__(name=name)\nself.window = intial_view\nself.home_view = self.window", "assert isinstance(self.layout, GridLayout)\nwidgets = self.layout.widgets\ndel widgets[self.window]\nself.window = view\nself.layout.place(content=view)\nawait self.refresh_layout()" ]
<|body_start_0|> name = self.__class__.__name__ super().__init__(name=name) self.window = intial_view self.home_view = self.window <|end_body_0|> <|body_start_1|> assert isinstance(self.layout, GridLayout) widgets = self.layout.widgets del widgets[self.window] ...
A subclass of textual.widgets.ScrollView
JenkinsScrollView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JenkinsScrollView: """A subclass of textual.widgets.ScrollView""" def __init__(self, intial_view: View) -> None: """Initialises a new custom ScrollView instance.""" <|body_0|> async def update(self, view: View) -> None: """Update the content area of the grid view...
stack_v2_sparse_classes_36k_train_028695
1,260
permissive
[ { "docstring": "Initialises a new custom ScrollView instance.", "name": "__init__", "signature": "def __init__(self, intial_view: View) -> None" }, { "docstring": "Update the content area of the grid view that backs ScrollView. Args: view (View): The view that will replace the current one assign...
2
stack_v2_sparse_classes_30k_train_001631
Implement the Python class `JenkinsScrollView` described below. Class description: A subclass of textual.widgets.ScrollView Method signatures and docstrings: - def __init__(self, intial_view: View) -> None: Initialises a new custom ScrollView instance. - async def update(self, view: View) -> None: Update the content ...
Implement the Python class `JenkinsScrollView` described below. Class description: A subclass of textual.widgets.ScrollView Method signatures and docstrings: - def __init__(self, intial_view: View) -> None: Initialises a new custom ScrollView instance. - async def update(self, view: View) -> None: Update the content ...
4270f9e64e6eb58f42e150ef13d478f2e0b2a26a
<|skeleton|> class JenkinsScrollView: """A subclass of textual.widgets.ScrollView""" def __init__(self, intial_view: View) -> None: """Initialises a new custom ScrollView instance.""" <|body_0|> async def update(self, view: View) -> None: """Update the content area of the grid view...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JenkinsScrollView: """A subclass of textual.widgets.ScrollView""" def __init__(self, intial_view: View) -> None: """Initialises a new custom ScrollView instance.""" name = self.__class__.__name__ super().__init__(name=name) self.window = intial_view self.home_view ...
the_stack_v2_python_sparse
src/jenkins_tui/views/scroll_view.py
aegp17/jenkins-tui
train
0
06187c02b36039b69d67b96df26d6161fbd02248
[ "n = len(ratings)\nres = [1] * n\nmin_index = ratings.index(min(ratings))\nfor i in range(min_index + 1, n):\n if ratings[i] > ratings[i - 1]:\n res[i] = res[i - 1] + 1\n else:\n j = i\n while ratings[j] < ratings[j - 1]:\n res[j - 1] = max(res[j - 1], res[j] + 1)\n ...
<|body_start_0|> n = len(ratings) res = [1] * n min_index = ratings.index(min(ratings)) for i in range(min_index + 1, n): if ratings[i] > ratings[i - 1]: res[i] = res[i - 1] + 1 else: j = i while ratings[j] < ratings...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def candy(self, ratings): """和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int""" <|body_0|> def candy3(self, ratings): """先给每个人一个糖,初始化tmp数组为额外糖果。 从左向右遍历,如果i+1分数高,tmp[i+1]=tmp[i]+1。 再从后往前遍历,如果i比i+1分数高,那么比较tm...
stack_v2_sparse_classes_36k_train_028696
2,881
no_license
[ { "docstring": "和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int", "name": "candy", "signature": "def candy(self, ratings)" }, { "docstring": "先给每个人一个糖,初始化tmp数组为额外糖果。 从左向右遍历,如果i+1分数高,tmp[i+1]=tmp[i]+1。 再从后往前遍历,如果i比i+1分数高,那么比较tmp[i]和tmp[i+1]+1,如果...
2
stack_v2_sparse_classes_30k_train_005529
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def candy(self, ratings): 和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int - def candy3(self, ratings): 先给每个人一个糖,初始化tmp数组为额外糖果。...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def candy(self, ratings): 和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int - def candy3(self, ratings): 先给每个人一个糖,初始化tmp数组为额外糖果。...
5d3574ccd282d0146c83c286ae28d8baaabd4910
<|skeleton|> class Solution: def candy(self, ratings): """和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int""" <|body_0|> def candy3(self, ratings): """先给每个人一个糖,初始化tmp数组为额外糖果。 从左向右遍历,如果i+1分数高,tmp[i+1]=tmp[i]+1。 再从后往前遍历,如果i比i+1分数高,那么比较tm...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def candy(self, ratings): """和字节跳动2019春招第一轮笔试第三题基本一样 还是要多刷leetcode 要是笔试做过这个就不拿到题的时候一脸懵逼了Orz :type ratings: List[int] :rtype: int""" n = len(ratings) res = [1] * n min_index = ratings.index(min(ratings)) for i in range(min_index + 1, n): if ratings[...
the_stack_v2_python_sparse
135_分发糖果.py
lovehhf/LeetCode
train
0
8f99934e8c9ed80face8aa61c7333fcb79bef74c
[ "super(Constructor, self).__init__()\nself.shell_loader = shell_loader\nself.abstract_loader = abstract_loader", "shell_cls = self.shell_loader()\nshell_obj = shell_cls()\nabstract_loader = self.abstract_loader\nif abstract_loader is not None:\n abstract_obj = abstract_loader()()\n shell_obj.abstract_obj = ...
<|body_start_0|> super(Constructor, self).__init__() self.shell_loader = shell_loader self.abstract_loader = abstract_loader <|end_body_0|> <|body_start_1|> shell_cls = self.shell_loader() shell_obj = shell_cls() abstract_loader = self.abstract_loader if abstract...
An EnamlFactory subclass; instances of which are used to populate a toolkit.
Constructor
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Constructor: """An EnamlFactory subclass; instances of which are used to populate a toolkit.""" def __init__(self, shell_loader, abstract_loader=None): """Initialize a constructor instance. Parameters ---------- shell_loader : Callable A callable object which returns the shell class ...
stack_v2_sparse_classes_36k_train_028697
2,189
permissive
[ { "docstring": "Initialize a constructor instance. Parameters ---------- shell_loader : Callable A callable object which returns the shell class to use for the widget. abstract_loader : Callable, optional A callable object which returns the abstract implementation class to use for the widget. If None, then it's...
3
null
Implement the Python class `Constructor` described below. Class description: An EnamlFactory subclass; instances of which are used to populate a toolkit. Method signatures and docstrings: - def __init__(self, shell_loader, abstract_loader=None): Initialize a constructor instance. Parameters ---------- shell_loader : ...
Implement the Python class `Constructor` described below. Class description: An EnamlFactory subclass; instances of which are used to populate a toolkit. Method signatures and docstrings: - def __init__(self, shell_loader, abstract_loader=None): Initialize a constructor instance. Parameters ---------- shell_loader : ...
96828b254ac9fdfa2e5b6b31eff93a4933cbc0aa
<|skeleton|> class Constructor: """An EnamlFactory subclass; instances of which are used to populate a toolkit.""" def __init__(self, shell_loader, abstract_loader=None): """Initialize a constructor instance. Parameters ---------- shell_loader : Callable A callable object which returns the shell class ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Constructor: """An EnamlFactory subclass; instances of which are used to populate a toolkit.""" def __init__(self, shell_loader, abstract_loader=None): """Initialize a constructor instance. Parameters ---------- shell_loader : Callable A callable object which returns the shell class to use for th...
the_stack_v2_python_sparse
enaml/core/constructor.py
agrawalprash/enaml
train
0
307d5f3028fa8ec1ee674a919d3409e048db95bf
[ "ak = input('请输入API Key:').strip()\nsk = input('请输入Secret Key:').strip()\nbaidu_ai = BAIDU_AI(ak=ak, sk=sk)\nwhile True:\n temp = self.Check_AS(baidu_ai=baidu_ai)\n if temp == 1:\n break\n elif temp == -1:\n print('API Key错误')\n baidu_ai.Ak = input('请重新输入API Key:').strip()\n con...
<|body_start_0|> ak = input('请输入API Key:').strip() sk = input('请输入Secret Key:').strip() baidu_ai = BAIDU_AI(ak=ak, sk=sk) while True: temp = self.Check_AS(baidu_ai=baidu_ai) if temp == 1: break elif temp == -1: print('AP...
百度AI验证类
BAIDU_AI_Verify
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BAIDU_AI_Verify: """百度AI验证类""" def Verify(self) -> BAIDU_AI: """Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI""" <|body_0|> def Check_AS(cls, baidu_ai: BAIDU_AI) -> int: """Check_AS(baidu_ai: BAIDU_AI) -> int 检查API Key、Secret Key是否有效 Args: baidu_ai: 百度AI Returns: 1: ...
stack_v2_sparse_classes_36k_train_028698
2,061
permissive
[ { "docstring": "Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI", "name": "Verify", "signature": "def Verify(self) -> BAIDU_AI" }, { "docstring": "Check_AS(baidu_ai: BAIDU_AI) -> int 检查API Key、Secret Key是否有效 Args: baidu_ai: 百度AI Returns: 1: 有效 -1: API Key 无效 -2: Secret Key 无效", "name": "Check_AS",...
2
null
Implement the Python class `BAIDU_AI_Verify` described below. Class description: 百度AI验证类 Method signatures and docstrings: - def Verify(self) -> BAIDU_AI: Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI - def Check_AS(cls, baidu_ai: BAIDU_AI) -> int: Check_AS(baidu_ai: BAIDU_AI) -> int 检查API Key、Secret Key是否有效 Args: baidu_...
Implement the Python class `BAIDU_AI_Verify` described below. Class description: 百度AI验证类 Method signatures and docstrings: - def Verify(self) -> BAIDU_AI: Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI - def Check_AS(cls, baidu_ai: BAIDU_AI) -> int: Check_AS(baidu_ai: BAIDU_AI) -> int 检查API Key、Secret Key是否有效 Args: baidu_...
9e2a023917b86460fb02984aed9fe638c3d38dd4
<|skeleton|> class BAIDU_AI_Verify: """百度AI验证类""" def Verify(self) -> BAIDU_AI: """Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI""" <|body_0|> def Check_AS(cls, baidu_ai: BAIDU_AI) -> int: """Check_AS(baidu_ai: BAIDU_AI) -> int 检查API Key、Secret Key是否有效 Args: baidu_ai: 百度AI Returns: 1: ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BAIDU_AI_Verify: """百度AI验证类""" def Verify(self) -> BAIDU_AI: """Verify() -> BAIDU_AI 验证 Returns: BAIDU_AI""" ak = input('请输入API Key:').strip() sk = input('请输入Secret Key:').strip() baidu_ai = BAIDU_AI(ak=ak, sk=sk) while True: temp = self.Check_AS(baidu_...
the_stack_v2_python_sparse
inside/Baidu_AI/Baidu_AI_Verify.py
lifansama/learning-power
train
1
fc03807c295a38d09031f06193ca3131d8cd9d21
[ "new_emp = Employee(*personal_identity)\nregistration_str = new_emp.get_registration_str()\nreturn_value = self.save_object_to_DB('employee', registration_str)\nreturn return_value", "changed_emp = Employee(*changed_identity)\nchanged_str = changed_emp.get_changes_registration_str()\nreturn_value = self.change_ob...
<|body_start_0|> new_emp = Employee(*personal_identity) registration_str = new_emp.get_registration_str() return_value = self.save_object_to_DB('employee', registration_str) return return_value <|end_body_0|> <|body_start_1|> changed_emp = Employee(*changed_identity) cha...
EmployeeLL
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmployeeLL: def create_employee(self, personal_identity): """Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence)""" <|body_0|> def change_employee(self, changed_identity): """Changes information about...
stack_v2_sparse_classes_36k_train_028699
2,878
no_license
[ { "docstring": "Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence)", "name": "create_employee", "signature": "def create_employee(self, personal_identity)" }, { "docstring": "Changes information about employee, except ssn, name ...
4
stack_v2_sparse_classes_30k_train_008578
Implement the Python class `EmployeeLL` described below. Class description: Implement the EmployeeLL class. Method signatures and docstrings: - def create_employee(self, personal_identity): Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence) - def cha...
Implement the Python class `EmployeeLL` described below. Class description: Implement the EmployeeLL class. Method signatures and docstrings: - def create_employee(self, personal_identity): Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence) - def cha...
ee2b2e6c1422ebab40e36ed3ed23f6f70ee7adb2
<|skeleton|> class EmployeeLL: def create_employee(self, personal_identity): """Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence)""" <|body_0|> def change_employee(self, changed_identity): """Changes information about...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmployeeLL: def create_employee(self, personal_identity): """Creates a new employee and saves to database. personal_identity = ('',ssn,name,address,mobile,email,role,rank,licence)""" new_emp = Employee(*personal_identity) registration_str = new_emp.get_registration_str() return...
the_stack_v2_python_sparse
random code snippets/EmployeeLL_sigurgeir.py
heidars19/3ja-vikna-verkefni
train
3