blob_id
stringlengths
40
40
bodies
listlengths
2
6
bodies_text
stringlengths
196
6.73k
class_docstring
stringlengths
0
700
class_name
stringlengths
1
86
detected_licenses
listlengths
0
45
format_version
stringclasses
1 value
full_text
stringlengths
438
7.52k
id
stringlengths
40
40
length_bytes
int64
506
50k
license_type
stringclasses
2 values
methods
listlengths
2
6
n_methods
int64
2
6
original_id
stringlengths
38
40
prompt
stringlengths
153
4.25k
prompted_full_text
stringlengths
645
10.7k
revision_id
stringlengths
40
40
skeleton
stringlengths
162
4.34k
snapshot_name
stringclasses
1 value
snapshot_source_dir
stringclasses
1 value
solution
stringlengths
302
7.33k
source
stringclasses
1 value
source_path
stringlengths
4
177
source_repo
stringlengths
6
110
split
stringclasses
1 value
star_events_count
int64
0
209k
611cff14b17f6cdc5846187ccf778a29da273728
[ "if not head:\n return None\nif head.next is None:\n return head\nvals = []\ncur = head\nwhile cur:\n vals.append(cur.val)\n cur = cur.next\nvals = sorted(vals)\npHead = ListNode(None)\ncur = ListNode(vals[0])\npHead.next = cur\nfor v in vals[1:]:\n cur.next = ListNode(v)\n cur = cur.next\nreturn ...
<|body_start_0|> if not head: return None if head.next is None: return head vals = [] cur = head while cur: vals.append(cur.val) cur = cur.next vals = sorted(vals) pHead = ListNode(None) cur = ListNode(vals[0...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def sortList2(self, head: ListNode) -> ListNode: """把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n)""" <|body_0|> def sortList(self, head: ListNode) -> ListNode: """归并排序解法, 代码比较丑, 但是思路没问题: 先用快慢指针找到链表的中点, 断开, 然后分别排序, 再归并""" <|...
stack_v2_sparse_classes_36k_train_008100
2,838
no_license
[ { "docstring": "把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n)", "name": "sortList2", "signature": "def sortList2(self, head: ListNode) -> ListNode" }, { "docstring": "归并排序解法, 代码比较丑, 但是思路没问题: 先用快慢指针找到链表的中点, 断开, 然后分别排序, 再归并", "name": "sortList", "signature": "def ...
2
stack_v2_sparse_classes_30k_train_004536
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortList2(self, head: ListNode) -> ListNode: 把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n) - def sortList(self, head: ListNode) -> ListNode: 归并排序解法,...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def sortList2(self, head: ListNode) -> ListNode: 把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n) - def sortList(self, head: ListNode) -> ListNode: 归并排序解法,...
99a3abf1774933af73a8405f9b59e5e64906bca4
<|skeleton|> class Solution: def sortList2(self, head: ListNode) -> ListNode: """把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n)""" <|body_0|> def sortList(self, head: ListNode) -> ListNode: """归并排序解法, 代码比较丑, 但是思路没问题: 先用快慢指针找到链表的中点, 断开, 然后分别排序, 再归并""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def sortList2(self, head: ListNode) -> ListNode: """把值都取出来, 然后排序, 再重新创建链表 时间复杂度是 O(n)+O(nlog(n))+O(n), 符合要求, 但是 空间复杂度是 O(n)""" if not head: return None if head.next is None: return head vals = [] cur = head while cur: ...
the_stack_v2_python_sparse
2018年力扣高频算法面试题汇总/排序链表.py
iamkissg/leetcode
train
0
adc76783d82bb519bf26570f3dce506bb09d9a5d
[ "self.v_ht = ctx.new_var('gb_ht')\nself.v_irow = self.compile_new_tuple(ctx, self.op.schema, 'gb_irow')\ninitargs = ['None', 'None', '[]']\nif self.l_i is not None:\n initargs.append('[]')\nhtinit = 'defaultdict(lambda: [%s])' % ', '.join(initargs)\nctx.declare(self.v_ht, htinit)\nctx.request_vars(dict(row=None)...
<|body_start_0|> self.v_ht = ctx.new_var('gb_ht') self.v_irow = self.compile_new_tuple(ctx, self.op.schema, 'gb_irow') initargs = ['None', 'None', '[]'] if self.l_i is not None: initargs.append('[]') htinit = 'defaultdict(lambda: [%s])' % ', '.join(initargs) c...
PyGroupByBottomTranslator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PyGroupByBottomTranslator: def produce(self, ctx): """Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually calls self.consume).""" <|body_0|> def consume(self, ctx): """Build hashtable For instance, i...
stack_v2_sparse_classes_36k_train_008101
4,883
permissive
[ { "docstring": "Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually calls self.consume).", "name": "produce", "signature": "def produce(self, ctx)" }, { "docstring": "Build hashtable For instance, if the query is: SELECT a-b, co...
2
null
Implement the Python class `PyGroupByBottomTranslator` described below. Class description: Implement the PyGroupByBottomTranslator class. Method signatures and docstrings: - def produce(self, ctx): Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually ...
Implement the Python class `PyGroupByBottomTranslator` described below. Class description: Implement the PyGroupByBottomTranslator class. Method signatures and docstrings: - def produce(self, ctx): Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually ...
9ffbd96b258e6f98f0876da5d7de0cef90a24ef0
<|skeleton|> class PyGroupByBottomTranslator: def produce(self, ctx): """Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually calls self.consume).""" <|body_0|> def consume(self, ctx): """Build hashtable For instance, i...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PyGroupByBottomTranslator: def produce(self, ctx): """Produce sets up the variables and hash table so that they can be populated by calling child's produce (which eventually calls self.consume).""" self.v_ht = ctx.new_var('gb_ht') self.v_irow = self.compile_new_tuple(ctx, self.op.schem...
the_stack_v2_python_sparse
databass/compile/py/agg.py
w6113/databass-public
train
5
d4a12b2857a19dda69da2475a322a692d0cc6827
[ "super().__init__()\nself.broadcaster = make_broadcaster(broadcaster_type=broadcaster_type, filename=filename)\nself.receiver = AirmarReceiver(logger=logger, broadcaster=self.broadcaster, mock_bbio=mock_bbio, mock_port=mock_port)\nself.read_interval = read_interval()", "while self.is_alive():\n if not self.rec...
<|body_start_0|> super().__init__() self.broadcaster = make_broadcaster(broadcaster_type=broadcaster_type, filename=filename) self.receiver = AirmarReceiver(logger=logger, broadcaster=self.broadcaster, mock_bbio=mock_bbio, mock_port=mock_port) self.read_interval = read_interval() <|end_b...
A separate thread to manage reading the airmar inputs.
AirmarInputThread
[ "MIT", "Python-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AirmarInputThread: """A separate thread to manage reading the airmar inputs.""" def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None): """Builds a new airmar input thread.""" <|body_0|> def run(self): ...
stack_v2_sparse_classes_36k_train_008102
1,291
permissive
[ { "docstring": "Builds a new airmar input thread.", "name": "__init__", "signature": "def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None)" }, { "docstring": "Starts a regular read interval.", "name": "run", "signature": "d...
2
stack_v2_sparse_classes_30k_train_012966
Implement the Python class `AirmarInputThread` described below. Class description: A separate thread to manage reading the airmar inputs. Method signatures and docstrings: - def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None): Builds a new airmar input...
Implement the Python class `AirmarInputThread` described below. Class description: A separate thread to manage reading the airmar inputs. Method signatures and docstrings: - def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None): Builds a new airmar input...
b5d75cb82e4bc3e9c4e428a288c6ac98a4aa2c52
<|skeleton|> class AirmarInputThread: """A separate thread to manage reading the airmar inputs.""" def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None): """Builds a new airmar input thread.""" <|body_0|> def run(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AirmarInputThread: """A separate thread to manage reading the airmar inputs.""" def __init__(self, logger, mock_bbio=None, mock_port=None, broadcaster_type=BroadcasterType.Messenger, filename=None): """Builds a new airmar input thread.""" super().__init__() self.broadcaster = make...
the_stack_v2_python_sparse
src/airmar/airmar_input_thread.py
vt-sailbot/sailbot-21
train
5
9963cb40a1d6ab4d2fca307a9122212b9093e8e3
[ "keys = 'ucagrymkwsbhvdn?-'\nfor k in keys:\n assert k in RnaAlphabet\nfor k in keys.upper():\n assert k in RnaAlphabet\nassert 'X' not in RnaAlphabet", "degens = [['ucag', 'n'], ['ucag-', '?'], ['ucg', 'b'], ['uag', 'd'], ['uca', 'h'], ['ug', 'k'], ['ca', 'm'], ['ag', 'r'], ['cg', 's'], ['cag', 'v'], ['ua'...
<|body_start_0|> keys = 'ucagrymkwsbhvdn?-' for k in keys: assert k in RnaAlphabet for k in keys.upper(): assert k in RnaAlphabet assert 'X' not in RnaAlphabet <|end_body_0|> <|body_start_1|> degens = [['ucag', 'n'], ['ucag-', '?'], ['ucg', 'b'], ['uag', ...
Spot-checks of alphabet functionality applied to RNA alphabet.
RnaAlphabetTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RnaAlphabetTests: """Spot-checks of alphabet functionality applied to RNA alphabet.""" def test_contains(self): """RnaAlphabet should __contain__ the expected symbols.""" <|body_0|> def test_InverseDegens(self): """RnaAlphabet should have correct inverse degenera...
stack_v2_sparse_classes_36k_train_008103
27,704
no_license
[ { "docstring": "RnaAlphabet should __contain__ the expected symbols.", "name": "test_contains", "signature": "def test_contains(self)" }, { "docstring": "RnaAlphabet should have correct inverse degenerates", "name": "test_InverseDegens", "signature": "def test_InverseDegens(self)" }, ...
3
stack_v2_sparse_classes_30k_train_020228
Implement the Python class `RnaAlphabetTests` described below. Class description: Spot-checks of alphabet functionality applied to RNA alphabet. Method signatures and docstrings: - def test_contains(self): RnaAlphabet should __contain__ the expected symbols. - def test_InverseDegens(self): RnaAlphabet should have cor...
Implement the Python class `RnaAlphabetTests` described below. Class description: Spot-checks of alphabet functionality applied to RNA alphabet. Method signatures and docstrings: - def test_contains(self): RnaAlphabet should __contain__ the expected symbols. - def test_InverseDegens(self): RnaAlphabet should have cor...
b49442bd793a743188a43809903dc140512420b7
<|skeleton|> class RnaAlphabetTests: """Spot-checks of alphabet functionality applied to RNA alphabet.""" def test_contains(self): """RnaAlphabet should __contain__ the expected symbols.""" <|body_0|> def test_InverseDegens(self): """RnaAlphabet should have correct inverse degenera...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RnaAlphabetTests: """Spot-checks of alphabet functionality applied to RNA alphabet.""" def test_contains(self): """RnaAlphabet should __contain__ the expected symbols.""" keys = 'ucagrymkwsbhvdn?-' for k in keys: assert k in RnaAlphabet for k in keys.upper(): ...
the_stack_v2_python_sparse
old_cogent_tests/base/test_alphabet.py
pycogent/old-cogent
train
0
48725f0716b8b0d6907e48beae85d9844a9ca368
[ "if isinstance(key, int):\n return FlowBindingAction(key)\nif key not in FlowBindingAction._member_map_:\n return extend_enum(FlowBindingAction, key, default)\nreturn FlowBindingAction[key]", "if not (isinstance(value, int) and 0 <= value <= 255):\n raise ValueError('%r is not a valid %s' % (value, cls._...
<|body_start_0|> if isinstance(key, int): return FlowBindingAction(key) if key not in FlowBindingAction._member_map_: return extend_enum(FlowBindingAction, key, default) return FlowBindingAction[key] <|end_body_0|> <|body_start_1|> if not (isinstance(value, int) ...
[FlowBindingAction] Flow Binding Action Values
FlowBindingAction
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FlowBindingAction: """[FlowBindingAction] Flow Binding Action Values""" def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction': """Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private:""" <|body_...
stack_v2_sparse_classes_36k_train_008104
2,081
permissive
[ { "docstring": "Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private:", "name": "get", "signature": "def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction'" }, { "docstring": "Lookup function used when value is not ...
2
null
Implement the Python class `FlowBindingAction` described below. Class description: [FlowBindingAction] Flow Binding Action Values Method signatures and docstrings: - def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction': Backport support for original codes. Args: key: Key to get enum item. default: Defa...
Implement the Python class `FlowBindingAction` described below. Class description: [FlowBindingAction] Flow Binding Action Values Method signatures and docstrings: - def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction': Backport support for original codes. Args: key: Key to get enum item. default: Defa...
a6fe49ec58f09e105bec5a00fb66d9b3f22730d9
<|skeleton|> class FlowBindingAction: """[FlowBindingAction] Flow Binding Action Values""" def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction': """Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private:""" <|body_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FlowBindingAction: """[FlowBindingAction] Flow Binding Action Values""" def get(key: 'int | str', default: 'int'=-1) -> 'FlowBindingAction': """Backport support for original codes. Args: key: Key to get enum item. default: Default value if not found. :meta private:""" if isinstance(key, i...
the_stack_v2_python_sparse
pcapkit/const/mh/fb_action.py
JarryShaw/PyPCAPKit
train
204
c72252db737a7f07b77a9f9649a0309ad9367ae0
[ "year = self.get_year()\nmonth = self.get_month()\nday = self.get_day()\ndate = _date_from_string(year, self.get_year_format(), month, self.get_month_format(), day, self.get_day_format())\nreturn self._get_dated_items(date)", "lookup_kwargs = self._make_single_date_lookup(date)\nqs = self.get_dated_queryset(**loo...
<|body_start_0|> year = self.get_year() month = self.get_month() day = self.get_day() date = _date_from_string(year, self.get_year_format(), month, self.get_month_format(), day, self.get_day_format()) return self._get_dated_items(date) <|end_body_0|> <|body_start_1|> loo...
List of objects published on a given day.
BaseDayArchiveView
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseDayArchiveView: """List of objects published on a given day.""" def get_dated_items(self): """Return (date_list, items, extra_context) for this request.""" <|body_0|> def _get_dated_items(self, date): """Do the actual heavy lifting of getting the dated items;...
stack_v2_sparse_classes_36k_train_008105
18,709
permissive
[ { "docstring": "Return (date_list, items, extra_context) for this request.", "name": "get_dated_items", "signature": "def get_dated_items(self)" }, { "docstring": "Do the actual heavy lifting of getting the dated items; this accepts a date object so that TodayArchiveView can be trivial.", "n...
2
stack_v2_sparse_classes_30k_train_011327
Implement the Python class `BaseDayArchiveView` described below. Class description: List of objects published on a given day. Method signatures and docstrings: - def get_dated_items(self): Return (date_list, items, extra_context) for this request. - def _get_dated_items(self, date): Do the actual heavy lifting of get...
Implement the Python class `BaseDayArchiveView` described below. Class description: List of objects published on a given day. Method signatures and docstrings: - def get_dated_items(self): Return (date_list, items, extra_context) for this request. - def _get_dated_items(self, date): Do the actual heavy lifting of get...
88059b53a10fdce960442fcfd7470fded4cabb19
<|skeleton|> class BaseDayArchiveView: """List of objects published on a given day.""" def get_dated_items(self): """Return (date_list, items, extra_context) for this request.""" <|body_0|> def _get_dated_items(self, date): """Do the actual heavy lifting of getting the dated items;...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseDayArchiveView: """List of objects published on a given day.""" def get_dated_items(self): """Return (date_list, items, extra_context) for this request.""" year = self.get_year() month = self.get_month() day = self.get_day() date = _date_from_string(year, self....
the_stack_v2_python_sparse
shared/utils/views/daterange.py
sha-red/django-shared-utils
train
0
cf223f2937e86fe317e5b3706026fddc724017fd
[ "logging.Handler.__init__(self)\nif not isinstance(database, LogMaster) and (not isinstance(database, LogReadWrite)):\n raise TypeError('A LogMaster or LogReadWrite object must be specified. A {:} was specified instead'.format(type(database)))\nself.database_name = database.database_name\nself.write_log = databa...
<|body_start_0|> logging.Handler.__init__(self) if not isinstance(database, LogMaster) and (not isinstance(database, LogReadWrite)): raise TypeError('A LogMaster or LogReadWrite object must be specified. A {:} was specified instead'.format(type(database))) self.database_name = databa...
A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package.
MongoLogHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MongoLogHandler: """A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package.""" def __init__(self, database): """A LogMaster or...
stack_v2_sparse_classes_36k_train_008106
47,472
no_license
[ { "docstring": "A LogMaster or LogReadWrite object must be specified. The resulting handler object will have a 'database_name' attribute that can be used to identify the handler's destination.", "name": "__init__", "signature": "def __init__(self, database)" }, { "docstring": "If a formatter is ...
2
stack_v2_sparse_classes_30k_train_013695
Implement the Python class `MongoLogHandler` described below. Class description: A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package. Method signatures and d...
Implement the Python class `MongoLogHandler` described below. Class description: A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package. Method signatures and d...
aab8f9789cb6d9b824836ffa4613b4b17d7d4df6
<|skeleton|> class MongoLogHandler: """A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package.""" def __init__(self, database): """A LogMaster or...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MongoLogHandler: """A handler class which writes logging records, appropriately formatted, to the a specified database's permanent log. This is used to simplify the log generation process with the use of the python "logging" package.""" def __init__(self, database): """A LogMaster or LogReadWrite...
the_stack_v2_python_sparse
Drivers/Database/MongoDB.py
cdfredrick/AstroComb_HPF
train
1
7ee6386eea2a69af1484816b2f2194df7680bbe6
[ "queryset = Article.objects.all()\nusername = self.request.query_params.get('username', None)\nif username is not None:\n queryset = queryset.filter(author__username__iexact=username)\ntag = self.request.query_params.get('tag', None)\nif tag is not None:\n queryset = queryset.filter(tags__tag_name__iexact=tag...
<|body_start_0|> queryset = Article.objects.all() username = self.request.query_params.get('username', None) if username is not None: queryset = queryset.filter(author__username__iexact=username) tag = self.request.query_params.get('tag', None) if tag is not None: ...
A user can post an artcle once they have an account in the application params: ['title', 'description', 'body']
ArticleAPIView
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ArticleAPIView: """A user can post an artcle once they have an account in the application params: ['title', 'description', 'body']""" def get_queryset(self): """Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL."...
stack_v2_sparse_classes_36k_train_008107
12,242
permissive
[ { "docstring": "Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL.", "name": "get_queryset", "signature": "def get_queryset(self)" }, { "docstring": "Create a new article in the application", "name": "post", "signatu...
3
stack_v2_sparse_classes_30k_test_000256
Implement the Python class `ArticleAPIView` described below. Class description: A user can post an artcle once they have an account in the application params: ['title', 'description', 'body'] Method signatures and docstrings: - def get_queryset(self): Optionally restricts the returned purchases to a given user, by fi...
Implement the Python class `ArticleAPIView` described below. Class description: A user can post an artcle once they have an account in the application params: ['title', 'description', 'body'] Method signatures and docstrings: - def get_queryset(self): Optionally restricts the returned purchases to a given user, by fi...
e8438b78b88c52d108520429d0b67cd3d13e0824
<|skeleton|> class ArticleAPIView: """A user can post an artcle once they have an account in the application params: ['title', 'description', 'body']""" def get_queryset(self): """Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL."...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ArticleAPIView: """A user can post an artcle once they have an account in the application params: ['title', 'description', 'body']""" def get_queryset(self): """Optionally restricts the returned purchases to a given user, by filtering against a `username` query parameter in the URL.""" qu...
the_stack_v2_python_sparse
authors/apps/articles/views.py
andela/ah-sealteam
train
1
56372b6003ecaffc555fca403c207cf95e64cf51
[ "super().__init__()\nself.name = 'PillarFeatureNet'\nassert len(num_filters) > 0\nnum_input_features += 0\nif with_distance:\n num_input_features += 1\nself._with_distance = with_distance\nself.height = height\nself.width = width\nself.depth = depth\nnum_filters = [num_input_features] + list(num_filters)\npfn_la...
<|body_start_0|> super().__init__() self.name = 'PillarFeatureNet' assert len(num_filters) > 0 num_input_features += 0 if with_distance: num_input_features += 1 self._with_distance = with_distance self.height = height self.width = width ...
PillarFeatureNet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PillarFeatureNet: def __init__(self, num_input_features=4, use_norm=True, num_filters=(64,), height=480, width=480, depth=2, with_distance=False): """Pillar Feature Net. The network prepares the pillar features and performs forward pass through PFNLayers. This net performs a similar role...
stack_v2_sparse_classes_36k_train_008108
7,758
no_license
[ { "docstring": "Pillar Feature Net. The network prepares the pillar features and performs forward pass through PFNLayers. This net performs a similar role to SECOND's second.pytorch.voxelnet.VoxelFeatureExtractor. :param num_input_features: <int>. Number of input features, either x, y, z or x, y, z, r. :param u...
2
null
Implement the Python class `PillarFeatureNet` described below. Class description: Implement the PillarFeatureNet class. Method signatures and docstrings: - def __init__(self, num_input_features=4, use_norm=True, num_filters=(64,), height=480, width=480, depth=2, with_distance=False): Pillar Feature Net. The network p...
Implement the Python class `PillarFeatureNet` described below. Class description: Implement the PillarFeatureNet class. Method signatures and docstrings: - def __init__(self, num_input_features=4, use_norm=True, num_filters=(64,), height=480, width=480, depth=2, with_distance=False): Pillar Feature Net. The network p...
43388efd911feecde588b27a753de353b8e28265
<|skeleton|> class PillarFeatureNet: def __init__(self, num_input_features=4, use_norm=True, num_filters=(64,), height=480, width=480, depth=2, with_distance=False): """Pillar Feature Net. The network prepares the pillar features and performs forward pass through PFNLayers. This net performs a similar role...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PillarFeatureNet: def __init__(self, num_input_features=4, use_norm=True, num_filters=(64,), height=480, width=480, depth=2, with_distance=False): """Pillar Feature Net. The network prepares the pillar features and performs forward pass through PFNLayers. This net performs a similar role to SECOND's s...
the_stack_v2_python_sparse
models/backbones/pointpillars_voxel.py
dragonlong/haoi-pose
train
0
3fb7c270348aade8d4f104fd19362e7ce91ef4a5
[ "super().__init__()\nself.original_image = image\nself.image = image\nself.rect = self.image.get_rect()\nself.rect.x = init_x\nself.rect.y = init_y", "my = self.rect\nits = other.rect\ndist = math.sqrt((its.x - my.x) ** 2 + (its.y - my.y) ** 2)\nreturn dist", "my = self.rect\nits = other.rect\ndist = self.dista...
<|body_start_0|> super().__init__() self.original_image = image self.image = image self.rect = self.image.get_rect() self.rect.x = init_x self.rect.y = init_y <|end_body_0|> <|body_start_1|> my = self.rect its = other.rect dist = math.sqrt((its.x ...
A base class for an entity in Nurltown
Entity
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Entity: """A base class for an entity in Nurltown""" def __init__(self, image, init_x=0, init_y=0): """Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image: pygame.Surface :param init_x: x coordinate of the initi...
stack_v2_sparse_classes_36k_train_008109
10,299
no_license
[ { "docstring": "Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image: pygame.Surface :param init_x: x coordinate of the initial position in the game :type init_x: float :param init_y: y coordinate of the initial position in the game :type i...
3
stack_v2_sparse_classes_30k_train_005885
Implement the Python class `Entity` described below. Class description: A base class for an entity in Nurltown Method signatures and docstrings: - def __init__(self, image, init_x=0, init_y=0): Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image...
Implement the Python class `Entity` described below. Class description: A base class for an entity in Nurltown Method signatures and docstrings: - def __init__(self, image, init_x=0, init_y=0): Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image...
d5cec43ac0958cfd8bcab5d841ffb13594cdcac0
<|skeleton|> class Entity: """A base class for an entity in Nurltown""" def __init__(self, image, init_x=0, init_y=0): """Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image: pygame.Surface :param init_x: x coordinate of the initi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Entity: """A base class for an entity in Nurltown""" def __init__(self, image, init_x=0, init_y=0): """Constructor function for the Entity class :param image: The image which will be rendered to represent the entity :type image: pygame.Surface :param init_x: x coordinate of the initial position i...
the_stack_v2_python_sparse
S18/Projects/nurltown/src/entities.py
dakadabra/Lessons
train
0
e7714d88306c278d3ceb8b6536ecb4a1f96c07ed
[ "self.feature_means = np.mean(X, axis=0)\nself.feature_stds = np.std(X, axis=0)\nprint('평균 : ', self.feature_means, '표준편차 : ', self.feature_stds)", "dim = X.shape\ntransformed = np.empty(dim)\nfor row in range(dim[0]):\n for col in range(dim[1]):\n transformed[row, col] = (X[row, col] - self.feature_mea...
<|body_start_0|> self.feature_means = np.mean(X, axis=0) self.feature_stds = np.std(X, axis=0) print('평균 : ', self.feature_means, '표준편차 : ', self.feature_stds) <|end_body_0|> <|body_start_1|> dim = X.shape transformed = np.empty(dim) for row in range(dim[0]): ...
MyScaler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MyScaler: def fit(self, X): """x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다.""" <|body_0|> def transform(self, X): """x의 평균을 0 / 표준편차를 1로 표준화하고 리턴""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.feature_means = np.mean(X, axis=0) ...
stack_v2_sparse_classes_36k_train_008110
6,624
no_license
[ { "docstring": "x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다.", "name": "fit", "signature": "def fit(self, X)" }, { "docstring": "x의 평균을 0 / 표준편차를 1로 표준화하고 리턴", "name": "transform", "signature": "def transform(self, X)" } ]
2
null
Implement the Python class `MyScaler` described below. Class description: Implement the MyScaler class. Method signatures and docstrings: - def fit(self, X): x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다. - def transform(self, X): x의 평균을 0 / 표준편차를 1로 표준화하고 리턴
Implement the Python class `MyScaler` described below. Class description: Implement the MyScaler class. Method signatures and docstrings: - def fit(self, X): x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다. - def transform(self, X): x의 평균을 0 / 표준편차를 1로 표준화하고 리턴 <|skeleton|> class MyScaler: def fit(self,...
da068ea62682ffa70c7d23dde4ef132c49a81364
<|skeleton|> class MyScaler: def fit(self, X): """x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다.""" <|body_0|> def transform(self, X): """x의 평균을 0 / 표준편차를 1로 표준화하고 리턴""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MyScaler: def fit(self, X): """x의 각 특성(컬럼)들의 평균 & 표준편차 저장 -> 평균과 표준편차는 '특성 별'로 구해져야 한다.""" self.feature_means = np.mean(X, axis=0) self.feature_stds = np.std(X, axis=0) print('평균 : ', self.feature_means, '표준편차 : ', self.feature_stds) def transform(self, X): """x의 평...
the_stack_v2_python_sparse
scratch11_KNN/ex03_knn_직접구현.py
handaeho/lab_python
train
0
ff3127513310da69e8632d86476c226317618987
[ "super().__init__()\nself.max_pool = max_pool\ntblocks = []\nfor i in range(depth):\n tblocks.append(TransformerBlock(emb=emb, heads=heads, seq_length=seq_length, mask=False, dropout=dropout, wide=wide))\nself.tblocks = nn.Sequential(*tblocks)\nself.toprobs = nn.Linear(emb, num_classes)\nself.do = nn.Dropout(dro...
<|body_start_0|> super().__init__() self.max_pool = max_pool tblocks = [] for i in range(depth): tblocks.append(TransformerBlock(emb=emb, heads=heads, seq_length=seq_length, mask=False, dropout=dropout, wide=wide)) self.tblocks = nn.Sequential(*tblocks) self.t...
Transformer for classifying sequences
CTransformer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CTransformer: """Transformer for classifying sequences""" def __init__(self, emb, heads, depth, seq_length, num_classes, max_pool=True, dropout=0.0, wide=False): """:param emb: Embedding dimension :param heads: nr. of attention heads :param depth: Number of transformer blocks :param ...
stack_v2_sparse_classes_36k_train_008111
23,155
permissive
[ { "docstring": ":param emb: Embedding dimension :param heads: nr. of attention heads :param depth: Number of transformer blocks :param seq_length: Expected maximum sequence length :param num_tokens: Number of tokens (usually words) in the vocabulary :param num_classes: Number of classes. :param max_pool: If tru...
2
stack_v2_sparse_classes_30k_train_002460
Implement the Python class `CTransformer` described below. Class description: Transformer for classifying sequences Method signatures and docstrings: - def __init__(self, emb, heads, depth, seq_length, num_classes, max_pool=True, dropout=0.0, wide=False): :param emb: Embedding dimension :param heads: nr. of attention...
Implement the Python class `CTransformer` described below. Class description: Transformer for classifying sequences Method signatures and docstrings: - def __init__(self, emb, heads, depth, seq_length, num_classes, max_pool=True, dropout=0.0, wide=False): :param emb: Embedding dimension :param heads: nr. of attention...
a68400f4918f10dde82574ad19654243c9a65024
<|skeleton|> class CTransformer: """Transformer for classifying sequences""" def __init__(self, emb, heads, depth, seq_length, num_classes, max_pool=True, dropout=0.0, wide=False): """:param emb: Embedding dimension :param heads: nr. of attention heads :param depth: Number of transformer blocks :param ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CTransformer: """Transformer for classifying sequences""" def __init__(self, emb, heads, depth, seq_length, num_classes, max_pool=True, dropout=0.0, wide=False): """:param emb: Embedding dimension :param heads: nr. of attention heads :param depth: Number of transformer blocks :param seq_length: E...
the_stack_v2_python_sparse
poker/models/model_layers.py
bogwero/PokerAI-2
train
0
deef330d6975a7ef77189a3b834ceeb97a8d0946
[ "length = len(s)\nsize = [0 for i in range(length)]\nstack = [0 for i in range(length)]\nstackPtr = 0\nsumming = 0\nres = 0\nfor i, char in enumerate(s):\n if char == '(':\n stack[stackPtr] = i\n stackPtr += 1\n elif char == ')':\n if stackPtr > 0:\n prev = stack[stackPtr - 1]\...
<|body_start_0|> length = len(s) size = [0 for i in range(length)] stack = [0 for i in range(length)] stackPtr = 0 summing = 0 res = 0 for i, char in enumerate(s): if char == '(': stack[stackPtr] = i stackPtr += 1 ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int""" <|body_0|> def longestValidParentheses2(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> length = len(s) size = [0 for i in r...
stack_v2_sparse_classes_36k_train_008112
1,528
permissive
[ { "docstring": ":type s: str :rtype: int", "name": "longestValidParentheses", "signature": "def longestValidParentheses(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "longestValidParentheses2", "signature": "def longestValidParentheses2(self, s)" } ]
2
stack_v2_sparse_classes_30k_train_014211
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestValidParentheses(self, s): :type s: str :rtype: int - def longestValidParentheses2(self, s): :type s: str :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestValidParentheses(self, s): :type s: str :rtype: int - def longestValidParentheses2(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def longestVal...
c8bf33af30569177c5276ffcd72a8d93ba4c402a
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int""" <|body_0|> def longestValidParentheses2(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int""" length = len(s) size = [0 for i in range(length)] stack = [0 for i in range(length)] stackPtr = 0 summing = 0 res = 0 for i, char in enumerate(s): if char ...
the_stack_v2_python_sparse
1-100/31-40/32-longestValidParenthesis/longestValidParenthesis.py
xuychen/Leetcode
train
0
9202d2e7929f8e5c3556ea256de476a3e1ab9cf5
[ "kwargs['type'] = 'variable'\nif 'meta' not in kwargs:\n kwargs['meta'] = {}\nkwargs['meta']['type'] = kwargs['type']\nsuper().__init__(field_id, **kwargs)", "if not isinstance(min_max, list):\n return -1\nif not len(min_max) == 2:\n return -2\nif not all((isinstance(x, numbers.Real) for x in min_max)):\...
<|body_start_0|> kwargs['type'] = 'variable' if 'meta' not in kwargs: kwargs['meta'] = {} kwargs['meta']['type'] = kwargs['type'] super().__init__(field_id, **kwargs) <|end_body_0|> <|body_start_1|> if not isinstance(min_max, list): return -1 if n...
Class for variable field type.
Variable
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Variable: """Class for variable field type.""" def __init__(self, field_id, **kwargs): """Init Variable class.""" <|body_0|> def get_indices_in_range(self, min_max, invert=False): """Get indices for all records in range.""" <|body_1|> def sum_values(...
stack_v2_sparse_classes_36k_train_008113
11,877
permissive
[ { "docstring": "Init Variable class.", "name": "__init__", "signature": "def __init__(self, field_id, **kwargs)" }, { "docstring": "Get indices for all records in range.", "name": "get_indices_in_range", "signature": "def get_indices_in_range(self, min_max, invert=False)" }, { "d...
3
stack_v2_sparse_classes_30k_train_014273
Implement the Python class `Variable` described below. Class description: Class for variable field type. Method signatures and docstrings: - def __init__(self, field_id, **kwargs): Init Variable class. - def get_indices_in_range(self, min_max, invert=False): Get indices for all records in range. - def sum_values(self...
Implement the Python class `Variable` described below. Class description: Class for variable field type. Method signatures and docstrings: - def __init__(self, field_id, **kwargs): Init Variable class. - def get_indices_in_range(self, min_max, invert=False): Get indices for all records in range. - def sum_values(self...
052a26316d19a48981417bf340d9f57e2cdc653a
<|skeleton|> class Variable: """Class for variable field type.""" def __init__(self, field_id, **kwargs): """Init Variable class.""" <|body_0|> def get_indices_in_range(self, min_max, invert=False): """Get indices for all records in range.""" <|body_1|> def sum_values(...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Variable: """Class for variable field type.""" def __init__(self, field_id, **kwargs): """Init Variable class.""" kwargs['type'] = 'variable' if 'meta' not in kwargs: kwargs['meta'] = {} kwargs['meta']['type'] = kwargs['type'] super().__init__(field_id,...
the_stack_v2_python_sparse
src/blobtools/lib/field.py
blobtoolkit/blobtoolkit
train
32
d009b74557a1af19f1ed38b28804c4b3d0fe5231
[ "if root is None:\n return [0]\nsums = []\ncounts = []\n\ndef dfs(node, level):\n if len(sums) == level:\n sums.append(0)\n counts.append(0)\n sums[level] += node.val\n counts[level] += 1\n if node.left:\n dfs(node.left, level + 1)\n if node.right:\n dfs(node.right, lev...
<|body_start_0|> if root is None: return [0] sums = [] counts = [] def dfs(node, level): if len(sums) == level: sums.append(0) counts.append(0) sums[level] += node.val counts[level] += 1 if node....
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" <|body_0|> def averageOfLevels(self, root) -> List[float]: """BFS, Time: O(n), Space: O(n)""" <|body_1|> <|end_skeleton|> <|body_start_0|> if root is None: ...
stack_v2_sparse_classes_36k_train_008114
1,288
no_license
[ { "docstring": "DFS, Time: O(n), Space: O(n)", "name": "averageOfLevels", "signature": "def averageOfLevels(self, root) -> List[float]" }, { "docstring": "BFS, Time: O(n), Space: O(n)", "name": "averageOfLevels", "signature": "def averageOfLevels(self, root) -> List[float]" } ]
2
stack_v2_sparse_classes_30k_train_016468
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def averageOfLevels(self, root) -> List[float]: DFS, Time: O(n), Space: O(n) - def averageOfLevels(self, root) -> List[float]: BFS, Time: O(n), Space: O(n)
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def averageOfLevels(self, root) -> List[float]: DFS, Time: O(n), Space: O(n) - def averageOfLevels(self, root) -> List[float]: BFS, Time: O(n), Space: O(n) <|skeleton|> class So...
72136e3487d239f5b37e2d6393e034262a6bf599
<|skeleton|> class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" <|body_0|> def averageOfLevels(self, root) -> List[float]: """BFS, Time: O(n), Space: O(n)""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def averageOfLevels(self, root) -> List[float]: """DFS, Time: O(n), Space: O(n)""" if root is None: return [0] sums = [] counts = [] def dfs(node, level): if len(sums) == level: sums.append(0) counts.app...
the_stack_v2_python_sparse
python/637-Average of Levels in Binary Tree.py
cwza/leetcode
train
0
7d6d095ac060ef7233d74a27d31db132792097fd
[ "self.selsk_form_kode_field = selsk_form_kode_field\nself.selsk_form_tekst_field = selsk_form_tekst_field\nself.etablert_ar_field = etablert_ar_field\nself.etablert_ar_field_specified = etablert_ar_field_specified\nself.stiftet_dato_field = APIHelper.RFC3339DateTime(stiftet_dato_field) if stiftet_dato_field else No...
<|body_start_0|> self.selsk_form_kode_field = selsk_form_kode_field self.selsk_form_tekst_field = selsk_form_tekst_field self.etablert_ar_field = etablert_ar_field self.etablert_ar_field_specified = etablert_ar_field_specified self.stiftet_dato_field = APIHelper.RFC3339DateTime(s...
Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: type description here. etablert_ar_field_specified (bool): TODO: type descrip...
Grunnfakta
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Grunnfakta: """Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: type description here. etablert_ar_fiel...
stack_v2_sparse_classes_36k_train_008115
7,569
permissive
[ { "docstring": "Constructor for the Grunnfakta class", "name": "__init__", "signature": "def __init__(self, selsk_form_kode_field=None, selsk_form_tekst_field=None, etablert_ar_field=None, etablert_ar_field_specified=None, stiftet_dato_field=None, aksjekapital_field=None, aksjekapital_status_field=None,...
2
null
Implement the Python class `Grunnfakta` described below. Class description: Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: ...
Implement the Python class `Grunnfakta` described below. Class description: Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: ...
fa3918a6c54ea0eedb9146578645b7eb1755b642
<|skeleton|> class Grunnfakta: """Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: type description here. etablert_ar_fiel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Grunnfakta: """Implementation of the 'Grunnfakta' model. TODO: type model description here. Attributes: selsk_form_kode_field (string): TODO: type description here. selsk_form_tekst_field (string): TODO: type description here. etablert_ar_field (int): TODO: type description here. etablert_ar_field_specified (...
the_stack_v2_python_sparse
idfy_rest_client/models/grunnfakta.py
dealflowteam/Idfy
train
0
0da743e9fd2ee531cf516f7f91c5835232851ffa
[ "test, traceback = super(SetRFOnOffTask, self).check(*args, **kwargs)\nif test and self.switch:\n try:\n switch = self.format_and_eval_string(self.switch)\n except Exception:\n return (False, traceback)\n if switch not in ('Off', 'On', 0, 1):\n test = False\n traceback[self.get_...
<|body_start_0|> test, traceback = super(SetRFOnOffTask, self).check(*args, **kwargs) if test and self.switch: try: switch = self.format_and_eval_string(self.switch) except Exception: return (False, traceback) if switch not in ('Off', '...
Switch on/off the output of the source.
SetRFOnOffTask
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SetRFOnOffTask: """Switch on/off the output of the source.""" def check(self, *args, **kwargs): """Validate the value of the of the switch.""" <|body_0|> def i_perform(self, switch=None): """Default interface behavior.""" <|body_1|> <|end_skeleton|> <|b...
stack_v2_sparse_classes_36k_train_008116
7,840
permissive
[ { "docstring": "Validate the value of the of the switch.", "name": "check", "signature": "def check(self, *args, **kwargs)" }, { "docstring": "Default interface behavior.", "name": "i_perform", "signature": "def i_perform(self, switch=None)" } ]
2
stack_v2_sparse_classes_30k_train_012350
Implement the Python class `SetRFOnOffTask` described below. Class description: Switch on/off the output of the source. Method signatures and docstrings: - def check(self, *args, **kwargs): Validate the value of the of the switch. - def i_perform(self, switch=None): Default interface behavior.
Implement the Python class `SetRFOnOffTask` described below. Class description: Switch on/off the output of the source. Method signatures and docstrings: - def check(self, *args, **kwargs): Validate the value of the of the switch. - def i_perform(self, switch=None): Default interface behavior. <|skeleton|> class Set...
b6f1f5b236c7a4e28d9a3bc8da9820c52d789309
<|skeleton|> class SetRFOnOffTask: """Switch on/off the output of the source.""" def check(self, *args, **kwargs): """Validate the value of the of the switch.""" <|body_0|> def i_perform(self, switch=None): """Default interface behavior.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SetRFOnOffTask: """Switch on/off the output of the source.""" def check(self, *args, **kwargs): """Validate the value of the of the switch.""" test, traceback = super(SetRFOnOffTask, self).check(*args, **kwargs) if test and self.switch: try: switch = se...
the_stack_v2_python_sparse
exopy_hqc_legacy/tasks/tasks/instr/rf_tasks.py
Exopy/exopy_hqc_legacy
train
0
e99171cc29a3ba7a6ca9b1b4df722547a9d2527f
[ "self._lat_deg = None\nself._lat_min = None\nself._long_deg = None\nself._long_min = None\nself._bearing = None", "self._lat_deg = sensor_package.latitude_deg\nself._lat_min = sensor_package.latitude_min\nself._long_deg = sensor_package.longitude_deg\nself._long_min = sensor_package.longitude_min\nself._bearing =...
<|body_start_0|> self._lat_deg = None self._lat_min = None self._long_deg = None self._long_min = None self._bearing = None <|end_body_0|> <|body_start_1|> self._lat_deg = sensor_package.latitude_deg self._lat_min = sensor_package.latitude_min self._long_...
Class for sensor package data and calculations.
RawSensorPackage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RawSensorPackage: """Class for sensor package data and calculations.""" def __init__(self): """Initialize sensor package data.""" <|body_0|> def update(self, sensor_package): """Update sensor package data with new LCM data.""" <|body_1|> <|end_skeleton|>...
stack_v2_sparse_classes_36k_train_008117
5,754
no_license
[ { "docstring": "Initialize sensor package data.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Update sensor package data with new LCM data.", "name": "update", "signature": "def update(self, sensor_package)" } ]
2
stack_v2_sparse_classes_30k_train_018128
Implement the Python class `RawSensorPackage` described below. Class description: Class for sensor package data and calculations. Method signatures and docstrings: - def __init__(self): Initialize sensor package data. - def update(self, sensor_package): Update sensor package data with new LCM data.
Implement the Python class `RawSensorPackage` described below. Class description: Class for sensor package data and calculations. Method signatures and docstrings: - def __init__(self): Initialize sensor package data. - def update(self, sensor_package): Update sensor package data with new LCM data. <|skeleton|> clas...
41230800c61b6ad782db691b12ae444d1a26ff05
<|skeleton|> class RawSensorPackage: """Class for sensor package data and calculations.""" def __init__(self): """Initialize sensor package data.""" <|body_0|> def update(self, sensor_package): """Update sensor package data with new LCM data.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RawSensorPackage: """Class for sensor package data and calculations.""" def __init__(self): """Initialize sensor package data.""" self._lat_deg = None self._lat_min = None self._long_deg = None self._long_min = None self._bearing = None def update(self...
the_stack_v2_python_sparse
onboard/filter/src/rawmessages.py
DavidSmith166/mrover-workspace
train
2
b2c651ca1856de05b4edc60d44e18493e3cc29c9
[ "infraction_type = get_field_value(data, 'infraction_type')\ninfraction_duration = get_field_value(data, 'infraction_duration')\nif (get_field_value(data, 'infraction_reason') or infraction_duration) and infraction_type == 'NONE':\n raise ValidationError('Infraction type is required with infraction duration or r...
<|body_start_0|> infraction_type = get_field_value(data, 'infraction_type') infraction_duration = get_field_value(data, 'infraction_duration') if (get_field_value(data, 'infraction_reason') or infraction_duration) and infraction_type == 'NONE': raise ValidationError('Infraction type ...
A class providing (de-)serialization of `Filter` instances.
FilterSerializer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FilterSerializer: """A class providing (de-)serialization of `Filter` instances.""" def validate(self, data: dict) -> dict: """Perform infraction data + allowed and disallowed lists validation.""" <|body_0|> def create(self, validated_data: dict) -> User: """Over...
stack_v2_sparse_classes_36k_train_008118
23,871
permissive
[ { "docstring": "Perform infraction data + allowed and disallowed lists validation.", "name": "validate", "signature": "def validate(self, data: dict) -> dict" }, { "docstring": "Override the create method to catch violations of the custom uniqueness constraint.", "name": "create", "signa...
3
null
Implement the Python class `FilterSerializer` described below. Class description: A class providing (de-)serialization of `Filter` instances. Method signatures and docstrings: - def validate(self, data: dict) -> dict: Perform infraction data + allowed and disallowed lists validation. - def create(self, validated_data...
Implement the Python class `FilterSerializer` described below. Class description: A class providing (de-)serialization of `Filter` instances. Method signatures and docstrings: - def validate(self, data: dict) -> dict: Perform infraction data + allowed and disallowed lists validation. - def create(self, validated_data...
cb6326cabee6570a5725702cb2893ae39f752279
<|skeleton|> class FilterSerializer: """A class providing (de-)serialization of `Filter` instances.""" def validate(self, data: dict) -> dict: """Perform infraction data + allowed and disallowed lists validation.""" <|body_0|> def create(self, validated_data: dict) -> User: """Over...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FilterSerializer: """A class providing (de-)serialization of `Filter` instances.""" def validate(self, data: dict) -> dict: """Perform infraction data + allowed and disallowed lists validation.""" infraction_type = get_field_value(data, 'infraction_type') infraction_duration = get...
the_stack_v2_python_sparse
pydis_site/apps/api/serializers.py
python-discord/site
train
746
80d65e1677017085f0b2948d1b271bca4bb50404
[ "tmpTsk = tasks[0]\nmin = 99999\nfor task in tasks:\n for machine in machines:\n if machine.get_task_duration(task) < min:\n min = machine.get_task_duration(task)\n tmpTsk = task\ntasks.remove(tmpTsk)\nreturn tmpTsk", "beginInd = 0\nendInd = len(tasks)\nvMachines = [vMachineA, vMac...
<|body_start_0|> tmpTsk = tasks[0] min = 99999 for task in tasks: for machine in machines: if machine.get_task_duration(task) < min: min = machine.get_task_duration(task) tmpTsk = task tasks.remove(tmpTsk) return...
JohnsonVirtual
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JohnsonVirtual: def task_w_min_duration(self, machines: list, tasks: list) -> Task: """Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ustawionymi czasami zadań; tasks : list Lista zadań; Returns ------- task Zadanie z najkrótszym czasem ...
stack_v2_sparse_classes_36k_train_008119
1,960
no_license
[ { "docstring": "Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ustawionymi czasami zadań; tasks : list Lista zadań; Returns ------- task Zadanie z najkrótszym czasem wykonywania (niezależnie od maszyny);", "name": "task_w_min_duration", "signature": "de...
2
stack_v2_sparse_classes_30k_test_000385
Implement the Python class `JohnsonVirtual` described below. Class description: Implement the JohnsonVirtual class. Method signatures and docstrings: - def task_w_min_duration(self, machines: list, tasks: list) -> Task: Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ...
Implement the Python class `JohnsonVirtual` described below. Class description: Implement the JohnsonVirtual class. Method signatures and docstrings: - def task_w_min_duration(self, machines: list, tasks: list) -> Task: Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ...
191b203143db8800759dedcb90f7b352e6e457fd
<|skeleton|> class JohnsonVirtual: def task_w_min_duration(self, machines: list, tasks: list) -> Task: """Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ustawionymi czasami zadań; tasks : list Lista zadań; Returns ------- task Zadanie z najkrótszym czasem ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JohnsonVirtual: def task_w_min_duration(self, machines: list, tasks: list) -> Task: """Wyszukiwanie i usuwanie najkrótszego zadania Parameters ---------- machines : list Lista maszyn z ustawionymi czasami zadań; tasks : list Lista zadań; Returns ------- task Zadanie z najkrótszym czasem wykonywania (n...
the_stack_v2_python_sparse
flow_shop_scheduling/labolatorium1/johnson_virtual.py
goorkamateusz/SPD-collage-course
train
1
f605f4a95f151ae3877881c25672887055ed1e36
[ "label_count = dict()\nlines = read_json_format_file(corpus_file)\ndata_len = list()\nfor line in lines:\n label = line['label']\n title = line['title']\n data_len.append(len(title))\n if label in label_count:\n label_count[label] += 1\n else:\n label_count[label] = 1\nprint('数据 label 分...
<|body_start_0|> label_count = dict() lines = read_json_format_file(corpus_file) data_len = list() for line in lines: label = line['label'] title = line['title'] data_len.append(len(title)) if label in label_count: label_cou...
AnalysisData
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AnalysisData: def analysis_data(self, corpus_file): """分析数据分布情况, :param corpus_file: :return:""" <|body_0|> def plot_text_length(self, all_text_len, save_path=None): """绘制文本长度分布 :param all_text_len: [22,33,34,...] :param save_path: 图片保存路径 :return:""" <|body_1...
stack_v2_sparse_classes_36k_train_008120
4,619
no_license
[ { "docstring": "分析数据分布情况, :param corpus_file: :return:", "name": "analysis_data", "signature": "def analysis_data(self, corpus_file)" }, { "docstring": "绘制文本长度分布 :param all_text_len: [22,33,34,...] :param save_path: 图片保存路径 :return:", "name": "plot_text_length", "signature": "def plot_tex...
3
null
Implement the Python class `AnalysisData` described below. Class description: Implement the AnalysisData class. Method signatures and docstrings: - def analysis_data(self, corpus_file): 分析数据分布情况, :param corpus_file: :return: - def plot_text_length(self, all_text_len, save_path=None): 绘制文本长度分布 :param all_text_len: [22...
Implement the Python class `AnalysisData` described below. Class description: Implement the AnalysisData class. Method signatures and docstrings: - def analysis_data(self, corpus_file): 分析数据分布情况, :param corpus_file: :return: - def plot_text_length(self, all_text_len, save_path=None): 绘制文本长度分布 :param all_text_len: [22...
ee7ecedd55ce544b127be8009e026ac2cdc3f71b
<|skeleton|> class AnalysisData: def analysis_data(self, corpus_file): """分析数据分布情况, :param corpus_file: :return:""" <|body_0|> def plot_text_length(self, all_text_len, save_path=None): """绘制文本长度分布 :param all_text_len: [22,33,34,...] :param save_path: 图片保存路径 :return:""" <|body_1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AnalysisData: def analysis_data(self, corpus_file): """分析数据分布情况, :param corpus_file: :return:""" label_count = dict() lines = read_json_format_file(corpus_file) data_len = list() for line in lines: label = line['label'] title = line['title'] ...
the_stack_v2_python_sparse
nlp_tasks/text_classification/toutiao_news/preprocess_data.py
ZouJoshua/dl_project
train
9
d92854ad0bd98a095d396106757e27a091808075
[ "MIPConstraint.__init__(self, inputs, **kwargs)\nself._choices = values\nself._internal_vars = Variable(shape=(len(values), len(self._indices)), boolean=True)", "W, H = (self.inputs.W, self.inputs.H)\nv1, v2 = self._choices\nind = self._internal_vars\ni = self._indices\nC = [W[i] == cvx.multiply(v1[i], ind[0]) + ...
<|body_start_0|> MIPConstraint.__init__(self, inputs, **kwargs) self._choices = values self._internal_vars = Variable(shape=(len(values), len(self._indices)), boolean=True) <|end_body_0|> <|body_start_1|> W, H = (self.inputs.W, self.inputs.H) v1, v2 = self._choices ind =...
FixedDimension
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FixedDimension: def __init__(self, inputs, values, **kwargs): """box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0]""" <|body_0|> def as_constraint(self, **kwargs): """constrain W and H to mutually exclusive discrete values""" ...
stack_v2_sparse_classes_36k_train_008121
8,681
no_license
[ { "docstring": "box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0]", "name": "__init__", "signature": "def __init__(self, inputs, values, **kwargs)" }, { "docstring": "constrain W and H to mutually exclusive discrete values", "name": "as_constraint", "sign...
2
null
Implement the Python class `FixedDimension` described below. Class description: Implement the FixedDimension class. Method signatures and docstrings: - def __init__(self, inputs, values, **kwargs): box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0] - def as_constraint(self, **kwargs): ...
Implement the Python class `FixedDimension` described below. Class description: Implement the FixedDimension class. Method signatures and docstrings: - def __init__(self, inputs, values, **kwargs): box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0] - def as_constraint(self, **kwargs): ...
5928c1ef1eb0d60bfa0726227e690c0a66570f45
<|skeleton|> class FixedDimension: def __init__(self, inputs, values, **kwargs): """box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0]""" <|body_0|> def as_constraint(self, **kwargs): """constrain W and H to mutually exclusive discrete values""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FixedDimension: def __init__(self, inputs, values, **kwargs): """box.W = values[0] and box.H = values[1] or box.W = values[1] and box.H = values[0]""" MIPConstraint.__init__(self, inputs, **kwargs) self._choices = values self._internal_vars = Variable(shape=(len(values), len(se...
the_stack_v2_python_sparse
src/cvopt/formulate/mip.py
psavine42/juststuff
train
0
fb9d24b4ec005753032d52ee7f38d4e13fe5511f
[ "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...
DB class
DB
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DB: """DB class""" def __init__(self) -> None: """Initialize a new DB instance""" <|body_0|> def _session(self): """Memoized session object""" <|body_1|> def add_user(self, email: str, hashed_password: str) -> User: """add_user: returns a use...
stack_v2_sparse_classes_36k_train_008122
2,484
no_license
[ { "docstring": "Initialize a new DB instance", "name": "__init__", "signature": "def __init__(self) -> None" }, { "docstring": "Memoized session object", "name": "_session", "signature": "def _session(self)" }, { "docstring": "add_user: returns a user object and save the user to ...
5
stack_v2_sparse_classes_30k_train_005267
Implement the Python class `DB` described below. Class description: DB class Method signatures and docstrings: - def __init__(self) -> None: Initialize a new DB instance - def _session(self): Memoized session object - def add_user(self, email: str, hashed_password: str) -> User: add_user: returns a user object and sa...
Implement the Python class `DB` described below. Class description: DB class Method signatures and docstrings: - def __init__(self) -> None: Initialize a new DB instance - def _session(self): Memoized session object - def add_user(self, email: str, hashed_password: str) -> User: add_user: returns a user object and sa...
2abe59720ba72d44e363b13e56ec9efed0339c33
<|skeleton|> class DB: """DB class""" def __init__(self) -> None: """Initialize a new DB instance""" <|body_0|> def _session(self): """Memoized session object""" <|body_1|> def add_user(self, email: str, hashed_password: str) -> User: """add_user: returns a use...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DB: """DB class""" def __init__(self) -> None: """Initialize a new DB instance""" 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
khaldi505/holbertonschool-web_back_end
train
1
13aaaab378c60e7422bccdd90dad48e34a042d03
[ "snap = super(ImageView, self).snapshot()\nsnap['source'] = self.source\nsnap['scale_to_fit'] = self.scale_to_fit\nsnap['allow_upscaling'] = self.allow_upscaling\nsnap['preserve_aspect_ratio'] = self.preserve_aspect_ratio\nreturn snap", "super(ImageView, self).bind()\nattrs = ('source', 'scale_to_fit', 'allow_ups...
<|body_start_0|> snap = super(ImageView, self).snapshot() snap['source'] = self.source snap['scale_to_fit'] = self.scale_to_fit snap['allow_upscaling'] = self.allow_upscaling snap['preserve_aspect_ratio'] = self.preserve_aspect_ratio return snap <|end_body_0|> <|body_sta...
A widget which can display an Image with optional scaling.
ImageView
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageView: """A widget which can display an Image with optional scaling.""" def snapshot(self): """Returns the dict of creation attribute for the control.""" <|body_0|> def bind(self): """A method called after initialization which allows the widget to bind any ev...
stack_v2_sparse_classes_36k_train_008123
1,852
permissive
[ { "docstring": "Returns the dict of creation attribute for the control.", "name": "snapshot", "signature": "def snapshot(self)" }, { "docstring": "A method called after initialization which allows the widget to bind any event handlers necessary.", "name": "bind", "signature": "def bind(s...
2
null
Implement the Python class `ImageView` described below. Class description: A widget which can display an Image with optional scaling. Method signatures and docstrings: - def snapshot(self): Returns the dict of creation attribute for the control. - def bind(self): A method called after initialization which allows the ...
Implement the Python class `ImageView` described below. Class description: A widget which can display an Image with optional scaling. Method signatures and docstrings: - def snapshot(self): Returns the dict of creation attribute for the control. - def bind(self): A method called after initialization which allows the ...
424bba29219de58fe9e47196de6763de8b2009f2
<|skeleton|> class ImageView: """A widget which can display an Image with optional scaling.""" def snapshot(self): """Returns the dict of creation attribute for the control.""" <|body_0|> def bind(self): """A method called after initialization which allows the widget to bind any ev...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageView: """A widget which can display an Image with optional scaling.""" def snapshot(self): """Returns the dict of creation attribute for the control.""" snap = super(ImageView, self).snapshot() snap['source'] = self.source snap['scale_to_fit'] = self.scale_to_fit ...
the_stack_v2_python_sparse
enaml/widgets/image_view.py
enthought/enaml
train
17
34efde1c8fe38fb5cfe4d603d1e1a693d1a02129
[ "start = self.isodate_param(timezone.now())\nend = self.isodate_param(timezone.now() + datetime.timedelta(days=31))\nself.send_and_compare_request('getActivityStream', [start, end], None, [])\nself.send_and_compare_request('getActivityStream', [start, end], self.data['token1'], [])", "_gen_activities(10)\nactivit...
<|body_start_0|> start = self.isodate_param(timezone.now()) end = self.isodate_param(timezone.now() + datetime.timedelta(days=31)) self.send_and_compare_request('getActivityStream', [start, end], None, []) self.send_and_compare_request('getActivityStream', [start, end], self.data['token1...
GetActivityStreamTest
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetActivityStreamTest: def test_empty(self): """Test the getActivityStream() call without contents.""" <|body_0|> def test_public(self): """Test the getActivityStream() call with public events.""" <|body_1|> def test_private(self): """Test the ge...
stack_v2_sparse_classes_36k_train_008124
17,825
permissive
[ { "docstring": "Test the getActivityStream() call without contents.", "name": "test_empty", "signature": "def test_empty(self)" }, { "docstring": "Test the getActivityStream() call with public events.", "name": "test_public", "signature": "def test_public(self)" }, { "docstring":...
4
stack_v2_sparse_classes_30k_train_000654
Implement the Python class `GetActivityStreamTest` described below. Class description: Implement the GetActivityStreamTest class. Method signatures and docstrings: - def test_empty(self): Test the getActivityStream() call without contents. - def test_public(self): Test the getActivityStream() call with public events....
Implement the Python class `GetActivityStreamTest` described below. Class description: Implement the GetActivityStreamTest class. Method signatures and docstrings: - def test_empty(self): Test the getActivityStream() call without contents. - def test_public(self): Test the getActivityStream() call with public events....
5e46b82cab225b452eceffd4a5be6dadccceddd2
<|skeleton|> class GetActivityStreamTest: def test_empty(self): """Test the getActivityStream() call without contents.""" <|body_0|> def test_public(self): """Test the getActivityStream() call with public events.""" <|body_1|> def test_private(self): """Test the ge...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GetActivityStreamTest: def test_empty(self): """Test the getActivityStream() call without contents.""" start = self.isodate_param(timezone.now()) end = self.isodate_param(timezone.now() + datetime.timedelta(days=31)) self.send_and_compare_request('getActivityStream', [start, en...
the_stack_v2_python_sparse
amelie/api/test_activitystream.py
Inter-Actief/amelie
train
11
6a8cd2950f6b94c5d9344334fede04012c162db9
[ "xx = x / x_0\nexponent = -alpha - beta * np.log(xx)\nreturn amplitude * xx ** exponent", "xx = x / x_0\nlog_xx = np.log(xx)\nexponent = -alpha - beta * log_xx\nd_amplitude = xx ** exponent\nd_beta = -amplitude * d_amplitude * log_xx ** 2\nd_x_0 = amplitude * d_amplitude * (beta * log_xx / x_0 - exponent / x_0)\n...
<|body_start_0|> xx = x / x_0 exponent = -alpha - beta * np.log(xx) return amplitude * xx ** exponent <|end_body_0|> <|body_start_1|> xx = x / x_0 log_xx = np.log(xx) exponent = -alpha - beta * log_xx d_amplitude = xx ** exponent d_beta = -amplitude * d_a...
One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- PowerLaw1D, BrokenPowerLaw1D, ExponentialCutoffPowerLaw1D Notes ----- Model formula...
LogParabola1D
[ "Python-2.0", "Apache-2.0", "BSD-3-Clause", "LicenseRef-scancode-unknown" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LogParabola1D: """One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- PowerLaw1D, BrokenPowerLaw1D, ExponentialC...
stack_v2_sparse_classes_36k_train_008125
6,539
permissive
[ { "docstring": "One dimensional log parabola model function", "name": "evaluate", "signature": "def evaluate(x, amplitude, x_0, alpha, beta)" }, { "docstring": "One dimensional log parabola derivative with respect to parameters", "name": "fit_deriv", "signature": "def fit_deriv(x, amplit...
2
stack_v2_sparse_classes_30k_train_006023
Implement the Python class `LogParabola1D` described below. Class description: One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- Pow...
Implement the Python class `LogParabola1D` described below. Class description: One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- Pow...
2c9002f16bb5c265e0d14f4a2314c86eeaa35cb6
<|skeleton|> class LogParabola1D: """One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- PowerLaw1D, BrokenPowerLaw1D, ExponentialC...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LogParabola1D: """One dimensional log parabola model (sometimes called curved power law). Parameters ---------- amplitude : float Model amplitude x_0 : float Reference point alpha : float Power law index beta : float Power law curvature See Also -------- PowerLaw1D, BrokenPowerLaw1D, ExponentialCutoffPowerLaw...
the_stack_v2_python_sparse
lib/python2.7/site-packages/astropy/modeling/powerlaws.py
wangyum/Anaconda
train
11
c07f868b9868e81c6207bbaf3604c04222def86d
[ "if restore_option is None:\n restore_option = {}\nif bool(restore_option):\n if not (isinstance(overwrite, bool) and isinstance(power_on, bool)):\n raise SDKException('Subclient', '101')\nself._set_restore_inputs(restore_option, vm_to_restore=self._set_vm_to_restore(vm_to_restore), unconditional_overw...
<|body_start_0|> if restore_option is None: restore_option = {} if bool(restore_option): if not (isinstance(overwrite, bool) and isinstance(power_on, bool)): raise SDKException('Subclient', '101') self._set_restore_inputs(restore_option, vm_to_restore=self...
Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient.
AzureSubclient
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AzureSubclient: """Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient.""" def full_vm_restore_out_of_place(self, vm_to_restore=None, cloud_service=None, storage_account=None, proxy_client=None, resto...
stack_v2_sparse_classes_36k_train_008126
5,835
permissive
[ { "docstring": "Restores the FULL Virtual machine specified in the input list to the client, at the specified destination location. Args: cloud_service (str) -- provide the cloud service storage_account (str) -- provide the storage account vm_to_restore (list) -- provide the VM name to restore overwrite default...
2
stack_v2_sparse_classes_30k_train_007647
Implement the Python class `AzureSubclient` described below. Class description: Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient. Method signatures and docstrings: - def full_vm_restore_out_of_place(self, vm_to_restore=None...
Implement the Python class `AzureSubclient` described below. Class description: Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient. Method signatures and docstrings: - def full_vm_restore_out_of_place(self, vm_to_restore=None...
6aa0beb426a95de877cd531602234515723ccc94
<|skeleton|> class AzureSubclient: """Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient.""" def full_vm_restore_out_of_place(self, vm_to_restore=None, cloud_service=None, storage_account=None, proxy_client=None, resto...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AzureSubclient: """Derived class from VirtualServerSubclient Base class, representing a Azure virtual server subclient,and to perform operations on that subclient.""" def full_vm_restore_out_of_place(self, vm_to_restore=None, cloud_service=None, storage_account=None, proxy_client=None, restore_new_name=N...
the_stack_v2_python_sparse
cvpysdk/subclients/virtualserver/azuresubclient.py
jack1806/cvpysdk
train
1
a42227a53e0dfb62b537e0755bb28a18c9a0cf09
[ "self.class_name = class_name\nself.klass = klass\nif not filter_models_classes(klass):\n raise NameError('Incompatible module for Models class: {0}'.format(klass.__module__))\nself.module_full_name = klass.__module__.replace('kubernetes.', 'kubernetes_typed.')\nself.module_name = klass.__module__.rpartition('.'...
<|body_start_0|> self.class_name = class_name self.klass = klass if not filter_models_classes(klass): raise NameError('Incompatible module for Models class: {0}'.format(klass.__module__)) self.module_full_name = klass.__module__.replace('kubernetes.', 'kubernetes_typed.') ...
Represents parsed state of kubernetes client model.
Model
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Model: """Represents parsed state of kubernetes client model.""" def __init__(self, class_name: str, klass: object) -> None: """Parse model parameters.""" <|body_0|> def uniq_imports(self, import_type: str) -> List[str]: """Get uniq import for the model.""" ...
stack_v2_sparse_classes_36k_train_008127
6,267
permissive
[ { "docstring": "Parse model parameters.", "name": "__init__", "signature": "def __init__(self, class_name: str, klass: object) -> None" }, { "docstring": "Get uniq import for the model.", "name": "uniq_imports", "signature": "def uniq_imports(self, import_type: str) -> List[str]" } ]
2
null
Implement the Python class `Model` described below. Class description: Represents parsed state of kubernetes client model. Method signatures and docstrings: - def __init__(self, class_name: str, klass: object) -> None: Parse model parameters. - def uniq_imports(self, import_type: str) -> List[str]: Get uniq import fo...
Implement the Python class `Model` described below. Class description: Represents parsed state of kubernetes client model. Method signatures and docstrings: - def __init__(self, class_name: str, klass: object) -> None: Parse model parameters. - def uniq_imports(self, import_type: str) -> List[str]: Get uniq import fo...
82995b008daf551a4fe11660018d9c08c69f9e6e
<|skeleton|> class Model: """Represents parsed state of kubernetes client model.""" def __init__(self, class_name: str, klass: object) -> None: """Parse model parameters.""" <|body_0|> def uniq_imports(self, import_type: str) -> List[str]: """Get uniq import for the model.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Model: """Represents parsed state of kubernetes client model.""" def __init__(self, class_name: str, klass: object) -> None: """Parse model parameters.""" self.class_name = class_name self.klass = klass if not filter_models_classes(klass): raise NameError('Inco...
the_stack_v2_python_sparse
scripts/typeddictgen.py
gordonbondon/kubernetes-typed
train
24
93965f7990b3f3f128d051b99b6e550b136ab733
[ "if not (is_scalar(prior) or isinstance(prior, Beta) or is_any_numeric_map(prior) or is_any_beta_map(prior)):\n raise ValueError('wrong type for prior')\nif not (is_scalar(likelihood) or isinstance(likelihood, Beta) or is_any_numeric_map(likelihood) or is_any_beta_map(likelihood)):\n raise ValueError('wrong t...
<|body_start_0|> if not (is_scalar(prior) or isinstance(prior, Beta) or is_any_numeric_map(prior) or is_any_beta_map(prior)): raise ValueError('wrong type for prior') if not (is_scalar(likelihood) or isinstance(likelihood, Beta) or is_any_numeric_map(likelihood) or is_any_beta_map(likelihood...
Class for testing one or more binary hypotheses using Bayes Rule.
BinaryBayesRule
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BinaryBayesRule: """Class for testing one or more binary hypotheses using Bayes Rule.""" def __init__(self, prior: Union[float, Beta, AnyFloatMap, AnyBetaMap], likelihood: Union[float, Beta, AnyFloatMap, AnyBetaMap]): """Create a new Bayes Rule object from: - the prior P(A) - the lik...
stack_v2_sparse_classes_36k_train_008128
2,366
permissive
[ { "docstring": "Create a new Bayes Rule object from: - the prior P(A) - the likelihood P(B|A) - the evidence P(B) :param prior: Single figure or Beta-distributed probability representing the hypothesis. :param likelihood: Series with values of Dirichlet likelihoods.", "name": "__init__", "signature": "d...
2
stack_v2_sparse_classes_30k_train_001008
Implement the Python class `BinaryBayesRule` described below. Class description: Class for testing one or more binary hypotheses using Bayes Rule. Method signatures and docstrings: - def __init__(self, prior: Union[float, Beta, AnyFloatMap, AnyBetaMap], likelihood: Union[float, Beta, AnyFloatMap, AnyBetaMap]): Create...
Implement the Python class `BinaryBayesRule` described below. Class description: Class for testing one or more binary hypotheses using Bayes Rule. Method signatures and docstrings: - def __init__(self, prior: Union[float, Beta, AnyFloatMap, AnyBetaMap], likelihood: Union[float, Beta, AnyFloatMap, AnyBetaMap]): Create...
ff3f5434d3da0d46b127b02cf733699e5a43c904
<|skeleton|> class BinaryBayesRule: """Class for testing one or more binary hypotheses using Bayes Rule.""" def __init__(self, prior: Union[float, Beta, AnyFloatMap, AnyBetaMap], likelihood: Union[float, Beta, AnyFloatMap, AnyBetaMap]): """Create a new Bayes Rule object from: - the prior P(A) - the lik...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BinaryBayesRule: """Class for testing one or more binary hypotheses using Bayes Rule.""" def __init__(self, prior: Union[float, Beta, AnyFloatMap, AnyBetaMap], likelihood: Union[float, Beta, AnyFloatMap, AnyBetaMap]): """Create a new Bayes Rule object from: - the prior P(A) - the likelihood P(B|A...
the_stack_v2_python_sparse
probability/calculations/bayes_rule/binary_bayes_rule.py
vahndi/probability
train
3
77a05df04ddd22f5c609b32ceda10e6d7b02046a
[ "user = User.objects.create(username='testuser', password='qwerty12345Q!')\nrecruiter = User.objects.create(username='recruiter3', first_name='first_recruiter', last_name='last_recruiter', email='recruiter@mail.com')\ncandidate = User.objects.create(username='candidate3', first_name='first_candidate', last_name='la...
<|body_start_0|> user = User.objects.create(username='testuser', password='qwerty12345Q!') recruiter = User.objects.create(username='recruiter3', first_name='first_recruiter', last_name='last_recruiter', email='recruiter@mail.com') candidate = User.objects.create(username='candidate3', first_nam...
Test GET request Answers app
AnswersGetTestCases
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AnswersGetTestCases: """Test GET request Answers app""" def setUp(self): """Create new data in in linked tables""" <|body_0|> def test_get_valid_answers(self): """Test for GET Answers with id""" <|body_1|> def test_get_invalid_answers(self): ...
stack_v2_sparse_classes_36k_train_008129
13,494
no_license
[ { "docstring": "Create new data in in linked tables", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "Test for GET Answers with id", "name": "test_get_valid_answers", "signature": "def test_get_valid_answers(self)" }, { "docstring": "Test for GET not existing A...
3
null
Implement the Python class `AnswersGetTestCases` described below. Class description: Test GET request Answers app Method signatures and docstrings: - def setUp(self): Create new data in in linked tables - def test_get_valid_answers(self): Test for GET Answers with id - def test_get_invalid_answers(self): Test for GET...
Implement the Python class `AnswersGetTestCases` described below. Class description: Test GET request Answers app Method signatures and docstrings: - def setUp(self): Create new data in in linked tables - def test_get_valid_answers(self): Test for GET Answers with id - def test_get_invalid_answers(self): Test for GET...
f448ec0453818d55c5c9d30aaa4f19e1d7ca5867
<|skeleton|> class AnswersGetTestCases: """Test GET request Answers app""" def setUp(self): """Create new data in in linked tables""" <|body_0|> def test_get_valid_answers(self): """Test for GET Answers with id""" <|body_1|> def test_get_invalid_answers(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AnswersGetTestCases: """Test GET request Answers app""" def setUp(self): """Create new data in in linked tables""" user = User.objects.create(username='testuser', password='qwerty12345Q!') recruiter = User.objects.create(username='recruiter3', first_name='first_recruiter', last_na...
the_stack_v2_python_sparse
Portfolio/tech-interview/techinterview/feedback/test_feedback.py
HeCToR74/Python
train
1
35e1bf97c8255fa3a0ea614123a4797cc33a2da6
[ "self.products_dict_list = []\nself.clean_brands = []\nself.clean_categories = []\nself.clean_stores = []\nself.brand_of_products = []\nself.cats_of_products = []\nself.stores_of_products = []", "complete_data = []\noff_api = OpenFoodApi()\nall_data = off_api.get_full_api_products()\ncomplete_data = [product for ...
<|body_start_0|> self.products_dict_list = [] self.clean_brands = [] self.clean_categories = [] self.clean_stores = [] self.brand_of_products = [] self.cats_of_products = [] self.stores_of_products = [] <|end_body_0|> <|body_start_1|> complete_data = [] ...
DataCleaner class To manage data cleaning from the Open Food Facts API
DataCleaner
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DataCleaner: """DataCleaner class To manage data cleaning from the Open Food Facts API""" def __init__(self): """Constructor""" <|body_0|> def create_products_dict_list(self): """Products are retrieved via the Open Food Facts API, but only those with all the requ...
stack_v2_sparse_classes_36k_train_008130
4,015
no_license
[ { "docstring": "Constructor", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Products are retrieved via the Open Food Facts API, but only those with all the required fields. :return: A list of dictionaries is obtained, one dictionary per product. :rtype: list()", "n...
5
stack_v2_sparse_classes_30k_train_013905
Implement the Python class `DataCleaner` described below. Class description: DataCleaner class To manage data cleaning from the Open Food Facts API Method signatures and docstrings: - def __init__(self): Constructor - def create_products_dict_list(self): Products are retrieved via the Open Food Facts API, but only th...
Implement the Python class `DataCleaner` described below. Class description: DataCleaner class To manage data cleaning from the Open Food Facts API Method signatures and docstrings: - def __init__(self): Constructor - def create_products_dict_list(self): Products are retrieved via the Open Food Facts API, but only th...
377deb35afe3749c8db8d09a55d4b69f8a8238a0
<|skeleton|> class DataCleaner: """DataCleaner class To manage data cleaning from the Open Food Facts API""" def __init__(self): """Constructor""" <|body_0|> def create_products_dict_list(self): """Products are retrieved via the Open Food Facts API, but only those with all the requ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DataCleaner: """DataCleaner class To manage data cleaning from the Open Food Facts API""" def __init__(self): """Constructor""" self.products_dict_list = [] self.clean_brands = [] self.clean_categories = [] self.clean_stores = [] self.brand_of_products = []...
the_stack_v2_python_sparse
src/data/api/data_cleaner.py
Githb-usr/substitution
train
0
f273cd69b5a75728a05c0bbf6687568db9542dd3
[ "self.to_run = cmd_list[:]\nself.running = {}\nself.N = N\nself.cwd = cwd\nself.env = env", "if self.N == 0:\n return True\nif len(self.running) < self.N:\n return True\nreturn False", "while len(self.to_run) > 0 and self.under_process_limit():\n LOGGER.info('%d left to run', len(self.to_run))\n cmd...
<|body_start_0|> self.to_run = cmd_list[:] self.running = {} self.N = N self.cwd = cwd self.env = env <|end_body_0|> <|body_start_1|> if self.N == 0: return True if len(self.running) < self.N: return True return False <|end_body_1|...
Queue up N commands from cmd_list, launching more jobs as the first finish.
QueueCommands
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QueueCommands: """Queue up N commands from cmd_list, launching more jobs as the first finish.""" def __init__(self, cmd_list, N=0, cwd=None, env=None): """cmd_list is a list of elements suitable for subprocess N is the number of simultanious processes to run. 0 is all of them. WARNIN...
stack_v2_sparse_classes_36k_train_008131
3,232
permissive
[ { "docstring": "cmd_list is a list of elements suitable for subprocess N is the number of simultanious processes to run. 0 is all of them. WARNING: this will not work on windows (It depends on being able to pass local file descriptors to the select call with isn't supported by the Win32 API)", "name": "__in...
4
stack_v2_sparse_classes_30k_train_010179
Implement the Python class `QueueCommands` described below. Class description: Queue up N commands from cmd_list, launching more jobs as the first finish. Method signatures and docstrings: - def __init__(self, cmd_list, N=0, cwd=None, env=None): cmd_list is a list of elements suitable for subprocess N is the number o...
Implement the Python class `QueueCommands` described below. Class description: Queue up N commands from cmd_list, launching more jobs as the first finish. Method signatures and docstrings: - def __init__(self, cmd_list, N=0, cwd=None, env=None): cmd_list is a list of elements suitable for subprocess N is the number o...
e1a246dcee157b7294030683f2d50ca0405f7095
<|skeleton|> class QueueCommands: """Queue up N commands from cmd_list, launching more jobs as the first finish.""" def __init__(self, cmd_list, N=0, cwd=None, env=None): """cmd_list is a list of elements suitable for subprocess N is the number of simultanious processes to run. 0 is all of them. WARNIN...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class QueueCommands: """Queue up N commands from cmd_list, launching more jobs as the first finish.""" def __init__(self, cmd_list, N=0, cwd=None, env=None): """cmd_list is a list of elements suitable for subprocess N is the number of simultanious processes to run. 0 is all of them. WARNING: this will ...
the_stack_v2_python_sparse
htsworkflow/util/queuecommands.py
detrout/htsworkflow
train
0
42914637a58c9b2509dc8d1e541b0a1aee3af026
[ "self.devaddr = devaddr\nself.adr = adr\nself.adrackreq = adrackreq\nself.ack = ack\nself.fpending = fpending\nself.foptslen = foptslen\nself.fcnt = fcnt\nself.fopts = fopts\nself.fdir = fdir\nself.length = self.foptslen + 7", "if len(data) < 7:\n raise DecodeError()\ndevaddr, fctrl, fcnt = struct.unpack('<LBH...
<|body_start_0|> self.devaddr = devaddr self.adr = adr self.adrackreq = adrackreq self.ack = ack self.fpending = fpending self.foptslen = foptslen self.fcnt = fcnt self.fopts = fopts self.fdir = fdir self.length = self.foptslen + 7 <|end_bo...
MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: devaddr (str): Device address. adr (int): ADR bit adrackreq (int): ADR acknowled...
FrameHeader
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FrameHeader: """MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: devaddr (str): Device address. adr (int):...
stack_v2_sparse_classes_36k_train_008132
26,915
permissive
[ { "docstring": "FrameHeader initialisation method.", "name": "__init__", "signature": "def __init__(self, devaddr, adr, adrackreq, ack, foptslen, fcnt, fopts, fpending=0, fdir='up')" }, { "docstring": "Create a FrameHeader object from binary representation. Args: data (str): MACPayload packet da...
3
stack_v2_sparse_classes_30k_train_009795
Implement the Python class `FrameHeader` described below. Class description: MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: de...
Implement the Python class `FrameHeader` described below. Class description: MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: de...
add5a1129296dca6db55b7980c0c1091f1ca80aa
<|skeleton|> class FrameHeader: """MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: devaddr (str): Device address. adr (int):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FrameHeader: """MAC Payload Frame Header. The frame header contains the short device address of the end device (devaddr), and frame control octet (fctrl), 2 octet frame counter (fcnt) and up to 15 octets used to transport MAC commands (fopts). Attributes: devaddr (str): Device address. adr (int): ADR bit adra...
the_stack_v2_python_sparse
floranet/lora/mac.py
chengzhongkai/floranet
train
0
50141ceda076ddd6e34610d2d1c1d979d7a199e1
[ "data_train = tfds.load('ted_hrlr_translate/pt_to_en', split='train', as_supervised=True)\ndata_valid = tfds.load('ted_hrlr_translate/pt_to_en', split='validation', as_supervised=True)\nself.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(data_train)\nself.data_train = data_train.map(self.tf_encode)\nself.d...
<|body_start_0|> data_train = tfds.load('ted_hrlr_translate/pt_to_en', split='train', as_supervised=True) data_valid = tfds.load('ted_hrlr_translate/pt_to_en', split='validation', as_supervised=True) self.tokenizer_pt, self.tokenizer_en = self.tokenize_dataset(data_train) self.data_train...
Class
Dataset
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Dataset: """Class""" def __init__(self): """Initialize""" <|body_0|> def tokenize_dataset(self, data): """Method""" <|body_1|> def encode(self, pt, en): """Method""" <|body_2|> def tf_encode(self, pt, en): """Method""" ...
stack_v2_sparse_classes_36k_train_008133
2,694
no_license
[ { "docstring": "Initialize", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Method", "name": "tokenize_dataset", "signature": "def tokenize_dataset(self, data)" }, { "docstring": "Method", "name": "encode", "signature": "def encode(self, pt, en)"...
4
stack_v2_sparse_classes_30k_train_004780
Implement the Python class `Dataset` described below. Class description: Class Method signatures and docstrings: - def __init__(self): Initialize - def tokenize_dataset(self, data): Method - def encode(self, pt, en): Method - def tf_encode(self, pt, en): Method
Implement the Python class `Dataset` described below. Class description: Class Method signatures and docstrings: - def __init__(self): Initialize - def tokenize_dataset(self, data): Method - def encode(self, pt, en): Method - def tf_encode(self, pt, en): Method <|skeleton|> class Dataset: """Class""" def __...
b5e8f1253309567ca7be71b9575a150de1be3820
<|skeleton|> class Dataset: """Class""" def __init__(self): """Initialize""" <|body_0|> def tokenize_dataset(self, data): """Method""" <|body_1|> def encode(self, pt, en): """Method""" <|body_2|> def tf_encode(self, pt, en): """Method""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Dataset: """Class""" def __init__(self): """Initialize""" data_train = tfds.load('ted_hrlr_translate/pt_to_en', split='train', as_supervised=True) data_valid = tfds.load('ted_hrlr_translate/pt_to_en', split='validation', as_supervised=True) self.tokenizer_pt, self.tokenize...
the_stack_v2_python_sparse
supervised_learning/0x12-transformer_apps/3-dataset.py
jadsm98/holbertonschool-machine_learning
train
0
679483262ef9e854746428f03c0310c0aae11700
[ "if update_info.get('data_truncate', {}).get('enable', False):\n instalog_config['buffer']['args']['truncate_interval'] = 86400\nthreshold = update_info.get('input_http', {}).get('log_level_threshold', logging.NOTSET)\ninstalog_config['input']['http_in']['args']['log_level_threshold'] = threshold\nif update_info...
<|body_start_0|> if update_info.get('data_truncate', {}).get('enable', False): instalog_config['buffer']['args']['truncate_interval'] = 86400 threshold = update_info.get('input_http', {}).get('log_level_threshold', logging.NOTSET) instalog_config['input']['http_in']['args']['log_leve...
Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs)
InstalogService
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InstalogService: """Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs)""" def UpdateConfig(self, instalog_config, update_info, env): """Updates Instalog plugin config based on Umpire config. Arg...
stack_v2_sparse_classes_36k_train_008134
6,051
permissive
[ { "docstring": "Updates Instalog plugin config based on Umpire config. Args: instalog_config: Original Instalog configuration. update_info: The Umpire configuration used to update instalog_config. env: UmpireEnv object.", "name": "UpdateConfig", "signature": "def UpdateConfig(self, instalog_config, upda...
3
stack_v2_sparse_classes_30k_train_018930
Implement the Python class `InstalogService` described below. Class description: Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs) Method signatures and docstrings: - def UpdateConfig(self, instalog_config, update_info, env): U...
Implement the Python class `InstalogService` described below. Class description: Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs) Method signatures and docstrings: - def UpdateConfig(self, instalog_config, update_info, env): U...
a1b0fccd68987d8cd9c89710adc3c04b868347ec
<|skeleton|> class InstalogService: """Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs)""" def UpdateConfig(self, instalog_config, update_info, env): """Updates Instalog plugin config based on Umpire config. Arg...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class InstalogService: """Instalog service. Example: svc = GetServiceInstance('instalog') procs = svc.CreateProcesses(umpire_config_dict, umpire_env) svc.Start(procs)""" def UpdateConfig(self, instalog_config, update_info, env): """Updates Instalog plugin config based on Umpire config. Args: instalog_c...
the_stack_v2_python_sparse
py/umpire/server/service/instalog.py
bridder/factory
train
0
70c84f975ee6d31b632aa6e6ab35d66871b98887
[ "self.host = flags.host\nself.port = int(flags.port)\nself.user = flags.user\nwith open(os.path.expanduser(flags.password_file)) as f:\n self.password = f.readline().rstrip()\nself.connection = None", "assert self.connection is None\nself.connection = imaplib.IMAP4_SSL(self.host, self.port)\nLOGGER.info('Opene...
<|body_start_0|> self.host = flags.host self.port = int(flags.port) self.user = flags.user with open(os.path.expanduser(flags.password_file)) as f: self.password = f.readline().rstrip() self.connection = None <|end_body_0|> <|body_start_1|> assert self.connec...
Encapsulates access to an IMAP account.
Account
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Account: """Encapsulates access to an IMAP account.""" def __init__(self): """Constructs a new account from the command line flags.""" <|body_0|> def open(self): """Opens an IMAP connection to this account.""" <|body_1|> def list(self): """Re...
stack_v2_sparse_classes_36k_train_008135
9,251
permissive
[ { "docstring": "Constructs a new account from the command line flags.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Opens an IMAP connection to this account.", "name": "open", "signature": "def open(self)" }, { "docstring": "Returns a list of (datetim...
4
stack_v2_sparse_classes_30k_train_018063
Implement the Python class `Account` described below. Class description: Encapsulates access to an IMAP account. Method signatures and docstrings: - def __init__(self): Constructs a new account from the command line flags. - def open(self): Opens an IMAP connection to this account. - def list(self): Returns a list of...
Implement the Python class `Account` described below. Class description: Encapsulates access to an IMAP account. Method signatures and docstrings: - def __init__(self): Constructs a new account from the command line flags. - def open(self): Opens an IMAP connection to this account. - def list(self): Returns a list of...
cec8fae0c1872bbd91b244775bee18d5db831581
<|skeleton|> class Account: """Encapsulates access to an IMAP account.""" def __init__(self): """Constructs a new account from the command line flags.""" <|body_0|> def open(self): """Opens an IMAP connection to this account.""" <|body_1|> def list(self): """Re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Account: """Encapsulates access to an IMAP account.""" def __init__(self): """Constructs a new account from the command line flags.""" self.host = flags.host self.port = int(flags.port) self.user = flags.user with open(os.path.expanduser(flags.password_file)) as f:...
the_stack_v2_python_sparse
camera_event_trending.py
jodysankey/scripts
train
0
58de6955ee9c4d906e62ea1f588f5c63e79e8355
[ "super(TwoLayerNet, self).__init__()\nself.linear1 = torch.nn.Linear(D_in, H)\nself.linear2 = torch.nn.Linear(H, D_out)", "h_relu = self.linear1(x).clamp(min=0)\ny_pred = self.linear2(h_relu).clamp(min=0)\nreturn y_pred" ]
<|body_start_0|> super(TwoLayerNet, self).__init__() self.linear1 = torch.nn.Linear(D_in, H) self.linear2 = torch.nn.Linear(H, D_out) <|end_body_0|> <|body_start_1|> h_relu = self.linear1(x).clamp(min=0) y_pred = self.linear2(h_relu).clamp(min=0) return y_pred <|end_body...
TwoLayerNet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TwoLayerNet: def __init__(self, D_in, H, D_out): """In the constructor we instantiate two nn.Linear modules and assign them as member variables.""" <|body_0|> def forward(self, x): """In the forward function we accept a Tensor of input data and we must return a Tenso...
stack_v2_sparse_classes_36k_train_008136
1,096
no_license
[ { "docstring": "In the constructor we instantiate two nn.Linear modules and assign them as member variables.", "name": "__init__", "signature": "def __init__(self, D_in, H, D_out)" }, { "docstring": "In the forward function we accept a Tensor of input data and we must return a Tensor of output d...
2
stack_v2_sparse_classes_30k_train_008089
Implement the Python class `TwoLayerNet` described below. Class description: Implement the TwoLayerNet class. Method signatures and docstrings: - def __init__(self, D_in, H, D_out): In the constructor we instantiate two nn.Linear modules and assign them as member variables. - def forward(self, x): In the forward func...
Implement the Python class `TwoLayerNet` described below. Class description: Implement the TwoLayerNet class. Method signatures and docstrings: - def __init__(self, D_in, H, D_out): In the constructor we instantiate two nn.Linear modules and assign them as member variables. - def forward(self, x): In the forward func...
e1b46706c09c1989513794fb9a456ebbdbae4986
<|skeleton|> class TwoLayerNet: def __init__(self, D_in, H, D_out): """In the constructor we instantiate two nn.Linear modules and assign them as member variables.""" <|body_0|> def forward(self, x): """In the forward function we accept a Tensor of input data and we must return a Tenso...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TwoLayerNet: def __init__(self, D_in, H, D_out): """In the constructor we instantiate two nn.Linear modules and assign them as member variables.""" super(TwoLayerNet, self).__init__() self.linear1 = torch.nn.Linear(D_in, H) self.linear2 = torch.nn.Linear(H, D_out) def forw...
the_stack_v2_python_sparse
twolayernetog.py
weekend37/BG_Competition
train
2
f9ffc34d740b921314a535f472ff29896e221639
[ "WebHttpThread.json_app_resp()\nif not name == '':\n name = 'world'\nreturn WebHttpThread.render_json({'message': 'Hello, %s!' % name})", "json_app_resp()\nparams = WebHttpThread.get_post_json_params()\nif not name == '':\n name = 'world'\nreturn WebHttpThread.render_json({'message': 'Hello, %s!' % name})" ...
<|body_start_0|> WebHttpThread.json_app_resp() if not name == '': name = 'world' return WebHttpThread.render_json({'message': 'Hello, %s!' % name}) <|end_body_0|> <|body_start_1|> json_app_resp() params = WebHttpThread.get_post_json_params() if not name == ''...
This controller is used for the human interaction
HomeController
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HomeController: """This controller is used for the human interaction""" def GET(self, name=''): """The get method is called for software control""" <|body_0|> def POST(self, name=''): """This post method is use for the business communication""" <|body_1|>...
stack_v2_sparse_classes_36k_train_008137
5,645
permissive
[ { "docstring": "The get method is called for software control", "name": "GET", "signature": "def GET(self, name='')" }, { "docstring": "This post method is use for the business communication", "name": "POST", "signature": "def POST(self, name='')" } ]
2
stack_v2_sparse_classes_30k_train_013781
Implement the Python class `HomeController` described below. Class description: This controller is used for the human interaction Method signatures and docstrings: - def GET(self, name=''): The get method is called for software control - def POST(self, name=''): This post method is use for the business communication
Implement the Python class `HomeController` described below. Class description: This controller is used for the human interaction Method signatures and docstrings: - def GET(self, name=''): The get method is called for software control - def POST(self, name=''): This post method is use for the business communication ...
dc6a3d8ee8b9dc67753d5b713bfa5f81f0a20f6a
<|skeleton|> class HomeController: """This controller is used for the human interaction""" def GET(self, name=''): """The get method is called for software control""" <|body_0|> def POST(self, name=''): """This post method is use for the business communication""" <|body_1|>...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HomeController: """This controller is used for the human interaction""" def GET(self, name=''): """The get method is called for software control""" WebHttpThread.json_app_resp() if not name == '': name = 'world' return WebHttpThread.render_json({'message': 'Hel...
the_stack_v2_python_sparse
src/TrainManagementWebServer.py
pierrecontri/TrainManagement
train
0
cf2f4e1a5a4aa6ebc40e411493c7c6abd6f4a544
[ "self.particleNum = particleNum\nif masses == 'random':\n masses = np.random.random(size=particleNum) + 1e-05\nelif not isinstance(masses, list) and (not isinstance(masses, np.ndarray)):\n raise Exception('Not a valid input for the masses, if not \"random\" the input has to be a list of masses!')\nelif len(ma...
<|body_start_0|> self.particleNum = particleNum if masses == 'random': masses = np.random.random(size=particleNum) + 1e-05 elif not isinstance(masses, list) and (not isinstance(masses, np.ndarray)): raise Exception('Not a valid input for the masses, if not "random" the in...
Class which simulates a system of particles.
Sistem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Sistem: """Class which simulates a system of particles.""" def __init__(self, particleNum, masses='random', initPositions='random', initVelocities='random'): """Sistem class which contains all the particles in the ring and their interactions. Args: particleNum (integer): Number of pa...
stack_v2_sparse_classes_36k_train_008138
20,528
no_license
[ { "docstring": "Sistem class which contains all the particles in the ring and their interactions. Args: particleNum (integer): Number of particles on the ring. masses (list, optional): List of masses for the particles. Must be in given in increasing positions of the particles. Defaults to 'random'. initPosition...
3
stack_v2_sparse_classes_30k_train_005688
Implement the Python class `Sistem` described below. Class description: Class which simulates a system of particles. Method signatures and docstrings: - def __init__(self, particleNum, masses='random', initPositions='random', initVelocities='random'): Sistem class which contains all the particles in the ring and thei...
Implement the Python class `Sistem` described below. Class description: Class which simulates a system of particles. Method signatures and docstrings: - def __init__(self, particleNum, masses='random', initPositions='random', initVelocities='random'): Sistem class which contains all the particles in the ring and thei...
fae485d2575c864f414719c6591bc78bb1f24166
<|skeleton|> class Sistem: """Class which simulates a system of particles.""" def __init__(self, particleNum, masses='random', initPositions='random', initVelocities='random'): """Sistem class which contains all the particles in the ring and their interactions. Args: particleNum (integer): Number of pa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Sistem: """Class which simulates a system of particles.""" def __init__(self, particleNum, masses='random', initPositions='random', initVelocities='random'): """Sistem class which contains all the particles in the ring and their interactions. Args: particleNum (integer): Number of particles on th...
the_stack_v2_python_sparse
simulation.py
MatejVe/SHP
train
0
472a9b6b2c10807344ffe7ae929c902f64dd03eb
[ "self.model = model\nself.padding = padding\nself.key_length = key_length\nself.key = key\nself.iv = iv", "if self.model in (MODE_ECB, MODE_CTR, MODE_CCM, MODE_EAX, MODE_SIV, MODE_GCM, MODE_OCB):\n cipher = algorithm.new(key=self.key, mode=self.model)\nelse:\n cipher = algorithm.new(key=self.key, mode=self....
<|body_start_0|> self.model = model self.padding = padding self.key_length = key_length self.key = key self.iv = iv <|end_body_0|> <|body_start_1|> if self.model in (MODE_ECB, MODE_CTR, MODE_CCM, MODE_EAX, MODE_SIV, MODE_GCM, MODE_OCB): cipher = algorithm.new...
Cipher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Cipher: def __init__(self, model, padding, key_length, key, iv): """Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type :param iv: bytes type""" <|body_0|> def get_cipher_object(self, algorithm): ...
stack_v2_sparse_classes_36k_train_008139
3,312
no_license
[ { "docstring": "Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type :param iv: bytes type", "name": "__init__", "signature": "def __init__(self, model, padding, key_length, key, iv)" }, { "docstring": "Get cipher object :p...
4
stack_v2_sparse_classes_30k_train_012073
Implement the Python class `Cipher` described below. Class description: Implement the Cipher class. Method signatures and docstrings: - def __init__(self, model, padding, key_length, key, iv): Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type...
Implement the Python class `Cipher` described below. Class description: Implement the Cipher class. Method signatures and docstrings: - def __init__(self, model, padding, key_length, key, iv): Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type...
41f343dc856958060c7b58fbbf1021757f75d818
<|skeleton|> class Cipher: def __init__(self, model, padding, key_length, key, iv): """Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type :param iv: bytes type""" <|body_0|> def get_cipher_object(self, algorithm): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Cipher: def __init__(self, model, padding, key_length, key, iv): """Encryption Class :param model: int type :param padding: str type :param key_length: int type, 16,24,32 :param key: bytes type :param iv: bytes type""" self.model = model self.padding = padding self.key_length =...
the_stack_v2_python_sparse
util/crypt.py
ChearH/ReverseWidget
train
0
1b76d9393c7aac46d57b770dd5b641808081c0dd
[ "pickle_file = PICKLE_FOLDER + os.path.sep + user + PICKLE_EXTENSION\nprint('Using ' + pickle_file + ' as the data')\nf = open(pickle_file, 'rb').read()\ndata = pickle.loads(f)\nreturn data", "input_path = INPUT_FOLDER + os.path.sep + user + JPG_EXTENSION\nprint('Using ' + input_path + ' as input')\nimage = cv2.i...
<|body_start_0|> pickle_file = PICKLE_FOLDER + os.path.sep + user + PICKLE_EXTENSION print('Using ' + pickle_file + ' as the data') f = open(pickle_file, 'rb').read() data = pickle.loads(f) return data <|end_body_0|> <|body_start_1|> input_path = INPUT_FOLDER + os.path.s...
A class to recognize a user's face with the corresponding encoding.
RecognizeUserFace
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RecognizeUserFace: """A class to recognize a user's face with the corresponding encoding.""" def read_pickle(self, user): """Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string :return: data :rtype: list""" <|body_0|> def...
stack_v2_sparse_classes_36k_train_008140
3,189
no_license
[ { "docstring": "Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string :return: data :rtype: list", "name": "read_pickle", "signature": "def read_pickle(self, user)" }, { "docstring": "Turns the input image to encoding :param user: user that's being...
4
stack_v2_sparse_classes_30k_val_000770
Implement the Python class `RecognizeUserFace` described below. Class description: A class to recognize a user's face with the corresponding encoding. Method signatures and docstrings: - def read_pickle(self, user): Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string ...
Implement the Python class `RecognizeUserFace` described below. Class description: A class to recognize a user's face with the corresponding encoding. Method signatures and docstrings: - def read_pickle(self, user): Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string ...
d5de98b225afb6ce07dae25e4734105432533830
<|skeleton|> class RecognizeUserFace: """A class to recognize a user's face with the corresponding encoding.""" def read_pickle(self, user): """Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string :return: data :rtype: list""" <|body_0|> def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RecognizeUserFace: """A class to recognize a user's face with the corresponding encoding.""" def read_pickle(self, user): """Reads pickle file and returns the contents. :param user: user that's being encoded :type user: string :return: data :rtype: list""" pickle_file = PICKLE_FOLDER + os...
the_stack_v2_python_sparse
utility/facialrecognition/recognizeuserface.py
PIoT-CSS/agent-pi
train
0
2d2c89df27b33d9d85291737d6a232609f4cda4b
[ "if type(arg_index) is int:\n return {cls.CATEGORY: category, cls.ARG_INDEX: [arg_index]}\nif type(arg_index) is list and all((isinstance(i, int) for i in arg_index)):\n return {cls.CATEGORY: category, cls.ARG_INDEX: arg_index}\nreturn {cls.CATEGORY: category}", "self.name = propertiesDict.pop('name', None)...
<|body_start_0|> if type(arg_index) is int: return {cls.CATEGORY: category, cls.ARG_INDEX: [arg_index]} if type(arg_index) is list and all((isinstance(i, int) for i in arg_index)): return {cls.CATEGORY: category, cls.ARG_INDEX: arg_index} return {cls.CATEGORY: category} <...
Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by specifying classname in the formatter node of the project configuration file.
BaseLogFormatter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseLogFormatter: """Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by specifying classname in the formatter ...
stack_v2_sparse_classes_36k_train_008141
8,804
no_license
[ { "docstring": "Return dictionary to tag a string to format with color encodings. @param category: The category, as defined in L{ColorLogFormatter.COLOR_CATEGORIES} @param arg_index: The index of argument in the string expansion to color. This can be either a single integer value representing the index, or a li...
2
stack_v2_sparse_classes_30k_val_000606
Implement the Python class `BaseLogFormatter` described below. Class description: Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by...
Implement the Python class `BaseLogFormatter` described below. Class description: Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by...
3f93cbedbb806b6c53de89358025f93c740ebdc3
<|skeleton|> class BaseLogFormatter: """Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by specifying classname in the formatter ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseLogFormatter: """Base class for formatting log messages. This implementation delegates everything to logging.Formatter using the messagefmt and datefmt properties. Subclasses may be implemented to provide required customizations, and can be registered by specifying classname in the formatter node of the p...
the_stack_v2_python_sparse
pysys/utils/logutils.py
moraygrieve/pysys
train
0
b857f4095cf36042baa38810ad2a0995c717e324
[ "warnings.warn('SequentialWeaveGraph is deprecated. Will be removed in DeepChem 1.4.', DeprecationWarning)\nself.graph = tf.Graph()\nself.max_atoms = max_atoms\nself.n_atom_feat = n_atom_feat\nself.n_pair_feat = n_pair_feat\nwith self.graph.as_default():\n self.graph_topology = WeaveGraphTopology(self.max_atoms,...
<|body_start_0|> warnings.warn('SequentialWeaveGraph is deprecated. Will be removed in DeepChem 1.4.', DeprecationWarning) self.graph = tf.Graph() self.max_atoms = max_atoms self.n_atom_feat = n_atom_feat self.n_pair_feat = n_pair_feat with self.graph.as_default(): ...
SequentialGraph for Weave models
SequentialWeaveGraph
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SequentialWeaveGraph: """SequentialGraph for Weave models""" def __init__(self, max_atoms=50, n_atom_feat=75, n_pair_feat=14): """Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be defined based on dataset n_atom_feat: int, optional Number...
stack_v2_sparse_classes_36k_train_008142
11,824
permissive
[ { "docstring": "Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be defined based on dataset n_atom_feat: int, optional Number of features per atom. n_pair_feat: int, optional Number of features per pair of atoms.", "name": "__init__", "signature": "def __init...
2
stack_v2_sparse_classes_30k_train_018583
Implement the Python class `SequentialWeaveGraph` described below. Class description: SequentialGraph for Weave models Method signatures and docstrings: - def __init__(self, max_atoms=50, n_atom_feat=75, n_pair_feat=14): Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be d...
Implement the Python class `SequentialWeaveGraph` described below. Class description: SequentialGraph for Weave models Method signatures and docstrings: - def __init__(self, max_atoms=50, n_atom_feat=75, n_pair_feat=14): Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be d...
ee6e67ebcf7bf04259cf13aff6388e2b791fea3d
<|skeleton|> class SequentialWeaveGraph: """SequentialGraph for Weave models""" def __init__(self, max_atoms=50, n_atom_feat=75, n_pair_feat=14): """Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be defined based on dataset n_atom_feat: int, optional Number...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SequentialWeaveGraph: """SequentialGraph for Weave models""" def __init__(self, max_atoms=50, n_atom_feat=75, n_pair_feat=14): """Parameters ---------- max_atoms: int, optional Maximum number of atoms in a molecule, should be defined based on dataset n_atom_feat: int, optional Number of features ...
the_stack_v2_python_sparse
contrib/one_shot_models/graph_models.py
deepchem/deepchem
train
4,876
3ed4db8211e8c1267456438f74e8bb45d918f195
[ "self.path = None\nself.end = end\nself.start = start\nself.openList = AStarList(Node(start, None, AStarObj.getDistHeur(start, end), 0))\nself.closedList = Table(len(boolMap), len(boolMap[0]))\nself.loops = 0\npath = None\nself.pathExists = self.iterate(boolMap, diagOkay)", "hasPath = False\nwhile hasPath == Fals...
<|body_start_0|> self.path = None self.end = end self.start = start self.openList = AStarList(Node(start, None, AStarObj.getDistHeur(start, end), 0)) self.closedList = Table(len(boolMap), len(boolMap[0])) self.loops = 0 path = None self.pathExists = self.i...
The main class for an A* pathing function.
AStarObj
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AStarObj: """The main class for an A* pathing function.""" def __init__(self, boolMap, start, end, diagOkay=False): """Initializer. Also generates the path, if one exists.""" <|body_0|> def iterate(self, boolMap, diagOkay): """Main work method. Follows the proced...
stack_v2_sparse_classes_36k_train_008143
5,940
no_license
[ { "docstring": "Initializer. Also generates the path, if one exists.", "name": "__init__", "signature": "def __init__(self, boolMap, start, end, diagOkay=False)" }, { "docstring": "Main work method. Follows the procedure outlined at top of this file.", "name": "iterate", "signature": "de...
6
stack_v2_sparse_classes_30k_train_001751
Implement the Python class `AStarObj` described below. Class description: The main class for an A* pathing function. Method signatures and docstrings: - def __init__(self, boolMap, start, end, diagOkay=False): Initializer. Also generates the path, if one exists. - def iterate(self, boolMap, diagOkay): Main work metho...
Implement the Python class `AStarObj` described below. Class description: The main class for an A* pathing function. Method signatures and docstrings: - def __init__(self, boolMap, start, end, diagOkay=False): Initializer. Also generates the path, if one exists. - def iterate(self, boolMap, diagOkay): Main work metho...
44fe3aab40959ae5829df74638037d9854eb3a91
<|skeleton|> class AStarObj: """The main class for an A* pathing function.""" def __init__(self, boolMap, start, end, diagOkay=False): """Initializer. Also generates the path, if one exists.""" <|body_0|> def iterate(self, boolMap, diagOkay): """Main work method. Follows the proced...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AStarObj: """The main class for an A* pathing function.""" def __init__(self, boolMap, start, end, diagOkay=False): """Initializer. Also generates the path, if one exists.""" self.path = None self.end = end self.start = start self.openList = AStarList(Node(start, N...
the_stack_v2_python_sparse
Side Projects/AStar/a_star_obj.py
MWidlerSchool/mwidlerschool.github.io
train
0
9979c052ba7781e7a4ebe21106767b9ea2355fc0
[ "self.agent_index = agent_index\nif fn not in dir(search_strategies):\n raise AttributeError(fn + ' is not a search function in search_strategies.py.')\nfunc = getattr(search_strategies, fn)\nif 'heuristic' not in func.__code__.co_varnames:\n sys.stderr.write('[SearchAgent] using function {} \\n'.format(fn))\...
<|body_start_0|> self.agent_index = agent_index if fn not in dir(search_strategies): raise AttributeError(fn + ' is not a search function in search_strategies.py.') func = getattr(search_strategies, fn) if 'heuristic' not in func.__code__.co_varnames: sys.stderr.w...
This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then gets actions from this plan with the get_action method. As a default, this agen...
SearchAgent
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SearchAgent: """This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then gets actions from this plan with the get...
stack_v2_sparse_classes_36k_train_008144
10,217
permissive
[ { "docstring": "Set up the agent, look for the implementations of its search function, problem, and heuristic. Warning: some advanced Python magic is employed below to find the right functions and problems. (SearchAgent, str, str, str) -> None", "name": "__init__", "signature": "def __init__(self, agent...
3
stack_v2_sparse_classes_30k_train_021215
Implement the Python class `SearchAgent` described below. Class description: This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then g...
Implement the Python class `SearchAgent` described below. Class description: This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then g...
f562f4e4bf0093da13b3fb4675c97ea8e02b0ed1
<|skeleton|> class SearchAgent: """This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then gets actions from this plan with the get...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SearchAgent: """This general search agent finds a path using a supplied search algorithm for a supplied search problem, then returns actions to follow that path. This planning is done when the system calls the register_initial_state method. The system then gets actions from this plan with the get_action metho...
the_stack_v2_python_sparse
assignment-1/agents.py
ybhan/ANU-Artificial-Intelligence
train
0
01a883a37cc5faa3c886a0edfef78b578aeb14a3
[ "self._check_params()\nself._warn_for_unused_params()\nif any((isinstance(el, list) for el in raw_documents)):\n self._tfidf.n_sent_per_doc = []\n for i in range(len(raw_documents)):\n self._tfidf.n_sent_per_doc.append(len(raw_documents[i]))\n self._tfidf.n_doc = len(raw_documents)\n raw_document...
<|body_start_0|> self._check_params() self._warn_for_unused_params() if any((isinstance(el, list) for el in raw_documents)): self._tfidf.n_sent_per_doc = [] for i in range(len(raw_documents)): self._tfidf.n_sent_per_doc.append(len(raw_documents[i])) ...
NewTfidfVectorizer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NewTfidfVectorizer: def fit(self, raw_documents, y=None): """Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields either str, unicode or file objects. y : None This parameter is not needed to compute tfidf. Returns ------- se...
stack_v2_sparse_classes_36k_train_008145
6,911
permissive
[ { "docstring": "Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields either str, unicode or file objects. y : None This parameter is not needed to compute tfidf. Returns ------- self : object Fitted vectorizer.", "name": "fit", "signature": ...
3
null
Implement the Python class `NewTfidfVectorizer` described below. Class description: Implement the NewTfidfVectorizer class. Method signatures and docstrings: - def fit(self, raw_documents, y=None): Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields eith...
Implement the Python class `NewTfidfVectorizer` described below. Class description: Implement the NewTfidfVectorizer class. Method signatures and docstrings: - def fit(self, raw_documents, y=None): Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields eith...
ca748a227acd446cd9259056c6a9d6ae261aeaea
<|skeleton|> class NewTfidfVectorizer: def fit(self, raw_documents, y=None): """Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields either str, unicode or file objects. y : None This parameter is not needed to compute tfidf. Returns ------- se...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NewTfidfVectorizer: def fit(self, raw_documents, y=None): """Learn vocabulary and idf from training set. Parameters ---------- raw_documents : iterable An iterable which yields either str, unicode or file objects. y : None This parameter is not needed to compute tfidf. Returns ------- self : object Fi...
the_stack_v2_python_sparse
tfidf_test.py
filiparente/Predtweet
train
3
aa73ec0205c0773c6afec7ca4caf6ce923b1f557
[ "self.screen_width = 1200\nself.screen_height = 800\nself.bg_color = (230, 230, 230)\nself.bullet_width = 30\nself.bullet_height = 6\nself.bullet_color = (60, 60, 60)\nself.bullet_allowed = 1\nself.rectangle_width = 30\nself.rectangle_height = 300\nself.rectangle_color = (120, 120, 120)\nself.hits_limit = 3\nself.s...
<|body_start_0|> self.screen_width = 1200 self.screen_height = 800 self.bg_color = (230, 230, 230) self.bullet_width = 30 self.bullet_height = 6 self.bullet_color = (60, 60, 60) self.bullet_allowed = 1 self.rectangle_width = 30 self.rectangle_heigh...
存储《外星人入侵》的所有设置的类
Settings
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏设置""" <|body_0|> def initialize_dynamic_settings(self): """初始化随游戏进行而变化的设置""" <|body_1|> def increase_speed(self): """提高速度设置""" <|body_2|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_008146
1,447
no_license
[ { "docstring": "初始化游戏设置", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "初始化随游戏进行而变化的设置", "name": "initialize_dynamic_settings", "signature": "def initialize_dynamic_settings(self)" }, { "docstring": "提高速度设置", "name": "increase_speed", "signature...
3
null
Implement the Python class `Settings` described below. Class description: 存储《外星人入侵》的所有设置的类 Method signatures and docstrings: - def __init__(self): 初始化游戏设置 - def initialize_dynamic_settings(self): 初始化随游戏进行而变化的设置 - def increase_speed(self): 提高速度设置
Implement the Python class `Settings` described below. Class description: 存储《外星人入侵》的所有设置的类 Method signatures and docstrings: - def __init__(self): 初始化游戏设置 - def initialize_dynamic_settings(self): 初始化随游戏进行而变化的设置 - def increase_speed(self): 提高速度设置 <|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __init...
e08f63616aabe609ff1ac53b8e0ab32eaf2a472b
<|skeleton|> class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏设置""" <|body_0|> def initialize_dynamic_settings(self): """初始化随游戏进行而变化的设置""" <|body_1|> def increase_speed(self): """提高速度设置""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Settings: """存储《外星人入侵》的所有设置的类""" def __init__(self): """初始化游戏设置""" self.screen_width = 1200 self.screen_height = 800 self.bg_color = (230, 230, 230) self.bullet_width = 30 self.bullet_height = 6 self.bullet_color = (60, 60, 60) self.bullet_a...
the_stack_v2_python_sparse
section_ii/project_a/chapter_14/example_3/settings.py
xieqing0428/python_helloworld
train
0
a760e513eaede15f1d9940484f0b20f8219c4400
[ "parser.add_argument('experiment', help='experiment to conclude')\nmutex_group = parser.add_mutually_exclusive_group(required=True)\nmutex_group.add_argument('branch', help='branch to promote to default', nargs='?')\nmutex_group.add_argument('--no-promote-branch', help='do not promote a branch to default', action='...
<|body_start_0|> parser.add_argument('experiment', help='experiment to conclude') mutex_group = parser.add_mutually_exclusive_group(required=True) mutex_group.add_argument('branch', help='branch to promote to default', nargs='?') mutex_group.add_argument('--no-promote-branch', help='do n...
Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaults.
Conclude
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Conclude: """Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaults.""" def add_arguments(self, par...
stack_v2_sparse_classes_36k_train_008147
13,324
permissive
[ { "docstring": "Add argparse arguments.", "name": "add_arguments", "signature": "def add_arguments(self, parser)" }, { "docstring": "Run command.", "name": "handle", "signature": "def handle(self, config, options)" } ]
2
stack_v2_sparse_classes_30k_train_018139
Implement the Python class `Conclude` described below. Class description: Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaul...
Implement the Python class `Conclude` described below. Class description: Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaul...
a06b781a81139ed578bcbef3fb521b8f712ab77d
<|skeleton|> class Conclude: """Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaults.""" def add_arguments(self, par...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Conclude: """Conclude a given experiment. This is one of the main user commands. It demotes an experiment to no longer being live, records a conclusion date, and (optionally but strongly advised) promotes the settings from one of its branches into the defaults.""" def add_arguments(self, parser): ...
the_stack_v2_python_sparse
jacquard/experiments/commands.py
prophile/jacquard
train
8
ed51b8dcd482ef63c2cd4d00d0c388d60bd18217
[ "super(ASRModel, self).__init__()\nself.input_size = input_size\nself.hidden_size = hidden_size\nself.num_layers = num_layers\nself.dropout = dropout\nself.conv1d_layer = nn.Conv1d(in_channels=input_size, out_channels=hidden_size, kernel_size=5, stride=2, padding=2)\nself.lstm_block = nn.LSTM(input_size=hidden_size...
<|body_start_0|> super(ASRModel, self).__init__() self.input_size = input_size self.hidden_size = hidden_size self.num_layers = num_layers self.dropout = dropout self.conv1d_layer = nn.Conv1d(in_channels=input_size, out_channels=hidden_size, kernel_size=5, stride=2, paddi...
ASRModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ASRModel: def __init__(self, input_size=80, hidden_size=256, output_size=29, num_layers=2, dropout=0.4): """Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the temporal dimension, followed by multiple bidirectional LSTM layers. Dropout is applied to the out...
stack_v2_sparse_classes_36k_train_008148
2,424
no_license
[ { "docstring": "Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the temporal dimension, followed by multiple bidirectional LSTM layers. Dropout is applied to the output of each hidden layer. Args: input_size (int): Size of the input feature dimension. hidden_size (int): Size of th...
2
stack_v2_sparse_classes_30k_train_007935
Implement the Python class `ASRModel` described below. Class description: Implement the ASRModel class. Method signatures and docstrings: - def __init__(self, input_size=80, hidden_size=256, output_size=29, num_layers=2, dropout=0.4): Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the ...
Implement the Python class `ASRModel` described below. Class description: Implement the ASRModel class. Method signatures and docstrings: - def __init__(self, input_size=80, hidden_size=256, output_size=29, num_layers=2, dropout=0.4): Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the ...
3b7452342e5eb4eea5a8ca3e24f86a57bcd20ff1
<|skeleton|> class ASRModel: def __init__(self, input_size=80, hidden_size=256, output_size=29, num_layers=2, dropout=0.4): """Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the temporal dimension, followed by multiple bidirectional LSTM layers. Dropout is applied to the out...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ASRModel: def __init__(self, input_size=80, hidden_size=256, output_size=29, num_layers=2, dropout=0.4): """Implements a 1D-convolutional (kernel_size=5, stride=2) layer for downsampling the temporal dimension, followed by multiple bidirectional LSTM layers. Dropout is applied to the output of each hi...
the_stack_v2_python_sparse
asr/modules/asr_model.py
LouisThygesen/02466_fagprojekt_done
train
0
bd39fc9a4057bde8a8fb00b5cf810ba0f1086681
[ "def cmp(a, b):\n if str(a) > str(b):\n return 1\n return -1\nans = [i for i in range(1, n + 1)]\nans.sort(cmp=cmp)\nprint(ans)\nreturn ans", "curr = 1\nans = []\nfor _ in range(1, n + 1):\n ans.append(curr)\n if curr * 10 <= n:\n curr *= 10\n elif curr % 10 != 9 and curr + 1 <= n:\n ...
<|body_start_0|> def cmp(a, b): if str(a) > str(b): return 1 return -1 ans = [i for i in range(1, n + 1)] ans.sort(cmp=cmp) print(ans) return ans <|end_body_0|> <|body_start_1|> curr = 1 ans = [] for _ in range(1, n...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def lexicalOrder(self, n): """:type n: int :rtype: List[int]""" <|body_0|> def lexicalOrder2(self, n): """:type n: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|> def cmp(a, b): if str(a) > str(b): ...
stack_v2_sparse_classes_36k_train_008149
1,618
no_license
[ { "docstring": ":type n: int :rtype: List[int]", "name": "lexicalOrder", "signature": "def lexicalOrder(self, n)" }, { "docstring": ":type n: int :rtype: List[int]", "name": "lexicalOrder2", "signature": "def lexicalOrder2(self, n)" } ]
2
stack_v2_sparse_classes_30k_val_000515
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lexicalOrder(self, n): :type n: int :rtype: List[int] - def lexicalOrder2(self, n): :type n: int :rtype: List[int]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def lexicalOrder(self, n): :type n: int :rtype: List[int] - def lexicalOrder2(self, n): :type n: int :rtype: List[int] <|skeleton|> class Solution: def lexicalOrder(self, n...
2d5fa4cd696d5035ea8859befeadc5cc436959c9
<|skeleton|> class Solution: def lexicalOrder(self, n): """:type n: int :rtype: List[int]""" <|body_0|> def lexicalOrder2(self, n): """:type n: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def lexicalOrder(self, n): """:type n: int :rtype: List[int]""" def cmp(a, b): if str(a) > str(b): return 1 return -1 ans = [i for i in range(1, n + 1)] ans.sort(cmp=cmp) print(ans) return ans def lexicalOrd...
the_stack_v2_python_sparse
SourceCode/Python/Problem/00386.Lexicographical Numbers.py
roger6blog/LeetCode
train
0
dc7e72c152bd5ced1ab531901b06be698d8eddb0
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn PasswordAuthenticationMethod()", "from .authentication_method import AuthenticationMethod\nfrom .authentication_method import AuthenticationMethod\nfields: Dict[str, Callable[[Any], None]] = {'createdDateTime': lambda n: setattr(self, ...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return PasswordAuthenticationMethod() <|end_body_0|> <|body_start_1|> from .authentication_method import AuthenticationMethod from .authentication_method import AuthenticationMethod fie...
PasswordAuthenticationMethod
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PasswordAuthenticationMethod: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PasswordAuthenticationMethod: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_36k_train_008150
2,774
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: PasswordAuthenticationMethod", "name": "create_from_discriminator_value", "signature": "def create_from_disc...
3
null
Implement the Python class `PasswordAuthenticationMethod` described below. Class description: Implement the PasswordAuthenticationMethod class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PasswordAuthenticationMethod: Creates a new instance of the a...
Implement the Python class `PasswordAuthenticationMethod` described below. Class description: Implement the PasswordAuthenticationMethod class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PasswordAuthenticationMethod: Creates a new instance of the a...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class PasswordAuthenticationMethod: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PasswordAuthenticationMethod: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PasswordAuthenticationMethod: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> PasswordAuthenticationMethod: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create th...
the_stack_v2_python_sparse
msgraph/generated/models/password_authentication_method.py
microsoftgraph/msgraph-sdk-python
train
135
39641c5bb9bdbcec5e2f12438ccd960298c77dc5
[ "from m3gnet.models import M3GNet\nif model_path:\n self.describer_model = M3GNet.from_dir(model_path)\nelse:\n self.describer_model = M3GNet.from_dir(DEFAULT_MODEL)\nself.model_path = model_path\nsuper().__init__(**kwargs)", "from m3gnet.graph import Index, tf_compute_distance_angle\nfrom m3gnet.layers imp...
<|body_start_0|> from m3gnet.models import M3GNet if model_path: self.describer_model = M3GNet.from_dir(model_path) else: self.describer_model = M3GNet.from_dir(DEFAULT_MODEL) self.model_path = model_path super().__init__(**kwargs) <|end_body_0|> <|body_s...
M3GNetStructure
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class M3GNetStructure: def __init__(self, model_path: str | None=None, **kwargs): """Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation energy model on figshare: https://figshare.com/articles/software/m3gnet_property_model_weights/20099465 P...
stack_v2_sparse_classes_36k_train_008151
2,220
permissive
[ { "docstring": "Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation energy model on figshare: https://figshare.com/articles/software/m3gnet_property_model_weights/20099465 Please refer to the M3GNet paper: https://doi.org/10.1038/s43588-022-00349-3.", "nam...
2
stack_v2_sparse_classes_30k_train_018506
Implement the Python class `M3GNetStructure` described below. Class description: Implement the M3GNetStructure class. Method signatures and docstrings: - def __init__(self, model_path: str | None=None, **kwargs): Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation e...
Implement the Python class `M3GNetStructure` described below. Class description: Implement the M3GNetStructure class. Method signatures and docstrings: - def __init__(self, model_path: str | None=None, **kwargs): Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation e...
6ae3c7029b939e1183684358a3ae2fef41053be5
<|skeleton|> class M3GNetStructure: def __init__(self, model_path: str | None=None, **kwargs): """Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation energy model on figshare: https://figshare.com/articles/software/m3gnet_property_model_weights/20099465 P...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class M3GNetStructure: def __init__(self, model_path: str | None=None, **kwargs): """Args: model_path (str): m3gnet models path. If no path is provided, the models will be M3GNet formation energy model on figshare: https://figshare.com/articles/software/m3gnet_property_model_weights/20099465 Please refer to...
the_stack_v2_python_sparse
maml/describers/_m3gnet.py
materialsvirtuallab/maml
train
266
97421b1a9d8db2b24f66e72effb56c021431a0d4
[ "if hasattr(request, 'user_rbac'):\n if request.user_rbac is not None:\n return True\nreturn False", "if hasattr(request, 'user_rbac'):\n user_rbac = request.user_rbac\n if user_rbac is not None:\n user = user_rbac.user\n if hasattr(user, 'userinfo'):\n return user.userinf...
<|body_start_0|> if hasattr(request, 'user_rbac'): if request.user_rbac is not None: return True return False <|end_body_0|> <|body_start_1|> if hasattr(request, 'user_rbac'): user_rbac = request.user_rbac if user_rbac is not None: ...
UserAPI
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserAPI: def is_login(request): """连接是否登录 :param request: :return:""" <|body_0|> def get_per_page(request): """获取用户设置的页信息 :param request: :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> if hasattr(request, 'user_rbac'): if reque...
stack_v2_sparse_classes_36k_train_008152
1,407
permissive
[ { "docstring": "连接是否登录 :param request: :return:", "name": "is_login", "signature": "def is_login(request)" }, { "docstring": "获取用户设置的页信息 :param request: :return:", "name": "get_per_page", "signature": "def get_per_page(request)" } ]
2
stack_v2_sparse_classes_30k_train_019166
Implement the Python class `UserAPI` described below. Class description: Implement the UserAPI class. Method signatures and docstrings: - def is_login(request): 连接是否登录 :param request: :return: - def get_per_page(request): 获取用户设置的页信息 :param request: :return:
Implement the Python class `UserAPI` described below. Class description: Implement the UserAPI class. Method signatures and docstrings: - def is_login(request): 连接是否登录 :param request: :return: - def get_per_page(request): 获取用户设置的页信息 :param request: :return: <|skeleton|> class UserAPI: def is_login(request): ...
8b97efdc9287645ea6b99dcf3a99fbe3f6ba6862
<|skeleton|> class UserAPI: def is_login(request): """连接是否登录 :param request: :return:""" <|body_0|> def get_per_page(request): """获取用户设置的页信息 :param request: :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserAPI: def is_login(request): """连接是否登录 :param request: :return:""" if hasattr(request, 'user_rbac'): if request.user_rbac is not None: return True return False def get_per_page(request): """获取用户设置的页信息 :param request: :return:""" if ha...
the_stack_v2_python_sparse
natrix/common/user_api.py
creditease-natrix/natrix
train
4
dfa62238e0acea51caeedd8fe80fd21ac6b59383
[ "url = self.build_url('/datastores', limit=limit, marker=marker)\nif response_key:\n return self._get(url, 'datastores', **kwargs)\nelse:\n return self._get(url, **kwargs)", "if response_key:\n return self._get('/datastores/%s' % datastore, 'datastore', **kwargs)\nelse:\n return self._get('/datastores...
<|body_start_0|> url = self.build_url('/datastores', limit=limit, marker=marker) if response_key: return self._get(url, 'datastores', **kwargs) else: return self._get(url, **kwargs) <|end_body_0|> <|body_start_1|> if response_key: return self._get('/d...
DatastoreManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DatastoreManager: def list(self, limit=None, marker=None, response_key=True, **kwargs): """Get a list of all datastores. :rtype: list of :class:`Datastore`.""" <|body_0|> def get(self, datastore, response_key=True, **kwargs): """Get a specific datastore. :rtype: :cla...
stack_v2_sparse_classes_36k_train_008153
862
no_license
[ { "docstring": "Get a list of all datastores. :rtype: list of :class:`Datastore`.", "name": "list", "signature": "def list(self, limit=None, marker=None, response_key=True, **kwargs)" }, { "docstring": "Get a specific datastore. :rtype: :class:`Datastore`", "name": "get", "signature": "d...
2
null
Implement the Python class `DatastoreManager` described below. Class description: Implement the DatastoreManager class. Method signatures and docstrings: - def list(self, limit=None, marker=None, response_key=True, **kwargs): Get a list of all datastores. :rtype: list of :class:`Datastore`. - def get(self, datastore,...
Implement the Python class `DatastoreManager` described below. Class description: Implement the DatastoreManager class. Method signatures and docstrings: - def list(self, limit=None, marker=None, response_key=True, **kwargs): Get a list of all datastores. :rtype: list of :class:`Datastore`. - def get(self, datastore,...
42f9197ba26ffb6b9dd336a524639ecbbf194365
<|skeleton|> class DatastoreManager: def list(self, limit=None, marker=None, response_key=True, **kwargs): """Get a list of all datastores. :rtype: list of :class:`Datastore`.""" <|body_0|> def get(self, datastore, response_key=True, **kwargs): """Get a specific datastore. :rtype: :cla...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DatastoreManager: def list(self, limit=None, marker=None, response_key=True, **kwargs): """Get a list of all datastores. :rtype: list of :class:`Datastore`.""" url = self.build_url('/datastores', limit=limit, marker=marker) if response_key: return self._get(url, 'datastores...
the_stack_v2_python_sparse
ops_client/project/trove/datastores.py
tokuzfunpi/ops_client
train
0
82a41c88b4d63de6023b42384d6335f1a5215a93
[ "max_data = []\nif len(nums) == 0:\n return max_data\nfor i in range(len(nums) - k + 1):\n max_data.append(max(nums[i:i + k]))\nreturn max_data", "win = []\nres = []\nfor i, v in enumerate(nums):\n if i >= k and i - win[0] >= k:\n win.pop(0)\n while win and v >= nums[win[-1]]:\n win.pop(...
<|body_start_0|> max_data = [] if len(nums) == 0: return max_data for i in range(len(nums) - k + 1): max_data.append(max(nums[i:i + k])) return max_data <|end_body_0|> <|body_start_1|> win = [] res = [] for i, v in enumerate(nums): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxSlidingWindow(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def maxSlidingWindow2(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_008154
1,291
no_license
[ { "docstring": ":type nums: List[int] :type k: int :rtype: List[int]", "name": "maxSlidingWindow", "signature": "def maxSlidingWindow(self, nums, k)" }, { "docstring": ":type nums: List[int] :type k: int :rtype: List[int]", "name": "maxSlidingWindow2", "signature": "def maxSlidingWindow2...
2
stack_v2_sparse_classes_30k_train_003623
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSlidingWindow(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int] - def maxSlidingWindow2(self, nums, k): :type nums: List[int] :type k: int :rtype: List[...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxSlidingWindow(self, nums, k): :type nums: List[int] :type k: int :rtype: List[int] - def maxSlidingWindow2(self, nums, k): :type nums: List[int] :type k: int :rtype: List[...
013f6f222c6c2a617787b258f8a37003a9f51526
<|skeleton|> class Solution: def maxSlidingWindow(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_0|> def maxSlidingWindow2(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxSlidingWindow(self, nums, k): """:type nums: List[int] :type k: int :rtype: List[int]""" max_data = [] if len(nums) == 0: return max_data for i in range(len(nums) - k + 1): max_data.append(max(nums[i:i + k])) return max_data ...
the_stack_v2_python_sparse
other/slid_window.py
terrifyzhao/leetcode
train
0
696164931bbfb8c814ac834384e12ad62a10f0b3
[ "self._forward = {}\nself._backward = {}\nself._last = 0", "if val in self._forward:\n return False\nself._forward[val] = self._last\nself._backward[self._last] = val\nself._last += 1\nreturn True", "if val not in self._forward:\n return False\nx = self._forward.pop(val)\nprev_last = self._last - 1\nif x ...
<|body_start_0|> self._forward = {} self._backward = {} self._last = 0 <|end_body_0|> <|body_start_1|> if val in self._forward: return False self._forward[val] = self._last self._backward[self._last] = val self._last += 1 return True <|end_bod...
RandomizedSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomizedSet: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_008155
1,710
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool", "name": "insert", "signature": ...
4
stack_v2_sparse_classes_30k_train_002519
Implement the Python class `RandomizedSet` described below. Class description: Implement the RandomizedSet class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, val): Inserts a value to the set. Returns true if the set did not already contain the specif...
Implement the Python class `RandomizedSet` described below. Class description: Implement the RandomizedSet class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def insert(self, val): Inserts a value to the set. Returns true if the set did not already contain the specif...
33e24e4be8d30ec294211024dd0eab52d3bccbb7
<|skeleton|> class RandomizedSet: def __init__(self): """Initialize your data structure here.""" <|body_0|> def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type val: int :rtype: bool""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomizedSet: def __init__(self): """Initialize your data structure here.""" self._forward = {} self._backward = {} self._last = 0 def insert(self, val): """Inserts a value to the set. Returns true if the set did not already contain the specified element. :type va...
the_stack_v2_python_sparse
leetcode/380-insert-delete-getrandom-o1/380.py
clchiou/uva-problem-set
train
1
e6f54d8145f0a6b7bfe44224c669bafa2915e324
[ "self.__screen = screen\nself.__dns = DNS()\nself.__hostnameLabel = Label(DNSSETUP_HOSTNAME_LABEL.localize())\nself.__primaryDNSLabel = Label(DNSSETUP_FST_DNS_LABEL.localize())\nself.__secondaryDNSLabel = Label(DNSSETUP_SND_DNS_LABEL.localize())\nself.__searchListLabel = Label(DNSSETUP_SEARCH_LABEL.localize())\ndat...
<|body_start_0|> self.__screen = screen self.__dns = DNS() self.__hostnameLabel = Label(DNSSETUP_HOSTNAME_LABEL.localize()) self.__primaryDNSLabel = Label(DNSSETUP_FST_DNS_LABEL.localize()) self.__secondaryDNSLabel = Label(DNSSETUP_SND_DNS_LABEL.localize()) self.__searchL...
Represents the DNS configuration screen
DNSSetup
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DNSSetup: """Represents the DNS configuration screen""" def __init__(self, screen, data): """Constructor @type screen: SnackScreen @param screen: SnackScreen instance""" <|body_0|> def run(self): """Draws the screen @rtype: integer @returns: status of operation""...
stack_v2_sparse_classes_36k_train_008156
3,215
no_license
[ { "docstring": "Constructor @type screen: SnackScreen @param screen: SnackScreen instance", "name": "__init__", "signature": "def __init__(self, screen, data)" }, { "docstring": "Draws the screen @rtype: integer @returns: status of operation", "name": "run", "signature": "def run(self)" ...
2
null
Implement the Python class `DNSSetup` described below. Class description: Represents the DNS configuration screen Method signatures and docstrings: - def __init__(self, screen, data): Constructor @type screen: SnackScreen @param screen: SnackScreen instance - def run(self): Draws the screen @rtype: integer @returns: ...
Implement the Python class `DNSSetup` described below. Class description: Represents the DNS configuration screen Method signatures and docstrings: - def __init__(self, screen, data): Constructor @type screen: SnackScreen @param screen: SnackScreen instance - def run(self): Draws the screen @rtype: integer @returns: ...
1c738fd5e6ee3f8fd4f47acf2207038f20868212
<|skeleton|> class DNSSetup: """Represents the DNS configuration screen""" def __init__(self, screen, data): """Constructor @type screen: SnackScreen @param screen: SnackScreen instance""" <|body_0|> def run(self): """Draws the screen @rtype: integer @returns: status of operation""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DNSSetup: """Represents the DNS configuration screen""" def __init__(self, screen, data): """Constructor @type screen: SnackScreen @param screen: SnackScreen instance""" self.__screen = screen self.__dns = DNS() self.__hostnameLabel = Label(DNSSETUP_HOSTNAME_LABEL.localize...
the_stack_v2_python_sparse
zfrobisher-installer/src/viewer/newt/dnssetup.py
fedosu85nce/work
train
2
683859b8ebbb5d83222e3e406b7333fa266a277e
[ "t1 = [0.6, 0.1, 0.6]\nt2 = np.array([0.1, 0.2, 0.3])\nt3 = onp.array([5.0, 8.0, 101.0])\nres = fn.concatenate([t1, t2, t3])\nassert isinstance(res, np.ndarray)\nassert np.all(res == np.concatenate([t1, t2, t3]))", "t1 = jnp.array([5.0, 8.0, 101.0])\nt2 = jnp.array([0.6, 0.1, 0.6])\nt3 = jnp.array([0.1, 0.2, 0.3]...
<|body_start_0|> t1 = [0.6, 0.1, 0.6] t2 = np.array([0.1, 0.2, 0.3]) t3 = onp.array([5.0, 8.0, 101.0]) res = fn.concatenate([t1, t2, t3]) assert isinstance(res, np.ndarray) assert np.all(res == np.concatenate([t1, t2, t3])) <|end_body_0|> <|body_start_1|> t1 = jn...
Tests for the concatenate function
TestConcatenate
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestConcatenate: """Tests for the concatenate function""" def test_concatenate_array(self): """Test that concatenate, called without the axis arguments, concatenates across the 0th dimension""" <|body_0|> def test_concatenate_jax(self): """Test that concatenate, ...
stack_v2_sparse_classes_36k_train_008157
47,600
permissive
[ { "docstring": "Test that concatenate, called without the axis arguments, concatenates across the 0th dimension", "name": "test_concatenate_array", "signature": "def test_concatenate_array(self)" }, { "docstring": "Test that concatenate, called without the axis arguments, concatenates across the...
6
null
Implement the Python class `TestConcatenate` described below. Class description: Tests for the concatenate function Method signatures and docstrings: - def test_concatenate_array(self): Test that concatenate, called without the axis arguments, concatenates across the 0th dimension - def test_concatenate_jax(self): Te...
Implement the Python class `TestConcatenate` described below. Class description: Tests for the concatenate function Method signatures and docstrings: - def test_concatenate_array(self): Test that concatenate, called without the axis arguments, concatenates across the 0th dimension - def test_concatenate_jax(self): Te...
0c1c805fd5dfce465a8955ee3faf81037023a23e
<|skeleton|> class TestConcatenate: """Tests for the concatenate function""" def test_concatenate_array(self): """Test that concatenate, called without the axis arguments, concatenates across the 0th dimension""" <|body_0|> def test_concatenate_jax(self): """Test that concatenate, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestConcatenate: """Tests for the concatenate function""" def test_concatenate_array(self): """Test that concatenate, called without the axis arguments, concatenates across the 0th dimension""" t1 = [0.6, 0.1, 0.6] t2 = np.array([0.1, 0.2, 0.3]) t3 = onp.array([5.0, 8.0, 1...
the_stack_v2_python_sparse
artifacts/old_dataset_versions/original_commits_backup/pennylane/pennylane#1081/before/test_functions.py
MattePalte/Bugs-Quantum-Computing-Platforms
train
4
0afd4d6d8b8c52b30b8fe331a2ff48e628a88e87
[ "bsscs = BSSCS_CLASSIFIER(l2_reg=tf.contrib.layers.l2_regularizer(scale=0.001), learning_rate=0.001, steps=250, batch=250)\nself.assertTrue(bsscs != None)\nsingle_layer = bsscs.create_layer(512, activation=tf.nn.relu)\nself.assertTrue(single_layer != None)", "bsscs = BSSCS_CLASSIFIER(l2_reg=tf.contrib.layers.l2_r...
<|body_start_0|> bsscs = BSSCS_CLASSIFIER(l2_reg=tf.contrib.layers.l2_regularizer(scale=0.001), learning_rate=0.001, steps=250, batch=250) self.assertTrue(bsscs != None) single_layer = bsscs.create_layer(512, activation=tf.nn.relu) self.assertTrue(single_layer != None) <|end_body_0|> <|...
ClassifierNetworkTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ClassifierNetworkTests: def test_layer_creation(self): """Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default placeholder has been created""" <|body_0|> def test_loss_creation(self): """Tests the creation ...
stack_v2_sparse_classes_36k_train_008158
3,035
no_license
[ { "docstring": "Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default placeholder has been created", "name": "test_layer_creation", "signature": "def test_layer_creation(self)" }, { "docstring": "Tests the creation of a loss function pr...
4
stack_v2_sparse_classes_30k_train_015968
Implement the Python class `ClassifierNetworkTests` described below. Class description: Implement the ClassifierNetworkTests class. Method signatures and docstrings: - def test_layer_creation(self): Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default place...
Implement the Python class `ClassifierNetworkTests` described below. Class description: Implement the ClassifierNetworkTests class. Method signatures and docstrings: - def test_layer_creation(self): Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default place...
d665ca405bdf35fdb57f8149a10b90be82d8de22
<|skeleton|> class ClassifierNetworkTests: def test_layer_creation(self): """Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default placeholder has been created""" <|body_0|> def test_loss_creation(self): """Tests the creation ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ClassifierNetworkTests: def test_layer_creation(self): """Tests the creation of a default layer preconditions: No layer has been created postconditions: layer with default placeholder has been created""" bsscs = BSSCS_CLASSIFIER(l2_reg=tf.contrib.layers.l2_regularizer(scale=0.001), learning_ra...
the_stack_v2_python_sparse
BSSCSFramework/classifier_tests.py
wezleysherman/TBI-NN-421
train
3
ae8d7deb1bfec087e73dc3265c2347aec6e39df2
[ "self.logging = Logging()\nself.file_path = rootPath + '\\\\config\\\\test_data.yaml'\nself.config = YamlManage(self.file_path)\nself.conf = {}", "self.conf['is_id'] = self.config.read_yaml('IS', 'is_id')\nself.conf['token'] = self.config.read_yaml('IS', 'token')\nself.conf['cookie'] = self.config.read_yaml('IS',...
<|body_start_0|> self.logging = Logging() self.file_path = rootPath + '\\config\\test_data.yaml' self.config = YamlManage(self.file_path) self.conf = {} <|end_body_0|> <|body_start_1|> self.conf['is_id'] = self.config.read_yaml('IS', 'is_id') self.conf['token'] = self.co...
GetCollectTestData
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetCollectTestData: def __init__(self): """初始化config,读取config文件""" <|body_0|> def get_is_test_data(self): """获取email的各种参数配置值""" <|body_1|> def set_is_test_data(self, title, key, value): """修改yaml数据""" <|body_2|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_008159
1,389
no_license
[ { "docstring": "初始化config,读取config文件", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "获取email的各种参数配置值", "name": "get_is_test_data", "signature": "def get_is_test_data(self)" }, { "docstring": "修改yaml数据", "name": "set_is_test_data", "signature": "...
3
stack_v2_sparse_classes_30k_train_015277
Implement the Python class `GetCollectTestData` described below. Class description: Implement the GetCollectTestData class. Method signatures and docstrings: - def __init__(self): 初始化config,读取config文件 - def get_is_test_data(self): 获取email的各种参数配置值 - def set_is_test_data(self, title, key, value): 修改yaml数据
Implement the Python class `GetCollectTestData` described below. Class description: Implement the GetCollectTestData class. Method signatures and docstrings: - def __init__(self): 初始化config,读取config文件 - def get_is_test_data(self): 获取email的各种参数配置值 - def set_is_test_data(self, title, key, value): 修改yaml数据 <|skeleton|>...
931179680d2c0bf9187060711c9f6dab94119024
<|skeleton|> class GetCollectTestData: def __init__(self): """初始化config,读取config文件""" <|body_0|> def get_is_test_data(self): """获取email的各种参数配置值""" <|body_1|> def set_is_test_data(self, title, key, value): """修改yaml数据""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GetCollectTestData: def __init__(self): """初始化config,读取config文件""" self.logging = Logging() self.file_path = rootPath + '\\config\\test_data.yaml' self.config = YamlManage(self.file_path) self.conf = {} def get_is_test_data(self): """获取email的各种参数配置值""" ...
the_stack_v2_python_sparse
config/get_collect_test_data.py
zhoululululu/Automation
train
0
d9fc0d6d5d99ddfbc7a0008ea777587b6b0222ad
[ "l = len(nums)\ndp = [[0] * l for _ in range(l)]\nfor i in range(l):\n dp[i][i] = nums[i]\n for j in range(i + 1, l):\n dp[i][j] = dp[i][j - 1] + nums[j]\nprint(np.array(dp))\nself.dicts = {}\n\ndef dfs(start, end, m):\n if (start, end, m) in self.dicts:\n return self.dicts[start, end, m]\n ...
<|body_start_0|> l = len(nums) dp = [[0] * l for _ in range(l)] for i in range(l): dp[i][i] = nums[i] for j in range(i + 1, l): dp[i][j] = dp[i][j - 1] + nums[j] print(np.array(dp)) self.dicts = {} def dfs(start, end, m): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def splitArray(self, nums, m): """:type nums: List[int] :type m: int :rtype: int""" <|body_0|> def splitArray_1(self, nums, m): """:type nums: List[int] :type m: int :rtype: int 7185 ms""" <|body_1|> def splitArray_1(self, nums, m): """...
stack_v2_sparse_classes_36k_train_008160
3,238
no_license
[ { "docstring": ":type nums: List[int] :type m: int :rtype: int", "name": "splitArray", "signature": "def splitArray(self, nums, m)" }, { "docstring": ":type nums: List[int] :type m: int :rtype: int 7185 ms", "name": "splitArray_1", "signature": "def splitArray_1(self, nums, m)" }, { ...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def splitArray(self, nums, m): :type nums: List[int] :type m: int :rtype: int - def splitArray_1(self, nums, m): :type nums: List[int] :type m: int :rtype: int 7185 ms - def spli...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def splitArray(self, nums, m): :type nums: List[int] :type m: int :rtype: int - def splitArray_1(self, nums, m): :type nums: List[int] :type m: int :rtype: int 7185 ms - def spli...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class Solution: def splitArray(self, nums, m): """:type nums: List[int] :type m: int :rtype: int""" <|body_0|> def splitArray_1(self, nums, m): """:type nums: List[int] :type m: int :rtype: int 7185 ms""" <|body_1|> def splitArray_1(self, nums, m): """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def splitArray(self, nums, m): """:type nums: List[int] :type m: int :rtype: int""" l = len(nums) dp = [[0] * l for _ in range(l)] for i in range(l): dp[i][i] = nums[i] for j in range(i + 1, l): dp[i][j] = dp[i][j - 1] + nums[j]...
the_stack_v2_python_sparse
SplitArrayLargestSum_HARD_410.py
953250587/leetcode-python
train
2
9aef17d931bfd23878bbfde96a718598428b59ca
[ "nums.sort()\nwant = 1\nfor i in range(0, len(nums)):\n if nums[i] == want:\n want += 1\n elif want < nums[i]:\n return want\nreturn want", "len_nums = len(nums)\nfor i in range(len_nums):\n while 1 <= nums[i] <= len_nums and nums[i] != nums[nums[i] - 1]:\n c = nums[i]\n nums[...
<|body_start_0|> nums.sort() want = 1 for i in range(0, len(nums)): if nums[i] == want: want += 1 elif want < nums[i]: return want return want <|end_body_0|> <|body_start_1|> len_nums = len(nums) for i in range(len_...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def firstMissingPositive(self, nums: list) -> int: """不满足题目要求""" <|body_0|> def firstMissingPositive(self, nums: list) -> int: """置换方法""" <|body_1|> <|end_skeleton|> <|body_start_0|> nums.sort() want = 1 for i in range(0, l...
stack_v2_sparse_classes_36k_train_008161
859
no_license
[ { "docstring": "不满足题目要求", "name": "firstMissingPositive", "signature": "def firstMissingPositive(self, nums: list) -> int" }, { "docstring": "置换方法", "name": "firstMissingPositive", "signature": "def firstMissingPositive(self, nums: list) -> int" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def firstMissingPositive(self, nums: list) -> int: 不满足题目要求 - def firstMissingPositive(self, nums: list) -> int: 置换方法
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def firstMissingPositive(self, nums: list) -> int: 不满足题目要求 - def firstMissingPositive(self, nums: list) -> int: 置换方法 <|skeleton|> class Solution: def firstMissingPositive(s...
cb3587242195bb3f2626231af2da13b90945a4d5
<|skeleton|> class Solution: def firstMissingPositive(self, nums: list) -> int: """不满足题目要求""" <|body_0|> def firstMissingPositive(self, nums: list) -> int: """置换方法""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def firstMissingPositive(self, nums: list) -> int: """不满足题目要求""" nums.sort() want = 1 for i in range(0, len(nums)): if nums[i] == want: want += 1 elif want < nums[i]: return want return want def firs...
the_stack_v2_python_sparse
leetcode/py36/缺失的第一个正数.py
lionheartStark/sword_towards_offer
train
0
536f92fbd41caf1fe602b81c53763013c7bb1888
[ "try:\n natController = NatController()\n json_data = json.dumps(natController.get_floating_ip_private_address(id))\n resp = Response(json_data, status=200, mimetype='application/json')\n return resp\nexcept ValueError as ve:\n return Response(json.dumps(str(ve)), status=404, mimetype='application/js...
<|body_start_0|> try: natController = NatController() json_data = json.dumps(natController.get_floating_ip_private_address(id)) resp = Response(json_data, status=200, mimetype='application/json') return resp except ValueError as ve: return Resp...
Nat_FloatingIP_PrivateAddress
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Nat_FloatingIP_PrivateAddress: def get(self, id=None): """Gets the Floating IP private address parameter""" <|body_0|> def put(self, id): """Update the Floating IP private address parameter""" <|body_1|> <|end_skeleton|> <|body_start_0|> try: ...
stack_v2_sparse_classes_36k_train_008162
7,153
no_license
[ { "docstring": "Gets the Floating IP private address parameter", "name": "get", "signature": "def get(self, id=None)" }, { "docstring": "Update the Floating IP private address parameter", "name": "put", "signature": "def put(self, id)" } ]
2
stack_v2_sparse_classes_30k_train_010502
Implement the Python class `Nat_FloatingIP_PrivateAddress` described below. Class description: Implement the Nat_FloatingIP_PrivateAddress class. Method signatures and docstrings: - def get(self, id=None): Gets the Floating IP private address parameter - def put(self, id): Update the Floating IP private address param...
Implement the Python class `Nat_FloatingIP_PrivateAddress` described below. Class description: Implement the Nat_FloatingIP_PrivateAddress class. Method signatures and docstrings: - def get(self, id=None): Gets the Floating IP private address parameter - def put(self, id): Update the Floating IP private address param...
6070e3cb6bf957e04f5d8267db11f3296410e18e
<|skeleton|> class Nat_FloatingIP_PrivateAddress: def get(self, id=None): """Gets the Floating IP private address parameter""" <|body_0|> def put(self, id): """Update the Floating IP private address parameter""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Nat_FloatingIP_PrivateAddress: def get(self, id=None): """Gets the Floating IP private address parameter""" try: natController = NatController() json_data = json.dumps(natController.get_floating_ip_private_address(id)) resp = Response(json_data, status=200, ...
the_stack_v2_python_sparse
configuration-agent/nat/rest_api/resources/floating_ip.py
ReliableLion/frog4-configurable-vnf
train
0
bddfd93148b32af0286fd9c6bebc644a703a21d4
[ "res = [0] * length\nfor op in updates:\n res[op[0]] += op[2]\n if op[1] + 1 < length:\n res[op[1] + 1] -= op[2]\ntemp = 0\nfor i in xrange(len(res)):\n temp += res[i]\n res[i] = temp\nreturn res", "ls, arr = ([0] * length, array.array('l'))\narr.fromlist(ls)\nfor op in updates:\n for i in x...
<|body_start_0|> res = [0] * length for op in updates: res[op[0]] += op[2] if op[1] + 1 < length: res[op[1] + 1] -= op[2] temp = 0 for i in xrange(len(res)): temp += res[i] res[i] = temp return res <|end_body_0|> <|...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def getModifiedArray(self, length, updates): """:type length: int :type updates: List[List[int]] :rtype: List[int]""" <|body_0|> def getModifiedArray2(self, length, updates): """:type length: int :type updates: List[List[int]] :rtype: List[int]""" <...
stack_v2_sparse_classes_36k_train_008163
1,409
no_license
[ { "docstring": ":type length: int :type updates: List[List[int]] :rtype: List[int]", "name": "getModifiedArray", "signature": "def getModifiedArray(self, length, updates)" }, { "docstring": ":type length: int :type updates: List[List[int]] :rtype: List[int]", "name": "getModifiedArray2", ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getModifiedArray(self, length, updates): :type length: int :type updates: List[List[int]] :rtype: List[int] - def getModifiedArray2(self, length, updates): :type length: int ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getModifiedArray(self, length, updates): :type length: int :type updates: List[List[int]] :rtype: List[int] - def getModifiedArray2(self, length, updates): :type length: int ...
b4da922c4e8406c486760639b71e3ec50283ca43
<|skeleton|> class Solution: def getModifiedArray(self, length, updates): """:type length: int :type updates: List[List[int]] :rtype: List[int]""" <|body_0|> def getModifiedArray2(self, length, updates): """:type length: int :type updates: List[List[int]] :rtype: List[int]""" <...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def getModifiedArray(self, length, updates): """:type length: int :type updates: List[List[int]] :rtype: List[int]""" res = [0] * length for op in updates: res[op[0]] += op[2] if op[1] + 1 < length: res[op[1] + 1] -= op[2] temp ...
the_stack_v2_python_sparse
old_session/session_1/_370/_370_range_addition.py
YJL33/LeetCode
train
3
05c3f4ce92dd0f6f9403bcad31ca149d5642373e
[ "task_configs = find_all_files(path, extension=name_task_config)\nassert len(task_configs) == 1\nwith open(task_configs[0]) as config_file:\n config = json.load(config_file)\n gene = config.get('{cls_network}.gene')\n gene = split(gene, int)\n data_set = get_dataset_from_json(task_configs[0], fake=True)...
<|body_start_0|> task_configs = find_all_files(path, extension=name_task_config) assert len(task_configs) == 1 with open(task_configs[0]) as config_file: config = json.load(config_file) gene = config.get('{cls_network}.gene') gene = split(gene, int) ...
go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be easily read
MiniNASParsedTabularBenchmark
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MiniNASParsedTabularBenchmark: """go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be easily read""" def make_from_single_...
stack_v2_sparse_classes_36k_train_008164
7,134
permissive
[ { "docstring": "creating a mini result by parsing a training process", "name": "make_from_single_dir", "signature": "def make_from_single_dir(cls, path: str, space_name: str, arch_index: int) -> MiniResult" }, { "docstring": "creating a mini bench dataset by parsing multiple training processes",...
2
null
Implement the Python class `MiniNASParsedTabularBenchmark` described below. Class description: go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be ea...
Implement the Python class `MiniNASParsedTabularBenchmark` described below. Class description: go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be ea...
06729b9cf517ec416fb798ae387c5bd9c3a278ac
<|skeleton|> class MiniNASParsedTabularBenchmark: """go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be easily read""" def make_from_single_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MiniNASParsedTabularBenchmark: """go through a directory of training save-dirs, parsing the results of each single training run and its used architecture assumptions: - all networks are created as RetrainFromSearchUninasNetwork, so that their genes can be easily read""" def make_from_single_dir(cls, path...
the_stack_v2_python_sparse
uninas/optimization/benchmarks/mini/tabular_parsed.py
MLDL/uninas
train
0
d0c44c99119ac2e02260ff2f0b0d23a3c6d45be4
[ "super().__init__()\ntotal_size = input_size + prev_input_size\nself.proj = nn.Linear(total_size, input_size)\nself.transform = nn.Linear(total_size, input_size)\nself.transform.bias.data.fill_(-2.0)", "concat_inputs = torch.cat((current, previous), 1)\nproj_result = F.relu(self.proj(concat_inputs))\nproj_gate = ...
<|body_start_0|> super().__init__() total_size = input_size + prev_input_size self.proj = nn.Linear(total_size, input_size) self.transform = nn.Linear(total_size, input_size) self.transform.bias.data.fill_(-2.0) <|end_body_0|> <|body_start_1|> concat_inputs = torch.cat((...
The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.
Highway
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway up...
stack_v2_sparse_classes_36k_train_008165
25,672
no_license
[ { "docstring": "Instantiate the Highway update layer. :param input_size: Current representation size. :param prev_input_size: Size of the representation obtained by the previous convolutional layer.", "name": "__init__", "signature": "def __init__(self, input_size: int, prev_input_size: int)" }, { ...
2
stack_v2_sparse_classes_30k_train_019883
Implement the Python class `Highway` described below. Class description: The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387. Method signatures and docstrings: - def __init__(self, input_siz...
Implement the Python class `Highway` described below. Class description: The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387. Method signatures and docstrings: - def __init__(self, input_siz...
7e55a422588c1d1e00f35a3d3a3ff896cce59e18
<|skeleton|> class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway up...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Highway: """The Highway update layer from [srivastava2015]_. .. [srivastava2015] Srivastava, R. K., *et al.* (2015). `Highway Networks <http://arxiv.org/abs/1505.00387>`_. *arXiv*, 1505.00387.""" def __init__(self, input_size: int, prev_input_size: int): """Instantiate the Highway update layer. :...
the_stack_v2_python_sparse
generated/test_AstraZeneca_chemicalx.py
jansel/pytorch-jit-paritybench
train
35
c0b879709e1cc761c4a4db22824405de09a147cf
[ "self.k = k\nself.nums = nums\nheapq.heapify(self.nums)\nwhile len(self.nums) > self.k:\n heapq.heappop(self.nums)", "if len(self.nums) < self.k:\n heapq.heappush(self.nums, val)\nelif val > self.nums[0]:\n heapq.heappushpop(self.nums, val)\nreturn self.nums[0]" ]
<|body_start_0|> self.k = k self.nums = nums heapq.heapify(self.nums) while len(self.nums) > self.k: heapq.heappop(self.nums) <|end_body_0|> <|body_start_1|> if len(self.nums) < self.k: heapq.heappush(self.nums, val) elif val > self.nums[0]: ...
KthLargest3
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KthLargest3: def __init__(self, k: int, nums: List[int]): """Time complexity: O(N), where N is the number of elements in nums""" <|body_0|> def add(self, val: int) -> int: """Time complexity: O(logN), where N is the number of elements in nums""" <|body_1|> <...
stack_v2_sparse_classes_36k_train_008166
6,443
no_license
[ { "docstring": "Time complexity: O(N), where N is the number of elements in nums", "name": "__init__", "signature": "def __init__(self, k: int, nums: List[int])" }, { "docstring": "Time complexity: O(logN), where N is the number of elements in nums", "name": "add", "signature": "def add(...
2
stack_v2_sparse_classes_30k_test_000054
Implement the Python class `KthLargest3` described below. Class description: Implement the KthLargest3 class. Method signatures and docstrings: - def __init__(self, k: int, nums: List[int]): Time complexity: O(N), where N is the number of elements in nums - def add(self, val: int) -> int: Time complexity: O(logN), wh...
Implement the Python class `KthLargest3` described below. Class description: Implement the KthLargest3 class. Method signatures and docstrings: - def __init__(self, k: int, nums: List[int]): Time complexity: O(N), where N is the number of elements in nums - def add(self, val: int) -> int: Time complexity: O(logN), wh...
642e6dd2c3cd65704c90d6e06a392bdae2ddd644
<|skeleton|> class KthLargest3: def __init__(self, k: int, nums: List[int]): """Time complexity: O(N), where N is the number of elements in nums""" <|body_0|> def add(self, val: int) -> int: """Time complexity: O(logN), where N is the number of elements in nums""" <|body_1|> <...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KthLargest3: def __init__(self, k: int, nums: List[int]): """Time complexity: O(N), where N is the number of elements in nums""" self.k = k self.nums = nums heapq.heapify(self.nums) while len(self.nums) > self.k: heapq.heappop(self.nums) def add(self, v...
the_stack_v2_python_sparse
LeetCode/703.Kth_Largest_Element_in_a_Stream.py
viiicky/Problem-Solving
train
0
adf2414bf67dd17b494b72bb24106ec1192b8ae6
[ "self.compare_angle = None\nself._centroid_vectors = None\nself.ref_curve = self._calc_dist_curve(training_mask)\nself._ref_angle = np.arctan2(*self._centroid_vectors[0])", "input_curve = self._calc_dist_curve(query_mask)\ncost_landscape = np.abs(self.ref_curve[:, None] - input_curve[None, :])\nn_eval = min(500, ...
<|body_start_0|> self.compare_angle = None self._centroid_vectors = None self.ref_curve = self._calc_dist_curve(training_mask) self._ref_angle = np.arctan2(*self._centroid_vectors[0]) <|end_body_0|> <|body_start_1|> input_curve = self._calc_dist_curve(query_mask) cost_la...
OutlineComparer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OutlineComparer: def __init__(self, training_mask): """Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then the outline distance will be small. :param training_mask: Binary mask with a single blob to use as the ref...
stack_v2_sparse_classes_36k_train_008167
22,952
no_license
[ { "docstring": "Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then the outline distance will be small. :param training_mask: Binary mask with a single blob to use as the reference/training object. :type training_mask: np.ndarray", "...
3
stack_v2_sparse_classes_30k_train_014773
Implement the Python class `OutlineComparer` described below. Class description: Implement the OutlineComparer class. Method signatures and docstrings: - def __init__(self, training_mask): Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then th...
Implement the Python class `OutlineComparer` described below. Class description: Implement the OutlineComparer class. Method signatures and docstrings: - def __init__(self, training_mask): Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then th...
457d839a4ae5401c76a46616c622f2728f56f25b
<|skeleton|> class OutlineComparer: def __init__(self, training_mask): """Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then the outline distance will be small. :param training_mask: Binary mask with a single blob to use as the ref...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OutlineComparer: def __init__(self, training_mask): """Create object for comparing blobs/connected components outlines, meaning if same geometrical outline, including rotation, then the outline distance will be small. :param training_mask: Binary mask with a single blob to use as the reference/trainin...
the_stack_v2_python_sparse
AdvancedVisionTools.py
AndersDHenriksen/Vision
train
0
d9c2eb175d70fb3920a078fc581b3fa19f51beac
[ "self.copy_task_uid = copy_task_uid\nself.job_run_id = job_run_id\nself.task_id_list = task_id_list", "if dictionary is None:\n return None\ncopy_task_uid = cohesity_management_sdk.models.universal_id.UniversalId.from_dictionary(dictionary.get('copyTaskUid')) if dictionary.get('copyTaskUid') else None\njob_run...
<|body_start_0|> self.copy_task_uid = copy_task_uid self.job_run_id = job_run_id self.task_id_list = task_id_list <|end_body_0|> <|body_start_1|> if dictionary is None: return None copy_task_uid = cohesity_management_sdk.models.universal_id.UniversalId.from_dictionar...
Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particular copy task. For example, if replication task is to be...
CancelProtectionJobRunParam
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particul...
stack_v2_sparse_classes_36k_train_008168
2,888
permissive
[ { "docstring": "Constructor for the CancelProtectionJobRunParam class", "name": "__init__", "signature": "def __init__(self, copy_task_uid=None, job_run_id=None, task_id_list=None)" }, { "docstring": "Creates an instance of this model from a dictionary Args: dictionary (dictionary): A dictionary...
2
stack_v2_sparse_classes_30k_train_020498
Implement the Python class `CancelProtectionJobRunParam` described below. Class description: Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field s...
Implement the Python class `CancelProtectionJobRunParam` described below. Class description: Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field s...
e4973dfeb836266904d0369ea845513c7acf261e
<|skeleton|> class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particul...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CancelProtectionJobRunParam: """Implementation of the 'CancelProtectionJobRunParam' model. TODO: type description here. Attributes: copy_task_uid (UniversalId): CopyTaskUid is the Uid of a copy task. If a particular copy task is to be cancelled, this field should be set to the id of that particular copy task....
the_stack_v2_python_sparse
cohesity_management_sdk/models/cancel_protection_job_run_param.py
cohesity/management-sdk-python
train
24
59c06aa50a5ab697676be284b760258ba33eca33
[ "super(Encoder, self).__init__()\nself.N = N\nself.dm = dm\nself.embedding = tf.keras.layers.Embedding(input_vocab, dm)\nself.positional_encoding = positional_encoding(max_seq_len, self.dm)\nself.blocks = [EncoderBlock(dm, h, hidden, drop_rate) for _ in range(N)]\nself.dropout = tf.keras.layers.Dropout(drop_rate)",...
<|body_start_0|> super(Encoder, self).__init__() self.N = N self.dm = dm self.embedding = tf.keras.layers.Embedding(input_vocab, dm) self.positional_encoding = positional_encoding(max_seq_len, self.dm) self.blocks = [EncoderBlock(dm, h, hidden, drop_rate) for _ in range(N...
[summary] Args: tf ([type]): [description]
Encoder
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Encoder: """[summary] Args: tf ([type]): [description]""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """[summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [description] hidden ([type]): [description] input_vocab ([type...
stack_v2_sparse_classes_36k_train_008169
1,989
no_license
[ { "docstring": "[summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [description] hidden ([type]): [description] input_vocab ([type]): [description] max_seq_len ([type]): [description] drop_rate (float, optional): [description]. Defaults to 0.1.", "name": "__init__", "signat...
2
stack_v2_sparse_classes_30k_train_012554
Implement the Python class `Encoder` described below. Class description: [summary] Args: tf ([type]): [description] Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): [summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [descr...
Implement the Python class `Encoder` described below. Class description: [summary] Args: tf ([type]): [description] Method signatures and docstrings: - def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): [summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [descr...
5f86dee95f4d1c32014d0d74a368f342ff3ce6f7
<|skeleton|> class Encoder: """[summary] Args: tf ([type]): [description]""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """[summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [description] hidden ([type]): [description] input_vocab ([type...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Encoder: """[summary] Args: tf ([type]): [description]""" def __init__(self, N, dm, h, hidden, input_vocab, max_seq_len, drop_rate=0.1): """[summary] Args: N ([type]): [description] dm ([type]): [description] h ([type]): [description] hidden ([type]): [description] input_vocab ([type]): [descript...
the_stack_v2_python_sparse
supervised_learning/0x11-attention/9-transformer_encoder.py
d1sd41n/holbertonschool-machine_learning
train
0
4c23cf231898a7466e100634ac91ab1337b588f5
[ "frame_id = 1\nfor img in images:\n img_name = folderName + '{}'.format(frame_id) + imgType\n frame_id = frame_id + 1\n cv2.imwrite(img_name, img)", "files = []\nimages = []\nfor r, d, f in os.walk(folderName):\n for file in f:\n if imgType in file:\n files.append(os.path.join(r, fil...
<|body_start_0|> frame_id = 1 for img in images: img_name = folderName + '{}'.format(frame_id) + imgType frame_id = frame_id + 1 cv2.imwrite(img_name, img) <|end_body_0|> <|body_start_1|> files = [] images = [] for r, d, f in os.walk(folderNam...
ImageIO
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageIO: def WriteImagesToFolder(images, folderName, imgType='.jpg'): """Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the images to be saved imgType : str, optional type of image format)""" <|body_0|> def ...
stack_v2_sparse_classes_36k_train_008170
1,716
permissive
[ { "docstring": "Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the images to be saved imgType : str, optional type of image format)", "name": "WriteImagesToFolder", "signature": "def WriteImagesToFolder(images, folderName, imgType='.jpg...
2
null
Implement the Python class `ImageIO` described below. Class description: Implement the ImageIO class. Method signatures and docstrings: - def WriteImagesToFolder(images, folderName, imgType='.jpg'): Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the ...
Implement the Python class `ImageIO` described below. Class description: Implement the ImageIO class. Method signatures and docstrings: - def WriteImagesToFolder(images, folderName, imgType='.jpg'): Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the ...
8d4b9c3e058765c3d633038e9d6954094347d202
<|skeleton|> class ImageIO: def WriteImagesToFolder(images, folderName, imgType='.jpg'): """Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the images to be saved imgType : str, optional type of image format)""" <|body_0|> def ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageIO: def WriteImagesToFolder(images, folderName, imgType='.jpg'): """Writes a list of images to folder Parameters ---------- images : list list of images folderName : str location for the images to be saved imgType : str, optional type of image format)""" frame_id = 1 for img in im...
the_stack_v2_python_sparse
DataProcessing/ImageIO.py
abhishekmadhu/FrontNetPorting
train
1
dfd72a4fd51a6d709e15c38a33b68236d16102c4
[ "stack = []\nres = 0\nfor i, h in enumerate(height):\n while stack and height[stack[-1]] < h:\n buttom = stack.pop()\n if not stack:\n break\n left = stack[-1]\n res += (i - left - 1) * (min(h, height[left]) - height[buttom])\n stack.append(i)\nreturn res", "n = len(he...
<|body_start_0|> stack = [] res = 0 for i, h in enumerate(height): while stack and height[stack[-1]] < h: buttom = stack.pop() if not stack: break left = stack[-1] res += (i - left - 1) * (min(h, heig...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def trap1(self, height: List[int]) -> int: """思路:单调栈 @param height: @return:""" <|body_0|> def trap2(self, height: List[int]) -> int: """思路:动态规划法 :param height: :return:""" <|body_1|> def trap3(self, height: List[int]) -> int: """思路:双指针...
stack_v2_sparse_classes_36k_train_008171
4,311
no_license
[ { "docstring": "思路:单调栈 @param height: @return:", "name": "trap1", "signature": "def trap1(self, height: List[int]) -> int" }, { "docstring": "思路:动态规划法 :param height: :return:", "name": "trap2", "signature": "def trap2(self, height: List[int]) -> int" }, { "docstring": "思路:双指针 :pa...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def trap1(self, height: List[int]) -> int: 思路:单调栈 @param height: @return: - def trap2(self, height: List[int]) -> int: 思路:动态规划法 :param height: :return: - def trap3(self, height: ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def trap1(self, height: List[int]) -> int: 思路:单调栈 @param height: @return: - def trap2(self, height: List[int]) -> int: 思路:动态规划法 :param height: :return: - def trap3(self, height: ...
e43ee86c5a8cdb808da09b4b6138e10275abadb5
<|skeleton|> class Solution: def trap1(self, height: List[int]) -> int: """思路:单调栈 @param height: @return:""" <|body_0|> def trap2(self, height: List[int]) -> int: """思路:动态规划法 :param height: :return:""" <|body_1|> def trap3(self, height: List[int]) -> int: """思路:双指针...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def trap1(self, height: List[int]) -> int: """思路:单调栈 @param height: @return:""" stack = [] res = 0 for i, h in enumerate(height): while stack and height[stack[-1]] < h: buttom = stack.pop() if not stack: ...
the_stack_v2_python_sparse
LeetCode/栈/单调栈(Monotone Stack)/42. 接雨水.py
yiming1012/MyLeetCode
train
2
14d3b3aaa387ccf601f709d393e28467833fc526
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn TodoTask()", "from .attachment_base import AttachmentBase\nfrom .attachment_session import AttachmentSession\nfrom .checklist_item import ChecklistItem\nfrom .date_time_time_zone import DateTimeTimeZone\nfrom .entity import Entity\nfro...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return TodoTask() <|end_body_0|> <|body_start_1|> from .attachment_base import AttachmentBase from .attachment_session import AttachmentSession from .checklist_item import ChecklistItem...
TodoTask
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TodoTask: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TodoTask: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: TodoTask...
stack_v2_sparse_classes_36k_train_008172
9,869
permissive
[ { "docstring": "Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: TodoTask", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_value(pars...
3
null
Implement the Python class `TodoTask` described below. Class description: Implement the TodoTask class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TodoTask: Creates a new instance of the appropriate class based on discriminator value Args: parse_no...
Implement the Python class `TodoTask` described below. Class description: Implement the TodoTask class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TodoTask: Creates a new instance of the appropriate class based on discriminator value Args: parse_no...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class TodoTask: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TodoTask: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: TodoTask...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TodoTask: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> TodoTask: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator value and create the object Returns: TodoTask""" if...
the_stack_v2_python_sparse
msgraph/generated/models/todo_task.py
microsoftgraph/msgraph-sdk-python
train
135
fd6fa49d49e33477589e8e0c933ffc3972c52073
[ "i = 0\ndigits = ''\nret = NestedInteger()\nwhile i < len(s):\n if '0' <= s[i] <= '9' or s[i] == '-':\n digits += s[i]\n else:\n if digits:\n num = int(digits)\n buf = NestedInteger(num)\n ret.add(buf)\n if s[i] == '[':\n start = i\n ...
<|body_start_0|> i = 0 digits = '' ret = NestedInteger() while i < len(s): if '0' <= s[i] <= '9' or s[i] == '-': digits += s[i] else: if digits: num = int(digits) buf = NestedInteger(num) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def buff(self, s): """# using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger""" <|body_0|> def deserialize(self, s): """:type s: str :rtype: NestedInteger""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k_train_008173
2,855
no_license
[ { "docstring": "# using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger", "name": "buff", "signature": "def buff(self, s)" }, { "docstring": ":type s: str :rtype: NestedInteger", "name": "deserialize", "signature": "def dese...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def buff(self, s): # using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger - def deserialize(self, s): :type s: st...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def buff(self, s): # using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger - def deserialize(self, s): :type s: st...
70bdd75b6af2e1811c1beab22050c01d28d7373e
<|skeleton|> class Solution: def buff(self, s): """# using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger""" <|body_0|> def deserialize(self, s): """:type s: str :rtype: NestedInteger""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def buff(self, s): """# using DFS # find all single integers # as for the list in it , call self to manage :type s: str :rtype: NestedInteger""" i = 0 digits = '' ret = NestedInteger() while i < len(s): if '0' <= s[i] <= '9' or s[i] == '-': ...
the_stack_v2_python_sparse
python/leetcode/385_Mini_Parser.py
bobcaoge/my-code
train
0
83dad2e11cc4c94614bdff547c2beef2e1b4d848
[ "try:\n params = request._serialize()\n headers = request.headers\n body = self.call('CreatePrefetchTask', params, headers=headers)\n response = json.loads(body)\n model = models.CreatePrefetchTaskResponse()\n model._deserialize(response['Response'])\n return model\nexcept Exception as e:\n ...
<|body_start_0|> try: params = request._serialize() headers = request.headers body = self.call('CreatePrefetchTask', params, headers=headers) response = json.loads(body) model = models.CreatePrefetchTaskResponse() model._deserialize(respons...
TeoClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TeoClient: def CreatePrefetchTask(self, request): """创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskRequest` :rtype: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskResponse`""" ...
stack_v2_sparse_classes_36k_train_008174
5,399
permissive
[ { "docstring": "创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskRequest` :rtype: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskResponse`", "name": "CreatePrefetchTask", "signature": "def CreatePrefet...
5
stack_v2_sparse_classes_30k_train_015883
Implement the Python class `TeoClient` described below. Class description: Implement the TeoClient class. Method signatures and docstrings: - def CreatePrefetchTask(self, request): 创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTa...
Implement the Python class `TeoClient` described below. Class description: Implement the TeoClient class. Method signatures and docstrings: - def CreatePrefetchTask(self, request): 创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTa...
6baf00a5a56ba58b6a1123423e0a1422d17a0201
<|skeleton|> class TeoClient: def CreatePrefetchTask(self, request): """创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskRequest` :rtype: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskResponse`""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TeoClient: def CreatePrefetchTask(self, request): """创建预热任务 :param request: Request instance for CreatePrefetchTask. :type request: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskRequest` :rtype: :class:`tencentcloud.teo.v20220106.models.CreatePrefetchTaskResponse`""" try: ...
the_stack_v2_python_sparse
tencentcloud/teo/v20220106/teo_client.py
TencentCloud/tencentcloud-sdk-python
train
594
d4ec8f8729eecd0b281f940eee5246c88529ae16
[ "ret = ''\nif root is None:\n return '#'\nret += str(root.val)\nret += ' ' + str(len(root.children))\nfor i in range(len(root.children)):\n ret += ' ' + self.serialize(root.children[i])\nreturn ret", "def dfs(it):\n val = next(it)\n if val == '#':\n return None\n val = int(val)\n children...
<|body_start_0|> ret = '' if root is None: return '#' ret += str(root.val) ret += ' ' + str(len(root.children)) for i in range(len(root.children)): ret += ' ' + self.serialize(root.children[i]) return ret <|end_body_0|> <|body_start_1|> de...
Codec3
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec3: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|end_skeleton|> <|body_start_0...
stack_v2_sparse_classes_36k_train_008175
4,629
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: Node :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: Node", "name": "deserialize", "signature": "def deserialize(self, ...
2
null
Implement the Python class `Codec3` described below. Class description: Implement the Codec3 class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype: N...
Implement the Python class `Codec3` described below. Class description: Implement the Codec3 class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype: N...
9190d3d178f1733aa226973757ee7e045b7bab00
<|skeleton|> class Codec3: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec3: def serialize(self, root): """Encodes a tree to a single string. :type root: Node :rtype: str""" ret = '' if root is None: return '#' ret += str(root.val) ret += ' ' + str(len(root.children)) for i in range(len(root.children)): re...
the_stack_v2_python_sparse
SerializeAndDeserializeN-aryTree.py
ellinx/LC-python
train
1
e9433dda7638aade544bd5e12915d806c35cff27
[ "error_messages = {'incomplete': _('Must fill both latitude and longitude')}\nfields = [forms.FloatField(), forms.FloatField()]\nfor field in fields:\n field.error_messages = {}\nkwargs['widget'] = LocationWidget\nif 'max_length' in kwargs:\n del kwargs['max_length']\nsuper(LocationFormField, self).__init__(*...
<|body_start_0|> error_messages = {'incomplete': _('Must fill both latitude and longitude')} fields = [forms.FloatField(), forms.FloatField()] for field in fields: field.error_messages = {} kwargs['widget'] = LocationWidget if 'max_length' in kwargs: del k...
Location field
LocationFormField
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LocationFormField: """Location field""" def __init__(self, *args, **kwargs): """Class initialization method""" <|body_0|> def compress(self, data_list): """Data compression method""" <|body_1|> def clean(self, value): """Cleaning method""" ...
stack_v2_sparse_classes_36k_train_008176
6,288
permissive
[ { "docstring": "Class initialization method", "name": "__init__", "signature": "def __init__(self, *args, **kwargs)" }, { "docstring": "Data compression method", "name": "compress", "signature": "def compress(self, data_list)" }, { "docstring": "Cleaning method", "name": "cle...
3
stack_v2_sparse_classes_30k_val_000822
Implement the Python class `LocationFormField` described below. Class description: Location field Method signatures and docstrings: - def __init__(self, *args, **kwargs): Class initialization method - def compress(self, data_list): Data compression method - def clean(self, value): Cleaning method
Implement the Python class `LocationFormField` described below. Class description: Location field Method signatures and docstrings: - def __init__(self, *args, **kwargs): Class initialization method - def compress(self, data_list): Data compression method - def clean(self, value): Cleaning method <|skeleton|> class ...
be9d747b8ca4c5d18f9725b2dad08dba6119d810
<|skeleton|> class LocationFormField: """Location field""" def __init__(self, *args, **kwargs): """Class initialization method""" <|body_0|> def compress(self, data_list): """Data compression method""" <|body_1|> def clean(self, value): """Cleaning method""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LocationFormField: """Location field""" def __init__(self, *args, **kwargs): """Class initialization method""" error_messages = {'incomplete': _('Must fill both latitude and longitude')} fields = [forms.FloatField(), forms.FloatField()] for field in fields: fie...
the_stack_v2_python_sparse
sitetools/forms/fields.py
olivergs/django-sitetools
train
0
89583538a29b38c97ca5d769ef8b17902833fb79
[ "self.verify_mco_parameters(params)\ntfunc = partial(self.translated_function, func=func, params=params)\nx0, bounds = self.get_initial_and_bounds(params)\noptimization_result = scipy_optimize.minimize(tfunc, x0, method=self.algorithms, bounds=bounds)\noptimal_point = self.translate_array_to_mco(optimization_result...
<|body_start_0|> self.verify_mco_parameters(params) tfunc = partial(self.translated_function, func=func, params=params) x0, bounds = self.get_initial_and_bounds(params) optimization_result = scipy_optimize.minimize(tfunc, x0, method=self.algorithms, bounds=bounds) optimal_point =...
Optimization of an objective function using scipy.
ScipyOptimizer
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ScipyOptimizer: """Optimization of an objective function using scipy.""" def optimize_function(self, func, params): """Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list of MCO parameter values. Should return a scalar (i.e. a ...
stack_v2_sparse_classes_36k_train_008177
9,020
permissive
[ { "docstring": "Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list of MCO parameter values. Should return a scalar (i.e. a single-objective). If not the return (objectives) will be summed. params: list of MCOParameter The MCO parameter objects correspond...
6
stack_v2_sparse_classes_30k_train_003466
Implement the Python class `ScipyOptimizer` described below. Class description: Optimization of an objective function using scipy. Method signatures and docstrings: - def optimize_function(self, func, params): Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list...
Implement the Python class `ScipyOptimizer` described below. Class description: Optimization of an objective function using scipy. Method signatures and docstrings: - def optimize_function(self, func, params): Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list...
6106bec35d6ad2383138a35205cea44fe529a229
<|skeleton|> class ScipyOptimizer: """Optimization of an objective function using scipy.""" def optimize_function(self, func, params): """Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list of MCO parameter values. Should return a scalar (i.e. a ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ScipyOptimizer: """Optimization of an objective function using scipy.""" def optimize_function(self, func, params): """Minimize the passed function. Parameters ---------- func: Callable The MCO function to optimize Takes a list of MCO parameter values. Should return a scalar (i.e. a single-object...
the_stack_v2_python_sparse
force_bdss/mco/optimizers/scipy_optimizer.py
force-h2020/force-bdss
train
2
f7829bf4c540f1c02bc6e0d73f3bd8422b888847
[ "super().__init__(force_update=force_update, sleeping_time=sleeping_time)\nassert self.entity_provider is not None\nassert self.entity_schema is not None\nself.exchanges = exchanges\nif codes is None and code is not None:\n self.codes = [code]\nelse:\n self.codes = codes\nself.day_data = day_data\nself.entity...
<|body_start_0|> super().__init__(force_update=force_update, sleeping_time=sleeping_time) assert self.entity_provider is not None assert self.entity_schema is not None self.exchanges = exchanges if codes is None and code is not None: self.codes = [code] else: ...
EntityEventRecorder
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EntityEventRecorder: def __init__(self, force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True) -> None: """:param code: :param ignore_failed: :param entity_filters: :param exch...
stack_v2_sparse_classes_36k_train_008178
24,497
permissive
[ { "docstring": ":param code: :param ignore_failed: :param entity_filters: :param exchanges: :param entity_id: for record single entity :param entity_ids: set entity_ids or (entity_type,exchanges,codes) :param codes: :param day_data: one record per day,set to True if you want skip recording it when data of today...
2
stack_v2_sparse_classes_30k_test_000288
Implement the Python class `EntityEventRecorder` described below. Class description: Implement the EntityEventRecorder class. Method signatures and docstrings: - def __init__(self, force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filt...
Implement the Python class `EntityEventRecorder` described below. Class description: Implement the EntityEventRecorder class. Method signatures and docstrings: - def __init__(self, force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filt...
03aee869fd432bb933d59ba419401cfc11501392
<|skeleton|> class EntityEventRecorder: def __init__(self, force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True) -> None: """:param code: :param ignore_failed: :param entity_filters: :param exch...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EntityEventRecorder: def __init__(self, force_update=False, sleeping_time=10, exchanges=None, entity_id=None, entity_ids=None, code=None, codes=None, day_data=False, entity_filters=None, ignore_failed=True) -> None: """:param code: :param ignore_failed: :param entity_filters: :param exchanges: :param ...
the_stack_v2_python_sparse
src/zvt/contract/recorder.py
zvtvz/zvt
train
2,782
1e7c09fbab53137d472dc26fb752c5fe458a4540
[ "BaseResource.__init__(self, *args, **kw)\nself._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\\r\\n', '\\n'))\nself._code = open('%s.py' % self.basesourcefile, 'r').read()", "fle = open(os.path.join(basedir, self.name) + '.rsrc.py', 'w')\nlog.info(\"Writing '%s'\" % os.path.join(basedir, ...
<|body_start_0|> BaseResource.__init__(self, *args, **kw) self._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\r\n', '\n')) self._code = open('%s.py' % self.basesourcefile, 'r').read() <|end_body_0|> <|body_start_1|> fle = open(os.path.join(basedir, self.name) + '...
Represents a Python Card resource object
Resource
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" <|body_0|> def writeToFile(self, basedir, write_code=0): """Write ourselves out to a directory""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k_train_008179
2,155
permissive
[ { "docstring": "Initialize the PythonCard resource", "name": "__init__", "signature": "def __init__(self, *args, **kw)" }, { "docstring": "Write ourselves out to a directory", "name": "writeToFile", "signature": "def writeToFile(self, basedir, write_code=0)" } ]
2
stack_v2_sparse_classes_30k_train_007791
Implement the Python class `Resource` described below. Class description: Represents a Python Card resource object Method signatures and docstrings: - def __init__(self, *args, **kw): Initialize the PythonCard resource - def writeToFile(self, basedir, write_code=0): Write ourselves out to a directory
Implement the Python class `Resource` described below. Class description: Represents a Python Card resource object Method signatures and docstrings: - def __init__(self, *args, **kw): Initialize the PythonCard resource - def writeToFile(self, basedir, write_code=0): Write ourselves out to a directory <|skeleton|> cl...
847ce71e85093ea5ee668ec61dbfba760ffa6bbd
<|skeleton|> class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" <|body_0|> def writeToFile(self, basedir, write_code=0): """Write ourselves out to a directory""" <|body_1|> <|end_skeleton...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Resource: """Represents a Python Card resource object""" def __init__(self, *args, **kw): """Initialize the PythonCard resource""" BaseResource.__init__(self, *args, **kw) self._rsc = eval(open('%s.txt' % self.basesourcefile, 'r').read().replace('\r\n', '\n')) self._code =...
the_stack_v2_python_sparse
vb2py/targets/pythoncard/resource.py
rayzamgh/sumurProjection
train
1
de87c056d08750b240a3d876316ea1ec4c6b5b5b
[ "super().__init__(**kwargs)\nself.blocks_1 = []\nself.blocks_2 = []\nfor i in range(len(dilation_rate)):\n self.blocks_1.append([TFReflectionPad1d((kernel_size - 1) // 2 * dilation_rate[i]), tf.keras.layers.Conv1D(filters=filters, kernel_size=kernel_size, dilation_rate=dilation_rate[i], use_bias=use_bias)])\n ...
<|body_start_0|> super().__init__(**kwargs) self.blocks_1 = [] self.blocks_2 = [] for i in range(len(dilation_rate)): self.blocks_1.append([TFReflectionPad1d((kernel_size - 1) // 2 * dilation_rate[i]), tf.keras.layers.Conv1D(filters=filters, kernel_size=kernel_size, dilation_...
Tensorflow Hifigan resblock 1 module.
TFHifiResBlock
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TFHifiResBlock: """Tensorflow Hifigan resblock 1 module.""" def __init__(self, kernel_size, filters, dilation_rate, use_bias, nonlinear_activation, nonlinear_activation_params, is_weight_norm, initializer_seed, **kwargs): """Initialize TFHifiResBlock module. Args: kernel_size (int): ...
stack_v2_sparse_classes_36k_train_008180
13,272
permissive
[ { "docstring": "Initialize TFHifiResBlock module. Args: kernel_size (int): Kernel size. filters (int): Number of filters. dilation_rate (list): List dilation rate. use_bias (bool): Whether to add bias parameter in convolution layers. nonlinear_activation (str): Activation function module name. nonlinear_activat...
3
stack_v2_sparse_classes_30k_train_005200
Implement the Python class `TFHifiResBlock` described below. Class description: Tensorflow Hifigan resblock 1 module. Method signatures and docstrings: - def __init__(self, kernel_size, filters, dilation_rate, use_bias, nonlinear_activation, nonlinear_activation_params, is_weight_norm, initializer_seed, **kwargs): In...
Implement the Python class `TFHifiResBlock` described below. Class description: Tensorflow Hifigan resblock 1 module. Method signatures and docstrings: - def __init__(self, kernel_size, filters, dilation_rate, use_bias, nonlinear_activation, nonlinear_activation_params, is_weight_norm, initializer_seed, **kwargs): In...
136877136355c82d7ba474ceb7a8f133bd84767e
<|skeleton|> class TFHifiResBlock: """Tensorflow Hifigan resblock 1 module.""" def __init__(self, kernel_size, filters, dilation_rate, use_bias, nonlinear_activation, nonlinear_activation_params, is_weight_norm, initializer_seed, **kwargs): """Initialize TFHifiResBlock module. Args: kernel_size (int): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TFHifiResBlock: """Tensorflow Hifigan resblock 1 module.""" def __init__(self, kernel_size, filters, dilation_rate, use_bias, nonlinear_activation, nonlinear_activation_params, is_weight_norm, initializer_seed, **kwargs): """Initialize TFHifiResBlock module. Args: kernel_size (int): Kernel size. ...
the_stack_v2_python_sparse
tensorflow_tts/models/hifigan.py
TensorSpeech/TensorFlowTTS
train
2,889
27337149f46daba9c9cddc430b4d32699d4ddfd8
[ "super(Net, self).__init__()\nself.conv1 = nn.Conv2d(c_in, 128, 3, 1)\nself.conv2 = nn.Conv2d(self.conv1.out_channels, 128, 3, 1)\nself.relu = nn.ReLU(inplace=True)\nself.flatten = nn.Flatten(1)\nself.fc = nn.Linear((h_in - 4) * (w_in - 4) * 128, classes)\nnn.init.kaiming_normal_(self.conv1.weight, mode='fan_out')\...
<|body_start_0|> super(Net, self).__init__() self.conv1 = nn.Conv2d(c_in, 128, 3, 1) self.conv2 = nn.Conv2d(self.conv1.out_channels, 128, 3, 1) self.relu = nn.ReLU(inplace=True) self.flatten = nn.Flatten(1) self.fc = nn.Linear((h_in - 4) * (w_in - 4) * 128, classes) ...
Network definition.
Net
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Net: """Network definition.""" def __init__(self, c_in=1, h_in=28, w_in=28, classes=10): """Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of classes.""" <|body_0|> def forward(self, x): ...
stack_v2_sparse_classes_36k_train_008181
1,999
permissive
[ { "docstring": "Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of classes.", "name": "__init__", "signature": "def __init__(self, c_in=1, h_in=28, w_in=28, classes=10)" }, { "docstring": "Network forward method. ...
2
null
Implement the Python class `Net` described below. Class description: Network definition. Method signatures and docstrings: - def __init__(self, c_in=1, h_in=28, w_in=28, classes=10): Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of c...
Implement the Python class `Net` described below. Class description: Network definition. Method signatures and docstrings: - def __init__(self, c_in=1, h_in=28, w_in=28, classes=10): Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of c...
757aac75a0f3921c6d1b4d98599bd7d4ffda936b
<|skeleton|> class Net: """Network definition.""" def __init__(self, c_in=1, h_in=28, w_in=28, classes=10): """Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of classes.""" <|body_0|> def forward(self, x): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Net: """Network definition.""" def __init__(self, c_in=1, h_in=28, w_in=28, classes=10): """Network initialize method. Args: c_in: Input tensor channels. h_in: Input tensor height. w_in: Input tensor width. classes: Number of classes.""" super(Net, self).__init__() self.conv1 = nn...
the_stack_v2_python_sparse
python/level1_single_api/9_amct/amct_pytorch/tensor_decompose/src/common/model.py
RomanGaraev/samples
train
0
cc8ad53b6ab4e33f96eead9a3c58683ea5e3ec44
[ "triplets = []\nlength = len(nums)\nif length < 3:\n return triplets\nnums.sort()\nfor i in range(length):\n target = 0 - nums[i]\n hashmap = {}\n for j in range(i + 1, length):\n item_j = nums[j]\n if target - item_j in hashmap:\n triplet = [nums[i], target - item_j, item_j]\n ...
<|body_start_0|> triplets = [] length = len(nums) if length < 3: return triplets nums.sort() for i in range(length): target = 0 - nums[i] hashmap = {} for j in range(i + 1, length): item_j = nums[j] i...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def threeSum2(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|> <|body_start_0|> triplets = [] leng...
stack_v2_sparse_classes_36k_train_008182
1,433
no_license
[ { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "threeSum", "signature": "def threeSum(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: List[List[int]]", "name": "threeSum2", "signature": "def threeSum2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_013658
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSum(self, nums): :type nums: List[int] :rtype: List[List[int]] - def threeSum2(self, nums): :type nums: List[int] :rtype: List[List[int]]
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def threeSum(self, nums): :type nums: List[int] :rtype: List[List[int]] - def threeSum2(self, nums): :type nums: List[int] :rtype: List[List[int]] <|skeleton|> class Solution: ...
3f8a1acc28520e65714296b337f817148ec3e0af
<|skeleton|> class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_0|> def threeSum2(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def threeSum(self, nums): """:type nums: List[int] :rtype: List[List[int]]""" triplets = [] length = len(nums) if length < 3: return triplets nums.sort() for i in range(length): target = 0 - nums[i] hashmap = {} ...
the_stack_v2_python_sparse
lintcode/TwoPointers/3Sum.py
sassyst/leetcode-python
train
0
0d1594b8d9cdbc151a3dde812fd9047ea008b13f
[ "self.logger = logging.getLogger(base_logger + '.' + self.__class__.__name__)\nself.mount_point = mount_point\nself.local_conf = auth_config\nself.vault_client = vault_client", "string = str(string)\nself.logger.debug('Hashing ' + string)\nsha256_hash = hashlib.sha256(string.encode()).hexdigest()\nself.logger.deb...
<|body_start_0|> self.logger = logging.getLogger(base_logger + '.' + self.__class__.__name__) self.mount_point = mount_point self.local_conf = auth_config self.vault_client = vault_client <|end_body_0|> <|body_start_1|> string = str(string) self.logger.debug('Hashing ' +...
LDAP configuration specific class
AuthMethodLDAP
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AuthMethodLDAP: """LDAP configuration specific class""" def __init__(self, base_logger, mount_point, auth_config, vault_client): """:param base_logger: main class name :type base_logger: string :param mount_point: auth method mount point :type mount_point: str :param auth_config: aut...
stack_v2_sparse_classes_36k_train_008183
2,828
permissive
[ { "docstring": ":param base_logger: main class name :type base_logger: string :param mount_point: auth method mount point :type mount_point: str :param auth_config: auth method specific configuration :type auth_config: dict", "name": "__init__", "signature": "def __init__(self, base_logger, mount_point,...
5
stack_v2_sparse_classes_30k_train_001887
Implement the Python class `AuthMethodLDAP` described below. Class description: LDAP configuration specific class Method signatures and docstrings: - def __init__(self, base_logger, mount_point, auth_config, vault_client): :param base_logger: main class name :type base_logger: string :param mount_point: auth method m...
Implement the Python class `AuthMethodLDAP` described below. Class description: LDAP configuration specific class Method signatures and docstrings: - def __init__(self, base_logger, mount_point, auth_config, vault_client): :param base_logger: main class name :type base_logger: string :param mount_point: auth method m...
3457e8c2487a0d9cba8362208df91b77024d7782
<|skeleton|> class AuthMethodLDAP: """LDAP configuration specific class""" def __init__(self, base_logger, mount_point, auth_config, vault_client): """:param base_logger: main class name :type base_logger: string :param mount_point: auth method mount point :type mount_point: str :param auth_config: aut...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AuthMethodLDAP: """LDAP configuration specific class""" def __init__(self, base_logger, mount_point, auth_config, vault_client): """:param base_logger: main class name :type base_logger: string :param mount_point: auth method mount point :type mount_point: str :param auth_config: auth method spec...
the_stack_v2_python_sparse
vaultmanager/lib/AuthMethods/AuthMethodLDAP.py
manuelaguilar/vault-manager
train
0
eb4ed989f04dcdce30a03f0b2cce08868ac1a1de
[ "super(Inception, self).__init__()\nself.branch1 = ConvBNLayer(num_channels=num_channels, num_filters=ch1x1, filter_size=1, stride=1, padding=0)\nself.branch2 = paddle.nn.Sequential(ConvBNLayer(num_channels=num_channels, num_filters=ch3x3reduced, filter_size=1, stride=1, padding=0), ConvBNLayer(num_channels=ch3x3re...
<|body_start_0|> super(Inception, self).__init__() self.branch1 = ConvBNLayer(num_channels=num_channels, num_filters=ch1x1, filter_size=1, stride=1, padding=0) self.branch2 = paddle.nn.Sequential(ConvBNLayer(num_channels=num_channels, num_filters=ch3x3reduced, filter_size=1, stride=1, padding=0)...
Inception
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Inception: def __init__(self, num_channels, ch1x1, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2, pool_proj): """@Brief `Inception` @Parameters num_channels : channel numbers of input tensor ch1x1 : output channel numbers of 1x1 conv ch3x3reduced : channel numbers...
stack_v2_sparse_classes_36k_train_008184
23,805
permissive
[ { "docstring": "@Brief `Inception` @Parameters num_channels : channel numbers of input tensor ch1x1 : output channel numbers of 1x1 conv ch3x3reduced : channel numbers of 1x1 conv before 3x3 conv ch3x3 : output channel numbers of 3x3 conv doublech3x3reduced : channel numbers of 1x1 conv before the double 3x3 co...
2
null
Implement the Python class `Inception` described below. Class description: Implement the Inception class. Method signatures and docstrings: - def __init__(self, num_channels, ch1x1, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2, pool_proj): @Brief `Inception` @Parameters num_channels : channel...
Implement the Python class `Inception` described below. Class description: Implement the Inception class. Method signatures and docstrings: - def __init__(self, num_channels, ch1x1, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2, pool_proj): @Brief `Inception` @Parameters num_channels : channel...
78ff3c3ab3906012a0f4a612251347632aa493a7
<|skeleton|> class Inception: def __init__(self, num_channels, ch1x1, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2, pool_proj): """@Brief `Inception` @Parameters num_channels : channel numbers of input tensor ch1x1 : output channel numbers of 1x1 conv ch3x3reduced : channel numbers...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Inception: def __init__(self, num_channels, ch1x1, ch3x3reduced, ch3x3, doublech3x3reduced, doublech3x3_1, doublech3x3_2, pool_proj): """@Brief `Inception` @Parameters num_channels : channel numbers of input tensor ch1x1 : output channel numbers of 1x1 conv ch3x3reduced : channel numbers of 1x1 conv b...
the_stack_v2_python_sparse
ECO/paddle2.0/model/ECO.py
thinkall/Contrib
train
1
aa0930de16646b3dce4f78458371976f904e4ad5
[ "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "context.set_code(grpc.StatusCode.UNIMPLEMENTED)\ncontext.set_details('Method not implemented!')\nraise NotImplementedError('Method not implemented!')", "conte...
<|body_start_0|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') <|end_body_0|> <|body_start_1|> context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not im...
Missing associated documentation comment in .proto file.
ResourceServiceServicer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResourceServiceServicer: """Missing associated documentation comment in .proto file.""" def List(self, request, context): """List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os).""" <|body_0|> def Get(self, request, context): """Get s...
stack_v2_sparse_classes_36k_train_008185
12,259
permissive
[ { "docstring": "List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os).", "name": "List", "signature": "def List(self, request, context)" }, { "docstring": "Get specific Compute Cloud instance.", "name": "Get", "signature": "def Get(self, request, context)" }...
6
stack_v2_sparse_classes_30k_test_001073
Implement the Python class `ResourceServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def List(self, request, context): List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os). - def Get(self, req...
Implement the Python class `ResourceServiceServicer` described below. Class description: Missing associated documentation comment in .proto file. Method signatures and docstrings: - def List(self, request, context): List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os). - def Get(self, req...
b906a014dd893e2697864e1e48e814a8d9fbc48c
<|skeleton|> class ResourceServiceServicer: """Missing associated documentation comment in .proto file.""" def List(self, request, context): """List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os).""" <|body_0|> def Get(self, request, context): """Get s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResourceServiceServicer: """Missing associated documentation comment in .proto file.""" def List(self, request, context): """List resources: [Compute Cloud instances](/docs/backup/concepts/vm-connection#os).""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('M...
the_stack_v2_python_sparse
yandex/cloud/backup/v1/resource_service_pb2_grpc.py
yandex-cloud/python-sdk
train
63
561be3b4151813e52f42fdc7871bf5ef4e69fca8
[ "envs = data.get('env', {})\np = data.get('with', {})\na = p.pop('args') if 'args' in p else ()\nk = p.pop('kwargs') if 'kwargs' in p else {}\ntmp_a = (expand_env_var(v) for v in a)\ntmp_p = {kk: expand_env_var(vv) for kk, vv in {**k, **p}.items()}\nobj = cls(*tmp_a, env=envs, **tmp_p)\npp = data.get('pods', [])\nf...
<|body_start_0|> envs = data.get('env', {}) p = data.get('with', {}) a = p.pop('args') if 'args' in p else () k = p.pop('kwargs') if 'kwargs' in p else {} tmp_a = (expand_env_var(v) for v in a) tmp_p = {kk: expand_env_var(vv) for kk, vv in {**k, **p}.items()} obj ...
V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into the Flow, availables are: - ``add``: (default) equal to `Flow.add(...)` - `...
V1Parser
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class V1Parser: """V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into the Flow, availables are: - ``add``: (d...
stack_v2_sparse_classes_36k_train_008186
4,335
permissive
[ { "docstring": ":param cls: the class registered for dumping/loading :param data: flow yaml file loaded as python dict :return: the Flow YAML parser given the syntax version number", "name": "parse", "signature": "def parse(self, cls: type, data: Dict) -> 'Flow'" }, { "docstring": ":param data: ...
2
null
Implement the Python class `V1Parser` described below. Class description: V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into ...
Implement the Python class `V1Parser` described below. Class description: V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into ...
97f9e97a4a678a28bdeacbc7346eaf7bbd2aeb89
<|skeleton|> class V1Parser: """V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into the Flow, availables are: - ``add``: (d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class V1Parser: """V1Parser introduces new syntax and features: - It has a top-level field ``version`` - ``pods`` is now a List of Dict (rather than a Dict as prev.) - ``name`` is now optional - new field ``method`` can be used to specify how to add this Pod into the Flow, availables are: - ``add``: (default) equal...
the_stack_v2_python_sparse
jina/jaml/parsers/flow/v1.py
deepampatel/jina
train
2
603d7a72acdde774ad8a9edd696c4992b5624dd1
[ "for p in [region_name, cluster_name]:\n if p is None or p == '' or p == ' ':\n exit(1)\nelse:\n self.region_name = region_name\n self.cluster_name = cluster_name\n self.err = 0", "self.err = 0\nerrInfo = None\ntry:\n client = boto3.Session(region_name=self.region_name)\n self.msk_client ...
<|body_start_0|> for p in [region_name, cluster_name]: if p is None or p == '' or p == ' ': exit(1) else: self.region_name = region_name self.cluster_name = cluster_name self.err = 0 <|end_body_0|> <|body_start_1|> self.err = 0 ...
Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore
BackendConfig
[ "JSON" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BackendConfig: """Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore""" def __init__(self, cluster_name, region_name): """:param region_name": Region Name for the AWS MSK Cluster :type region_name": string :param cluster_name: AW...
stack_v2_sparse_classes_36k_train_008187
4,994
permissive
[ { "docstring": ":param region_name\": Region Name for the AWS MSK Cluster :type region_name\": string :param cluster_name: AWS MSK Cluster Name :type cluster_name: string", "name": "__init__", "signature": "def __init__(self, cluster_name, region_name)" }, { "docstring": "Method that creates a M...
3
stack_v2_sparse_classes_30k_train_005577
Implement the Python class `BackendConfig` described below. Class description: Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore Method signatures and docstrings: - def __init__(self, cluster_name, region_name): :param region_name": Region Name for the AWS MSK C...
Implement the Python class `BackendConfig` described below. Class description: Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore Method signatures and docstrings: - def __init__(self, cluster_name, region_name): :param region_name": Region Name for the AWS MSK C...
a327a56d8722bc039a7250903098f4ac7613e5a2
<|skeleton|> class BackendConfig: """Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore""" def __init__(self, cluster_name, region_name): """:param region_name": Region Name for the AWS MSK Cluster :type region_name": string :param cluster_name: AW...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BackendConfig: """Class for exporting MSK Connection information - Brokers - Zookeepers - Connection Protocol - Trustostore""" def __init__(self, cluster_name, region_name): """:param region_name": Region Name for the AWS MSK Cluster :type region_name": string :param cluster_name: AWS MSK Cluster...
the_stack_v2_python_sparse
aws/eks/lambdas/backend_config.py
christafford/lenses-cloud-templates
train
0
70caee432b859b430060bb4db68db62227cb7ddb
[ "form = CommentForm()\nis_liked = Like.is_liked_by_user(self.user, self.post)\nself.render_viewpost(form, is_liked)", "form = CommentForm(self.request.POST)\nis_liked = Like.is_liked_by_user(self.user, self.post)\nif form.validate():\n comment_key = Comment.new_comment(form.content.data, self.user, self.post)\...
<|body_start_0|> form = CommentForm() is_liked = Like.is_liked_by_user(self.user, self.post) self.render_viewpost(form, is_liked) <|end_body_0|> <|body_start_1|> form = CommentForm(self.request.POST) is_liked = Like.is_liked_by_user(self.user, self.post) if form.validate...
ViewPost
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ViewPost: def get(self, post_key): """Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display""" <|body_0|> def post(self, post_key): """Create a new comment and redirect user to the post page If error, display for...
stack_v2_sparse_classes_36k_train_008188
1,426
no_license
[ { "docstring": "Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display", "name": "get", "signature": "def get(self, post_key)" }, { "docstring": "Create a new comment and redirect user to the post page If error, display form with error detail...
2
stack_v2_sparse_classes_30k_train_001630
Implement the Python class `ViewPost` described below. Class description: Implement the ViewPost class. Method signatures and docstrings: - def get(self, post_key): Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display - def post(self, post_key): Create a new com...
Implement the Python class `ViewPost` described below. Class description: Implement the ViewPost class. Method signatures and docstrings: - def get(self, post_key): Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display - def post(self, post_key): Create a new com...
9a574d9abae7f3a599538956942c5439c8e0f69c
<|skeleton|> class ViewPost: def get(self, post_key): """Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display""" <|body_0|> def post(self, post_key): """Create a new comment and redirect user to the post page If error, display for...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ViewPost: def get(self, post_key): """Display a post and its comments Generate a form to post comments :param post_key: Key of the post to display""" form = CommentForm() is_liked = Like.is_liked_by_user(self.user, self.post) self.render_viewpost(form, is_liked) def post(s...
the_stack_v2_python_sparse
src/app/posts/view.py
fabriziou/UBlog
train
0
a9db689be705f11cb94b91e563e5c84b98f137e3
[ "allowed_users = []\nfor user in self.targets:\n allows_emails = self.usersetting(user)\n if allows_emails:\n allowed_users.append(user)\nreturn EmailAddress.objects.filter(user__in=allowed_users)", "html_message = render_to_string(self.context['template']['html'], self.context)\ntargets = self.targe...
<|body_start_0|> allowed_users = [] for user in self.targets: allows_emails = self.usersetting(user) if allows_emails: allowed_users.append(user) return EmailAddress.objects.filter(user__in=allowed_users) <|end_body_0|> <|body_start_1|> html_messa...
Notificationmethod for delivery via Email.
EmailNotification
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailNotification: """Notificationmethod for delivery via Email.""" def get_targets(self): """Return a list of target email addresses, only for users which allow email notifications.""" <|body_0|> def send_bulk(self): """Send the notifications out via email.""" ...
stack_v2_sparse_classes_36k_train_008189
2,847
permissive
[ { "docstring": "Return a list of target email addresses, only for users which allow email notifications.", "name": "get_targets", "signature": "def get_targets(self)" }, { "docstring": "Send the notifications out via email.", "name": "send_bulk", "signature": "def send_bulk(self)" } ]
2
stack_v2_sparse_classes_30k_train_008646
Implement the Python class `EmailNotification` described below. Class description: Notificationmethod for delivery via Email. Method signatures and docstrings: - def get_targets(self): Return a list of target email addresses, only for users which allow email notifications. - def send_bulk(self): Send the notification...
Implement the Python class `EmailNotification` described below. Class description: Notificationmethod for delivery via Email. Method signatures and docstrings: - def get_targets(self): Return a list of target email addresses, only for users which allow email notifications. - def send_bulk(self): Send the notification...
5a08ef908dd5344b4433436a4679d122f7f99e41
<|skeleton|> class EmailNotification: """Notificationmethod for delivery via Email.""" def get_targets(self): """Return a list of target email addresses, only for users which allow email notifications.""" <|body_0|> def send_bulk(self): """Send the notifications out via email.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmailNotification: """Notificationmethod for delivery via Email.""" def get_targets(self): """Return a list of target email addresses, only for users which allow email notifications.""" allowed_users = [] for user in self.targets: allows_emails = self.usersetting(user)...
the_stack_v2_python_sparse
InvenTree/plugin/builtin/integration/core_notifications.py
onurtatli/InvenTree
train
0
3344af935d4a3683b121094c5159c21cbc1d51bb
[ "super().__init__()\nif json is None:\n json = {}\nself._manager: 'SideBarManager' = side_bar_manager\nself.align = json.get('align', alignment)\nself.minimum_access_level = json.get('minimumAccessLevel', minimum_access_level)\nself.maximum_access_level = json.get('maximumAccessLevel', maximum_access_level)\nsel...
<|body_start_0|> super().__init__() if json is None: json = {} self._manager: 'SideBarManager' = side_bar_manager self.align = json.get('align', alignment) self.minimum_access_level = json.get('minimumAccessLevel', minimum_access_level) self.maximum_access_lev...
Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type: the item type of this class. Defaults to a BUTTON.
SideBarCard
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SideBarCard: """Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type: the item type of this class. Defaults ...
stack_v2_sparse_classes_36k_train_008190
6,308
permissive
[ { "docstring": "Create a side-bar card. :param side_bar_manager: Manager object to which the button is linked. :param json: the json response to construct the :class:`SideBarButton` from :param title: visible label of the button :param icon: FontAwesome icon of the button :param uri: Uniform Resource Identifier...
2
stack_v2_sparse_classes_30k_train_003067
Implement the Python class `SideBarCard` described below. Class description: Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type:...
Implement the Python class `SideBarCard` described below. Class description: Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type:...
e8352e4d434bd5d0a5d76f7351f100d0b63f6fa8
<|skeleton|> class SideBarCard: """Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type: the item type of this class. Defaults ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SideBarCard: """Side-bar card class. Every side-bar can have one or more cards and is maintained as an object of this class. :cvar allowed_attributes: allowed additional attributed provided as options alongside the specifically allowed ones. :cvar item_type: the item type of this class. Defaults to a BUTTON."...
the_stack_v2_python_sparse
pykechain/models/sidebar/sidebar_card.py
KE-works/pykechain
train
7
4cfc7dfb2a2762d1e56212844968a8b3e62782f8
[ "ipAddress = '10.0.2.15'\nport = '5432'\ndbName = 'sample'\nuserName = 'inoue'\npassword = '****'\nself.connection = psycopg2.connect('host={0} port={1} dbname={2} user={3} password={4}'.format(ipAddress, port, dbName, userName, password))", "cur = self.connection.cursor()\ncur.execute('select id,name from sample...
<|body_start_0|> ipAddress = '10.0.2.15' port = '5432' dbName = 'sample' userName = 'inoue' password = '****' self.connection = psycopg2.connect('host={0} port={1} dbname={2} user={3} password={4}'.format(ipAddress, port, dbName, userName, password)) <|end_body_0|> <|bod...
ポスグレに接続してみる
ConnectPostgresql
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConnectPostgresql: """ポスグレに接続してみる""" def __init__(self): """コンストラクタ DBに接続する""" <|body_0|> def Select(self): """selectする""" <|body_1|> <|end_skeleton|> <|body_start_0|> ipAddress = '10.0.2.15' port = '5432' dbName = 'sample' ...
stack_v2_sparse_classes_36k_train_008191
801
no_license
[ { "docstring": "コンストラクタ DBに接続する", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "selectする", "name": "Select", "signature": "def Select(self)" } ]
2
stack_v2_sparse_classes_30k_train_013524
Implement the Python class `ConnectPostgresql` described below. Class description: ポスグレに接続してみる Method signatures and docstrings: - def __init__(self): コンストラクタ DBに接続する - def Select(self): selectする
Implement the Python class `ConnectPostgresql` described below. Class description: ポスグレに接続してみる Method signatures and docstrings: - def __init__(self): コンストラクタ DBに接続する - def Select(self): selectする <|skeleton|> class ConnectPostgresql: """ポスグレに接続してみる""" def __init__(self): """コンストラクタ DBに接続する""" ...
6028f92290de60eb2552825d850758099162397f
<|skeleton|> class ConnectPostgresql: """ポスグレに接続してみる""" def __init__(self): """コンストラクタ DBに接続する""" <|body_0|> def Select(self): """selectする""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConnectPostgresql: """ポスグレに接続してみる""" def __init__(self): """コンストラクタ DBに接続する""" ipAddress = '10.0.2.15' port = '5432' dbName = 'sample' userName = 'inoue' password = '****' self.connection = psycopg2.connect('host={0} port={1} dbname={2} user={3} pas...
the_stack_v2_python_sparse
DB操作/connectdb.py
inoue0508/psample
train
0
176f35bf9c74b4adefb9f0778b4d9954704e094c
[ "if self.required is False and value is None:\n return\nif isinstance(value, self.cls):\n return value\nelif isinstance(value, dict):\n f_instance = self.cls(**value)\n return f_instance\nelse:\n raise TypedClassValidationError('{name} is not instance of {cls}'.format(name=name, cls=self.cls))", "i...
<|body_start_0|> if self.required is False and value is None: return if isinstance(value, self.cls): return value elif isinstance(value, dict): f_instance = self.cls(**value) return f_instance else: raise TypedClassValidationErr...
Ref
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Ref: def process(self, name, value): """:type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None""" <|body_0|> def simplify(self, value): """:type self: TypedClassBaseField :type value: TypedClass|None :rtype: TypedClassAny""...
stack_v2_sparse_classes_36k_train_008192
1,133
permissive
[ { "docstring": ":type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None", "name": "process", "signature": "def process(self, name, value)" }, { "docstring": ":type self: TypedClassBaseField :type value: TypedClass|None :rtype: TypedClassAny", "name"...
2
stack_v2_sparse_classes_30k_train_000445
Implement the Python class `Ref` described below. Class description: Implement the Ref class. Method signatures and docstrings: - def process(self, name, value): :type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None - def simplify(self, value): :type self: TypedClassBaseFi...
Implement the Python class `Ref` described below. Class description: Implement the Ref class. Method signatures and docstrings: - def process(self, name, value): :type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None - def simplify(self, value): :type self: TypedClassBaseFi...
c55b6a7506fc5ca21e7d20f03a5fbad1f5b5aa85
<|skeleton|> class Ref: def process(self, name, value): """:type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None""" <|body_0|> def simplify(self, value): """:type self: TypedClassBaseField :type value: TypedClass|None :rtype: TypedClassAny""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Ref: def process(self, name, value): """:type self: TypedClassBaseField :type name: str :type value: TypedClassAny :rtype: TypedClass|None""" if self.required is False and value is None: return if isinstance(value, self.cls): return value elif isinstance...
the_stack_v2_python_sparse
typedclass/fields/special/ref.py
ostrovok-team/typedclass
train
0
bbe55b9abc10f45c57b564549597c03512dae025
[ "if not root:\n return '[]'\nqueue = collections.deque()\nqueue.append(root)\nans = []\nwhile queue:\n node = queue.popleft()\n if node:\n ans.append(str(node.val))\n queue.append(node.left)\n queue.append(node.right)\n else:\n ans.append('null')\nreturn '[' + ','.join(ans) +...
<|body_start_0|> if not root: return '[]' queue = collections.deque() queue.append(root) ans = [] while queue: node = queue.popleft() if node: ans.append(str(node.val)) queue.append(node.left) que...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_008193
7,095
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_005982
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:...
58ad6836582da61bcdee649732fae5504b919e80
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return '[]' queue = collections.deque() queue.append(root) ans = [] while queue: node = queue.popleft() i...
the_stack_v2_python_sparse
binary_tree.py
lengyugo/leetcode
train
0
0a37a3dd9d3d263d6fa5fa7e5624585b8b140579
[ "if nums is []:\n return None\nleft = 0\nright = len(nums) - 1\nwhile left < right - 1:\n mid = (left + right) / 2\n if nums[left] < nums[right]:\n return nums[left]\n if nums[left] < nums[mid]:\n left = mid\n else:\n right = mid\nreturn min(nums[left], nums[right])", "if nums ...
<|body_start_0|> if nums is []: return None left = 0 right = len(nums) - 1 while left < right - 1: mid = (left + right) / 2 if nums[left] < nums[right]: return nums[left] if nums[left] < nums[mid]: left = mid...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findMin_2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> if nums is []: return None left...
stack_v2_sparse_classes_36k_train_008194
929
no_license
[ { "docstring": ":type nums: List[int] :rtype: int", "name": "findMin", "signature": "def findMin(self, nums)" }, { "docstring": ":type nums: List[int] :rtype: int", "name": "findMin_2", "signature": "def findMin_2(self, nums)" } ]
2
stack_v2_sparse_classes_30k_train_020238
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findMin(self, nums): :type nums: List[int] :rtype: int - def findMin_2(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 findMin(self, nums): :type nums: List[int] :rtype: int - def findMin_2(self, nums): :type nums: List[int] :rtype: int <|skeleton|> class Solution: def findMin(self, num...
4d24e9924a92d2f9517f82a07933b51a9ab32023
<|skeleton|> class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int""" <|body_0|> def findMin_2(self, nums): """:type nums: List[int] :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findMin(self, nums): """:type nums: List[int] :rtype: int""" if nums is []: return None left = 0 right = len(nums) - 1 while left < right - 1: mid = (left + right) / 2 if nums[left] < nums[right]: return ...
the_stack_v2_python_sparse
find-minimum-in-rotated-sorted-array.py
ceciet/leetcode
train
0
4667e18ebc89a24c0c724f80a3989f9fbc954ddb
[ "follower = request.user\nis_following = User.objects.filter(username=username).first()\n'Return HTTP 400 if the user is same as the following'\nif follower == is_following:\n return JsonResponse({'error': 'You cannot follow yourself'}, status=status.HTTP_400_BAD_REQUEST)\n'Return HTTP 404 if the following does ...
<|body_start_0|> follower = request.user is_following = User.objects.filter(username=username).first() 'Return HTTP 400 if the user is same as the following' if follower == is_following: return JsonResponse({'error': 'You cannot follow yourself'}, status=status.HTTP_400_BAD_R...
Follow and Unfollow the user with the username in the URL
CreateFollowing
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateFollowing: """Follow and Unfollow the user with the username in the URL""" def post(self, request, username): """This Class creates a new following record, the username in the URL is the user being followed The user that follows us gotten from the request object""" <|bo...
stack_v2_sparse_classes_36k_train_008195
12,940
no_license
[ { "docstring": "This Class creates a new following record, the username in the URL is the user being followed The user that follows us gotten from the request object", "name": "post", "signature": "def post(self, request, username)" }, { "docstring": "This Class deletes a following record, the u...
2
stack_v2_sparse_classes_30k_train_013130
Implement the Python class `CreateFollowing` described below. Class description: Follow and Unfollow the user with the username in the URL Method signatures and docstrings: - def post(self, request, username): This Class creates a new following record, the username in the URL is the user being followed The user that ...
Implement the Python class `CreateFollowing` described below. Class description: Follow and Unfollow the user with the username in the URL Method signatures and docstrings: - def post(self, request, username): This Class creates a new following record, the username in the URL is the user being followed The user that ...
bf30e4338a3bfe51f43d73b5ad876e27de6408da
<|skeleton|> class CreateFollowing: """Follow and Unfollow the user with the username in the URL""" def post(self, request, username): """This Class creates a new following record, the username in the URL is the user being followed The user that follows us gotten from the request object""" <|bo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CreateFollowing: """Follow and Unfollow the user with the username in the URL""" def post(self, request, username): """This Class creates a new following record, the username in the URL is the user being followed The user that follows us gotten from the request object""" follower = reques...
the_stack_v2_python_sparse
Account/views.py
damey2011/AskolonyAPI
train
0
bf6b8622ebd7cf8e4562142b9ad6ba13a6cabc7a
[ "if body_start is None and tail_start is None:\n raise ValueError('Both body start and tail start are None.')\nif tail_start is not None and tail_fn is None:\n raise ValueError(f'Tail start has value ({tail_start}) but tail_fn is None.')\nif body_start is None:\n body_start = tail_start if tail_start is no...
<|body_start_0|> if body_start is None and tail_start is None: raise ValueError('Both body start and tail start are None.') if tail_start is not None and tail_fn is None: raise ValueError(f'Tail start has value ({tail_start}) but tail_fn is None.') if body_start is None: ...
Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_value). The tail, if defined, is a function from time to learning rate that is ...
_BodyAndTail
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class _BodyAndTail: """Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_value). The tail, if defined, is a func...
stack_v2_sparse_classes_36k_train_008196
9,085
permissive
[ { "docstring": "Specifies a body-and-tail time curve. Args: body_value: Constant learning rate for the body of the curve (after warm-up and before tail). Also is the reference (maximum) value for calculating warm-up values and tail values. body_start: Training step number at which the body starts. If None, take...
2
null
Implement the Python class `_BodyAndTail` described below. Class description: Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_...
Implement the Python class `_BodyAndTail` described below. Class description: Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_...
1bb3b89427f669f2f0ec84633952e21b68964a23
<|skeleton|> class _BodyAndTail: """Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_value). The tail, if defined, is a func...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class _BodyAndTail: """Defines a curve over time as a linear ramp + constant body + curvy tail. The body is a span of constant learning rate, and can be the entire curve. The warm-up, if present, is based on the line connecting points (0, 0) and (body_start, body_value). The tail, if defined, is a function from tim...
the_stack_v2_python_sparse
trax/supervised/lr_schedules.py
google/trax
train
8,180
a9ff2f4b70ea6a1dd8f4aa0598757610d041c38c
[ "self.number_points = number_points\nself.x_values = [0]\nself.y_values = [0]", "while len(self.x_values) < self.number_points:\n x_direction = choice([1, -1])\n x_distince = choice([0, 1, 2, 3, 4])\n x_step = x_direction * x_distince\n y_direction = choice([1, -1])\n y_distince = choice([0, 1, 2, ...
<|body_start_0|> self.number_points = number_points self.x_values = [0] self.y_values = [0] <|end_body_0|> <|body_start_1|> while len(self.x_values) < self.number_points: x_direction = choice([1, -1]) x_distince = choice([0, 1, 2, 3, 4]) x_step = x_di...
一个生成随机漫步数据的类
RandomWalk
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomWalk: """一个生成随机漫步数据的类""" def __init__(self, number_points=5000): """初始化随机漫步的属性""" <|body_0|> def fill_walk(self): """计算随机漫步包含的所有点""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.number_points = number_points self.x_values = [0...
stack_v2_sparse_classes_36k_train_008197
1,021
no_license
[ { "docstring": "初始化随机漫步的属性", "name": "__init__", "signature": "def __init__(self, number_points=5000)" }, { "docstring": "计算随机漫步包含的所有点", "name": "fill_walk", "signature": "def fill_walk(self)" } ]
2
stack_v2_sparse_classes_30k_train_003223
Implement the Python class `RandomWalk` described below. Class description: 一个生成随机漫步数据的类 Method signatures and docstrings: - def __init__(self, number_points=5000): 初始化随机漫步的属性 - def fill_walk(self): 计算随机漫步包含的所有点
Implement the Python class `RandomWalk` described below. Class description: 一个生成随机漫步数据的类 Method signatures and docstrings: - def __init__(self, number_points=5000): 初始化随机漫步的属性 - def fill_walk(self): 计算随机漫步包含的所有点 <|skeleton|> class RandomWalk: """一个生成随机漫步数据的类""" def __init__(self, number_points=5000): ...
30ad6ddfbf206fb7a0a76ae78ae5837cafcff842
<|skeleton|> class RandomWalk: """一个生成随机漫步数据的类""" def __init__(self, number_points=5000): """初始化随机漫步的属性""" <|body_0|> def fill_walk(self): """计算随机漫步包含的所有点""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomWalk: """一个生成随机漫步数据的类""" def __init__(self, number_points=5000): """初始化随机漫步的属性""" self.number_points = number_points self.x_values = [0] self.y_values = [0] def fill_walk(self): """计算随机漫步包含的所有点""" while len(self.x_values) < self.number_points: ...
the_stack_v2_python_sparse
view_data/random_walk.py
422518490/python
train
0
e0b32925aee455ca49a8ba47f6d45a72e7d74ee0
[ "super().__init__()\nself.self_attn_layer_norm = nn.LayerNorm(hid_dim)\nself.ff_layer_norm = nn.LayerNorm(hid_dim)\nself.self_attention = MultiHeadAttentionLayer(hid_dim, n_heads, dropout)\nself.positionwise_feedforward = PositionwiseFeedforwardLayer(hid_dim, pf_dim, dropout)\nself.dropout = nn.Dropout(dropout)", ...
<|body_start_0|> super().__init__() self.self_attn_layer_norm = nn.LayerNorm(hid_dim) self.ff_layer_norm = nn.LayerNorm(hid_dim) self.self_attention = MultiHeadAttentionLayer(hid_dim, n_heads, dropout) self.positionwise_feedforward = PositionwiseFeedforwardLayer(hid_dim, pf_dim, ...
TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value device: the device on which the model is running
TransformerEncoderLayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TransformerEncoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value devi...
stack_v2_sparse_classes_36k_train_008198
10,223
permissive
[ { "docstring": "Initialize model with params.", "name": "__init__", "signature": "def __init__(self, hid_dim, n_heads, pf_dim, dropout)" }, { "docstring": "Run a forward pass of model over the data.", "name": "forward", "signature": "def forward(self, src, src_mask)" } ]
2
stack_v2_sparse_classes_30k_train_017363
Implement the Python class `TransformerEncoderLayer` described below. Class description: TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward networ...
Implement the Python class `TransformerEncoderLayer` described below. Class description: TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward networ...
9cdbf270487751a0ad6862b2fea2ccc0e23a0b67
<|skeleton|> class TransformerEncoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value devi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TransformerEncoderLayer: """TransformerEncoderLayer is made up of self-attn and feedforward network. Args: hid_dim: the hidden size of the encoder n_heads: the number of heads in the multi-head attention layers pf_dim: the dimension of the feedforward network model dropout: the dropout value device: the devic...
the_stack_v2_python_sparse
caspr/models/transformer.py
microsoft/CASPR
train
29
da3bfc7b162b52722fedc81173c8bc55113e26cf
[ "if not self.request.user.is_external:\n raise Http404()\norganisation_slug = self.kwargs['organisation']\ncategory_slug = self.kwargs['category']\ncategory_qs = Category.objects.select_related().filter(organisation__slug=organisation_slug).filter(category_template__slug=category_slug)\ncategory = get_object_or_...
<|body_start_0|> if not self.request.user.is_external: raise Http404() organisation_slug = self.kwargs['organisation'] category_slug = self.kwargs['category'] category_qs = Category.objects.select_related().filter(organisation__slug=organisation_slug).filter(category_template...
Allows a contractor to download a file_transmitted file.
FileTransmittedDownload
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileTransmittedDownload: """Allows a contractor to download a file_transmitted file.""" def get_object(self): """Extract the correct revision.""" <|body_0|> def get(self, request, *args, **kwargs): """Serve the file.""" <|body_1|> <|end_skeleton|> <|bod...
stack_v2_sparse_classes_36k_train_008199
15,867
permissive
[ { "docstring": "Extract the correct revision.", "name": "get_object", "signature": "def get_object(self)" }, { "docstring": "Serve the file.", "name": "get", "signature": "def get(self, request, *args, **kwargs)" } ]
2
stack_v2_sparse_classes_30k_train_019431
Implement the Python class `FileTransmittedDownload` described below. Class description: Allows a contractor to download a file_transmitted file. Method signatures and docstrings: - def get_object(self): Extract the correct revision. - def get(self, request, *args, **kwargs): Serve the file.
Implement the Python class `FileTransmittedDownload` described below. Class description: Allows a contractor to download a file_transmitted file. Method signatures and docstrings: - def get_object(self): Extract the correct revision. - def get(self, request, *args, **kwargs): Serve the file. <|skeleton|> class FileT...
60ff6f37778971ae356c5b2b20e0d174a8288bfe
<|skeleton|> class FileTransmittedDownload: """Allows a contractor to download a file_transmitted file.""" def get_object(self): """Extract the correct revision.""" <|body_0|> def get(self, request, *args, **kwargs): """Serve the file.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileTransmittedDownload: """Allows a contractor to download a file_transmitted file.""" def get_object(self): """Extract the correct revision.""" if not self.request.user.is_external: raise Http404() organisation_slug = self.kwargs['organisation'] category_slug...
the_stack_v2_python_sparse
src/transmittals/views.py
Talengi/phase
train
8