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
d45debe8a56d3dc2a51a91d08b4fde7ff48817ea
[ "for paper_id in fragment.split():\n try:\n paper_id, dummy, categories = self._parse_entry(paper_id)\n except AssertionError:\n warnings.warn(f'Failed parsing new (new style): {paper_id}')\n continue\n for category in categories:\n try:\n yield (Identifier(paper_id),...
<|body_start_0|> for paper_id in fragment.split(): try: paper_id, dummy, categories = self._parse_entry(paper_id) except AssertionError: warnings.warn(f'Failed parsing new (new style): {paper_id}') continue for category in categ...
Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are preserved, but within each section are entries for e-prints from all archives.
NewStyleLineParser
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NewStyleLineParser: """Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are preserved, but within each section are entr...
stack_v2_sparse_classes_75kplus_train_065900
23,697
permissive
[ { "docstring": "Parse entries for new e-prints. Parameters ---------- archive : str Literally just ``\"arxiv\"``; this is a dummy place-holder, since new-style lines contain entries for all archives for which announcements occurred on a particular day. fragment : str Section of the line containing new e-print e...
4
stack_v2_sparse_classes_30k_train_011749
Implement the Python class `NewStyleLineParser` described below. Class description: Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are pres...
Implement the Python class `NewStyleLineParser` described below. Class description: Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are pres...
407cb0b2cef83c7f653dabdf998e797b18475b13
<|skeleton|> class NewStyleLineParser: """Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are preserved, but within each section are entr...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NewStyleLineParser: """Parses new-style daily log lines. Starting after 2007-04-02 (:const:`NEW_STYLE_CUTOVER_AFTER`), the format changed to put all announcement-related events on a given day on the same line. The three original sections of the line are preserved, but within each section are entries for e-pri...
the_stack_v2_python_sparse
arxiv/canonical/classic/daily.py
arXiv/arxiv-canonical
train
5
dbf36004be77fc1c80331e3a64a7ec8fde1ff267
[ "partname = package.next_partname('/word/header%d.xml')\ncontent_type = CT.WML_HEADER\nelement = parse_xml(cls._default_header_xml())\nreturn cls(partname, content_type, element, package)", "path = os.path.join(os.path.split(__file__)[0], '..', 'templates', 'default-header.xml')\nwith open(path, 'rb') as f:\n ...
<|body_start_0|> partname = package.next_partname('/word/header%d.xml') content_type = CT.WML_HEADER element = parse_xml(cls._default_header_xml()) return cls(partname, content_type, element, package) <|end_body_0|> <|body_start_1|> path = os.path.join(os.path.split(__file__)[0]...
Definition of a section header.
HeaderPart
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HeaderPart: """Definition of a section header.""" def new(cls, package): """Return newly created header part.""" <|body_0|> def _default_header_xml(cls): """Return bytes containing XML for a default header part.""" <|body_1|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_75kplus_train_065901
1,717
permissive
[ { "docstring": "Return newly created header part.", "name": "new", "signature": "def new(cls, package)" }, { "docstring": "Return bytes containing XML for a default header part.", "name": "_default_header_xml", "signature": "def _default_header_xml(cls)" } ]
2
stack_v2_sparse_classes_30k_train_013606
Implement the Python class `HeaderPart` described below. Class description: Definition of a section header. Method signatures and docstrings: - def new(cls, package): Return newly created header part. - def _default_header_xml(cls): Return bytes containing XML for a default header part.
Implement the Python class `HeaderPart` described below. Class description: Definition of a section header. Method signatures and docstrings: - def new(cls, package): Return newly created header part. - def _default_header_xml(cls): Return bytes containing XML for a default header part. <|skeleton|> class HeaderPart...
2bfcf6b9779bf1abd41e1bc42c27007127ddbefb
<|skeleton|> class HeaderPart: """Definition of a section header.""" def new(cls, package): """Return newly created header part.""" <|body_0|> def _default_header_xml(cls): """Return bytes containing XML for a default header part.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HeaderPart: """Definition of a section header.""" def new(cls, package): """Return newly created header part.""" partname = package.next_partname('/word/header%d.xml') content_type = CT.WML_HEADER element = parse_xml(cls._default_header_xml()) return cls(partname, ...
the_stack_v2_python_sparse
anuvaad-etl/anuvaad-extractor/file_translator/etl-file-translator/docx/parts/hdrftr.py
project-anuvaad/anuvaad
train
41
53f8244b18ef273093a100985455ca8c84da1970
[ "model = model or MEGNetModel.from_file(model_filename)\ngaussian_cutoff = kwargs.get('gaussian_cutoff', 6)\nradius_cutoff = kwargs.get('radius_cutoff', 5)\nnpass = kwargs.get('npass', 2)\nself.reconstruct = reconstruct\nweights = model.get_weights()\nself.embedding = weights[0]\nif reconstruct:\n cg = CrystalGr...
<|body_start_0|> model = model or MEGNetModel.from_file(model_filename) gaussian_cutoff = kwargs.get('gaussian_cutoff', 6) radius_cutoff = kwargs.get('radius_cutoff', 5) npass = kwargs.get('npass', 2) self.reconstruct = reconstruct weights = model.get_weights() se...
MEGNetModel wrapper.
MEGNet
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MEGNet: """MEGNetModel wrapper.""" def __init__(self, model=None, reconstruct=False, **kwargs): """Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs:""" <|body_0|> def predict_energy(self, structure: Struct...
stack_v2_sparse_classes_75kplus_train_065902
3,050
permissive
[ { "docstring": "Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs:", "name": "__init__", "signature": "def __init__(self, model=None, reconstruct=False, **kwargs)" }, { "docstring": "Predict energy from structure Args: structure: (...
2
stack_v2_sparse_classes_30k_train_011484
Implement the Python class `MEGNet` described below. Class description: MEGNetModel wrapper. Method signatures and docstrings: - def __init__(self, model=None, reconstruct=False, **kwargs): Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs: - def predic...
Implement the Python class `MEGNet` described below. Class description: MEGNetModel wrapper. Method signatures and docstrings: - def __init__(self, model=None, reconstruct=False, **kwargs): Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs: - def predic...
6ae3c7029b939e1183684358a3ae2fef41053be5
<|skeleton|> class MEGNet: """MEGNetModel wrapper.""" def __init__(self, model=None, reconstruct=False, **kwargs): """Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs:""" <|body_0|> def predict_energy(self, structure: Struct...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MEGNet: """MEGNetModel wrapper.""" def __init__(self, model=None, reconstruct=False, **kwargs): """Args: model: MEGNet energy model reconstruct: Whether to reconstruct the model (used in disordered model) **kwargs:""" model = model or MEGNetModel.from_file(model_filename) gaussian...
the_stack_v2_python_sparse
maml/apps/bowsr/model/megnet.py
materialsvirtuallab/maml
train
266
b314ba76d2652c98bad9c2506019c5095f6e603f
[ "try:\n cls.abrir_conexion()\n sql = 'SELECT idValor, fecha, valor FROM valoresTipArt WHERE idTipoArticulo = {};'.format(id)\n cls.cursor.execute(sql)\n valores = cls.cursor.fetchall()\n max_date = valores[0]\n for v in valores:\n if v[1] > max_date[1...
<|body_start_0|> try: cls.abrir_conexion() sql = 'SELECT idValor, fecha, valor FROM valoresTipArt WHERE idTipoArticulo = {};'.format(id) cls.cursor.execute(sql) valores = cls.cursor.fetchall() max_date = valores[...
DatosValor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DatosValor: def get_from_TAid(cls, id, noClose=False): """Obtiene el valor de un tipo articulo de la BD""" <|body_0|> def add(cls, idArt, fecha, valor): """Da de alta un nuevo valor de un articulo en el sistema.""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_75kplus_train_065903
1,869
no_license
[ { "docstring": "Obtiene el valor de un tipo articulo de la BD", "name": "get_from_TAid", "signature": "def get_from_TAid(cls, id, noClose=False)" }, { "docstring": "Da de alta un nuevo valor de un articulo en el sistema.", "name": "add", "signature": "def add(cls, idArt, fecha, valor)" ...
2
stack_v2_sparse_classes_30k_train_013005
Implement the Python class `DatosValor` described below. Class description: Implement the DatosValor class. Method signatures and docstrings: - def get_from_TAid(cls, id, noClose=False): Obtiene el valor de un tipo articulo de la BD - def add(cls, idArt, fecha, valor): Da de alta un nuevo valor de un articulo en el s...
Implement the Python class `DatosValor` described below. Class description: Implement the DatosValor class. Method signatures and docstrings: - def get_from_TAid(cls, id, noClose=False): Obtiene el valor de un tipo articulo de la BD - def add(cls, idArt, fecha, valor): Da de alta un nuevo valor de un articulo en el s...
57ca674dba4dabd2526c450ba7210933240f19c5
<|skeleton|> class DatosValor: def get_from_TAid(cls, id, noClose=False): """Obtiene el valor de un tipo articulo de la BD""" <|body_0|> def add(cls, idArt, fecha, valor): """Da de alta un nuevo valor de un articulo en el sistema.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DatosValor: def get_from_TAid(cls, id, noClose=False): """Obtiene el valor de un tipo articulo de la BD""" try: cls.abrir_conexion() sql = 'SELECT idValor, fecha, valor FROM valoresTipArt WHERE idTipoArticulo = {};'.format(id) ...
the_stack_v2_python_sparse
data/data_valor.py
JoaquinCardonaRuiz/proyecto-final
train
0
11b66ac9b813ef1f4d41b4893a16ef742bce79c2
[ "if not is_administrator(self.context['request'].user):\n raise serializers.ValidationError(constants.PERMISSION_ADMINISTRATOR_REQUIRED)\nreturn data", "if is_attendants(user):\n raise serializers.ValidationError('User already has attendants permissions')\nreturn user" ]
<|body_start_0|> if not is_administrator(self.context['request'].user): raise serializers.ValidationError(constants.PERMISSION_ADMINISTRATOR_REQUIRED) return data <|end_body_0|> <|body_start_1|> if is_attendants(user): raise serializers.ValidationError('User already has ...
AttendantSerializerCreate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AttendantSerializerCreate: def validate(self, data): """Administrator permissions needed""" <|body_0|> def validate_user(self, user): """Ensure user is not already attendant or higher""" <|body_1|> <|end_skeleton|> <|body_start_0|> if not is_adminis...
stack_v2_sparse_classes_75kplus_train_065904
1,156
no_license
[ { "docstring": "Administrator permissions needed", "name": "validate", "signature": "def validate(self, data)" }, { "docstring": "Ensure user is not already attendant or higher", "name": "validate_user", "signature": "def validate_user(self, user)" } ]
2
null
Implement the Python class `AttendantSerializerCreate` described below. Class description: Implement the AttendantSerializerCreate class. Method signatures and docstrings: - def validate(self, data): Administrator permissions needed - def validate_user(self, user): Ensure user is not already attendant or higher
Implement the Python class `AttendantSerializerCreate` described below. Class description: Implement the AttendantSerializerCreate class. Method signatures and docstrings: - def validate(self, data): Administrator permissions needed - def validate_user(self, user): Ensure user is not already attendant or higher <|sk...
d17fcc79b175831bae9c2e0a3a536a384b1a562b
<|skeleton|> class AttendantSerializerCreate: def validate(self, data): """Administrator permissions needed""" <|body_0|> def validate_user(self, user): """Ensure user is not already attendant or higher""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AttendantSerializerCreate: def validate(self, data): """Administrator permissions needed""" if not is_administrator(self.context['request'].user): raise serializers.ValidationError(constants.PERMISSION_ADMINISTRATOR_REQUIRED) return data def validate_user(self, user): ...
the_stack_v2_python_sparse
app/users/serializers/attendants.py
Empire-Synergy-Solutions/Altaviz_Backend
train
0
a517c275124d88153efbcb7f91030161519aae0e
[ "x_headers = 'x-ms-date:' + date\nstring_to_hash = method + '\\n' + str(content_length) + '\\n' + content_type + '\\n' + x_headers + '\\n' + resource\nbytes_to_hash = bytes(string_to_hash, encoding='utf-8')\ndecoded_key = base64.b64decode(shared_key)\nencoded_hash = base64.b64encode(hmac.new(decoded_key, bytes_to_h...
<|body_start_0|> x_headers = 'x-ms-date:' + date string_to_hash = method + '\n' + str(content_length) + '\n' + content_type + '\n' + x_headers + '\n' + resource bytes_to_hash = bytes(string_to_hash, encoding='utf-8') decoded_key = base64.b64decode(shared_key) encoded_hash = base6...
AzureSentinel is Used to post data to log analytics.
AzureSentinel
[ "MIT", "LicenseRef-scancode-generic-cla" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AzureSentinel: """AzureSentinel is Used to post data to log analytics.""" def build_signature(self, date, content_length, method, content_type, resource): """To build the signature.""" <|body_0|> def post_data(self, customer_id, body, log_type): """Build and send...
stack_v2_sparse_classes_75kplus_train_065905
7,907
permissive
[ { "docstring": "To build the signature.", "name": "build_signature", "signature": "def build_signature(self, date, content_length, method, content_type, resource)" }, { "docstring": "Build and send a request to the POST API.", "name": "post_data", "signature": "def post_data(self, custom...
2
stack_v2_sparse_classes_30k_val_002579
Implement the Python class `AzureSentinel` described below. Class description: AzureSentinel is Used to post data to log analytics. Method signatures and docstrings: - def build_signature(self, date, content_length, method, content_type, resource): To build the signature. - def post_data(self, customer_id, body, log_...
Implement the Python class `AzureSentinel` described below. Class description: AzureSentinel is Used to post data to log analytics. Method signatures and docstrings: - def build_signature(self, date, content_length, method, content_type, resource): To build the signature. - def post_data(self, customer_id, body, log_...
4536a3f6b9bdef902312b3d96f9c2e66b8bf52c1
<|skeleton|> class AzureSentinel: """AzureSentinel is Used to post data to log analytics.""" def build_signature(self, date, content_length, method, content_type, resource): """To build the signature.""" <|body_0|> def post_data(self, customer_id, body, log_type): """Build and send...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AzureSentinel: """AzureSentinel is Used to post data to log analytics.""" def build_signature(self, date, content_length, method, content_type, resource): """To build the signature.""" x_headers = 'x-ms-date:' + date string_to_hash = method + '\n' + str(content_length) + '\n' + co...
the_stack_v2_python_sparse
Solutions/SecurityScorecard Cybersecurity Ratings/Data Connectors/SecurityScorecardIssue/SecurityScorecardIssueSentinelConnector/writers.py
Azure/Azure-Sentinel
train
3,697
da4b0c4c9bdb0fd012ca268a1a2b37051b7592ae
[ "unlabelled = self.labels.mask.nonzero()[0]\nif len(unlabelled):\n index = numpy.random.choice(unlabelled)\n return index\nreturn 0", "indices = set()\nunlabelled = self.labels.mask.nonzero()[0]\nif len(unlabelled) < n:\n return unlabelled\nwhile len(indices) < n:\n index = numpy.random.choice(unlabel...
<|body_start_0|> unlabelled = self.labels.mask.nonzero()[0] if len(unlabelled): index = numpy.random.choice(unlabelled) return index return 0 <|end_body_0|> <|body_start_1|> indices = set() unlabelled = self.labels.mask.nonzero()[0] if len(unlabel...
Pool-based learning with random sampling.
RandomSampler
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomSampler: """Pool-based learning with random sampling.""" def sample_index(self): """Finds index of a random unlabelled point.""" <|body_0|> def sample_indices(self, n): """Finds indices of n random unlabelled points.""" <|body_1|> <|end_skeleton|> ...
stack_v2_sparse_classes_75kplus_train_065906
2,413
permissive
[ { "docstring": "Finds index of a random unlabelled point.", "name": "sample_index", "signature": "def sample_index(self)" }, { "docstring": "Finds indices of n random unlabelled points.", "name": "sample_indices", "signature": "def sample_indices(self, n)" } ]
2
stack_v2_sparse_classes_30k_train_037359
Implement the Python class `RandomSampler` described below. Class description: Pool-based learning with random sampling. Method signatures and docstrings: - def sample_index(self): Finds index of a random unlabelled point. - def sample_indices(self, n): Finds indices of n random unlabelled points.
Implement the Python class `RandomSampler` described below. Class description: Pool-based learning with random sampling. Method signatures and docstrings: - def sample_index(self): Finds index of a random unlabelled point. - def sample_indices(self, n): Finds indices of n random unlabelled points. <|skeleton|> class...
ce14432c36de0574b73d813304365b74446a61f8
<|skeleton|> class RandomSampler: """Pool-based learning with random sampling.""" def sample_index(self): """Finds index of a random unlabelled point.""" <|body_0|> def sample_indices(self, n): """Finds indices of n random unlabelled points.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RandomSampler: """Pool-based learning with random sampling.""" def sample_index(self): """Finds index of a random unlabelled point.""" unlabelled = self.labels.mask.nonzero()[0] if len(unlabelled): index = numpy.random.choice(unlabelled) return index ...
the_stack_v2_python_sparse
crowdastro/active_learning/random_sampler.py
vishalbelsare/crowdastro
train
0
0ddbf94e467228697a54fbf0a4349c5c6bf9ad6f
[ "self.conf = {}\nself.ini = ini_file\nself.verbose = verbose\nself.load_config()", "parser = SafeConfigParser()\nparser.read(self.ini, encoding='utf-8')\nfor section_name in parser.sections():\n self.conf[section_name] = {}\n for key, value in parser.items(section_name):\n self.conf[section_name][key...
<|body_start_0|> self.conf = {} self.ini = ini_file self.verbose = verbose self.load_config() <|end_body_0|> <|body_start_1|> parser = SafeConfigParser() parser.read(self.ini, encoding='utf-8') for section_name in parser.sections(): self.conf[section_...
Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé.
MyConfig
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyConfig: """Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé.""" def __init__(self, ini_file, verbose=1): """Charge la config depuis un fichier *.ini Le chemin d...
stack_v2_sparse_classes_75kplus_train_065907
2,213
no_license
[ { "docstring": "Charge la config depuis un fichier *.ini Le chemin devrait être donné avec son chemin absolu.", "name": "__init__", "signature": "def __init__(self, ini_file, verbose=1)" }, { "docstring": "Lit le fichier *.ini, et copie la config dans un dictionnaire.", "name": "load_config"...
3
null
Implement the Python class `MyConfig` described below. Class description: Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé. Method signatures and docstrings: - def __init__(self, ini_file, verbose...
Implement the Python class `MyConfig` described below. Class description: Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé. Method signatures and docstrings: - def __init__(self, ini_file, verbose...
b931caf107457aea4caea2b0ce821e981d19bd79
<|skeleton|> class MyConfig: """Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé.""" def __init__(self, ini_file, verbose=1): """Charge la config depuis un fichier *.ini Le chemin d...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class MyConfig: """Class de gestion d'une configuration: Charge la configuration depuis le fichier *.ini, sauve les changements de configuration, enregistre les changements par section, clé.""" def __init__(self, ini_file, verbose=1): """Charge la config depuis un fichier *.ini Le chemin devrait être d...
the_stack_v2_python_sparse
py_9_divers/py_80_exo_class_bad/py_84_config/py_84_config_response.py
sergeLabo/formation_python
train
0
d397b6a6f9d2486960f255425febc1717c95e09b
[ "conflict = fake_conflict('fool\\nbar\\neggs\\n', 'foo\\nbar\\neggs\\n', 'foo\\nbaz\\negg\\n')\nhandle_conflict(conflict)\nself.assertTrue(conflict.is_resolved())\nself.assertEqual(conflict.content, 'fool\\nbaz\\negg\\n')", "conflict = fake_conflict('fool\\nbar\\neggs\\nspam\\n', 'foo\\nbar\\neggs\\n', 'foo\\nbaz...
<|body_start_0|> conflict = fake_conflict('fool\nbar\neggs\n', 'foo\nbar\neggs\n', 'foo\nbaz\negg\n') handle_conflict(conflict) self.assertTrue(conflict.is_resolved()) self.assertEqual(conflict.content, 'fool\nbaz\negg\n') <|end_body_0|> <|body_start_1|> conflict = fake_conflict...
SolverTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SolverTest: def test_simple(self): """Test a conflict with woven changes""" <|body_0|> def test_not_woven_1(self): """Test a conflict with woven changes + additions""" <|body_1|> def test_not_woven_2(self): """Test a conflict with woven changes +...
stack_v2_sparse_classes_75kplus_train_065908
2,887
permissive
[ { "docstring": "Test a conflict with woven changes", "name": "test_simple", "signature": "def test_simple(self)" }, { "docstring": "Test a conflict with woven changes + additions", "name": "test_not_woven_1", "signature": "def test_not_woven_1(self)" }, { "docstring": "Test a con...
6
stack_v2_sparse_classes_30k_val_002367
Implement the Python class `SolverTest` described below. Class description: Implement the SolverTest class. Method signatures and docstrings: - def test_simple(self): Test a conflict with woven changes - def test_not_woven_1(self): Test a conflict with woven changes + additions - def test_not_woven_2(self): Test a co...
Implement the Python class `SolverTest` described below. Class description: Implement the SolverTest class. Method signatures and docstrings: - def test_simple(self): Test a conflict with woven changes - def test_not_woven_1(self): Test a conflict with woven changes + additions - def test_not_woven_2(self): Test a co...
81ef5e9636f264221b8f8b6f6aaf4cfb5b6a79b6
<|skeleton|> class SolverTest: def test_simple(self): """Test a conflict with woven changes""" <|body_0|> def test_not_woven_1(self): """Test a conflict with woven changes + additions""" <|body_1|> def test_not_woven_2(self): """Test a conflict with woven changes +...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SolverTest: def test_simple(self): """Test a conflict with woven changes""" conflict = fake_conflict('fool\nbar\neggs\n', 'foo\nbar\neggs\n', 'foo\nbaz\negg\n') handle_conflict(conflict) self.assertTrue(conflict.is_resolved()) self.assertEqual(conflict.content, 'fool\nb...
the_stack_v2_python_sparse
_gen_woven_test.py
clmoreno/AutoMergeTool
train
1
e8673af90874393be570446b34e7178597effd77
[ "cutoffs = sorted(cutoffs)\nnum_groups = len(cutoffs)\nif i <= cutoffs[0]:\n return '小于等于{}'.format(cutoffs[0])\nelif i > cutoffs[-1]:\n return '大于{}'.format(cutoffs[-1])\nelse:\n for j in range(1, num_groups):\n if cutoffs[j - 1] < i <= cutoffs[j]:\n return '大于%s小于等于%s' % (cutoffs[j - 1]...
<|body_start_0|> cutoffs = sorted(cutoffs) num_groups = len(cutoffs) if i <= cutoffs[0]: return '小于等于{}'.format(cutoffs[0]) elif i > cutoffs[-1]: return '大于{}'.format(cutoffs[-1]) else: for j in range(1, num_groups): if cutoffs[...
1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace)
Value2Group
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Value2Group: """1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace)""" def value2group(self, i, cutoffs): """Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别""" <|body_0|> def group_add_df(self, df, var, cutoffs, new_var, inplace): ...
stack_v2_sparse_classes_75kplus_train_065909
9,326
no_license
[ { "docstring": "Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别", "name": "value2group", "signature": "def value2group(self, i, cutoffs)" }, { "docstring": "对某个变量进行分组处理 Args: df: 待分组的数据框 var: 待分组的变量名 cutoffs: 分组的切分点 new_var: 分组后的变量名 inplace: 是否删除原变量 Returns: 分组后的数据框", "name": "group_add_...
2
null
Implement the Python class `Value2Group` described below. Class description: 1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace) Method signatures and docstrings: - def value2group(self, i, cutoffs): Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别 - def group_add_df(self, df, var,...
Implement the Python class `Value2Group` described below. Class description: 1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace) Method signatures and docstrings: - def value2group(self, i, cutoffs): Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别 - def group_add_df(self, df, var,...
cc25cb60f1c1c89b4591bbdaec8db1eeba818377
<|skeleton|> class Value2Group: """1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace)""" def value2group(self, i, cutoffs): """Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别""" <|body_0|> def group_add_df(self, df, var, cutoffs, new_var, inplace): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Value2Group: """1. value2group(self, x, cutoffs) 2. group_add_df(self, df, X, cutoffs, var, inplace)""" def value2group(self, i, cutoffs): """Args: i:某个待分组的元素 cutoffs: 切分点的列表 Returns: 这个元素对应的组别""" cutoffs = sorted(cutoffs) num_groups = len(cutoffs) if i <= cutoffs[0]: ...
the_stack_v2_python_sparse
bus_drop/loans_drop/feature_engineering/autobin.py
xeon-ye/dgg-pro
train
0
08d6d950974a21c19ecf1ae273ee63ceb2f47534
[ "stdout, stderr = self.redirect_streams(lambda: show.list_files([]))\nself.assertEqual(stdout, pathlist(FILES))\nself.assertEqual(stderr, '')", "stdout, stderr = self.redirect_streams(lambda: show.list_files(['']))\nself.assertEqual(stdout, pathlist(FILES))\nself.assertEqual(stderr, '')", "stdout, stderr = self...
<|body_start_0|> stdout, stderr = self.redirect_streams(lambda: show.list_files([])) self.assertEqual(stdout, pathlist(FILES)) self.assertEqual(stderr, '') <|end_body_0|> <|body_start_1|> stdout, stderr = self.redirect_streams(lambda: show.list_files([''])) self.assertEqual(stdo...
Basic tests of list_files
TestListFiles
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestListFiles: """Basic tests of list_files""" def test_list_files_empty_list(self): """an empty list in should list all files""" <|body_0|> def test_list_files_empty_string(self): """an empty string in should list all files""" <|body_1|> def test_li...
stack_v2_sparse_classes_75kplus_train_065910
5,423
no_license
[ { "docstring": "an empty list in should list all files", "name": "test_list_files_empty_list", "signature": "def test_list_files_empty_list(self)" }, { "docstring": "an empty string in should list all files", "name": "test_list_files_empty_string", "signature": "def test_list_files_empty...
4
stack_v2_sparse_classes_30k_train_023186
Implement the Python class `TestListFiles` described below. Class description: Basic tests of list_files Method signatures and docstrings: - def test_list_files_empty_list(self): an empty list in should list all files - def test_list_files_empty_string(self): an empty string in should list all files - def test_list_f...
Implement the Python class `TestListFiles` described below. Class description: Basic tests of list_files Method signatures and docstrings: - def test_list_files_empty_list(self): an empty list in should list all files - def test_list_files_empty_string(self): an empty string in should list all files - def test_list_f...
539868dab2041b7694c0d53e8e74cf1b5b033653
<|skeleton|> class TestListFiles: """Basic tests of list_files""" def test_list_files_empty_list(self): """an empty list in should list all files""" <|body_0|> def test_list_files_empty_string(self): """an empty string in should list all files""" <|body_1|> def test_li...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestListFiles: """Basic tests of list_files""" def test_list_files_empty_list(self): """an empty list in should list all files""" stdout, stderr = self.redirect_streams(lambda: show.list_files([])) self.assertEqual(stdout, pathlist(FILES)) self.assertEqual(stderr, '') ...
the_stack_v2_python_sparse
test_igseq/test_show.py
ShawHahnLab/igseq
train
1
6e96d7de05b50715e87df5270ef3fda7390c1046
[ "while num >= 10:\n string = str(num)\n num = 0\n for i in range(len(string)):\n num += int(string[i])\nreturn num", "if num == 0:\n return 0\nelif num % 9 == 0:\n return 9\nelse:\n return num % 9" ]
<|body_start_0|> while num >= 10: string = str(num) num = 0 for i in range(len(string)): num += int(string[i]) return num <|end_body_0|> <|body_start_1|> if num == 0: return 0 elif num % 9 == 0: return 9 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def addDigits(self, num): """:type num: int :rtype: int""" <|body_0|> def addDigits2(self, num): """:type num: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> while num >= 10: string = str(num) num =...
stack_v2_sparse_classes_75kplus_train_065911
673
no_license
[ { "docstring": ":type num: int :rtype: int", "name": "addDigits", "signature": "def addDigits(self, num)" }, { "docstring": ":type num: int :rtype: int", "name": "addDigits2", "signature": "def addDigits2(self, num)" } ]
2
stack_v2_sparse_classes_30k_train_048905
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addDigits(self, num): :type num: int :rtype: int - def addDigits2(self, num): :type num: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addDigits(self, num): :type num: int :rtype: int - def addDigits2(self, num): :type num: int :rtype: int <|skeleton|> class Solution: def addDigits(self, num): ...
0fc4c7af59246e3064db41989a45d9db413a624b
<|skeleton|> class Solution: def addDigits(self, num): """:type num: int :rtype: int""" <|body_0|> def addDigits2(self, num): """:type num: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def addDigits(self, num): """:type num: int :rtype: int""" while num >= 10: string = str(num) num = 0 for i in range(len(string)): num += int(string[i]) return num def addDigits2(self, num): """:type num: int :r...
the_stack_v2_python_sparse
258. Add Digits/addDigits.py
Macielyoung/LeetCode
train
1
4a5224aa4828debaa4142235558bf35b9e75e097
[ "sdram = SDRAMResource(128 * 2 ** 20)\nself.assertEqual(sdram.get_value(), 128 * 2 ** 20)\nsdram = SDRAMResource(128 * 2 ** 19)\nself.assertEqual(sdram.get_value(), 128 * 2 ** 19)\nsdram = SDRAMResource(128 * 2 ** 21)\nself.assertEqual(sdram.get_value(), 128 * 2 ** 21)", "dtcm = DTCMResource(128 * 2 ** 20)\nself....
<|body_start_0|> sdram = SDRAMResource(128 * 2 ** 20) self.assertEqual(sdram.get_value(), 128 * 2 ** 20) sdram = SDRAMResource(128 * 2 ** 19) self.assertEqual(sdram.get_value(), 128 * 2 ** 19) sdram = SDRAMResource(128 * 2 ** 21) self.assertEqual(sdram.get_value(), 128 * ...
unit tests on the resources object
TestResourceModels
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestResourceModels: """unit tests on the resources object""" def test_sdram(self): """test that adding a sdram resource to a resoruce container works correctly :return:""" <|body_0|> def test_dtcm(self): """test that adding a dtcm resource to a resoruce container...
stack_v2_sparse_classes_75kplus_train_065912
3,274
no_license
[ { "docstring": "test that adding a sdram resource to a resoruce container works correctly :return:", "name": "test_sdram", "signature": "def test_sdram(self)" }, { "docstring": "test that adding a dtcm resource to a resoruce container works correctly :return:", "name": "test_dtcm", "sign...
4
stack_v2_sparse_classes_30k_val_001385
Implement the Python class `TestResourceModels` described below. Class description: unit tests on the resources object Method signatures and docstrings: - def test_sdram(self): test that adding a sdram resource to a resoruce container works correctly :return: - def test_dtcm(self): test that adding a dtcm resource to...
Implement the Python class `TestResourceModels` described below. Class description: unit tests on the resources object Method signatures and docstrings: - def test_sdram(self): test that adding a sdram resource to a resoruce container works correctly :return: - def test_dtcm(self): test that adding a dtcm resource to...
5c2faba4d823e9341e5c18f61ea9bf8c6e15b687
<|skeleton|> class TestResourceModels: """unit tests on the resources object""" def test_sdram(self): """test that adding a sdram resource to a resoruce container works correctly :return:""" <|body_0|> def test_dtcm(self): """test that adding a dtcm resource to a resoruce container...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestResourceModels: """unit tests on the resources object""" def test_sdram(self): """test that adding a sdram resource to a resoruce container works correctly :return:""" sdram = SDRAMResource(128 * 2 ** 20) self.assertEqual(sdram.get_value(), 128 * 2 ** 20) sdram = SDRAM...
the_stack_v2_python_sparse
unittests/model_tests/resources_tests/test_resources_model.py
kfriesth/PACMAN
train
0
879c388195df8a5db2c433a6f31f6c3783e9f86d
[ "super(ConvNet, self).__init__(torch_ref=torch_ref)\nself.conv1 = self.torch_ref.nn.Conv2d(in_channels=1, out_channels=5, kernel_size=5)\nself.fc1 = self.torch_ref.nn.Linear(2880, 10)\nself.fc2 = self.torch_ref.nn.Linear(10, 5)", "x = self.conv1(x)\nx = self.torch_ref.nn.functional.relu(x)\nx = x.view(1, -1)\nx =...
<|body_start_0|> super(ConvNet, self).__init__(torch_ref=torch_ref) self.conv1 = self.torch_ref.nn.Conv2d(in_channels=1, out_channels=5, kernel_size=5) self.fc1 = self.torch_ref.nn.Linear(2880, 10) self.fc2 = self.torch_ref.nn.Linear(10, 5) <|end_body_0|> <|body_start_1|> x = se...
Simple convolutional network.
ConvNet
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConvNet: """Simple convolutional network.""" def __init__(self, torch_ref): """Initialize convolutional network. Arguments: torch_ref: Reference to the torch library""" <|body_0|> def forward(self, x): """Do a feedforward through the layer. Args: x (MPCTensor): t...
stack_v2_sparse_classes_75kplus_train_065913
2,433
permissive
[ { "docstring": "Initialize convolutional network. Arguments: torch_ref: Reference to the torch library", "name": "__init__", "signature": "def __init__(self, torch_ref)" }, { "docstring": "Do a feedforward through the layer. Args: x (MPCTensor): the input Returns: An MPCTensor representing the l...
2
stack_v2_sparse_classes_30k_test_002332
Implement the Python class `ConvNet` described below. Class description: Simple convolutional network. Method signatures and docstrings: - def __init__(self, torch_ref): Initialize convolutional network. Arguments: torch_ref: Reference to the torch library - def forward(self, x): Do a feedforward through the layer. A...
Implement the Python class `ConvNet` described below. Class description: Simple convolutional network. Method signatures and docstrings: - def __init__(self, torch_ref): Initialize convolutional network. Arguments: torch_ref: Reference to the torch library - def forward(self, x): Do a feedforward through the layer. A...
ee6ac74050acd03c3088104855d0b8e4ab3e03fa
<|skeleton|> class ConvNet: """Simple convolutional network.""" def __init__(self, torch_ref): """Initialize convolutional network. Arguments: torch_ref: Reference to the torch library""" <|body_0|> def forward(self, x): """Do a feedforward through the layer. Args: x (MPCTensor): t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ConvNet: """Simple convolutional network.""" def __init__(self, torch_ref): """Initialize convolutional network. Arguments: torch_ref: Reference to the torch library""" super(ConvNet, self).__init__(torch_ref=torch_ref) self.conv1 = self.torch_ref.nn.Conv2d(in_channels=1, out_chan...
the_stack_v2_python_sparse
benchmarks/module/conv_model.py
shubhank-saxena/SyMPC
train
1
e9fe2c55b9826956f722e3b0e5caf5230b618fc7
[ "if not root:\n return '[]'\nlevel = [root]\nres = []\nwhile level:\n next = []\n for node in level:\n if node:\n res.append(node.val)\n if node.left:\n next.append(node.left)\n else:\n next.append(None)\n if node.right:\n ...
<|body_start_0|> if not root: return '[]' level = [root] res = [] while level: next = [] for node in level: if node: res.append(node.val) if node.left: next.append(node.lef...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_75kplus_train_065914
1,974
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
stack_v2_sparse_classes_30k_train_023044
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
0f45a05d258d7dced844c657da2362d87bee15a8
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return '[]' level = [root] res = [] while level: next = [] for node in level: if node: ...
the_stack_v2_python_sparse
297-Serialize-and-Deserialize-Binary-Tree/solution.py
zmxrice/leetcodetraining
train
0
cfd9772680a75ded54eedb6b7e4271393d03b9b1
[ "self.params = {}\nself.reg = reg\nself.dtype = dtype\nC, H, W = input_dim\nconv_stride, conv_pad = (1, int((filter_size - 1) / 2))\nconv_H = int(1 + (H + 2 * conv_pad - filter_size) / conv_stride)\nconv_W = int(1 + (W + 2 * conv_pad - filter_size) / conv_stride)\nself.params['W1'] = np.random.normal(0, weight_scal...
<|body_start_0|> self.params = {} self.reg = reg self.dtype = dtype C, H, W = input_dim conv_stride, conv_pad = (1, int((filter_size - 1) / 2)) conv_H = int(1 + (H + 2 * conv_pad - filter_size) / conv_stride) conv_W = int(1 + (W + 2 * conv_pad - filter_size) / con...
A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each with height H and width W and with C input channels.
ThreeLayerConvNet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ThreeLayerConvNet: """A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each with height H and width W and with C input...
stack_v2_sparse_classes_75kplus_train_065915
3,757
no_license
[ { "docstring": "Initialize a new network. Inputs: - input_dim: Tuple (C, H, W) giving size of input data - num_filters: Number of filters to use in the convolutional layer - filter_size: Size of filters to use in the convolutional layer - hidden_dim: Number of units to use in the fully-connected hidden layer - ...
2
null
Implement the Python class `ThreeLayerConvNet` described below. Class description: A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each wit...
Implement the Python class `ThreeLayerConvNet` described below. Class description: A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each wit...
fb69e5944f00247c1d0a7aabdf425c553baf3dc9
<|skeleton|> class ThreeLayerConvNet: """A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each with height H and width W and with C input...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ThreeLayerConvNet: """A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each with height H and width W and with C input channels."""...
the_stack_v2_python_sparse
cs231n/assignment2/cs231n/classifiers/cnn.py
bcrusu/ml
train
2
6514e19df785c7de1b3420bf7bb00e5e7e55f60f
[ "self.verbose = verbose\nself.valid_indices = valid_indices\nself.test_indices = test_indices", "num_datapoints = len(dataset)\nindices = np.arange(num_datapoints).tolist()\ntrain_indices = []\nif self.valid_indices is None:\n self.valid_indices = []\nif self.test_indices is None:\n self.test_indices = []\n...
<|body_start_0|> self.verbose = verbose self.valid_indices = valid_indices self.test_indices = test_indices <|end_body_0|> <|body_start_1|> num_datapoints = len(dataset) indices = np.arange(num_datapoints).tolist() train_indices = [] if self.valid_indices is None...
Class for splits based on input order.
IndiceSplitter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IndiceSplitter: """Class for splits based on input order.""" def __init__(self, verbose=False, valid_indices=None, test_indices=None): """Parameters ----------- valid_indices: list of int indices of samples in the valid set test_indices: list of int indices of samples in the test set...
stack_v2_sparse_classes_75kplus_train_065916
1,989
no_license
[ { "docstring": "Parameters ----------- valid_indices: list of int indices of samples in the valid set test_indices: list of int indices of samples in the test set", "name": "__init__", "signature": "def __init__(self, verbose=False, valid_indices=None, test_indices=None)" }, { "docstring": "Spli...
2
stack_v2_sparse_classes_30k_train_044017
Implement the Python class `IndiceSplitter` described below. Class description: Class for splits based on input order. Method signatures and docstrings: - def __init__(self, verbose=False, valid_indices=None, test_indices=None): Parameters ----------- valid_indices: list of int indices of samples in the valid set tes...
Implement the Python class `IndiceSplitter` described below. Class description: Class for splits based on input order. Method signatures and docstrings: - def __init__(self, verbose=False, valid_indices=None, test_indices=None): Parameters ----------- valid_indices: list of int indices of samples in the valid set tes...
57e40d04181059ca39890d22361606edfadcc930
<|skeleton|> class IndiceSplitter: """Class for splits based on input order.""" def __init__(self, verbose=False, valid_indices=None, test_indices=None): """Parameters ----------- valid_indices: list of int indices of samples in the valid set test_indices: list of int indices of samples in the test set...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class IndiceSplitter: """Class for splits based on input order.""" def __init__(self, verbose=False, valid_indices=None, test_indices=None): """Parameters ----------- valid_indices: list of int indices of samples in the valid set test_indices: list of int indices of samples in the test set""" s...
the_stack_v2_python_sparse
utils/splitter/indexsplitter.py
moguizhizi/Adaptive-Graph-Convolutional-Network
train
0
f1aec19ea3bd63dbc774b17f6d551b6c7adc45ac
[ "if len(nums) == 0:\n return 0\nt = nums[0]\nn = 0\nfor i in range(1, len(nums)):\n t, n = (n + nums[i], max(t, n))\nreturn max(t, n)", "if len(nums) == 0:\n return 0\nif len(nums) == 1:\n return nums[0]\nif len(nums) == 2:\n return max(nums)\nreturn max(self.sub_rob(nums[1:]), self.sub_rob(nums[:-...
<|body_start_0|> if len(nums) == 0: return 0 t = nums[0] n = 0 for i in range(1, len(nums)): t, n = (n + nums[i], max(t, n)) return max(t, n) <|end_body_0|> <|body_start_1|> if len(nums) == 0: return 0 if len(nums) == 1: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def sub_rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if len(nums) == 0: return 0 t = nums[...
stack_v2_sparse_classes_75kplus_train_065917
716
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "sub_rob", "signature": "def sub_rob(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "rob", "signature": "def rob(self, nums)" } ]
2
stack_v2_sparse_classes_30k_val_001052
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sub_rob(self, nums): :type nums: List[int] :rtype: int - def rob(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 sub_rob(self, nums): :type nums: List[int] :rtype: int - def rob(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def sub_rob(self, nums): ...
c9a53ef2fc1fd1fea7377c3633689fa87601dba6
<|skeleton|> class Solution: def sub_rob(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def rob(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 sub_rob(self, nums): """:type nums: List[int] :rtype: int""" if len(nums) == 0: return 0 t = nums[0] n = 0 for i in range(1, len(nums)): t, n = (n + nums[i], max(t, n)) return max(t, n) def rob(self, nums): """:...
the_stack_v2_python_sparse
leetcode213.py
yuchien302/LeetCode
train
2
e3ad00fe65376b1a8e895d3b70e28d91a817aff0
[ "features_ser = [port.serialize() for port in self.ports]\ncapabilities_ser = (OFPC_FLOW_STATS if self.cap_flow_stats else 0) | (OFPC_TABLE_STATS if self.cap_table_stats else 0) | (OFPC_PORT_STATS if self.cap_port_stats else 0) | (OFPC_STP if self.cap_stp else 0) | (OFPC_IP_REASM if self.cap_ip_reasm else 0) | (OFP...
<|body_start_0|> features_ser = [port.serialize() for port in self.ports] capabilities_ser = (OFPC_FLOW_STATS if self.cap_flow_stats else 0) | (OFPC_TABLE_STATS if self.cap_table_stats else 0) | (OFPC_PORT_STATS if self.cap_port_stats else 0) | (OFPC_STP if self.cap_stp else 0) | (OFPC_IP_REASM if self....
The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the datapath. cap_*: Boolean flags indicating each the support of not of a capability: c...
SwitchFeatures
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SwitchFeatures: """The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the datapath. cap_*: Boolean flags indicating ...
stack_v2_sparse_classes_75kplus_train_065918
22,976
permissive
[ { "docstring": "Serialize this object into an OpenFlow ofp_switch_features. The returned string can be passed to deserialize() to recreate a copy of this object. Returns: A new list of binary strings that is a serialized form of this object into an OpenFlow ofp_switch_features. The ofp_header structure is not i...
2
stack_v2_sparse_classes_30k_train_046165
Implement the Python class `SwitchFeatures` described below. Class description: The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the dat...
Implement the Python class `SwitchFeatures` described below. Class description: The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the dat...
4ef1783fc74320e66ee7a71576dc91511f238a81
<|skeleton|> class SwitchFeatures: """The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the datapath. cap_*: Boolean flags indicating ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SwitchFeatures: """The features of an OpenFlow switch. The attributes of a datapath are: datapath_id: The datapath's unique ID, as a binary string. n_buffers: The maximum number of packets buffered at once. n_tables: The number of tables supported by the datapath. cap_*: Boolean flags indicating each the supp...
the_stack_v2_python_sparse
src/openfaucet/ofconfig.py
bharathi26/openfaucet
train
0
004d4556399354b2e7880bd247f57814c21f3644
[ "ret = super().to_representation(instance)\nif ret.get('parameters', False):\n ret['parameters'] = json.loads(ret['parameters'])\nreturn ret", "if data.get('parameters', False):\n data['parameters'] = json.dumps(data['parameters'])\nif data.get('score_info', False):\n data['score_info'] = json.dumps(data...
<|body_start_0|> ret = super().to_representation(instance) if ret.get('parameters', False): ret['parameters'] = json.loads(ret['parameters']) return ret <|end_body_0|> <|body_start_1|> if data.get('parameters', False): data['parameters'] = json.dumps(data['parame...
Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters.
TrialSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrialSerializer: """Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters.""" def to_representation(self, instance): """Convert the serialized parameters into a real dictionary. Args: :param instance: instance to be deserialized :...
stack_v2_sparse_classes_75kplus_train_065919
5,050
no_license
[ { "docstring": "Convert the serialized parameters into a real dictionary. Args: :param instance: instance to be deserialized :return: Deserialized instance", "name": "to_representation", "signature": "def to_representation(self, instance)" }, { "docstring": "Convert the parameter dictionary into...
3
stack_v2_sparse_classes_30k_train_046101
Implement the Python class `TrialSerializer` described below. Class description: Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters. Method signatures and docstrings: - def to_representation(self, instance): Convert the serialized parameters into a real diction...
Implement the Python class `TrialSerializer` described below. Class description: Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters. Method signatures and docstrings: - def to_representation(self, instance): Convert the serialized parameters into a real diction...
27f861c09615aedfd96cffdebf7d9653f72b4d7b
<|skeleton|> class TrialSerializer: """Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters.""" def to_representation(self, instance): """Convert the serialized parameters into a real dictionary. Args: :param instance: instance to be deserialized :...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TrialSerializer: """Serialize and deserialized trial instances. Ensure to pass from the serializer for adjusting the parameters.""" def to_representation(self, instance): """Convert the serialized parameters into a real dictionary. Args: :param instance: instance to be deserialized :return: Deser...
the_stack_v2_python_sparse
API/serializers.py
AndreaCorsini1/Ahmet
train
1
215d39e3f6579de07ec9544650e262eab5d77373
[ "if x < 0:\n return None\nelif x <= 1:\n return x\nleft = 1\nright = x // 2 + 1\nif x > 10000:\n bits = 1\n cx = x\n while cx > 0:\n cx //= 10\n bits += 1\n left = 10 ** (bits // 2 - 1)\n right = left * 10\nwhile left < right:\n mid = left + (right - left) // 2\n mv = mid * ...
<|body_start_0|> if x < 0: return None elif x <= 1: return x left = 1 right = x // 2 + 1 if x > 10000: bits = 1 cx = x while cx > 0: cx //= 10 bits += 1 left = 10 ** (bits // 2...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def mySqrt(self, x): """只要求返回整数解, 二叉查找即可 :param x: :return:""" <|body_0|> def sqrt(self, x): """平方根公式, 利用斜率计算 X(k+1) = (X(k) + n/X(k)) / 2 :param x: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> if x < 0: return None...
stack_v2_sparse_classes_75kplus_train_065920
1,623
permissive
[ { "docstring": "只要求返回整数解, 二叉查找即可 :param x: :return:", "name": "mySqrt", "signature": "def mySqrt(self, x)" }, { "docstring": "平方根公式, 利用斜率计算 X(k+1) = (X(k) + n/X(k)) / 2 :param x: :return:", "name": "sqrt", "signature": "def sqrt(self, x)" } ]
2
stack_v2_sparse_classes_30k_train_053790
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def mySqrt(self, x): 只要求返回整数解, 二叉查找即可 :param x: :return: - def sqrt(self, x): 平方根公式, 利用斜率计算 X(k+1) = (X(k) + n/X(k)) / 2 :param x: :return:
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def mySqrt(self, x): 只要求返回整数解, 二叉查找即可 :param x: :return: - def sqrt(self, x): 平方根公式, 利用斜率计算 X(k+1) = (X(k) + n/X(k)) / 2 :param x: :return: <|skeleton|> class Solution: def...
2830c7e2ada8dfd3dcdda7c06846116d4f944a27
<|skeleton|> class Solution: def mySqrt(self, x): """只要求返回整数解, 二叉查找即可 :param x: :return:""" <|body_0|> def sqrt(self, x): """平方根公式, 利用斜率计算 X(k+1) = (X(k) + n/X(k)) / 2 :param x: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def mySqrt(self, x): """只要求返回整数解, 二叉查找即可 :param x: :return:""" if x < 0: return None elif x <= 1: return x left = 1 right = x // 2 + 1 if x > 10000: bits = 1 cx = x while cx > 0: ...
the_stack_v2_python_sparse
leetcode/medium/Sqrt.py
shhuan/algorithms
train
0
2593881bf3e264c82d735895ce6e1da7e942d5e8
[ "queryset = self.queryset.filter(type='student').order_by('-created_at')[0]\nserializer = self.get_serializer(queryset, many=False)\nreturn Response(serializer.data)", "try:\n cache_key = 'apk_release_student'\n data = cache.get(cache_key)\n if data:\n return Response(data)\nexcept Exception as e:...
<|body_start_0|> queryset = self.queryset.filter(type='student').order_by('-created_at')[0] serializer = self.get_serializer(queryset, many=False) return Response(serializer.data) <|end_body_0|> <|body_start_1|> try: cache_key = 'apk_release_student' data = cache...
ApkReleaseViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ApkReleaseViewSet: def list(self, request, *args, **kwargs): """this function expire in new version of server :param request: :return: application address""" <|body_0|> def student(self, request): """last app from student :param request: :return: application address"...
stack_v2_sparse_classes_75kplus_train_065921
8,937
no_license
[ { "docstring": "this function expire in new version of server :param request: :return: application address", "name": "list", "signature": "def list(self, request, *args, **kwargs)" }, { "docstring": "last app from student :param request: :return: application address", "name": "student", ...
4
stack_v2_sparse_classes_30k_train_054270
Implement the Python class `ApkReleaseViewSet` described below. Class description: Implement the ApkReleaseViewSet class. Method signatures and docstrings: - def list(self, request, *args, **kwargs): this function expire in new version of server :param request: :return: application address - def student(self, request...
Implement the Python class `ApkReleaseViewSet` described below. Class description: Implement the ApkReleaseViewSet class. Method signatures and docstrings: - def list(self, request, *args, **kwargs): this function expire in new version of server :param request: :return: application address - def student(self, request...
a95addbca0b25b99da920721c078f1c01466f09b
<|skeleton|> class ApkReleaseViewSet: def list(self, request, *args, **kwargs): """this function expire in new version of server :param request: :return: application address""" <|body_0|> def student(self, request): """last app from student :param request: :return: application address"...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ApkReleaseViewSet: def list(self, request, *args, **kwargs): """this function expire in new version of server :param request: :return: application address""" queryset = self.queryset.filter(type='student').order_by('-created_at')[0] serializer = self.get_serializer(queryset, many=False...
the_stack_v2_python_sparse
apps/common/viewsets.py
mehdi1361/backend_aghigh
train
0
fb42951a51294cfff88ca441eb07fc9529dc8ddd
[ "super(RpcPikaIncomingMessage, self).__init__(pika_engine, channel, method, properties, body)\nself.reply_q = properties.reply_to\nself.msg_id = properties.correlation_id", "if self.reply_q is None:\n return\nreply_outgoing_message = RpcReplyPikaOutgoingMessage(self._pika_engine, self.msg_id, reply=reply, fail...
<|body_start_0|> super(RpcPikaIncomingMessage, self).__init__(pika_engine, channel, method, properties, body) self.reply_q = properties.reply_to self.msg_id = properties.correlation_id <|end_body_0|> <|body_start_1|> if self.reply_q is None: return reply_outgoing_mes...
PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client
RpcPikaIncomingMessage
[ "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RpcPikaIncomingMessage: """PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client""" def __init__(self, pika_engine, channel, method, p...
stack_v2_sparse_classes_75kplus_train_065922
24,684
permissive
[ { "docstring": "Defines default values of msg_id and reply_q fields and just call super.__init__ method :param pika_engine: PikaEngine, shared object with configuration and shared driver functionality :param channel: Channel, RabbitMQ channel which was used for this message delivery, used for sending ack back. ...
2
stack_v2_sparse_classes_30k_test_001962
Implement the Python class `RpcPikaIncomingMessage` described below. Class description: PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client Method signatures ...
Implement the Python class `RpcPikaIncomingMessage` described below. Class description: PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client Method signatures ...
c01951b33e278de9e769c2d0609c0be61d2cb26b
<|skeleton|> class RpcPikaIncomingMessage: """PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client""" def __init__(self, pika_engine, channel, method, p...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RpcPikaIncomingMessage: """PikaIncomingMessage implementation for RPC messages. It expects extra RPC related fields in message body (msg_id and reply_q). Also 'reply' method added to allow consumer to send RPC reply back to the RPC client""" def __init__(self, pika_engine, channel, method, properties, bo...
the_stack_v2_python_sparse
filesystems/vnx_rootfs_lxc_ubuntu64-16.04-v025-openstack-compute/rootfs/usr/lib/python2.7/dist-packages/oslo_messaging/_drivers/pika_driver/pika_message.py
juancarlosdiaztorres/Ansible-OpenStack
train
0
e4d6990132cbd4287e0b83e4172ace5f00169e8b
[ "message = \"Processing type order: order ID is '%(order)s' and request ID is '%(request)s'\"\nLOG.info(message, {'order': order_id, 'request': request_id})\nreturn resources.BeginTypeOrder().process_and_suppress_exceptions(order_id, project_id)", "message = \"Processing check certificate status on order: order I...
<|body_start_0|> message = "Processing type order: order ID is '%(order)s' and request ID is '%(request)s'" LOG.info(message, {'order': order_id, 'request': request_id}) return resources.BeginTypeOrder().process_and_suppress_exceptions(order_id, project_id) <|end_body_0|> <|body_start_1|> ...
Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added that can be retried, please also add its method name to MAP_RETRY_TASKS abo...
Tasks
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Tasks: """Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added that can be retried, please also add its m...
stack_v2_sparse_classes_75kplus_train_065923
9,386
permissive
[ { "docstring": "Process TypeOrder.", "name": "process_type_order", "signature": "def process_type_order(self, context, order_id, project_id, request_id)" }, { "docstring": "Check the status of a certificate order.", "name": "check_certificate_status", "signature": "def check_certificate_...
2
null
Implement the Python class `Tasks` described below. Class description: Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added tha...
Implement the Python class `Tasks` described below. Class description: Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added tha...
c8e3dc14e6225f1d400131434e8afec0aa410ae7
<|skeleton|> class Tasks: """Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added that can be retried, please also add its m...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Tasks: """Tasks that can be invoked asynchronously in Barbican. Only place task methods and implementations on this class, as they can be called directly from the client side for non-asynchronous standalone single-node operation. If a new method is added that can be retried, please also add its method name to...
the_stack_v2_python_sparse
barbican/queue/server.py
openstack/barbican
train
189
9078ecd85d4393f632fe55c3fc786ad38016c5e6
[ "assert alpha >= 0\nsuper(PrioritizedReplayBuffer, self).__init__(obs_dim, size, batch_size, n_step, gamma)\nself.max_priority, self.tree_ptr = (1.0, 0)\nself.alpha = alpha\ntree_capacity = 1\nwhile tree_capacity < self.max_size:\n tree_capacity *= 2\nself.sum_tree = SumSegmentTree(tree_capacity)\nself.min_tree ...
<|body_start_0|> assert alpha >= 0 super(PrioritizedReplayBuffer, self).__init__(obs_dim, size, batch_size, n_step, gamma) self.max_priority, self.tree_ptr = (1.0, 0) self.alpha = alpha tree_capacity = 1 while tree_capacity < self.max_size: tree_capacity *= 2 ...
Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinSegmentTree): min tree for min prior to get max weight
PrioritizedReplayBuffer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PrioritizedReplayBuffer: """Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinSegmentTree): min tree for min prior to ...
stack_v2_sparse_classes_75kplus_train_065924
22,704
no_license
[ { "docstring": "Initialization.", "name": "__init__", "signature": "def __init__(self, obs_dim: int, size: int, batch_size: int=32, alpha: float=0.6, n_step: int=1, gamma: float=0.99)" }, { "docstring": "Store experience and priority.", "name": "store", "signature": "def store(self, obs:...
6
stack_v2_sparse_classes_30k_train_016350
Implement the Python class `PrioritizedReplayBuffer` described below. Class description: Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinS...
Implement the Python class `PrioritizedReplayBuffer` described below. Class description: Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinS...
99472f5f6b37bc421e31b145ace55bb175c5b2c4
<|skeleton|> class PrioritizedReplayBuffer: """Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinSegmentTree): min tree for min prior to ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PrioritizedReplayBuffer: """Prioritized Replay buffer. Attributes: max_priority (float): max priority tree_ptr (int): next index of tree alpha (float): alpha parameter for prioritized replay buffer sum_tree (SumSegmentTree): sum tree for prior min_tree (MinSegmentTree): min tree for min prior to get max weigh...
the_stack_v2_python_sparse
agent/torch_agent/agent_Rainbow.py
ZJ96/City_Brain_TSC
train
4
44461232e4b1f68e1c5904a454ae345dfa3f01b9
[ "if type(dct) is str:\n return evalfn(dct)\nfor k, v in dct.items():\n dct[k] = self.evalfunc(v, evalfn)\nreturn dct", "rs = {}\nfor par in parameter_str_list:\n cd = {}\n for name, comp in complist.items():\n comp = comp.replace('math.exp', 'exp')\n sd = sympy.diff(comp, par)\n s...
<|body_start_0|> if type(dct) is str: return evalfn(dct) for k, v in dct.items(): dct[k] = self.evalfunc(v, evalfn) return dct <|end_body_0|> <|body_start_1|> rs = {} for par in parameter_str_list: cd = {} for name, comp in complis...
StringEMTransistorModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StringEMTransistorModel: def evalfunc(self, dct, evalfn): """Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так далее :param evalfn: функция, которая принимает на вход строку, возвращает вычисленное значение :return: тот же ...
stack_v2_sparse_classes_75kplus_train_065925
6,653
no_license
[ { "docstring": "Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так далее :param evalfn: функция, которая принимает на вход строку, возвращает вычисленное значение :return: тот же словарь, но вместо строк нечто вычисленное", "name": "evalfunc", ...
5
null
Implement the Python class `StringEMTransistorModel` described below. Class description: Implement the StringEMTransistorModel class. Method signatures and docstrings: - def evalfunc(self, dct, evalfn): Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так ...
Implement the Python class `StringEMTransistorModel` described below. Class description: Implement the StringEMTransistorModel class. Method signatures and docstrings: - def evalfunc(self, dct, evalfn): Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так ...
b071d3084cdf2d9f18b3981c9884ec7310840e79
<|skeleton|> class StringEMTransistorModel: def evalfunc(self, dct, evalfn): """Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так далее :param evalfn: функция, которая принимает на вход строку, возвращает вычисленное значение :return: тот же ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class StringEMTransistorModel: def evalfunc(self, dct, evalfn): """Рекурсивное вычисление словаря любой вложенности :param dct: строка или словарь, может быть словарь словарей и так далее :param evalfn: функция, которая принимает на вход строку, возвращает вычисленное значение :return: тот же словарь, но вм...
the_stack_v2_python_sparse
Fianora/Fianora_Derivative.py
reinerwaldmann/PHDLinearization
train
0
7ab37ab224045abd7cee10ff3e0815e662abc1af
[ "self.frame = frame\nsuper().__init__(self.frame)\nself.give_shape()\nself.brick_matrix = self.make_brick_matrix(self.frame)", "for r in range(len(self.location_n_type_matrix)):\n for c in range(len(self.location_n_type_matrix[r])):\n if r == len(self.location_n_type_matrix) - 1:\n self.locat...
<|body_start_0|> self.frame = frame super().__init__(self.frame) self.give_shape() self.brick_matrix = self.make_brick_matrix(self.frame) <|end_body_0|> <|body_start_1|> for r in range(len(self.location_n_type_matrix)): for c in range(len(self.location_n_type_matrix[...
BrickLayout for stage
LayoutStage1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LayoutStage1: """BrickLayout for stage""" def __init__(self, frame: Frame): """constructor for this class""" <|body_0|> def give_shape(self): """This function is from the parrent class. Now overriding it to give""" <|body_1|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_75kplus_train_065926
8,421
no_license
[ { "docstring": "constructor for this class", "name": "__init__", "signature": "def __init__(self, frame: Frame)" }, { "docstring": "This function is from the parrent class. Now overriding it to give", "name": "give_shape", "signature": "def give_shape(self)" } ]
2
stack_v2_sparse_classes_30k_train_040234
Implement the Python class `LayoutStage1` described below. Class description: BrickLayout for stage Method signatures and docstrings: - def __init__(self, frame: Frame): constructor for this class - def give_shape(self): This function is from the parrent class. Now overriding it to give
Implement the Python class `LayoutStage1` described below. Class description: BrickLayout for stage Method signatures and docstrings: - def __init__(self, frame: Frame): constructor for this class - def give_shape(self): This function is from the parrent class. Now overriding it to give <|skeleton|> class LayoutStag...
c4cd10f631aba51d290395dec446850a0fbfe1b5
<|skeleton|> class LayoutStage1: """BrickLayout for stage""" def __init__(self, frame: Frame): """constructor for this class""" <|body_0|> def give_shape(self): """This function is from the parrent class. Now overriding it to give""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LayoutStage1: """BrickLayout for stage""" def __init__(self, frame: Frame): """constructor for this class""" self.frame = frame super().__init__(self.frame) self.give_shape() self.brick_matrix = self.make_brick_matrix(self.frame) def give_shape(self): ...
the_stack_v2_python_sparse
v1/brick_layout.py
ayushsharma-crypto/Brick-Breaker-Terminal-Based-Game
train
0
8df2789715d75225492abf20fdc7ff074be9aab4
[ "super(GaussianProcessModel, self).__init__(**kwargs)\nself.regression = regression\nself.gp_implementation = gp_implementation\nself.model = None\nself.num_tasks = num_tasks\nself.tasks = self.num_tasks", "self.model = []\ntrain_labels = train_dataset.get_labels()\nval_labels = val_dataset.get_labels()\nX = self...
<|body_start_0|> super(GaussianProcessModel, self).__init__(**kwargs) self.regression = regression self.gp_implementation = gp_implementation self.model = None self.num_tasks = num_tasks self.tasks = self.num_tasks <|end_body_0|> <|body_start_1|> self.model = [] ...
GaussianProcessModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GaussianProcessModel: def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs): """__init__. Args: gp_implementation (str): Which package to use to build these num_tasks (int) : Number of tasks kwargs: kwargs""" <|body_0|> def train(self, trai...
stack_v2_sparse_classes_75kplus_train_065927
37,814
no_license
[ { "docstring": "__init__. Args: gp_implementation (str): Which package to use to build these num_tasks (int) : Number of tasks kwargs: kwargs", "name": "__init__", "signature": "def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs)" }, { "docstring": "fit. Fit ...
3
null
Implement the Python class `GaussianProcessModel` described below. Class description: Implement the GaussianProcessModel class. Method signatures and docstrings: - def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs): __init__. Args: gp_implementation (str): Which package to use to...
Implement the Python class `GaussianProcessModel` described below. Class description: Implement the GaussianProcessModel class. Method signatures and docstrings: - def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs): __init__. Args: gp_implementation (str): Which package to use to...
84c9026c78bec9a2267960a87080b71beba5c305
<|skeleton|> class GaussianProcessModel: def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs): """__init__. Args: gp_implementation (str): Which package to use to build these num_tasks (int) : Number of tasks kwargs: kwargs""" <|body_0|> def train(self, trai...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GaussianProcessModel: def __init__(self, regression: bool, gp_implementation: str, num_tasks: int=1, **kwargs): """__init__. Args: gp_implementation (str): Which package to use to build these num_tasks (int) : Number of tasks kwargs: kwargs""" super(GaussianProcessModel, self).__init__(**kwarg...
the_stack_v2_python_sparse
enzpred/models/dense_models.py
liudongliangHI/enz-pred
train
0
f1620989ed61be9a21630c9afabc0867551b62e2
[ "self.reporting = reporting\nself.github = GitHubService(ghName, ghToken)\nself.artifacts = ArtifactService()\nself.monitoring = MonitoringService()\nself.idle = True\nself.started = 0", "s = os.statvfs(config.prbuildsRoot)\nfreeSpaceMB = s.f_frsize * s.f_bavail / 1000 / 1000\nhealth = {'has free space': freeSpac...
<|body_start_0|> self.reporting = reporting self.github = GitHubService(ghName, ghToken) self.artifacts = ArtifactService() self.monitoring = MonitoringService() self.idle = True self.started = 0 <|end_body_0|> <|body_start_1|> s = os.statvfs(config.prbuildsRoot)...
Trousers
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Trousers: def __init__(self, reporting, ghName, ghToken): """constructor""" <|body_0|> def is_healthy(self): """we are healthy under these conditions""" <|body_1|> def process(self, action, bucket, metricService): """process a message coming off ...
stack_v2_sparse_classes_75kplus_train_065928
3,641
no_license
[ { "docstring": "constructor", "name": "__init__", "signature": "def __init__(self, reporting, ghName, ghToken)" }, { "docstring": "we are healthy under these conditions", "name": "is_healthy", "signature": "def is_healthy(self)" }, { "docstring": "process a message coming off the...
4
stack_v2_sparse_classes_30k_train_002122
Implement the Python class `Trousers` described below. Class description: Implement the Trousers class. Method signatures and docstrings: - def __init__(self, reporting, ghName, ghToken): constructor - def is_healthy(self): we are healthy under these conditions - def process(self, action, bucket, metricService): proc...
Implement the Python class `Trousers` described below. Class description: Implement the Trousers class. Method signatures and docstrings: - def __init__(self, reporting, ghName, ghToken): constructor - def is_healthy(self): we are healthy under these conditions - def process(self, action, bucket, metricService): proc...
1dd8f0959fec8a3bb5e06ee0c4acdd43c509765b
<|skeleton|> class Trousers: def __init__(self, reporting, ghName, ghToken): """constructor""" <|body_0|> def is_healthy(self): """we are healthy under these conditions""" <|body_1|> def process(self, action, bucket, metricService): """process a message coming off ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Trousers: def __init__(self, reporting, ghName, ghToken): """constructor""" self.reporting = reporting self.github = GitHubService(ghName, ghToken) self.artifacts = ArtifactService() self.monitoring = MonitoringService() self.idle = True self.started = 0...
the_stack_v2_python_sparse
trousers/trouserlib/trousers.py
guardian/prbuilds
train
6
15f39eab02c2098df36033b90b43c0ea373a7cd1
[ "n = len(prices)\ndp = [[0, -prices[0]]] + [[0, 0] for _ in range(n - 1)]\nfor i in range(1, n):\n dp[i][0] = max(dp[i - 1][0], dp[i - 1][1] + prices[i] - fee)\n dp[i][1] = max(dp[i - 1][1], dp[i - 1][0] - prices[i])\nreturn dp[-1][0]", "if not prices:\n return 0\nn = len(prices)\ndp0 = 0\ndp1 = -prices[...
<|body_start_0|> n = len(prices) dp = [[0, -prices[0]]] + [[0, 0] for _ in range(n - 1)] for i in range(1, n): dp[i][0] = max(dp[i - 1][0], dp[i - 1][1] + prices[i] - fee) dp[i][1] = max(dp[i - 1][1], dp[i - 1][0] - prices[i]) return dp[-1][0] <|end_body_0|> <|bo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit(self, prices, fee): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit(self, prices, fee): """:type prices: List[int] :type fee: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> n = len(prices) ...
stack_v2_sparse_classes_75kplus_train_065929
1,003
no_license
[ { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfit", "signature": "def maxProfit(self, prices, fee)" }, { "docstring": ":type prices: List[int] :type fee: int :rtype: int", "name": "maxProfit", "signature": "def maxProfit(self, prices, fee)" } ]
2
stack_v2_sparse_classes_30k_train_047683
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices, fee): :type prices: List[int] :rtype: int - def maxProfit(self, prices, fee): :type prices: List[int] :type fee: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices, fee): :type prices: List[int] :rtype: int - def maxProfit(self, prices, fee): :type prices: List[int] :type fee: int :rtype: int <|skeleton|> class S...
a509b383a42f54313970168d9faa11f088f18708
<|skeleton|> class Solution: def maxProfit(self, prices, fee): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit(self, prices, fee): """:type prices: List[int] :type fee: 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, fee): """:type prices: List[int] :rtype: int""" n = len(prices) dp = [[0, -prices[0]]] + [[0, 0] for _ in range(n - 1)] for i in range(1, n): dp[i][0] = max(dp[i - 1][0], dp[i - 1][1] + prices[i] - fee) dp[i][1] = ma...
the_stack_v2_python_sparse
0714_Best_Time_to_Buy_and_Sell_Stock_with_Transaction_Fee.py
bingli8802/leetcode
train
0
9695c6a5f271f73512b1e1afca367850975c6348
[ "super().__init__(args, n_r, n_e, dataset_name)\nself.name = 'GCVAE'\nn = self.n\ninput_dim = n * n + n * n_e + n * n * n_r\nself.input_dim = input_dim\nn_feat = n_e + n * n_r\nself.encoder = GCN(n, n_feat, self.h_dim, 2 * self.z_dim).to(torch.double)\nself.decoder = RMLP(input_dim, self.h_dim, self.z_dim)", "A, ...
<|body_start_0|> super().__init__(args, n_r, n_e, dataset_name) self.name = 'GCVAE' n = self.n input_dim = n * n + n * n_e + n * n * n_r self.input_dim = input_dim n_feat = n_e + n * n_r self.encoder = GCN(n, n_feat, self.h_dim, 2 * self.z_dim).to(torch.double) ...
GCVAE
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GCVAE: def __init__(self, args, n_r: int, n_e: int, dataset_name: str): """Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of edge attributes :param dataset_name : name of the dataset which the model will train on. :par...
stack_v2_sparse_classes_75kplus_train_065930
2,171
permissive
[ { "docstring": "Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of edge attributes :param dataset_name : name of the dataset which the model will train on. :param h_dim : Hidden dimension :param z_dim : latent dimension :param beta: for beta <...
2
stack_v2_sparse_classes_30k_train_048530
Implement the Python class `GCVAE` described below. Class description: Implement the GCVAE class. Method signatures and docstrings: - def __init__(self, args, n_r: int, n_e: int, dataset_name: str): Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of...
Implement the Python class `GCVAE` described below. Class description: Implement the GCVAE class. Method signatures and docstrings: - def __init__(self, args, n_r: int, n_e: int, dataset_name: str): Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of...
6e2554e79a71a7a8e5833c554fa9aee9a5309bef
<|skeleton|> class GCVAE: def __init__(self, args, n_r: int, n_e: int, dataset_name: str): """Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of edge attributes :param dataset_name : name of the dataset which the model will train on. :par...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GCVAE: def __init__(self, args, n_r: int, n_e: int, dataset_name: str): """Graph Variational Auto Encoder :param n : Number of nodes :param n_e : Number of node attributes :param n_r : Number of edge attributes :param dataset_name : name of the dataset which the model will train on. :param h_dim : Hid...
the_stack_v2_python_sparse
torch_rgvae/GCVAE.py
xixiareone/rgvae
train
0
c6c1ff53c73e6fbbb92f57162d5e0a99189a4ac6
[ "user = get_jwt_identity()\ndata = request.get_json()\nbooking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number'), 'payment': data.get('payment')}\ntry:\n cleaned_data = validate_data(**booking)\nexcept AssertionError as error:\n return (jsonify({'error': error.args[0]}), 409)\n...
<|body_start_0|> user = get_jwt_identity() data = request.get_json() booking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number'), 'payment': data.get('payment')} try: cleaned_data = validate_data(**booking) except AssertionError as error:...
Controls all bookings and those of each flight
BookingController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" <|body_0|> def bookings(): """Returns all the bookings of a specific user""" <|body_1|> def flight_bookings(flight_i...
stack_v2_sparse_classes_75kplus_train_065931
2,523
no_license
[ { "docstring": "creat booking objects for logged in users", "name": "create", "signature": "def create()" }, { "docstring": "Returns all the bookings of a specific user", "name": "bookings", "signature": "def bookings()" }, { "docstring": "\"Returns all the flight bookings", ...
3
stack_v2_sparse_classes_30k_train_001883
Implement the Python class `BookingController` described below. Class description: Controls all bookings and those of each flight Method signatures and docstrings: - def create(): creat booking objects for logged in users - def bookings(): Returns all the bookings of a specific user - def flight_bookings(flight_id): ...
Implement the Python class `BookingController` described below. Class description: Controls all bookings and those of each flight Method signatures and docstrings: - def create(): creat booking objects for logged in users - def bookings(): Returns all the bookings of a specific user - def flight_bookings(flight_id): ...
f4174888ebaf0902d842894bb48f51b9ec0c3e7e
<|skeleton|> class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" <|body_0|> def bookings(): """Returns all the bookings of a specific user""" <|body_1|> def flight_bookings(flight_i...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BookingController: """Controls all bookings and those of each flight""" def create(): """creat booking objects for logged in users""" user = get_jwt_identity() data = request.get_json() booking = {'flight_name': data.get('flight_name'), 'seat_number': data.get('seat_number...
the_stack_v2_python_sparse
flights/controller/booking_controller.py
Bonifase/flight-reservation-api
train
0
7576348745a1722575e4c4a2164b05aeca070a5f
[ "s1, s2 = ('', '')\nwhile l1:\n s1 = s1 + str(l1.val)\n l1 = l1.next\nwhile l2:\n s2 = s2 + str(l2.val)\n l2 = l2.next\nnum = int(s1[::-1]) + int(s2[::-1])\nnum = str(num)[::-1]\npivot = head = ListNode(num[0])\nfor x in num[1:]:\n head.next = ListNode(int(x))\n head = head.next\nreturn pivot", ...
<|body_start_0|> s1, s2 = ('', '') while l1: s1 = s1 + str(l1.val) l1 = l1.next while l2: s2 = s2 + str(l2.val) l2 = l2.next num = int(s1[::-1]) + int(s2[::-1]) num = str(num)[::-1] pivot = head = ListNode(num[0]) fo...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode: """先遍历生成int,求值后再生成链表。""" <|body_0|> def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode: """内置函数divmod() x,y = divmod(m,n) x = m//n y = m%n""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus_train_065932
2,266
no_license
[ { "docstring": "先遍历生成int,求值后再生成链表。", "name": "addTwoNumbers1", "signature": "def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode" }, { "docstring": "内置函数divmod() x,y = divmod(m,n) x = m//n y = m%n", "name": "addTwoNumbers2", "signature": "def addTwoNumbers2(self, l1: ListNod...
2
stack_v2_sparse_classes_30k_train_025055
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode: 先遍历生成int,求值后再生成链表。 - def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode: 内置函数divmod() x,y = divmod...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode: 先遍历生成int,求值后再生成链表。 - def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode: 内置函数divmod() x,y = divmod...
2bbb1640589aab34f2bc42489283033cc11fb885
<|skeleton|> class Solution: def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode: """先遍历生成int,求值后再生成链表。""" <|body_0|> def addTwoNumbers2(self, l1: ListNode, l2: ListNode) -> ListNode: """内置函数divmod() x,y = divmod(m,n) x = m//n y = m%n""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def addTwoNumbers1(self, l1: ListNode, l2: ListNode) -> ListNode: """先遍历生成int,求值后再生成链表。""" s1, s2 = ('', '') while l1: s1 = s1 + str(l1.val) l1 = l1.next while l2: s2 = s2 + str(l2.val) l2 = l2.next num = int(s1[...
the_stack_v2_python_sparse
002_add-two-numbers.py
helloocc/algorithm
train
1
ad55e8ff6b27e12e479707a8c309b14ef1bc907a
[ "query = Query(Objective.collection, service_id=client.service_id, objective_group_id=objective_group_id)\nquery.limit(1000)\nreturn SequenceProxy(Objective, query, client=client)", "collection: Final[str] = 'objective_set_to_objective'\nquery = Query(collection, service_id=client.service_id, objective_set_id=obj...
<|body_start_0|> query = Query(Objective.collection, service_id=client.service_id, objective_group_id=objective_group_id) query.limit(1000) return SequenceProxy(Objective, query, client=client) <|end_body_0|> <|body_start_1|> collection: Final[str] = 'objective_set_to_objective' ...
A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for this objective. .. seealso:: :meth:`type` -- The type of objective. .. attr...
Objective
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Objective: """A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for this objective. .. seealso:: :meth:`ty...
stack_v2_sparse_classes_75kplus_train_065933
4,410
permissive
[ { "docstring": "Return any rewards contained from the given reward group. This returns a :class:`auraxium.SequenceProxy`.", "name": "get_by_objective_group", "signature": "def get_by_objective_group(cls, objective_group_id: int, client: RequestClient) -> SequenceProxy['Objective']" }, { "docstri...
3
null
Implement the Python class `Objective` described below. Class description: A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for...
Implement the Python class `Objective` described below. Class description: A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for...
23dcf927a199c8d7c917d89fe96b470a34cf4bba
<|skeleton|> class Objective: """A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for this objective. .. seealso:: :meth:`ty...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Objective: """A objective presented to a character. .. attribute:: id :type: int The unique ID of this objective. In the API payload, this field is called ``objective_id``. .. attribute:: objective_type_id :type: int The associated :class:`ObjectiveType` for this objective. .. seealso:: :meth:`type` -- The ty...
the_stack_v2_python_sparse
auraxium/ps2/_objective.py
leonhard-s/auraxium
train
29
0d53f5b928af3c170c7644347445719b9fc01845
[ "logger.info('Creating ReferenceCell...')\nsuper(ReferenceCell, self).__init__(mesh, pseudo_mesh, time_mesh, boundaries, **kwargs)\nlogger.info('Finding subdomains and indices...')\nself.neg_ind, self.sep_ind, self.pos_ind = subdomains(mesh[0:], [(0, 1), (1, 2), (2, 3)])\nself.neg, self.sep, self.pos = (mesh[self.n...
<|body_start_0|> logger.info('Creating ReferenceCell...') super(ReferenceCell, self).__init__(mesh, pseudo_mesh, time_mesh, boundaries, **kwargs) logger.info('Finding subdomains and indices...') self.neg_ind, self.sep_ind, self.pos_ind = subdomains(mesh[0:], [(0, 1), (1, 2), (2, 3)]) ...
Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, 3]. For convenience the subdomains are added onto engine.Mountain.
ReferenceCell
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReferenceCell: """Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, 3]. For convenience the subdomains are ...
stack_v2_sparse_classes_75kplus_train_065934
3,719
permissive
[ { "docstring": "Store the solutions to each cell parameter. :param mesh: Solution mesh :param boundaries: internal boundaries in the mesh :param kwargs: arrays for each solution", "name": "__init__", "signature": "def __init__(self, mesh: np.ndarray, pseudo_mesh: np.ndarray, time_mesh: np.ndarray, bound...
2
stack_v2_sparse_classes_30k_train_045624
Implement the Python class `ReferenceCell` described below. Class description: Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, ...
Implement the Python class `ReferenceCell` described below. Class description: Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, ...
ba2e93faeed3004d344a8c14f37a409da572271d
<|skeleton|> class ReferenceCell: """Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, 3]. For convenience the subdomains are ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ReferenceCell: """Reference lithium-ion cell geometry, where the dimensions are normalized. The x dimension is defined such that the negative electrode exists between [0, 1], the separator exists between [1, 2], and the positive electrode exists between [2, 3]. For convenience the subdomains are added onto en...
the_stack_v2_python_sparse
mtnlion/domain.py
macklenc/mtnlion
train
0
3dff085a46a6fb3665531c22e042021827665b15
[ "super(VideoEncoder, self).__init__()\nself.n_frames = n_frames\nself.z_dim = z_dim\nself.hand_side_invariance = hand_side_invariance\nself.frameEncoder = RGBEncoder(z_dim, hand_side_invariance)\nfeatures_num = self.n_frames * self.z_dim * 2\nself.layers = nn.Sequential(nn.Linear(features_num, features_num), nn.ReL...
<|body_start_0|> super(VideoEncoder, self).__init__() self.n_frames = n_frames self.z_dim = z_dim self.hand_side_invariance = hand_side_invariance self.frameEncoder = RGBEncoder(z_dim, hand_side_invariance) features_num = self.n_frames * self.z_dim * 2 self.layers...
VideoEncoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VideoEncoder: def __init__(self, n_frames, z_dim, hand_side_invariance): """实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法""" <|body_0|> def forward(self, x): """N 张图片一起输入。 :param x:(batch_size, n, 3, 320, 320) :r...
stack_v2_sparse_classes_75kplus_train_065935
1,416
no_license
[ { "docstring": "实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法", "name": "__init__", "signature": "def __init__(self, n_frames, z_dim, hand_side_invariance)" }, { "docstring": "N 张图片一起输入。 :param x:(batch_size, n, 3, 320, 320) :return:", "...
2
null
Implement the Python class `VideoEncoder` described below. Class description: Implement the VideoEncoder class. Method signatures and docstrings: - def __init__(self, n_frames, z_dim, hand_side_invariance): 实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法 - def forw...
Implement the Python class `VideoEncoder` described below. Class description: Implement the VideoEncoder class. Method signatures and docstrings: - def __init__(self, n_frames, z_dim, hand_side_invariance): 实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法 - def forw...
a7c3779b3241634bbecaecbc58dbcc42aa44621f
<|skeleton|> class VideoEncoder: def __init__(self, n_frames, z_dim, hand_side_invariance): """实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法""" <|body_0|> def forward(self, x): """N 张图片一起输入。 :param x:(batch_size, n, 3, 320, 320) :r...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class VideoEncoder: def __init__(self, n_frames, z_dim, hand_side_invariance): """实现对视频,多帧图片的同时编码。 :param n_frames: :param z_dim: :param hand_side_invariance: TODO: BatchNormal 的正确写法""" super(VideoEncoder, self).__init__() self.n_frames = n_frames self.z_dim = z_dim self.hand...
the_stack_v2_python_sparse
VaePose/Model/Video.py
guoyangzhao/VAE-Pose
train
0
a5f2fd2ee63600eb2af8aa34113489c36b9ec0b7
[ "self.model = model\nself.monitors = []\nurwid.WidgetWrap.__init__(self, self.build())", "self.cpuMonitor = SystemMonitor(self.model, 'cpu', 'header', 'CPU Load')\nself.memoryMonitor = SystemMonitor(self.model, 'memory', 'header', 'Used Memory (MB)')\nself.received = SystemMonitor(self.model, 'packetsreceived', '...
<|body_start_0|> self.model = model self.monitors = [] urwid.WidgetWrap.__init__(self, self.build()) <|end_body_0|> <|body_start_1|> self.cpuMonitor = SystemMonitor(self.model, 'cpu', 'header', 'CPU Load') self.memoryMonitor = SystemMonitor(self.model, 'memory', 'header', 'Used ...
SystemMonitors is a view to track various system level information like CPU/Memory usage
SystemMonitors
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SystemMonitors: """SystemMonitors is a view to track various system level information like CPU/Memory usage""" def __init__(self, model): """Parameters ---------- model : ConfigurationModel The model that this component is linked to.""" <|body_0|> def build(self): ...
stack_v2_sparse_classes_75kplus_train_065936
1,822
permissive
[ { "docstring": "Parameters ---------- model : ConfigurationModel The model that this component is linked to.", "name": "__init__", "signature": "def __init__(self, model)" }, { "docstring": "Composes child views and components into a single object to be rendered. This view builds a list of Syste...
3
null
Implement the Python class `SystemMonitors` described below. Class description: SystemMonitors is a view to track various system level information like CPU/Memory usage Method signatures and docstrings: - def __init__(self, model): Parameters ---------- model : ConfigurationModel The model that this component is link...
Implement the Python class `SystemMonitors` described below. Class description: SystemMonitors is a view to track various system level information like CPU/Memory usage Method signatures and docstrings: - def __init__(self, model): Parameters ---------- model : ConfigurationModel The model that this component is link...
e8d919a1a8ebc8605f69d00378d2bfaa533731eb
<|skeleton|> class SystemMonitors: """SystemMonitors is a view to track various system level information like CPU/Memory usage""" def __init__(self, model): """Parameters ---------- model : ConfigurationModel The model that this component is linked to.""" <|body_0|> def build(self): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SystemMonitors: """SystemMonitors is a view to track various system level information like CPU/Memory usage""" def __init__(self, model): """Parameters ---------- model : ConfigurationModel The model that this component is linked to.""" self.model = model self.monitors = [] ...
the_stack_v2_python_sparse
tui/views/systemMonitors.py
lenkatilka/diminish
train
0
060c6cc7fa3636088d7ced3fcd6fc2827829d272
[ "permitted_objects_filter = self.permitted_objects_filter(Job, JOB_READ)\nfilter_params = {}\nfor key in self.request.arguments.keys():\n if key in JobSchema.get_attribute_names():\n filter_params[key] = self.get_query_argument(key)\nresponse = await self.client(Operation(operation_type='JOB_READ_ALL', kw...
<|body_start_0|> permitted_objects_filter = self.permitted_objects_filter(Job, JOB_READ) filter_params = {} for key in self.request.arguments.keys(): if key in JobSchema.get_attribute_names(): filter_params[key] = self.get_query_argument(key) response = await ...
JobListAPI
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JobListAPI: async def get(self): """--- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x: $ref: '#/definitions/50xError' tags: - Jobs""" <|body_0|> async def post(self): ...
stack_v2_sparse_classes_75kplus_train_065937
12,340
permissive
[ { "docstring": "--- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x: $ref: '#/definitions/50xError' tags: - Jobs", "name": "get", "signature": "async def get(self)" }, { "docstring": "--- summar...
2
null
Implement the Python class `JobListAPI` described below. Class description: Implement the JobListAPI class. Method signatures and docstrings: - async def get(self): --- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x...
Implement the Python class `JobListAPI` described below. Class description: Implement the JobListAPI class. Method signatures and docstrings: - async def get(self): --- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x...
a5fd2dcc2444409e243d3fdaa43d86695e5cb142
<|skeleton|> class JobListAPI: async def get(self): """--- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x: $ref: '#/definitions/50xError' tags: - Jobs""" <|body_0|> async def post(self): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class JobListAPI: async def get(self): """--- summary: Retrieve all Jobs. responses: 200: description: Successfully retrieved all systems. schema: type: array items: $ref: '#/definitions/Job' 50x: $ref: '#/definitions/50xError' tags: - Jobs""" permitted_objects_filter = self.permitted_objects_filter...
the_stack_v2_python_sparse
src/app/beer_garden/api/http/handlers/v1/job.py
beer-garden/beer-garden
train
254
7e576625154c5678a2a913b519a279d77e3324e0
[ "freq = Counter(tiles).values()\ndp = [[0] * (len(tiles) + 1) for _ in range(len(freq) + 1)]\ndp[0][0] = 1\nfor i, count in enumerate(freq, 1):\n for j in range(len(tiles) + 1):\n for k in range(min(j, count) + 1):\n dp[i][j] += dp[i - 1][j - k] * E.C(j, k)\n dp[i][j] %= MOD\nreturn ...
<|body_start_0|> freq = Counter(tiles).values() dp = [[0] * (len(tiles) + 1) for _ in range(len(freq) + 1)] dp[0][0] = 1 for i, count in enumerate(freq, 1): for j in range(len(tiles) + 1): for k in range(min(j, count) + 1): dp[i][j] += dp[i...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def numTilePossibilities(self, tiles: str) -> int: """O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k).""" <|body_0|> def numTilePossibilities2(self, tiles: str) -> int: """O(n!*n).""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus_train_065938
3,705
no_license
[ { "docstring": "O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k).", "name": "numTilePossibilities", "signature": "def numTilePossibilities(self, tiles: str) -> int" }, { "docstring": "O(n!*n).", "name": "numTilePossibilities2", "signature": "def numTi...
2
stack_v2_sparse_classes_30k_val_000309
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numTilePossibilities(self, tiles: str) -> int: O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k). - def numTilePossibilities2(self, tiles:...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def numTilePossibilities(self, tiles: str) -> int: O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k). - def numTilePossibilities2(self, tiles:...
7e79e26bb8f641868561b186e34c1127ed63c9e0
<|skeleton|> class Solution: def numTilePossibilities(self, tiles: str) -> int: """O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k).""" <|body_0|> def numTilePossibilities2(self, tiles: str) -> int: """O(n!*n).""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def numTilePossibilities(self, tiles: str) -> int: """O(n^2) dp. dp[i][j]表示用前i种字母组成长度为j的序列的个数. 如果选第i种字母k个, 则dp[i][j] = dp[i-1][j-k]*C(j, k).""" freq = Counter(tiles).values() dp = [[0] * (len(tiles) + 1) for _ in range(len(freq) + 1)] dp[0][0] = 1 for i, count...
the_stack_v2_python_sparse
11_动态规划/字符串计数/1079. 活字印刷.py
981377660LMT/algorithm-study
train
225
71e5ec9f0105511cb33dd5bbec9e2789017b92b4
[ "self.id = id\nself.provider_id = provider_id\nself.server_time = server_time\nself.active_from = active_from\nself.active_to = active_to\nself.rpm_over_value = rpm_over_value\nself.over_speed_value = over_speed_value\nself.excess_speed_value = excess_speed_value\nself.long_idle_value = long_idle_value\nself.hi_thr...
<|body_start_0|> self.id = id self.provider_id = provider_id self.server_time = server_time self.active_from = active_from self.active_to = active_to self.rpm_over_value = rpm_over_value self.over_speed_value = over_speed_value self.excess_speed_value = ex...
Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and time when this object was received at the TSP act...
PerformanceThresholds
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and ...
stack_v2_sparse_classes_75kplus_train_065939
4,395
permissive
[ { "docstring": "Constructor for the PerformanceThresholds class", "name": "__init__", "signature": "def __init__(self, id=None, provider_id=None, server_time=None, active_from=None, active_to=None, rpm_over_value=None, over_speed_value=None, excess_speed_value=None, long_idle_value=None, hi_throttle_val...
2
stack_v2_sparse_classes_30k_train_024596
Implement the Python class `PerformanceThresholds` described below. Class description: Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of ...
Implement the Python class `PerformanceThresholds` described below. Class description: Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of ...
729e9391879e273545a4818558677b2e47261f08
<|skeleton|> class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PerformanceThresholds: """Implementation of the 'Performance Thresholds' model. TODO: type model description here. Attributes: id (string): The unique identifier for the specific Entity object in the system. provider_id (string): The unique 'Provider ID' of the TSP server_time (string): Date and time when thi...
the_stack_v2_python_sparse
sdk/python/v0.1-rc.4/opentelematicsapi/models/performance_thresholds.py
nmfta-repo/nmfta-opentelematics-prototype
train
2
6540e2f840706330c067b01668f4996b2132d1df
[ "self.res = 10 ** n\n\ndef helper(n, set):\n if n <= 0:\n return\n if len(set) == 0:\n helper(n - 1, set)\n for i in range(1, 10):\n helper(n - 1, set + [i])\n else:\n for i in range(10):\n if i in set:\n self.res -= 10 ** (n - 1)\n ...
<|body_start_0|> self.res = 10 ** n def helper(n, set): if n <= 0: return if len(set) == 0: helper(n - 1, set) for i in range(1, 10): helper(n - 1, set + [i]) else: for i in range(10)...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def countNumbersWithUniqueDigits2(self, n): """:type n: int :rtype: int""" <|body_0|> def countNumbersWithUniqueDigits(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.res = 10 ** n def he...
stack_v2_sparse_classes_75kplus_train_065940
1,044
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "countNumbersWithUniqueDigits2", "signature": "def countNumbersWithUniqueDigits2(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "countNumbersWithUniqueDigits", "signature": "def countNumbersWithUniqueDigits(self, n)" }...
2
stack_v2_sparse_classes_30k_train_028655
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def countNumbersWithUniqueDigits2(self, n): :type n: int :rtype: int - def countNumbersWithUniqueDigits(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 countNumbersWithUniqueDigits2(self, n): :type n: int :rtype: int - def countNumbersWithUniqueDigits(self, n): :type n: int :rtype: int <|skeleton|> class Solution: def ...
0fc972e5cd2baf1b5ddf8b192962629f40bc3bf4
<|skeleton|> class Solution: def countNumbersWithUniqueDigits2(self, n): """:type n: int :rtype: int""" <|body_0|> def countNumbersWithUniqueDigits(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 countNumbersWithUniqueDigits2(self, n): """:type n: int :rtype: int""" self.res = 10 ** n def helper(n, set): if n <= 0: return if len(set) == 0: helper(n - 1, set) for i in range(1, 10): ...
the_stack_v2_python_sparse
Array/src/357. Count Numbers with Unique Digits.py
yukiii-zhong/Leetcode
train
2
4191b2d94c8897840db9e2aee4605e6c6e653681
[ "self.x = x\nself.y = y\nself.hx = hx\nself.hy = hy", "assert len(exclude_refcode) > 0\nrefcodes = self.x.index.tolist()\nhx = self.x.loc[exclude_refcode]\nhy = self.y.loc[exclude_refcode]\nremaining = list(set(refcodes).difference(set(exclude_refcode)))\nx = self.x.loc[remaining]\ny = self.y.loc[remaining]\nself...
<|body_start_0|> self.x = x self.y = y self.hx = hx self.hy = hy <|end_body_0|> <|body_start_1|> assert len(exclude_refcode) > 0 refcodes = self.x.index.tolist() hx = self.x.loc[exclude_refcode] hy = self.y.loc[exclude_refcode] remaining = list(se...
DimDataset
[ "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DimDataset: def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None): """dataset used for dimensionality prediction""" <|body_0|> def holdout(self, exclude_refcode: [str]): """:param exclude_refcode: to exclude a list of structures and put them in holdo...
stack_v2_sparse_classes_75kplus_train_065941
15,633
permissive
[ { "docstring": "dataset used for dimensionality prediction", "name": "__init__", "signature": "def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None)" }, { "docstring": ":param exclude_refcode: to exclude a list of structures and put them in holdout data/target", "name": "hol...
3
stack_v2_sparse_classes_30k_train_004782
Implement the Python class `DimDataset` described below. Class description: Implement the DimDataset class. Method signatures and docstrings: - def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None): dataset used for dimensionality prediction - def holdout(self, exclude_refcode: [str]): :param exclude...
Implement the Python class `DimDataset` described below. Class description: Implement the DimDataset class. Method signatures and docstrings: - def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None): dataset used for dimensionality prediction - def holdout(self, exclude_refcode: [str]): :param exclude...
a9e10419f30fcb1b53cd7c90cc752fd1c4f269d7
<|skeleton|> class DimDataset: def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None): """dataset used for dimensionality prediction""" <|body_0|> def holdout(self, exclude_refcode: [str]): """:param exclude_refcode: to exclude a list of structures and put them in holdo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DimDataset: def __init__(self, x: pd.DataFrame, y: pd.DataFrame, hx=None, hy=None): """dataset used for dimensionality prediction""" self.x = x self.y = y self.hx = hx self.hy = hy def holdout(self, exclude_refcode: [str]): """:param exclude_refcode: to exc...
the_stack_v2_python_sparse
cacgan/data/dataset.py
qai222/CompAugCycleGAN
train
0
199689dc56fd6fd4410d7620620842f97fb43cf0
[ "if not num_feat_per_dim > 1:\n raise pyrado.ValueErr(given=num_feat_per_dim, g_constraint='1')\nif not len(bounds) == 2:\n raise pyrado.ShapeErr(given=bounds, expected_match=np.empty(2))\nbounds_to = [None, None]\nfor i, b in enumerate(bounds):\n if isinstance(b, np.ndarray):\n bounds_to[i] = to.fr...
<|body_start_0|> if not num_feat_per_dim > 1: raise pyrado.ValueErr(given=num_feat_per_dim, g_constraint='1') if not len(bounds) == 2: raise pyrado.ShapeErr(given=bounds, expected_match=np.empty(2)) bounds_to = [None, None] for i, b in enumerate(bounds): ...
Normalized Gaussian radial basis function features
RBFFeat
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RBFFeat: """Normalized Gaussian radial basis function features""" def __init__(self, num_feat_per_dim: int, bounds: [Sequence[np.ndarray], Sequence[to.Tensor], Sequence[float]], scale: float=None, state_wise_norm: bool=True): """Constructor :param num_feat_per_dim: number of radial b...
stack_v2_sparse_classes_75kplus_train_065942
13,729
permissive
[ { "docstring": "Constructor :param num_feat_per_dim: number of radial basis functions, identical for every dimension of the input :param bounds: lower and upper bound for the Gaussians' centers, the input dimension is inferred from them :param scale: scaling factor for the squared distance, if `None` the factor...
3
stack_v2_sparse_classes_30k_train_012772
Implement the Python class `RBFFeat` described below. Class description: Normalized Gaussian radial basis function features Method signatures and docstrings: - def __init__(self, num_feat_per_dim: int, bounds: [Sequence[np.ndarray], Sequence[to.Tensor], Sequence[float]], scale: float=None, state_wise_norm: bool=True)...
Implement the Python class `RBFFeat` described below. Class description: Normalized Gaussian radial basis function features Method signatures and docstrings: - def __init__(self, num_feat_per_dim: int, bounds: [Sequence[np.ndarray], Sequence[to.Tensor], Sequence[float]], scale: float=None, state_wise_norm: bool=True)...
a6c982862e2ab39a9f65d1c09aa59d9a8b7ac6c5
<|skeleton|> class RBFFeat: """Normalized Gaussian radial basis function features""" def __init__(self, num_feat_per_dim: int, bounds: [Sequence[np.ndarray], Sequence[to.Tensor], Sequence[float]], scale: float=None, state_wise_norm: bool=True): """Constructor :param num_feat_per_dim: number of radial b...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class RBFFeat: """Normalized Gaussian radial basis function features""" def __init__(self, num_feat_per_dim: int, bounds: [Sequence[np.ndarray], Sequence[to.Tensor], Sequence[float]], scale: float=None, state_wise_norm: bool=True): """Constructor :param num_feat_per_dim: number of radial basis function...
the_stack_v2_python_sparse
Pyrado/pyrado/policies/features.py
jacarvalho/SimuRLacra
train
0
25e8a9bbf04c03be73433d41d3ca73a792b3ff91
[ "input_val = [1, 5, 4, 6, 9, 3, 0, 0, 1, 3]\noutput = ArrayMinJumps.ArrayMinJumps(input_val)\nself.assertEqual(output, 3)", "input_val = [1, 0, 1]\noutput = ArrayMinJumps.ArrayMinJumps(input_val)\nself.assertEqual(output, -1)" ]
<|body_start_0|> input_val = [1, 5, 4, 6, 9, 3, 0, 0, 1, 3] output = ArrayMinJumps.ArrayMinJumps(input_val) self.assertEqual(output, 3) <|end_body_0|> <|body_start_1|> input_val = [1, 0, 1] output = ArrayMinJumps.ArrayMinJumps(input_val) self.assertEqual(output, -1) <|en...
Class with unittests for ArrayMinJumps.py
test_ArrayMinJumps
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test_ArrayMinJumps: """Class with unittests for ArrayMinJumps.py""" def test_ExpectedOutput(self): """Checks if returned output is as expected.""" <|body_0|> def test_NotPossible(self): """Checks if returned output is equal -1 if it is not possible to reach end o...
stack_v2_sparse_classes_75kplus_train_065943
924
no_license
[ { "docstring": "Checks if returned output is as expected.", "name": "test_ExpectedOutput", "signature": "def test_ExpectedOutput(self)" }, { "docstring": "Checks if returned output is equal -1 if it is not possible to reach end of array.", "name": "test_NotPossible", "signature": "def te...
2
stack_v2_sparse_classes_30k_test_001088
Implement the Python class `test_ArrayMinJumps` described below. Class description: Class with unittests for ArrayMinJumps.py Method signatures and docstrings: - def test_ExpectedOutput(self): Checks if returned output is as expected. - def test_NotPossible(self): Checks if returned output is equal -1 if it is not po...
Implement the Python class `test_ArrayMinJumps` described below. Class description: Class with unittests for ArrayMinJumps.py Method signatures and docstrings: - def test_ExpectedOutput(self): Checks if returned output is as expected. - def test_NotPossible(self): Checks if returned output is equal -1 if it is not po...
3aa62ad36c3b06b2a3b05f1f8e2a9e21d68b371f
<|skeleton|> class test_ArrayMinJumps: """Class with unittests for ArrayMinJumps.py""" def test_ExpectedOutput(self): """Checks if returned output is as expected.""" <|body_0|> def test_NotPossible(self): """Checks if returned output is equal -1 if it is not possible to reach end o...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class test_ArrayMinJumps: """Class with unittests for ArrayMinJumps.py""" def test_ExpectedOutput(self): """Checks if returned output is as expected.""" input_val = [1, 5, 4, 6, 9, 3, 0, 0, 1, 3] output = ArrayMinJumps.ArrayMinJumps(input_val) self.assertEqual(output, 3) de...
the_stack_v2_python_sparse
Coderbyte_algorithms/Medium/ArrayMinJumps/test_ArrayMinJumps.py
JakubKazimierski/PythonPortfolio
train
9
786981f34fbbbe5895356d53224c4c2665930c17
[ "if len(args) == 0:\n return ()\nif len(args) == 2:\n substitution_pairs = (args,)\nelif len(args) == 1:\n arg = args[0]\n if isinstance(arg, dict):\n if arg == {}:\n return ()\n substitution_pairs = arg.items()\n else:\n if len(arg) == 0:\n return ()\n ...
<|body_start_0|> if len(args) == 0: return () if len(args) == 2: substitution_pairs = (args,) elif len(args) == 1: arg = args[0] if isinstance(arg, dict): if arg == {}: return () substitution_pair...
SubstitutionPairsParsingUtility
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubstitutionPairsParsingUtility: def parse(*args, required_object_type: Optional[Type]=object): """Extracts substitution pairs from general argument and check them. While extracting, also checks some invariants regarding the shape and content of the substitution pairs. The object is iter...
stack_v2_sparse_classes_75kplus_train_065944
16,598
no_license
[ { "docstring": "Extracts substitution pairs from general argument and check them. While extracting, also checks some invariants regarding the shape and content of the substitution pairs. The object is iterable of pairs (sequence of length 2). The first element is a pair occur only once among first elements (i.e...
2
stack_v2_sparse_classes_30k_train_016478
Implement the Python class `SubstitutionPairsParsingUtility` described below. Class description: Implement the SubstitutionPairsParsingUtility class. Method signatures and docstrings: - def parse(*args, required_object_type: Optional[Type]=object): Extracts substitution pairs from general argument and check them. Whi...
Implement the Python class `SubstitutionPairsParsingUtility` described below. Class description: Implement the SubstitutionPairsParsingUtility class. Method signatures and docstrings: - def parse(*args, required_object_type: Optional[Type]=object): Extracts substitution pairs from general argument and check them. Whi...
acaf4d340f8ab0807ac655186a154b064d49f12c
<|skeleton|> class SubstitutionPairsParsingUtility: def parse(*args, required_object_type: Optional[Type]=object): """Extracts substitution pairs from general argument and check them. While extracting, also checks some invariants regarding the shape and content of the substitution pairs. The object is iter...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SubstitutionPairsParsingUtility: def parse(*args, required_object_type: Optional[Type]=object): """Extracts substitution pairs from general argument and check them. While extracting, also checks some invariants regarding the shape and content of the substitution pairs. The object is iterable of pairs ...
the_stack_v2_python_sparse
neads/activation_model/symbolic_objects/symbolic_object.py
Thrayld/neads
train
0
d0ea87c9c30a5f1d183d4fb95e618a2e684300c7
[ "reasoner = GdlChainingReasoner.create(model)\nsentencesByForm = reasoner.getConstantSentences()\naddSentencesTrueByRulesDifferentially(sentencesByForm, model, reasoner)\nreturn ImmutableConstantChecker.create(model, Multimaps.filterKeys(sentencesByForm.getSentences(), Predicates.in_(model.getConstantSentenceForms(...
<|body_start_0|> reasoner = GdlChainingReasoner.create(model) sentencesByForm = reasoner.getConstantSentences() addSentencesTrueByRulesDifferentially(sentencesByForm, model, reasoner) return ImmutableConstantChecker.create(model, Multimaps.filterKeys(sentencesByForm.getSentences(), Predi...
generated source for class ConstantCheckerFactory
ConstantCheckerFactory
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConstantCheckerFactory: """generated source for class ConstantCheckerFactory""" def createWithForwardChaining(cls, model): """generated source for method createWithForwardChaining""" <|body_0|> def addSentencesTrueByRulesDifferentially(cls, sentencesByForm, domainModel, ...
stack_v2_sparse_classes_75kplus_train_065945
5,719
permissive
[ { "docstring": "generated source for method createWithForwardChaining", "name": "createWithForwardChaining", "signature": "def createWithForwardChaining(cls, model)" }, { "docstring": "generated source for method addSentencesTrueByRulesDifferentially", "name": "addSentencesTrueByRulesDiffere...
5
stack_v2_sparse_classes_30k_test_001249
Implement the Python class `ConstantCheckerFactory` described below. Class description: generated source for class ConstantCheckerFactory Method signatures and docstrings: - def createWithForwardChaining(cls, model): generated source for method createWithForwardChaining - def addSentencesTrueByRulesDifferentially(cls...
Implement the Python class `ConstantCheckerFactory` described below. Class description: generated source for class ConstantCheckerFactory Method signatures and docstrings: - def createWithForwardChaining(cls, model): generated source for method createWithForwardChaining - def addSentencesTrueByRulesDifferentially(cls...
4e6e6e876c3a4294cd711647051da2d9c1836b60
<|skeleton|> class ConstantCheckerFactory: """generated source for class ConstantCheckerFactory""" def createWithForwardChaining(cls, model): """generated source for method createWithForwardChaining""" <|body_0|> def addSentencesTrueByRulesDifferentially(cls, sentencesByForm, domainModel, ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ConstantCheckerFactory: """generated source for class ConstantCheckerFactory""" def createWithForwardChaining(cls, model): """generated source for method createWithForwardChaining""" reasoner = GdlChainingReasoner.create(model) sentencesByForm = reasoner.getConstantSentences() ...
the_stack_v2_python_sparse
ggpy/cruft/autocode/ConstantCheckerFactory.py
hobson/ggpy
train
1
9a271f9b08b3c1b6fd0d99f87872cbeb78d93115
[ "if db_field.name == 'user':\n kwargs['queryset'] = User.objects.filter(id=request.user.id)\n kwargs['initial'] = request.user.id\nelif db_field.name == 'topic' and (not request.user.is_superuser):\n kwargs['queryset'] = Topic.objects.filter(id__in=request.user.profile.topics.all())\nreturn super(TaskAdmin...
<|body_start_0|> if db_field.name == 'user': kwargs['queryset'] = User.objects.filter(id=request.user.id) kwargs['initial'] = request.user.id elif db_field.name == 'topic' and (not request.user.is_superuser): kwargs['queryset'] = Topic.objects.filter(id__in=request.us...
TaskAdmin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TaskAdmin: def formfield_for_foreignkey(self, db_field, request, **kwargs): """Assigns default value for User field. limits Topics field to user's topics.""" <|body_0|> def formfield_for_manytomany(self, db_field, request, **kwargs): """Limits the choices of professo...
stack_v2_sparse_classes_75kplus_train_065946
9,167
permissive
[ { "docstring": "Assigns default value for User field. limits Topics field to user's topics.", "name": "formfield_for_foreignkey", "signature": "def formfield_for_foreignkey(self, db_field, request, **kwargs)" }, { "docstring": "Limits the choices of professors for the limit of user.", "name"...
3
stack_v2_sparse_classes_30k_train_000481
Implement the Python class `TaskAdmin` described below. Class description: Implement the TaskAdmin class. Method signatures and docstrings: - def formfield_for_foreignkey(self, db_field, request, **kwargs): Assigns default value for User field. limits Topics field to user's topics. - def formfield_for_manytomany(self...
Implement the Python class `TaskAdmin` described below. Class description: Implement the TaskAdmin class. Method signatures and docstrings: - def formfield_for_foreignkey(self, db_field, request, **kwargs): Assigns default value for User field. limits Topics field to user's topics. - def formfield_for_manytomany(self...
70638c121ea85ff0e6a650c5f2641b0b3b04d6d0
<|skeleton|> class TaskAdmin: def formfield_for_foreignkey(self, db_field, request, **kwargs): """Assigns default value for User field. limits Topics field to user's topics.""" <|body_0|> def formfield_for_manytomany(self, db_field, request, **kwargs): """Limits the choices of professo...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TaskAdmin: def formfield_for_foreignkey(self, db_field, request, **kwargs): """Assigns default value for User field. limits Topics field to user's topics.""" if db_field.name == 'user': kwargs['queryset'] = User.objects.filter(id=request.user.id) kwargs['initial'] = req...
the_stack_v2_python_sparse
cms/admin.py
Ibrahem3amer/bala7
train
0
4e59dd42814fa7575e5c3577c1a29890521ac950
[ "train_loss_legend, test_loss_legend = ([], [])\nmin_test_loss, running_loss, i = (np.inf, 0, 0)\nloss_pattern = standardize_loss_pattern(loss_pattern)\nif evaluate_every is None:\n evaluate_every = log_every if log_every is not None else 1\ndataset, test_dataset = self.split_dataset(dataset, test_frac)\nmodel.t...
<|body_start_0|> train_loss_legend, test_loss_legend = ([], []) min_test_loss, running_loss, i = (np.inf, 0, 0) loss_pattern = standardize_loss_pattern(loss_pattern) if evaluate_every is None: evaluate_every = log_every if log_every is not None else 1 dataset, test_da...
Class for neural-networks training.
NNTrainer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NNTrainer: """Class for neural-networks training.""" def train_model(self, model, dataset, n_epoch=1, lr=0.001, parameters_to_optimize=None, loss_pattern=None, log_every=None, evaluate_every=None, test_frac=0, dump_best_parameters=None, optimizer=torch.optim.Adam, scheduler=partial(torch.opt...
stack_v2_sparse_classes_75kplus_train_065947
6,362
permissive
[ { "docstring": "Train model on the given dataset. Parameters ---------- model: BaseModel Model to train. dataset: FieldDataset Dataset to use. n_epoch: int Number of iterations through the dataset. lr: float Learning rate. parameters_to_optimize: None or tuple of model's parameters Will optimize loss over this ...
6
stack_v2_sparse_classes_30k_train_034446
Implement the Python class `NNTrainer` described below. Class description: Class for neural-networks training. Method signatures and docstrings: - def train_model(self, model, dataset, n_epoch=1, lr=0.001, parameters_to_optimize=None, loss_pattern=None, log_every=None, evaluate_every=None, test_frac=0, dump_best_para...
Implement the Python class `NNTrainer` described below. Class description: Class for neural-networks training. Method signatures and docstrings: - def train_model(self, model, dataset, n_epoch=1, lr=0.001, parameters_to_optimize=None, loss_pattern=None, log_every=None, evaluate_every=None, test_frac=0, dump_best_para...
3b336ed110ff806316f1f6a99b212f99256a6b56
<|skeleton|> class NNTrainer: """Class for neural-networks training.""" def train_model(self, model, dataset, n_epoch=1, lr=0.001, parameters_to_optimize=None, loss_pattern=None, log_every=None, evaluate_every=None, test_frac=0, dump_best_parameters=None, optimizer=torch.optim.Adam, scheduler=partial(torch.opt...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class NNTrainer: """Class for neural-networks training.""" def train_model(self, model, dataset, n_epoch=1, lr=0.001, parameters_to_optimize=None, loss_pattern=None, log_every=None, evaluate_every=None, test_frac=0, dump_best_parameters=None, optimizer=torch.optim.Adam, scheduler=partial(torch.optim.lr_schedul...
the_stack_v2_python_sparse
deepfield/metamodelling/training.py
scuervo91/DeepField
train
0
589857bd6234392e36f0991be93fe854536c96f9
[ "self.sys = platform.system()\nself.name = netName or settings.ADSL_NAME\nself.url = url or settings.IP138_URL\nself.token = token or settings.IP138_TOKEN\nself.user = user or settings.ADSL_USER\nself.password = password or settings.ADSL_PASSWORD\nself.ip = self.refreshIP()\nself.status = False\nif self.sys == 'Win...
<|body_start_0|> self.sys = platform.system() self.name = netName or settings.ADSL_NAME self.url = url or settings.IP138_URL self.token = token or settings.IP138_TOKEN self.user = user or settings.ADSL_USER self.password = password or settings.ADSL_PASSWORD self.i...
ADSL_Tool
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ADSL_Tool: def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None): """user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138提供的ip查询接口 当同时使用了url与token参数,默认会调用token返回ip地址""" <|body_0|> def cmd(self, commands): ...
stack_v2_sparse_classes_75kplus_train_065948
3,858
no_license
[ { "docstring": "user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138提供的ip查询接口 当同时使用了url与token参数,默认会调用token返回ip地址", "name": "__init__", "signature": "def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None)" }, { "docstring": "comm...
6
stack_v2_sparse_classes_30k_train_053265
Implement the Python class `ADSL_Tool` described below. Class description: Implement the ADSL_Tool class. Method signatures and docstrings: - def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None): user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138...
Implement the Python class `ADSL_Tool` described below. Class description: Implement the ADSL_Tool class. Method signatures and docstrings: - def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None): user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138...
54bf8cc8fba72a1177ce3279a3e0f7a7a8fc754e
<|skeleton|> class ADSL_Tool: def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None): """user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138提供的ip查询接口 当同时使用了url与token参数,默认会调用token返回ip地址""" <|body_0|> def cmd(self, commands): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ADSL_Tool: def __init__(self, netName='adslproxy', user=None, password=None, url=None, token=None): """user: windows使用者的adsl用户账号 password: windows使用者的adsl密码 url: ip138的ip查询临时url token: ip138提供的ip查询接口 当同时使用了url与token参数,默认会调用token返回ip地址""" self.sys = platform.system() self.name = netName...
the_stack_v2_python_sparse
adsl_py/adsl.py
crystalxiao/myspider
train
0
faa581470bb770c5b7e886fd25ebb7c27f47aecc
[ "tel_id = h.get_teldata_list()\ntel_num = h.get_num_telescope()\ntel_posX = [-1] * u.m\ntel_posY = [-1] * u.m\ntel_posZ = [-1] * u.m\nreturn (tel_id, tel_num, tel_posX, tel_posY, tel_posZ)", "hdulist = item\nteles = hdulist[1].data\ntel_id = teles['TelID']\ntel_num = len(tel_id)\ntel_posX = teles['TelX'] * u.m\nt...
<|body_start_0|> tel_id = h.get_teldata_list() tel_num = h.get_num_telescope() tel_posX = [-1] * u.m tel_posY = [-1] * u.m tel_posZ = [-1] * u.m return (tel_id, tel_num, tel_posX, tel_posY, tel_posZ) <|end_body_0|> <|body_start_1|> hdulist = item teles = ...
`Initialize` is a class containing the initialize functions for the different file extensions
Initialize
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Initialize: """`Initialize` is a class containing the initialize functions for the different file extensions""" def _initialize_hessio(filename, item): """reads the Telescope data out of the open hessio file Parameters ---------- filename: string name of the hessio file (must be a he...
stack_v2_sparse_classes_75kplus_train_065949
3,190
no_license
[ { "docstring": "reads the Telescope data out of the open hessio file Parameters ---------- filename: string name of the hessio file (must be a hessio file!)", "name": "_initialize_hessio", "signature": "def _initialize_hessio(filename, item)" }, { "docstring": "reads the Telescope data out of th...
3
stack_v2_sparse_classes_30k_train_014890
Implement the Python class `Initialize` described below. Class description: `Initialize` is a class containing the initialize functions for the different file extensions Method signatures and docstrings: - def _initialize_hessio(filename, item): reads the Telescope data out of the open hessio file Parameters --------...
Implement the Python class `Initialize` described below. Class description: `Initialize` is a class containing the initialize functions for the different file extensions Method signatures and docstrings: - def _initialize_hessio(filename, item): reads the Telescope data out of the open hessio file Parameters --------...
3308978bcd0f02abc9ca34f028a24d9689fb6364
<|skeleton|> class Initialize: """`Initialize` is a class containing the initialize functions for the different file extensions""" def _initialize_hessio(filename, item): """reads the Telescope data out of the open hessio file Parameters ---------- filename: string name of the hessio file (must be a he...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Initialize: """`Initialize` is a class containing the initialize functions for the different file extensions""" def _initialize_hessio(filename, item): """reads the Telescope data out of the open hessio file Parameters ---------- filename: string name of the hessio file (must be a hessio file!)""...
the_stack_v2_python_sparse
instrument/telescope/TelescopeDescription_20151203.py
justuszorn/CTA_InstrumentModule_Backup
train
0
96a8e020a72d791a55bf963cc8fc9d8fe4217538
[ "max_len = 0\nA_set = set(A)\n\ndef backtrack(cur_seq):\n nonlocal max_len\n next = cur_seq[-1] + cur_seq[-2]\n if next in A_set:\n cur_seq.append(next)\n backtrack(cur_seq)\n else:\n max_len = max(max_len, len(cur_seq))\nfor i in range(len(A) - 1):\n for j in range(i + 1, len(A)...
<|body_start_0|> max_len = 0 A_set = set(A) def backtrack(cur_seq): nonlocal max_len next = cur_seq[-1] + cur_seq[-2] if next in A_set: cur_seq.append(next) backtrack(cur_seq) else: max_len = max(max...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lenLongestFibSubseq(self, A): """:type A: List[int] :rtype: int""" <|body_0|> def lenLongestFibSubseq2(self, A): """:type A: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> max_len = 0 A_set = set(A) ...
stack_v2_sparse_classes_75kplus_train_065950
1,219
no_license
[ { "docstring": ":type A: List[int] :rtype: int", "name": "lenLongestFibSubseq", "signature": "def lenLongestFibSubseq(self, A)" }, { "docstring": ":type A: List[int] :rtype: int", "name": "lenLongestFibSubseq2", "signature": "def lenLongestFibSubseq2(self, A)" } ]
2
stack_v2_sparse_classes_30k_train_041472
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lenLongestFibSubseq(self, A): :type A: List[int] :rtype: int - def lenLongestFibSubseq2(self, A): :type A: List[int] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lenLongestFibSubseq(self, A): :type A: List[int] :rtype: int - def lenLongestFibSubseq2(self, A): :type A: List[int] :rtype: int <|skeleton|> class Solution: def lenLon...
4a1747b6497305f3821612d9c358a6795b1690da
<|skeleton|> class Solution: def lenLongestFibSubseq(self, A): """:type A: List[int] :rtype: int""" <|body_0|> def lenLongestFibSubseq2(self, A): """:type A: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def lenLongestFibSubseq(self, A): """:type A: List[int] :rtype: int""" max_len = 0 A_set = set(A) def backtrack(cur_seq): nonlocal max_len next = cur_seq[-1] + cur_seq[-2] if next in A_set: cur_seq.append(next) ...
the_stack_v2_python_sparse
DynamicProgramming/q873_length_of_longest_fibonacci_subsequence.py
sevenhe716/LeetCode
train
0
382db0d228e8136c6eef0b0e670b1762ce0acb71
[ "sql = \"\\n SELECT\\n *\\n FROM\\n (SELECT\\n CONCAT(t.name, '-', e.model) e_name, COUNT(*) type_count\\n FROM\\n cmdb.cmdb_equipment e, cmdb.cmdb_baseequipmenttype t, cmdb.cmdb_basefactory f\\n ...
<|body_start_0|> sql = "\n SELECT\n *\n FROM\n (SELECT\n CONCAT(t.name, '-', e.model) e_name, COUNT(*) type_count\n FROM\n cmdb.cmdb_equipment e, cmdb.cmdb_baseequipmenttype t, cmdb.cmdb_basefactory f\n ...
EquipmentManage
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EquipmentManage: def equipment_type_group_count(self, custid=None): """统计网络设备数量,按设备类型分类统计 :return:""" <|body_0|> def month_group_count(self, month_value_dict, custid=None): """获取当前月份以及之前12月内所有设备数量统计 :param custid: 客户ID :return:""" <|body_1|> <|end_skeleton|>...
stack_v2_sparse_classes_75kplus_train_065951
9,914
permissive
[ { "docstring": "统计网络设备数量,按设备类型分类统计 :return:", "name": "equipment_type_group_count", "signature": "def equipment_type_group_count(self, custid=None)" }, { "docstring": "获取当前月份以及之前12月内所有设备数量统计 :param custid: 客户ID :return:", "name": "month_group_count", "signature": "def month_group_count(s...
2
null
Implement the Python class `EquipmentManage` described below. Class description: Implement the EquipmentManage class. Method signatures and docstrings: - def equipment_type_group_count(self, custid=None): 统计网络设备数量,按设备类型分类统计 :return: - def month_group_count(self, month_value_dict, custid=None): 获取当前月份以及之前12月内所有设备数量统计 ...
Implement the Python class `EquipmentManage` described below. Class description: Implement the EquipmentManage class. Method signatures and docstrings: - def equipment_type_group_count(self, custid=None): 统计网络设备数量,按设备类型分类统计 :return: - def month_group_count(self, month_value_dict, custid=None): 获取当前月份以及之前12月内所有设备数量统计 ...
002f80dcc07e3502610b0a0be1e91fe61bcfc42c
<|skeleton|> class EquipmentManage: def equipment_type_group_count(self, custid=None): """统计网络设备数量,按设备类型分类统计 :return:""" <|body_0|> def month_group_count(self, month_value_dict, custid=None): """获取当前月份以及之前12月内所有设备数量统计 :param custid: 客户ID :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EquipmentManage: def equipment_type_group_count(self, custid=None): """统计网络设备数量,按设备类型分类统计 :return:""" sql = "\n SELECT\n *\n FROM\n (SELECT\n CONCAT(t.name, '-', e.model) e_name, COUNT(*) type_count\n FROM\n ...
the_stack_v2_python_sparse
cmdb/afcat/cmdb/packages/cmdbmanger.py
tonglinge/MyProjects
train
4
2cecf00407ae0f3a914afd50bad69d7edb990522
[ "self.name = name\nself.sgm = {}\nself.psarj = []\nself.ssarj = []\nself.read_sgm()\nself.eqv_15deg()", "with open(self.name) as f:\n for i, line in enumerate(f):\n line_split = line.split(sep=',')\n if i > 2:\n line_split[0] = int(line_split[0])\n label = line_split[0]\n ...
<|body_start_0|> self.name = name self.sgm = {} self.psarj = [] self.ssarj = [] self.read_sgm() self.eqv_15deg() <|end_body_0|> <|body_start_1|> with open(self.name) as f: for i, line in enumerate(f): line_split = line.split(sep=',') ...
Class of object to represent the sgm file, csv of inc.
SGM
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SGM: """Class of object to represent the sgm file, csv of inc.""" def __init__(self, name): """Method to initialize.""" <|body_0|> def read_sgm(self): """Method to read in the sgm file and parse.""" <|body_1|> def eqv_15deg(self): """Method t...
stack_v2_sparse_classes_75kplus_train_065952
11,241
no_license
[ { "docstring": "Method to initialize.", "name": "__init__", "signature": "def __init__(self, name)" }, { "docstring": "Method to read in the sgm file and parse.", "name": "read_sgm", "signature": "def read_sgm(self)" }, { "docstring": "Method to round to nearest 15deg increment f...
3
stack_v2_sparse_classes_30k_train_019331
Implement the Python class `SGM` described below. Class description: Class of object to represent the sgm file, csv of inc. Method signatures and docstrings: - def __init__(self, name): Method to initialize. - def read_sgm(self): Method to read in the sgm file and parse. - def eqv_15deg(self): Method to round to near...
Implement the Python class `SGM` described below. Class description: Class of object to represent the sgm file, csv of inc. Method signatures and docstrings: - def __init__(self, name): Method to initialize. - def read_sgm(self): Method to read in the sgm file and parse. - def eqv_15deg(self): Method to round to near...
6b37842203ff4318a48dbf0258cbe2b253436e7d
<|skeleton|> class SGM: """Class of object to represent the sgm file, csv of inc.""" def __init__(self, name): """Method to initialize.""" <|body_0|> def read_sgm(self): """Method to read in the sgm file and parse.""" <|body_1|> def eqv_15deg(self): """Method t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SGM: """Class of object to represent the sgm file, csv of inc.""" def __init__(self, name): """Method to initialize.""" self.name = name self.sgm = {} self.psarj = [] self.ssarj = [] self.read_sgm() self.eqv_15deg() def read_sgm(self): ...
the_stack_v2_python_sparse
thermal/inc.py
tslowery78/PyLnD
train
0
f80f2dfe0c9fe305c4cbe9075e027b947422f23a
[ "if not root:\n return []\nqueue = deque([root])\nresult = []\nwhile queue:\n curr = queue.popleft()\n result.append(curr.val) if curr else result.append(curr)\n if not curr:\n continue\n queue.append(curr.left)\n queue.append(curr.right)\nreturn result", "if not data:\n return None\ni...
<|body_start_0|> if not root: return [] queue = deque([root]) result = [] while queue: curr = queue.popleft() result.append(curr.val) if curr else result.append(curr) if not curr: continue queue.append(curr.left)...
Codec
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_75kplus_train_065953
1,591
permissive
[ { "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
stack_v2_sparse_classes_30k_test_002311
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
8d120162657a1e29c3e821b51ac4121300fc7a12
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return [] queue = deque([root]) result = [] while queue: curr = queue.popleft() result.append(curr.val) if curr e...
the_stack_v2_python_sparse
LeetCode/Tree/297. Serialize and Deserialize Binary Tree.py
thehanemperor/LeetCode
train
0
d897c9ca13ebcfaa38c8b439461ccd66128ae5dc
[ "self.serializer = instance_serializer\nkwargs['source'] = '*'\nsuper().__init__(**kwargs)", "if data == self.parent.context['request'].user.id:\n raise serializers.ValidationError('Cannot be friend with self.')\nreturn {'friend': User.objects.get(id=data)}", "if self.parent.context['request'].user == value....
<|body_start_0|> self.serializer = instance_serializer kwargs['source'] = '*' super().__init__(**kwargs) <|end_body_0|> <|body_start_1|> if data == self.parent.context['request'].user.id: raise serializers.ValidationError('Cannot be friend with self.') return {'frien...
Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pass to the `Field` constructor
FriendField
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FriendField: """Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pass to the `Field` constructor""" d...
stack_v2_sparse_classes_75kplus_train_065954
14,729
no_license
[ { "docstring": "Override the default constructor of field to force the `source` to be the whole object. This also sets the serializer used internally :param kwargs: arguments to pass to the parent constructor", "name": "__init__", "signature": "def __init__(self, instance_serializer, **kwargs)" }, {...
3
stack_v2_sparse_classes_30k_train_019727
Implement the Python class `FriendField` described below. Class description: Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pa...
Implement the Python class `FriendField` described below. Class description: Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pa...
38f0b29e6fc737756ae21a8c193a110876bc221c
<|skeleton|> class FriendField: """Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pass to the `Field` constructor""" d...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class FriendField: """Field for a friend. This will check the `from_account` and `to_account` values and will return the one that is not the current user. :param instance_serializer: serializer used to serialize the friend :param kwargs: additional arguments to pass to the `Field` constructor""" def __init__(s...
the_stack_v2_python_sparse
backend/user/serializers.py
BenjaminSchubert/HEIG_VD_2016_PDG
train
0
d44217a9444780e5f7f8b258bc1a9497b80f4d89
[ "self.dir = experiment_dir\nself.name = self.dir.split('/')[-1]\nself.sessions = {}", "cwd = os.getcwd()\nos.chdir(probe_file_dir)\nprobe_module = import_module(probe_name)\nprobe_class = getattr(probe_module, probe_name)\nos.chdir(cwd)\nself.probe = probe_class()\nself.probe.get_channel_mapping(self.amplifier)\n...
<|body_start_0|> self.dir = experiment_dir self.name = self.dir.split('/')[-1] self.sessions = {} <|end_body_0|> <|body_start_1|> cwd = os.getcwd() os.chdir(probe_file_dir) probe_module = import_module(probe_name) probe_class = getattr(probe_module, probe_name) ...
Experiment
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Experiment: def __init__(self, experiment_dir): """Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experiment. Inputs: -experiment_dir: The directory to the folder that contains the recording session folders...
stack_v2_sparse_classes_75kplus_train_065955
8,147
no_license
[ { "docstring": "Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experiment. Inputs: -experiment_dir: The directory to the folder that contains the recording session folders for the experiment", "name": "__init__", "signatur...
4
stack_v2_sparse_classes_30k_train_001859
Implement the Python class `Experiment` described below. Class description: Implement the Experiment class. Method signatures and docstrings: - def __init__(self, experiment_dir): Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experimen...
Implement the Python class `Experiment` described below. Class description: Implement the Experiment class. Method signatures and docstrings: - def __init__(self, experiment_dir): Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experimen...
9639815b9de793c867a358f73df32e15b5b01544
<|skeleton|> class Experiment: def __init__(self, experiment_dir): """Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experiment. Inputs: -experiment_dir: The directory to the folder that contains the recording session folders...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Experiment: def __init__(self, experiment_dir): """Initialization function of the Experiment class. This class contains the parameters and classes for the overall acute or chronic experiment. Inputs: -experiment_dir: The directory to the folder that contains the recording session folders for the exper...
the_stack_v2_python_sparse
utils/experiment_classes.py
tanselbaran/depth_recordings
train
1
1a29ae6ed997a7ad9ca85526086c6dd3c0431919
[ "formula = self.get_object()\npublic = request.DATA.get('public', None)\nif public is None or len(request.DATA) > 1:\n raise BadRequest('Only \"public\" field of a formula may be modified.')\nif not isinstance(public, bool):\n raise BadRequest(\"'public' field must be a boolean value.\")\nformula.public = pub...
<|body_start_0|> formula = self.get_object() public = request.DATA.get('public', None) if public is None or len(request.DATA) > 1: raise BadRequest('Only "public" field of a formula may be modified.') if not isinstance(public, bool): raise BadRequest("'public' fie...
FormulaDetailAPIView
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FormulaDetailAPIView: def update(self, request, *args, **kwargs): """Override PUT requests to only allow the public field to be changed.""" <|body_0|> def delete(self, request, *args, **kwargs): """Override the delete method to check for ownership and prevent delete ...
stack_v2_sparse_classes_75kplus_train_065956
10,644
permissive
[ { "docstring": "Override PUT requests to only allow the public field to be changed.", "name": "update", "signature": "def update(self, request, *args, **kwargs)" }, { "docstring": "Override the delete method to check for ownership and prevent delete if other resources depend on this formula or o...
2
null
Implement the Python class `FormulaDetailAPIView` described below. Class description: Implement the FormulaDetailAPIView class. Method signatures and docstrings: - def update(self, request, *args, **kwargs): Override PUT requests to only allow the public field to be changed. - def delete(self, request, *args, **kwarg...
Implement the Python class `FormulaDetailAPIView` described below. Class description: Implement the FormulaDetailAPIView class. Method signatures and docstrings: - def update(self, request, *args, **kwargs): Override PUT requests to only allow the public field to be changed. - def delete(self, request, *args, **kwarg...
8dcd9967a9213bdeec666b14e55583c50bdaf57e
<|skeleton|> class FormulaDetailAPIView: def update(self, request, *args, **kwargs): """Override PUT requests to only allow the public field to be changed.""" <|body_0|> def delete(self, request, *args, **kwargs): """Override the delete method to check for ownership and prevent delete ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class FormulaDetailAPIView: def update(self, request, *args, **kwargs): """Override PUT requests to only allow the public field to be changed.""" formula = self.get_object() public = request.DATA.get('public', None) if public is None or len(request.DATA) > 1: raise BadReq...
the_stack_v2_python_sparse
stackdio/server/formulas/api.py
WLPhoenix/stackdio
train
0
be1a32c608ef50c27edb0e9fb9f4c644b50a1837
[ "self._duration = 0\nself._frequency = 65\nself._waves = []\nself._amplitude = 1\nself._next_notes = []", "d = 0\nfor wave in self._waves:\n d += wave.get_duration()\nself._duration = d\nreturn d", "a = 0\nfor wave in self._waves:\n w_a = wave._get_amplitude()\n if w_a > a:\n a = w_a\nself._ampl...
<|body_start_0|> self._duration = 0 self._frequency = 65 self._waves = [] self._amplitude = 1 self._next_notes = [] <|end_body_0|> <|body_start_1|> d = 0 for wave in self._waves: d += wave.get_duration() self._duration = d return d <|e...
A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplitude of the instrument _next_notes: Stores the next notes for the instrument. ...
Holophonor
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Holophonor: """A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplitude of the instrument _next_notes: Stor...
stack_v2_sparse_classes_75kplus_train_065957
30,960
no_license
[ { "docstring": "Initializes an instance of class Holophonor", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "Duration of this Baliset", "name": "get_duration", "signature": "def get_duration(self) -> float" }, { "docstring": "Max amplitude of thi...
6
stack_v2_sparse_classes_30k_train_042432
Implement the Python class `Holophonor` described below. Class description: A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplit...
Implement the Python class `Holophonor` described below. Class description: A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplit...
faa08c32faae732dd04f59a73d0f71579afbe1f5
<|skeleton|> class Holophonor: """A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplitude of the instrument _next_notes: Stor...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Holophonor: """A Holophonor is an instrument === Attributes === _frequency: fundamental frequency of the instrument in Hz. _duration: duration of the wave in seconds. _waves: A list of StutterNote which make up the sound of this instrument _amplitude: Amplitude of the instrument _next_notes: Stores the next n...
the_stack_v2_python_sparse
make_some_noise.py
a2khera/music_simulator
train
0
f6400a1157a563dc0a1162d9bed14478f096afaa
[ "super(ReluNet, self).__init__()\nself.input_dim = input_dim\nself.output_dim = output_dim\nself.hidden_dim = hidden_dim\nself.num_layers = num_layers\nself.num_epochs = num_epochs\nself.threshold = threshold\nself.learning_rate = learning_rate\nself.layers = nn.ModuleList()\nself.layers.append(nn.Linear(input_dim,...
<|body_start_0|> super(ReluNet, self).__init__() self.input_dim = input_dim self.output_dim = output_dim self.hidden_dim = hidden_dim self.num_layers = num_layers self.num_epochs = num_epochs self.threshold = threshold self.learning_rate = learning_rate ...
Fully connected neural network with relu activation
ReluNet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReluNet: """Fully connected neural network with relu activation""" def __init__(self, input_dim, output_dim, hidden_dim=100, num_layers=2, num_epochs=100, learning_rate=0.001, threshold=0.1): """Initilize a Neural Network with Relu activation Args: input_dim: int -- dimension of the ...
stack_v2_sparse_classes_75kplus_train_065958
4,882
no_license
[ { "docstring": "Initilize a Neural Network with Relu activation Args: input_dim: int -- dimension of the input feature output_dim: int -- dimension of the output feature hidden_dim: int -- number of hidden units at each layer num_layers: int -- number of hidden layers num_epochs: int -- number of epochs to trai...
5
stack_v2_sparse_classes_30k_train_018955
Implement the Python class `ReluNet` described below. Class description: Fully connected neural network with relu activation Method signatures and docstrings: - def __init__(self, input_dim, output_dim, hidden_dim=100, num_layers=2, num_epochs=100, learning_rate=0.001, threshold=0.1): Initilize a Neural Network with ...
Implement the Python class `ReluNet` described below. Class description: Fully connected neural network with relu activation Method signatures and docstrings: - def __init__(self, input_dim, output_dim, hidden_dim=100, num_layers=2, num_epochs=100, learning_rate=0.001, threshold=0.1): Initilize a Neural Network with ...
d7e651024b07587b46497183d90934561a4839e2
<|skeleton|> class ReluNet: """Fully connected neural network with relu activation""" def __init__(self, input_dim, output_dim, hidden_dim=100, num_layers=2, num_epochs=100, learning_rate=0.001, threshold=0.1): """Initilize a Neural Network with Relu activation Args: input_dim: int -- dimension of the ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ReluNet: """Fully connected neural network with relu activation""" def __init__(self, input_dim, output_dim, hidden_dim=100, num_layers=2, num_epochs=100, learning_rate=0.001, threshold=0.1): """Initilize a Neural Network with Relu activation Args: input_dim: int -- dimension of the input feature...
the_stack_v2_python_sparse
model/relunet.py
SSF-climate/SSF
train
7
281c9f4ef4996b25288527e8102f4afdc821cdfe
[ "parameters = []\nfor group in groups:\n parameters += [param for param in group]\nsuper().__init__(parameters, lrate=lrate, std_optim=std_optim)\nself._groups = groups\nself._update_count = 0", "if self._std_optim is not None:\n self._std_optim.step()\nif self._update_count >= len(self._groups):\n self....
<|body_start_0|> parameters = [] for group in groups: parameters += [param for param in group] super().__init__(parameters, lrate=lrate, std_optim=std_optim) self._groups = groups self._update_count = 0 <|end_body_0|> <|body_start_1|> if self._std_optim is no...
Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel to be trained and X is >>> # the dataset. >>> elbo_fn = beer.EvidenceLowerBound(len(X)) >>> optim = beer...
BayesianModelCoordinateAscentOptimizer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BayesianModelCoordinateAscentOptimizer: """Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel to be trained and X is >>> # the datas...
stack_v2_sparse_classes_75kplus_train_065959
13,212
permissive
[ { "docstring": "Args: ... (list): N List of ``BayesianParameter``. to be updated separately. lrate (float): learning rate. std_optim (``torch.optim.Optimizer``): Optimizer for non-Bayesian parameters (i.e. standard ``pytorch`` parameters)", "name": "__init__", "signature": "def __init__(self, groups, lr...
2
null
Implement the Python class `BayesianModelCoordinateAscentOptimizer` described below. Class description: Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel...
Implement the Python class `BayesianModelCoordinateAscentOptimizer` described below. Class description: Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel...
6fe968c7ca4864437890aa6bd705755c2580696e
<|skeleton|> class BayesianModelCoordinateAscentOptimizer: """Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel to be trained and X is >>> # the datas...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BayesianModelCoordinateAscentOptimizer: """Optimizer that update iteratively groups of parameters. This optimizer is suited for model like PPCA which cannot estimate the gradient of all its paramaters at once. Example: >>> # Assume "model" is a BayesianModel to be trained and X is >>> # the dataset. >>> elbo_...
the_stack_v2_python_sparse
beer/vbi.py
bolajiy/beer
train
0
5a0aa3c571a2b2c460401d7837dc71a3d28d2ad7
[ "self.transformed_collection: list[TiTransform] = []\nfor ti_dict in self.ti_dicts:\n self.transformed_collection.append(TiTransform(ti_dict, self.transforms))", "self.process()\nbatch = {'group': [], 'indicator': []}\nself.log.trace(f'feature=ti-transform-batch, ti-count={len(self.transformed_collection)}')\n...
<|body_start_0|> self.transformed_collection: list[TiTransform] = [] for ti_dict in self.ti_dicts: self.transformed_collection.append(TiTransform(ti_dict, self.transforms)) <|end_body_0|> <|body_start_1|> self.process() batch = {'group': [], 'indicator': []} self.log...
Mappings
TiTransforms
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TiTransforms: """Mappings""" def process(self): """Process the mapping.""" <|body_0|> def batch(self) -> dict: """Return the data in batch format.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.transformed_collection: list[TiTransform] = [...
stack_v2_sparse_classes_75kplus_train_065960
6,246
permissive
[ { "docstring": "Process the mapping.", "name": "process", "signature": "def process(self)" }, { "docstring": "Return the data in batch format.", "name": "batch", "signature": "def batch(self) -> dict" } ]
2
stack_v2_sparse_classes_30k_train_026025
Implement the Python class `TiTransforms` described below. Class description: Mappings Method signatures and docstrings: - def process(self): Process the mapping. - def batch(self) -> dict: Return the data in batch format.
Implement the Python class `TiTransforms` described below. Class description: Mappings Method signatures and docstrings: - def process(self): Process the mapping. - def batch(self) -> dict: Return the data in batch format. <|skeleton|> class TiTransforms: """Mappings""" def process(self): """Process...
30dc147e40d63d1082ec2a5e6c62005b60c29c37
<|skeleton|> class TiTransforms: """Mappings""" def process(self): """Process the mapping.""" <|body_0|> def batch(self) -> dict: """Return the data in batch format.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TiTransforms: """Mappings""" def process(self): """Process the mapping.""" self.transformed_collection: list[TiTransform] = [] for ti_dict in self.ti_dicts: self.transformed_collection.append(TiTransform(ti_dict, self.transforms)) def batch(self) -> dict: ...
the_stack_v2_python_sparse
tcex/api/tc/ti_transform/ti_transform.py
ThreatConnect-Inc/tcex
train
24
60e3f8764853e5156982855ae193d1cdba1ed48f
[ "super(Instance, self).__init__(resource_id=instance_id, resource_type=resource.ResourceType.INSTANCE, name=kwargs.get('name'), display_name=kwargs.get('name'), parent=parent, locations=kwargs.get('locations'))\nif parent and parent.type != 'project':\n raise TypeError('Unexpected parent type: got {}, want proje...
<|body_start_0|> super(Instance, self).__init__(resource_id=instance_id, resource_type=resource.ResourceType.INSTANCE, name=kwargs.get('name'), display_name=kwargs.get('name'), parent=parent, locations=kwargs.get('locations')) if parent and parent.type != 'project': raise TypeError('Unexpect...
Represents Instance resource.
Instance
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Instance: """Represents Instance resource.""" def __init__(self, instance_id, parent=None, **kwargs): """Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Should be a project. **kwargs (dict): The object's attributes....
stack_v2_sparse_classes_75kplus_train_065961
10,814
permissive
[ { "docstring": "Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Should be a project. **kwargs (dict): The object's attributes. Raises: TypeError: If unexpected parent type.", "name": "__init__", "signature": "def __init__(self, instanc...
6
stack_v2_sparse_classes_30k_train_001301
Implement the Python class `Instance` described below. Class description: Represents Instance resource. Method signatures and docstrings: - def __init__(self, instance_id, parent=None, **kwargs): Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Shoul...
Implement the Python class `Instance` described below. Class description: Represents Instance resource. Method signatures and docstrings: - def __init__(self, instance_id, parent=None, **kwargs): Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Shoul...
d4421afa50a17ed47cbebe942044ebab3720e0f5
<|skeleton|> class Instance: """Represents Instance resource.""" def __init__(self, instance_id, parent=None, **kwargs): """Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Should be a project. **kwargs (dict): The object's attributes....
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Instance: """Represents Instance resource.""" def __init__(self, instance_id, parent=None, **kwargs): """Instance resource. Args: instance_id (str): id of the instance. parent (Resource): Parent resource of this instance. Should be a project. **kwargs (dict): The object's attributes. Raises: Type...
the_stack_v2_python_sparse
google/cloud/forseti/common/gcp_type/instance.py
kevensen/forseti-security
train
1
61777ce76fa0aa407cfce3f0c6fc81db02d04523
[ "super(WeightQuantizerLS2, self).__init__()\nself.register_buffer('v1', torch.tensor([0.0] * size))\nself.register_buffer('v2', torch.tensor([0.0] * size))", "if self.training:\n v1, v2, w_q = quantization.quantizer_ls_2(w, skip=skip)\n self.v1.copy_(v1)\n self.v2.copy_(v2)\nelse:\n _, _, w_q = quanti...
<|body_start_0|> super(WeightQuantizerLS2, self).__init__() self.register_buffer('v1', torch.tensor([0.0] * size)) self.register_buffer('v2', torch.tensor([0.0] * size)) <|end_body_0|> <|body_start_1|> if self.training: v1, v2, w_q = quantization.quantizer_ls_2(w, skip=skip)...
Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization.
WeightQuantizerLS2
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WeightQuantizerLS2: """Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization.""" def __init__(self, size: int) -> None: """Construct a weight quantizer using l...
stack_v2_sparse_classes_75kplus_train_065962
4,037
no_license
[ { "docstring": "Construct a weight quantizer using least squares with 2 bits.", "name": "__init__", "signature": "def __init__(self, size: int) -> None" }, { "docstring": "Forward pass of quantizing weight using least squares 2 bits.", "name": "forward", "signature": "def forward(self, w...
2
stack_v2_sparse_classes_30k_train_051005
Implement the Python class `WeightQuantizerLS2` described below. Class description: Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization. Method signatures and docstrings: - def __init__(self,...
Implement the Python class `WeightQuantizerLS2` described below. Class description: Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization. Method signatures and docstrings: - def __init__(self,...
39197b5f54cd84ff35022c851dd2dcb753ca6b89
<|skeleton|> class WeightQuantizerLS2: """Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization.""" def __init__(self, size: int) -> None: """Construct a weight quantizer using l...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class WeightQuantizerLS2: """Weight quantizer using least squares, 2 bits. In training mode, the optimal scalars are computed and cached. In eval mode, the cached scalars are used to compute the quantization.""" def __init__(self, size: int) -> None: """Construct a weight quantizer using least squares ...
the_stack_v2_python_sparse
quant/binary/weight_quantization.py
mikechen66/ml-quant
train
0
2b88076fae52ade5de17e2de5d7a3fd09a1773a7
[ "if rowIndex < 0:\n return []\nbuild = [0 for i in range(rowIndex + 1)]\nbuild[0] = 1\nfor row in range(1, rowIndex + 1):\n pre = build[0]\n for i in range(1, row + 1):\n temp = build[i]\n build[i] += pre\n pre = temp\n build[row] = 1\nreturn build", "res = [1] * (rowIndex + 1)\nf...
<|body_start_0|> if rowIndex < 0: return [] build = [0 for i in range(rowIndex + 1)] build[0] = 1 for row in range(1, rowIndex + 1): pre = build[0] for i in range(1, row + 1): temp = build[i] build[i] += pre ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def getRow(self, rowIndex): """:type rowIndex: int :rtype: List[int]""" <|body_0|> def getRow2(self, rowIndex): """:type rowIndex: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> if rowIndex < 0: return []...
stack_v2_sparse_classes_75kplus_train_065963
1,538
no_license
[ { "docstring": ":type rowIndex: int :rtype: List[int]", "name": "getRow", "signature": "def getRow(self, rowIndex)" }, { "docstring": ":type rowIndex: int :rtype: List[int]", "name": "getRow2", "signature": "def getRow2(self, rowIndex)" } ]
2
stack_v2_sparse_classes_30k_train_046490
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getRow(self, rowIndex): :type rowIndex: int :rtype: List[int] - def getRow2(self, rowIndex): :type rowIndex: int :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getRow(self, rowIndex): :type rowIndex: int :rtype: List[int] - def getRow2(self, rowIndex): :type rowIndex: int :rtype: List[int] <|skeleton|> class Solution: def getR...
635af6e22aa8eef8e7920a585d43a45a891a8157
<|skeleton|> class Solution: def getRow(self, rowIndex): """:type rowIndex: int :rtype: List[int]""" <|body_0|> def getRow2(self, rowIndex): """:type rowIndex: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def getRow(self, rowIndex): """:type rowIndex: int :rtype: List[int]""" if rowIndex < 0: return [] build = [0 for i in range(rowIndex + 1)] build[0] = 1 for row in range(1, rowIndex + 1): pre = build[0] for i in range(1, row...
the_stack_v2_python_sparse
code119PascalsTriangleII.py
cybelewang/leetcode-python
train
0
6bf8fbfd054fa302153423bdcd86d6a2603572ea
[ "try:\n if mode == 'r':\n if is_py2():\n return open(str(name), 'rb', buffering=1)\n else:\n kwargs = dict(buffering=1, newline='', encoding=encoding)\n return open(str(name), 'r', **kwargs)\n elif mode == 'w':\n if is_py2():\n return open(str(n...
<|body_start_0|> try: if mode == 'r': if is_py2(): return open(str(name), 'rb', buffering=1) else: kwargs = dict(buffering=1, newline='', encoding=encoding) return open(str(name), 'r', **kwargs) e...
Read and write CSV files to and from lists of dictionaries
CSVAdapter
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CSVAdapter: """Read and write CSV files to and from lists of dictionaries""" def open_csv_file(name, mode, encoding=None): """:type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file""" <|body_0|> def guess_delimiter_from_filename(filename): ...
stack_v2_sparse_classes_75kplus_train_065964
7,527
permissive
[ { "docstring": ":type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file", "name": "open_csv_file", "signature": "def open_csv_file(name, mode, encoding=None)" }, { "docstring": ":type filename :rtype str", "name": "guess_delimiter_from_filename", "signature": ...
4
stack_v2_sparse_classes_30k_val_002486
Implement the Python class `CSVAdapter` described below. Class description: Read and write CSV files to and from lists of dictionaries Method signatures and docstrings: - def open_csv_file(name, mode, encoding=None): :type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file - def guess_delim...
Implement the Python class `CSVAdapter` described below. Class description: Read and write CSV files to and from lists of dictionaries Method signatures and docstrings: - def open_csv_file(name, mode, encoding=None): :type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file - def guess_delim...
15a228b6f3d4b12efe213eec1bf599c8a56840a3
<|skeleton|> class CSVAdapter: """Read and write CSV files to and from lists of dictionaries""" def open_csv_file(name, mode, encoding=None): """:type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file""" <|body_0|> def guess_delimiter_from_filename(filename): ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CSVAdapter: """Read and write CSV files to and from lists of dictionaries""" def open_csv_file(name, mode, encoding=None): """:type name: str :type mode: str :type encoding: str, but ignored in py2 :rtype file""" try: if mode == 'r': if is_py2(): ...
the_stack_v2_python_sparse
user_sync/helper.py
adobe-apiplatform/user-sync.py
train
96
c76ce85112c52bafde6e529ee6819b36ee420489
[ "self.query = query or pywikibot.input('Please enter the search query:')\nif site is None:\n site = pywikibot.Site()\nself.site = site\nself._google_query = None", "try:\n import google\nexcept ImportError:\n pywikibot.error(\"generator GoogleSearchPageGenerator depends on package 'google'.\\nTo install,...
<|body_start_0|> self.query = query or pywikibot.input('Please enter the search query:') if site is None: site = pywikibot.Site() self.site = site self._google_query = None <|end_body_0|> <|body_start_1|> try: import google except ImportError: ...
Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and provided by PyPI since 2013. As there are concerns about Google's Terms of Service, this gen...
GoogleSearchPageGenerator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GoogleSearchPageGenerator: """Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and provided by PyPI since 2013. As there a...
stack_v2_sparse_classes_75kplus_train_065965
43,909
permissive
[ { "docstring": "Initializer. :param site: Site for generator results.", "name": "__init__", "signature": "def __init__(self, query: Optional[str]=None, site: OPT_SITE_TYPE=None) -> None" }, { "docstring": "Perform a query using python package 'google'. The terms of service as at June 2014 give t...
3
stack_v2_sparse_classes_30k_train_021061
Implement the Python class `GoogleSearchPageGenerator` described below. Class description: Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and ...
Implement the Python class `GoogleSearchPageGenerator` described below. Class description: Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and ...
5c01e6bfcd328bc6eae643e661f1a0ae57612808
<|skeleton|> class GoogleSearchPageGenerator: """Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and provided by PyPI since 2013. As there a...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class GoogleSearchPageGenerator: """Page generator using Google search results. To use this generator, you need to install the package 'google': :py:obj:`https://pypi.org/project/google` This package has been available since 2010, hosted on GitHub since 2012, and provided by PyPI since 2013. As there are concerns a...
the_stack_v2_python_sparse
pywikibot/pagegenerators/_generators.py
wikimedia/pywikibot
train
432
cb4af0bd557b6baba0f6425869bd52d119c005a1
[ "pagination = context_utils.get_pagination()\nquery = LoginLogs.query.order_by(LoginLogs.id.desc())\npagination = query.paginate(pagination.page_no, pagination.page_size)\npagination = pagination_utils.get_pagination_sqlalchemy(pagination)\nreturn pagination", "context = db.get_app().app_context()\n\ndef do_save(...
<|body_start_0|> pagination = context_utils.get_pagination() query = LoginLogs.query.order_by(LoginLogs.id.desc()) pagination = query.paginate(pagination.page_no, pagination.page_size) pagination = pagination_utils.get_pagination_sqlalchemy(pagination) return pagination <|end_bod...
用户登录业务接口
LoginLogsService
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LoginLogsService: """用户登录业务接口""" def get_page_loginlogs(): """返回分页对象""" <|body_0|> def add_loginlogs(loginlogs): """添加登录日志""" <|body_1|> <|end_skeleton|> <|body_start_0|> pagination = context_utils.get_pagination() query = LoginLogs.quer...
stack_v2_sparse_classes_75kplus_train_065966
1,444
no_license
[ { "docstring": "返回分页对象", "name": "get_page_loginlogs", "signature": "def get_page_loginlogs()" }, { "docstring": "添加登录日志", "name": "add_loginlogs", "signature": "def add_loginlogs(loginlogs)" } ]
2
null
Implement the Python class `LoginLogsService` described below. Class description: 用户登录业务接口 Method signatures and docstrings: - def get_page_loginlogs(): 返回分页对象 - def add_loginlogs(loginlogs): 添加登录日志
Implement the Python class `LoginLogsService` described below. Class description: 用户登录业务接口 Method signatures and docstrings: - def get_page_loginlogs(): 返回分页对象 - def add_loginlogs(loginlogs): 添加登录日志 <|skeleton|> class LoginLogsService: """用户登录业务接口""" def get_page_loginlogs(): """返回分页对象""" <|...
a3027259b2f5275f81ab530a3fdf53c97c23f863
<|skeleton|> class LoginLogsService: """用户登录业务接口""" def get_page_loginlogs(): """返回分页对象""" <|body_0|> def add_loginlogs(loginlogs): """添加登录日志""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class LoginLogsService: """用户登录业务接口""" def get_page_loginlogs(): """返回分页对象""" pagination = context_utils.get_pagination() query = LoginLogs.query.order_by(LoginLogs.id.desc()) pagination = query.paginate(pagination.page_no, pagination.page_size) pagination = pagination_u...
the_stack_v2_python_sparse
blog/services/logs_service.py
foxandyhu/projects
train
0
f2b678dc1aecc282ec2f10e6f05cd72091c573a8
[ "source_path = PathConvertor.build_path_without_trailing_slash(local_path)\nbasename = os.path.basename(source_path)\nfolder_name = os.path.expanduser(os.path.dirname(source_path))\ntarget_dir = PathConvertor.build_path_with_trailing_slash(remote_dir)\nmkdir_script = f\"ssh -o StrictHostKeyChecking=no -p {node_ssh_...
<|body_start_0|> source_path = PathConvertor.build_path_without_trailing_slash(local_path) basename = os.path.basename(source_path) folder_name = os.path.expanduser(os.path.dirname(source_path)) target_dir = PathConvertor.build_path_with_trailing_slash(remote_dir) mkdir_script = ...
Synchronizer class for files.
FileSynchronizer
[ "LicenseRef-scancode-generic-cla", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileSynchronizer: """Synchronizer class for files.""" def copy_files_to_node(local_path: str, remote_dir: str, node_username: str, node_hostname: str, node_ssh_port: int) -> None: """Copy local files to node, automatically create folder if not exist. Args: local_path (str): path of t...
stack_v2_sparse_classes_75kplus_train_065967
6,685
permissive
[ { "docstring": "Copy local files to node, automatically create folder if not exist. Args: local_path (str): path of the local file. remote_dir (str): dir for remote files. node_username (str): username of the vm. node_hostname (str): hostname of the vm. node_ssh_port (int): port of the ssh connection.", "na...
3
null
Implement the Python class `FileSynchronizer` described below. Class description: Synchronizer class for files. Method signatures and docstrings: - def copy_files_to_node(local_path: str, remote_dir: str, node_username: str, node_hostname: str, node_ssh_port: int) -> None: Copy local files to node, automatically crea...
Implement the Python class `FileSynchronizer` described below. Class description: Synchronizer class for files. Method signatures and docstrings: - def copy_files_to_node(local_path: str, remote_dir: str, node_username: str, node_hostname: str, node_ssh_port: int) -> None: Copy local files to node, automatically crea...
b3c6a589ad9036b03221e776a6929b2bc1eb4680
<|skeleton|> class FileSynchronizer: """Synchronizer class for files.""" def copy_files_to_node(local_path: str, remote_dir: str, node_username: str, node_hostname: str, node_ssh_port: int) -> None: """Copy local files to node, automatically create folder if not exist. Args: local_path (str): path of t...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class FileSynchronizer: """Synchronizer class for files.""" def copy_files_to_node(local_path: str, remote_dir: str, node_username: str, node_hostname: str, node_ssh_port: int) -> None: """Copy local files to node, automatically create folder if not exist. Args: local_path (str): path of the local file...
the_stack_v2_python_sparse
maro/cli/grass/utils/file_synchronizer.py
microsoft/maro
train
764
b7430d53b55a61c1e7153ec971d49b72b8a0b563
[ "self.n_classes = number_class\nself.is_training = is_training\nself.is_simplified = is_simplified\nself.dropout = dropout", "if not self.is_simplified:\n net, _ = unet.unet(input_batch, self.n_classes, is_training=is_training, dropout=dropout, weight_decay=0.0005)\nelse:\n net, _ = simplified_unet.unet(inp...
<|body_start_0|> self.n_classes = number_class self.is_training = is_training self.is_simplified = is_simplified self.dropout = dropout <|end_body_0|> <|body_start_1|> if not self.is_simplified: net, _ = unet.unet(input_batch, self.n_classes, is_training=is_training,...
UnetModel
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" <|body_0|> def _create_network(self, input_batch, dropout=False, is_training=True): """Args: input_batch: batch of pre-processed images. keep_pr...
stack_v2_sparse_classes_75kplus_train_065968
4,646
permissive
[ { "docstring": "Create the model", "name": "__init__", "signature": "def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True)" }, { "docstring": "Args: input_batch: batch of pre-processed images. keep_prob: probability of keeping neurons intact. Returns: A downsamp...
5
stack_v2_sparse_classes_30k_val_000168
Implement the Python class `UnetModel` described below. Class description: Implement the UnetModel class. Method signatures and docstrings: - def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): Create the model - def _create_network(self, input_batch, dropout=False, is_training=Tr...
Implement the Python class `UnetModel` described below. Class description: Implement the UnetModel class. Method signatures and docstrings: - def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): Create the model - def _create_network(self, input_batch, dropout=False, is_training=Tr...
57904544c6d6b43dcd5937afeb474c0a47456d98
<|skeleton|> class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" <|body_0|> def _create_network(self, input_batch, dropout=False, is_training=True): """Args: input_batch: batch of pre-processed images. keep_pr...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class UnetModel: def __init__(self, number_class=3, is_training=True, is_simplified=False, dropout=True): """Create the model""" self.n_classes = number_class self.is_training = is_training self.is_simplified = is_simplified self.dropout = dropout def _create_network(sel...
the_stack_v2_python_sparse
models/model_unet.py
cliang1453/IHC-based-labels-generation-and-semantic-segmentation-for-lung-cancer
train
0
7c05fb6bdc88876cce6ca8e3aac44c7a98c1003a
[ "if MUTED:\n return MutedSound()\nelse:\n return pygame.mixer.Sound(os.path.join('data', 'sounds', name))", "if not MUTED and False:\n pygame.mixer.music.load(os.path.join('data', 'music', name))\n pygame.mixer.music.play(-1)" ]
<|body_start_0|> if MUTED: return MutedSound() else: return pygame.mixer.Sound(os.path.join('data', 'sounds', name)) <|end_body_0|> <|body_start_1|> if not MUTED and False: pygame.mixer.music.load(os.path.join('data', 'music', name)) pygame.mixer....
Handle sounds
_Sounds
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _Sounds: """Handle sounds""" def getSound(self, name): """Return a new sound""" <|body_0|> def playMusic(self, name): """Return a new sound""" <|body_1|> <|end_skeleton|> <|body_start_0|> if MUTED: return MutedSound() else: ...
stack_v2_sparse_classes_75kplus_train_065969
638
permissive
[ { "docstring": "Return a new sound", "name": "getSound", "signature": "def getSound(self, name)" }, { "docstring": "Return a new sound", "name": "playMusic", "signature": "def playMusic(self, name)" } ]
2
stack_v2_sparse_classes_30k_train_045780
Implement the Python class `_Sounds` described below. Class description: Handle sounds Method signatures and docstrings: - def getSound(self, name): Return a new sound - def playMusic(self, name): Return a new sound
Implement the Python class `_Sounds` described below. Class description: Handle sounds Method signatures and docstrings: - def getSound(self, name): Return a new sound - def playMusic(self, name): Return a new sound <|skeleton|> class _Sounds: """Handle sounds""" def getSound(self, name): """Return ...
cee7e4b5dc28c57a6c912852827652b5f51005ae
<|skeleton|> class _Sounds: """Handle sounds""" def getSound(self, name): """Return a new sound""" <|body_0|> def playMusic(self, name): """Return a new sound""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class _Sounds: """Handle sounds""" def getSound(self, name): """Return a new sound""" if MUTED: return MutedSound() else: return pygame.mixer.Sound(os.path.join('data', 'sounds', name)) def playMusic(self, name): """Return a new sound""" if n...
the_stack_v2_python_sparse
IE_games_8/unvisible-0.4.0/unvisible/sound.py
IndexErrorCoders/PygamesCompilation
train
2
e95f4924ef775cac6b7c3da500adcddf85641b37
[ "super().__init__()\nself.hidden_layers = nn.ModuleList([nn.Linear(n_input, hiddens[0])])\nhidden_sizes = zip(hiddens[:-1], hiddens[1:])\nself.hidden_layers.extend([nn.Linear(h1, h2) for h1, h2 in hidden_sizes])\nself.output = nn.Linear(hiddens[-1], n_output)\nself.dropout = nn.Dropout(p=p_dropout)", "for each_hi...
<|body_start_0|> super().__init__() self.hidden_layers = nn.ModuleList([nn.Linear(n_input, hiddens[0])]) hidden_sizes = zip(hiddens[:-1], hiddens[1:]) self.hidden_layers.extend([nn.Linear(h1, h2) for h1, h2 in hidden_sizes]) self.output = nn.Linear(hiddens[-1], n_output) ...
Network
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Network: def __init__(self, n_input, n_output, hiddens, p_dropout=0.2): """Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: int, size of output layer hiddens: list of integers, sizes of hidden layers p_dropout: float, dro...
stack_v2_sparse_classes_75kplus_train_065970
5,551
no_license
[ { "docstring": "Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: int, size of output layer hiddens: list of integers, sizes of hidden layers p_dropout: float, drop out probablity", "name": "__init__", "signature": "def __init__(self, n_i...
2
stack_v2_sparse_classes_30k_train_026031
Implement the Python class `Network` described below. Class description: Implement the Network class. Method signatures and docstrings: - def __init__(self, n_input, n_output, hiddens, p_dropout=0.2): Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: i...
Implement the Python class `Network` described below. Class description: Implement the Network class. Method signatures and docstrings: - def __init__(self, n_input, n_output, hiddens, p_dropout=0.2): Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: i...
707cbc8150d123e8b49a450e20fb36e07088dfc5
<|skeleton|> class Network: def __init__(self, n_input, n_output, hiddens, p_dropout=0.2): """Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: int, size of output layer hiddens: list of integers, sizes of hidden layers p_dropout: float, dro...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Network: def __init__(self, n_input, n_output, hiddens, p_dropout=0.2): """Initiate a full connected neural network with hidden layers. Arguments: n_input: int, size of input layer n_output: int, size of output layer hiddens: list of integers, sizes of hidden layers p_dropout: float, drop out probabli...
the_stack_v2_python_sparse
fc_model.py
str1ngth3ory/Flower-Image-Classifier
train
0
76e5e12e74481c6a6be66a0d8c481505c0203332
[ "if relevant_docs is None or docs is None:\n raise Exception('Invalid Input: Inputs cannot be None!')\nself.docs = docs\nself.relevant_docs = relevant_docs\nself.retrieved_docs = retrieved_docs\nself.query = query\nself.para_section = pickle.load(open('process_data/paragraph_article_section.pkl', 'rb'))", "tit...
<|body_start_0|> if relevant_docs is None or docs is None: raise Exception('Invalid Input: Inputs cannot be None!') self.docs = docs self.relevant_docs = relevant_docs self.retrieved_docs = retrieved_docs self.query = query self.para_section = pickle.load(open...
HTMLCreator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HTMLCreator: def __init__(self, docs, retrieved_docs, relevant_docs, query): """:param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of docid sorted in order to generate the site""" <|body_0|> def generate_wiki(self, title=...
stack_v2_sparse_classes_75kplus_train_065971
2,290
no_license
[ { "docstring": ":param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of docid sorted in order to generate the site", "name": "__init__", "signature": "def __init__(self, docs, retrieved_docs, relevant_docs, query)" }, { "docstring": "Generates ...
2
stack_v2_sparse_classes_30k_train_021565
Implement the Python class `HTMLCreator` described below. Class description: Implement the HTMLCreator class. Method signatures and docstrings: - def __init__(self, docs, retrieved_docs, relevant_docs, query): :param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of ...
Implement the Python class `HTMLCreator` described below. Class description: Implement the HTMLCreator class. Method signatures and docstrings: - def __init__(self, docs, retrieved_docs, relevant_docs, query): :param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of ...
5c5d77b2f341b4579d4d096b7531e25296850c3a
<|skeleton|> class HTMLCreator: def __init__(self, docs, retrieved_docs, relevant_docs, query): """:param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of docid sorted in order to generate the site""" <|body_0|> def generate_wiki(self, title=...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class HTMLCreator: def __init__(self, docs, retrieved_docs, relevant_docs, query): """:param docs: a dict containing docid: str, where str contains the paragraph :param relevant_docs: a list of docid sorted in order to generate the site""" if relevant_docs is None or docs is None: raise ...
the_stack_v2_python_sparse
html_creator/site_creator.py
heatherwan/IR_Complex_Question_Retrieval
train
0
669d3301c1296ec8dc15a77d44accb8540fc9ab6
[ "arg_fields = {'token': String(required=True)}\nargs = parser.parse(arg_fields)\nvalidated_user = UserDAO().verify_token(args['token'])\nlogging.info('Successfully validated token {0} for user {1}.'.format(args['token'], validated_user))\nreturn jsonify(UserMarshal().dump(validated_user).data)", "arg_fields = {'e...
<|body_start_0|> arg_fields = {'token': String(required=True)} args = parser.parse(arg_fields) validated_user = UserDAO().verify_token(args['token']) logging.info('Successfully validated token {0} for user {1}.'.format(args['token'], validated_user)) return jsonify(UserMarshal()....
Handles anything related to the verification token.
VerificationToken
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class VerificationToken: """Handles anything related to the verification token.""" def post(self): """Validate a user by providing the correct token.""" <|body_0|> def put(self): """Regenerate the verification token.""" <|body_1|> <|end_skeleton|> <|body_star...
stack_v2_sparse_classes_75kplus_train_065972
1,487
no_license
[ { "docstring": "Validate a user by providing the correct token.", "name": "post", "signature": "def post(self)" }, { "docstring": "Regenerate the verification token.", "name": "put", "signature": "def put(self)" } ]
2
stack_v2_sparse_classes_30k_train_038915
Implement the Python class `VerificationToken` described below. Class description: Handles anything related to the verification token. Method signatures and docstrings: - def post(self): Validate a user by providing the correct token. - def put(self): Regenerate the verification token.
Implement the Python class `VerificationToken` described below. Class description: Handles anything related to the verification token. Method signatures and docstrings: - def post(self): Validate a user by providing the correct token. - def put(self): Regenerate the verification token. <|skeleton|> class Verificatio...
dcd65ade96b7239b799fe436e61dea29cb568f2e
<|skeleton|> class VerificationToken: """Handles anything related to the verification token.""" def post(self): """Validate a user by providing the correct token.""" <|body_0|> def put(self): """Regenerate the verification token.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class VerificationToken: """Handles anything related to the verification token.""" def post(self): """Validate a user by providing the correct token.""" arg_fields = {'token': String(required=True)} args = parser.parse(arg_fields) validated_user = UserDAO().verify_token(args['to...
the_stack_v2_python_sparse
backend/skael/skael/api/user_verify_token.py
webcat12345/skael-public
train
2
5a64a2de474acdaced518ca6d74cf6f595eb0abc
[ "tile = self.a2.Tile('#')\nresult = tile.get_name()\nself.assertEqual(result, '#')", "tile = self.a2.Tile('#')\nresult = tile.get_id()\nself.assertEqual(result, 'tile')", "tile = self.a2.Tile('#')\nresult = tile.can_select()\nself.assertIs(result, True)", "tile = self.a2.Tile('#', False)\nresult = tile.can_se...
<|body_start_0|> tile = self.a2.Tile('#') result = tile.get_name() self.assertEqual(result, '#') <|end_body_0|> <|body_start_1|> tile = self.a2.Tile('#') result = tile.get_id() self.assertEqual(result, 'tile') <|end_body_1|> <|body_start_2|> tile = self.a2.Tile(...
TestTile
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestTile: def test_get_name(self): """test Tile.get_name""" <|body_0|> def test_get_id(self): """test Tile.get_id""" <|body_1|> def test_can_select_default(self): """test Tile.can_select defaults True""" <|body_2|> def test_can_selec...
stack_v2_sparse_classes_75kplus_train_065973
23,226
no_license
[ { "docstring": "test Tile.get_name", "name": "test_get_name", "signature": "def test_get_name(self)" }, { "docstring": "test Tile.get_id", "name": "test_get_id", "signature": "def test_get_id(self)" }, { "docstring": "test Tile.can_select defaults True", "name": "test_can_sel...
6
stack_v2_sparse_classes_30k_train_044829
Implement the Python class `TestTile` described below. Class description: Implement the TestTile class. Method signatures and docstrings: - def test_get_name(self): test Tile.get_name - def test_get_id(self): test Tile.get_id - def test_can_select_default(self): test Tile.can_select defaults True - def test_can_selec...
Implement the Python class `TestTile` described below. Class description: Implement the TestTile class. Method signatures and docstrings: - def test_get_name(self): test Tile.get_name - def test_get_id(self): test Tile.get_id - def test_can_select_default(self): test Tile.can_select defaults True - def test_can_selec...
47c1dbbca81f83e2a7f9601d367d4d563742c3f5
<|skeleton|> class TestTile: def test_get_name(self): """test Tile.get_name""" <|body_0|> def test_get_id(self): """test Tile.get_id""" <|body_1|> def test_can_select_default(self): """test Tile.can_select defaults True""" <|body_2|> def test_can_selec...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestTile: def test_get_name(self): """test Tile.get_name""" tile = self.a2.Tile('#') result = tile.get_name() self.assertEqual(result, '#') def test_get_id(self): """test Tile.get_id""" tile = self.a2.Tile('#') result = tile.get_id() self.as...
the_stack_v2_python_sparse
CSSE7030/Assignment - 2/test_files/test_a2_sample.py
admiralmafei/UQ
train
3
f299c4ecf87e8710df75aa041b18fecfe4404d7f
[ "for key, value in validated_data.items():\n setattr(instance, key, value)\ninstance.save()\nreturn instance", "is_following = False\ntry:\n current_user = User.objects.get(username=self.context['request'])\n username = User.objects.get(username=self.context['username'])\n is_following = UserFollow.ob...
<|body_start_0|> for key, value in validated_data.items(): setattr(instance, key, value) instance.save() return instance <|end_body_0|> <|body_start_1|> is_following = False try: current_user = User.objects.get(username=self.context['request']) ...
Handles serialization and deserialization of User Profile objects.
ProfileSerializer
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ProfileSerializer: """Handles serialization and deserialization of User Profile objects.""" def update(self, instance, validated_data): """Performs an update on a User Profile.""" <|body_0|> def get_following(self, user): """This method 'get_following' defines wh...
stack_v2_sparse_classes_75kplus_train_065974
1,864
permissive
[ { "docstring": "Performs an update on a User Profile.", "name": "update", "signature": "def update(self, instance, validated_data)" }, { "docstring": "This method 'get_following' defines whether the authenticated user follows the user associated with the provided username", "name": "get_foll...
2
stack_v2_sparse_classes_30k_val_001404
Implement the Python class `ProfileSerializer` described below. Class description: Handles serialization and deserialization of User Profile objects. Method signatures and docstrings: - def update(self, instance, validated_data): Performs an update on a User Profile. - def get_following(self, user): This method 'get_...
Implement the Python class `ProfileSerializer` described below. Class description: Handles serialization and deserialization of User Profile objects. Method signatures and docstrings: - def update(self, instance, validated_data): Performs an update on a User Profile. - def get_following(self, user): This method 'get_...
ba429dfcec577bd6d52052673c1c413835f65988
<|skeleton|> class ProfileSerializer: """Handles serialization and deserialization of User Profile objects.""" def update(self, instance, validated_data): """Performs an update on a User Profile.""" <|body_0|> def get_following(self, user): """This method 'get_following' defines wh...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ProfileSerializer: """Handles serialization and deserialization of User Profile objects.""" def update(self, instance, validated_data): """Performs an update on a User Profile.""" for key, value in validated_data.items(): setattr(instance, key, value) instance.save() ...
the_stack_v2_python_sparse
authors/apps/profiles/serializers.py
andela/ah-the-jedi-backend
train
1
8da9623c561a4454bfd5921a12c1192c935e2a25
[ "g = GoogleV3()\nplace, (lat, lng) = g.geocode(address, exactly_one=True)\nreturn (lat, lng)", "g = geocoders.Google()\nplace, point = g.reverse(lat_lng)\nreturn place", "config = h.parse_config_file()\nrequest_url = config['api_timezone_url']\nrequest_user = config['geonames_user']\nparams = {'lat': lat_lng[0]...
<|body_start_0|> g = GoogleV3() place, (lat, lng) = g.geocode(address, exactly_one=True) return (lat, lng) <|end_body_0|> <|body_start_1|> g = geocoders.Google() place, point = g.reverse(lat_lng) return place <|end_body_1|> <|body_start_2|> config = h.parse_conf...
BarLocation
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BarLocation: def geocode_address(cls, address): """a method to convert an address in string representation to its lat, long form""" <|body_0|> def reverse_geocode(cls, lat_lng): """a method to create an address out of its latitude and longitude""" <|body_1|> ...
stack_v2_sparse_classes_75kplus_train_065975
1,463
no_license
[ { "docstring": "a method to convert an address in string representation to its lat, long form", "name": "geocode_address", "signature": "def geocode_address(cls, address)" }, { "docstring": "a method to create an address out of its latitude and longitude", "name": "reverse_geocode", "sig...
3
stack_v2_sparse_classes_30k_train_012116
Implement the Python class `BarLocation` described below. Class description: Implement the BarLocation class. Method signatures and docstrings: - def geocode_address(cls, address): a method to convert an address in string representation to its lat, long form - def reverse_geocode(cls, lat_lng): a method to create an ...
Implement the Python class `BarLocation` described below. Class description: Implement the BarLocation class. Method signatures and docstrings: - def geocode_address(cls, address): a method to convert an address in string representation to its lat, long form - def reverse_geocode(cls, lat_lng): a method to create an ...
89196dcce3fe5f967fe53da710b9886d80bab5f8
<|skeleton|> class BarLocation: def geocode_address(cls, address): """a method to convert an address in string representation to its lat, long form""" <|body_0|> def reverse_geocode(cls, lat_lng): """a method to create an address out of its latitude and longitude""" <|body_1|> ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class BarLocation: def geocode_address(cls, address): """a method to convert an address in string representation to its lat, long form""" g = GoogleV3() place, (lat, lng) = g.geocode(address, exactly_one=True) return (lat, lng) def reverse_geocode(cls, lat_lng): """a met...
the_stack_v2_python_sparse
opentapp/opentapp/barportal/location.py
steinbachr/OpenTapp
train
0
4854b02d5ef6582486b3c8e7eb8a1042a98f49c1
[ "self._engine = create_engine('sqlite:///a.db', echo=False)\nBase.metadata.drop_all(self._engine)\nBase.metadata.create_all(self._engine)\nself.__session = None", "if self.__session is None:\n DBSession = sessionmaker(bind=self._engine)\n self.__session = DBSession()\nreturn self.__session", "user = User(...
<|body_start_0|> self._engine = create_engine('sqlite:///a.db', echo=False) Base.metadata.drop_all(self._engine) Base.metadata.create_all(self._engine) self.__session = None <|end_body_0|> <|body_start_1|> if self.__session is None: DBSession = sessionmaker(bind=self...
Database class
DB
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DB: """Database class""" def __init__(self): """Initializes class attributes""" <|body_0|> def _session(self): """Private method that returns a session""" <|body_1|> def add_user(self, email: str, hashed_password: str) -> User: """Save new th...
stack_v2_sparse_classes_75kplus_train_065976
2,320
no_license
[ { "docstring": "Initializes class attributes", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Private method that returns a session", "name": "_session", "signature": "def _session(self)" }, { "docstring": "Save new the user to the database", "name":...
5
stack_v2_sparse_classes_30k_train_007044
Implement the Python class `DB` described below. Class description: Database class Method signatures and docstrings: - def __init__(self): Initializes class attributes - def _session(self): Private method that returns a session - def add_user(self, email: str, hashed_password: str) -> User: Save new the user to the d...
Implement the Python class `DB` described below. Class description: Database class Method signatures and docstrings: - def __init__(self): Initializes class attributes - def _session(self): Private method that returns a session - def add_user(self, email: str, hashed_password: str) -> User: Save new the user to the d...
151c5c063b15c8474c1fa4ab5ce27f94f36c42b5
<|skeleton|> class DB: """Database class""" def __init__(self): """Initializes class attributes""" <|body_0|> def _session(self): """Private method that returns a session""" <|body_1|> def add_user(self, email: str, hashed_password: str) -> User: """Save new th...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class DB: """Database class""" def __init__(self): """Initializes class attributes""" self._engine = create_engine('sqlite:///a.db', echo=False) Base.metadata.drop_all(self._engine) Base.metadata.create_all(self._engine) self.__session = None def _session(self): ...
the_stack_v2_python_sparse
0x08-user_authentication_service/db.py
Gzoref/holbertonschool-web_back_end
train
0
8d9a7f86bee9b0309bfd7cd6c30c87277f9f4843
[ "self._cc_squares, self._ch_squares = ({2, 17, 33}, {7, 22, 36})\ncc_cards = [lambda x, tar=tar: tar for tar in ['STAY'] * 14 + [0, 10]]\nrandom.shuffle(cc_cards)\nself._cc_cards = itertools.cycle(cc_cards)\nch_cards = [lambda x, tar=tar: tar for tar in ['STAY'] * 6 + [0, 10, 11, 24, 39, 5]]\nnext_rr = lambda x: {7...
<|body_start_0|> self._cc_squares, self._ch_squares = ({2, 17, 33}, {7, 22, 36}) cc_cards = [lambda x, tar=tar: tar for tar in ['STAY'] * 14 + [0, 10]] random.shuffle(cc_cards) self._cc_cards = itertools.cycle(cc_cards) ch_cards = [lambda x, tar=tar: tar for tar in ['STAY'] * 6 +...
class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84
Monopoly
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Monopoly: """class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84""" def __init__(self, dice): """requires dice passed (see helper function get_n_sided_dice), designates spots w/ special actions, creates lambdas expe...
stack_v2_sparse_classes_75kplus_train_065977
3,658
no_license
[ { "docstring": "requires dice passed (see helper function get_n_sided_dice), designates spots w/ special actions, creates lambdas expecting current position for every significant card", "name": "__init__", "signature": "def __init__(self, dice)" }, { "docstring": "only real interface with logic ...
5
stack_v2_sparse_classes_30k_train_024127
Implement the Python class `Monopoly` described below. Class description: class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84 Method signatures and docstrings: - def __init__(self, dice): requires dice passed (see helper function get_n_sided_dice), ...
Implement the Python class `Monopoly` described below. Class description: class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84 Method signatures and docstrings: - def __init__(self, dice): requires dice passed (see helper function get_n_sided_dice), ...
5c0333fb240d0e8e75411c6301157c12d27758f4
<|skeleton|> class Monopoly: """class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84""" def __init__(self, dice): """requires dice passed (see helper function get_n_sided_dice), designates spots w/ special actions, creates lambdas expe...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Monopoly: """class finding the probabilities of a Monopoly turn ending on every square for given dice (through simulation) problem 84""" def __init__(self, dice): """requires dice passed (see helper function get_n_sided_dice), designates spots w/ special actions, creates lambdas expecting current...
the_stack_v2_python_sparse
pe_80_89/problem_84.py
jwilner/project_euler
train
0
82381db6c92600a6f97e118455a8dcd1f7018200
[ "parser.add_argument('LINK_ID', help='ID of the linked dataset to create.')\nparser.add_argument('--description', help='A textual description for the linked dataset.')\nutil.AddParentArgs(parser, 'linked dataset to create')\nutil.AddBucketLocationArg(parser, True, 'Location of the bucket that will hold the linked d...
<|body_start_0|> parser.add_argument('LINK_ID', help='ID of the linked dataset to create.') parser.add_argument('--description', help='A textual description for the linked dataset.') util.AddParentArgs(parser, 'linked dataset to create') util.AddBucketLocationArg(parser, True, 'Location ...
Create a linked dataset on an analytics log bucket.
Create
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Create: """Create a linked dataset on an analytics log bucket.""" def Args(parser): """Register flags for this command.""" <|body_0|> def Run(self, args): """This is what gets called when the user runs this command. Args: args: an argparse namespace. All the argu...
stack_v2_sparse_classes_75kplus_train_065978
3,633
permissive
[ { "docstring": "Register flags for this command.", "name": "Args", "signature": "def Args(parser)" }, { "docstring": "This is what gets called when the user runs this command. Args: args: an argparse namespace. All the arguments that were provided to this command invocation. Returns: Linked data...
2
stack_v2_sparse_classes_30k_train_034006
Implement the Python class `Create` described below. Class description: Create a linked dataset on an analytics log bucket. Method signatures and docstrings: - def Args(parser): Register flags for this command. - def Run(self, args): This is what gets called when the user runs this command. Args: args: an argparse na...
Implement the Python class `Create` described below. Class description: Create a linked dataset on an analytics log bucket. Method signatures and docstrings: - def Args(parser): Register flags for this command. - def Run(self, args): This is what gets called when the user runs this command. Args: args: an argparse na...
392abf004b16203030e6efd2f0af24db7c8d669e
<|skeleton|> class Create: """Create a linked dataset on an analytics log bucket.""" def Args(parser): """Register flags for this command.""" <|body_0|> def Run(self, args): """This is what gets called when the user runs this command. Args: args: an argparse namespace. All the argu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Create: """Create a linked dataset on an analytics log bucket.""" def Args(parser): """Register flags for this command.""" parser.add_argument('LINK_ID', help='ID of the linked dataset to create.') parser.add_argument('--description', help='A textual description for the linked dat...
the_stack_v2_python_sparse
lib/surface/logging/links/create.py
google-cloud-sdk-unofficial/google-cloud-sdk
train
9
27bdce3d62cb4f29b605c14764da3c2470778be0
[ "time_units = AnalysisHelpers.convert_time_units_str_to_enum(time_units)\ntravel_direction = AnalysisHelpers.convert_travel_direction_str_to_enum(travel_direction)\ngeometry_at_cutoff = AnalysisHelpers.convert_geometry_at_cutoff_str_to_enum(geometry_at_cutoff)\ngeometry_at_overlap = AnalysisHelpers.convert_geometry...
<|body_start_0|> time_units = AnalysisHelpers.convert_time_units_str_to_enum(time_units) travel_direction = AnalysisHelpers.convert_travel_direction_str_to_enum(travel_direction) geometry_at_cutoff = AnalysisHelpers.convert_geometry_at_cutoff_str_to_enum(geometry_at_cutoff) geometry_at_o...
Solves a Service Area incrementally over a time window solving in parallel and combining results.
ParallelSACalculator
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ParallelSACalculator: """Solves a Service Area incrementally over a time window solving in parallel and combining results.""" def __init__(self, facilities, output_polygons, network_data_source, travel_mode, cutoffs, time_units, time_window_start_day, time_window_start_time, time_window_end_...
stack_v2_sparse_classes_75kplus_train_065979
30,157
permissive
[ { "docstring": "Compute Service Areas in parallel over the time window and save the output polygons to a feature class. This class assumes that the inputs have already been pre-processed and validated. Args: facilities (str): Catalog path to facilities output_polygons (str): Catalog path to output polygons netw...
3
null
Implement the Python class `ParallelSACalculator` described below. Class description: Solves a Service Area incrementally over a time window solving in parallel and combining results. Method signatures and docstrings: - def __init__(self, facilities, output_polygons, network_data_source, travel_mode, cutoffs, time_un...
Implement the Python class `ParallelSACalculator` described below. Class description: Solves a Service Area incrementally over a time window solving in parallel and combining results. Method signatures and docstrings: - def __init__(self, facilities, output_polygons, network_data_source, travel_mode, cutoffs, time_un...
47cbc3de67a7b1bf9255e07e88cba7b051db0505
<|skeleton|> class ParallelSACalculator: """Solves a Service Area incrementally over a time window solving in parallel and combining results.""" def __init__(self, facilities, output_polygons, network_data_source, travel_mode, cutoffs, time_units, time_window_start_day, time_window_start_time, time_window_end_...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ParallelSACalculator: """Solves a Service Area incrementally over a time window solving in parallel and combining results.""" def __init__(self, facilities, output_polygons, network_data_source, travel_mode, cutoffs, time_units, time_window_start_day, time_window_start_time, time_window_end_day, time_win...
the_stack_v2_python_sparse
transit-network-analysis-tools/parallel_sa.py
Esri/public-transit-tools
train
155
769f986c82f77dbf7d20c4b179ecdffb46db68e4
[ "num_smooth = left_gauss_linear(num)\nden_smooth = left_gauss_linear(den)\nden_smooth = np.clip(den_smooth, 0, None)\nnum_smooth = np.clip(num_smooth, 0, den_smooth)\nreturn (num_smooth, den_smooth)", "if isinstance(den, (pd.DataFrame, pd.Series)):\n den = den.values\nif isinstance(num, (pd.DataFrame, pd.Serie...
<|body_start_0|> num_smooth = left_gauss_linear(num) den_smooth = left_gauss_linear(den) den_smooth = np.clip(den_smooth, 0, None) num_smooth = np.clip(num_smooth, 0, den_smooth) return (num_smooth, den_smooth) <|end_body_0|> <|body_start_1|> if isinstance(den, (pd.DataF...
Class to fit a hospitalizations indicator using CLI counts from claims-based data.
ClaimsHospIndicator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClaimsHospIndicator: """Class to fit a hospitalizations indicator using CLI counts from claims-based data.""" def gauss_smooth(num, den): """Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of denominator counts Returns: tuple: (array of smoothed nu...
stack_v2_sparse_classes_75kplus_train_065980
5,159
permissive
[ { "docstring": "Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of denominator counts Returns: tuple: (array of smoothed num, array of smoothed den)", "name": "gauss_smooth", "signature": "def gauss_smooth(num, den)" }, { "docstring": "Adjust for small denomin...
3
stack_v2_sparse_classes_30k_val_000249
Implement the Python class `ClaimsHospIndicator` described below. Class description: Class to fit a hospitalizations indicator using CLI counts from claims-based data. Method signatures and docstrings: - def gauss_smooth(num, den): Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of...
Implement the Python class `ClaimsHospIndicator` described below. Class description: Class to fit a hospitalizations indicator using CLI counts from claims-based data. Method signatures and docstrings: - def gauss_smooth(num, den): Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of...
0c0ca18f38892c850565edf8bed9d2acaf234354
<|skeleton|> class ClaimsHospIndicator: """Class to fit a hospitalizations indicator using CLI counts from claims-based data.""" def gauss_smooth(num, den): """Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of denominator counts Returns: tuple: (array of smoothed nu...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ClaimsHospIndicator: """Class to fit a hospitalizations indicator using CLI counts from claims-based data.""" def gauss_smooth(num, den): """Smooth using the left_gauss_linear. Args: num: array of numerator counts den: array of denominator counts Returns: tuple: (array of smoothed num, array of s...
the_stack_v2_python_sparse
claims_hosp/delphi_claims_hosp/indicator.py
alexcoda/covidcast-indicators
train
0
a59a492015185b6e1a9af5b1fdf98acebc0c109e
[ "sc.logger.info('小影圈关注页面初始状态检查开始')\nfun_name = 'test_planet_page'\nsc.logger.info('点击小影圈主按钮')\np_btn = 'com.quvideo.xiaoying:id/img_find'\nWebDriverWait(sc.driver, 10, 1).until(lambda el: el.find_element_by_id(p_btn)).click()\ntime.sleep(1)\nsc.logger.info('开始查找小影圈关注tab')\nel_tab_list = sc.driver.find_elements_by_i...
<|body_start_0|> sc.logger.info('小影圈关注页面初始状态检查开始') fun_name = 'test_planet_page' sc.logger.info('点击小影圈主按钮') p_btn = 'com.quvideo.xiaoying:id/img_find' WebDriverWait(sc.driver, 10, 1).until(lambda el: el.find_element_by_id(p_btn)).click() time.sleep(1) sc.logger.in...
小影圈关注页UI的测试类,分步截图.
TestPlanetExploreUI
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestPlanetExploreUI: """小影圈关注页UI的测试类,分步截图.""" def test_planet_page(self): """小影圈关注页面初始状态测试.""" <|body_0|> def test_refresh(self): """测试下拉刷新.""" <|body_1|> def test_swipe_vertical(self): """测试上下方向的滑动.""" <|body_2|> def test_origin...
stack_v2_sparse_classes_75kplus_train_065981
3,656
no_license
[ { "docstring": "小影圈关注页面初始状态测试.", "name": "test_planet_page", "signature": "def test_planet_page(self)" }, { "docstring": "测试下拉刷新.", "name": "test_refresh", "signature": "def test_refresh(self)" }, { "docstring": "测试上下方向的滑动.", "name": "test_swipe_vertical", "signature": "d...
4
stack_v2_sparse_classes_30k_test_001362
Implement the Python class `TestPlanetExploreUI` described below. Class description: 小影圈关注页UI的测试类,分步截图. Method signatures and docstrings: - def test_planet_page(self): 小影圈关注页面初始状态测试. - def test_refresh(self): 测试下拉刷新. - def test_swipe_vertical(self): 测试上下方向的滑动. - def test_origin_home(self): 关注页tab的功能.
Implement the Python class `TestPlanetExploreUI` described below. Class description: 小影圈关注页UI的测试类,分步截图. Method signatures and docstrings: - def test_planet_page(self): 小影圈关注页面初始状态测试. - def test_refresh(self): 测试下拉刷新. - def test_swipe_vertical(self): 测试上下方向的滑动. - def test_origin_home(self): 关注页tab的功能. <|skeleton|> cl...
0003b68fc8e26a96ee1661c1eb1f26f96810e909
<|skeleton|> class TestPlanetExploreUI: """小影圈关注页UI的测试类,分步截图.""" def test_planet_page(self): """小影圈关注页面初始状态测试.""" <|body_0|> def test_refresh(self): """测试下拉刷新.""" <|body_1|> def test_swipe_vertical(self): """测试上下方向的滑动.""" <|body_2|> def test_origin...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestPlanetExploreUI: """小影圈关注页UI的测试类,分步截图.""" def test_planet_page(self): """小影圈关注页面初始状态测试.""" sc.logger.info('小影圈关注页面初始状态检查开始') fun_name = 'test_planet_page' sc.logger.info('点击小影圈主按钮') p_btn = 'com.quvideo.xiaoying:id/img_find' WebDriverWait(sc.driver, 10,...
the_stack_v2_python_sparse
iOS/VivaVideo/test_community/test_personal/test_follow.py
Lemonzhulixin/UItest
train
5
1c84273a119cb53f83c6811b624b69c15f2c244f
[ "category_Q = Q()\nif category:\n category_Q = Q(category=category)\nname_Q = Q()\nif name:\n name_Q = Q(name__contains=name)\nstart = page * self.page_size\nend = start + self.page_size\nreturn Clothing.objects.filter(category_Q, name_Q).filter(is_active=True)[start:end]", "category = request.REQUEST.get('...
<|body_start_0|> category_Q = Q() if category: category_Q = Q(category=category) name_Q = Q() if name: name_Q = Q(name__contains=name) start = page * self.page_size end = start + self.page_size return Clothing.objects.filter(category_Q, nam...
Search clothing
ClothingSearchView
[ "Unlicense" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClothingSearchView: """Search clothing""" def search(self, category, name, page): """Search clothings""" <|body_0|> def get_ajax(self, request, *args, **kwargs): """Do ajax search""" <|body_1|> <|end_skeleton|> <|body_start_0|> category_Q = Q() ...
stack_v2_sparse_classes_75kplus_train_065982
4,207
permissive
[ { "docstring": "Search clothings", "name": "search", "signature": "def search(self, category, name, page)" }, { "docstring": "Do ajax search", "name": "get_ajax", "signature": "def get_ajax(self, request, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_039103
Implement the Python class `ClothingSearchView` described below. Class description: Search clothing Method signatures and docstrings: - def search(self, category, name, page): Search clothings - def get_ajax(self, request, *args, **kwargs): Do ajax search
Implement the Python class `ClothingSearchView` described below. Class description: Search clothing Method signatures and docstrings: - def search(self, category, name, page): Search clothings - def get_ajax(self, request, *args, **kwargs): Do ajax search <|skeleton|> class ClothingSearchView: """Search clothing...
0ea016745d92054bd4df8d934c1b67fd61b6f845
<|skeleton|> class ClothingSearchView: """Search clothing""" def search(self, category, name, page): """Search clothings""" <|body_0|> def get_ajax(self, request, *args, **kwargs): """Do ajax search""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ClothingSearchView: """Search clothing""" def search(self, category, name, page): """Search clothings""" category_Q = Q() if category: category_Q = Q(category=category) name_Q = Q() if name: name_Q = Q(name__contains=name) start = pa...
the_stack_v2_python_sparse
clothings/views.py
ygrass/handsome
train
0
b66e4b55e67bb7998cd7bc882caaf58a9e15e8dd
[ "envelopes.sort(key=lambda x: (x[0], -x[1]))\ndoll = [0] * len(envelopes)\nmaxLen = 0\nfor envelope in envelopes:\n i = bisect_left(doll, envelope[1], 0, maxLen)\n doll[i] = envelope[1]\n if i == maxLen:\n maxLen += 1\nreturn maxLen", "n = len(envelopes)\nif n < 1:\n return 0\nenvelopes.sort()\...
<|body_start_0|> envelopes.sort(key=lambda x: (x[0], -x[1])) doll = [0] * len(envelopes) maxLen = 0 for envelope in envelopes: i = bisect_left(doll, envelope[1], 0, maxLen) doll[i] = envelope[1] if i == maxLen: maxLen += 1 retur...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxEnvelopes(self, envelopes): """:type envelopes: List[List[int]] :rtype: int""" <|body_0|> def maxEnvelopes2(self, envelopes): """:type envelopes: List[List[int]] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> envelopes....
stack_v2_sparse_classes_75kplus_train_065983
2,260
no_license
[ { "docstring": ":type envelopes: List[List[int]] :rtype: int", "name": "maxEnvelopes", "signature": "def maxEnvelopes(self, envelopes)" }, { "docstring": ":type envelopes: List[List[int]] :rtype: int", "name": "maxEnvelopes2", "signature": "def maxEnvelopes2(self, envelopes)" } ]
2
stack_v2_sparse_classes_30k_train_010709
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxEnvelopes(self, envelopes): :type envelopes: List[List[int]] :rtype: int - def maxEnvelopes2(self, envelopes): :type envelopes: List[List[int]] :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxEnvelopes(self, envelopes): :type envelopes: List[List[int]] :rtype: int - def maxEnvelopes2(self, envelopes): :type envelopes: List[List[int]] :rtype: int <|skeleton|> c...
635af6e22aa8eef8e7920a585d43a45a891a8157
<|skeleton|> class Solution: def maxEnvelopes(self, envelopes): """:type envelopes: List[List[int]] :rtype: int""" <|body_0|> def maxEnvelopes2(self, envelopes): """:type envelopes: 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 maxEnvelopes(self, envelopes): """:type envelopes: List[List[int]] :rtype: int""" envelopes.sort(key=lambda x: (x[0], -x[1])) doll = [0] * len(envelopes) maxLen = 0 for envelope in envelopes: i = bisect_left(doll, envelope[1], 0, maxLen) ...
the_stack_v2_python_sparse
code354RussianDollEnvelopes.py
cybelewang/leetcode-python
train
0
5790083497e46ef6365b2f805fcbdcfad01e7824
[ "self.name = name\nself.given_name = given_name\nself.middle_name = middle_name\nself.family_name = family_name\nself.address = address\nself.additional_properties = additional_properties", "if dictionary is None:\n return None\nname = dictionary.get('name')\ngiven_name = dictionary.get('givenName')\nmiddle_na...
<|body_start_0|> self.name = name self.given_name = given_name self.middle_name = middle_name self.family_name = family_name self.address = address self.additional_properties = additional_properties <|end_body_0|> <|body_start_1|> if dictionary is None: ...
Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee middle_name (string): Middle name of employee, if stated family_name (string): Last name o...
PayrollEmployeeRecord
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PayrollEmployeeRecord: """Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee middle_name (string): Middle name of empl...
stack_v2_sparse_classes_75kplus_train_065984
2,958
permissive
[ { "docstring": "Constructor for the PayrollEmployeeRecord class", "name": "__init__", "signature": "def __init__(self, name=None, given_name=None, middle_name=None, family_name=None, address=None, additional_properties={})" }, { "docstring": "Creates an instance of this model from a dictionary A...
2
stack_v2_sparse_classes_30k_train_053093
Implement the Python class `PayrollEmployeeRecord` described below. Class description: Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee mi...
Implement the Python class `PayrollEmployeeRecord` described below. Class description: Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee mi...
b2ab1ded435db75c78d42261f5e4acd2a3061487
<|skeleton|> class PayrollEmployeeRecord: """Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee middle_name (string): Middle name of empl...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class PayrollEmployeeRecord: """Implementation of the 'Payroll Employee Record' model. TODO: type model description here. Attributes: name (string): Full name of the employee: first, middle (if stated), and last name. given_name (string): First name of employee middle_name (string): Middle name of employee, if stat...
the_stack_v2_python_sparse
finicityapi/models/payroll_employee_record.py
monarchmoney/finicity-python
train
0
02161fb03380a04e8027c87eab197a384e62a0aa
[ "max_len = 0\nfor size in range(1, 27):\n m = {}\n begin = 0\n end = 0\n unique_letter = 0\n counter = 0\n while end < len(s):\n if unique_letter <= size:\n if s[end] not in m or m[s[end]] == 0:\n unique_letter += 1\n m[s[end]] = m[s[end]] + 1 if s[end] ...
<|body_start_0|> max_len = 0 for size in range(1, 27): m = {} begin = 0 end = 0 unique_letter = 0 counter = 0 while end < len(s): if unique_letter <= size: if s[end] not in m or m[s[end]] == 0: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestSubstring(self, s, k): """:type s: str :type k: int :rtype: int""" <|body_0|> def longestSubstring2(self, s, k): """:type s: str :type k: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> max_len = 0 for si...
stack_v2_sparse_classes_75kplus_train_065985
4,028
no_license
[ { "docstring": ":type s: str :type k: int :rtype: int", "name": "longestSubstring", "signature": "def longestSubstring(self, s, k)" }, { "docstring": ":type s: str :type k: int :rtype: int", "name": "longestSubstring2", "signature": "def longestSubstring2(self, s, k)" } ]
2
stack_v2_sparse_classes_30k_train_035901
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestSubstring(self, s, k): :type s: str :type k: int :rtype: int - def longestSubstring2(self, s, k): :type s: str :type k: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestSubstring(self, s, k): :type s: str :type k: int :rtype: int - def longestSubstring2(self, s, k): :type s: str :type k: int :rtype: int <|skeleton|> class Solution: ...
516b28a3df505b942098d91a4891e414f1c75c08
<|skeleton|> class Solution: def longestSubstring(self, s, k): """:type s: str :type k: int :rtype: int""" <|body_0|> def longestSubstring2(self, s, k): """:type s: str :type k: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def longestSubstring(self, s, k): """:type s: str :type k: int :rtype: int""" max_len = 0 for size in range(1, 27): m = {} begin = 0 end = 0 unique_letter = 0 counter = 0 while end < len(s): ...
the_stack_v2_python_sparse
TwoPointer/395_maxSubstrKRepeat.py
terylll/LeetCode
train
0
504652878111639cc349d6f684e799d7213d815b
[ "self.__image = Image(imagePath)\nself.__axis_from_edges = None\nself.__right_direction = None", "if self.__right_direction == None:\n angle = None\n counts = 0\n ordinate = None\n for i in range(-20, 21):\n rotated_i = ndimage.rotate(self.__image.edges_detection(), i, reshape=False)\n l...
<|body_start_0|> self.__image = Image(imagePath) self.__axis_from_edges = None self.__right_direction = None <|end_body_0|> <|body_start_1|> if self.__right_direction == None: angle = None counts = 0 ordinate = None for i in range(-20, 21)...
class defining the protection object on a photograph
Protection
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Protection: """class defining the protection object on a photograph""" def __init__(self, imagePath: str) -> None: """constructor of class Protection""" <|body_0|> def get_right_direction(self) -> dict: """@parameters: object itself @returns: an object indicating...
stack_v2_sparse_classes_75kplus_train_065986
4,133
no_license
[ { "docstring": "constructor of class Protection", "name": "__init__", "signature": "def __init__(self, imagePath: str) -> None" }, { "docstring": "@parameters: object itself @returns: an object indicating information on the protection axis approximation", "name": "get_right_direction", "...
4
stack_v2_sparse_classes_30k_train_009077
Implement the Python class `Protection` described below. Class description: class defining the protection object on a photograph Method signatures and docstrings: - def __init__(self, imagePath: str) -> None: constructor of class Protection - def get_right_direction(self) -> dict: @parameters: object itself @returns:...
Implement the Python class `Protection` described below. Class description: class defining the protection object on a photograph Method signatures and docstrings: - def __init__(self, imagePath: str) -> None: constructor of class Protection - def get_right_direction(self) -> dict: @parameters: object itself @returns:...
dc29188eb7cb3a7302ac474f04d5307c6e584d52
<|skeleton|> class Protection: """class defining the protection object on a photograph""" def __init__(self, imagePath: str) -> None: """constructor of class Protection""" <|body_0|> def get_right_direction(self) -> dict: """@parameters: object itself @returns: an object indicating...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Protection: """class defining the protection object on a photograph""" def __init__(self, imagePath: str) -> None: """constructor of class Protection""" self.__image = Image(imagePath) self.__axis_from_edges = None self.__right_direction = None def get_right_direction...
the_stack_v2_python_sparse
src/conformity/Protection.py
fredericsonergia/confomity-presence
train
0
bb584cc5b7c53705b83d1c9bd57872f326f83a05
[ "command_list = []\nfor i in range(len(command)):\n if i % 2 == 0:\n command_list.append(command[i:i + 2].replace('ff', 'fe01').replace('fe', 'fe00'))\nresult = ''.join(command_list)\nreturn result", "rsctl = CommonUtil.get_rsctl()\ncmd_type = 'c0'\ntime_stamp = int(time.time())\nunix_time = hex(time_st...
<|body_start_0|> command_list = [] for i in range(len(command)): if i % 2 == 0: command_list.append(command[i:i + 2].replace('ff', 'fe01').replace('fe', 'fe00')) result = ''.join(command_list) return result <|end_body_0|> <|body_start_1|> rsctl = Comm...
指令发送集合
CommandSendSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CommandSendSet: """指令发送集合""" def transfer_command(command): """转义指令""" <|body_0|> def combine_c0(lane_mode='03', wait_time='02', tx_power='0a', pll_channel_id='00', trans_mode='02'): """组合c0指令, 该指令为初始化指令 :param lane_mode: 车道工作模式 :param wait_time: 最小重读时间 :param tx...
stack_v2_sparse_classes_75kplus_train_065987
5,258
no_license
[ { "docstring": "转义指令", "name": "transfer_command", "signature": "def transfer_command(command)" }, { "docstring": "组合c0指令, 该指令为初始化指令 :param lane_mode: 车道工作模式 :param wait_time: 最小重读时间 :param tx_power: etc天线功率级数 :param pll_channel_id: 信道号 :param trans_mode: 记账模式 :return:", "name": "combine_c0"...
6
stack_v2_sparse_classes_30k_train_018577
Implement the Python class `CommandSendSet` described below. Class description: 指令发送集合 Method signatures and docstrings: - def transfer_command(command): 转义指令 - def combine_c0(lane_mode='03', wait_time='02', tx_power='0a', pll_channel_id='00', trans_mode='02'): 组合c0指令, 该指令为初始化指令 :param lane_mode: 车道工作模式 :param wait_t...
Implement the Python class `CommandSendSet` described below. Class description: 指令发送集合 Method signatures and docstrings: - def transfer_command(command): 转义指令 - def combine_c0(lane_mode='03', wait_time='02', tx_power='0a', pll_channel_id='00', trans_mode='02'): 组合c0指令, 该指令为初始化指令 :param lane_mode: 车道工作模式 :param wait_t...
3e854b6cb479497e44fb36a77e4f4ccef803d911
<|skeleton|> class CommandSendSet: """指令发送集合""" def transfer_command(command): """转义指令""" <|body_0|> def combine_c0(lane_mode='03', wait_time='02', tx_power='0a', pll_channel_id='00', trans_mode='02'): """组合c0指令, 该指令为初始化指令 :param lane_mode: 车道工作模式 :param wait_time: 最小重读时间 :param tx...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CommandSendSet: """指令发送集合""" def transfer_command(command): """转义指令""" command_list = [] for i in range(len(command)): if i % 2 == 0: command_list.append(command[i:i + 2].replace('ff', 'fe01').replace('fe', 'fe00')) result = ''.join(command_list...
the_stack_v2_python_sparse
rsu_soulin/service/command_send_set.py
crazyfox07/rsu-langneng
train
0
0645eaee821c22e20c7ff7b92d68907c28af7cf2
[ "IV = FeaDisSelectClass(self.ivThreshold, self.xgbSelectNum).iv_xy(self.train['c1'], self.train['label'])\nprint(IV)\nreturn IV", "ivList = FeaDisSelectClass(self.ivThreshold, self.xgbSelectNum).iv_claculate(self.train, 'label', X=['c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8'], order=True)\nprint(ivList)\nretur...
<|body_start_0|> IV = FeaDisSelectClass(self.ivThreshold, self.xgbSelectNum).iv_xy(self.train['c1'], self.train['label']) print(IV) return IV <|end_body_0|> <|body_start_1|> ivList = FeaDisSelectClass(self.ivThreshold, self.xgbSelectNum).iv_claculate(self.train, 'label', X=['c1', 'c2', ...
功能描述:缺失值处理测试类
TestFeaDisSelectHandle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestFeaDisSelectHandle: """功能描述:缺失值处理测试类""" def test_iv_xy(self): """功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24""" <|body_0|> def test_iv_claculate(self): """功能描述: 测试iv_claculate函数 管理记录: 1. edited by 王文丹 2021/07/24""" <|body_1|> def test_iv_se...
stack_v2_sparse_classes_75kplus_train_065988
4,772
no_license
[ { "docstring": "功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24", "name": "test_iv_xy", "signature": "def test_iv_xy(self)" }, { "docstring": "功能描述: 测试iv_claculate函数 管理记录: 1. edited by 王文丹 2021/07/24", "name": "test_iv_claculate", "signature": "def test_iv_claculate(self)" }, { ...
3
null
Implement the Python class `TestFeaDisSelectHandle` described below. Class description: 功能描述:缺失值处理测试类 Method signatures and docstrings: - def test_iv_xy(self): 功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24 - def test_iv_claculate(self): 功能描述: 测试iv_claculate函数 管理记录: 1. edited by 王文丹 2021/07/24 - def test_iv_select...
Implement the Python class `TestFeaDisSelectHandle` described below. Class description: 功能描述:缺失值处理测试类 Method signatures and docstrings: - def test_iv_xy(self): 功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24 - def test_iv_claculate(self): 功能描述: 测试iv_claculate函数 管理记录: 1. edited by 王文丹 2021/07/24 - def test_iv_select...
e1f7d1229ee82fb5cf7e5f969f24f8c61568c2c9
<|skeleton|> class TestFeaDisSelectHandle: """功能描述:缺失值处理测试类""" def test_iv_xy(self): """功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24""" <|body_0|> def test_iv_claculate(self): """功能描述: 测试iv_claculate函数 管理记录: 1. edited by 王文丹 2021/07/24""" <|body_1|> def test_iv_se...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class TestFeaDisSelectHandle: """功能描述:缺失值处理测试类""" def test_iv_xy(self): """功能描述: 测试iV值计算函数 管理记录: 1. edited by 王文丹 2021/07/24""" IV = FeaDisSelectClass(self.ivThreshold, self.xgbSelectNum).iv_xy(self.train['c1'], self.train['label']) print(IV) return IV def test_iv_claculate...
the_stack_v2_python_sparse
J_unintest/F_SelectChar_test/test_FeaSelectProcessModule/test_FeaDisSelectHandle.py
wenhui0331/Basic_Model_V1
train
0
255d4f94087b86f574f047e44430680b0291aa2d
[ "super(ReignitionCallback, self).__init__()\nself.priority = 100\nself.desc_copy = None", "logging.info('Start SPNas Reigniting.')\nself.desc_copy = copy.deepcopy(self.trainer.model_desc)\nbackbone = self.desc_copy.get('backbone')\ncode = backbone.get('code')\nself.trainer.model_desc = dict(type='SerialClassifica...
<|body_start_0|> super(ReignitionCallback, self).__init__() self.priority = 100 self.desc_copy = None <|end_body_0|> <|body_start_1|> logging.info('Start SPNas Reigniting.') self.desc_copy = copy.deepcopy(self.trainer.model_desc) backbone = self.desc_copy.get('backbone')...
Reignition callback.
ReignitionCallback
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ReignitionCallback: """Reignition callback.""" def __init__(self): """Initialize callback.""" <|body_0|> def init_trainer(self, logs=None): """Be called before train.""" <|body_1|> def after_epoch(self, epoch, logs=None): """Save desc into Fa...
stack_v2_sparse_classes_75kplus_train_065989
1,801
permissive
[ { "docstring": "Initialize callback.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Be called before train.", "name": "init_trainer", "signature": "def init_trainer(self, logs=None)" }, { "docstring": "Save desc into FasterRCNN.", "name": "after_ep...
3
stack_v2_sparse_classes_30k_train_023082
Implement the Python class `ReignitionCallback` described below. Class description: Reignition callback. Method signatures and docstrings: - def __init__(self): Initialize callback. - def init_trainer(self, logs=None): Be called before train. - def after_epoch(self, epoch, logs=None): Save desc into FasterRCNN.
Implement the Python class `ReignitionCallback` described below. Class description: Reignition callback. Method signatures and docstrings: - def __init__(self): Initialize callback. - def init_trainer(self, logs=None): Be called before train. - def after_epoch(self, epoch, logs=None): Save desc into FasterRCNN. <|sk...
12e37a1991eb6771a2999fe0a46ddda920c47948
<|skeleton|> class ReignitionCallback: """Reignition callback.""" def __init__(self): """Initialize callback.""" <|body_0|> def init_trainer(self, logs=None): """Be called before train.""" <|body_1|> def after_epoch(self, epoch, logs=None): """Save desc into Fa...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ReignitionCallback: """Reignition callback.""" def __init__(self): """Initialize callback.""" super(ReignitionCallback, self).__init__() self.priority = 100 self.desc_copy = None def init_trainer(self, logs=None): """Be called before train.""" logging....
the_stack_v2_python_sparse
vega/algorithms/nas/sp_nas/reignition.py
huawei-noah/vega
train
850
72d2ee8a515be65bb5becaa84726c86102dc928c
[ "super(ResizeDetailsMessageBox, self).__init__(*args, **kwargs)\nself.detailsBoxWidth = detailsBoxWidth\nself.detailBoxHeight = detailBoxHeight", "result = super(ResizeDetailsMessageBox, self).resizeEvent(event)\ndetails_box = self.findChild(QtWidgets.QTextEdit)\nif details_box is not None:\n details_box.setFi...
<|body_start_0|> super(ResizeDetailsMessageBox, self).__init__(*args, **kwargs) self.detailsBoxWidth = detailsBoxWidth self.detailBoxHeight = detailBoxHeight <|end_body_0|> <|body_start_1|> result = super(ResizeDetailsMessageBox, self).resizeEvent(event) details_box = self.findC...
Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.com/questions/2655354/how-to-allow-resizing-of-qmessagebox-in-pyqt4
ResizeDetailsMessageBox
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResizeDetailsMessageBox: """Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.com/questions/2655354/how-to-allow-resizi...
stack_v2_sparse_classes_75kplus_train_065990
7,800
permissive
[ { "docstring": "Constructor :param detailsBoxWidht: The width of the details text box (default=700) :param detailBoxHeight: The heights of the details text box (default=700)", "name": "__init__", "signature": "def __init__(self, detailsBoxWidth=700, detailBoxHeight=300, *args, **kwargs)" }, { "d...
2
stack_v2_sparse_classes_30k_train_033039
Implement the Python class `ResizeDetailsMessageBox` described below. Class description: Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.co...
Implement the Python class `ResizeDetailsMessageBox` described below. Class description: Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.co...
57a66e2d7030c265f0b5e1d577326cb9e986216f
<|skeleton|> class ResizeDetailsMessageBox: """Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.com/questions/2655354/how-to-allow-resizi...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ResizeDetailsMessageBox: """Message box that enlarges when the 'Show Details' button is clicked. Can be used to better view stack traces. I could't find how to make a resizeable message box but this it the next best thing. Taken from: http://stackoverflow.com/questions/2655354/how-to-allow-resizing-of-qmessag...
the_stack_v2_python_sparse
objbrowser/app.py
titusjan/objbrowser
train
94
3c5441a9df4a66d80d30bb975cc02649e04e57f3
[ "if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0):\n raise Exception('server_ip和server_port必须同时指定')\nself._server_ip = server_ip\nself._server_port = server_port\nself._service_name = service_name\nself._host = host", "headers = {'org': org, 'user': user}\nroute_name = ''\nserv...
<|body_start_0|> if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0): raise Exception('server_ip和server_port必须同时指定') self._server_ip = server_ip self._server_port = server_port self._service_name = service_name self._host = host <|end_bod...
AlertRuleClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AlertRuleClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和ser...
stack_v2_sparse_classes_75kplus_train_065991
4,691
permissive
[ { "docstring": "初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,server_ip优先级更高 :param host: 指定sdk请求服务的host名称, 如cmdb.easyops-only.com", "name": "__ini...
3
stack_v2_sparse_classes_30k_train_035369
Implement the Python class `AlertRuleClient` described below. Class description: Implement the AlertRuleClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的serv...
Implement the Python class `AlertRuleClient` described below. Class description: Implement the AlertRuleClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的serv...
adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0
<|skeleton|> class AlertRuleClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和ser...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class AlertRuleClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,...
the_stack_v2_python_sparse
alert_service_sdk/api/alert_rule/alert_rule_client.py
easyopsapis/easyops-api-python
train
5
048e6500651bb7b7bcd37a991421be697a63a2ca
[ "args = parser.parse_args()\nsentence = args.get('sentence')\nreturn jsonify(rst)", "form = ChargeForm().validate_for_api()\nsentence = form.sentence.data\nreturn jsonify(rst)" ]
<|body_start_0|> args = parser.parse_args() sentence = args.get('sentence') return jsonify(rst) <|end_body_0|> <|body_start_1|> form = ChargeForm().validate_for_api() sentence = form.sentence.data return jsonify(rst) <|end_body_1|>
(刑事)罪名预测引擎
Charge
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Charge: """(刑事)罪名预测引擎""" def get(self): """罪名预测 根据用户的输入预测罪名""" <|body_0|> def post(self): """罪名预测 根据用户的输入预测罪名""" <|body_1|> <|end_skeleton|> <|body_start_0|> args = parser.parse_args() sentence = args.get('sentence') return jsoni...
stack_v2_sparse_classes_75kplus_train_065992
1,388
no_license
[ { "docstring": "罪名预测 根据用户的输入预测罪名", "name": "get", "signature": "def get(self)" }, { "docstring": "罪名预测 根据用户的输入预测罪名", "name": "post", "signature": "def post(self)" } ]
2
stack_v2_sparse_classes_30k_val_000669
Implement the Python class `Charge` described below. Class description: (刑事)罪名预测引擎 Method signatures and docstrings: - def get(self): 罪名预测 根据用户的输入预测罪名 - def post(self): 罪名预测 根据用户的输入预测罪名
Implement the Python class `Charge` described below. Class description: (刑事)罪名预测引擎 Method signatures and docstrings: - def get(self): 罪名预测 根据用户的输入预测罪名 - def post(self): 罪名预测 根据用户的输入预测罪名 <|skeleton|> class Charge: """(刑事)罪名预测引擎""" def get(self): """罪名预测 根据用户的输入预测罪名""" <|body_0|> def post...
d373f6bcd461a55d6a6662ccf3a9edd66f0b91ab
<|skeleton|> class Charge: """(刑事)罪名预测引擎""" def get(self): """罪名预测 根据用户的输入预测罪名""" <|body_0|> def post(self): """罪名预测 根据用户的输入预测罪名""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Charge: """(刑事)罪名预测引擎""" def get(self): """罪名预测 根据用户的输入预测罪名""" args = parser.parse_args() sentence = args.get('sentence') return jsonify(rst) def post(self): """罪名预测 根据用户的输入预测罪名""" form = ChargeForm().validate_for_api() sentence = form.sentence...
the_stack_v2_python_sparse
charges_kg/charges_kg/src/web/apps/v1/charge.py
yaolinxia/practice
train
0
c979607d76c252a7029c18bf8f76286d65a6b907
[ "self.validate_json(data, process_fn=process_fn)\nself.semantic_validate_json(data, process_fn=process_fn)\nreturn data", "self.validate_json(data, process_fn=process_fn)\nself.semantic_validate_json(data, process_fn=process_fn)\nreturn data", "validate = self.context.get(self.VALIDATE, False)\nif not validate:...
<|body_start_0|> self.validate_json(data, process_fn=process_fn) self.semantic_validate_json(data, process_fn=process_fn) return data <|end_body_0|> <|body_start_1|> self.validate_json(data, process_fn=process_fn) self.semantic_validate_json(data, process_fn=process_fn) ...
ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON.
ValidatingSchema
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ValidatingSchema: """ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON.""" def validate_on_load(self, data, process_fn=lambda x: x, **_): """Validate the JSON string to deserialise. :...
stack_v2_sparse_classes_75kplus_train_065993
4,890
permissive
[ { "docstring": "Validate the JSON string to deserialise. :param data: Marshmallow-provided dict containing parsed object values :param process_fn: function to process data before validation :param _: unused kwargs passed by Marshmallow :return: dict suitable for object constructor.", "name": "validate_on_lo...
4
stack_v2_sparse_classes_30k_train_003007
Implement the Python class `ValidatingSchema` described below. Class description: ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON. Method signatures and docstrings: - def validate_on_load(self, data, process_fn=lamb...
Implement the Python class `ValidatingSchema` described below. Class description: ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON. Method signatures and docstrings: - def validate_on_load(self, data, process_fn=lamb...
87083655aca8f8f53a26dba253a0189d8519714b
<|skeleton|> class ValidatingSchema: """ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON.""" def validate_on_load(self, data, process_fn=lambda x: x, **_): """Validate the JSON string to deserialise. :...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class ValidatingSchema: """ValidatingSchema is a marshmallow schema that calls the appropriate Telescope Model schema validation functions when serialising or deserialising JSON.""" def validate_on_load(self, data, process_fn=lambda x: x, **_): """Validate the JSON string to deserialise. :param data: M...
the_stack_v2_python_sparse
src/ska_tmc_cdm/schemas/shared.py
ska-telescope/cdm-shared-library
train
0
105366e7da84f09ca4651ffd86a53e1a710299ac
[ "if len(signals) == 0:\n return 0.0\nif len(signals) == 1:\n res = np.copy(signals[0])\nelse:\n rng = slice(*phase)\n wei = np.clip(np.array([nanhfsigma(i[rng]) for i in signals], dtype='f4'), 0.0005, 0.01)\n wei[np.isnan(wei)] = 0.01\n wei = 0.01 - wei\n wei[np.isnan(wei)] = 0.0\n res = np....
<|body_start_0|> if len(signals) == 0: return 0.0 if len(signals) == 1: res = np.copy(signals[0]) else: rng = slice(*phase) wei = np.clip(np.array([nanhfsigma(i[rng]) for i in signals], dtype='f4'), 0.0005, 0.01) wei[np.isnan(wei)] = 0....
Subtracts the average signal
SubtractWeightedAverageSignal
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubtractWeightedAverageSignal: """Subtracts the average signal""" def apply(signals, phase): """Aggregates signals""" <|body_0|> def process(self, beads, frame): """Aggregates signals from a frame""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_75kplus_train_065994
17,420
no_license
[ { "docstring": "Aggregates signals", "name": "apply", "signature": "def apply(signals, phase)" }, { "docstring": "Aggregates signals from a frame", "name": "process", "signature": "def process(self, beads, frame)" } ]
2
stack_v2_sparse_classes_30k_train_027720
Implement the Python class `SubtractWeightedAverageSignal` described below. Class description: Subtracts the average signal Method signatures and docstrings: - def apply(signals, phase): Aggregates signals - def process(self, beads, frame): Aggregates signals from a frame
Implement the Python class `SubtractWeightedAverageSignal` described below. Class description: Subtracts the average signal Method signatures and docstrings: - def apply(signals, phase): Aggregates signals - def process(self, beads, frame): Aggregates signals from a frame <|skeleton|> class SubtractWeightedAverageSi...
f9534e4fff9775ff45d08d401de61015d4a69e76
<|skeleton|> class SubtractWeightedAverageSignal: """Subtracts the average signal""" def apply(signals, phase): """Aggregates signals""" <|body_0|> def process(self, beads, frame): """Aggregates signals from a frame""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SubtractWeightedAverageSignal: """Subtracts the average signal""" def apply(signals, phase): """Aggregates signals""" if len(signals) == 0: return 0.0 if len(signals) == 1: res = np.copy(signals[0]) else: rng = slice(*phase) ...
the_stack_v2_python_sparse
src/cleaning/beadsubtraction.py
depixusgenome/trackanalysis
train
0
c98c5fc182539b9fdbedaf30acb24607f80dd8b2
[ "self.original_user = kwargs.pop('original_user', None)\nsuper(EmailShareForm, self).__init__(*args, **kwargs)\nif self.original_user is not None:\n self.fields['user_group'].queryset = CustomUser.objects.filter(tenant=get_current_user().tenant).exclude(pk=self.original_user.pk)\nelse:\n self.fields['user_gro...
<|body_start_0|> self.original_user = kwargs.pop('original_user', None) super(EmailShareForm, self).__init__(*args, **kwargs) if self.original_user is not None: self.fields['user_group'].queryset = CustomUser.objects.filter(tenant=get_current_user().tenant).exclude(pk=self.original_u...
Form to share an e-mail account.
EmailShareForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailShareForm: """Form to share an e-mail account.""" def __init__(self, *args, **kwargs): """Overload super().__init__ to change the appearance of the form.""" <|body_0|> def clean(self): """Please specify which users to share this email address with.""" ...
stack_v2_sparse_classes_75kplus_train_065995
19,124
no_license
[ { "docstring": "Overload super().__init__ to change the appearance of the form.", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Please specify which users to share this email address with.", "name": "clean", "signature": "def clean(self)" }, ...
3
null
Implement the Python class `EmailShareForm` described below. Class description: Form to share an e-mail account. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Overload super().__init__ to change the appearance of the form. - def clean(self): Please specify which users to share this email ad...
Implement the Python class `EmailShareForm` described below. Class description: Form to share an e-mail account. Method signatures and docstrings: - def __init__(self, *args, **kwargs): Overload super().__init__ to change the appearance of the form. - def clean(self): Please specify which users to share this email ad...
0a284e2aae3ca08955215418a76bb70ad9af1f81
<|skeleton|> class EmailShareForm: """Form to share an e-mail account.""" def __init__(self, *args, **kwargs): """Overload super().__init__ to change the appearance of the form.""" <|body_0|> def clean(self): """Please specify which users to share this email address with.""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class EmailShareForm: """Form to share an e-mail account.""" def __init__(self, *args, **kwargs): """Overload super().__init__ to change the appearance of the form.""" self.original_user = kwargs.pop('original_user', None) super(EmailShareForm, self).__init__(*args, **kwargs) if...
the_stack_v2_python_sparse
lily/messaging/email/forms/forms.py
rmoorman/hellolily
train
0
67ac9a0282cf54e04071ece60930f6fe934ecc14
[ "if sort is None:\n self.sort = lambda numbers: numbers\nelif callable(sort):\n self.sort = sort\nelse:\n raise TypeError('sort must be a callable method or None')", "if numbers[0] <= target <= numbers[-1]:\n return True\nreturn False" ]
<|body_start_0|> if sort is None: self.sort = lambda numbers: numbers elif callable(sort): self.sort = sort else: raise TypeError('sort must be a callable method or None') <|end_body_0|> <|body_start_1|> if numbers[0] <= target <= numbers[-1]: ...
An abstract base class for sorted sequence-based search algorithms.
SortedSequenceSearchAlgorithm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SortedSequenceSearchAlgorithm: """An abstract base class for sorted sequence-based search algorithms.""" def __init__(self, sort: Callable=sorted): """Initialize a new sortable search algorithm. Args: sort: the sorting method to used (default sorted) Note: passing None to sort will d...
stack_v2_sparse_classes_75kplus_train_065996
2,104
no_license
[ { "docstring": "Initialize a new sortable search algorithm. Args: sort: the sorting method to used (default sorted) Note: passing None to sort will disable sorting before searching", "name": "__init__", "signature": "def __init__(self, sort: Callable=sorted)" }, { "docstring": "Return a boolean ...
2
null
Implement the Python class `SortedSequenceSearchAlgorithm` described below. Class description: An abstract base class for sorted sequence-based search algorithms. Method signatures and docstrings: - def __init__(self, sort: Callable=sorted): Initialize a new sortable search algorithm. Args: sort: the sorting method t...
Implement the Python class `SortedSequenceSearchAlgorithm` described below. Class description: An abstract base class for sorted sequence-based search algorithms. Method signatures and docstrings: - def __init__(self, sort: Callable=sorted): Initialize a new sortable search algorithm. Args: sort: the sorting method t...
06bff81c5b8942c3b713263b0d417c4d19f1d7b3
<|skeleton|> class SortedSequenceSearchAlgorithm: """An abstract base class for sorted sequence-based search algorithms.""" def __init__(self, sort: Callable=sorted): """Initialize a new sortable search algorithm. Args: sort: the sorting method to used (default sorted) Note: passing None to sort will d...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class SortedSequenceSearchAlgorithm: """An abstract base class for sorted sequence-based search algorithms.""" def __init__(self, sort: Callable=sorted): """Initialize a new sortable search algorithm. Args: sort: the sorting method to used (default sorted) Note: passing None to sort will disable sortin...
the_stack_v2_python_sparse
venv1/lib/python3.6/site-packages/searching/sequence/sequence_search_algorithm.py
Shawnmhy/BEProject
train
0
9818a7466268e82c9e5cff02176ca64384394c9d
[ "res = 1\np = x\nt = abs(n)\nwhile t:\n print(t, p, res)\n if t & 1:\n res *= p\n p *= p\n t >>= 1\nreturn res if n > 0 else 1 / res", "res = 1\np = x\nt = abs(n)\ncur = 1\nwhile cur <= t:\n if cur * 2 < t:\n p *= p\n cur *= 2\n else:\n t -= cur\n res *= p\n ...
<|body_start_0|> res = 1 p = x t = abs(n) while t: print(t, p, res) if t & 1: res *= p p *= p t >>= 1 return res if n > 0 else 1 / res <|end_body_0|> <|body_start_1|> res = 1 p = x t = abs(n)...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def myPow(self, x: float, n: int) -> float: """二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return:""" <|body_0|> def myPow2(self, x: float, n: int) -> float: """正向乘方逼近 :param x: :param n: :return:""" ...
stack_v2_sparse_classes_75kplus_train_065997
1,990
no_license
[ { "docstring": "二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return:", "name": "myPow", "signature": "def myPow(self, x: float, n: int) -> float" }, { "docstring": "正向乘方逼近 :param x: :param n: :return:", "name": "myPow2", "signature":...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myPow(self, x: float, n: int) -> float: 二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return: - def myPow2(self, x: floa...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def myPow(self, x: float, n: int) -> float: 二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return: - def myPow2(self, x: floa...
5d3574ccd282d0146c83c286ae28d8baaabd4910
<|skeleton|> class Solution: def myPow(self, x: float, n: int) -> float: """二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return:""" <|body_0|> def myPow2(self, x: float, n: int) -> float: """正向乘方逼近 :param x: :param n: :return:""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class Solution: def myPow(self, x: float, n: int) -> float: """二进制拆分 2^15 = 2^8*2^7 = 1111=1000+111 -> 8=1000=((2*2)**2)**2(三次p=p*p) 7=111 -> :param x: :param n: :return:""" res = 1 p = x t = abs(n) while t: print(t, p, res) if t & 1: r...
the_stack_v2_python_sparse
50_Pow(x, n).py
lovehhf/LeetCode
train
0
7b7b3b49bc50b725f8977e5ca80c15e4091d1bb0
[ "self.trigramCount = collections.defaultdict(lambda: 0)\nbg = LaplaceBigramLanguageModel(corpus)\nself.bigramCount = bg.bigramCount\nself.uniGram = bg.uniGram.uniDict\nself.train(corpus)\nself.vocab = len(self.bigramCount.keys())", "for sentence in corpus.corpus:\n line = sentence.data\n for i in range(1, l...
<|body_start_0|> self.trigramCount = collections.defaultdict(lambda: 0) bg = LaplaceBigramLanguageModel(corpus) self.bigramCount = bg.bigramCount self.uniGram = bg.uniGram.uniDict self.train(corpus) self.vocab = len(self.bigramCount.keys()) <|end_body_0|> <|body_start_1|...
CustomLanguageModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomLanguageModel: def __init__(self, corpus): """Initialize your data structures in the constructor.""" <|body_0|> def train(self, corpus): """Takes a corpus and trains your language model. Compute any counts or other corpus statistics in this function.""" ...
stack_v2_sparse_classes_75kplus_train_065998
1,386
no_license
[ { "docstring": "Initialize your data structures in the constructor.", "name": "__init__", "signature": "def __init__(self, corpus)" }, { "docstring": "Takes a corpus and trains your language model. Compute any counts or other corpus statistics in this function.", "name": "train", "signat...
3
stack_v2_sparse_classes_30k_val_001611
Implement the Python class `CustomLanguageModel` described below. Class description: Implement the CustomLanguageModel class. Method signatures and docstrings: - def __init__(self, corpus): Initialize your data structures in the constructor. - def train(self, corpus): Takes a corpus and trains your language model. Co...
Implement the Python class `CustomLanguageModel` described below. Class description: Implement the CustomLanguageModel class. Method signatures and docstrings: - def __init__(self, corpus): Initialize your data structures in the constructor. - def train(self, corpus): Takes a corpus and trains your language model. Co...
c85a5d0caf702efac27a50c17bf7a03c5768be9f
<|skeleton|> class CustomLanguageModel: def __init__(self, corpus): """Initialize your data structures in the constructor.""" <|body_0|> def train(self, corpus): """Takes a corpus and trains your language model. Compute any counts or other corpus statistics in this function.""" ...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class CustomLanguageModel: def __init__(self, corpus): """Initialize your data structures in the constructor.""" self.trigramCount = collections.defaultdict(lambda: 0) bg = LaplaceBigramLanguageModel(corpus) self.bigramCount = bg.bigramCount self.uniGram = bg.uniGram.uniDict ...
the_stack_v2_python_sparse
LanguageModels/src/CustomLanguageModel.py
rahulr56/NLP
train
0
d68bb7481b214e1616af35579e0acc89f2ed318c
[ "if isinstance(dc, intdisc.discount_calculator):\n self.dc_ = dc\nelse:\n raise ValueError('dc must be of type discount_calculator')\nif options and isinstance(options, dict):\n self.options = options.copy()\nelse:\n raise ValueError('options must be of type dictionary')\nself.dbg = dbg\nself.results = ...
<|body_start_0|> if isinstance(dc, intdisc.discount_calculator): self.dc_ = dc else: raise ValueError('dc must be of type discount_calculator') if options and isinstance(options, dict): self.options = options.copy() else: raise ValueError('...
Class for evaliuating quality of discount class
discount_calculator_review
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class discount_calculator_review: """Class for evaliuating quality of discount class""" def __init__(self, options, dc, dbg=True): """instantiates review tool""" <|body_0|> def review(self): """Constructs dictionary of comparisons based on the init_dict specification""...
stack_v2_sparse_classes_75kplus_train_065999
3,662
permissive
[ { "docstring": "instantiates review tool", "name": "__init__", "signature": "def __init__(self, options, dc, dbg=True)" }, { "docstring": "Constructs dictionary of comparisons based on the init_dict specification", "name": "review", "signature": "def review(self)" }, { "docstring...
3
null
Implement the Python class `discount_calculator_review` described below. Class description: Class for evaliuating quality of discount class Method signatures and docstrings: - def __init__(self, options, dc, dbg=True): instantiates review tool - def review(self): Constructs dictionary of comparisons based on the init...
Implement the Python class `discount_calculator_review` described below. Class description: Class for evaliuating quality of discount class Method signatures and docstrings: - def __init__(self, options, dc, dbg=True): instantiates review tool - def review(self): Constructs dictionary of comparisons based on the init...
2e08363642fd4e2afb5ab76596d75aa10f2a6e3b
<|skeleton|> class discount_calculator_review: """Class for evaliuating quality of discount class""" def __init__(self, options, dc, dbg=True): """instantiates review tool""" <|body_0|> def review(self): """Constructs dictionary of comparisons based on the init_dict specification""...
stack_v2_sparse_classes_75kplus
data/stack_v2_sparse_classes_30k
75,829
class discount_calculator_review: """Class for evaliuating quality of discount class""" def __init__(self, options, dc, dbg=True): """instantiates review tool""" if isinstance(dc, intdisc.discount_calculator): self.dc_ = dc else: raise ValueError('dc must be of t...
the_stack_v2_python_sparse
src/ir_discount_review.py
slpenn13/pythoninterestrates
train
0