blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
7.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
378
8.64k
id
stringlengths
44
44
length_bytes
int64
505
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.88k
prompted_full_text
stringlengths
565
12.5k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
5.05k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
snapshot_total_rows
int64
75.8k
75.8k
solution
stringlengths
242
8.3k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
7d804718a0229d6992798809121cb074f3595806
[ "params = dict(((key, val) for key, val in request.QUERY_PARAMS.iteritems()))\nparams['image_id'] = image_id\nparams['organism_id'] = organism_id\nform = SingleGetForm(params)\nif not form.is_valid():\n raise BadRequestException()\nreturn Response(form.submit(request))", "params = dict(((key, val) for key, val...
<|body_start_0|> params = dict(((key, val) for key, val in request.QUERY_PARAMS.iteritems())) params['image_id'] = image_id params['organism_id'] = organism_id form = SingleGetForm(params) if not form.is_valid(): raise BadRequestException() return Response(for...
Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism.
ImageOrganismSingle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageOrganismSingle: """Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism.""" def get(self, request, image_id, organism_id): """Method for getting an ImageOrganism.""" <|body_0|> def delete(self, request, image_id, ...
stack_v2_sparse_classes_75kplus_train_073900
2,349
no_license
[ { "docstring": "Method for getting an ImageOrganism.", "name": "get", "signature": "def get(self, request, image_id, organism_id)" }, { "docstring": "Method for deleting an ImageOrganism.", "name": "delete", "signature": "def delete(self, request, image_id, organism_id)" } ]
2
null
Implement the Python class `ImageOrganismSingle` described below. Class description: Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism. Method signatures and docstrings: - def get(self, request, image_id, organism_id): Method for getting an ImageOrganism. - def ...
Implement the Python class `ImageOrganismSingle` described below. Class description: Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism. Method signatures and docstrings: - def get(self, request, image_id, organism_id): Method for getting an ImageOrganism. - def ...
22c1ce3c5a8e4ed99c2f014672d60ad3c5a4003c
<|skeleton|> class ImageOrganismSingle: """Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism.""" def get(self, request, image_id, organism_id): """Method for getting an ImageOrganism.""" <|body_0|> def delete(self, request, image_id, ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ImageOrganismSingle: """Class for rendering the view for getting a Organim, deleting a ImageOrganism and updating a ImageOrganism.""" def get(self, request, image_id, organism_id): """Method for getting an ImageOrganism.""" params = dict(((key, val) for key, val in request.QUERY_PARAMS.it...
the_stack_v2_python_sparse
biodig/rest/v2/ImageOrganisms/views.py
asmariyaz23/BioDIG
train
0
c1f68990bba40b5def56350b367db36bd8f19b57
[ "try:\n for q in question:\n int(q)\nexcept Exception as e:\n logger.error(f'format_question: Asking non-int tables {e}')\nspeech_list = (' ', str(question[0]), ' times ', str(question[1]))\nreturn ''.join(speech_list)", "question = QuestionAttr.get_question_tables(handler_input, integers=False)\nq...
<|body_start_0|> try: for q in question: int(q) except Exception as e: logger.error(f'format_question: Asking non-int tables {e}') speech_list = (' ', str(question[0]), ' times ', str(question[1])) return ''.join(speech_list) <|end_body_0|> <|bo...
GenQuestions
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GenQuestions: def format_question(question: tuple) -> str: """Formats the question for Alexa <speak>""" <|body_0|> def get_same_question(handler_input) -> str: """Returns the same question to the user.""" <|body_1|> def check_same_question(handler_input,...
stack_v2_sparse_classes_75kplus_train_073901
1,723
permissive
[ { "docstring": "Formats the question for Alexa <speak>", "name": "format_question", "signature": "def format_question(question: tuple) -> str" }, { "docstring": "Returns the same question to the user.", "name": "get_same_question", "signature": "def get_same_question(handler_input) -> st...
3
stack_v2_sparse_classes_30k_train_044444
Implement the Python class `GenQuestions` described below. Class description: Implement the GenQuestions class. Method signatures and docstrings: - def format_question(question: tuple) -> str: Formats the question for Alexa <speak> - def get_same_question(handler_input) -> str: Returns the same question to the user. ...
Implement the Python class `GenQuestions` described below. Class description: Implement the GenQuestions class. Method signatures and docstrings: - def format_question(question: tuple) -> str: Formats the question for Alexa <speak> - def get_same_question(handler_input) -> str: Returns the same question to the user. ...
1072dea1a5be0b339211ff39db6a89a90aca64c1
<|skeleton|> class GenQuestions: def format_question(question: tuple) -> str: """Formats the question for Alexa <speak>""" <|body_0|> def get_same_question(handler_input) -> str: """Returns the same question to the user.""" <|body_1|> def check_same_question(handler_input,...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GenQuestions: def format_question(question: tuple) -> str: """Formats the question for Alexa <speak>""" try: for q in question: int(q) except Exception as e: logger.error(f'format_question: Asking non-int tables {e}') speech_list = (' '...
the_stack_v2_python_sparse
1_code/mult_questions/gen_questions.py
jaimiles23/Multiplication-Medley
train
0
79f72871b84abe662d35840e1283341206ecc088
[ "self.acno = int(raw_input('enter accont no : '))\nself.acname = raw_input('enter accont h name : ')\nself.acbal = float(raw_input('enter accont blance : '))", "self.acno = int(raw_input('enter accont no : '))\nself.acname = raw_input('enter accont h name : ')\nself.acbal = float(raw_input('enter accont blance : ...
<|body_start_0|> self.acno = int(raw_input('enter accont no : ')) self.acname = raw_input('enter accont h name : ') self.acbal = float(raw_input('enter accont blance : ')) <|end_body_0|> <|body_start_1|> self.acno = int(raw_input('enter accont no : ')) self.acname = raw_input('e...
to define account class woth account info and operations
account
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class account: """to define account class woth account info and operations""" def __init__(self): """to initialise instance variables""" <|body_0|> def setaccountinfo(self): """to initialise account info""" <|body_1|> def getaccountinfo(self): """t...
stack_v2_sparse_classes_75kplus_train_073902
1,448
no_license
[ { "docstring": "to initialise instance variables", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "to initialise account info", "name": "setaccountinfo", "signature": "def setaccountinfo(self)" }, { "docstring": "to display account detail", "name": "g...
4
stack_v2_sparse_classes_30k_train_048915
Implement the Python class `account` described below. Class description: to define account class woth account info and operations Method signatures and docstrings: - def __init__(self): to initialise instance variables - def setaccountinfo(self): to initialise account info - def getaccountinfo(self): to display accou...
Implement the Python class `account` described below. Class description: to define account class woth account info and operations Method signatures and docstrings: - def __init__(self): to initialise instance variables - def setaccountinfo(self): to initialise account info - def getaccountinfo(self): to display accou...
a2c3cbbfa740dc39944d8a7e4ca0eaad07f44316
<|skeleton|> class account: """to define account class woth account info and operations""" def __init__(self): """to initialise instance variables""" <|body_0|> def setaccountinfo(self): """to initialise account info""" <|body_1|> def getaccountinfo(self): """t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class account: """to define account class woth account info and operations""" def __init__(self): """to initialise instance variables""" self.acno = int(raw_input('enter accont no : ')) self.acname = raw_input('enter accont h name : ') self.acbal = float(raw_input('enter accont ...
the_stack_v2_python_sparse
class/act2.py
kajal241199/PYTraining
train
0
8ec0ddc8b8d32afd52b2070f01a27d7faf7db5f3
[ "self.degeneracy = kwargs.pop('degeneracy', 0.001)\n' Degeneracy parameter for oscillator strength. '\nsuper(Dipole, self).__init__(*args, **kwargs)", "out = super(Dipole, self).run(indiv, outdir, comm, **kwargs)\ndegeneracy = getattr(self, 'degeneracy', 0.001)\nindiv.dipoles = out.dipole(degeneracy=degeneracy)\n...
<|body_start_0|> self.degeneracy = kwargs.pop('degeneracy', 0.001) ' Degeneracy parameter for oscillator strength. ' super(Dipole, self).__init__(*args, **kwargs) <|end_body_0|> <|body_start_1|> out = super(Dipole, self).run(indiv, outdir, comm, **kwargs) degeneracy = getattr(se...
Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles.
Dipole
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dipole: """Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles.""" def __init__(self, *args, **kwargs): """Initializes the dipole element evaluator.""" <|body_0|> def _...
stack_v2_sparse_classes_75kplus_train_073903
9,676
no_license
[ { "docstring": "Initializes the dipole element evaluator.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Computes the oscillator strength.", "name": "__call__", "signature": "def __call__(self, indiv, outdir=None, comm=None, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_051629
Implement the Python class `Dipole` described below. Class description: Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initializes the d...
Implement the Python class `Dipole` described below. Class description: Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Initializes the d...
9c0ab667f94dc4629404a8ec99cbeaa323f0c8b3
<|skeleton|> class Dipole: """Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles.""" def __init__(self, *args, **kwargs): """Initializes the dipole element evaluator.""" <|body_0|> def _...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Dipole: """Evaluates the oscillator strength. On top of those quantities saved by base class BandgapEvaluator, this class stores the dipole elements in indiv.dipoles.""" def __init__(self, *args, **kwargs): """Initializes the dipole element evaluator.""" self.degeneracy = kwargs.pop('dege...
the_stack_v2_python_sparse
ga/escan/evaluator.py
Shibu778/LaDa
train
0
2456f608b19a6f936dcf23c816ba5679b2cf48fb
[ "super().__init__()\nself.query_emb = nn.Linear(args['target_agent_enc_size'], args['emb_size'])\nself.key_emb = nn.Linear(args['context_enc_size'], args['emb_size'])\nself.val_emb = nn.Linear(args['context_enc_size'], args['emb_size'])\nself.mha = nn.MultiheadAttention(args['emb_size'], args['num_heads'])", "tar...
<|body_start_0|> super().__init__() self.query_emb = nn.Linear(args['target_agent_enc_size'], args['emb_size']) self.key_emb = nn.Linear(args['context_enc_size'], args['emb_size']) self.val_emb = nn.Linear(args['context_enc_size'], args['emb_size']) self.mha = nn.MultiheadAttenti...
Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings.
GlobalAttention
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GlobalAttention: """Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings.""" def __init__(self, args: Dict): """args to include enc_size: int Dimension of encoding...
stack_v2_sparse_classes_75kplus_train_073904
2,711
permissive
[ { "docstring": "args to include enc_size: int Dimension of encodings generated by encoder emb_size: int Size of embeddings used for queries, keys and values num_heads: int Number of attention heads", "name": "__init__", "signature": "def __init__(self, args: Dict)" }, { "docstring": "Forward pas...
3
stack_v2_sparse_classes_30k_train_012672
Implement the Python class `GlobalAttention` described below. Class description: Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings. Method signatures and docstrings: - def __init__(self, args: D...
Implement the Python class `GlobalAttention` described below. Class description: Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings. Method signatures and docstrings: - def __init__(self, args: D...
6419894aa040adb9570b14493952a98c0a52f803
<|skeleton|> class GlobalAttention: """Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings.""" def __init__(self, args: Dict): """args to include enc_size: int Dimension of encoding...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GlobalAttention: """Aggregate context encoding using scaled dot product attention. Query obtained using target agent encoding, Keys and values obtained using map and surrounding agent encodings.""" def __init__(self, args: Dict): """args to include enc_size: int Dimension of encodings generated b...
the_stack_v2_python_sparse
models/aggregators/global_attention.py
sancarlim/Explainable-MP
train
17
60d16f481e801278c6e7c2dface2085d10815b8a
[ "QDialog.__init__(self, parent)\nself.setupUi(self)\nself.xlsFile = ''\nself.db_path = ''", "print('on_pushButton_select_xls_clicked')\nself.xlsFile = QFileDialog.getOpenFileName(self, u'选取文件', './', 'Excel Files (*.xls;*.xlsx)')[0]\nprint(self.xlsFile)", "if self.xlsFile == '':\n QMessageBox.warning(self, u...
<|body_start_0|> QDialog.__init__(self, parent) self.setupUi(self) self.xlsFile = '' self.db_path = '' <|end_body_0|> <|body_start_1|> print('on_pushButton_select_xls_clicked') self.xlsFile = QFileDialog.getOpenFileName(self, u'选取文件', './', 'Excel Files (*.xls;*.xlsx)')[...
Class documentation goes here.
Dialog
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dialog: """Class documentation goes here.""" def __init__(self, parent=None): """Constructor""" <|body_0|> def on_pushButton_select_xls_clicked(self): """Slot documentation goes here.""" <|body_1|> def on_pushButton_create_db_clicked(self): "...
stack_v2_sparse_classes_75kplus_train_073905
1,965
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self, parent=None)" }, { "docstring": "Slot documentation goes here.", "name": "on_pushButton_select_xls_clicked", "signature": "def on_pushButton_select_xls_clicked(self)" }, { "docstring": "Slot docume...
3
stack_v2_sparse_classes_30k_train_016864
Implement the Python class `Dialog` described below. Class description: Class documentation goes here. Method signatures and docstrings: - def __init__(self, parent=None): Constructor - def on_pushButton_select_xls_clicked(self): Slot documentation goes here. - def on_pushButton_create_db_clicked(self): Slot document...
Implement the Python class `Dialog` described below. Class description: Class documentation goes here. Method signatures and docstrings: - def __init__(self, parent=None): Constructor - def on_pushButton_select_xls_clicked(self): Slot documentation goes here. - def on_pushButton_create_db_clicked(self): Slot document...
6ec9027b679bbb707436b9a4095d995265b266c8
<|skeleton|> class Dialog: """Class documentation goes here.""" def __init__(self, parent=None): """Constructor""" <|body_0|> def on_pushButton_select_xls_clicked(self): """Slot documentation goes here.""" <|body_1|> def on_pushButton_create_db_clicked(self): "...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Dialog: """Class documentation goes here.""" def __init__(self, parent=None): """Constructor""" QDialog.__init__(self, parent) self.setupUi(self) self.xlsFile = '' self.db_path = '' def on_pushButton_select_xls_clicked(self): """Slot documentation goes...
the_stack_v2_python_sparse
src/utils/Create_DB.py
fzero17/college_wish
train
0
a9243beb16dcf6c00aafc553c90e52d32ba97915
[ "self.max_sample_count = max_sample_count or 0\nself.sampling_frequency = sampling_frequency or 1\nif self.sampling_frequency < 1:\n err_msg = 'sampling_frequency must be larger or equal to 1. (Given: {})'.format(self.sampling_frequency)\n raise GenericTrainerException(err_msg)\nself.s3_prefix = s3_prefix\nse...
<|body_start_0|> self.max_sample_count = max_sample_count or 0 self.sampling_frequency = sampling_frequency or 1 if self.sampling_frequency < 1: err_msg = 'sampling_frequency must be larger or equal to 1. (Given: {})'.format(self.sampling_frequency) raise GenericTrainerEx...
Sample Collector class to collect sample and persist to S3.
SampleCollector
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SampleCollector: """Sample Collector class to collect sample and persist to S3.""" def __init__(self, bucket, s3_prefix, region_name, s3_endpoint_url=None, max_sample_count=None, sampling_frequency=None, max_retry_attempts=5, backoff_time_sec=1.0): """Sample Collector class to collec...
stack_v2_sparse_classes_75kplus_train_073906
3,211
permissive
[ { "docstring": "Sample Collector class to collect sample and persist to S3. Args: bucket (str): S3 bucket string s3_prefix (str): S3 prefix string region_name (str): S3 region name max_sample_count (int): max sample count sampling_frequency (int): sampleing frequency max_retry_attempts (int): maximum number of ...
2
stack_v2_sparse_classes_30k_train_015572
Implement the Python class `SampleCollector` described below. Class description: Sample Collector class to collect sample and persist to S3. Method signatures and docstrings: - def __init__(self, bucket, s3_prefix, region_name, s3_endpoint_url=None, max_sample_count=None, sampling_frequency=None, max_retry_attempts=5...
Implement the Python class `SampleCollector` described below. Class description: Sample Collector class to collect sample and persist to S3. Method signatures and docstrings: - def __init__(self, bucket, s3_prefix, region_name, s3_endpoint_url=None, max_sample_count=None, sampling_frequency=None, max_retry_attempts=5...
2ce50508dd4100eaef7f8729436549a801505705
<|skeleton|> class SampleCollector: """Sample Collector class to collect sample and persist to S3.""" def __init__(self, bucket, s3_prefix, region_name, s3_endpoint_url=None, max_sample_count=None, sampling_frequency=None, max_retry_attempts=5, backoff_time_sec=1.0): """Sample Collector class to collec...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SampleCollector: """Sample Collector class to collect sample and persist to S3.""" def __init__(self, bucket, s3_prefix, region_name, s3_endpoint_url=None, max_sample_count=None, sampling_frequency=None, max_retry_attempts=5, backoff_time_sec=1.0): """Sample Collector class to collect sample and ...
the_stack_v2_python_sparse
bundle/markov/samples/sample_collector.py
aws-deepracer-community/deepracer-simapp
train
83
b26fb1defb170bfa210f568377e151630e91b286
[ "if cls.credentials is None:\n cls.credentials = service_account.Credentials.from_service_account_info(cls.service_account_info, scopes=cls.GCP_SA_SCOPES)\nrequest = google.auth.transport.requests.Request()\ncls.credentials.refresh(request)\ncurrent_app.logger.info('Call successful: obtained token.')\nreturn cls...
<|body_start_0|> if cls.credentials is None: cls.credentials = service_account.Credentials.from_service_account_info(cls.service_account_info, scopes=cls.GCP_SA_SCOPES) request = google.auth.transport.requests.Request() cls.credentials.refresh(request) current_app.logger.info...
Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls.
GoogleAuthService
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GoogleAuthService: """Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls.""" def get_token(cls): """Generate an OAuth access token with cloud storage access.""" <|body_0|> def get_report_api_...
stack_v2_sparse_classes_75kplus_train_073907
3,364
permissive
[ { "docstring": "Generate an OAuth access token with cloud storage access.", "name": "get_token", "signature": "def get_token(cls)" }, { "docstring": "Generate an OAuth access token with IAM configured auth mhr api container to report api container.", "name": "get_report_api_token", "sign...
3
stack_v2_sparse_classes_30k_train_036663
Implement the Python class `GoogleAuthService` described below. Class description: Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls. Method signatures and docstrings: - def get_token(cls): Generate an OAuth access token with cloud stora...
Implement the Python class `GoogleAuthService` described below. Class description: Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls. Method signatures and docstrings: - def get_token(cls): Generate an OAuth access token with cloud stora...
af1a4458bb78c16ecca484514d4bd0d1d8c24b5d
<|skeleton|> class GoogleAuthService: """Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls.""" def get_token(cls): """Generate an OAuth access token with cloud storage access.""" <|body_0|> def get_report_api_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GoogleAuthService: """Google Auth Service implementation. Maintains a wrapper to get a service account access token and credentials for Google API calls.""" def get_token(cls): """Generate an OAuth access token with cloud storage access.""" if cls.credentials is None: cls.cred...
the_stack_v2_python_sparse
mhr_api/src/mhr_api/services/gcp_auth/auth_service.py
bcgov/ppr
train
4
9f3de2cf0565d84189ac82c5a2706c1783139f24
[ "self.input_file = input_file\nself.output_file = output_file\nself.max_iter = max_iter\nself.max_total_iter = max_total_iter\nself.optimizers = optimizers\nself.optimizer_id = 0", "o = Cp2kOutput(self.output_file)\no.convergence()\nif o.data.get('geo_opt_not_converged'):\n return True\nreturn False", "ci = ...
<|body_start_0|> self.input_file = input_file self.output_file = output_file self.max_iter = max_iter self.max_total_iter = max_total_iter self.optimizers = optimizers self.optimizer_id = 0 <|end_body_0|> <|body_start_1|> o = Cp2kOutput(self.output_file) ...
This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping back-and-forth between BFGS and CG optimizers. BFGS is fast, but unstable when far from the minimum, wh...
UnconvergedRelaxationErrorHandler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnconvergedRelaxationErrorHandler: """This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping back-and-forth between BFGS and CG optimiz...
stack_v2_sparse_classes_75kplus_train_073908
43,756
permissive
[ { "docstring": "Initialize the error handler. Args: input_file: name of the input file output_file: name of the output file max_iter: Max iter for an \"inner loop\", i.e. max iterations for one optimizer before switching to another. max_total_iter: max total number of iterations before calling it quits. (Not re...
3
null
Implement the Python class `UnconvergedRelaxationErrorHandler` described below. Class description: This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping bac...
Implement the Python class `UnconvergedRelaxationErrorHandler` described below. Class description: This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping bac...
e133fe0f2290ef3c1e96be25de0c13e6c3c33284
<|skeleton|> class UnconvergedRelaxationErrorHandler: """This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping back-and-forth between BFGS and CG optimiz...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UnconvergedRelaxationErrorHandler: """This handler checks to see if geometry optimization has failed to converge, as signified by a line in the output file that says the maximum number of optimization steps were reached. By, this handler works by jumping back-and-forth between BFGS and CG optimizers. BFGS is ...
the_stack_v2_python_sparse
custodian/cp2k/handlers.py
materialsproject/custodian
train
116
5f36120cfe2eb3459e1c85f1ea1cf7fef8ad9bbf
[ "previous_index = 0\ntotal_profit = 0\nfor index in range(0, len(prices)):\n if previous_index == index:\n continue\n previous_price = prices[previous_index]\n current_price = prices[index]\n if previous_price < current_price:\n total_profit += current_price - previous_price\n previous_...
<|body_start_0|> previous_index = 0 total_profit = 0 for index in range(0, len(prices)): if previous_index == index: continue previous_price = prices[previous_index] current_price = prices[index] if previous_price < current_price: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> previous_index = 0 total_profi...
stack_v2_sparse_classes_75kplus_train_073909
1,420
no_license
[ { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfit", "signature": "def maxProfit(self, prices)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "removeDuplicates", "signature": "def removeDuplicates(self, nums)" } ]
2
stack_v2_sparse_classes_30k_test_001222
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices): :type prices: List[int] :rtype: int - def removeDuplicates(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices): :type prices: List[int] :rtype: int - def removeDuplicates(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def maxP...
dae0a5e6e688a34e6b870a93ecb210416a54d67a
<|skeleton|> class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def removeDuplicates(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" previous_index = 0 total_profit = 0 for index in range(0, len(prices)): if previous_index == index: continue previous_price = prices[previous_index] ...
the_stack_v2_python_sparse
python/algorithms/arrays/max_profit.py
nathanle89/interview
train
0
01804d27701d141413146d7da2cb6593e5fa0037
[ "self.objects = []\nself.errors = None\nself.api_key = os.environ.get('GOOGLE_PLACES_API')", "if not self.api_key:\n logging.warning(WARNING_MESSAGE)\n return []\nparams = {'input': name, 'types': '(cities)', 'key': self.api_key}\nrequest = requests.get(self.URL.format(self.FORMAT_TYPE), params=params)\nres...
<|body_start_0|> self.objects = [] self.errors = None self.api_key = os.environ.get('GOOGLE_PLACES_API') <|end_body_0|> <|body_start_1|> if not self.api_key: logging.warning(WARNING_MESSAGE) return [] params = {'input': name, 'types': '(cities)', 'key': s...
Service for getting the cities list from Google places.
CitiesService
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CitiesService: """Service for getting the cities list from Google places.""" def __init__(self): """Initialize method for cities service.""" <|body_0|> def find_by_name(self, name): """Receive a list of matched cities by the name.""" <|body_1|> <|end_ske...
stack_v2_sparse_classes_75kplus_train_073910
1,472
no_license
[ { "docstring": "Initialize method for cities service.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Receive a list of matched cities by the name.", "name": "find_by_name", "signature": "def find_by_name(self, name)" } ]
2
null
Implement the Python class `CitiesService` described below. Class description: Service for getting the cities list from Google places. Method signatures and docstrings: - def __init__(self): Initialize method for cities service. - def find_by_name(self, name): Receive a list of matched cities by the name.
Implement the Python class `CitiesService` described below. Class description: Service for getting the cities list from Google places. Method signatures and docstrings: - def __init__(self): Initialize method for cities service. - def find_by_name(self, name): Receive a list of matched cities by the name. <|skeleton...
252b0ebd77eefbcc945a0efc3068cc3421f46d5f
<|skeleton|> class CitiesService: """Service for getting the cities list from Google places.""" def __init__(self): """Initialize method for cities service.""" <|body_0|> def find_by_name(self, name): """Receive a list of matched cities by the name.""" <|body_1|> <|end_ske...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CitiesService: """Service for getting the cities list from Google places.""" def __init__(self): """Initialize method for cities service.""" self.objects = [] self.errors = None self.api_key = os.environ.get('GOOGLE_PLACES_API') def find_by_name(self, name): "...
the_stack_v2_python_sparse
common/services/cities_service.py
vsokoltsov/Interview360Server
train
2
db41f2ab000ef8f7ae894177d86b1b2776ac003f
[ "logger.info('loading corpus from %s' % fname)\nself.fname = fname\nself.length = None\nself.labels = labels\nhead = ''.join(itertools.islice(utils.smart_open(self.fname), 5))\nself.headers = csv.Sniffer().has_header(head)\nself.dialect = csv.Sniffer().sniff(head)\nlogger.info('sniffed CSV delimiter=%r, headers=%s'...
<|body_start_0|> logger.info('loading corpus from %s' % fname) self.fname = fname self.length = None self.labels = labels head = ''.join(itertools.islice(utils.smart_open(self.fname), 5)) self.headers = csv.Sniffer().has_header(head) self.dialect = csv.Sniffer().s...
Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats.
CsvCorpus
[ "Python-2.0", "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CsvCorpus: """Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats.""" def __init__(self, fname, labels): """Initialize the corpus from a file. `labels` = are class labels present in t...
stack_v2_sparse_classes_75kplus_train_073911
1,880
permissive
[ { "docstring": "Initialize the corpus from a file. `labels` = are class labels present in the input file? => skip the first column", "name": "__init__", "signature": "def __init__(self, fname, labels)" }, { "docstring": "Iterate over the corpus, returning one sparse vector at a time.", "name...
2
stack_v2_sparse_classes_30k_train_050639
Implement the Python class `CsvCorpus` described below. Class description: Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats. Method signatures and docstrings: - def __init__(self, fname, labels): Initialize the cor...
Implement the Python class `CsvCorpus` described below. Class description: Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats. Method signatures and docstrings: - def __init__(self, fname, labels): Initialize the cor...
2c9002f16bb5c265e0d14f4a2314c86eeaa35cb6
<|skeleton|> class CsvCorpus: """Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats.""" def __init__(self, fname, labels): """Initialize the corpus from a file. `labels` = are class labels present in t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CsvCorpus: """Corpus in CSV format. The CSV delimiter, headers etc. are guessed automatically based on the file content. All row values are expected to be ints/floats.""" def __init__(self, fname, labels): """Initialize the corpus from a file. `labels` = are class labels present in the input file...
the_stack_v2_python_sparse
lib/python2.7/site-packages/gensim/corpora/csvcorpus.py
wangyum/Anaconda
train
11
dd71e51390519c515ed9914888f22e9accb0602c
[ "if self.physical_element in ['UH', 'UR'] and self.num_value is not None:\n return self.num_value * 10\nif self.unit_convention == 'E' or self.num_value is None:\n return self.num_value\nename = shef_english_units.get(self.physical_element)\nsname = shef_standard_units.get(self.physical_element)\nif ename is ...
<|body_start_0|> if self.physical_element in ['UH', 'UR'] and self.num_value is not None: return self.num_value * 10 if self.unit_convention == 'E' or self.num_value is None: return self.num_value ename = shef_english_units.get(self.physical_element) sname = shef_...
A PEDTSEP Element.
SHEFElement
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SHEFElement: """A PEDTSEP Element.""" def to_english(self) -> float: """Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value.""" <|body_0|> def varname(self) -> str: """Return the Fu...
stack_v2_sparse_classes_75kplus_train_073912
4,398
permissive
[ { "docstring": "Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value.", "name": "to_english", "signature": "def to_english(self) -> float" }, { "docstring": "Return the Full SHEF Code.", "name": "varname", "...
4
stack_v2_sparse_classes_30k_train_009637
Implement the Python class `SHEFElement` described below. Class description: A PEDTSEP Element. Method signatures and docstrings: - def to_english(self) -> float: Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value. - def varname(self) ...
Implement the Python class `SHEFElement` described below. Class description: A PEDTSEP Element. Method signatures and docstrings: - def to_english(self) -> float: Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value. - def varname(self) ...
460f44394be05e1b655111595a3d7de3f7e47757
<|skeleton|> class SHEFElement: """A PEDTSEP Element.""" def to_english(self) -> float: """Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value.""" <|body_0|> def varname(self) -> str: """Return the Fu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SHEFElement: """A PEDTSEP Element.""" def to_english(self) -> float: """Return an English value representation. Implementation Note: In the case of wind direction (UH, UR), this returns the un-scaled value.""" if self.physical_element in ['UH', 'UR'] and self.num_value is not None: ...
the_stack_v2_python_sparse
src/pyiem/models/shef.py
akrherz/pyIEM
train
38
e4eda1a37903139fa2a3d3ae9e6c4813052ef369
[ "nums, result, i = (sorted(nums), [], 0)\nwhile i < len(nums) - 2:\n if i == 0 or nums[i] != nums[i - 1]:\n j, k = (i + 1, len(nums) - 1)\n while j < k:\n if nums[i] + nums[j] + nums[k] < 0:\n j += 1\n elif nums[i] + nums[j] + nums[k] > 0:\n k -= ...
<|body_start_0|> nums, result, i = (sorted(nums), [], 0) while i < len(nums) - 2: if i == 0 or nums[i] != nums[i - 1]: j, k = (i + 1, len(nums) - 1) while j < k: if nums[i] + nums[j] + nums[k] < 0: j += 1 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def threeSum2(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|> <|body_start_0|> nums, result, i = (sorted(...
stack_v2_sparse_classes_75kplus_train_073913
12,022
no_license
[ { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "threeSum", "signature": "def threeSum(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "threeSum2", "signature": "def threeSum2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_037827
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSum(self, nums): :type nums: List[int] :rtype: List[List[int]] - def threeSum2(self, nums): :type nums: List[int] :rtype: List[List[int]]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSum(self, nums): :type nums: List[int] :rtype: List[List[int]] - def threeSum2(self, nums): :type nums: List[int] :rtype: List[List[int]] <|skeleton|> class Solution: ...
035ef08434fa1ca781a6fb2f9eed3538b7d20c02
<|skeleton|> class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def threeSum2(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" nums, result, i = (sorted(nums), [], 0) while i < len(nums) - 2: if i == 0 or nums[i] != nums[i - 1]: j, k = (i + 1, len(nums) - 1) while j < k: ...
the_stack_v2_python_sparse
leetcode_python/Array/3sum.py
yennanliu/CS_basics
train
64
cf559b5c0966fc31016507766b68fecc09144653
[ "super(MicroTomographyAnalyzer.Rotator, self).__init__()\nself.ui = outer.ui\nself.outer = outer\nself.angle = None\nself.make_connections()", "self.ui.rotation_angle.valueChanged.connect(self.rotate_preview)\nself.output_tensor.connect(self.outer.set_tensor)\nself.progress.connect(self.ui.progress.setValue)\nsel...
<|body_start_0|> super(MicroTomographyAnalyzer.Rotator, self).__init__() self.ui = outer.ui self.outer = outer self.angle = None self.make_connections() <|end_body_0|> <|body_start_1|> self.ui.rotation_angle.valueChanged.connect(self.rotate_preview) self.output_t...
Rotator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Rotator: def __init__(self, outer): """Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI.""" <|body_0|> def make_connections(self): """Establishes connections between GUI elements and methods""" <|body_1|> def r...
stack_v2_sparse_classes_75kplus_train_073914
27,085
no_license
[ { "docstring": "Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI.", "name": "__init__", "signature": "def __init__(self, outer)" }, { "docstring": "Establishes connections between GUI elements and methods", "name": "make_connections", "signatur...
5
null
Implement the Python class `Rotator` described below. Class description: Implement the Rotator class. Method signatures and docstrings: - def __init__(self, outer): Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI. - def make_connections(self): Establishes connections betwe...
Implement the Python class `Rotator` described below. Class description: Implement the Rotator class. Method signatures and docstrings: - def __init__(self, outer): Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI. - def make_connections(self): Establishes connections betwe...
fb462691e14a650a0d55cd059721b13ece589105
<|skeleton|> class Rotator: def __init__(self, outer): """Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI.""" <|body_0|> def make_connections(self): """Establishes connections between GUI elements and methods""" <|body_1|> def r...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Rotator: def __init__(self, outer): """Rotates tensor around center point in two axis Args: outer: Outer instance that owns the GUI.""" super(MicroTomographyAnalyzer.Rotator, self).__init__() self.ui = outer.ui self.outer = outer self.angle = None self.make_conn...
the_stack_v2_python_sparse
segmentation_cpg/segmentation.py
elerator/capillary_effects_aluminum
train
0
a559d65be327d7bc908edd544ad184f2bf88ebe2
[ "result = []\ndistance = [[0] * len(points) for _ in range(len(points))]\nfor i in range(len(points)):\n for j in range(i):\n distance[i][j] = (points[i][0] - points[j][0]) ** 2 + (points[i][1] - points[j][1]) ** 2\n distance[j][i] = distance[i][j]\n for m in range(i):\n if distan...
<|body_start_0|> result = [] distance = [[0] * len(points) for _ in range(len(points))] for i in range(len(points)): for j in range(i): distance[i][j] = (points[i][0] - points[j][0]) ** 2 + (points[i][1] - points[j][1]) ** 2 distance[j][i] = distance[i...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def _numberOfBoomerangs(self, points): """:type points: List[List[int]] :rtype: int""" <|body_0|> def numberOfBoomerangs(self, points): """:type points: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> result = [...
stack_v2_sparse_classes_75kplus_train_073915
8,991
permissive
[ { "docstring": ":type points: List[List[int]] :rtype: int", "name": "_numberOfBoomerangs", "signature": "def _numberOfBoomerangs(self, points)" }, { "docstring": ":type points: List[List[int]] :rtype: int", "name": "numberOfBoomerangs", "signature": "def numberOfBoomerangs(self, points)"...
2
stack_v2_sparse_classes_30k_train_047516
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _numberOfBoomerangs(self, points): :type points: List[List[int]] :rtype: int - def numberOfBoomerangs(self, points): :type points: List[List[int]] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def _numberOfBoomerangs(self, points): :type points: List[List[int]] :rtype: int - def numberOfBoomerangs(self, points): :type points: List[List[int]] :rtype: int <|skeleton|> c...
0dd67edca4e0b0323cb5a7239f02ea46383cd15a
<|skeleton|> class Solution: def _numberOfBoomerangs(self, points): """:type points: List[List[int]] :rtype: int""" <|body_0|> def numberOfBoomerangs(self, points): """:type points: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def _numberOfBoomerangs(self, points): """:type points: List[List[int]] :rtype: int""" result = [] distance = [[0] * len(points) for _ in range(len(points))] for i in range(len(points)): for j in range(i): distance[i][j] = (points[i][0] - p...
the_stack_v2_python_sparse
447.number-of-boomerangs.py
windard/leeeeee
train
0
1b0694fb790fea310372936e5795358d48d757ea
[ "self.__logger = Logger.get_instance()\nself.__is_initialised = False\nself.__database_url = os.environ['DATABASE_URL']\nself.__database_connection = None", "if self.__is_initialised:\n self.__logger.log(\"Skipping initialising the database client as it's already initialised.\")\n return\nself.__logger.log(...
<|body_start_0|> self.__logger = Logger.get_instance() self.__is_initialised = False self.__database_url = os.environ['DATABASE_URL'] self.__database_connection = None <|end_body_0|> <|body_start_1|> if self.__is_initialised: self.__logger.log("Skipping initialising ...
Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variable to keep track of whether the database client has been initialised or not.
DatabaseClient
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DatabaseClient: """Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variable to keep track of whether the databas...
stack_v2_sparse_classes_75kplus_train_073916
2,605
no_license
[ { "docstring": "Initialises a new instance of this class.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Initialises the device token manager.", "name": "initialise", "signature": "def initialise(self)" }, { "docstring": "Executes the given SQL query. ...
3
stack_v2_sparse_classes_30k_train_025513
Implement the Python class `DatabaseClient` described below. Class description: Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variab...
Implement the Python class `DatabaseClient` described below. Class description: Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variab...
db6506683fd664a918fff298a671a004310a5709
<|skeleton|> class DatabaseClient: """Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variable to keep track of whether the databas...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DatabaseClient: """Represents client for managing connections to the nlp-analytics database. TODO: need to think about thread safety in this class. ... Attributes ---------- __logger : Logger The logger of this class. __is_initialised : bool A boolean variable to keep track of whether the database client has ...
the_stack_v2_python_sparse
src/core/database_client.py
skingswolf/coinarius-analytics
train
0
53b2dfd733cf264e13684fe707facabe6a5eeaa7
[ "super().__init__(r_cut, elements, **kwargs)\nself.elements = list(np.sort(elements))\nself.r_cut = r_cut\nself.grids_eam = grids_eam\nself.alpha = alpha\nself.r0 = r0", "super().calculate(atoms, properties, system_changes)\nforces = np.zeros((len(self.atoms), 3))\npotential_energies = np.zeros((len(self.atoms), ...
<|body_start_0|> super().__init__(r_cut, elements, **kwargs) self.elements = list(np.sort(elements)) self.r_cut = r_cut self.grids_eam = grids_eam self.alpha = alpha self.r0 = r0 <|end_body_0|> <|body_start_1|> super().calculate(atoms, properties, system_changes)...
A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object
EamManySpecies
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EamManySpecies: """A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object""" def __init__(self, r_cut, elements, grids_eam, alpha, r0, **kwargs): "...
stack_v2_sparse_classes_75kplus_train_073917
25,108
permissive
[ { "docstring": "Args: elements (list): List of ordered atomic numbers of the mapped two species system. grid_eam (list): list of 1D Spline interpolator, one for each element in elements r_cut (float): cutoff radius alpha (float): Exponential prefactor of the eam Descriptor r0 (float): Radius in the exponent of ...
2
null
Implement the Python class `EamManySpecies` described below. Class description: A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object Method signatures and docstrings: - def __init...
Implement the Python class `EamManySpecies` described below. Class description: A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object Method signatures and docstrings: - def __init...
cd1b22b606dfd64d91dc94fece72ad6a707212af
<|skeleton|> class EamManySpecies: """A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object""" def __init__(self, r_cut, elements, grids_eam, alpha, r0, **kwargs): "...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EamManySpecies: """A mapped Eam calculator for ase Attributes: grid_eam (object): list of 1D Spline interpolator, one for each element in elements results(dict): energy and forces calculated on the atoms object""" def __init__(self, r_cut, elements, grids_eam, alpha, r0, **kwargs): """Args: eleme...
the_stack_v2_python_sparse
mff/calculators.py
kcl-tscm/mff
train
16
7ad354bca79c604fc83cc7415ae82bba35cc6c51
[ "course = self.test_settings['test_course']\nself.search_for_course(type=course['type'], school=course['school'], term=course['term'], year=course['year'], search_term=course['cid'])\nself.assertTrue(self.search_page.is_course_displayed(cid=course['cid']))", "course = self.test_settings['test_course_with_registra...
<|body_start_0|> course = self.test_settings['test_course'] self.search_for_course(type=course['type'], school=course['school'], term=course['term'], year=course['year'], search_term=course['cid']) self.assertTrue(self.search_page.is_course_displayed(cid=course['cid'])) <|end_body_0|> <|body_st...
CourseSearchTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CourseSearchTests: def test_course_search(self): """verify the course search functionality""" <|body_0|> def test_course_code_when_registrar_code_display_is_null(self): """Test when course has a registrar_code_display that is null in db. Expected result: Course Code ...
stack_v2_sparse_classes_75kplus_train_073918
2,347
no_license
[ { "docstring": "verify the course search functionality", "name": "test_course_search", "signature": "def test_course_search(self)" }, { "docstring": "Test when course has a registrar_code_display that is null in db. Expected result: Course Code will display the registrar_code :return:", "nam...
3
stack_v2_sparse_classes_30k_train_006705
Implement the Python class `CourseSearchTests` described below. Class description: Implement the CourseSearchTests class. Method signatures and docstrings: - def test_course_search(self): verify the course search functionality - def test_course_code_when_registrar_code_display_is_null(self): Test when course has a re...
Implement the Python class `CourseSearchTests` described below. Class description: Implement the CourseSearchTests class. Method signatures and docstrings: - def test_course_search(self): verify the course search functionality - def test_course_code_when_registrar_code_display_is_null(self): Test when course has a re...
c00f9af5bbe344d0cbf71bcdfe2c3af85ae4be4a
<|skeleton|> class CourseSearchTests: def test_course_search(self): """verify the course search functionality""" <|body_0|> def test_course_code_when_registrar_code_display_is_null(self): """Test when course has a registrar_code_display that is null in db. Expected result: Course Code ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CourseSearchTests: def test_course_search(self): """verify the course search functionality""" course = self.test_settings['test_course'] self.search_for_course(type=course['type'], school=course['school'], term=course['term'], year=course['year'], search_term=course['cid']) sel...
the_stack_v2_python_sparse
selenium_tests/course_info/course_info_search_tests.py
Harvard-University-iCommons/canvas_account_admin_tools
train
4
d161974b8923897fd21d8e0879fbee9d8dc65081
[ "auto = input('是否静音(Y/n):').strip()\nif auto in ['y', 'Y', '']:\n OPTIONS().Mute_Audio = True\nelse:\n OPTIONS().Mute_Audio = False", "headless = input('是否显示自动化过程(y/N):').strip()\nif headless in ['y', 'Y']:\n OPTIONS().Headless = False\nelse:\n OPTIONS().Headless = True", "token = input('是否持久化登录(Y/n...
<|body_start_0|> auto = input('是否静音(Y/n):').strip() if auto in ['y', 'Y', '']: OPTIONS().Mute_Audio = True else: OPTIONS().Mute_Audio = False <|end_body_0|> <|body_start_1|> headless = input('是否显示自动化过程(y/N):').strip() if headless in ['y', 'Y']: ...
选项管理类
OPTIONS_MANAGE
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OPTIONS_MANAGE: """选项管理类""" def __Auto(cls) -> None: """__Auto() -> None 禁音选项(默认: True) :return: None""" <|body_0|> def __Headless(cls) -> None: """__Headless() -> None 显示过程选项(默认: False) :return: None""" <|body_1|> def __Token(cls) -> None: "...
stack_v2_sparse_classes_75kplus_train_073919
3,572
permissive
[ { "docstring": "__Auto() -> None 禁音选项(默认: True) :return: None", "name": "__Auto", "signature": "def __Auto(cls) -> None" }, { "docstring": "__Headless() -> None 显示过程选项(默认: False) :return: None", "name": "__Headless", "signature": "def __Headless(cls) -> None" }, { "docstring": "_...
6
stack_v2_sparse_classes_30k_train_052505
Implement the Python class `OPTIONS_MANAGE` described below. Class description: 选项管理类 Method signatures and docstrings: - def __Auto(cls) -> None: __Auto() -> None 禁音选项(默认: True) :return: None - def __Headless(cls) -> None: __Headless() -> None 显示过程选项(默认: False) :return: None - def __Token(cls) -> None: __Token() -> ...
Implement the Python class `OPTIONS_MANAGE` described below. Class description: 选项管理类 Method signatures and docstrings: - def __Auto(cls) -> None: __Auto() -> None 禁音选项(默认: True) :return: None - def __Headless(cls) -> None: __Headless() -> None 显示过程选项(默认: False) :return: None - def __Token(cls) -> None: __Token() -> ...
9e2a023917b86460fb02984aed9fe638c3d38dd4
<|skeleton|> class OPTIONS_MANAGE: """选项管理类""" def __Auto(cls) -> None: """__Auto() -> None 禁音选项(默认: True) :return: None""" <|body_0|> def __Headless(cls) -> None: """__Headless() -> None 显示过程选项(默认: False) :return: None""" <|body_1|> def __Token(cls) -> None: "...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class OPTIONS_MANAGE: """选项管理类""" def __Auto(cls) -> None: """__Auto() -> None 禁音选项(默认: True) :return: None""" auto = input('是否静音(Y/n):').strip() if auto in ['y', 'Y', '']: OPTIONS().Mute_Audio = True else: OPTIONS().Mute_Audio = False def __Headless...
the_stack_v2_python_sparse
inside/Options/Options_Manage.py
lifansama/learning-power
train
1
48ae130d70feb9bc53d11c9d048e30c7fd28cd4c
[ "if n < 2:\n return []\nif n == 2:\n return [2]\ns = range(3, n, 2)\nmroot = n ** 0.5\nhalf = len(s)\ni = 0\nm = 3\nwhile m <= mroot:\n if s[i]:\n j = (m * m - 3) // 2\n if j < len(s):\n s[j] = 0\n while j < min(len(s), half):\n s[j] = 0\n j...
<|body_start_0|> if n < 2: return [] if n == 2: return [2] s = range(3, n, 2) mroot = n ** 0.5 half = len(s) i = 0 m = 3 while m <= mroot: if s[i]: j = (m * m - 3) // 2 if j < len(s): ...
Solution
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def find_primes(n): """returns a list of prime numbers from 2 to < n""" <|body_0|> def judgeSquareSum(self, c): """:type c: int :rtype: bool""" <|body_1|> <|end_skeleton|> <|body_start_0|> if n < 2: return [] if n == 2:...
stack_v2_sparse_classes_75kplus_train_073920
1,325
permissive
[ { "docstring": "returns a list of prime numbers from 2 to < n", "name": "find_primes", "signature": "def find_primes(n)" }, { "docstring": ":type c: int :rtype: bool", "name": "judgeSquareSum", "signature": "def judgeSquareSum(self, c)" } ]
2
stack_v2_sparse_classes_30k_train_005930
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_primes(n): returns a list of prime numbers from 2 to < n - def judgeSquareSum(self, c): :type c: int :rtype: bool
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def find_primes(n): returns a list of prime numbers from 2 to < n - def judgeSquareSum(self, c): :type c: int :rtype: bool <|skeleton|> class Solution: def find_primes(n): ...
844c6f18d06dcb397db76436e5f4b8ddcb1beddc
<|skeleton|> class Solution: def find_primes(n): """returns a list of prime numbers from 2 to < n""" <|body_0|> def judgeSquareSum(self, c): """:type c: int :rtype: bool""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def find_primes(n): """returns a list of prime numbers from 2 to < n""" if n < 2: return [] if n == 2: return [2] s = range(3, n, 2) mroot = n ** 0.5 half = len(s) i = 0 m = 3 while m <= mroot: ...
the_stack_v2_python_sparse
py/sum-of-square-numbers.py
ckclark/leetcode
train
0
4517e517e873ae242677697f5cda761a8c2be5fb
[ "self.sent_freq_dict = defaultdict(int)\nself.curr_sent = ''\nfor i in range(len(sentences)):\n self.sent_freq_dict[sentences[i]] = times[i]", "if c == '#':\n self.sent_freq_dict[self.curr_sent] += 1\n self.curr_sent = ''\nelse:\n self.curr_sent += c\n L = len(self.curr_sent)\n temp_lst = []\n ...
<|body_start_0|> self.sent_freq_dict = defaultdict(int) self.curr_sent = '' for i in range(len(sentences)): self.sent_freq_dict[sentences[i]] = times[i] <|end_body_0|> <|body_start_1|> if c == '#': self.sent_freq_dict[self.curr_sent] += 1 self.curr_se...
AutocompleteSystem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" <|body_0|> def input(self, c): """:type c: str :rtype: List[str]""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.sent_freq_dict = ...
stack_v2_sparse_classes_75kplus_train_073921
1,296
no_license
[ { "docstring": ":type sentences: List[str] :type times: List[int]", "name": "__init__", "signature": "def __init__(self, sentences, times)" }, { "docstring": ":type c: str :rtype: List[str]", "name": "input", "signature": "def input(self, c)" } ]
2
stack_v2_sparse_classes_30k_train_047964
Implement the Python class `AutocompleteSystem` described below. Class description: Implement the AutocompleteSystem class. Method signatures and docstrings: - def __init__(self, sentences, times): :type sentences: List[str] :type times: List[int] - def input(self, c): :type c: str :rtype: List[str]
Implement the Python class `AutocompleteSystem` described below. Class description: Implement the AutocompleteSystem class. Method signatures and docstrings: - def __init__(self, sentences, times): :type sentences: List[str] :type times: List[int] - def input(self, c): :type c: str :rtype: List[str] <|skeleton|> cla...
a9b2de06306f3929a82ef4e6613c972e9a2c2200
<|skeleton|> class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" <|body_0|> def input(self, c): """:type c: str :rtype: List[str]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AutocompleteSystem: def __init__(self, sentences, times): """:type sentences: List[str] :type times: List[int]""" self.sent_freq_dict = defaultdict(int) self.curr_sent = '' for i in range(len(sentences)): self.sent_freq_dict[sentences[i]] = times[i] def input(s...
the_stack_v2_python_sparse
Practice_3/Design_Search_Autocomplete_System.py
anantvir/Leetcode-Problems
train
1
ed0208f820b21d24c1005f59a50359c6c34fd38e
[ "self.topic = sub_hedge_imu_json_topic(SYSTEM_REAL, THING_TYPE_AGENT, THING_GROUP_LOADER)\nif debug:\n print('[IMUSubscriber] topic name = {}'.format(self.topic))\nsuper().__init__(aws_iot_client_factory, name='IMU', topic_name=self.topic, debug=debug)", "if self.debug:\n print('[IMUSubscriber] subscribed:{...
<|body_start_0|> self.topic = sub_hedge_imu_json_topic(SYSTEM_REAL, THING_TYPE_AGENT, THING_GROUP_LOADER) if debug: print('[IMUSubscriber] topic name = {}'.format(self.topic)) super().__init__(aws_iot_client_factory, name='IMU', topic_name=self.topic, debug=debug) <|end_body_0|> <|b...
Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。
IMUSubscriber
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IMUSubscriber: """Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。""" def __init__(self, aws_iot_client_factory, debug=False): """Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT Coreファクトリオブジェクト debug デバッグフラグ 戻り値: なし""" <|body_...
stack_v2_sparse_classes_75kplus_train_073922
7,541
no_license
[ { "docstring": "Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT Coreファクトリオブジェクト debug デバッグフラグ 戻り値: なし", "name": "__init__", "signature": "def __init__(self, aws_iot_client_factory, debug=False)" }, { "docstring": "Subscribe した Marvelmindデータ(辞書型、IMUデータのみ)を取得する。 引...
2
stack_v2_sparse_classes_30k_train_052855
Implement the Python class `IMUSubscriber` described below. Class description: Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。 Method signatures and docstrings: - def __init__(self, aws_iot_client_factory, debug=False): Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT...
Implement the Python class `IMUSubscriber` described below. Class description: Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。 Method signatures and docstrings: - def __init__(self, aws_iot_client_factory, debug=False): Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT...
1ec8c285fcb3996eaa77869b15af993696e113a8
<|skeleton|> class IMUSubscriber: """Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。""" def __init__(self, aws_iot_client_factory, debug=False): """Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT Coreファクトリオブジェクト debug デバッグフラグ 戻り値: なし""" <|body_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class IMUSubscriber: """Marvelmindデータ(辞書型、IMUデータのみ)を AWS IoT Core から Subscirbe するパーツクラス。""" def __init__(self, aws_iot_client_factory, debug=False): """Subscribeを実行する。 real/agent/loaderをSubscribeする。 引数: aws_iot_client_factory AWS IoT Coreファクトリオブジェクト debug デバッグフラグ 戻り値: なし""" self.topic = sub_hed...
the_stack_v2_python_sparse
parts/broker/sub/hedge.py
coolerking/agent_smith
train
0
79018f99c43d9acb3717d20a86edbd2675c4c362
[ "super(SubGraphLayer, self).__init__()\nself.mlp_input_size = feature_length\nself.mlp_output_size = feature_length\nself.hidden_size = 64\nself.node_encoder = nn.Sequential(nn.Linear(self.mlp_input_size, self.hidden_size), nn.LayerNorm(self.hidden_size), nn.ReLU(True), nn.Linear(self.hidden_size, self.mlp_output_s...
<|body_start_0|> super(SubGraphLayer, self).__init__() self.mlp_input_size = feature_length self.mlp_output_size = feature_length self.hidden_size = 64 self.node_encoder = nn.Sequential(nn.Linear(self.mlp_input_size, self.hidden_size), nn.LayerNorm(self.hidden_size), nn.ReLU(True...
One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator).
SubGraphLayer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubGraphLayer: """One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator).""" def __init__(self, feature_length): """:pa...
stack_v2_sparse_classes_75kplus_train_073923
3,612
no_license
[ { "docstring": ":param feature_length: the length of input vector.", "name": "__init__", "signature": "def __init__(self, feature_length)" }, { "docstring": ":param x: A number of vectors. x.shape = [batch size, vNumber, feature_length] :return: All processed vectors with shape [batch size, vNum...
2
stack_v2_sparse_classes_30k_train_047943
Implement the Python class `SubGraphLayer` described below. Class description: One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator). Method signatures ...
Implement the Python class `SubGraphLayer` described below. Class description: One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator). Method signatures ...
0a314f7bdfc6db0247c92bc2c5c3806fdd18b885
<|skeleton|> class SubGraphLayer: """One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator).""" def __init__(self, feature_length): """:pa...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SubGraphLayer: """One layer of subgraph, include the MLP of g_enc. The calculation detail in this paper's 3.2 section. Input some vectors with 'feature_length' length, the output's length is '2*feature_length'(because of concat operator).""" def __init__(self, feature_length): """:param feature_l...
the_stack_v2_python_sparse
sub_graph.py
JieFeng-cse/dynamic_driving
train
1
213774e45b33b5de93b0fb722fe19bc1a20a55c5
[ "self.config = dict(max_depth=max_depth, sleep_seconds=sleep_seconds)\nsuper().__init__(config=self.config, **kwargs)\nreturn", "from sklearn import datasets\nfrom sklearn.tree import DecisionTreeClassifier\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.metrics import accuracy_score\nfrom tim...
<|body_start_0|> self.config = dict(max_depth=max_depth, sleep_seconds=sleep_seconds) super().__init__(config=self.config, **kwargs) return <|end_body_0|> <|body_start_1|> from sklearn import datasets from sklearn.tree import DecisionTreeClassifier from sklearn.model_sel...
IrisDemo
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IrisDemo: def __init__(self, max_depth=None, sleep_seconds=0, **kwargs): """All the information you want to pass inside the flow function, you can embed in the config dictionary.""" <|body_0|> def imports(): """For remote executions, you better specify your imports e...
stack_v2_sparse_classes_75kplus_train_073924
2,960
permissive
[ { "docstring": "All the information you want to pass inside the flow function, you can embed in the config dictionary.", "name": "__init__", "signature": "def __init__(self, max_depth=None, sleep_seconds=0, **kwargs)" }, { "docstring": "For remote executions, you better specify your imports expl...
3
null
Implement the Python class `IrisDemo` described below. Class description: Implement the IrisDemo class. Method signatures and docstrings: - def __init__(self, max_depth=None, sleep_seconds=0, **kwargs): All the information you want to pass inside the flow function, you can embed in the config dictionary. - def import...
Implement the Python class `IrisDemo` described below. Class description: Implement the IrisDemo class. Method signatures and docstrings: - def __init__(self, max_depth=None, sleep_seconds=0, **kwargs): All the information you want to pass inside the flow function, you can embed in the config dictionary. - def import...
10a8eeb30bfc71de4acfd4b0a20e51347cc31fcb
<|skeleton|> class IrisDemo: def __init__(self, max_depth=None, sleep_seconds=0, **kwargs): """All the information you want to pass inside the flow function, you can embed in the config dictionary.""" <|body_0|> def imports(): """For remote executions, you better specify your imports e...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class IrisDemo: def __init__(self, max_depth=None, sleep_seconds=0, **kwargs): """All the information you want to pass inside the flow function, you can embed in the config dictionary.""" self.config = dict(max_depth=max_depth, sleep_seconds=sleep_seconds) super().__init__(config=self.config...
the_stack_v2_python_sparse
src/affe/demo/IrisDemo.py
eliavw/affe
train
1
cd3e8572e1e7bfc4607a40f4198109b33d10a843
[ "try:\n verify_token(request.headers)\nexcept Exception as err:\n ns.abort(401, message=err)\ntry:\n obs = observaciones_pre_asf.read(id)\nexcept psycopg2.Error as err:\n ns.abort(400, message=get_msg_pgerror(err))\nexcept EmptySetError:\n ns.abort(404, message=ObservacionPreAsf.obs_not_found)\nexcep...
<|body_start_0|> try: verify_token(request.headers) except Exception as err: ns.abort(401, message=err) try: obs = observaciones_pre_asf.read(id) except psycopg2.Error as err: ns.abort(400, message=get_msg_pgerror(err)) except Empty...
ObservacionPreAsf
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ObservacionPreAsf: def get(self, id): """To fetch an observation (preliminar de la ASF)""" <|body_0|> def put(self, id): """To update an observation (preliminar de la ASF)""" <|body_1|> def delete(self, id): """To delete an observation (prelimina...
stack_v2_sparse_classes_75kplus_train_073925
13,540
no_license
[ { "docstring": "To fetch an observation (preliminar de la ASF)", "name": "get", "signature": "def get(self, id)" }, { "docstring": "To update an observation (preliminar de la ASF)", "name": "put", "signature": "def put(self, id)" }, { "docstring": "To delete an observation (preli...
3
stack_v2_sparse_classes_30k_train_017555
Implement the Python class `ObservacionPreAsf` described below. Class description: Implement the ObservacionPreAsf class. Method signatures and docstrings: - def get(self, id): To fetch an observation (preliminar de la ASF) - def put(self, id): To update an observation (preliminar de la ASF) - def delete(self, id): T...
Implement the Python class `ObservacionPreAsf` described below. Class description: Implement the ObservacionPreAsf class. Method signatures and docstrings: - def get(self, id): To fetch an observation (preliminar de la ASF) - def put(self, id): To update an observation (preliminar de la ASF) - def delete(self, id): T...
e00610fac26ef3ca078fd037c0649b70fa0e9a09
<|skeleton|> class ObservacionPreAsf: def get(self, id): """To fetch an observation (preliminar de la ASF)""" <|body_0|> def put(self, id): """To update an observation (preliminar de la ASF)""" <|body_1|> def delete(self, id): """To delete an observation (prelimina...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ObservacionPreAsf: def get(self, id): """To fetch an observation (preliminar de la ASF)""" try: verify_token(request.headers) except Exception as err: ns.abort(401, message=err) try: obs = observaciones_pre_asf.read(id) except psycopg...
the_stack_v2_python_sparse
DOS/soa/service/genl/endpoints/observaciones_pre_asf.py
Telematica/knight-rider
train
1
8da0d16bb56fef384382aae050836db6a277536e
[ "self.tuples = kargs.pop('tuples', None)\nself.context = kargs.pop('context', None)\nself.form_values = kargs.pop('values', None)\nself.show_key = kargs.pop('show_key', None)\nself.is_empty = True\nsuper().__init__(*args, **kargs)\nif not self.form_values:\n self.form_values = [None] * len(self.tuples)\nfor idx,...
<|body_start_0|> self.tuples = kargs.pop('tuples', None) self.context = kargs.pop('context', None) self.form_values = kargs.pop('values', None) self.show_key = kargs.pop('show_key', None) self.is_empty = True super().__init__(*args, **kargs) if not self.form_value...
Form to enter values in a row.
EnterActionIn
[ "LGPL-2.0-or-later", "BSD-3-Clause", "MIT", "Apache-2.0", "LGPL-2.1-only", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EnterActionIn: """Form to enter values in a row.""" def __init__(self, *args, **kargs): """Store parameters and adjust questions, columns, etc.""" <|body_0|> def get_key_value_pairs(self) -> Tuple[List, List, str, Any]: """Extract key/value pairs and primary key/...
stack_v2_sparse_classes_75kplus_train_073926
5,848
permissive
[ { "docstring": "Store parameters and adjust questions, columns, etc.", "name": "__init__", "signature": "def __init__(self, *args, **kargs)" }, { "docstring": "Extract key/value pairs and primary key/value. :return: Tuple with List[keys], List[values], where_field, where_value", "name": "get...
2
stack_v2_sparse_classes_30k_val_001718
Implement the Python class `EnterActionIn` described below. Class description: Form to enter values in a row. Method signatures and docstrings: - def __init__(self, *args, **kargs): Store parameters and adjust questions, columns, etc. - def get_key_value_pairs(self) -> Tuple[List, List, str, Any]: Extract key/value p...
Implement the Python class `EnterActionIn` described below. Class description: Form to enter values in a row. Method signatures and docstrings: - def __init__(self, *args, **kargs): Store parameters and adjust questions, columns, etc. - def get_key_value_pairs(self) -> Tuple[List, List, str, Any]: Extract key/value p...
c432745dfff932cbe7397100422d49df78f0a882
<|skeleton|> class EnterActionIn: """Form to enter values in a row.""" def __init__(self, *args, **kargs): """Store parameters and adjust questions, columns, etc.""" <|body_0|> def get_key_value_pairs(self) -> Tuple[List, List, str, Any]: """Extract key/value pairs and primary key/...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EnterActionIn: """Form to enter values in a row.""" def __init__(self, *args, **kargs): """Store parameters and adjust questions, columns, etc.""" self.tuples = kargs.pop('tuples', None) self.context = kargs.pop('context', None) self.form_values = kargs.pop('values', None)...
the_stack_v2_python_sparse
ontask/action/forms/edit.py
abelardopardo/ontask_b
train
43
c30b39416dac2595e237ce80723bff435462093a
[ "super().__init__(url)\nself._endpoint = SPARQLWrapper(url)\nself._endpoint.setReturnFormat(JSON)", "self._endpoint.setQuery(sparql)\nresponse = self._endpoint.query()\nreturn self.convert(response)", "converted_response = []\nif response:\n response = response.convert()\n var = response['head']['vars'][0...
<|body_start_0|> super().__init__(url) self._endpoint = SPARQLWrapper(url) self._endpoint.setReturnFormat(JSON) <|end_body_0|> <|body_start_1|> self._endpoint.setQuery(sparql) response = self._endpoint.query() return self.convert(response) <|end_body_1|> <|body_start_2|...
Class which issues SPARQL queries to an endpoint
SPARQLEndpoint
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SPARQLEndpoint: """Class which issues SPARQL queries to an endpoint""" def __init__(self, url): """:param url: The SPARQL endpoint :url: str""" <|body_0|> def query(self, ontology, sparql, err_msg): """Issues SPARQL query""" <|body_1|> def convert(se...
stack_v2_sparse_classes_75kplus_train_073927
16,768
permissive
[ { "docstring": ":param url: The SPARQL endpoint :url: str", "name": "__init__", "signature": "def __init__(self, url)" }, { "docstring": "Issues SPARQL query", "name": "query", "signature": "def query(self, ontology, sparql, err_msg)" }, { "docstring": "Converts standard SPARQL q...
3
stack_v2_sparse_classes_30k_train_014089
Implement the Python class `SPARQLEndpoint` described below. Class description: Class which issues SPARQL queries to an endpoint Method signatures and docstrings: - def __init__(self, url): :param url: The SPARQL endpoint :url: str - def query(self, ontology, sparql, err_msg): Issues SPARQL query - def convert(self, ...
Implement the Python class `SPARQLEndpoint` described below. Class description: Class which issues SPARQL queries to an endpoint Method signatures and docstrings: - def __init__(self, url): :param url: The SPARQL endpoint :url: str - def query(self, ontology, sparql, err_msg): Issues SPARQL query - def convert(self, ...
84f6d3fced521849657d21ae4cb9681f5897b957
<|skeleton|> class SPARQLEndpoint: """Class which issues SPARQL queries to an endpoint""" def __init__(self, url): """:param url: The SPARQL endpoint :url: str""" <|body_0|> def query(self, ontology, sparql, err_msg): """Issues SPARQL query""" <|body_1|> def convert(se...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SPARQLEndpoint: """Class which issues SPARQL queries to an endpoint""" def __init__(self, url): """:param url: The SPARQL endpoint :url: str""" super().__init__(url) self._endpoint = SPARQLWrapper(url) self._endpoint.setReturnFormat(JSON) def query(self, ontology, spa...
the_stack_v2_python_sparse
venv/lib/python3.9/site-packages/tyto/endpoint/endpoint.py
ClassWizard/PodLockParser
train
2
b23a4f10e6832228d0190d82263907644be4854b
[ "self.restart = restart\nself.attacks = list(map(construct_attack, base_attack_names))\nlogging.info('UNION CONFIG CREATION: %s', self.__dict__)", "batch_shape = [x.shape[0]] + [1] * (x.shape.rank - 1)\nadv_x = x\nadv_loss = tf.zeros(batch_shape)\nfor attack in self.attacks:\n for _ in range(self.restart):\n ...
<|body_start_0|> self.restart = restart self.attacks = list(map(construct_attack, base_attack_names)) logging.info('UNION CONFIG CREATION: %s', self.__dict__) <|end_body_0|> <|body_start_1|> batch_shape = [x.shape[0]] + [1] * (x.shape.rank - 1) adv_x = x adv_loss = tf.ze...
Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss.
UnionAttack
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnionAttack: """Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss.""" def __init__(self, base_attack_names, restart): """Constructs an Attack object wrapping a b...
stack_v2_sparse_classes_75kplus_train_073928
9,538
permissive
[ { "docstring": "Constructs an Attack object wrapping a base attack with restarts. Args: base_attack_names: List of base attacks, any of ('l1', 'l2', 'linf'). restart: Number of restarts for each attack.", "name": "__init__", "signature": "def __init__(self, base_attack_names, restart)" }, { "doc...
2
stack_v2_sparse_classes_30k_train_001071
Implement the Python class `UnionAttack` described below. Class description: Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss. Method signatures and docstrings: - def __init__(self, base_attack_...
Implement the Python class `UnionAttack` described below. Class description: Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss. Method signatures and docstrings: - def __init__(self, base_attack_...
aaa9d3e4733f3b551823b86f67cf8a572acfeb7d
<|skeleton|> class UnionAttack: """Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss.""" def __init__(self, base_attack_names, restart): """Constructs an Attack object wrapping a b...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UnionAttack: """Composite Attack class with 1+ base attacks and 1+ restarts. For each example, this attack evaluates each base attack with N restarts and take the one with the highest loss.""" def __init__(self, base_attack_names, restart): """Constructs an Attack object wrapping a base attack wi...
the_stack_v2_python_sparse
research/multi_representation_adversary/multi_representation_adversary/attacks.py
jango-blockchained/neural-structured-learning
train
0
ed88116f654c80d60f32045f225fd58046e6f737
[ "self.preorder = preorder\nself.inorder = inorder\nreturn self.dfs(pbegin=0, pend=len(preorder), ibegin=0, iend=len(inorder))", "if pbegin >= pend:\n return None\nif pbegin + 1 == pend:\n return TreeNode(self.preorder[pbegin])\ni = self.inorder.index(self.preorder[pbegin])\ni = i - ibegin\nans = TreeNode(se...
<|body_start_0|> self.preorder = preorder self.inorder = inorder return self.dfs(pbegin=0, pend=len(preorder), ibegin=0, iend=len(inorder)) <|end_body_0|> <|body_start_1|> if pbegin >= pend: return None if pbegin + 1 == pend: return TreeNode(self.preorder...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def buildTree(self, preorder, inorder): """:type preorder: List[int] :type inorder: List[int] :rtype: TreeNode""" <|body_0|> def dfs(self, pbegin, pend, ibegin, iend): """:param pbegin:前序开始节点 :param pend: 前序结束节点 :param ibegin: 中序开始结点 :param iend: 中序结束节点 :re...
stack_v2_sparse_classes_75kplus_train_073929
2,259
no_license
[ { "docstring": ":type preorder: List[int] :type inorder: List[int] :rtype: TreeNode", "name": "buildTree", "signature": "def buildTree(self, preorder, inorder)" }, { "docstring": ":param pbegin:前序开始节点 :param pend: 前序结束节点 :param ibegin: 中序开始结点 :param iend: 中序结束节点 :return:", "name": "dfs", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def buildTree(self, preorder, inorder): :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode - def dfs(self, pbegin, pend, ibegin, iend): :param pbegin:前序开始节点 :par...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def buildTree(self, preorder, inorder): :type preorder: List[int] :type inorder: List[int] :rtype: TreeNode - def dfs(self, pbegin, pend, ibegin, iend): :param pbegin:前序开始节点 :par...
006a142e7d1023f8c542f6642a67ab88ea0af8f7
<|skeleton|> class Solution: def buildTree(self, preorder, inorder): """:type preorder: List[int] :type inorder: List[int] :rtype: TreeNode""" <|body_0|> def dfs(self, pbegin, pend, ibegin, iend): """:param pbegin:前序开始节点 :param pend: 前序结束节点 :param ibegin: 中序开始结点 :param iend: 中序结束节点 :re...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def buildTree(self, preorder, inorder): """:type preorder: List[int] :type inorder: List[int] :rtype: TreeNode""" self.preorder = preorder self.inorder = inorder return self.dfs(pbegin=0, pend=len(preorder), ibegin=0, iend=len(inorder)) def dfs(self, pbegin, pend...
the_stack_v2_python_sparse
DFS/105. Construct Binary Tree from Preorder and Inorder Traversal.py
ShenMinXu/Leetcode-by-python
train
0
45119d87ddb7bb131bb7dff554a8ae5cf4d65d02
[ "filter_parser = reqparse.RequestParser(bundle_errors=True)\nfilter_parser.add_argument('page', type=int, default=DEFAULT_PAGE, location='args')\nfilter_parser.add_argument('size', type=int, default=DEFAULT_SITE, location='args')\nfilter_parser.add_argument('applicant_id', type=int, store_missing=False, location='a...
<|body_start_0|> filter_parser = reqparse.RequestParser(bundle_errors=True) filter_parser.add_argument('page', type=int, default=DEFAULT_PAGE, location='args') filter_parser.add_argument('size', type=int, default=DEFAULT_SITE, location='args') filter_parser.add_argument('applicant_id', t...
SpecimenItemsResource
SpecimenItemsResource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpecimenItemsResource: """SpecimenItemsResource""" def get(self): """Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return:""" <|body_0|> def post(self): """Example: curl http://0.0.0.0:8000/specimen_item -H...
stack_v2_sparse_classes_75kplus_train_073930
10,445
no_license
[ { "docstring": "Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return:", "name": "get", "signature": "def get(self)" }, { "docstring": "Example: curl http://0.0.0.0:8000/specimen_item -H \"Content-Type: application/json\" -X POST -d ' { \"s...
3
stack_v2_sparse_classes_30k_train_037453
Implement the Python class `SpecimenItemsResource` described below. Class description: SpecimenItemsResource Method signatures and docstrings: - def get(self): Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return: - def post(self): Example: curl http://0.0.0.0:...
Implement the Python class `SpecimenItemsResource` described below. Class description: SpecimenItemsResource Method signatures and docstrings: - def get(self): Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return: - def post(self): Example: curl http://0.0.0.0:...
0b44d83b95079734ac9aa78bc7af40a0a7530bca
<|skeleton|> class SpecimenItemsResource: """SpecimenItemsResource""" def get(self): """Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return:""" <|body_0|> def post(self): """Example: curl http://0.0.0.0:8000/specimen_item -H...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SpecimenItemsResource: """SpecimenItemsResource""" def get(self): """Example: curl http://0.0.0.0:8000/specimen_item curl http://0.0.0.0:8000/specimen_item?page=1&size=20 :return:""" filter_parser = reqparse.RequestParser(bundle_errors=True) filter_parser.add_argument('page', type...
the_stack_v2_python_sparse
apps/lims/specimen_item/resource.py
zhanghe06/lims_project
train
1
375ef742badf653713e27ba908eb0bc1044b3fcf
[ "set_req = self.gateway.const.SetReq\nif set_req.V_DIMMER in self._values:\n return SUPPORT_BRIGHTNESS | SUPPORT_COLOR\nreturn SUPPORT_COLOR", "self._turn_on_light()\nself._turn_on_dimmer(**kwargs)\nself._turn_on_rgb_and_w('%02x%02x%02x', **kwargs)\nif self.assumed_state:\n self.async_write_ha_state()", "...
<|body_start_0|> set_req = self.gateway.const.SetReq if set_req.V_DIMMER in self._values: return SUPPORT_BRIGHTNESS | SUPPORT_COLOR return SUPPORT_COLOR <|end_body_0|> <|body_start_1|> self._turn_on_light() self._turn_on_dimmer(**kwargs) self._turn_on_rgb_and...
RGB child class to MySensorsLight.
MySensorsLightRGB
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MySensorsLightRGB: """RGB child class to MySensorsLight.""" def supported_features(self) -> int: """Flag supported features.""" <|body_0|> async def async_turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" <|body_1|> async def async_upda...
stack_v2_sparse_classes_75kplus_train_073931
9,412
permissive
[ { "docstring": "Flag supported features.", "name": "supported_features", "signature": "def supported_features(self) -> int" }, { "docstring": "Turn the device on.", "name": "async_turn_on", "signature": "async def async_turn_on(self, **kwargs: Any) -> None" }, { "docstring": "Upd...
3
null
Implement the Python class `MySensorsLightRGB` described below. Class description: RGB child class to MySensorsLight. Method signatures and docstrings: - def supported_features(self) -> int: Flag supported features. - async def async_turn_on(self, **kwargs: Any) -> None: Turn the device on. - async def async_update(s...
Implement the Python class `MySensorsLightRGB` described below. Class description: RGB child class to MySensorsLight. Method signatures and docstrings: - def supported_features(self) -> int: Flag supported features. - async def async_turn_on(self, **kwargs: Any) -> None: Turn the device on. - async def async_update(s...
2fee32fce03bc49e86cf2e7b741a15621a97cce5
<|skeleton|> class MySensorsLightRGB: """RGB child class to MySensorsLight.""" def supported_features(self) -> int: """Flag supported features.""" <|body_0|> async def async_turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" <|body_1|> async def async_upda...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MySensorsLightRGB: """RGB child class to MySensorsLight.""" def supported_features(self) -> int: """Flag supported features.""" set_req = self.gateway.const.SetReq if set_req.V_DIMMER in self._values: return SUPPORT_BRIGHTNESS | SUPPORT_COLOR return SUPPORT_COL...
the_stack_v2_python_sparse
homeassistant/components/mysensors/light.py
BenWoodford/home-assistant
train
11
fff1f72334b3a548d214143385f5aeaf676dd188
[ "count = 0\nwhile n:\n if n & 1:\n count += 1\n n >>= 1\nreturn count", "count = 0\nwhile n:\n n &= n - 1\n count += 1\nreturn count" ]
<|body_start_0|> count = 0 while n: if n & 1: count += 1 n >>= 1 return count <|end_body_0|> <|body_start_1|> count = 0 while n: n &= n - 1 count += 1 return count <|end_body_1|>
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def hammingWeight(self, n): """:type n: int :rtype: int""" <|body_0|> def hammingWeight(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> count = 0 while n: if n & 1: ...
stack_v2_sparse_classes_75kplus_train_073932
1,056
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "hammingWeight", "signature": "def hammingWeight(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "hammingWeight", "signature": "def hammingWeight(self, n)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def hammingWeight(self, n): :type n: int :rtype: int - def hammingWeight(self, n): :type n: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def hammingWeight(self, n): :type n: int :rtype: int - def hammingWeight(self, n): :type n: int :rtype: int <|skeleton|> class Solution: def hammingWeight(self, n): ...
b209bb253c7b83db0db72bbd47cd306b8fd8b551
<|skeleton|> class Solution: def hammingWeight(self, n): """:type n: int :rtype: int""" <|body_0|> def hammingWeight(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def hammingWeight(self, n): """:type n: int :rtype: int""" count = 0 while n: if n & 1: count += 1 n >>= 1 return count def hammingWeight(self, n): """:type n: int :rtype: int""" count = 0 while n: ...
the_stack_v2_python_sparse
191_hammingWeight.py
taitujing123/my_leetcode
train
1
8de18584fdf13bfaf3552501ef1366ea05303fc1
[ "page_data = super(AdminLabels, self).GatherPageData(mr)\nconfig = self.services.config.GetProjectConfig(mr.cnxn, mr.project_id)\nfield_def_views = [tracker_views.FieldDefView(fd, config) for fd in config.field_defs if not fd.is_deleted]\npage_data.update({'field_defs': field_def_views})\nreturn page_data", "wkl_...
<|body_start_0|> page_data = super(AdminLabels, self).GatherPageData(mr) config = self.services.config.GetProjectConfig(mr.cnxn, mr.project_id) field_def_views = [tracker_views.FieldDefView(fd, config) for fd in config.field_defs if not fd.is_deleted] page_data.update({'field_defs': fiel...
Servlet allowing project owners to labels and fields.
AdminLabels
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdminLabels: """Servlet allowing project owners to labels and fields.""" def GatherPageData(self, mr): """Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request. Returns: Dict of values used by EZT for rendering the p...
stack_v2_sparse_classes_75kplus_train_073933
24,142
permissive
[ { "docstring": "Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request. Returns: Dict of values used by EZT for rendering the page.", "name": "GatherPageData", "signature": "def GatherPageData(self, mr)" }, { "docstring": "Proces...
2
stack_v2_sparse_classes_30k_train_036877
Implement the Python class `AdminLabels` described below. Class description: Servlet allowing project owners to labels and fields. Method signatures and docstrings: - def GatherPageData(self, mr): Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request...
Implement the Python class `AdminLabels` described below. Class description: Servlet allowing project owners to labels and fields. Method signatures and docstrings: - def GatherPageData(self, mr): Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request...
09064105713603f7bf75c772e8354800a1bfa256
<|skeleton|> class AdminLabels: """Servlet allowing project owners to labels and fields.""" def GatherPageData(self, mr): """Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request. Returns: Dict of values used by EZT for rendering the p...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AdminLabels: """Servlet allowing project owners to labels and fields.""" def GatherPageData(self, mr): """Build up a dictionary of data values to use when rendering the page. Args: mr: commonly used info parsed from the request. Returns: Dict of values used by EZT for rendering the page.""" ...
the_stack_v2_python_sparse
appengine/monorail/tracker/issueadmin.py
mcgreevy/chromium-infra
train
1
03374d2f2f58de202c0fc305e7110378b9601227
[ "self.path_base_dir = base_dir\nself.path_script_dir = script_dir\nself.path_app_folder = app_dir\nself.do_analysis = do_analysis", "logging.info('Initiating Android analysis.')\nself.bool_generate_graph = bool_gen_graph\nself.graph_type = graph_type\nself.master_bug_object = bug_object\nself.bool_pull_apps = boo...
<|body_start_0|> self.path_base_dir = base_dir self.path_script_dir = script_dir self.path_app_folder = app_dir self.do_analysis = do_analysis <|end_body_0|> <|body_start_1|> logging.info('Initiating Android analysis.') self.bool_generate_graph = bool_gen_graph s...
PluginMain
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PluginMain: def __init__(self, base_dir, script_dir, app_dir, do_analysis=True): """Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, templates/, etc) :param script_dir: string specifying path to the main script directory, i.e., <root>/...
stack_v2_sparse_classes_75kplus_train_073934
3,227
permissive
[ { "docstring": "Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, templates/, etc) :param script_dir: string specifying path to the main script directory, i.e., <root>/src/ :param app_dir: string specifying path to the directory containing the applications und...
4
stack_v2_sparse_classes_30k_train_006624
Implement the Python class `PluginMain` described below. Class description: Implement the PluginMain class. Method signatures and docstrings: - def __init__(self, base_dir, script_dir, app_dir, do_analysis=True): Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, tem...
Implement the Python class `PluginMain` described below. Class description: Implement the PluginMain class. Method signatures and docstrings: - def __init__(self, base_dir, script_dir, app_dir, do_analysis=True): Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, tem...
641e600cc98c17607ce9743231d11beef064756f
<|skeleton|> class PluginMain: def __init__(self, base_dir, script_dir, app_dir, do_analysis=True): """Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, templates/, etc) :param script_dir: string specifying path to the main script directory, i.e., <root>/...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PluginMain: def __init__(self, base_dir, script_dir, app_dir, do_analysis=True): """Sets script paths. :param base_dir: string specifying path to the base/root directory (contains src/, templates/, etc) :param script_dir: string specifying path to the main script directory, i.e., <root>/src/ :param ap...
the_stack_v2_python_sparse
application/flow_reslove/src/plugins/android/main.py
arnow117/androhunter
train
0
f581d53cc65ab7d72fb7463c501bd26a0227ab4e
[ "sc.logger.info('小影圈推荐页面初始状态检查开始')\nfun_name = 'test_planet_notify_ui'\ntime.sleep(1)\nsc.logger.info('开始查找小影圈按钮')\nel_planet = sc.driver.find_element_by_id('com.quvideo.xiaoying:id/img_find')\nel_planet.click()\ntime.sleep(0.5)\nsc.logger.info('开始查找小影圈消息中心图标')\nel_notify = sc.driver.find_element_by_id('com.quvideo...
<|body_start_0|> sc.logger.info('小影圈推荐页面初始状态检查开始') fun_name = 'test_planet_notify_ui' time.sleep(1) sc.logger.info('开始查找小影圈按钮') el_planet = sc.driver.find_element_by_id('com.quvideo.xiaoying:id/img_find') el_planet.click() time.sleep(0.5) sc.logger.info('开...
小影圈通知页的测试类,分步截图.
TestPlanetNotify
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestPlanetNotify: """小影圈通知页的测试类,分步截图.""" def test_planet_notify_ui(self): """小影圈推荐页面初始状态测试.""" <|body_0|> def test_notify_activity(self): """测试消息中心动态.""" <|body_1|> def test_notify_info(self): """测试消息中心通知页.""" <|body_2|> def test...
stack_v2_sparse_classes_75kplus_train_073935
2,959
no_license
[ { "docstring": "小影圈推荐页面初始状态测试.", "name": "test_planet_notify_ui", "signature": "def test_planet_notify_ui(self)" }, { "docstring": "测试消息中心动态.", "name": "test_notify_activity", "signature": "def test_notify_activity(self)" }, { "docstring": "测试消息中心通知页.", "name": "test_notify_i...
4
stack_v2_sparse_classes_30k_train_006377
Implement the Python class `TestPlanetNotify` described below. Class description: 小影圈通知页的测试类,分步截图. Method signatures and docstrings: - def test_planet_notify_ui(self): 小影圈推荐页面初始状态测试. - def test_notify_activity(self): 测试消息中心动态. - def test_notify_info(self): 测试消息中心通知页. - def test_notify_message(self): 测试消息中心动态.
Implement the Python class `TestPlanetNotify` described below. Class description: 小影圈通知页的测试类,分步截图. Method signatures and docstrings: - def test_planet_notify_ui(self): 小影圈推荐页面初始状态测试. - def test_notify_activity(self): 测试消息中心动态. - def test_notify_info(self): 测试消息中心通知页. - def test_notify_message(self): 测试消息中心动态. <|skel...
b1190e3df62fa85562c14625c06a9794b8ce29a0
<|skeleton|> class TestPlanetNotify: """小影圈通知页的测试类,分步截图.""" def test_planet_notify_ui(self): """小影圈推荐页面初始状态测试.""" <|body_0|> def test_notify_activity(self): """测试消息中心动态.""" <|body_1|> def test_notify_info(self): """测试消息中心通知页.""" <|body_2|> def test...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestPlanetNotify: """小影圈通知页的测试类,分步截图.""" def test_planet_notify_ui(self): """小影圈推荐页面初始状态测试.""" sc.logger.info('小影圈推荐页面初始状态检查开始') fun_name = 'test_planet_notify_ui' time.sleep(1) sc.logger.info('开始查找小影圈按钮') el_planet = sc.driver.find_element_by_id('com.quvid...
the_stack_v2_python_sparse
Android/VivaVideo/test_community/test_planet/test_notify.py
hicheng/UItest
train
0
1f5dd48e3a1863222ab6ce02b6c97ed368020faa
[ "self.layers = ModuleList([DetrTransformerEncoderLayer(**self.layer_cfg) for _ in range(self.num_layers)])\nembed_dims = self.layers[0].embed_dims\nself.embed_dims = embed_dims\nself.query_scale = MLP(embed_dims, embed_dims, embed_dims, 2)", "for layer in self.layers:\n pos_scales = self.query_scale(query)\n ...
<|body_start_0|> self.layers = ModuleList([DetrTransformerEncoderLayer(**self.layer_cfg) for _ in range(self.num_layers)]) embed_dims = self.layers[0].embed_dims self.embed_dims = embed_dims self.query_scale = MLP(embed_dims, embed_dims, embed_dims, 2) <|end_body_0|> <|body_start_1|> ...
Encoder of DAB-DETR.
DABDetrTransformerEncoder
[ "Apache-2.0", "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DABDetrTransformerEncoder: """Encoder of DAB-DETR.""" def _init_layers(self): """Initialize encoder layers.""" <|body_0|> def forward(self, query: Tensor, query_pos: Tensor, key_padding_mask: Tensor, **kwargs): """Forward function of encoder. Args: query (Tensor)...
stack_v2_sparse_classes_75kplus_train_073936
11,683
permissive
[ { "docstring": "Initialize encoder layers.", "name": "_init_layers", "signature": "def _init_layers(self)" }, { "docstring": "Forward function of encoder. Args: query (Tensor): Input queries of encoder, has shape (bs, num_queries, dim). query_pos (Tensor): The positional embeddings of the querie...
2
stack_v2_sparse_classes_30k_train_046254
Implement the Python class `DABDetrTransformerEncoder` described below. Class description: Encoder of DAB-DETR. Method signatures and docstrings: - def _init_layers(self): Initialize encoder layers. - def forward(self, query: Tensor, query_pos: Tensor, key_padding_mask: Tensor, **kwargs): Forward function of encoder....
Implement the Python class `DABDetrTransformerEncoder` described below. Class description: Encoder of DAB-DETR. Method signatures and docstrings: - def _init_layers(self): Initialize encoder layers. - def forward(self, query: Tensor, query_pos: Tensor, key_padding_mask: Tensor, **kwargs): Forward function of encoder....
8d5f9a2d49ab8f9e85ccf058cb02c2fda287afc6
<|skeleton|> class DABDetrTransformerEncoder: """Encoder of DAB-DETR.""" def _init_layers(self): """Initialize encoder layers.""" <|body_0|> def forward(self, query: Tensor, query_pos: Tensor, key_padding_mask: Tensor, **kwargs): """Forward function of encoder. Args: query (Tensor)...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DABDetrTransformerEncoder: """Encoder of DAB-DETR.""" def _init_layers(self): """Initialize encoder layers.""" self.layers = ModuleList([DetrTransformerEncoderLayer(**self.layer_cfg) for _ in range(self.num_layers)]) embed_dims = self.layers[0].embed_dims self.embed_dims =...
the_stack_v2_python_sparse
ai/mmdetection/mmdet/models/layers/transformer/dab_detr_layers.py
alldatacenter/alldata
train
774
d11d8dcf65bca64afdb191aa0f74f6bb242330fd
[ "DebugObject.__init__(self, 'AntialiasingManager')\nself.pipeline = pipeline\nself.jitter = False\nself.jitterOffsets = []\nself.jitterIndex = 0\nself.jitterPTA = PTAVecBase2f.emptyArray(1)\nself.create()", "technique = self.pipeline.settings.antialiasingTechnique\nif technique not in self.availableTechniques:\n ...
<|body_start_0|> DebugObject.__init__(self, 'AntialiasingManager') self.pipeline = pipeline self.jitter = False self.jitterOffsets = [] self.jitterIndex = 0 self.jitterPTA = PTAVecBase2f.emptyArray(1) self.create() <|end_body_0|> <|body_start_1|> techniqu...
The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every second frame, and then merged with the previous...
AntialiasingManager
[ "WTFPL" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AntialiasingManager: """The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every ...
stack_v2_sparse_classes_75kplus_train_073937
3,455
permissive
[ { "docstring": "Creates the manager and directly setups the passes", "name": "__init__", "signature": "def __init__(self, pipeline)" }, { "docstring": "Setups the antialiasing passes, and also computes the jitter offsets", "name": "create", "signature": "def create(self)" }, { "d...
3
stack_v2_sparse_classes_30k_train_028199
Implement the Python class `AntialiasingManager` described below. Class description: The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame ...
Implement the Python class `AntialiasingManager` described below. Class description: The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame ...
12131b115775f97927633d71832af65b99eebd09
<|skeleton|> class AntialiasingManager: """The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AntialiasingManager: """The Antialiasing Manager handles the setup of the antialiasing passes, if antialiasing is defined in the settings. It also handles jittering when using a temporal antialiasing technique like SMAA. When jittering is enabled, the frame is moved by half a pixel up/down every second frame,...
the_stack_v2_python_sparse
Code/AntialiasingManager.py
2lost4u/RenderPipeline
train
1
1c2595edd9546a9b522e60f2036e7ee1d2e978db
[ "number_list = []\nprelist = ['130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '147', '150', '151', '152', '153', '155', '156', '157', '158', '159', '186', '187', '188']\nend = '0123456789'\nfor i in range(n):\n number_list.append(random.choice(prelist) + ''.join(random.sample(end, 8)))\nret...
<|body_start_0|> number_list = [] prelist = ['130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '147', '150', '151', '152', '153', '155', '156', '157', '158', '159', '186', '187', '188'] end = '0123456789' for i in range(n): number_list.append(random.choice...
StringUtil
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StringUtil: def random_phone_number(n): """随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list""" <|body_0|> def random_chinese_str(n, lengh): """随机生成指定位数中文字符的方法 :param n: 生成多少个长度为lengh的字符串 :param lengh: 每个字符串的长度 :return: 长度为length的字符串的list列表""" <|body_1|> ...
stack_v2_sparse_classes_75kplus_train_073938
1,678
no_license
[ { "docstring": "随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list", "name": "random_phone_number", "signature": "def random_phone_number(n)" }, { "docstring": "随机生成指定位数中文字符的方法 :param n: 生成多少个长度为lengh的字符串 :param lengh: 每个字符串的长度 :return: 长度为length的字符串的list列表", "name": "random_chinese_str", ...
2
stack_v2_sparse_classes_30k_train_031552
Implement the Python class `StringUtil` described below. Class description: Implement the StringUtil class. Method signatures and docstrings: - def random_phone_number(n): 随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list - def random_chinese_str(n, lengh): 随机生成指定位数中文字符的方法 :param n: 生成多少个长度为lengh的字符串 :param lengh:...
Implement the Python class `StringUtil` described below. Class description: Implement the StringUtil class. Method signatures and docstrings: - def random_phone_number(n): 随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list - def random_chinese_str(n, lengh): 随机生成指定位数中文字符的方法 :param n: 生成多少个长度为lengh的字符串 :param lengh:...
b7e82387e2dcb32ede99abbda36d04e08efe92fb
<|skeleton|> class StringUtil: def random_phone_number(n): """随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list""" <|body_0|> def random_chinese_str(n, lengh): """随机生成指定位数中文字符的方法 :param n: 生成多少个长度为lengh的字符串 :param lengh: 每个字符串的长度 :return: 长度为length的字符串的list列表""" <|body_1|> ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class StringUtil: def random_phone_number(n): """随机生成11位手机号码方法 :param n: 生成手机号码的数量 :return: 手机号码的list""" number_list = [] prelist = ['130', '131', '132', '133', '134', '135', '136', '137', '138', '139', '147', '150', '151', '152', '153', '155', '156', '157', '158', '159', '186', '187', '188'...
the_stack_v2_python_sparse
hy_api_tmp/Utils/stringutil.py
MiaoMiao-Qi/hy_api_tmp_python
train
0
32581d6d4a692abf945cb3198599ef06ef15b76a
[ "l, r = (0, 0)\nlookup = set()\nmaxLen = 0\nwhile r < len(s):\n if s[r] not in lookup:\n lookup.add(s[r])\n maxLen = max(maxLen, r - l + 1)\n r += 1\n else:\n lookup.remove(s[l])\n l += 1\nreturn maxLen", "l, r = (0, 0)\nlookup = {}\nmaxLen = 0\nwhile r < len(s):\n if s...
<|body_start_0|> l, r = (0, 0) lookup = set() maxLen = 0 while r < len(s): if s[r] not in lookup: lookup.add(s[r]) maxLen = max(maxLen, r - l + 1) r += 1 else: lookup.remove(s[l]) l +=...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLongestSubstring1(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> l, r = (0, 0) lookup = set() ...
stack_v2_sparse_classes_75kplus_train_073939
915
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring1", "signature": "def lengthOfLongestSubstring1(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring", "signature": "def lengthOfLongestSubstring(self, s)" } ]
2
stack_v2_sparse_classes_30k_test_002124
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring1(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring1(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def lengthOf...
d953abe2c9680f636563e76287d2f907e90ced63
<|skeleton|> class Solution: def lengthOfLongestSubstring1(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def lengthOfLongestSubstring1(self, s): """:type s: str :rtype: int""" l, r = (0, 0) lookup = set() maxLen = 0 while r < len(s): if s[r] not in lookup: lookup.add(s[r]) maxLen = max(maxLen, r - l + 1) ...
the_stack_v2_python_sparse
python_leetcode_2020/Python_Leetcode_2020/3_longest_substring_no_repeating.py
xiangcao/Leetcode
train
0
40b35bd084e24510d981210cd0df518989c0f839
[ "logger.info('用例编号:111-1---参数化测试不同杠杆倍数,5,10,20,50,100,成交,先限价多单,后限价空单,完全成交,验证余额')\ndeal_num = 100000000\nstock_price_dict = market_info_get(user=self.buyer, session=self.session, sda_id=sda_id)\nnow_stock_price = int(stock_price_dict['stockPrice'])\ndeal_price = int(int(now_stock_price) * 0.95)\nprint('deal price', ...
<|body_start_0|> logger.info('用例编号:111-1---参数化测试不同杠杆倍数,5,10,20,50,100,成交,先限价多单,后限价空单,完全成交,验证余额') deal_num = 100000000 stock_price_dict = market_info_get(user=self.buyer, session=self.session, sda_id=sda_id) now_stock_price = int(stock_price_dict['stockPrice']) deal_price = int(in...
杠杆完全成交测试类
TestCase
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestCase: """杠杆完全成交测试类""" def test_01(self, lever): """参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return:""" <|body_0|> def test_02(self, lever): """参数化测试不同杠杆倍数成交,先限价空单,后限价多单""" <|body_1|> <|end_skeleton|> <|body_start_0|> logger.info('用例编号:111-1---参数化测试不同杠杆倍数,...
stack_v2_sparse_classes_75kplus_train_073940
8,873
no_license
[ { "docstring": "参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return:", "name": "test_01", "signature": "def test_01(self, lever)" }, { "docstring": "参数化测试不同杠杆倍数成交,先限价空单,后限价多单", "name": "test_02", "signature": "def test_02(self, lever)" } ]
2
null
Implement the Python class `TestCase` described below. Class description: 杠杆完全成交测试类 Method signatures and docstrings: - def test_01(self, lever): 参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return: - def test_02(self, lever): 参数化测试不同杠杆倍数成交,先限价空单,后限价多单
Implement the Python class `TestCase` described below. Class description: 杠杆完全成交测试类 Method signatures and docstrings: - def test_01(self, lever): 参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return: - def test_02(self, lever): 参数化测试不同杠杆倍数成交,先限价空单,后限价多单 <|skeleton|> class TestCase: """杠杆完全成交测试类""" def test_01(self, lever): ...
29f04fc05d4c1d8c950d726861b1884892cfbf58
<|skeleton|> class TestCase: """杠杆完全成交测试类""" def test_01(self, lever): """参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return:""" <|body_0|> def test_02(self, lever): """参数化测试不同杠杆倍数成交,先限价空单,后限价多单""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestCase: """杠杆完全成交测试类""" def test_01(self, lever): """参数化测试不同杠杆倍数成交,先限价多单,后限价空单 :return:""" logger.info('用例编号:111-1---参数化测试不同杠杆倍数,5,10,20,50,100,成交,先限价多单,后限价空单,完全成交,验证余额') deal_num = 100000000 stock_price_dict = market_info_get(user=self.buyer, session=self.session, sda_i...
the_stack_v2_python_sparse
case/SDA/test_111.py
xiaoxiangLiu/test
train
0
5bb00eab175218c14123f30ae3f02272492d26f3
[ "self.username = username\npassword = password.encode('utf8')\nself.password = md5(password).hexdigest()\nself.soft_id = soft_id\nself.base_params = {'user': self.username, 'pass2': self.password, 'softid': self.soft_id}\nself.headers = {'Accept-Encoding': 'gzip, deflate, sdch', 'Accept-Language': 'en-US,en;q=0.8',...
<|body_start_0|> self.username = username password = password.encode('utf8') self.password = md5(password).hexdigest() self.soft_id = soft_id self.base_params = {'user': self.username, 'pass2': self.password, 'softid': self.soft_id} self.headers = {'Accept-Encoding': 'gzi...
Chaojiying
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Chaojiying: def __init__(self, username, password, soft_id): """:param username: :param password: :param soft_id:""" <|body_0|> def PostPic(self, im, codetype): """:param im: 图片字节 :param codetype: 题目类型 参考 http://www.chaojiying.com/price.html :return:""" <|bod...
stack_v2_sparse_classes_75kplus_train_073941
7,494
no_license
[ { "docstring": ":param username: :param password: :param soft_id:", "name": "__init__", "signature": "def __init__(self, username, password, soft_id)" }, { "docstring": ":param im: 图片字节 :param codetype: 题目类型 参考 http://www.chaojiying.com/price.html :return:", "name": "PostPic", "signature...
3
stack_v2_sparse_classes_30k_train_051543
Implement the Python class `Chaojiying` described below. Class description: Implement the Chaojiying class. Method signatures and docstrings: - def __init__(self, username, password, soft_id): :param username: :param password: :param soft_id: - def PostPic(self, im, codetype): :param im: 图片字节 :param codetype: 题目类型 参考...
Implement the Python class `Chaojiying` described below. Class description: Implement the Chaojiying class. Method signatures and docstrings: - def __init__(self, username, password, soft_id): :param username: :param password: :param soft_id: - def PostPic(self, im, codetype): :param im: 图片字节 :param codetype: 题目类型 参考...
a9705ebc3a6f95160ad9571d48675bc59876bd32
<|skeleton|> class Chaojiying: def __init__(self, username, password, soft_id): """:param username: :param password: :param soft_id:""" <|body_0|> def PostPic(self, im, codetype): """:param im: 图片字节 :param codetype: 题目类型 参考 http://www.chaojiying.com/price.html :return:""" <|bod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Chaojiying: def __init__(self, username, password, soft_id): """:param username: :param password: :param soft_id:""" self.username = username password = password.encode('utf8') self.password = md5(password).hexdigest() self.soft_id = soft_id self.base_params = {...
the_stack_v2_python_sparse
codes/Module_4/lecture_23/lecture_23_1.py
Gedanke/Reptile_study_notes
train
5
71017a2fa5c59ca047137a97502d31ea6dfdb58a
[ "try:\n return self.request_debug(text)[0]\nexcept Exception:\n return '해당 문자열은 교정할 수 없습니다.'", "try:\n return self.request_debug(text)[1]\nexcept Exception:\n return '해당 문자열은 교정할 수 없습니다.'", "if len(text) > 500:\n raise Exception('500글자 이상 넘을 수 없음!')\nsess = Session()\ndata = sess.get(url='https:/...
<|body_start_0|> try: return self.request_debug(text)[0] except Exception: return '해당 문자열은 교정할 수 없습니다.' <|end_body_0|> <|body_start_1|> try: return self.request_debug(text)[1] except Exception: return '해당 문자열은 교정할 수 없습니다.' <|end_body_1|> ...
SpellCrawler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpellCrawler: def request(self, text: str) -> str: """맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열""" <|body_0|> def request_dict(self, text: str) -> str: """맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열"""...
stack_v2_sparse_classes_75kplus_train_073942
2,221
permissive
[ { "docstring": "맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열", "name": "request", "signature": "def request(self, text: str) -> str" }, { "docstring": "맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열", "name": "request_dict", "si...
3
stack_v2_sparse_classes_30k_train_011802
Implement the Python class `SpellCrawler` described below. Class description: Implement the SpellCrawler class. Method signatures and docstrings: - def request(self, text: str) -> str: 맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열 - def request_dict(self, text: str) -> str: 맞춤법을 교정합니다. (...
Implement the Python class `SpellCrawler` described below. Class description: Implement the SpellCrawler class. Method signatures and docstrings: - def request(self, text: str) -> str: 맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열 - def request_dict(self, text: str) -> str: 맞춤법을 교정합니다. (...
544857e4ac1c71b18f1e44f11f7ab41766e75de8
<|skeleton|> class SpellCrawler: def request(self, text: str) -> str: """맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열""" <|body_0|> def request_dict(self, text: str) -> str: """맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열"""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SpellCrawler: def request(self, text: str) -> str: """맞춤법을 교정합니다. (try-catch로 에러가 나지 않는 함수) :param text: 교정할 문자열 :return: 교정된 문자열""" try: return self.request_debug(text)[0] except Exception: return '해당 문자열은 교정할 수 없습니다.' def request_dict(self, text: str) -> ...
the_stack_v2_python_sparse
kocrawl/spell.py
vicjung/kocrawl
train
0
dd131b4529eceb1fb14c02010b498f83e901062d
[ "self.g = g\nself.visited = [False] * self.g.get_size()\nself.vertex_group = [0] * self.g.get_size()", "if self.visited[v]:\n return\nself.visited[v] = True\nself.vertex_group[v] = group\nfor vertex in self.g.adj(v):\n self.dfs(vertex, group)", "group = 0\nfor i in range(len(self.visited)):\n if not se...
<|body_start_0|> self.g = g self.visited = [False] * self.g.get_size() self.vertex_group = [0] * self.g.get_size() <|end_body_0|> <|body_start_1|> if self.visited[v]: return self.visited[v] = True self.vertex_group[v] = group for vertex in self.g.adj(...
class to compute connected components of given graph
ConnectedComponents
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConnectedComponents: """class to compute connected components of given graph""" def __init__(self, g: Graph): """init with a graph :param g: Graph""" <|body_0|> def dfs(self, v: int, group: int): """dfs to mark components from the same group Complexity O(E + V) :...
stack_v2_sparse_classes_75kplus_train_073943
1,418
no_license
[ { "docstring": "init with a graph :param g: Graph", "name": "__init__", "signature": "def __init__(self, g: Graph)" }, { "docstring": "dfs to mark components from the same group Complexity O(E + V) :param v: starting vertex :param group: current group number", "name": "dfs", "signature":...
4
stack_v2_sparse_classes_30k_train_003037
Implement the Python class `ConnectedComponents` described below. Class description: class to compute connected components of given graph Method signatures and docstrings: - def __init__(self, g: Graph): init with a graph :param g: Graph - def dfs(self, v: int, group: int): dfs to mark components from the same group ...
Implement the Python class `ConnectedComponents` described below. Class description: class to compute connected components of given graph Method signatures and docstrings: - def __init__(self, g: Graph): init with a graph :param g: Graph - def dfs(self, v: int, group: int): dfs to mark components from the same group ...
e24f1a422a998672d1e78ba6bc23dfa5836e3a51
<|skeleton|> class ConnectedComponents: """class to compute connected components of given graph""" def __init__(self, g: Graph): """init with a graph :param g: Graph""" <|body_0|> def dfs(self, v: int, group: int): """dfs to mark components from the same group Complexity O(E + V) :...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ConnectedComponents: """class to compute connected components of given graph""" def __init__(self, g: Graph): """init with a graph :param g: Graph""" self.g = g self.visited = [False] * self.g.get_size() self.vertex_group = [0] * self.g.get_size() def dfs(self, v: int...
the_stack_v2_python_sparse
graphs/connected_components.py
mkozel92/algos_py
train
1
7e28a29756acf4c729884eab258db8b5561035f6
[ "self.mIsOriented = oriented\nself.mVertexNumber = vertex_number\nself.mAdjacentMatrix = []\nfor i in range(self.mVertexNumber):\n self.mAdjacentMatrix.append([0] * self.mVertexNumber)", "assert 0 <= source < self.mVertexNumber and 0 <= destination < self.mVertexNumber\nself.mAdjacentMatrix[source][destination...
<|body_start_0|> self.mIsOriented = oriented self.mVertexNumber = vertex_number self.mAdjacentMatrix = [] for i in range(self.mVertexNumber): self.mAdjacentMatrix.append([0] * self.mVertexNumber) <|end_body_0|> <|body_start_1|> assert 0 <= source < self.mVertexNumber...
Graph
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Graph: def __init__(self, oriented=False, vertex_number=20): """Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі""" <|body_0|> def addEdge(self, source, destination, weight=1): """Додавання ребра з кінцями в точка...
stack_v2_sparse_classes_75kplus_train_073944
2,619
no_license
[ { "docstring": "Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі", "name": "__init__", "signature": "def __init__(self, oriented=False, vertex_number=20)" }, { "docstring": "Додавання ребра з кінцями в точках source та destination з вагою wei...
3
null
Implement the Python class `Graph` described below. Class description: Implement the Graph class. Method signatures and docstrings: - def __init__(self, oriented=False, vertex_number=20): Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі - def addEdge(self, source,...
Implement the Python class `Graph` described below. Class description: Implement the Graph class. Method signatures and docstrings: - def __init__(self, oriented=False, vertex_number=20): Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі - def addEdge(self, source,...
883c62f7846dde84204ea09a31fa1ce18ad2a98d
<|skeleton|> class Graph: def __init__(self, oriented=False, vertex_number=20): """Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі""" <|body_0|> def addEdge(self, source, destination, weight=1): """Додавання ребра з кінцями в точка...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Graph: def __init__(self, oriented=False, vertex_number=20): """Конструктор графа :param oriented: Чи орієнтований граф :param vertex_number: Кількість вершин у графі""" self.mIsOriented = oriented self.mVertexNumber = vertex_number self.mAdjacentMatrix = [] for i in ra...
the_stack_v2_python_sparse
source/T7_Graphs/P1_Definitions/L1_Graph.py
krenevych/algo
train
8
f306e44a195d1175628ba089569393ba03e39409
[ "length = len(nums)\nif length == 0:\n return False\nlastPos = length - 1\nfor i in range(lastPos, -1, -1):\n if nums[i] + i >= lastPos:\n lastPos = i\nreturn lastPos == 0", "maxs = 0\nfor i in range(len(nums) - 1):\n maxs = max(nums[i], maxs - 1)\n if maxs == 0:\n return False\nreturn T...
<|body_start_0|> length = len(nums) if length == 0: return False lastPos = length - 1 for i in range(lastPos, -1, -1): if nums[i] + i >= lastPos: lastPos = i return lastPos == 0 <|end_body_0|> <|body_start_1|> maxs = 0 for ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canJump1(self, nums): """:type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48%""" <|body_0|> def canJump2(self, nums): """:type nums: List[int] :rtype: bool 时间复杂度O(n):80ms beaten 95.70% 空间复杂度O(n): 13.2MB beaten ...
stack_v2_sparse_classes_75kplus_train_073945
1,989
permissive
[ { "docstring": ":type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48%", "name": "canJump1", "signature": "def canJump1(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: bool 时间复杂度O(n):80ms beaten 95.70% 空间复杂度O(n): 13.2MB beaten 46.28%", "...
2
stack_v2_sparse_classes_30k_train_040441
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump1(self, nums): :type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48% - def canJump2(self, nums): :type nums: List[int] :rtype...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canJump1(self, nums): :type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48% - def canJump2(self, nums): :type nums: List[int] :rtype...
a2e5256f27dbfb23fc34119fc857cd9b00e28c03
<|skeleton|> class Solution: def canJump1(self, nums): """:type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48%""" <|body_0|> def canJump2(self, nums): """:type nums: List[int] :rtype: bool 时间复杂度O(n):80ms beaten 95.70% 空间复杂度O(n): 13.2MB beaten ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def canJump1(self, nums): """:type nums: List[int] :rtype: bool 时间复杂度O(n):84ms beaten 99.33% 空间复杂度O(n): 13.2MB beaten 48.48%""" length = len(nums) if length == 0: return False lastPos = length - 1 for i in range(lastPos, -1, -1): if num...
the_stack_v2_python_sparse
toTheMoon/leetcode_055_JumpGame.py
jercas/offer66-leetcode-newcode
train
0
88093189541a18e7ef1948859f5b54aad13ca59a
[ "ax = super()._plot(ax, axis_1, axis_2, downsample)\nif axis_1 is self._beta_axis:\n for curve in self.curves:\n for kink in curve.find_kinks():\n ax.axvline(kink, ls=':', c='k')\nreturn ax", "fig, axs = plt.subplots(3, 2, figsize=(16, 16))\nself._plot(axs[0, 0], self._beta_axis, self._comple...
<|body_start_0|> ax = super()._plot(ax, axis_1, axis_2, downsample) if axis_1 is self._beta_axis: for curve in self.curves: for kink in curve.find_kinks(): ax.axvline(kink, ls=':', c='k') return ax <|end_body_0|> <|body_start_1|> fig, axs ...
A plotter for information bottleneck curves.
IBPlotter
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IBPlotter: """A plotter for information bottleneck curves.""" def _plot(self, ax, axis_1, axis_2, downsample): """Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every `downsample` points.""" <|body_0|> def plot...
stack_v2_sparse_classes_75kplus_train_073946
7,228
permissive
[ { "docstring": "Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every `downsample` points.", "name": "_plot", "signature": "def _plot(self, ax, axis_1, axis_2, downsample)" }, { "docstring": "Plot various views of the information bottle...
2
null
Implement the Python class `IBPlotter` described below. Class description: A plotter for information bottleneck curves. Method signatures and docstrings: - def _plot(self, ax, axis_1, axis_2, downsample): Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every...
Implement the Python class `IBPlotter` described below. Class description: A plotter for information bottleneck curves. Method signatures and docstrings: - def _plot(self, ax, axis_1, axis_2, downsample): Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every...
b13c5020a2b8524527a4a0db5a81d8549142228c
<|skeleton|> class IBPlotter: """A plotter for information bottleneck curves.""" def _plot(self, ax, axis_1, axis_2, downsample): """Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every `downsample` points.""" <|body_0|> def plot...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class IBPlotter: """A plotter for information bottleneck curves.""" def _plot(self, ax, axis_1, axis_2, downsample): """Plot various views of the information bottleneck curve. Parameters ---------- downsample : int Show markers every `downsample` points.""" ax = super()._plot(ax, axis_1, axis_2...
the_stack_v2_python_sparse
dit/rate_distortion/plotting.py
dit/dit
train
468
2ae18a43e56b56f94a11a3a4b7b81449f0b13c67
[ "super(StreamingUploadTask, self).__init__(source_resource, destination_resource, posix_to_set=posix_to_set, print_source_version=print_source_version, user_request_args=user_request_args, verbose=verbose)\nself._source_resource = source_resource\nself._destination_resource = destination_resource\nself._print_creat...
<|body_start_0|> super(StreamingUploadTask, self).__init__(source_resource, destination_resource, posix_to_set=posix_to_set, print_source_version=print_source_version, user_request_args=user_request_args, verbose=verbose) self._source_resource = source_resource self._destination_resource = desti...
Represents a command operation triggering a streaming upload.
StreamingUploadTask
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StreamingUploadTask: """Represents a command operation triggering a streaming upload.""" def __init__(self, source_resource, destination_resource, posix_to_set=None, print_created_message=False, print_source_version=False, user_request_args=None, verbose=False): """Initializes task. ...
stack_v2_sparse_classes_75kplus_train_073947
4,684
permissive
[ { "docstring": "Initializes task. Args: source_resource (FileObjectResource): Points to the stream or named pipe to read from. destination_resource (UnknownResource|ObjectResource): The full path of object to upload to. posix_to_set (PosixAttributes|None): Triggers setting POSIX on result of copy and avoids re-...
2
null
Implement the Python class `StreamingUploadTask` described below. Class description: Represents a command operation triggering a streaming upload. Method signatures and docstrings: - def __init__(self, source_resource, destination_resource, posix_to_set=None, print_created_message=False, print_source_version=False, u...
Implement the Python class `StreamingUploadTask` described below. Class description: Represents a command operation triggering a streaming upload. Method signatures and docstrings: - def __init__(self, source_resource, destination_resource, posix_to_set=None, print_created_message=False, print_source_version=False, u...
392abf004b16203030e6efd2f0af24db7c8d669e
<|skeleton|> class StreamingUploadTask: """Represents a command operation triggering a streaming upload.""" def __init__(self, source_resource, destination_resource, posix_to_set=None, print_created_message=False, print_source_version=False, user_request_args=None, verbose=False): """Initializes task. ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class StreamingUploadTask: """Represents a command operation triggering a streaming upload.""" def __init__(self, source_resource, destination_resource, posix_to_set=None, print_created_message=False, print_source_version=False, user_request_args=None, verbose=False): """Initializes task. Args: source_...
the_stack_v2_python_sparse
lib/googlecloudsdk/command_lib/storage/tasks/cp/streaming_upload_task.py
google-cloud-sdk-unofficial/google-cloud-sdk
train
9
c81e2619c369e63c77674adda82d80fe0c826c6b
[ "queryset = Sight.objects.filter(is_valid=True, is_top=True)\ntry:\n paginator = Paginator(queryset, 20)\n current_page = 1\n page_data = paginator.page(current_page)\n objects = SightSerializer(page_data, many=True).data\n key = 'index_top'\n resp = {'code': 0, 'meta': {'current_page': current_pa...
<|body_start_0|> queryset = Sight.objects.filter(is_valid=True, is_top=True) try: paginator = Paginator(queryset, 20) current_page = 1 page_data = paginator.page(current_page) objects = SightSerializer(page_data, many=True).data key = 'index_to...
SightAdmin
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SightAdmin: def cache_top_sight(self): """缓存精选景点""" <|body_0|> def cache_hot_sight(self): """缓存热门景点""" <|body_1|> def save_form(self, request, form, change): """新增/修改时缓存数据 :param request: :param form: 表单 :param change: 表单是否发送改变 :return:""" ...
stack_v2_sparse_classes_75kplus_train_073948
4,741
no_license
[ { "docstring": "缓存精选景点", "name": "cache_top_sight", "signature": "def cache_top_sight(self)" }, { "docstring": "缓存热门景点", "name": "cache_hot_sight", "signature": "def cache_hot_sight(self)" }, { "docstring": "新增/修改时缓存数据 :param request: :param form: 表单 :param change: 表单是否发送改变 :retu...
4
null
Implement the Python class `SightAdmin` described below. Class description: Implement the SightAdmin class. Method signatures and docstrings: - def cache_top_sight(self): 缓存精选景点 - def cache_hot_sight(self): 缓存热门景点 - def save_form(self, request, form, change): 新增/修改时缓存数据 :param request: :param form: 表单 :param change: ...
Implement the Python class `SightAdmin` described below. Class description: Implement the SightAdmin class. Method signatures and docstrings: - def cache_top_sight(self): 缓存精选景点 - def cache_hot_sight(self): 缓存热门景点 - def save_form(self, request, form, change): 新增/修改时缓存数据 :param request: :param form: 表单 :param change: ...
14c94075094e1657b90b0bb3f94544d008255f45
<|skeleton|> class SightAdmin: def cache_top_sight(self): """缓存精选景点""" <|body_0|> def cache_hot_sight(self): """缓存热门景点""" <|body_1|> def save_form(self, request, form, change): """新增/修改时缓存数据 :param request: :param form: 表单 :param change: 表单是否发送改变 :return:""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SightAdmin: def cache_top_sight(self): """缓存精选景点""" queryset = Sight.objects.filter(is_valid=True, is_top=True) try: paginator = Paginator(queryset, 20) current_page = 1 page_data = paginator.page(current_page) objects = SightSerializer(p...
the_stack_v2_python_sparse
sight/admin.py
Tsurol/trip-server
train
1
653843e1c52b4884dc2e272b3f72b2f87dfd8189
[ "context = context or {}\nres = {}.fromkeys(ids)\nfor wol_brw in self.browse(cr, uid, ids, context=context):\n wol_state = wol_brw.state\n wo_states = list(set([wo_brw.state for wo_brw in wol_brw.wo_ids]))\n if wol_state in ['draft', 'picking', 'ready', 'done', 'cancel']:\n res[wol_brw.id] = wol_sta...
<|body_start_0|> context = context or {} res = {}.fromkeys(ids) for wol_brw in self.browse(cr, uid, ids, context=context): wol_state = wol_brw.state wo_states = list(set([wo_brw.state for wo_brw in wol_brw.wo_ids])) if wol_state in ['draft', 'picking', 'ready'...
MrpWorkorderLot
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MrpWorkorderLot: def _get_lot_state(self, cr, uid, ids, field_name, arg, context=None): """This method update the work order lot state taking into account the state of the work orders associated. This is the logic: - work orders 'done' -> work order lot change to 'done' (finished). - one...
stack_v2_sparse_classes_75kplus_train_073949
40,020
no_license
[ { "docstring": "This method update the work order lot state taking into account the state of the work orders associated. This is the logic: - work orders 'done' -> work order lot change to 'done' (finished). - one work order in 'pause' -> work order lot change to 'pending'. - one work order in 'cancel' -> work ...
3
null
Implement the Python class `MrpWorkorderLot` described below. Class description: Implement the MrpWorkorderLot class. Method signatures and docstrings: - def _get_lot_state(self, cr, uid, ids, field_name, arg, context=None): This method update the work order lot state taking into account the state of the work orders ...
Implement the Python class `MrpWorkorderLot` described below. Class description: Implement the MrpWorkorderLot class. Method signatures and docstrings: - def _get_lot_state(self, cr, uid, ids, field_name, arg, context=None): This method update the work order lot state taking into account the state of the work orders ...
9c588e45011a87ec8d9af73535c4c56485be92f7
<|skeleton|> class MrpWorkorderLot: def _get_lot_state(self, cr, uid, ids, field_name, arg, context=None): """This method update the work order lot state taking into account the state of the work orders associated. This is the logic: - work orders 'done' -> work order lot change to 'done' (finished). - one...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MrpWorkorderLot: def _get_lot_state(self, cr, uid, ids, field_name, arg, context=None): """This method update the work order lot state taking into account the state of the work orders associated. This is the logic: - work orders 'done' -> work order lot change to 'done' (finished). - one work order in...
the_stack_v2_python_sparse
addons-vauxoo/mrp_workorder_lot/model/mrp_workorder_lot.py
OpenBusinessSolutions/odoo-fondeur-server
train
1
4567bb76acf32b3c651b8d31827d1d6f0ad3d3ab
[ "serializer = serializers.CheckProviderSerializer(data=request.data)\nserializer.is_valid(raise_exception=True)\nsecured = serializer.data['secured']\naddress = serializer.data['address']\nport = serializer.data['port']\ntry:\n if secured:\n imaplib.IMAP4_SSL(address, port)\n else:\n imaplib.IMA...
<|body_start_0|> serializer = serializers.CheckProviderSerializer(data=request.data) serializer.is_valid(raise_exception=True) secured = serializer.data['secured'] address = serializer.data['address'] port = serializer.data['port'] try: if secured: ...
ViewSet class for EmailProvider.
EmailProviderViewSet
[ "ISC" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailProviderViewSet: """ViewSet class for EmailProvider.""" def check_connection(self, request, **kwargs): """check that provided information allow connection to imap server.""" <|body_0|> def check_associated_domain(self, request, **kwargs): """check that the a...
stack_v2_sparse_classes_75kplus_train_073950
2,688
permissive
[ { "docstring": "check that provided information allow connection to imap server.", "name": "check_connection", "signature": "def check_connection(self, request, **kwargs)" }, { "docstring": "check that the associated domain is either the same as the provider, or if a local domain already exists....
2
stack_v2_sparse_classes_30k_train_020885
Implement the Python class `EmailProviderViewSet` described below. Class description: ViewSet class for EmailProvider. Method signatures and docstrings: - def check_connection(self, request, **kwargs): check that provided information allow connection to imap server. - def check_associated_domain(self, request, **kwar...
Implement the Python class `EmailProviderViewSet` described below. Class description: ViewSet class for EmailProvider. Method signatures and docstrings: - def check_connection(self, request, **kwargs): check that provided information allow connection to imap server. - def check_associated_domain(self, request, **kwar...
df699aab0799ec1725b6b89be38e56285821c889
<|skeleton|> class EmailProviderViewSet: """ViewSet class for EmailProvider.""" def check_connection(self, request, **kwargs): """check that provided information allow connection to imap server.""" <|body_0|> def check_associated_domain(self, request, **kwargs): """check that the a...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EmailProviderViewSet: """ViewSet class for EmailProvider.""" def check_connection(self, request, **kwargs): """check that provided information allow connection to imap server.""" serializer = serializers.CheckProviderSerializer(data=request.data) serializer.is_valid(raise_exceptio...
the_stack_v2_python_sparse
modoboa/imap_migration/api/v2/viewsets.py
modoboa/modoboa
train
2,201
2f8b3c285eb27e30cdbaf9f62d22c873af84a012
[ "if hyperparameter_config is None:\n hyperparameter_config = configs.encoder_decoder()\nsuper().__init__(name, parent=None, hyperparameter_config=hyperparameter_config, spatial_scale=spatial_scale)\nself.setup_children()\npass", "with tf.variable_scope(self.name.replace(' ', '_')):\n for blockset in self.ch...
<|body_start_0|> if hyperparameter_config is None: hyperparameter_config = configs.encoder_decoder() super().__init__(name, parent=None, hyperparameter_config=hyperparameter_config, spatial_scale=spatial_scale) self.setup_children() pass <|end_body_0|> <|body_start_1|> ...
Controls the creation of an encoder-decoder network (u-net). TODO Attributes:
EncoderDecoderGene
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EncoderDecoderGene: """Controls the creation of an encoder-decoder network (u-net). TODO Attributes:""" def __init__(self, name: str, hyperparameter_config: Optional[mt.HyperparameterConfig]=None, spatial_scale: int=0): """Constructor. Args: name (str): This gene's name. hyperparamet...
stack_v2_sparse_classes_75kplus_train_073951
3,787
no_license
[ { "docstring": "Constructor. Args: name (str): This gene's name. hyperparameter_config (Optional[mt.HyperparameterConfig]): The HyperparameterConfig governing this Gene's hyperparameters. If none is supplied, use genenet.hyperparameter_config.encoder_decoder(). spatial_scale (int): The spatial scale of the data...
4
stack_v2_sparse_classes_30k_train_024881
Implement the Python class `EncoderDecoderGene` described below. Class description: Controls the creation of an encoder-decoder network (u-net). TODO Attributes: Method signatures and docstrings: - def __init__(self, name: str, hyperparameter_config: Optional[mt.HyperparameterConfig]=None, spatial_scale: int=0): Cons...
Implement the Python class `EncoderDecoderGene` described below. Class description: Controls the creation of an encoder-decoder network (u-net). TODO Attributes: Method signatures and docstrings: - def __init__(self, name: str, hyperparameter_config: Optional[mt.HyperparameterConfig]=None, spatial_scale: int=0): Cons...
6b78dc5e1e793a206ae3f4860d3a9ac887e663e5
<|skeleton|> class EncoderDecoderGene: """Controls the creation of an encoder-decoder network (u-net). TODO Attributes:""" def __init__(self, name: str, hyperparameter_config: Optional[mt.HyperparameterConfig]=None, spatial_scale: int=0): """Constructor. Args: name (str): This gene's name. hyperparamet...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EncoderDecoderGene: """Controls the creation of an encoder-decoder network (u-net). TODO Attributes:""" def __init__(self, name: str, hyperparameter_config: Optional[mt.HyperparameterConfig]=None, spatial_scale: int=0): """Constructor. Args: name (str): This gene's name. hyperparameter_config (Op...
the_stack_v2_python_sparse
example3/src/_private/genenet/genes/EncoderDecoderGene.py
leapmanlab/examples
train
1
6f57edb78cd065201968fd77094b217a2098e073
[ "length = len(s)\nif length == 0:\n return 0\nwinner, i, j = (0, 0, 0)\ndictA = {}\nwhile (i < length) & (j < length):\n if s[j] not in dictA:\n dictA[s[j]] = j\n j += 1\n winner = max(winner, j - i)\n else:\n i = max(i, dictA[s[j]] + 1)\n dictA[s[j]] = j\n j += 1\...
<|body_start_0|> length = len(s) if length == 0: return 0 winner, i, j = (0, 0, 0) dictA = {} while (i < length) & (j < length): if s[j] not in dictA: dictA[s[j]] = j j += 1 winner = max(winner, j - i) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring_best(self, s): """:type s: str :rtype: int""" <|body_1|> def lengthOfLongestSubstring_sliding_opt(self, s): """:type s: str :r...
stack_v2_sparse_classes_75kplus_train_073952
4,334
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring", "signature": "def lengthOfLongestSubstring(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "lengthOfLongestSubstring_best", "signature": "def lengthOfLongestSubstring_best(self, s)" }, { ...
6
stack_v2_sparse_classes_30k_train_040988
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring_best(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring_sliding_opt(...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lengthOfLongestSubstring(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring_best(self, s): :type s: str :rtype: int - def lengthOfLongestSubstring_sliding_opt(...
f0d9070fa292ca36971a465a805faddb12025482
<|skeleton|> class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" <|body_0|> def lengthOfLongestSubstring_best(self, s): """:type s: str :rtype: int""" <|body_1|> def lengthOfLongestSubstring_sliding_opt(self, s): """:type s: str :r...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def lengthOfLongestSubstring(self, s): """:type s: str :rtype: int""" length = len(s) if length == 0: return 0 winner, i, j = (0, 0, 0) dictA = {} while (i < length) & (j < length): if s[j] not in dictA: dictA[s[...
the_stack_v2_python_sparse
3.lengthOfLongestSubstring.py
JerryRoc/leetcode
train
0
d71dc2f1a3351639ea8c3e0b6aa5060781363e2d
[ "parser = MagicCommandParser(description='changes matplotlib style', prog='mpl_style')\nparser.add_argument('style', type=str, help='style, ggplot for exemple', default='ggplot')\nreturn parser", "parser = self.get_parser(MagicGraph.mpl_style_parser, 'mpl_style')\nargs = self.get_args(line, parser)\nif args is no...
<|body_start_0|> parser = MagicCommandParser(description='changes matplotlib style', prog='mpl_style') parser.add_argument('style', type=str, help='style, ggplot for exemple', default='ggplot') return parser <|end_body_0|> <|body_start_1|> parser = self.get_parser(MagicGraph.mpl_style_p...
Defines magic commands about graphs .. versionadded:: 1.1
MagicGraph
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MagicGraph: """Defines magic commands about graphs .. versionadded:: 1.1""" def mpl_style_parser(): """defines the way to parse the magic command ``%mpl_style``""" <|body_0|> def mpl_style(self, line): """defines ``%mpl_style`` which changes the style of matplotl...
stack_v2_sparse_classes_75kplus_train_073953
1,955
permissive
[ { "docstring": "defines the way to parse the magic command ``%mpl_style``", "name": "mpl_style_parser", "signature": "def mpl_style_parser()" }, { "docstring": "defines ``%mpl_style`` which changes the style of matplotlib graphs, example: ``%mpl_style ggplot`` .. nbref:: :title: mpl_style This m...
2
stack_v2_sparse_classes_30k_train_042917
Implement the Python class `MagicGraph` described below. Class description: Defines magic commands about graphs .. versionadded:: 1.1 Method signatures and docstrings: - def mpl_style_parser(): defines the way to parse the magic command ``%mpl_style`` - def mpl_style(self, line): defines ``%mpl_style`` which changes ...
Implement the Python class `MagicGraph` described below. Class description: Defines magic commands about graphs .. versionadded:: 1.1 Method signatures and docstrings: - def mpl_style_parser(): defines the way to parse the magic command ``%mpl_style`` - def mpl_style(self, line): defines ``%mpl_style`` which changes ...
33af98adb093f525df7fac7c86613fa7cd181b44
<|skeleton|> class MagicGraph: """Defines magic commands about graphs .. versionadded:: 1.1""" def mpl_style_parser(): """defines the way to parse the magic command ``%mpl_style``""" <|body_0|> def mpl_style(self, line): """defines ``%mpl_style`` which changes the style of matplotl...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MagicGraph: """Defines magic commands about graphs .. versionadded:: 1.1""" def mpl_style_parser(): """defines the way to parse the magic command ``%mpl_style``""" parser = MagicCommandParser(description='changes matplotlib style', prog='mpl_style') parser.add_argument('style', ty...
the_stack_v2_python_sparse
src/pyensae/graphhelper/magic_graph.py
sdpython/pyensae
train
33
3059b31dd974dc14359e9269174e24bb30a080fd
[ "region = context.region\nrv3d = context.region_data\nco2d = (event.mouse_region_x, event.mouse_region_y)\nview_vector_mouse = region_2d_to_vector_3d(region, rv3d, co2d)\nray_origin_mouse = region_2d_to_origin_3d(region, rv3d, co2d)\npt = intersect_line_plane(ray_origin_mouse, ray_origin_mouse + view_vector_mouse, ...
<|body_start_0|> region = context.region rv3d = context.region_data co2d = (event.mouse_region_x, event.mouse_region_y) view_vector_mouse = region_2d_to_vector_3d(region, rv3d, co2d) ray_origin_mouse = region_2d_to_origin_3d(region, rv3d, co2d) pt = intersect_line_plane(r...
Draw tools
ArchipackDrawTool
[ "Unlicense", "GPL-3.0-only", "Font-exception-2.0", "GPL-3.0-or-later", "Apache-2.0", "LicenseRef-scancode-public-domain", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-public-domain-disclaimer", "Bitstream-Vera", "LicenseRef-scancode-blender-2010", "LGPL-2.1-or-later", ...
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArchipackDrawTool: """Draw tools""" def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1))): """convert mouse pos to 3d point over plane defined by origin and normal""" <|body_0|> def mouse_to_scene_raycast(self, context, event): ...
stack_v2_sparse_classes_75kplus_train_073954
9,808
permissive
[ { "docstring": "convert mouse pos to 3d point over plane defined by origin and normal", "name": "mouse_to_plane", "signature": "def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1)))" }, { "docstring": "convert mouse pos to 3d point over plane defined by ori...
3
stack_v2_sparse_classes_30k_train_020932
Implement the Python class `ArchipackDrawTool` described below. Class description: Draw tools Method signatures and docstrings: - def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1))): convert mouse pos to 3d point over plane defined by origin and normal - def mouse_to_scene_ray...
Implement the Python class `ArchipackDrawTool` described below. Class description: Draw tools Method signatures and docstrings: - def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1))): convert mouse pos to 3d point over plane defined by origin and normal - def mouse_to_scene_ray...
f7d23a489c2b4bcc3c1961ac955926484ff8b8d9
<|skeleton|> class ArchipackDrawTool: """Draw tools""" def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1))): """convert mouse pos to 3d point over plane defined by origin and normal""" <|body_0|> def mouse_to_scene_raycast(self, context, event): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ArchipackDrawTool: """Draw tools""" def mouse_to_plane(self, context, event, origin=Vector((0, 0, 0)), normal=Vector((0, 0, 1))): """convert mouse pos to 3d point over plane defined by origin and normal""" region = context.region rv3d = context.region_data co2d = (event.mo...
the_stack_v2_python_sparse
engine/2.80/scripts/addons/archipack/archipack_object.py
byteinc/Phasor
train
3
343c759d70f1c9c727773ebb2c71416c03e7b198
[ "p_col = field.get_col(self.lhs.alias)\nif value is None:\n lookup_type, value = ('isnull', True)\nelse:\n lookup_type, value = ('exact', value)\nlookup = field.get_lookup(lookup_type)(p_col, value)\nreturn lookup.as_sql(compiler, connection)", "if self.rhs_is_direct_value():\n sql_list, params_list = ([...
<|body_start_0|> p_col = field.get_col(self.lhs.alias) if value is None: lookup_type, value = ('isnull', True) else: lookup_type, value = ('exact', value) lookup = field.get_lookup(lookup_type)(p_col, value) return lookup.as_sql(compiler, connection) <|end...
Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup.
CompositeExact
[ "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CompositeExact: """Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup.""" def _partfield_as_sql(self, field, value, compiler, connection): """...
stack_v2_sparse_classes_75kplus_train_073955
17,987
permissive
[ { "docstring": "Return exact-match lookup `as_sql` result for the given field and value. Lookup is converted to `isnull` if value is None.", "name": "_partfield_as_sql", "signature": "def _partfield_as_sql(self, field, value, compiler, connection)" }, { "docstring": "Return an SQL tuple: sql, pa...
2
stack_v2_sparse_classes_30k_train_032541
Implement the Python class `CompositeExact` described below. Class description: Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup. Method signatures and docstrings: - def _par...
Implement the Python class `CompositeExact` described below. Class description: Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup. Method signatures and docstrings: - def _par...
9189a6cc64305a6ead4b95ca0b56d7b7ae6c87d5
<|skeleton|> class CompositeExact: """Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup.""" def _partfield_as_sql(self, field, value, compiler, connection): """...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CompositeExact: """Exact match Lookup for VirtualCompField. Tries to break the provided lookup value into its constituent parts and create a multi-part, ANDed together WHERE statement for a nice efficient lookup.""" def _partfield_as_sql(self, field, value, compiler, connection): """Return exact-...
the_stack_v2_python_sparse
django/sierra/base/fields.py
unt-libraries/catalog-api
train
20
fd47fbcb6f96bb2e6802a7c970908086b90a8a4e
[ "dt_str = request.GET.get(get_dict_key)\ndt_parsed = None\nif dt_str:\n dt_parsed = parse_to_dt(dt_str, tzinfo_=get_current_timezone())\n if not dt_parsed:\n msg_parse_failed = msg_parse_failed or _('Failed to parse the timestamp. ({})')\n messages.warning(request, msg_parse_failed.format(dt_str...
<|body_start_0|> dt_str = request.GET.get(get_dict_key) dt_parsed = None if dt_str: dt_parsed = parse_to_dt(dt_str, tzinfo_=get_current_timezone()) if not dt_parsed: msg_parse_failed = msg_parse_failed or _('Failed to parse the timestamp. ({})') ...
View to see the channel message stats.
ChannelMessageStatsView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ChannelMessageStatsView: """View to see the channel message stats.""" def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: """Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param...
stack_v2_sparse_classes_75kplus_train_073956
9,531
permissive
[ { "docstring": "Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param request: web request to get URL param :param get_dict_key: key of the param :param msg_parse_failed: message to be displayed if failed to parse :param msg_out_of_range: message to be disp...
2
stack_v2_sparse_classes_30k_val_000041
Implement the Python class `ChannelMessageStatsView` described below. Class description: View to see the channel message stats. Method signatures and docstrings: - def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: Get the timestamp string in URL GET params of key `...
Implement the Python class `ChannelMessageStatsView` described below. Class description: View to see the channel message stats. Method signatures and docstrings: - def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: Get the timestamp string in URL GET params of key `...
c7da1e91783dce3a2b71b955b3a22b68db9056cf
<|skeleton|> class ChannelMessageStatsView: """View to see the channel message stats.""" def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: """Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ChannelMessageStatsView: """View to see the channel message stats.""" def get_timestamp(request, get_dict_key, *, msg_parse_failed=None, msg_out_of_range=None) -> datetime: """Get the timestamp string in URL GET params of key ``get_dict_key`` and parse it to :class:`datetime`. :param request: web...
the_stack_v2_python_sparse
JellyBot/views/info/msgstats.py
RxJellyBot/Jelly-Bot
train
5
1f2f12a6c4af25245f5ec8e4a99d63ce23e75a40
[ "try:\n super().__post_init__()\nexcept AttributeError:\n pass", "try:\n return item in self.contents\nexcept TypeError:\n return item == self.contents", "try:\n return object.__getattribute__(object.__getattribute__(self, 'contents'), attribute)\nexcept AttributeError:\n raise AttributeError(...
<|body_start_0|> try: super().__post_init__() except AttributeError: pass <|end_body_0|> <|body_start_1|> try: return item in self.contents except TypeError: return item == self.contents <|end_body_1|> <|body_start_2|> try: ...
Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check gets a TypeError, the method then checks if the item is equivalent to 'cont...
Proxy
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Proxy: """Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check gets a TypeError, the method then checks i...
stack_v2_sparse_classes_75kplus_train_073957
36,318
permissive
[ { "docstring": "Initializes class instance. Although this method ordinarily does nothing, it makes the order of the inherited classes less important with multiple inheritance, such as when adding amicus quirks.", "name": "__post_init__", "signature": "def __post_init__(self) -> None" }, { "docst...
5
stack_v2_sparse_classes_30k_train_050351
Implement the Python class `Proxy` described below. Class description: Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check get...
Implement the Python class `Proxy` described below. Class description: Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check get...
0de6d90c34b8402f4464dcba784349514b3b8e42
<|skeleton|> class Proxy: """Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check gets a TypeError, the method then checks i...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Proxy: """Basic wrapper class. A Proxy differs than an ordinary container in 2 significant ways: 1) When an 'in' call is made, the '__contains__' method first looks to see if the item is stored in 'contents' (if 'contents' is a collection). If that check gets a TypeError, the method then checks if the item is...
the_stack_v2_python_sparse
amicus/core/base.py
WithPrecedent/amicus
train
1
812697aa157f025b26d1fce46c5c905e33c886e3
[ "super(Data, self).__init__(xmi_dir, tokenizer, max_input_length, max_output_length, n_files)\nself.partition = partition\nself.extract_events_and_times()", "caption = 'event/time %s data' % self.partition\nfor xmi_path in tqdm(self.xmi_paths, desc=caption):\n xmi_file_name = xmi_path.split('/')[-1]\n id = ...
<|body_start_0|> super(Data, self).__init__(xmi_dir, tokenizer, max_input_length, max_output_length, n_files) self.partition = partition self.extract_events_and_times() <|end_body_0|> <|body_start_1|> caption = 'event/time %s data' % self.partition for xmi_path in tqdm(self.xmi_...
Thyme data
Data
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Data: """Thyme data""" def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all'): """Thyme data""" <|body_0|> def extract_events_and_times(self): """Extract events and times""" <|body_1|> <|end_skeleton|> <|bo...
stack_v2_sparse_classes_75kplus_train_073958
3,084
no_license
[ { "docstring": "Thyme data", "name": "__init__", "signature": "def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all')" }, { "docstring": "Extract events and times", "name": "extract_events_and_times", "signature": "def extract_events_and_tim...
2
stack_v2_sparse_classes_30k_train_038038
Implement the Python class `Data` described below. Class description: Thyme data Method signatures and docstrings: - def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all'): Thyme data - def extract_events_and_times(self): Extract events and times
Implement the Python class `Data` described below. Class description: Thyme data Method signatures and docstrings: - def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all'): Thyme data - def extract_events_and_times(self): Extract events and times <|skeleton|> class Data...
7d44509621dcbd394d503301859002f8da132b5b
<|skeleton|> class Data: """Thyme data""" def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all'): """Thyme data""" <|body_0|> def extract_events_and_times(self): """Extract events and times""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Data: """Thyme data""" def __init__(self, xmi_dir, tokenizer, max_input_length, max_output_length, partition, n_files='all'): """Thyme data""" super(Data, self).__init__(xmi_dir, tokenizer, max_input_length, max_output_length, n_files) self.partition = partition self.extra...
the_stack_v2_python_sparse
Archive/T5/dataset_events.py
dmitriydligach/Thyme
train
0
90f7dfde5c13892a866ce7ee74860b3094d7a1a3
[ "self.signed_data = signed_data\nself.audit_log_reference = audit_log_reference\nself.signing_format = signing_format\nself.error = error\nself.sign_certificate_base_64_string = sign_certificate_base_64_string\nself.transaction_id = transaction_id\nself.additional_properties = additional_properties", "if dictiona...
<|body_start_0|> self.signed_data = signed_data self.audit_log_reference = audit_log_reference self.signing_format = signing_format self.error = error self.sign_certificate_base_64_string = sign_certificate_base_64_string self.transaction_id = transaction_id self....
Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing format error (MerchantError): Error message sign_certificate_base_64_string (s...
SignResponse
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SignResponse: """Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing format error (MerchantError): Error me...
stack_v2_sparse_classes_75kplus_train_073959
3,537
permissive
[ { "docstring": "Constructor for the SignResponse class", "name": "__init__", "signature": "def __init__(self, signed_data=None, audit_log_reference=None, signing_format=None, error=None, sign_certificate_base_64_string=None, transaction_id=None, additional_properties={})" }, { "docstring": "Crea...
2
stack_v2_sparse_classes_30k_train_006632
Implement the Python class `SignResponse` described below. Class description: Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing...
Implement the Python class `SignResponse` described below. Class description: Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing...
fa3918a6c54ea0eedb9146578645b7eb1755b642
<|skeleton|> class SignResponse: """Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing format error (MerchantError): Error me...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SignResponse: """Implementation of the 'SignResponse' model. TODO: type model description here. Attributes: signed_data (string): base 64 encoded signed data audit_log_reference (uuid|string): Reference Id to audit log signing_format (SigningFormat): Signing format error (MerchantError): Error message sign_ce...
the_stack_v2_python_sparse
idfy_rest_client/models/sign_response.py
dealflowteam/Idfy
train
0
74f1111f9ecdaf80c30922405f488a499f7bda05
[ "super(Net, self).__init__()\nself.input_dim = input_dim\nself.hidden_size = hidden_size\nself.output_dim = output_dim\nself.num_layers = num_layers\nself.layer_type = layer_type\nself.output_activation = output_activation\nself.internal_batch_norm = internal_batch_norm\nself.skip_connection = skip_connection\nself...
<|body_start_0|> super(Net, self).__init__() self.input_dim = input_dim self.hidden_size = hidden_size self.output_dim = output_dim self.num_layers = num_layers self.layer_type = layer_type self.output_activation = output_activation self.internal_batch_nor...
RealNVP neural network definitions.
Net
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Net: """RealNVP neural network definitions.""" def __init__(self, input_dim: int, hidden_size: int, output_dim: int=None, num_layers: int=3, layer_type: Literal['s', 't']='s', output_activation: Literal['tanh', 'lrelu']='tanh', internal_batch_norm: bool=False, skip_connection: bool=False) ->...
stack_v2_sparse_classes_75kplus_train_073960
8,028
permissive
[ { "docstring": "RealNVP neural network definition. :param input_dim: Data input dimension. :param hidden_size: Neural network hidden size. :param output_dim: Output dimension. :param num_layers: Number of linear layers. :param layer_type: \"s\" vs \"t\" type layer. :param output_activation: \"s\" network output...
2
stack_v2_sparse_classes_30k_train_012689
Implement the Python class `Net` described below. Class description: RealNVP neural network definitions. Method signatures and docstrings: - def __init__(self, input_dim: int, hidden_size: int, output_dim: int=None, num_layers: int=3, layer_type: Literal['s', 't']='s', output_activation: Literal['tanh', 'lrelu']='tan...
Implement the Python class `Net` described below. Class description: RealNVP neural network definitions. Method signatures and docstrings: - def __init__(self, input_dim: int, hidden_size: int, output_dim: int=None, num_layers: int=3, layer_type: Literal['s', 't']='s', output_activation: Literal['tanh', 'lrelu']='tan...
f470849d5b7b90dc5a65bab8a536de1d57c1021a
<|skeleton|> class Net: """RealNVP neural network definitions.""" def __init__(self, input_dim: int, hidden_size: int, output_dim: int=None, num_layers: int=3, layer_type: Literal['s', 't']='s', output_activation: Literal['tanh', 'lrelu']='tanh', internal_batch_norm: bool=False, skip_connection: bool=False) ->...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Net: """RealNVP neural network definitions.""" def __init__(self, input_dim: int, hidden_size: int, output_dim: int=None, num_layers: int=3, layer_type: Literal['s', 't']='s', output_activation: Literal['tanh', 'lrelu']='tanh', internal_batch_norm: bool=False, skip_connection: bool=False) -> None: ...
the_stack_v2_python_sparse
conformation/model.py
ks8/conformation
train
1
fb4049d8db8793c5d605768946086fd310732a59
[ "adjacencies_list = []\nexpectedadj_list = [{1: (1, 0), 2: (0, 1), 5: (1, 1)}, {1: [(1, 0), (2, 0)], 2: [(0, 1), (0, 2)], 5: [(1, 1), (2, 2)]}, {5: [(1, 1), (2, 2)]}, {1: [(1, 0), (2, 0)], 2: [(0, 1), (0, 2)]}, {5: (1, 2), 6: (2, 1)}]\npiece_letters = ['K', 'Q', 'B', 'R', 'N']\nmatrix = [[0] * 3 for _ in itertools....
<|body_start_0|> adjacencies_list = [] expectedadj_list = [{1: (1, 0), 2: (0, 1), 5: (1, 1)}, {1: [(1, 0), (2, 0)], 2: [(0, 1), (0, 2)], 5: [(1, 1), (2, 2)]}, {5: [(1, 1), (2, 2)]}, {1: [(1, 0), (2, 0)], 2: [(0, 1), (0, 2)]}, {5: (1, 2), 6: (2, 1)}] piece_letters = ['K', 'Q', 'B', 'R', 'N'] ...
Class of chess main application - pieces module testing
PiecesApplicationTest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PiecesApplicationTest: """Class of chess main application - pieces module testing""" def test_list_adjacencies(self): """Tests adjacencies listing""" <|body_0|> def test_adjacencies(self): """Tests adjacencies checking""" <|body_1|> def test_check_ad...
stack_v2_sparse_classes_75kplus_train_073961
6,418
permissive
[ { "docstring": "Tests adjacencies listing", "name": "test_list_adjacencies", "signature": "def test_list_adjacencies(self)" }, { "docstring": "Tests adjacencies checking", "name": "test_adjacencies", "signature": "def test_adjacencies(self)" }, { "docstring": "Tests check_adj bet...
3
stack_v2_sparse_classes_30k_train_018465
Implement the Python class `PiecesApplicationTest` described below. Class description: Class of chess main application - pieces module testing Method signatures and docstrings: - def test_list_adjacencies(self): Tests adjacencies listing - def test_adjacencies(self): Tests adjacencies checking - def test_check_adj(se...
Implement the Python class `PiecesApplicationTest` described below. Class description: Class of chess main application - pieces module testing Method signatures and docstrings: - def test_list_adjacencies(self): Tests adjacencies listing - def test_adjacencies(self): Tests adjacencies checking - def test_check_adj(se...
7470479e352bf6fa28215e745af8c42dc20d7a1f
<|skeleton|> class PiecesApplicationTest: """Class of chess main application - pieces module testing""" def test_list_adjacencies(self): """Tests adjacencies listing""" <|body_0|> def test_adjacencies(self): """Tests adjacencies checking""" <|body_1|> def test_check_ad...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PiecesApplicationTest: """Class of chess main application - pieces module testing""" def test_list_adjacencies(self): """Tests adjacencies listing""" adjacencies_list = [] expectedadj_list = [{1: (1, 0), 2: (0, 1), 5: (1, 1)}, {1: [(1, 0), (2, 0)], 2: [(0, 1), (0, 2)], 5: [(1, 1),...
the_stack_v2_python_sparse
challenges/chess/tests.py
williamlagos/python-coding
train
0
4f0181ec3b5332c3b2f8a7e49a65d1758685124b
[ "user_course_outline = user_course_outline_details.outline\nschedule = user_course_outline_details.schedule\nexam_information = user_course_outline_details.special_exam_attempts\nreturn {'course_key': str(user_course_outline.course_key), 'course_start': schedule.course_start, 'course_end': schedule.course_end, 'tit...
<|body_start_0|> user_course_outline = user_course_outline_details.outline schedule = user_course_outline_details.schedule exam_information = user_course_outline_details.special_exam_attempts return {'course_key': str(user_course_outline.course_key), 'course_start': schedule.course_start...
Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are being serialized, and not have surprise regressions because a shared serializer in another module w...
UserCourseOutlineDataSerializer
[ "MIT", "AGPL-3.0-only", "AGPL-3.0-or-later" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserCourseOutlineDataSerializer: """Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are being serialized, and not have surprise ...
stack_v2_sparse_classes_75kplus_train_073962
11,389
permissive
[ { "docstring": "Convert to something DRF knows how to serialize (so no custom types) This is intentionally dumb and lists out every field to make API additions/changes more obvious.", "name": "to_representation", "signature": "def to_representation(self, user_course_outline_details)" }, { "docst...
3
stack_v2_sparse_classes_30k_train_032495
Implement the Python class `UserCourseOutlineDataSerializer` described below. Class description: Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are b...
Implement the Python class `UserCourseOutlineDataSerializer` described below. Class description: Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are b...
5809eaca7079a15ee56b0b7fcfea425337046c97
<|skeleton|> class UserCourseOutlineDataSerializer: """Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are being serialized, and not have surprise ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UserCourseOutlineDataSerializer: """Read-only serializer for CourseOutlineData for this endpoint. This serializer was purposefully declared inline with the CourseOutlineView to discourage reuse/magic. Our goal is to make it extremely obvious how things are being serialized, and not have surprise regressions b...
the_stack_v2_python_sparse
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/content/learning_sequences/views.py
luque/better-ways-of-thinking-about-software
train
3
5143240a3b20845e1c9e9dbf67558ed5152dbdda
[ "if not prices:\n return 0\nl = len(prices)\nif k > l / 2:\n return self.maxProfitGreedy(prices)\ndp = [[[0, 0] for _ in range(k + 1)] for _ in range(2)]\ndp[0] = [[0, -prices[0]] for _ in range(k + 1)]\nfor i in range(1, l):\n for j in range(k):\n x, x0 = (i % 2, (i - 1) % 2)\n dp[x][j][0] =...
<|body_start_0|> if not prices: return 0 l = len(prices) if k > l / 2: return self.maxProfitGreedy(prices) dp = [[[0, 0] for _ in range(k + 1)] for _ in range(2)] dp[0] = [[0, -prices[0]] for _ in range(k + 1)] for i in range(1, l): for...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit(self, k, prices): """:type k: int :type prices: List[int] :rtype: int""" <|body_0|> def maxProfitGreedy(self, prices): """:type prices: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not prices: ...
stack_v2_sparse_classes_75kplus_train_073963
1,547
no_license
[ { "docstring": ":type k: int :type prices: List[int] :rtype: int", "name": "maxProfit", "signature": "def maxProfit(self, k, prices)" }, { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfitGreedy", "signature": "def maxProfitGreedy(self, prices)" } ]
2
stack_v2_sparse_classes_30k_test_001123
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, k, prices): :type k: int :type prices: List[int] :rtype: int - def maxProfitGreedy(self, prices): :type prices: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, k, prices): :type k: int :type prices: List[int] :rtype: int - def maxProfitGreedy(self, prices): :type prices: List[int] :rtype: int <|skeleton|> class Solu...
fabe435f366477ec3526add84accec0b4ac38919
<|skeleton|> class Solution: def maxProfit(self, k, prices): """:type k: int :type prices: List[int] :rtype: int""" <|body_0|> def maxProfitGreedy(self, prices): """:type prices: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def maxProfit(self, k, prices): """:type k: int :type prices: List[int] :rtype: int""" if not prices: return 0 l = len(prices) if k > l / 2: return self.maxProfitGreedy(prices) dp = [[[0, 0] for _ in range(k + 1)] for _ in range(2)] ...
the_stack_v2_python_sparse
algorithm/leetcode/188_best-time-to-buy-and-sell-stock-iv.py
icejoywoo/toys
train
1
3f67d9d72ce564d2b1e35bbbe28fdb22ef5b5b69
[ "f = False\nif x < 0:\n f = True\nx2 = list(reversed(str(abs(x))))\nif f:\n x2.insert(0, '-')\nlast = int(''.join(x2))\nif abs(last) > 2147483647:\n return 0\nelse:\n return last", "sum = 0\nif x < 0:\n y = -x\nelse:\n y = x\nwhile y > 0:\n sum = sum * 10 + y % 10\n y = y // 10\nprint(sum)...
<|body_start_0|> f = False if x < 0: f = True x2 = list(reversed(str(abs(x)))) if f: x2.insert(0, '-') last = int(''.join(x2)) if abs(last) > 2147483647: return 0 else: return last <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def reverse(self, x): """:type x: int :rtype: int""" <|body_0|> def reverse2(self, x): """:type x: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> f = False if x < 0: f = True x2 = list(reversed(...
stack_v2_sparse_classes_75kplus_train_073964
1,545
no_license
[ { "docstring": ":type x: int :rtype: int", "name": "reverse", "signature": "def reverse(self, x)" }, { "docstring": ":type x: int :rtype: int", "name": "reverse2", "signature": "def reverse2(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_035058
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverse(self, x): :type x: int :rtype: int - def reverse2(self, x): :type x: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def reverse(self, x): :type x: int :rtype: int - def reverse2(self, x): :type x: int :rtype: int <|skeleton|> class Solution: def reverse(self, x): """:type x: int ...
b0f498ebe84e46b7e17e94759dd462891dcc8f85
<|skeleton|> class Solution: def reverse(self, x): """:type x: int :rtype: int""" <|body_0|> def reverse2(self, x): """:type x: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def reverse(self, x): """:type x: int :rtype: int""" f = False if x < 0: f = True x2 = list(reversed(str(abs(x)))) if f: x2.insert(0, '-') last = int(''.join(x2)) if abs(last) > 2147483647: return 0 e...
the_stack_v2_python_sparse
初级算法/string_2.py
wulinlw/leetcode_cn
train
0
65e82a4377f6d922df70c04dd68d7c68afef2c80
[ "keyList = list(self.cache_data)[0:]\nif key and item:\n if key in keyList:\n self.cache_data.update({key: item})\n self.__LFUDict.update({key: self.__bit})\n self.__bit += 1\n elif len(self.cache_data) < self.MAX_ITEMS:\n self.__LFUDict.update({key: self.__bit})\n self.__bi...
<|body_start_0|> keyList = list(self.cache_data)[0:] if key and item: if key in keyList: self.cache_data.update({key: item}) self.__LFUDict.update({key: self.__bit}) self.__bit += 1 elif len(self.cache_data) < self.MAX_ITEMS: ...
LFU Caching algorithm
LFUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LFUCache: """LFU Caching algorithm""" def put(self, key, item): """Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key""" <|body_0|> def get(self, key): """Return...
stack_v2_sparse_classes_75kplus_train_073965
2,258
no_license
[ { "docstring": "Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key", "name": "put", "signature": "def put(self, key, item)" }, { "docstring": "Returns the value of self.cache_data of given key P...
3
stack_v2_sparse_classes_30k_train_016059
Implement the Python class `LFUCache` described below. Class description: LFU Caching algorithm Method signatures and docstrings: - def put(self, key, item): Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key - def g...
Implement the Python class `LFUCache` described below. Class description: LFU Caching algorithm Method signatures and docstrings: - def put(self, key, item): Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key - def g...
03a8272d98af1975b7c476398a5cd95610ea2c1f
<|skeleton|> class LFUCache: """LFU Caching algorithm""" def put(self, key, item): """Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key""" <|body_0|> def get(self, key): """Return...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LFUCache: """LFU Caching algorithm""" def put(self, key, item): """Assign key: item to self.cache_data If key or item is None do nothing Parameters: key: key for item in self.cache_data dict item: contains value for key""" keyList = list(self.cache_data)[0:] if key and item: ...
the_stack_v2_python_sparse
0x03-caching/100-lfu_cache.py
veeteeran/holbertonschool-web_back_end
train
0
b7f31d10e89e5a784f1c8c85bc9a62104f56adfd
[ "state = [0, float('-inf'), float('-inf')]\nfor num in nums:\n if num % 3 == 0:\n state = [state[0] + num, state[1] + num, state[2] + num]\n if num % 3 == 1:\n a = max(state[2] + num, state[0])\n b = max(state[0] + num, state[1])\n c = max(state[1] + num, state[2])\n state =...
<|body_start_0|> state = [0, float('-inf'), float('-inf')] for num in nums: if num % 3 == 0: state = [state[0] + num, state[1] + num, state[2] + num] if num % 3 == 1: a = max(state[2] + num, state[0]) b = max(state[0] + num, state[1...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxSumDivThree(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxSumDivThreeTotalSumSubstraction(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> state = [0, float('...
stack_v2_sparse_classes_75kplus_train_073966
2,874
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "maxSumDivThree", "signature": "def maxSumDivThree(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "maxSumDivThreeTotalSumSubstraction", "signature": "def maxSumDivThreeTotalSumSubstraction(self, nums...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSumDivThree(self, nums): :type nums: List[int] :rtype: int - def maxSumDivThreeTotalSumSubstraction(self, nums): :type nums: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSumDivThree(self, nums): :type nums: List[int] :rtype: int - def maxSumDivThreeTotalSumSubstraction(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solu...
810575368ecffa97677bdb51744d1f716140bbb1
<|skeleton|> class Solution: def maxSumDivThree(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def maxSumDivThreeTotalSumSubstraction(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def maxSumDivThree(self, nums): """:type nums: List[int] :rtype: int""" state = [0, float('-inf'), float('-inf')] for num in nums: if num % 3 == 0: state = [state[0] + num, state[1] + num, state[2] + num] if num % 3 == 1: ...
the_stack_v2_python_sparse
G/GreatestSumDivisiblebyThree.py
bssrdf/pyleet
train
2
0b4aafbd7ba63af57ee1847f3cf8b839c48bc52f
[ "if name == '':\n return self\nelse:\n return ImageResource(name)", "images = [i for i in image.Image.all() if i.is_authorized(request.context, readonly=True)]\n\ndef decorate(m):\n if 'imageType' not in m and 'type' in m:\n m[u'imageType'] = m['type']\n elif 'imageType' in m:\n m[u'type...
<|body_start_0|> if name == '': return self else: return ImageResource(name) <|end_body_0|> <|body_start_1|> images = [i for i in image.Image.all() if i.is_authorized(request.context, readonly=True)] def decorate(m): if 'imageType' not in m and 'type...
A web resource representing a list of images
ImagesResource
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImagesResource: """A web resource representing a list of images""" def getChild(self, name, _request): """Returns itself or an ImageResource if no name given""" <|body_0|> def render_GET(self, request): """returns a json listing of all images that a user has perm...
stack_v2_sparse_classes_75kplus_train_073967
17,945
permissive
[ { "docstring": "Returns itself or an ImageResource if no name given", "name": "getChild", "signature": "def getChild(self, name, _request)" }, { "docstring": "returns a json listing of all images that a user has permissions to see", "name": "render_GET", "signature": "def render_GET(self...
5
stack_v2_sparse_classes_30k_train_031685
Implement the Python class `ImagesResource` described below. Class description: A web resource representing a list of images Method signatures and docstrings: - def getChild(self, name, _request): Returns itself or an ImageResource if no name given - def render_GET(self, request): returns a json listing of all images...
Implement the Python class `ImagesResource` described below. Class description: A web resource representing a list of images Method signatures and docstrings: - def getChild(self, name, _request): Returns itself or an ImageResource if no name given - def render_GET(self, request): returns a json listing of all images...
6912b0e1efd6ba3814d3b29beef236bfe4da52ea
<|skeleton|> class ImagesResource: """A web resource representing a list of images""" def getChild(self, name, _request): """Returns itself or an ImageResource if no name given""" <|body_0|> def render_GET(self, request): """returns a json listing of all images that a user has perm...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ImagesResource: """A web resource representing a list of images""" def getChild(self, name, _request): """Returns itself or an ImageResource if no name given""" if name == '': return self else: return ImageResource(name) def render_GET(self, request): ...
the_stack_v2_python_sparse
nova/objectstore/handler.py
pombredanne/nova
train
0
5e544f198d41eb0e5675a14b3c2775fa53fcacf4
[ "regex = '^(\\\\d+).*'\npattern = re.compile(regex)\nmatcher = pattern.search(limit_text_of_per_page)\nif matcher:\n return matcher.group(1)\nelse:\n return None", "regex = '\\\\d+-\\\\d+\\\\s共(\\\\d+)条$'\npattern = re.compile(regex)\nmatcher = pattern.search(total_data_text)\nif matcher:\n return matche...
<|body_start_0|> regex = '^(\\d+).*' pattern = re.compile(regex) matcher = pattern.search(limit_text_of_per_page) if matcher: return matcher.group(1) else: return None <|end_body_0|> <|body_start_1|> regex = '\\d+-\\d+\\s共(\\d+)条$' pattern...
广告位管理页面
ADPlaceManagePage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ADPlaceManagePage: """广告位管理页面""" def get_limit_number(self, limit_text_of_per_page): """获取每页显示条数""" <|body_0|> def get_total_datas(self, total_data_text): """获取数据总数""" <|body_1|> <|end_skeleton|> <|body_start_0|> regex = '^(\\d+).*' patt...
stack_v2_sparse_classes_75kplus_train_073968
12,259
no_license
[ { "docstring": "获取每页显示条数", "name": "get_limit_number", "signature": "def get_limit_number(self, limit_text_of_per_page)" }, { "docstring": "获取数据总数", "name": "get_total_datas", "signature": "def get_total_datas(self, total_data_text)" } ]
2
stack_v2_sparse_classes_30k_train_041827
Implement the Python class `ADPlaceManagePage` described below. Class description: 广告位管理页面 Method signatures and docstrings: - def get_limit_number(self, limit_text_of_per_page): 获取每页显示条数 - def get_total_datas(self, total_data_text): 获取数据总数
Implement the Python class `ADPlaceManagePage` described below. Class description: 广告位管理页面 Method signatures and docstrings: - def get_limit_number(self, limit_text_of_per_page): 获取每页显示条数 - def get_total_datas(self, total_data_text): 获取数据总数 <|skeleton|> class ADPlaceManagePage: """广告位管理页面""" def get_limit_n...
3011071556a3fa097d951a1823a4870cc4cc81e1
<|skeleton|> class ADPlaceManagePage: """广告位管理页面""" def get_limit_number(self, limit_text_of_per_page): """获取每页显示条数""" <|body_0|> def get_total_datas(self, total_data_text): """获取数据总数""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ADPlaceManagePage: """广告位管理页面""" def get_limit_number(self, limit_text_of_per_page): """获取每页显示条数""" regex = '^(\\d+).*' pattern = re.compile(regex) matcher = pattern.search(limit_text_of_per_page) if matcher: return matcher.group(1) else: ...
the_stack_v2_python_sparse
sevenautotest/testobjects/pages/webpages/yy/ad_place_manage_page.py
hotswwkyo/SevenPytest
train
3
64d570e9af884bd79e6deeffd46dac7b856c47cf
[ "self.attainable_Q = attainable_Q\nself.lambd = lambd\nself.discount = discount\nself.baseline = baseline\nself.deviation = deviation\nself.use_scale = use_scale\nif baseline != 'stepwise':\n self.name = baseline.capitalize()\n if baseline == 'start':\n self.name = 'Starting state'\nif deviation != 'ab...
<|body_start_0|> self.attainable_Q = attainable_Q self.lambd = lambd self.discount = discount self.baseline = baseline self.deviation = deviation self.use_scale = use_scale if baseline != 'stepwise': self.name = baseline.capitalize() if bas...
Attainable utility-preserving agent.
AUPAgent
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AUPAgent: """Attainable utility-preserving agent.""" def __init__(self, attainable_Q, lambd=1 / 1.501, discount=0.996, baseline='stepwise', deviation='absolute', use_scale=False): """:param attainable_Q: Q functions for the attainable set. :param lambd: Scale harshness of penalty. :p...
stack_v2_sparse_classes_75kplus_train_073969
5,049
permissive
[ { "docstring": ":param attainable_Q: Q functions for the attainable set. :param lambd: Scale harshness of penalty. :param discount: :param baseline: That with respect to which we calculate impact. :param deviation: How to penalize shifts in attainable utility.", "name": "__init__", "signature": "def __i...
4
stack_v2_sparse_classes_30k_train_013917
Implement the Python class `AUPAgent` described below. Class description: Attainable utility-preserving agent. Method signatures and docstrings: - def __init__(self, attainable_Q, lambd=1 / 1.501, discount=0.996, baseline='stepwise', deviation='absolute', use_scale=False): :param attainable_Q: Q functions for the att...
Implement the Python class `AUPAgent` described below. Class description: Attainable utility-preserving agent. Method signatures and docstrings: - def __init__(self, attainable_Q, lambd=1 / 1.501, discount=0.996, baseline='stepwise', deviation='absolute', use_scale=False): :param attainable_Q: Q functions for the att...
245b1fbc18f31d1d53883790d0d81d9fa27c2eba
<|skeleton|> class AUPAgent: """Attainable utility-preserving agent.""" def __init__(self, attainable_Q, lambd=1 / 1.501, discount=0.996, baseline='stepwise', deviation='absolute', use_scale=False): """:param attainable_Q: Q functions for the attainable set. :param lambd: Scale harshness of penalty. :p...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AUPAgent: """Attainable utility-preserving agent.""" def __init__(self, attainable_Q, lambd=1 / 1.501, discount=0.996, baseline='stepwise', deviation='absolute', use_scale=False): """:param attainable_Q: Q functions for the attainable set. :param lambd: Scale harshness of penalty. :param discount...
the_stack_v2_python_sparse
agents/aup.py
alexander-turner/attainable-utility-preservation
train
12
16e14cee89f081a8079869d5053c7f9008e46391
[ "km = self.kernel_manager\nmodel = await ensure_async(km.kernel_model(kernel_id))\nself.finish(json.dumps(model, default=json_default))", "km = self.kernel_manager\nawait ensure_async(km.shutdown_kernel(kernel_id))\nself.set_status(204)\nself.finish()" ]
<|body_start_0|> km = self.kernel_manager model = await ensure_async(km.kernel_model(kernel_id)) self.finish(json.dumps(model, default=json_default)) <|end_body_0|> <|body_start_1|> km = self.kernel_manager await ensure_async(km.shutdown_kernel(kernel_id)) self.set_statu...
A kernel API handler.
KernelHandler
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KernelHandler: """A kernel API handler.""" async def get(self, kernel_id): """Get a kernel model.""" <|body_0|> async def delete(self, kernel_id): """Remove a kernel.""" <|body_1|> <|end_skeleton|> <|body_start_0|> km = self.kernel_manager ...
stack_v2_sparse_classes_75kplus_train_073970
4,140
permissive
[ { "docstring": "Get a kernel model.", "name": "get", "signature": "async def get(self, kernel_id)" }, { "docstring": "Remove a kernel.", "name": "delete", "signature": "async def delete(self, kernel_id)" } ]
2
null
Implement the Python class `KernelHandler` described below. Class description: A kernel API handler. Method signatures and docstrings: - async def get(self, kernel_id): Get a kernel model. - async def delete(self, kernel_id): Remove a kernel.
Implement the Python class `KernelHandler` described below. Class description: A kernel API handler. Method signatures and docstrings: - async def get(self, kernel_id): Get a kernel model. - async def delete(self, kernel_id): Remove a kernel. <|skeleton|> class KernelHandler: """A kernel API handler.""" asy...
93fde1ad9fece22607960184501f5c9c80cd3765
<|skeleton|> class KernelHandler: """A kernel API handler.""" async def get(self, kernel_id): """Get a kernel model.""" <|body_0|> async def delete(self, kernel_id): """Remove a kernel.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class KernelHandler: """A kernel API handler.""" async def get(self, kernel_id): """Get a kernel model.""" km = self.kernel_manager model = await ensure_async(km.kernel_model(kernel_id)) self.finish(json.dumps(model, default=json_default)) async def delete(self, kernel_id):...
the_stack_v2_python_sparse
jupyter_server/services/kernels/handlers.py
jupyter-server/jupyter_server
train
237
ea4581fc47301ecc33a351c0e591e0071bae272a
[ "super(ComboLoss, self).__init__()\nassert alpha >= 0 and alpha <= 1, f'ValueError. alpha must in the range [0,1]. {alpha} given'\nassert beta >= 0 and beta <= 1, f'ValueError. beta must in the range [0,1]. {beta} given'\nself.alpha = alpha\nself.beta = beta\nself.reduction = reduction\nself.bin_dice_loss_fn = Bina...
<|body_start_0|> super(ComboLoss, self).__init__() assert alpha >= 0 and alpha <= 1, f'ValueError. alpha must in the range [0,1]. {alpha} given' assert beta >= 0 and beta <= 1, f'ValueError. beta must in the range [0,1]. {beta} given' self.alpha = alpha self.beta = beta s...
Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted.
ComboLoss
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ComboLoss: """Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted.""" def __init__(self, alpha=0.5, beta=0.5, reduction='mean', p=1): """Build a ComboLo...
stack_v2_sparse_classes_75kplus_train_073971
22,277
permissive
[ { "docstring": "Build a ComboLoss module for Binary segmentation. ---------- INPUT |---- alpha (float) the relative importance of the BCE compared to the Dice loss. Must be between 0 and 1. |---- beta (float) the relative importance of FP compared to FN in the BCE Loss. Must be between 0 and 1. |---- reduction ...
2
null
Implement the Python class `ComboLoss` described below. Class description: Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted. Method signatures and docstrings: - def __init__(self, alp...
Implement the Python class `ComboLoss` described below. Class description: Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted. Method signatures and docstrings: - def __init__(self, alp...
61e74a6188fe82843085e87da7d9c4ec7bdbf85e
<|skeleton|> class ComboLoss: """Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted.""" def __init__(self, alpha=0.5, beta=0.5, reduction='mean', p=1): """Build a ComboLo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ComboLoss: """Define the ComboLoss described by Asgari et al. It combines a Dice loss and a Binary cross entropy (BCE) loss in which the False Posistive (FP) and False Negative (FN) can be weighted.""" def __init__(self, alpha=0.5, beta=0.5, reduction='mean', p=1): """Build a ComboLoss module for...
the_stack_v2_python_sparse
code/src/models/optim/LossFunctions.py
antoine-spahr/Label-Efficient-Volumetric-Deep-Semantic-Segmentation-of-ICH
train
6
aaa8806b1754ef891aab5cc7f520e1109a7e4b7a
[ "equipment_qs = Equipment.search(**search_info)\nequipment_qs.order_by('-create_time')\nreturn Splitor(current_page, equipment_qs)", "for logistics in logistics_list:\n for logisticsitem in logistics.items:\n equipment_qs = Equipment.search(logistics_item=logisticsitem)\n logisticsitem.equipment_...
<|body_start_0|> equipment_qs = Equipment.search(**search_info) equipment_qs.order_by('-create_time') return Splitor(current_page, equipment_qs) <|end_body_0|> <|body_start_1|> for logistics in logistics_list: for logisticsitem in logistics.items: equipment_q...
EquipmentServer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EquipmentServer: def search(cls, current_page, **search_info): """查询设备列表""" <|body_0|> def hung_code_bylogistics(cls, logistics_list): """根据物流详情挂载设备""" <|body_1|> <|end_skeleton|> <|body_start_0|> equipment_qs = Equipment.search(**search_info) ...
stack_v2_sparse_classes_75kplus_train_073972
1,568
no_license
[ { "docstring": "查询设备列表", "name": "search", "signature": "def search(cls, current_page, **search_info)" }, { "docstring": "根据物流详情挂载设备", "name": "hung_code_bylogistics", "signature": "def hung_code_bylogistics(cls, logistics_list)" } ]
2
stack_v2_sparse_classes_30k_train_048567
Implement the Python class `EquipmentServer` described below. Class description: Implement the EquipmentServer class. Method signatures and docstrings: - def search(cls, current_page, **search_info): 查询设备列表 - def hung_code_bylogistics(cls, logistics_list): 根据物流详情挂载设备
Implement the Python class `EquipmentServer` described below. Class description: Implement the EquipmentServer class. Method signatures and docstrings: - def search(cls, current_page, **search_info): 查询设备列表 - def hung_code_bylogistics(cls, logistics_list): 根据物流详情挂载设备 <|skeleton|> class EquipmentServer: def sear...
c22e772bc24381f7f57e1d6e41ae0289e7f11e57
<|skeleton|> class EquipmentServer: def search(cls, current_page, **search_info): """查询设备列表""" <|body_0|> def hung_code_bylogistics(cls, logistics_list): """根据物流详情挂载设备""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EquipmentServer: def search(cls, current_page, **search_info): """查询设备列表""" equipment_qs = Equipment.search(**search_info) equipment_qs.order_by('-create_time') return Splitor(current_page, equipment_qs) def hung_code_bylogistics(cls, logistics_list): """根据物流详情挂载设备...
the_stack_v2_python_sparse
codes/crm-be/tuoen/abs/service/equipment/manager.py
MaseraTiGo/Maserati_Go
train
0
8fa3a6eb8cf8725b6be447d74ad2f1d6c6b77081
[ "super().__init__(name, plug, model, unique_id)\nif self._model == MODEL_POWER_STRIP_V2:\n self._device_features = FEATURE_FLAGS_POWER_STRIP_V2\nelse:\n self._device_features = FEATURE_FLAGS_POWER_STRIP_V1\nself._state_attrs[ATTR_LOAD_POWER] = None\nif self._device_features & FEATURE_SET_POWER_MODE == 1:\n ...
<|body_start_0|> super().__init__(name, plug, model, unique_id) if self._model == MODEL_POWER_STRIP_V2: self._device_features = FEATURE_FLAGS_POWER_STRIP_V2 else: self._device_features = FEATURE_FLAGS_POWER_STRIP_V1 self._state_attrs[ATTR_LOAD_POWER] = None ...
Representation of a Xiaomi Power Strip.
XiaomiPowerStripSwitch
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class XiaomiPowerStripSwitch: """Representation of a Xiaomi Power Strip.""" def __init__(self, name, plug, model, unique_id): """Initialize the plug switch.""" <|body_0|> async def async_update(self) -> None: """Fetch state from the device.""" <|body_1|> a...
stack_v2_sparse_classes_75kplus_train_073973
36,734
permissive
[ { "docstring": "Initialize the plug switch.", "name": "__init__", "signature": "def __init__(self, name, plug, model, unique_id)" }, { "docstring": "Fetch state from the device.", "name": "async_update", "signature": "async def async_update(self) -> None" }, { "docstring": "Set t...
3
stack_v2_sparse_classes_30k_train_017139
Implement the Python class `XiaomiPowerStripSwitch` described below. Class description: Representation of a Xiaomi Power Strip. Method signatures and docstrings: - def __init__(self, name, plug, model, unique_id): Initialize the plug switch. - async def async_update(self) -> None: Fetch state from the device. - async...
Implement the Python class `XiaomiPowerStripSwitch` described below. Class description: Representation of a Xiaomi Power Strip. Method signatures and docstrings: - def __init__(self, name, plug, model, unique_id): Initialize the plug switch. - async def async_update(self) -> None: Fetch state from the device. - async...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class XiaomiPowerStripSwitch: """Representation of a Xiaomi Power Strip.""" def __init__(self, name, plug, model, unique_id): """Initialize the plug switch.""" <|body_0|> async def async_update(self) -> None: """Fetch state from the device.""" <|body_1|> a...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class XiaomiPowerStripSwitch: """Representation of a Xiaomi Power Strip.""" def __init__(self, name, plug, model, unique_id): """Initialize the plug switch.""" super().__init__(name, plug, model, unique_id) if self._model == MODEL_POWER_STRIP_V2: self._device_features = FEAT...
the_stack_v2_python_sparse
homeassistant/components/xiaomi_miio/switch.py
home-assistant/core
train
35,501
89c2b707a154c475d18bfdfa48fdac4d31d81cce
[ "if actions is None:\n actions = list(VALID_ACTIONS_FOR_LIST.keys()) + list(VALID_ACTIONS_FOR_DETAIL)\nif not isinstance(actions, (list, set)):\n raise TypeError(\"The `actions` argument must be a list or set.For example `CaravaggiokRouter(['list', 'retrieve'])`\")\nlist_actions = {}\ndetail_actions = {}\nlis...
<|body_start_0|> if actions is None: actions = list(VALID_ACTIONS_FOR_LIST.keys()) + list(VALID_ACTIONS_FOR_DETAIL) if not isinstance(actions, (list, set)): raise TypeError("The `actions` argument must be a list or set.For example `CaravaggiokRouter(['list', 'retrieve'])`") ...
CaravaggioRouter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CaravaggioRouter: def __init__(self, actions=None, *args, **kwargs): """Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dynamic routes are generated based on the use of @action(detail=True) decorator on methods of the viewset. :...
stack_v2_sparse_classes_75kplus_train_073974
4,843
permissive
[ { "docstring": "Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dynamic routes are generated based on the use of @action(detail=True) decorator on methods of the viewset. :param actions: the actions the router should register. The valid actions are: li...
2
stack_v2_sparse_classes_30k_train_052260
Implement the Python class `CaravaggioRouter` described below. Class description: Implement the CaravaggioRouter class. Method signatures and docstrings: - def __init__(self, actions=None, *args, **kwargs): Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dyn...
Implement the Python class `CaravaggioRouter` described below. Class description: Implement the CaravaggioRouter class. Method signatures and docstrings: - def __init__(self, actions=None, *args, **kwargs): Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dyn...
98a530f7c0c38860561fac2f57476cf40f03e3d7
<|skeleton|> class CaravaggioRouter: def __init__(self, actions=None, *args, **kwargs): """Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dynamic routes are generated based on the use of @action(detail=True) decorator on methods of the viewset. :...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CaravaggioRouter: def __init__(self, actions=None, *args, **kwargs): """Configure the available routes based on the informed actions. All the dynamic routes are always registered. Dynamic routes are generated based on the use of @action(detail=True) decorator on methods of the viewset. :param actions:...
the_stack_v2_python_sparse
src/caravaggio_rest_api/drf/routers.py
intellstartup/django-caravaggio-rest-api
train
0
ce04c0d2b0e96712b552ee28b98dfcbb4d9e6c1c
[ "from collections import deque\nself.w = width\nself.h = height\nself.foods = deque(food)\nself.snake = deque([(0, 0)])\nself.invalid = set([(0, 0)])\nself.score = 0", "head = self.snake[0]\nnew_head = (head[0], head[1])\nif direction == 'U':\n new_head = (new_head[0] - 1, new_head[1])\nelif direction == 'L':\...
<|body_start_0|> from collections import deque self.w = width self.h = height self.foods = deque(food) self.snake = deque([(0, 0)]) self.invalid = set([(0, 0)]) self.score = 0 <|end_body_0|> <|body_start_1|> head = self.snake[0] new_head = (head[0...
SnakeGame
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SnakeGame: def __init__(self, width: int, height: int, food: List[List[int]]): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], t...
stack_v2_sparse_classes_75kplus_train_073975
2,143
no_license
[ { "docstring": "Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is at [1,0].", "name": "__init__", "signature": "def __init__(self, widt...
2
stack_v2_sparse_classes_30k_train_045268
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width: int, height: int, food: List[List[int]]): Initialize your data structure here. @param width - screen width @param height - screen height @param food -...
Implement the Python class `SnakeGame` described below. Class description: Implement the SnakeGame class. Method signatures and docstrings: - def __init__(self, width: int, height: int, food: List[List[int]]): Initialize your data structure here. @param width - screen width @param height - screen height @param food -...
88ccd910dfdb0e6ca6a70fa2d37906c31f4b3d70
<|skeleton|> class SnakeGame: def __init__(self, width: int, height: int, food: List[List[int]]): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SnakeGame: def __init__(self, width: int, height: int, food: List[List[int]]): """Initialize your data structure here. @param width - screen width @param height - screen height @param food - A list of food positions E.g food = [[1,1], [1,0]] means the first food is positioned at [1,1], the second is a...
the_stack_v2_python_sparse
practice/medium/0353-Design_Snake_Game.py
mattjp/leetcode
train
0
c6cebaece7e95949133e1f3112a133f9cb7abcbc
[ "if not heights:\n return 0\nn = len(heights)\ncnt = [0] * 101\nfor h in heights:\n cnt[h] += 1\nline = []\nfor i in range(1, 101):\n line.extend([i] * cnt[i])\nres = 0\nfor i in range(n):\n if heights[i] != line[i]:\n res += 1\nreturn res", "if not heights:\n return 0\ncnt = [0] * 101\nfor ...
<|body_start_0|> if not heights: return 0 n = len(heights) cnt = [0] * 101 for h in heights: cnt[h] += 1 line = [] for i in range(1, 101): line.extend([i] * cnt[i]) res = 0 for i in range(n): if heights[i] !=...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def heightChecker1(self, heights: List[int]) -> int: """思路:计数排序 @param heights: @return:""" <|body_0|> def heightChecker2(self, heights: List[int]) -> int: """思路:不用新建line数组 @param heights: @return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_073976
2,301
no_license
[ { "docstring": "思路:计数排序 @param heights: @return:", "name": "heightChecker1", "signature": "def heightChecker1(self, heights: List[int]) -> int" }, { "docstring": "思路:不用新建line数组 @param heights: @return:", "name": "heightChecker2", "signature": "def heightChecker2(self, heights: List[int])...
2
stack_v2_sparse_classes_30k_train_041853
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def heightChecker1(self, heights: List[int]) -> int: 思路:计数排序 @param heights: @return: - def heightChecker2(self, heights: List[int]) -> int: 思路:不用新建line数组 @param heights: @return...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def heightChecker1(self, heights: List[int]) -> int: 思路:计数排序 @param heights: @return: - def heightChecker2(self, heights: List[int]) -> int: 思路:不用新建line数组 @param heights: @return...
e43ee86c5a8cdb808da09b4b6138e10275abadb5
<|skeleton|> class Solution: def heightChecker1(self, heights: List[int]) -> int: """思路:计数排序 @param heights: @return:""" <|body_0|> def heightChecker2(self, heights: List[int]) -> int: """思路:不用新建line数组 @param heights: @return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def heightChecker1(self, heights: List[int]) -> int: """思路:计数排序 @param heights: @return:""" if not heights: return 0 n = len(heights) cnt = [0] * 101 for h in heights: cnt[h] += 1 line = [] for i in range(1, 101): ...
the_stack_v2_python_sparse
LeetCode/排序算法(sort)/1051. 高度检查器.py
yiming1012/MyLeetCode
train
2
9ac095ce6475e48891ee21421a8551c8a64ec23d
[ "sensor = None\nif config['type'].lower() == 'gpio':\n sensor = NanpyGPIOSensor(self.mudpi, config)\nelif config['type'].lower() == 'dht':\n sensor = NanpyDHTSensor(self.mudpi, config)\nelif config['type'].lower() == 'dallas_temperature':\n pass\nif sensor:\n node = self.extension.nodes[config['node']]\...
<|body_start_0|> sensor = None if config['type'].lower() == 'gpio': sensor = NanpyGPIOSensor(self.mudpi, config) elif config['type'].lower() == 'dht': sensor = NanpyDHTSensor(self.mudpi, config) elif config['type'].lower() == 'dallas_temperature': pass...
Interface
[ "BSD-4-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Interface: def load(self, config): """Load Nanpy sensor components from configs""" <|body_0|> def validate(self, config): """Validate the Nanpy sensor config""" <|body_1|> <|end_skeleton|> <|body_start_0|> sensor = None if config['type'].low...
stack_v2_sparse_classes_75kplus_train_073977
8,457
permissive
[ { "docstring": "Load Nanpy sensor components from configs", "name": "load", "signature": "def load(self, config)" }, { "docstring": "Validate the Nanpy sensor config", "name": "validate", "signature": "def validate(self, config)" } ]
2
stack_v2_sparse_classes_30k_train_040970
Implement the Python class `Interface` described below. Class description: Implement the Interface class. Method signatures and docstrings: - def load(self, config): Load Nanpy sensor components from configs - def validate(self, config): Validate the Nanpy sensor config
Implement the Python class `Interface` described below. Class description: Implement the Interface class. Method signatures and docstrings: - def load(self, config): Load Nanpy sensor components from configs - def validate(self, config): Validate the Nanpy sensor config <|skeleton|> class Interface: def load(se...
fb206b1136f529c7197f1e6b29629ed05630d377
<|skeleton|> class Interface: def load(self, config): """Load Nanpy sensor components from configs""" <|body_0|> def validate(self, config): """Validate the Nanpy sensor config""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Interface: def load(self, config): """Load Nanpy sensor components from configs""" sensor = None if config['type'].lower() == 'gpio': sensor = NanpyGPIOSensor(self.mudpi, config) elif config['type'].lower() == 'dht': sensor = NanpyDHTSensor(self.mudpi, c...
the_stack_v2_python_sparse
mudpi/extensions/nanpy/sensor.py
mistasp0ck/mudpi-core
train
0
ec5e31c6d470224f54a8f7ff51bbe68e355fff79
[ "self._console = Console()\nself._status = self._console.status('Working on it ...', spinner='bouncingBall')\nself._stored_progress_reporter = RichConsoleContextProgressReporter(console=self._console, status=self._status, sections=[], created_entities_stats=defaultdict(list), updated_entities_stats=defaultdict(lamb...
<|body_start_0|> self._console = Console() self._status = self._console.status('Working on it ...', spinner='bouncingBall') self._stored_progress_reporter = RichConsoleContextProgressReporter(console=self._console, status=self._status, sections=[], created_entities_stats=defaultdict(list), updat...
A progress reporter factory that builds Rich progress reporters.
RichConsoleProgressReporterFactory
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RichConsoleProgressReporterFactory: """A progress reporter factory that builds Rich progress reporters.""" def __init__(self) -> None: """Constructor.""" <|body_0|> def new_reporter(self, context: AppLoggedInUseCaseContext) -> ContextProgressReporter: """Create a...
stack_v2_sparse_classes_75kplus_train_073978
30,212
permissive
[ { "docstring": "Constructor.", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "Create a new progress reporter.", "name": "new_reporter", "signature": "def new_reporter(self, context: AppLoggedInUseCaseContext) -> ContextProgressReporter" }, { "doc...
3
stack_v2_sparse_classes_30k_train_018830
Implement the Python class `RichConsoleProgressReporterFactory` described below. Class description: A progress reporter factory that builds Rich progress reporters. Method signatures and docstrings: - def __init__(self) -> None: Constructor. - def new_reporter(self, context: AppLoggedInUseCaseContext) -> ContextProgr...
Implement the Python class `RichConsoleProgressReporterFactory` described below. Class description: A progress reporter factory that builds Rich progress reporters. Method signatures and docstrings: - def __init__(self) -> None: Constructor. - def new_reporter(self, context: AppLoggedInUseCaseContext) -> ContextProgr...
5be2f692e851ce18ad65df40a6c00afc00ae86ae
<|skeleton|> class RichConsoleProgressReporterFactory: """A progress reporter factory that builds Rich progress reporters.""" def __init__(self) -> None: """Constructor.""" <|body_0|> def new_reporter(self, context: AppLoggedInUseCaseContext) -> ContextProgressReporter: """Create a...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RichConsoleProgressReporterFactory: """A progress reporter factory that builds Rich progress reporters.""" def __init__(self) -> None: """Constructor.""" self._console = Console() self._status = self._console.status('Working on it ...', spinner='bouncingBall') self._stored...
the_stack_v2_python_sparse
src/cli/jupiter/cli/command/rendering.py
horia141/jupiter
train
16
fbcf65e16ccaaeb3a973dd02c1d2ee07354f0ade
[ "import collections\nself.cache = collections.OrderedDict()\nself.capacity = capacity", "ret = self.cache.pop(key, -1)\nif ret != -1:\n self.cache[key] = ret\nreturn ret", "self.cache.pop(key, None)\nif len(self.cache) == self.capacity:\n self.cache.popitem(last=False)\nself.cache[key] = value" ]
<|body_start_0|> import collections self.cache = collections.OrderedDict() self.capacity = capacity <|end_body_0|> <|body_start_1|> ret = self.cache.pop(key, -1) if ret != -1: self.cache[key] = ret return ret <|end_body_1|> <|body_start_2|> self.cach...
LRUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:rtype: int""" <|body_1|> def set(self, key, value): """:type key: int :type value: int :rtype: nothing""" <|body_2|> <|end_skeleton|> <...
stack_v2_sparse_classes_75kplus_train_073979
681
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: nothing", "name": "set", "sig...
3
stack_v2_sparse_classes_30k_train_044589
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): :rtype: int - def set(self, key, value): :type key: int :type value: int :rtype: nothing
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): :rtype: int - def set(self, key, value): :type key: int :type value: int :rtype: nothing <|skeleton|> cla...
88a822c48ef50187507d0f75ce65ecc39e849839
<|skeleton|> class LRUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:rtype: int""" <|body_1|> def set(self, key, value): """:type key: int :type value: int :rtype: nothing""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LRUCache: def __init__(self, capacity): """:type capacity: int""" import collections self.cache = collections.OrderedDict() self.capacity = capacity def get(self, key): """:rtype: int""" ret = self.cache.pop(key, -1) if ret != -1: self.c...
the_stack_v2_python_sparse
captainhcg/py/146-lru-cache.py
captainhcg/leetcode-in-py-and-go
train
1
07c89add1ec548b742ed43460a76be105de4c23a
[ "self._xx = xx\nself._yy = yy\nsuper(DeformationToPhase, self).__init__(str_description, ap_paramList)", "track_angle = self.ap_paramList[0]()\nmin_ground_range_1 = self.ap_paramList[1]()\nheight_1 = self.ap_paramList[2]()\nis_right_looking = self.ap_paramList[3]()\nwavelength = self.ap_paramList[4]()\nk = self.a...
<|body_start_0|> self._xx = xx self._yy = yy super(DeformationToPhase, self).__init__(str_description, ap_paramList) <|end_body_0|> <|body_start_1|> track_angle = self.ap_paramList[0]() min_ground_range_1 = self.ap_paramList[1]() height_1 = self.ap_paramList[2]() ...
Convert deformation to phas
DeformationToPhase
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeformationToPhase: """Convert deformation to phas""" def __init__(self, str_description, ap_paramList, xx, yy): """Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_paramList[track_angle] = Auto param of the track angle @param...
stack_v2_sparse_classes_75kplus_train_073980
4,150
permissive
[ { "docstring": "Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_paramList[track_angle] = Auto param of the track angle @param ap_paramList[min_ground_range_1] = Auto param of min_ground_range_1 @param ap_paramList[height_1] = Auto param of height_1 @par...
2
stack_v2_sparse_classes_30k_train_026741
Implement the Python class `DeformationToPhase` described below. Class description: Convert deformation to phas Method signatures and docstrings: - def __init__(self, str_description, ap_paramList, xx, yy): Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_para...
Implement the Python class `DeformationToPhase` described below. Class description: Convert deformation to phas Method signatures and docstrings: - def __init__(self, str_description, ap_paramList, xx, yy): Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_para...
4d22e3ef90ef842d6b390074a8b5deedc7658a2b
<|skeleton|> class DeformationToPhase: """Convert deformation to phas""" def __init__(self, str_description, ap_paramList, xx, yy): """Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_paramList[track_angle] = Auto param of the track angle @param...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DeformationToPhase: """Convert deformation to phas""" def __init__(self, str_description, ap_paramList, xx, yy): """Initialize Deformation to Phase pipeline item @param str_description: String description of item @param ap_paramList[track_angle] = Auto param of the track angle @param ap_paramList...
the_stack_v2_python_sparse
pyinsar/processing/discovery/deformation_to_phase.py
MITeaps/pyinsar
train
11
ac15bb95fda6211a157d02722a7f4b016acec825
[ "found = False\nseedlist = self.get_Value()\nfor iseed in seedlist:\n found = iseed.startswith(name + ' ')\n if found:\n break\nreturn found", "seedlist = self.get_Value()\noffset = jobproperties.Digitization.rndmSeedOffset1.get_Value() + jobproperties.Digitization.rndmSeedOffset2.get_Value()\nnewsee...
<|body_start_0|> found = False seedlist = self.get_Value() for iseed in seedlist: found = iseed.startswith(name + ' ') if found: break return found <|end_body_0|> <|body_start_1|> seedlist = self.get_Value() offset = jobproperties....
Random Number Seeds
rndmSeedList
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class rndmSeedList: """Random Number Seeds""" def checkForExistingSeed(self, name): """Ensure that each stream is only initialized once""" <|body_0|> def addSeed(self, name, seed1, seed2): """Add seeds to internal seedlist. Seeds will be incremented by offset values"""...
stack_v2_sparse_classes_75kplus_train_073981
29,414
permissive
[ { "docstring": "Ensure that each stream is only initialized once", "name": "checkForExistingSeed", "signature": "def checkForExistingSeed(self, name)" }, { "docstring": "Add seeds to internal seedlist. Seeds will be incremented by offset values", "name": "addSeed", "signature": "def addS...
4
null
Implement the Python class `rndmSeedList` described below. Class description: Random Number Seeds Method signatures and docstrings: - def checkForExistingSeed(self, name): Ensure that each stream is only initialized once - def addSeed(self, name, seed1, seed2): Add seeds to internal seedlist. Seeds will be incremente...
Implement the Python class `rndmSeedList` described below. Class description: Random Number Seeds Method signatures and docstrings: - def checkForExistingSeed(self, name): Ensure that each stream is only initialized once - def addSeed(self, name, seed1, seed2): Add seeds to internal seedlist. Seeds will be incremente...
354f92551294f7be678aebcd7b9d67d2c4448176
<|skeleton|> class rndmSeedList: """Random Number Seeds""" def checkForExistingSeed(self, name): """Ensure that each stream is only initialized once""" <|body_0|> def addSeed(self, name, seed1, seed2): """Add seeds to internal seedlist. Seeds will be incremented by offset values"""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class rndmSeedList: """Random Number Seeds""" def checkForExistingSeed(self, name): """Ensure that each stream is only initialized once""" found = False seedlist = self.get_Value() for iseed in seedlist: found = iseed.startswith(name + ' ') if found: ...
the_stack_v2_python_sparse
Simulation/Digitization/python/DigitizationFlags.py
strigazi/athena
train
0
44de7009aedc02afe1c34e1086a62a367a50a06a
[ "self.predictor_async = predictor_async\nself.output_path = output_path\nself._result = None\nself.failure_path = failure_path", "if waiter_config is not None and (not isinstance(waiter_config, WaiterConfig)):\n raise ValueError('waiter_config should be a WaiterConfig object')\nif self._result is None:\n if...
<|body_start_0|> self.predictor_async = predictor_async self.output_path = output_path self._result = None self.failure_path = failure_path <|end_body_0|> <|body_start_1|> if waiter_config is not None and (not isinstance(waiter_config, WaiterConfig)): raise ValueErro...
Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result
AsyncInferenceResponse
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AsyncInferenceResponse: """Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result""" def __init__(self, predictor_async, outpu...
stack_v2_sparse_classes_75kplus_train_073982
5,879
permissive
[ { "docstring": "Initialize an AsyncInferenceResponse object. AsyncInferenceResponse can help users to get async inference result from the Amazon S3 output path Args: predictor_async (sagemaker.predictor.AsyncPredictor): The ``AsyncPredictor`` that return this response. output_path (str): The Amazon S3 location ...
5
null
Implement the Python class `AsyncInferenceResponse` described below. Class description: Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result Method si...
Implement the Python class `AsyncInferenceResponse` described below. Class description: Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result Method si...
8d5d7fd8ae1a917ed3e2b988d5e533bce244fd85
<|skeleton|> class AsyncInferenceResponse: """Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result""" def __init__(self, predictor_async, outpu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AsyncInferenceResponse: """Response from Async Inference endpoint This response object provides a method to check for an async inference result in the Amazon S3 output path specified. If result object exists in that path, get and return the result""" def __init__(self, predictor_async, output_path, failu...
the_stack_v2_python_sparse
src/sagemaker/async_inference/async_inference_response.py
aws/sagemaker-python-sdk
train
2,050
c7c9a249d55290e3c80faac5db659750fd379b50
[ "self.aux_weight = aux_weight\nloss_base_cp = loss_base.copy()\nloss_base_name = loss_base_cp.pop('type')\nif ClassFactory.is_exists('trainer.loss', loss_base_name):\n loss_class = ClassFactory.get_cls('trainer.loss', loss_base_name)\nelse:\n loss_class = getattr(importlib.import_module('tensorflow.losses'), ...
<|body_start_0|> self.aux_weight = aux_weight loss_base_cp = loss_base.copy() loss_base_name = loss_base_cp.pop('type') if ClassFactory.is_exists('trainer.loss', loss_base_name): loss_class = ClassFactory.get_cls('trainer.loss', loss_base_name) else: loss_...
Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str
MixAuxiliaryLoss
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MixAuxiliaryLoss: """Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str""" def __init__(self, aux_weight, loss_base): """Init MixAuxiliaryLoss.""" <|body_0|> def __call__(self, logi...
stack_v2_sparse_classes_75kplus_train_073983
1,827
permissive
[ { "docstring": "Init MixAuxiliaryLoss.", "name": "__init__", "signature": "def __init__(self, aux_weight, loss_base)" }, { "docstring": "Loss forward function.", "name": "__call__", "signature": "def __call__(self, logits, labels)" } ]
2
stack_v2_sparse_classes_30k_train_054476
Implement the Python class `MixAuxiliaryLoss` described below. Class description: Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str Method signatures and docstrings: - def __init__(self, aux_weight, loss_base): Init MixAuxiliar...
Implement the Python class `MixAuxiliaryLoss` described below. Class description: Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str Method signatures and docstrings: - def __init__(self, aux_weight, loss_base): Init MixAuxiliar...
12e37a1991eb6771a2999fe0a46ddda920c47948
<|skeleton|> class MixAuxiliaryLoss: """Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str""" def __init__(self, aux_weight, loss_base): """Init MixAuxiliaryLoss.""" <|body_0|> def __call__(self, logi...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MixAuxiliaryLoss: """Class of Mix Auxiliary Loss. :param aux_weight: auxiliary loss weight :type aux_weight: float :loss_base: base loss function :loss_base: str""" def __init__(self, aux_weight, loss_base): """Init MixAuxiliaryLoss.""" self.aux_weight = aux_weight loss_base_cp = ...
the_stack_v2_python_sparse
vega/networks/tensorflow/losses/mix_auxiliary_loss.py
huawei-noah/vega
train
850
e6fa0384178cfe926aab3b216143dfcd9578cfc3
[ "self.resource_name = str_attr\nCDevice.__init__(self, self.resource_name)\nself.obj_parent = obj_device\nself.set_logger(self.obj_parent.obj_logger)\nself.set_rest_agent(self.obj_parent.obj_rest_agent)\nself.str_device_type = self.obj_parent.str_device_type\nself.uri = '{}/{}'.format(self.obj_parent.uri, self.reso...
<|body_start_0|> self.resource_name = str_attr CDevice.__init__(self, self.resource_name) self.obj_parent = obj_device self.set_logger(self.obj_parent.obj_logger) self.set_rest_agent(self.obj_parent.obj_rest_agent) self.str_device_type = self.obj_parent.str_device_type ...
CCatalog
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CCatalog: def __init__(self, obj_device, str_attr): """@param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id for catalog in catalogs - source for catalog in nodes @type str_attr: string""" <|body_0...
stack_v2_sparse_classes_75kplus_train_073984
2,652
no_license
[ { "docstring": "@param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id for catalog in catalogs - source for catalog in nodes @type str_attr: string", "name": "__init__", "signature": "def __init__(self, obj_device, str_att...
3
stack_v2_sparse_classes_30k_val_002855
Implement the Python class `CCatalog` described below. Class description: Implement the CCatalog class. Method signatures and docstrings: - def __init__(self, obj_device, str_attr): @param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id...
Implement the Python class `CCatalog` described below. Class description: Implement the CCatalog class. Method signatures and docstrings: - def __init__(self, obj_device, str_attr): @param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id...
8290fc0ccbde0a6a7d8784aec04c88cc325cfa4c
<|skeleton|> class CCatalog: def __init__(self, obj_device, str_attr): """@param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id for catalog in catalogs - source for catalog in nodes @type str_attr: string""" <|body_0...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CCatalog: def __init__(self, obj_device, str_attr): """@param obj_device: Parent device that init this one @type obj_device: CDevice @param str_attr: attribute of this catalog, could be: - id for catalog in catalogs - source for catalog in nodes @type str_attr: string""" self.resource_name = s...
the_stack_v2_python_sparse
idic/monorail/Catalog.py
InfraSIM/test
train
1
5f58597032042e4a2abbcc550a110fc81d7b8b96
[ "if s == '' or len(s) <= 0:\n return ''\nreturn '%20'.join(s.split(' '))", "if s == '' or len(s) <= 0:\n return ''\nreturn s.replace(' ', '%20')", "if s == '' or len(s) <= 0:\n return ''\ns = list(s)\ncount = 0\nfor i in s:\n if i == ' ':\n count += 1\np1 = len(s) - 1\ns += [None] * (count * ...
<|body_start_0|> if s == '' or len(s) <= 0: return '' return '%20'.join(s.split(' ')) <|end_body_0|> <|body_start_1|> if s == '' or len(s) <= 0: return '' return s.replace(' ', '%20') <|end_body_1|> <|body_start_2|> if s == '' or len(s) <= 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def replaceSpace1(self, s): """使用join""" <|body_0|> def replaceSpace2(self, s): """使用replace方法""" <|body_1|> def replaceSpace3(self, s): """剑指offer解法: ①先计算源字符串数组长度,并统计空格数量 ②新字符串数组长度=源数组长度+2*空格数量 ③在新字符串数组上,从后向前遍历,通过两个index移动并复制 :param s:...
stack_v2_sparse_classes_75kplus_train_073985
1,869
no_license
[ { "docstring": "使用join", "name": "replaceSpace1", "signature": "def replaceSpace1(self, s)" }, { "docstring": "使用replace方法", "name": "replaceSpace2", "signature": "def replaceSpace2(self, s)" }, { "docstring": "剑指offer解法: ①先计算源字符串数组长度,并统计空格数量 ②新字符串数组长度=源数组长度+2*空格数量 ③在新字符串数组上,从后向前...
3
stack_v2_sparse_classes_30k_train_020719
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def replaceSpace1(self, s): 使用join - def replaceSpace2(self, s): 使用replace方法 - def replaceSpace3(self, s): 剑指offer解法: ①先计算源字符串数组长度,并统计空格数量 ②新字符串数组长度=源数组长度+2*空格数量 ③在新字符串数组上,从后向前遍历...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def replaceSpace1(self, s): 使用join - def replaceSpace2(self, s): 使用replace方法 - def replaceSpace3(self, s): 剑指offer解法: ①先计算源字符串数组长度,并统计空格数量 ②新字符串数组长度=源数组长度+2*空格数量 ③在新字符串数组上,从后向前遍历...
060e809175cff96e91c694b93417c0c1d21719f0
<|skeleton|> class Solution: def replaceSpace1(self, s): """使用join""" <|body_0|> def replaceSpace2(self, s): """使用replace方法""" <|body_1|> def replaceSpace3(self, s): """剑指offer解法: ①先计算源字符串数组长度,并统计空格数量 ②新字符串数组长度=源数组长度+2*空格数量 ③在新字符串数组上,从后向前遍历,通过两个index移动并复制 :param s:...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def replaceSpace1(self, s): """使用join""" if s == '' or len(s) <= 0: return '' return '%20'.join(s.split(' ')) def replaceSpace2(self, s): """使用replace方法""" if s == '' or len(s) <= 0: return '' return s.replace(' ', '%20') ...
the_stack_v2_python_sparse
ProgrammingOJ/CodingInterviewOffer_nowcoder_python/05_ReplaceSpaces.py
PandoraLS/CodingInterview
train
2
f81275bd127bdb5d644fd7446fdcbc19172b7606
[ "debug.trace('GramMgrDictContext.interpret_dictation', 'initial_buffer=%s' % initial_buffer)\nname = self.name()\nif initial_buffer != 0:\n self.recog_mgr.interpret_dictation(name, result, initial_buffer=initial_buffer)", "current = self.app.cur_pos(buff_name=buffer)\nselection = self.app.get_selection(buff_na...
<|body_start_0|> debug.trace('GramMgrDictContext.interpret_dictation', 'initial_buffer=%s' % initial_buffer) name = self.name() if initial_buffer != 0: self.recog_mgr.interpret_dictation(name, result, initial_buffer=initial_buffer) <|end_body_0|> <|body_start_1|> current = s...
implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none*
GramMgrDictContext
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GramMgrDictContext: """implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none*""" def interpret_dictation(self, result, initial_buffer=None): """interpret the result of recognition by a dictation grammar, and store the relevant information t...
stack_v2_sparse_classes_75kplus_train_073986
43,420
no_license
[ { "docstring": "interpret the result of recognition by a dictation grammar, and store the relevant information to allow for correction. **INPUTS** *SpokenUtterance result* -- a SpokenUtterance object representing the recognition results *STR initial_buffer* -- the name of the initial buffer which was active at ...
2
stack_v2_sparse_classes_30k_train_007852
Implement the Python class `GramMgrDictContext` described below. Class description: implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none* Method signatures and docstrings: - def interpret_dictation(self, result, initial_buffer=None): interpret the result of recognition by ...
Implement the Python class `GramMgrDictContext` described below. Class description: implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none* Method signatures and docstrings: - def interpret_dictation(self, result, initial_buffer=None): interpret the result of recognition by ...
21eea404bfe63e4ea445cfa9edcde8152ad59836
<|skeleton|> class GramMgrDictContext: """implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none*""" def interpret_dictation(self, result, initial_buffer=None): """interpret the result of recognition by a dictation grammar, and store the relevant information t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GramMgrDictContext: """implements finding of dictation context **INSTANCE ATTRIBUTES** *none* **CLASS ATTRIBUTES** *none*""" def interpret_dictation(self, result, initial_buffer=None): """interpret the result of recognition by a dictation grammar, and store the relevant information to allow for c...
the_stack_v2_python_sparse
VCode/Mediator/GramMgr.py
jboner/emacs-config
train
8
2a30e9d3bdc47b4e5018d254e9429bec0ad022ea
[ "cdata = self.cleaned_data\npassword1 = cdata.get('password1')\npassword2 = cdata.get('password2')\nif not password1 or not password2 or (not len(password1)) or (not len(password2)):\n msg = 'Both password and password confirmation must be filled'\n raise forms.ValidationError(msg)\nif password1 != password2:...
<|body_start_0|> cdata = self.cleaned_data password1 = cdata.get('password1') password2 = cdata.get('password2') if not password1 or not password2 or (not len(password1)) or (not len(password2)): msg = 'Both password and password confirmation must be filled' raise...
A form for creating new users.
TrackTrainsUserCreationForm
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrackTrainsUserCreationForm: """A form for creating new users.""" def clean_password2(self): """Check that the password and password confirmation are identical.""" <|body_0|> def save(self, commit=True): """Save password in hashed format""" <|body_1|> <|...
stack_v2_sparse_classes_75kplus_train_073987
3,456
permissive
[ { "docstring": "Check that the password and password confirmation are identical.", "name": "clean_password2", "signature": "def clean_password2(self)" }, { "docstring": "Save password in hashed format", "name": "save", "signature": "def save(self, commit=True)" } ]
2
stack_v2_sparse_classes_30k_train_009564
Implement the Python class `TrackTrainsUserCreationForm` described below. Class description: A form for creating new users. Method signatures and docstrings: - def clean_password2(self): Check that the password and password confirmation are identical. - def save(self, commit=True): Save password in hashed format
Implement the Python class `TrackTrainsUserCreationForm` described below. Class description: A form for creating new users. Method signatures and docstrings: - def clean_password2(self): Check that the password and password confirmation are identical. - def save(self, commit=True): Save password in hashed format <|s...
fd7086f14e415531fbb4215c8f0df8540b4ade00
<|skeleton|> class TrackTrainsUserCreationForm: """A form for creating new users.""" def clean_password2(self): """Check that the password and password confirmation are identical.""" <|body_0|> def save(self, commit=True): """Save password in hashed format""" <|body_1|> <|...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TrackTrainsUserCreationForm: """A form for creating new users.""" def clean_password2(self): """Check that the password and password confirmation are identical.""" cdata = self.cleaned_data password1 = cdata.get('password1') password2 = cdata.get('password2') if no...
the_stack_v2_python_sparse
profiles/admin.py
pavelkuchin/tracktrains
train
0
8aeff0b9ef4ccbf9a8a6c374cb3566705965f099
[ "self.unit_dim = unit_dim\nself.activation = activation\nself.dropout = dropout\nself.regularizer = regularizer\nself.random_seed = random_seed\nself.trainable = trainable\nself.scope = scope\nself.device_spec = get_device_spec(default_gpu_id, num_gpus)\nwith tf.variable_scope(self.scope, reuse=tf.AUTO_REUSE), tf.d...
<|body_start_0|> self.unit_dim = unit_dim self.activation = activation self.dropout = dropout self.regularizer = regularizer self.random_seed = random_seed self.trainable = trainable self.scope = scope self.device_spec = get_device_spec(default_gpu_id, num...
highway layer
Highway
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Highway: """highway layer""" def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway'): """initialize highway layer""" <|body_0|> def __call__(self, input_data, input_mask): "...
stack_v2_sparse_classes_75kplus_train_073988
9,944
permissive
[ { "docstring": "initialize highway layer", "name": "__init__", "signature": "def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway')" }, { "docstring": "call highway layer", "name": "__call__", "sig...
2
stack_v2_sparse_classes_30k_test_001640
Implement the Python class `Highway` described below. Class description: highway layer Method signatures and docstrings: - def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway'): initialize highway layer - def __call__(self, in...
Implement the Python class `Highway` described below. Class description: highway layer Method signatures and docstrings: - def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway'): initialize highway layer - def __call__(self, in...
05fcbec15e359e3db86af6c3798c13be8a6c58ee
<|skeleton|> class Highway: """highway layer""" def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway'): """initialize highway layer""" <|body_0|> def __call__(self, input_data, input_mask): "...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Highway: """highway layer""" def __init__(self, unit_dim, activation, dropout, num_gpus=1, default_gpu_id=0, regularizer=None, random_seed=0, trainable=True, scope='highway'): """initialize highway layer""" self.unit_dim = unit_dim self.activation = activation self.dropout...
the_stack_v2_python_sparse
sequence_labeling/layer/highway.py
stevezheng23/sequence_labeling_tf
train
18
e03b5ed4b7415b893ce03168acb3e789bc0c1abc
[ "response = self.client.get('/feed/')\nself.assertContains(response, 'Django 1.0 alpha released', 1)\nself.assertContains(response, 'Introducing Review Board News', 1)", "response = self.client.get('/feed-inline/')\nself.assertContains(response, 'Django 1.0 alpha released', 1)\nself.assertContains(response, 'Intr...
<|body_start_0|> response = self.client.get('/feed/') self.assertContains(response, 'Django 1.0 alpha released', 1) self.assertContains(response, 'Introducing Review Board News', 1) <|end_body_0|> <|body_start_1|> response = self.client.get('/feed-inline/') self.assertContains(r...
FeedViewTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FeedViewTests: def testViewFeedPage(self): """Testing view_feed with the feed-page.html template""" <|body_0|> def testViewFeedInline(self): """Testing view_feed with the feed-inline.html template""" <|body_1|> def testViewFeedError(self): """Tes...
stack_v2_sparse_classes_75kplus_train_073989
1,065
no_license
[ { "docstring": "Testing view_feed with the feed-page.html template", "name": "testViewFeedPage", "signature": "def testViewFeedPage(self)" }, { "docstring": "Testing view_feed with the feed-inline.html template", "name": "testViewFeedInline", "signature": "def testViewFeedInline(self)" ...
3
stack_v2_sparse_classes_30k_train_038985
Implement the Python class `FeedViewTests` described below. Class description: Implement the FeedViewTests class. Method signatures and docstrings: - def testViewFeedPage(self): Testing view_feed with the feed-page.html template - def testViewFeedInline(self): Testing view_feed with the feed-inline.html template - de...
Implement the Python class `FeedViewTests` described below. Class description: Implement the FeedViewTests class. Method signatures and docstrings: - def testViewFeedPage(self): Testing view_feed with the feed-page.html template - def testViewFeedInline(self): Testing view_feed with the feed-inline.html template - de...
99ea69d80a3a393b0da4da3152ef26e808dd8487
<|skeleton|> class FeedViewTests: def testViewFeedPage(self): """Testing view_feed with the feed-page.html template""" <|body_0|> def testViewFeedInline(self): """Testing view_feed with the feed-inline.html template""" <|body_1|> def testViewFeedError(self): """Tes...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class FeedViewTests: def testViewFeedPage(self): """Testing view_feed with the feed-page.html template""" response = self.client.get('/feed/') self.assertContains(response, 'Django 1.0 alpha released', 1) self.assertContains(response, 'Introducing Review Board News', 1) def test...
the_stack_v2_python_sparse
djblets/feedview/tests.py
chipx86/djblets
train
2
f5fb50d0ef37b2b9bf4de53a09c355740486895a
[ "inputs = np.random.rand(2, input_size, input_size, 3)\ntf.keras.backend.set_image_data_format('channels_last')\nbackbone = basnet_model.BASNetEncoder()\ndecoder = basnet_model.BASNetDecoder()\nrefinement = refunet.RefUnet()\nmodel = basnet_model.BASNetModel(backbone=backbone, decoder=decoder, refinement=refinement...
<|body_start_0|> inputs = np.random.rand(2, input_size, input_size, 3) tf.keras.backend.set_image_data_format('channels_last') backbone = basnet_model.BASNetEncoder() decoder = basnet_model.BASNetDecoder() refinement = refunet.RefUnet() model = basnet_model.BASNetModel(ba...
BASNetNetworkTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BASNetNetworkTest: def test_basnet_network_creation(self, input_size): """Test for creation of a segmentation network.""" <|body_0|> def test_serialize_deserialize(self): """Validate the network can be serialized and deserialized.""" <|body_1|> <|end_skeleto...
stack_v2_sparse_classes_75kplus_train_073990
2,356
permissive
[ { "docstring": "Test for creation of a segmentation network.", "name": "test_basnet_network_creation", "signature": "def test_basnet_network_creation(self, input_size)" }, { "docstring": "Validate the network can be serialized and deserialized.", "name": "test_serialize_deserialize", "si...
2
stack_v2_sparse_classes_30k_train_053227
Implement the Python class `BASNetNetworkTest` described below. Class description: Implement the BASNetNetworkTest class. Method signatures and docstrings: - def test_basnet_network_creation(self, input_size): Test for creation of a segmentation network. - def test_serialize_deserialize(self): Validate the network ca...
Implement the Python class `BASNetNetworkTest` described below. Class description: Implement the BASNetNetworkTest class. Method signatures and docstrings: - def test_basnet_network_creation(self, input_size): Test for creation of a segmentation network. - def test_serialize_deserialize(self): Validate the network ca...
d3507b550a3ade40cade60a79eb5b8978b56c7ae
<|skeleton|> class BASNetNetworkTest: def test_basnet_network_creation(self, input_size): """Test for creation of a segmentation network.""" <|body_0|> def test_serialize_deserialize(self): """Validate the network can be serialized and deserialized.""" <|body_1|> <|end_skeleto...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BASNetNetworkTest: def test_basnet_network_creation(self, input_size): """Test for creation of a segmentation network.""" inputs = np.random.rand(2, input_size, input_size, 3) tf.keras.backend.set_image_data_format('channels_last') backbone = basnet_model.BASNetEncoder() ...
the_stack_v2_python_sparse
official/projects/basnet/modeling/basnet_model_test.py
jianzhnie/models
train
2
4a0521e733d7580ef3eba6519f3e26a369b68637
[ "super().__init__()\nself.pooling = pooling\nself.kernel_size = kernel_size\nself.enc_l5 = SphericalChebBN2(16, 32, 64, laps[5], self.kernel_size)\nself.enc_l4 = SphericalChebBNPool(64, 128, laps[4], self.pooling, self.kernel_size)\nself.enc_l3 = SphericalChebBNPool(128, 256, laps[3], self.pooling, self.kernel_size...
<|body_start_0|> super().__init__() self.pooling = pooling self.kernel_size = kernel_size self.enc_l5 = SphericalChebBN2(16, 32, 64, laps[5], self.kernel_size) self.enc_l4 = SphericalChebBNPool(64, 128, laps[4], self.pooling, self.kernel_size) self.enc_l3 = SphericalChebB...
Encoder for the Spherical UNet.
Encoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Encoder: """Encoder for the Spherical UNet.""" def __init__(self, pooling, laps, kernel_size): """Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polynomial degree.""" <|body_0|> def forward(self,...
stack_v2_sparse_classes_75kplus_train_073991
41,403
no_license
[ { "docstring": "Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polynomial degree.", "name": "__init__", "signature": "def __init__(self, pooling, laps, kernel_size)" }, { "docstring": "Forward Pass. Args: x (:obj:`torch....
2
stack_v2_sparse_classes_30k_train_032096
Implement the Python class `Encoder` described below. Class description: Encoder for the Spherical UNet. Method signatures and docstrings: - def __init__(self, pooling, laps, kernel_size): Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polyno...
Implement the Python class `Encoder` described below. Class description: Encoder for the Spherical UNet. Method signatures and docstrings: - def __init__(self, pooling, laps, kernel_size): Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polyno...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class Encoder: """Encoder for the Spherical UNet.""" def __init__(self, pooling, laps, kernel_size): """Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polynomial degree.""" <|body_0|> def forward(self,...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Encoder: """Encoder for the Spherical UNet.""" def __init__(self, pooling, laps, kernel_size): """Initialization. Args: pooling (:obj:`torch.nn.Module`): pooling layer. laps (list): List of laplacians. kernel_size (int): polynomial degree.""" super().__init__() self.pooling = pool...
the_stack_v2_python_sparse
generated/test_deepsphere_deepsphere_pytorch.py
jansel/pytorch-jit-paritybench
train
35
152651842aa7c5bad824ee56cc9a4831f7bb5ec2
[ "ret = 0\nfor i1 in range(len(height)):\n for i2 in range(i1 + 1, len(height)):\n ret = max(min(height[i1], height[i2]) * (i2 - i1), ret)\nreturn ret", "maxarea = 0\nl = 0\nr = len(height)\nwhile l < r:\n maxarea = max(maxarea, Math.min(height[l], height[r]) * (r - l))\n if height[l] < height[r]:\...
<|body_start_0|> ret = 0 for i1 in range(len(height)): for i2 in range(i1 + 1, len(height)): ret = max(min(height[i1], height[i2]) * (i2 - i1), ret) return ret <|end_body_0|> <|body_start_1|> maxarea = 0 l = 0 r = len(height) while l <...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_0|> def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> ret = 0 for i1 in range(len(height)):...
stack_v2_sparse_classes_75kplus_train_073992
961
no_license
[ { "docstring": ":type height: List[int] :rtype: int", "name": "maxArea", "signature": "def maxArea(self, height)" }, { "docstring": ":type height: List[int] :rtype: int", "name": "maxArea", "signature": "def maxArea(self, height)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxArea(self, height): :type height: List[int] :rtype: int - def maxArea(self, height): :type height: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxArea(self, height): :type height: List[int] :rtype: int - def maxArea(self, height): :type height: List[int] :rtype: int <|skeleton|> class Solution: def maxArea(sel...
d8ed762d1005975f0de4f07760c9671195621c88
<|skeleton|> class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_0|> def maxArea(self, height): """:type height: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def maxArea(self, height): """:type height: List[int] :rtype: int""" ret = 0 for i1 in range(len(height)): for i2 in range(i1 + 1, len(height)): ret = max(min(height[i1], height[i2]) * (i2 - i1), ret) return ret def maxArea(self, heigh...
the_stack_v2_python_sparse
container-with-most-water/solution.py
uxlsl/leetcode_practice
train
0
852b42df62a5e382b706216d2040074f8892317c
[ "super().__init__()\nself.up_layers = torch.nn.ModuleList()\nfor scale in upsample_scales:\n stretch = Stretch2d(scale, 1, interpolate_mode)\n self.up_layers += [stretch]\n assert (freq_axis_kernel_size - 1) % 2 == 0, 'Not support even number freq axis kernel size.'\n freq_axis_padding = (freq_axis_kern...
<|body_start_0|> super().__init__() self.up_layers = torch.nn.ModuleList() for scale in upsample_scales: stretch = Stretch2d(scale, 1, interpolate_mode) self.up_layers += [stretch] assert (freq_axis_kernel_size - 1) % 2 == 0, 'Not support even number freq axis...
Upsampling network module.
UpsampleNetwork
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UpsampleNetwork: """Upsampling network module.""" def __init__(self, upsample_scales: List[int], nonlinear_activation: Optional[str]=None, nonlinear_activation_params: Dict[str, Any]={}, interpolate_mode: str='nearest', freq_axis_kernel_size: int=1): """Initialize UpsampleNetwork mod...
stack_v2_sparse_classes_75kplus_train_073993
6,161
permissive
[ { "docstring": "Initialize UpsampleNetwork module. Args: upsample_scales (List[int]): List of upsampling scales. nonlinear_activation (Optional[str]): Activation function name. nonlinear_activation_params (Dict[str, Any]): Arguments for the specified activation function. interpolate_mode (str): Interpolation mo...
2
stack_v2_sparse_classes_30k_train_039596
Implement the Python class `UpsampleNetwork` described below. Class description: Upsampling network module. Method signatures and docstrings: - def __init__(self, upsample_scales: List[int], nonlinear_activation: Optional[str]=None, nonlinear_activation_params: Dict[str, Any]={}, interpolate_mode: str='nearest', freq...
Implement the Python class `UpsampleNetwork` described below. Class description: Upsampling network module. Method signatures and docstrings: - def __init__(self, upsample_scales: List[int], nonlinear_activation: Optional[str]=None, nonlinear_activation_params: Dict[str, Any]={}, interpolate_mode: str='nearest', freq...
bcd20948db7846ee523443ef9fd78c7a1248c95e
<|skeleton|> class UpsampleNetwork: """Upsampling network module.""" def __init__(self, upsample_scales: List[int], nonlinear_activation: Optional[str]=None, nonlinear_activation_params: Dict[str, Any]={}, interpolate_mode: str='nearest', freq_axis_kernel_size: int=1): """Initialize UpsampleNetwork mod...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UpsampleNetwork: """Upsampling network module.""" def __init__(self, upsample_scales: List[int], nonlinear_activation: Optional[str]=None, nonlinear_activation_params: Dict[str, Any]={}, interpolate_mode: str='nearest', freq_axis_kernel_size: int=1): """Initialize UpsampleNetwork module. Args: up...
the_stack_v2_python_sparse
espnet2/gan_tts/parallel_wavegan/upsample.py
espnet/espnet
train
7,242
f281cb604e8f1469829908b6c1b98451827da3a2
[ "super().__init__()\nself.seed = torch.manual_seed(seed)\nself.layer1 = nn.Linear(state_size, layer1_units)\nself.layer2 = nn.Linear(layer1_units, layer2_units)\nself.layer3 = nn.Linear(layer2_units, layer3_units)\nself.layer4 = nn.Linear(layer3_units, action_size)", "x = F.relu(self.layer1(x))\nx = F.relu(self.l...
<|body_start_0|> super().__init__() self.seed = torch.manual_seed(seed) self.layer1 = nn.Linear(state_size, layer1_units) self.layer2 = nn.Linear(layer1_units, layer2_units) self.layer3 = nn.Linear(layer2_units, layer3_units) self.layer4 = nn.Linear(layer3_units, action_s...
MLPNetwork
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MLPNetwork: def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100): """MLP model for agent :param state_size: :param action_size: :param seed: :param layer1_units: :param layer2_units: :param layer3_units:""" <|body_0|> def fo...
stack_v2_sparse_classes_75kplus_train_073994
975
no_license
[ { "docstring": "MLP model for agent :param state_size: :param action_size: :param seed: :param layer1_units: :param layer2_units: :param layer3_units:", "name": "__init__", "signature": "def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100)" }, { ...
2
stack_v2_sparse_classes_30k_train_037967
Implement the Python class `MLPNetwork` described below. Class description: Implement the MLPNetwork class. Method signatures and docstrings: - def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100): MLP model for agent :param state_size: :param action_size: :param see...
Implement the Python class `MLPNetwork` described below. Class description: Implement the MLPNetwork class. Method signatures and docstrings: - def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100): MLP model for agent :param state_size: :param action_size: :param see...
21ceb0d5fe143848f0b58f8f92e455faf5013154
<|skeleton|> class MLPNetwork: def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100): """MLP model for agent :param state_size: :param action_size: :param seed: :param layer1_units: :param layer2_units: :param layer3_units:""" <|body_0|> def fo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MLPNetwork: def __init__(self, state_size, action_size, seed, layer1_units=100, layer2_units=100, layer3_units=100): """MLP model for agent :param state_size: :param action_size: :param seed: :param layer1_units: :param layer2_units: :param layer3_units:""" super().__init__() self.seed...
the_stack_v2_python_sparse
src/agents/models/nn_model.py
ylcoldplayer/bidding
train
1
e3061201e1f5ca147839c1d508a14d9f2fb8156f
[ "super(Compressor, self).__init__()\nself.hidden_size = hidden_size\nconv = functools.partial(tf.keras.layers.Conv2D, padding='SAME', activation=tf.nn.leaky_relu)\nself.conv1 = conv(256, 3, 2)\nself.conv2 = conv(256, 3, 2)\nself.conv3 = conv(256, 3, 2)\nself.conv4 = conv(hidden_size, 8, padding='VALID')", "image_...
<|body_start_0|> super(Compressor, self).__init__() self.hidden_size = hidden_size conv = functools.partial(tf.keras.layers.Conv2D, padding='SAME', activation=tf.nn.leaky_relu) self.conv1 = conv(256, 3, 2) self.conv2 = conv(256, 3, 2) self.conv3 = conv(256, 3, 2) ...
Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder.
Compressor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Compressor: """Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder.""" def __init__(self, hidden_size): """Con...
stack_v2_sparse_classes_75kplus_train_073995
40,214
permissive
[ { "docstring": "Constructs a convolutional compressor. This model takes as input `x_{1:T}` and outputs an intermediate representation for use in downstream probabilistic encoders. Args: hidden_size: Dimensionality of the intermediate representations.", "name": "__init__", "signature": "def __init__(self...
2
null
Implement the Python class `Compressor` described below. Class description: Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder. Method signatur...
Implement the Python class `Compressor` described below. Class description: Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder. Method signatur...
8f727353954cea1199e5c59e2019f018a3da6601
<|skeleton|> class Compressor: """Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder.""" def __init__(self, hidden_size): """Con...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Compressor: """Feature extractor. This convolutional model aims to extract features corresponding to a sequence of image frames for use in downstream probabilistic encoders. The architecture is symmetric to that of the convolutional decoder.""" def __init__(self, hidden_size): """Constructs a con...
the_stack_v2_python_sparse
indl/old_reference/disentangled_vae_sprites.py
SachsLab/indl
train
0
ab3006fe41b68bdecd862b9fad7e15178d645949
[ "seq = []\n\ndef pre_order_traversal(root):\n if not root:\n seq.append('#')\n return\n seq.append(str(root.val))\n pre_order_traversal(root.left)\n pre_order_traversal(root.right)\npre_order_traversal(root)\nreturn ' '.join(seq)", "seq = data.split()\nvals = iter(seq)\n\ndef build_tree(...
<|body_start_0|> seq = [] def pre_order_traversal(root): if not root: seq.append('#') return seq.append(str(root.val)) pre_order_traversal(root.left) pre_order_traversal(root.right) pre_order_traversal(root) ...
Codec3
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec3: 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_75kplus_train_073996
5,549
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 `Codec3` described below. Class description: Implement the Codec3 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 :rtyp...
Implement the Python class `Codec3` described below. Class description: Implement the Codec3 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 :rtyp...
052bd7915257679877dbe55b60ed1abb7528eaa2
<|skeleton|> class Codec3: 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_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec3: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" seq = [] def pre_order_traversal(root): if not root: seq.append('#') return seq.append(str(root.val)) pre_or...
the_stack_v2_python_sparse
python_solution/Tree/297_SerializeAndDeserializeBinaryTree.py
Dimen61/leetcode
train
4
95cd16cff31facdfaa49c1cc3e68f83b0ddd4db7
[ "self.myClick(self.find_uiautomator(self.get_mtz_name(), 'text'))\nself.boolean_login_state()\nself.login_by_sms(self.localReadConfig().getMobileInfo('mobile1'))\nself.swipe_to_down(2)\nself.myClick(self.find_element('个人中心', *self.iv_my_icon_id))\nself.assertEqual(self.find_element('个人中心title', *self.personal_info)...
<|body_start_0|> self.myClick(self.find_uiautomator(self.get_mtz_name(), 'text')) self.boolean_login_state() self.login_by_sms(self.localReadConfig().getMobileInfo('mobile1')) self.swipe_to_down(2) self.myClick(self.find_element('个人中心', *self.iv_my_icon_id)) self.assertEq...
Test_login_by_sms
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_login_by_sms: def test_sms(self): """使用验证码登录并且退出登录""" <|body_0|> def test_sms_error(self): """验证码输入错误""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.myClick(self.find_uiautomator(self.get_mtz_name(), 'text')) self.boolean_login_st...
stack_v2_sparse_classes_75kplus_train_073997
1,409
no_license
[ { "docstring": "使用验证码登录并且退出登录", "name": "test_sms", "signature": "def test_sms(self)" }, { "docstring": "验证码输入错误", "name": "test_sms_error", "signature": "def test_sms_error(self)" } ]
2
stack_v2_sparse_classes_30k_train_003969
Implement the Python class `Test_login_by_sms` described below. Class description: Implement the Test_login_by_sms class. Method signatures and docstrings: - def test_sms(self): 使用验证码登录并且退出登录 - def test_sms_error(self): 验证码输入错误
Implement the Python class `Test_login_by_sms` described below. Class description: Implement the Test_login_by_sms class. Method signatures and docstrings: - def test_sms(self): 使用验证码登录并且退出登录 - def test_sms_error(self): 验证码输入错误 <|skeleton|> class Test_login_by_sms: def test_sms(self): """使用验证码登录并且退出登录""...
b2066139eb0723eff69d971589b283b4b776c84c
<|skeleton|> class Test_login_by_sms: def test_sms(self): """使用验证码登录并且退出登录""" <|body_0|> def test_sms_error(self): """验证码输入错误""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Test_login_by_sms: def test_sms(self): """使用验证码登录并且退出登录""" self.myClick(self.find_uiautomator(self.get_mtz_name(), 'text')) self.boolean_login_state() self.login_by_sms(self.localReadConfig().getMobileInfo('mobile1')) self.swipe_to_down(2) self.myClick(self.find...
the_stack_v2_python_sparse
TestCase/4_5/TC_login/test_login_by_sms.py
testerSunshine/auto_md
train
4
e6c8d87e6c8ab4dce9d142bc1f530ef7e4c1e6e7
[ "pygame.init()\nself.screen_width = 1200\nself.screen_height = 800\nself.screen = pygame.display.set_mode((self.screen_width, self.screen_height))\npygame.display.set_caption('Star Field')\nself.bg_color = (0, 0, 0)\nself.stars = pygame.sprite.Group()\nself._creat_starfield()", "star = Star(self)\nstar_width, sta...
<|body_start_0|> pygame.init() self.screen_width = 1200 self.screen_height = 800 self.screen = pygame.display.set_mode((self.screen_width, self.screen_height)) pygame.display.set_caption('Star Field') self.bg_color = (0, 0, 0) self.stars = pygame.sprite.Group() ...
Overall class for a star field.
StarField
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StarField: """Overall class for a star field.""" def __init__(self): """Initialize the game and background resources.""" <|body_0|> def _creat_starfield(self): """Create a field of stars.""" <|body_1|> def _creat_star(self, star_number, row_number): ...
stack_v2_sparse_classes_75kplus_train_073998
2,457
no_license
[ { "docstring": "Initialize the game and background resources.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Create a field of stars.", "name": "_creat_starfield", "signature": "def _creat_starfield(self)" }, { "docstring": "Create a star and place in ...
4
stack_v2_sparse_classes_30k_train_054602
Implement the Python class `StarField` described below. Class description: Overall class for a star field. Method signatures and docstrings: - def __init__(self): Initialize the game and background resources. - def _creat_starfield(self): Create a field of stars. - def _creat_star(self, star_number, row_number): Crea...
Implement the Python class `StarField` described below. Class description: Overall class for a star field. Method signatures and docstrings: - def __init__(self): Initialize the game and background resources. - def _creat_starfield(self): Create a field of stars. - def _creat_star(self, star_number, row_number): Crea...
de8b257c1d69eb2a71dd95114f5f7adf58e00a53
<|skeleton|> class StarField: """Overall class for a star field.""" def __init__(self): """Initialize the game and background resources.""" <|body_0|> def _creat_starfield(self): """Create a field of stars.""" <|body_1|> def _creat_star(self, star_number, row_number): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class StarField: """Overall class for a star field.""" def __init__(self): """Initialize the game and background resources.""" pygame.init() self.screen_width = 1200 self.screen_height = 800 self.screen = pygame.display.set_mode((self.screen_width, self.screen_height)) ...
the_stack_v2_python_sparse
ch12_tryityourslef/stars.py
thewchan/python_crash_course
train
0
a36dc2e0645ab9f77162c1f386572ee23bd06ed7
[ "p = head\nwhile p:\n if p.next and p.val == p.next.val:\n p.next = p.next.next\n p = p.next\nreturn head", "pre, pre.next = (ListNode(0), head)\npl, pr = (pre, head)\nwhile pr:\n if pr.next and pr.next.val == pr.val:\n tmp = pr.val\n while pr and pr.val == tmp:\n pr = pr....
<|body_start_0|> p = head while p: if p.next and p.val == p.next.val: p.next = p.next.next p = p.next return head <|end_body_0|> <|body_start_1|> pre, pre.next = (ListNode(0), head) pl, pr = (pre, head) while pr: if pr....
Solution83
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution83: def deleteDuplicates(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def deleteDuplicates82(self, head): """:type head: ListNode :rtype: ListNode""" <|body_1|> <|end_skeleton|> <|body_start_0|> p = head while ...
stack_v2_sparse_classes_75kplus_train_073999
3,101
no_license
[ { "docstring": ":type head: ListNode :rtype: ListNode", "name": "deleteDuplicates", "signature": "def deleteDuplicates(self, head)" }, { "docstring": ":type head: ListNode :rtype: ListNode", "name": "deleteDuplicates82", "signature": "def deleteDuplicates82(self, head)" } ]
2
stack_v2_sparse_classes_30k_train_027631
Implement the Python class `Solution83` described below. Class description: Implement the Solution83 class. Method signatures and docstrings: - def deleteDuplicates(self, head): :type head: ListNode :rtype: ListNode - def deleteDuplicates82(self, head): :type head: ListNode :rtype: ListNode
Implement the Python class `Solution83` described below. Class description: Implement the Solution83 class. Method signatures and docstrings: - def deleteDuplicates(self, head): :type head: ListNode :rtype: ListNode - def deleteDuplicates82(self, head): :type head: ListNode :rtype: ListNode <|skeleton|> class Soluti...
fcf79f4f7354454a28b60ef3c845dd6defddbf42
<|skeleton|> class Solution83: def deleteDuplicates(self, head): """:type head: ListNode :rtype: ListNode""" <|body_0|> def deleteDuplicates82(self, head): """:type head: ListNode :rtype: ListNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution83: def deleteDuplicates(self, head): """:type head: ListNode :rtype: ListNode""" p = head while p: if p.next and p.val == p.next.val: p.next = p.next.next p = p.next return head def deleteDuplicates82(self, head): ""...
the_stack_v2_python_sparse
python_data_structure/python_List/leetcode.py
liunlll/LiuLeetCode
train
0