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
a00d4df0b1f571334edd602248b4a47e65d0e4cb
[ "self._dbg = debug\nself._log = get_logger(self.__class__.__name__, self._dbg)\nself._log.debug('wav_topdir=%s, wav_subdir=%s', wav_topdir, wav_subdir)\nself._log.debug('wav_prefix=%s, wav_suffix=%s', wav_prefix, wav_suffix)\nself._log.debug('note_origin=%s', note_origin)\nself._wav_topdir = wav_topdir\nself._wav_s...
<|body_start_0|> self._dbg = debug self._log = get_logger(self.__class__.__name__, self._dbg) self._log.debug('wav_topdir=%s, wav_subdir=%s', wav_topdir, wav_subdir) self._log.debug('wav_prefix=%s, wav_suffix=%s', wav_prefix, wav_suffix) self._log.debug('note_origin=%s', note_ori...
Play wav_file insted of music box movement. Music Boxと同じ音階
MovementWav1
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MovementWav1: """Play wav_file insted of music box movement. Music Boxと同じ音階""" def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_SUFFIX, note_origin=NOTE_ORIGIN, debug=False): """Constructor Parameters ---------- ...
stack_v2_sparse_classes_36k_train_000000
13,175
no_license
[ { "docstring": "Constructor Parameters ---------- wav_topdir: str wav_subdir: str directory name wav_prefix: str wav_suffix: str note_origin: int", "name": "__init__", "signature": "def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_S...
4
stack_v2_sparse_classes_30k_train_014746
Implement the Python class `MovementWav1` described below. Class description: Play wav_file insted of music box movement. Music Boxと同じ音階 Method signatures and docstrings: - def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_SUFFIX, note_origin=NOTE...
Implement the Python class `MovementWav1` described below. Class description: Play wav_file insted of music box movement. Music Boxと同じ音階 Method signatures and docstrings: - def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_SUFFIX, note_origin=NOTE...
b8264118d19c7f6c6be9b11f18c890c598eb1295
<|skeleton|> class MovementWav1: """Play wav_file insted of music box movement. Music Boxと同じ音階""" def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_SUFFIX, note_origin=NOTE_ORIGIN, debug=False): """Constructor Parameters ---------- ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MovementWav1: """Play wav_file insted of music box movement. Music Boxと同じ音階""" def __init__(self, wav_topdir=DEF_WAV_TOPDIR, wav_subdir=DEF_WAV_SUBDIR, wav_prefix=WAV_FILE_PREFIX, wav_suffix=WAV_FILE_SUFFIX, note_origin=NOTE_ORIGIN, debug=False): """Constructor Parameters ---------- wav_topdir: s...
the_stack_v2_python_sparse
musicbox/movement.py
ytani01/MusicBox
train
1
f4874f85eec9abb47eeabd0a1174b52049cf5361
[ "self.report = report_document\nself.text_input = text_input_document\nself.text_input_soup = text_input_soup\nself.tables = list_of_tables\nself.picture_paths = picture_paths_list\nself.parameters = parameters_dictionary\nself.cGOM_dataframes = list_of_dataframes", "all_transitions = pd.DataFrame()\nfor idx, dat...
<|body_start_0|> self.report = report_document self.text_input = text_input_document self.text_input_soup = text_input_soup self.tables = list_of_tables self.picture_paths = picture_paths_list self.parameters = parameters_dictionary self.cGOM_dataframes = list_of_...
Class that represents the 'Transitions' chapter and the visualization of its results.
Transitions
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Transitions: """Class that represents the 'Transitions' chapter and the visualization of its results.""" def __init__(self, report_document: Document, text_input_document: Document, text_input_soup: BeautifulSoup, list_of_tables: List[str], picture_paths_list: List[str], parameters_dictionar...
stack_v2_sparse_classes_36k_train_000001
6,508
no_license
[ { "docstring": "Args: report_document: .docx file where the report is written. text_input_document: .docx file where all inputs are written. text_input_soup: BeautifulSoup of the xml of the input .docx file. list_of_tables: List of all table names. picture_paths_list: List of the path of all input pictures. par...
3
stack_v2_sparse_classes_30k_train_009976
Implement the Python class `Transitions` described below. Class description: Class that represents the 'Transitions' chapter and the visualization of its results. Method signatures and docstrings: - def __init__(self, report_document: Document, text_input_document: Document, text_input_soup: BeautifulSoup, list_of_ta...
Implement the Python class `Transitions` described below. Class description: Class that represents the 'Transitions' chapter and the visualization of its results. Method signatures and docstrings: - def __init__(self, report_document: Document, text_input_document: Document, text_input_soup: BeautifulSoup, list_of_ta...
f0ce3f75756be5a1b377474882b66293be8ed5ac
<|skeleton|> class Transitions: """Class that represents the 'Transitions' chapter and the visualization of its results.""" def __init__(self, report_document: Document, text_input_document: Document, text_input_soup: BeautifulSoup, list_of_tables: List[str], picture_paths_list: List[str], parameters_dictionar...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Transitions: """Class that represents the 'Transitions' chapter and the visualization of its results.""" def __init__(self, report_document: Document, text_input_document: Document, text_input_soup: BeautifulSoup, list_of_tables: List[str], picture_paths_list: List[str], parameters_dictionary: Dict[str, ...
the_stack_v2_python_sparse
docx_package/transitions.py
how2know/Usability_Testing_Report_Generator
train
0
2ffdfcad09525fc2408a45fffcdceed962ef9171
[ "for app_region in self.app.regions.values():\n app_region.instance_max = 1\n app_region.volumes['data0'] = {'count': 1, 'size': 1}\n laika_service = app_region.services['laika']\n laika_service.volumes['/mnt/data0'] = '/mnt/data'\n laika_service.environment['DISK_PATH'] = '/mnt/data/file.txt'\nself....
<|body_start_0|> for app_region in self.app.regions.values(): app_region.instance_max = 1 app_region.volumes['data0'] = {'count': 1, 'size': 1} laika_service = app_region.services['laika'] laika_service.volumes['/mnt/data0'] = '/mnt/data' laika_service...
TestDeployPersistence
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestDeployPersistence: def test_01_disk(self): """Deploy a service with persistent EBS volume, verify.""" <|body_0|> def test_02_cache(self): """Deploy a service with ElastiCache, verify.""" <|body_1|> def test_03_rds(self): """Deploy a service w...
stack_v2_sparse_classes_36k_train_000002
2,156
permissive
[ { "docstring": "Deploy a service with persistent EBS volume, verify.", "name": "test_01_disk", "signature": "def test_01_disk(self)" }, { "docstring": "Deploy a service with ElastiCache, verify.", "name": "test_02_cache", "signature": "def test_02_cache(self)" }, { "docstring": "...
3
stack_v2_sparse_classes_30k_train_010851
Implement the Python class `TestDeployPersistence` described below. Class description: Implement the TestDeployPersistence class. Method signatures and docstrings: - def test_01_disk(self): Deploy a service with persistent EBS volume, verify. - def test_02_cache(self): Deploy a service with ElastiCache, verify. - def...
Implement the Python class `TestDeployPersistence` described below. Class description: Implement the TestDeployPersistence class. Method signatures and docstrings: - def test_01_disk(self): Deploy a service with persistent EBS volume, verify. - def test_02_cache(self): Deploy a service with ElastiCache, verify. - def...
900b8ada0017f727163c5c2ae464e17d747ba0e8
<|skeleton|> class TestDeployPersistence: def test_01_disk(self): """Deploy a service with persistent EBS volume, verify.""" <|body_0|> def test_02_cache(self): """Deploy a service with ElastiCache, verify.""" <|body_1|> def test_03_rds(self): """Deploy a service w...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestDeployPersistence: def test_01_disk(self): """Deploy a service with persistent EBS volume, verify.""" for app_region in self.app.regions.values(): app_region.instance_max = 1 app_region.volumes['data0'] = {'count': 1, 'size': 1} laika_service = app_regio...
the_stack_v2_python_sparse
src/test_integ/test_persistence.py
tom9nguyen/spacel-provision
train
0
4cee1c7203949459bdb962e64818dc09786487ae
[ "stack = [-1]\nret = 0\nfor i, p in enumerate(s):\n if p == '(':\n stack.append(i)\n else:\n stack.pop()\n if stack:\n ret = max(ret, i - stack[-1])\n else:\n stack.append(i)\nreturn ret", "ret = 0\nleft = right = 0\nfor i in range(len(s)):\n if s[i] == '...
<|body_start_0|> stack = [-1] ret = 0 for i, p in enumerate(s): if p == '(': stack.append(i) else: stack.pop() if stack: ret = max(ret, i - stack[-1]) else: stack.appen...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int""" <|body_0|> def longestValidParentheses_1(self, s): """:type s: str :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> stack = [-1] ret = 0 for i,...
stack_v2_sparse_classes_36k_train_000003
1,951
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "longestValidParentheses", "signature": "def longestValidParentheses(self, s)" }, { "docstring": ":type s: str :rtype: int", "name": "longestValidParentheses_1", "signature": "def longestValidParentheses_1(self, s)" } ]
2
stack_v2_sparse_classes_30k_train_012030
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 longestValidParentheses_1(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 longestValidParentheses_1(self, s): :type s: str :rtype: int <|skeleton|> class Solution: def longestVa...
9fa6f81d8968dea51c255a6f92708cfc6bafb057
<|skeleton|> class Solution: def longestValidParentheses(self, s): """:type s: str :rtype: int""" <|body_0|> def longestValidParentheses_1(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""" stack = [-1] ret = 0 for i, p in enumerate(s): if p == '(': stack.append(i) else: stack.pop() if stack: ret...
the_stack_v2_python_sparse
32. Longest Valid Parentheses.py
ChihaoFeng/Leetcode
train
0
a61eb8948b43b30a5bb9d95e5418b3963317fedb
[ "webob.exc.HTTPError.__init__(self, detail=detail)\nserializer = serializers.XMLResponseSerializer()\nserializer.default(self, self.get_unserialized_body())", "if self.detail:\n message = ':'.join([self.explanation, self.detail])\nelse:\n message = self.explanation\nreturn {'ErrorResponse': {'Error': {'Type...
<|body_start_0|> webob.exc.HTTPError.__init__(self, detail=detail) serializer = serializers.XMLResponseSerializer() serializer.default(self, self.get_unserialized_body()) <|end_body_0|> <|body_start_1|> if self.detail: message = ':'.join([self.explanation, self.detail]) ...
webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used directly, instead use the subclasses defined below which map to AWS API errors.
HeatAPIException
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HeatAPIException: """webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used directly, instead use the subclasses defined ...
stack_v2_sparse_classes_36k_train_000004
10,462
permissive
[ { "docstring": "Overload HTTPError constructor to create a default serialized body. This is required because not all error responses are processed by the wsgi controller (such as auth errors), which are further up the paste pipeline. We serialize in XML by default (as AWS does).", "name": "__init__", "s...
2
null
Implement the Python class `HeatAPIException` described below. Class description: webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used direct...
Implement the Python class `HeatAPIException` described below. Class description: webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used direct...
aad322c705b338af52cccbbe1d100e9e885c08ea
<|skeleton|> class HeatAPIException: """webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used directly, instead use the subclasses defined ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HeatAPIException: """webob HTTPError subclass that creates a serialized body. Subclass webob HTTPError so we can correctly serialize the wsgi response into the http response body, using the format specified by the request. Note this should not be used directly, instead use the subclasses defined below which m...
the_stack_v2_python_sparse
heat/api/aws/exception.py
containers-kraken/heat
train
1
fad7bcfc3cad488dcc8ecfc419219d994157af07
[ "self.matrix = [[0 for j in range(len(matrix[0]) + 1)] for i in range(len(matrix))]\nfor i in range(len(matrix)):\n sum_1 = 0\n for j in range(len(matrix[0]))[::-1]:\n sum_1 += matrix[i][j]\n self.matrix[i][j] = sum_1\nprint(self.matrix)", "sum_1 = 0\nfor i in range(row1, row2 + 1):\n sum_1...
<|body_start_0|> self.matrix = [[0 for j in range(len(matrix[0]) + 1)] for i in range(len(matrix))] for i in range(len(matrix)): sum_1 = 0 for j in range(len(matrix[0]))[::-1]: sum_1 += matrix[i][j] self.matrix[i][j] = sum_1 print(self.matr...
NumMatrix
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 196ms""" <|body_1|> <|end_skeleton|> <|body_sta...
stack_v2_sparse_classes_36k_train_000005
2,823
no_license
[ { "docstring": ":type matrix: List[List[int]]", "name": "__init__", "signature": "def __init__(self, matrix)" }, { "docstring": ":type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 196ms", "name": "sumRegion", "signature": "def sumRegion(self, row1, col1, row2, co...
2
null
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
Implement the Python class `NumMatrix` described below. Class description: Implement the NumMatrix class. Method signatures and docstrings: - def __init__(self, matrix): :type matrix: List[List[int]] - def sumRegion(self, row1, col1, row2, col2): :type row1: int :type col1: int :type row2: int :type col2: int :rtype:...
679a2b246b8b6bb7fc55ed1c8096d3047d6d4461
<|skeleton|> class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" <|body_0|> def sumRegion(self, row1, col1, row2, col2): """:type row1: int :type col1: int :type row2: int :type col2: int :rtype: int 196ms""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NumMatrix: def __init__(self, matrix): """:type matrix: List[List[int]]""" self.matrix = [[0 for j in range(len(matrix[0]) + 1)] for i in range(len(matrix))] for i in range(len(matrix)): sum_1 = 0 for j in range(len(matrix[0]))[::-1]: sum_1 += ma...
the_stack_v2_python_sparse
RangeSumQuery2D_Immutable_MID_304.py
953250587/leetcode-python
train
2
999a61f93d2581b13955c545b04f3e7f65dfdbb5
[ "if self.barcamp is None:\n return self.render(page=self.page, slug='___', page_slug=page_slug)\nelse:\n return self.render(page=self.page, page_slug=page_slug, **self.barcamp)", "filename = self.request.headers.get('X-File-Name', 'unbekannt')\ncontent_type = self.request.headers.get('X-Mime-Type', 'applica...
<|body_start_0|> if self.barcamp is None: return self.render(page=self.page, slug='___', page_slug=page_slug) else: return self.render(page=self.page, page_slug=page_slug, **self.barcamp) <|end_body_0|> <|body_start_1|> filename = self.request.headers.get('X-File-Name', ...
a view for uploading a page image (display is separate because the URL might be served directly by the web server
ImageUpload
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ImageUpload: """a view for uploading a page image (display is separate because the URL might be served directly by the web server""" def get(self, slug=None, page_slug=None): """return the contents for the image upload view""" <|body_0|> def post(self, slug=None, page_sl...
stack_v2_sparse_classes_36k_train_000006
3,230
permissive
[ { "docstring": "return the contents for the image upload view", "name": "get", "signature": "def get(self, slug=None, page_slug=None)" }, { "docstring": "upload an image for a page", "name": "post", "signature": "def post(self, slug=None, page_slug=None)" } ]
2
stack_v2_sparse_classes_30k_train_017657
Implement the Python class `ImageUpload` described below. Class description: a view for uploading a page image (display is separate because the URL might be served directly by the web server Method signatures and docstrings: - def get(self, slug=None, page_slug=None): return the contents for the image upload view - d...
Implement the Python class `ImageUpload` described below. Class description: a view for uploading a page image (display is separate because the URL might be served directly by the web server Method signatures and docstrings: - def get(self, slug=None, page_slug=None): return the contents for the image upload view - d...
9b45664e46c451b2cbe00bb55583b043e769083d
<|skeleton|> class ImageUpload: """a view for uploading a page image (display is separate because the URL might be served directly by the web server""" def get(self, slug=None, page_slug=None): """return the contents for the image upload view""" <|body_0|> def post(self, slug=None, page_sl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ImageUpload: """a view for uploading a page image (display is separate because the URL might be served directly by the web server""" def get(self, slug=None, page_slug=None): """return the contents for the image upload view""" if self.barcamp is None: return self.render(page=s...
the_stack_v2_python_sparse
camper/pages/images.py
comlounge/camper
train
14
b3dba2e092cc0c1ebbaacd99286be1a6a7cbea57
[ "self.enterTuangou(self.s_name)\nself.swipe_to_down(1)\nsleep(2)\nself.assertTrue(self.check_icon(self.s_name))", "self.enterTuangou(self.s_name)\nself.swipe_to_down(1)\nself.enter_fist_goods_datil_page(self.s_name)\ns_goods_title = self.setCollected(self.s_name)\nself.press_back_by_keycode()\nself.press_back()\n...
<|body_start_0|> self.enterTuangou(self.s_name) self.swipe_to_down(1) sleep(2) self.assertTrue(self.check_icon(self.s_name)) <|end_body_0|> <|body_start_1|> self.enterTuangou(self.s_name) self.swipe_to_down(1) self.enter_fist_goods_datil_page(self.s_name) ...
TChaoJi
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TChaoJi: def test_goods_icon(self): """超级团_团购标签验证""" <|body_0|> def test_collect(self): """超级团_收藏功能""" <|body_1|> def test_customer_service(self): """超级团_发送客服消息验证""" <|body_2|> def test_separately_buy(self): """超级团_去参团_""" ...
stack_v2_sparse_classes_36k_train_000007
1,854
no_license
[ { "docstring": "超级团_团购标签验证", "name": "test_goods_icon", "signature": "def test_goods_icon(self)" }, { "docstring": "超级团_收藏功能", "name": "test_collect", "signature": "def test_collect(self)" }, { "docstring": "超级团_发送客服消息验证", "name": "test_customer_service", "signature": "de...
4
stack_v2_sparse_classes_30k_train_018265
Implement the Python class `TChaoJi` described below. Class description: Implement the TChaoJi class. Method signatures and docstrings: - def test_goods_icon(self): 超级团_团购标签验证 - def test_collect(self): 超级团_收藏功能 - def test_customer_service(self): 超级团_发送客服消息验证 - def test_separately_buy(self): 超级团_去参团_
Implement the Python class `TChaoJi` described below. Class description: Implement the TChaoJi class. Method signatures and docstrings: - def test_goods_icon(self): 超级团_团购标签验证 - def test_collect(self): 超级团_收藏功能 - def test_customer_service(self): 超级团_发送客服消息验证 - def test_separately_buy(self): 超级团_去参团_ <|skeleton|> cla...
b2066139eb0723eff69d971589b283b4b776c84c
<|skeleton|> class TChaoJi: def test_goods_icon(self): """超级团_团购标签验证""" <|body_0|> def test_collect(self): """超级团_收藏功能""" <|body_1|> def test_customer_service(self): """超级团_发送客服消息验证""" <|body_2|> def test_separately_buy(self): """超级团_去参团_""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TChaoJi: def test_goods_icon(self): """超级团_团购标签验证""" self.enterTuangou(self.s_name) self.swipe_to_down(1) sleep(2) self.assertTrue(self.check_icon(self.s_name)) def test_collect(self): """超级团_收藏功能""" self.enterTuangou(self.s_name) self.swipe...
the_stack_v2_python_sparse
TestCase/4_5/TC_tuan_gou/test_chao_ji.py
testerSunshine/auto_md
train
4
8205a16ff6a512078836ce840439b8ea4b515f76
[ "self.check_parameters(params)\nct = np.cos(params[0] / 2)\nst = np.sin(params[0] / 2)\ncp = np.cos(params[1])\nsp = np.sin(params[1])\ncl = np.cos(params[2])\nsl = np.sin(params[2])\ncg = np.cos(params[3])\nsg = np.sin(params[3])\nel = cl + 1j * sl\nep = cp + 1j * sp\neg = cg + 1j * sg\nreturn UnitaryMatrix([[1, 0...
<|body_start_0|> self.check_parameters(params) ct = np.cos(params[0] / 2) st = np.sin(params[0] / 2) cp = np.cos(params[1]) sp = np.sin(params[1]) cl = np.cos(params[2]) sl = np.sin(params[2]) cg = np.cos(params[3]) sg = np.sin(params[3]) e...
A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda)}sin(\\frac{\\theta}{2}) \\\\ 0 & 0 & \\exp{i(\\gamma + \\phi)}sin(\\fra...
CUGate
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CUGate: """A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda)}sin(\\frac{\\theta}{2}) \\\\ 0 & 0 & ...
stack_v2_sparse_classes_36k_train_000008
3,439
permissive
[ { "docstring": "Return the unitary for this gate, see :class:`Unitary` for more.", "name": "get_unitary", "signature": "def get_unitary(self, params: RealVector=[]) -> UnitaryMatrix" }, { "docstring": "Return the gradient for this gate. See :class:`DifferentiableUnitary` for more info.", "na...
2
null
Implement the Python class `CUGate` described below. Class description: A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda...
Implement the Python class `CUGate` described below. Class description: A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda...
c89112d15072e8ffffb68cf1757b184e2aeb3dc8
<|skeleton|> class CUGate: """A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda)}sin(\\frac{\\theta}{2}) \\\\ 0 & 0 & ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CUGate: """A gate representing an arbitrary controlled rotation. It is given by the following parameterized unitary: .. math:: \\begin{pmatrix} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & \\exp{i\\gamma}cos(\\frac{\\theta}{2}) & -\\exp{i(\\gamma + \\lambda)}sin(\\frac{\\theta}{2}) \\\\ 0 & 0 & \\exp{i(\\gam...
the_stack_v2_python_sparse
bqskit/ir/gates/parameterized/cu.py
BQSKit/bqskit
train
54
4f8978fd0fcefd9e86a2f524e432f64d393f19d9
[ "if DEBUG and dist.is_initialized() and (dist.get_rank() == 0):\n print('DEBUG trigger fwd')\nctx.save_for_backward(w, trigger_tensor)\nreturn w", "if DEBUG and dist.is_initialized() and (dist.get_rank() == 0):\n print('DEBUG trigger bwd')\nassert len(args) == 1\nw, trigger = ctx.saved_tensors\nassert w.req...
<|body_start_0|> if DEBUG and dist.is_initialized() and (dist.get_rank() == 0): print('DEBUG trigger fwd') ctx.save_for_backward(w, trigger_tensor) return w <|end_body_0|> <|body_start_1|> if DEBUG and dist.is_initialized() and (dist.get_rank() == 0): print('DEBU...
A backward trigger function.
BackwardTriggerFn
[ "Apache-2.0", "MIT", "BSD-3-Clause", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BackwardTriggerFn: """A backward trigger function.""" def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor: """We take a weight tensor and the trigger as inputs and output the weight directly.""" <|body_0|> def backward(ctx: Any, *args: An...
stack_v2_sparse_classes_36k_train_000009
25,261
permissive
[ { "docstring": "We take a weight tensor and the trigger as inputs and output the weight directly.", "name": "forward", "signature": "def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor" }, { "docstring": "We return zero grad for the trigger only.", "name": "b...
2
null
Implement the Python class `BackwardTriggerFn` described below. Class description: A backward trigger function. Method signatures and docstrings: - def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor: We take a weight tensor and the trigger as inputs and output the weight directly. - ...
Implement the Python class `BackwardTriggerFn` described below. Class description: A backward trigger function. Method signatures and docstrings: - def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor: We take a weight tensor and the trigger as inputs and output the weight directly. - ...
164cc0f3170b4a3951dd84dda29c3e1504ac4d6e
<|skeleton|> class BackwardTriggerFn: """A backward trigger function.""" def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor: """We take a weight tensor and the trigger as inputs and output the weight directly.""" <|body_0|> def backward(ctx: Any, *args: An...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BackwardTriggerFn: """A backward trigger function.""" def forward(ctx: Any, w: torch.Tensor, trigger_tensor: torch.Tensor) -> torch.Tensor: """We take a weight tensor and the trigger as inputs and output the weight directly.""" if DEBUG and dist.is_initialized() and (dist.get_rank() == 0)...
the_stack_v2_python_sparse
fairscale/experimental/nn/mevo.py
facebookresearch/fairscale
train
2,553
331e2ff3c5f8d31e5f2a7d34eded954dca5e6759
[ "bert = BertModel.shared(config=config, name='bert')\nsequence_output, pooled_output = bert(input_ids, input_mask, type_ids, deterministic=deterministic)\nif masked_lm_positions is None:\n return (sequence_output, pooled_output)\nmasked_lm_input = GatherIndexes(sequence_output, masked_lm_positions)\nmasked_lm_in...
<|body_start_0|> bert = BertModel.shared(config=config, name='bert') sequence_output, pooled_output = bert(input_ids, input_mask, type_ids, deterministic=deterministic) if masked_lm_positions is None: return (sequence_output, pooled_output) masked_lm_input = GatherIndexes(seq...
Bert model for pre-training.
BertForPreTraining
[ "CC-BY-4.0", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BertForPreTraining: """Bert model for pre-training.""" def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, deterministic=False): """Applies BERT for pre-training.""" <|...
stack_v2_sparse_classes_36k_train_000010
8,883
permissive
[ { "docstring": "Applies BERT for pre-training.", "name": "apply", "signature": "def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, deterministic=False)" }, { "docstring": "Computes the pr...
2
stack_v2_sparse_classes_30k_train_002941
Implement the Python class `BertForPreTraining` described below. Class description: Bert model for pre-training. Method signatures and docstrings: - def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, determini...
Implement the Python class `BertForPreTraining` described below. Class description: Bert model for pre-training. Method signatures and docstrings: - def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, determini...
0714e9a5a3934d922c0b9dd017943a8e511eb5bc
<|skeleton|> class BertForPreTraining: """Bert model for pre-training.""" def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, deterministic=False): """Applies BERT for pre-training.""" <|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BertForPreTraining: """Bert model for pre-training.""" def apply(self, input_ids, input_mask, type_ids, masked_lm_positions=None, masked_lm_labels=None, masked_lm_weights=None, next_sentence_labels=None, *, config, deterministic=False): """Applies BERT for pre-training.""" bert = BertMode...
the_stack_v2_python_sparse
flax_models/bert/models.py
pdybczak/google-research
train
1
782c58f42d65ffbaa99555596eca909eb789172e
[ "if context is None:\n context = {}\nres = super(AccountMoveLineReconcileWriteoff, self).trans_rec_reconcile_partial(cr, uid, ids, context=context)\nself.trans_rec_reconcile_tax(cr, uid, context.get('active_ids', []), context=context)\nreturn res", "if context is None:\n context = {}\nperiod_obj = self.pool...
<|body_start_0|> if context is None: context = {} res = super(AccountMoveLineReconcileWriteoff, self).trans_rec_reconcile_partial(cr, uid, ids, context=context) self.trans_rec_reconcile_tax(cr, uid, context.get('active_ids', []), context=context) return res <|end_body_0|> <|...
AccountMoveLineReconcileWriteoff
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AccountMoveLineReconcileWriteoff: def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): """This function is overwrite because we need reconcile also the aml of taxes when is reconcile partial""" <|body_0|> def trans_rec_reconcile(self, cr, uid, ids, context=None...
stack_v2_sparse_classes_36k_train_000011
4,750
no_license
[ { "docstring": "This function is overwrite because we need reconcile also the aml of taxes when is reconcile partial", "name": "trans_rec_reconcile_partial", "signature": "def trans_rec_reconcile_partial(self, cr, uid, ids, context=None)" }, { "docstring": "This function is overwrite because we ...
3
null
Implement the Python class `AccountMoveLineReconcileWriteoff` described below. Class description: Implement the AccountMoveLineReconcileWriteoff class. Method signatures and docstrings: - def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): This function is overwrite because we need reconcile also the a...
Implement the Python class `AccountMoveLineReconcileWriteoff` described below. Class description: Implement the AccountMoveLineReconcileWriteoff class. Method signatures and docstrings: - def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): This function is overwrite because we need reconcile also the a...
511dc410b4eba1f8ea939c6af02a5adea5122c92
<|skeleton|> class AccountMoveLineReconcileWriteoff: def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): """This function is overwrite because we need reconcile also the aml of taxes when is reconcile partial""" <|body_0|> def trans_rec_reconcile(self, cr, uid, ids, context=None...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AccountMoveLineReconcileWriteoff: def trans_rec_reconcile_partial(self, cr, uid, ids, context=None): """This function is overwrite because we need reconcile also the aml of taxes when is reconcile partial""" if context is None: context = {} res = super(AccountMoveLineReconc...
the_stack_v2_python_sparse
account_voucher_tax/account_reconcile.py
yelizariev/addons-vauxoo
train
3
d8a8fff0da5e5825219ba76be5d2832f41b8caee
[ "self.master = master\nself.mode = Tk.StringVar()\nself.mode_list = ['Create Level', 'Edit Existing Level']\nself.mode_string = ''\nself.lw = Tk.StringVar()\nself.newFrame = None\nself.createWidgets()", "textLabel = Tk.Label(self.master, text='Select Editor Mode:')\ndropDown = Tk.OptionMenu(self.master, self.mode...
<|body_start_0|> self.master = master self.mode = Tk.StringVar() self.mode_list = ['Create Level', 'Edit Existing Level'] self.mode_string = '' self.lw = Tk.StringVar() self.newFrame = None self.createWidgets() <|end_body_0|> <|body_start_1|> textLabel = ...
mainGUI
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class mainGUI: def __init__(self, master): """Initialisation params: master -> root window""" <|body_0|> def createWidgets(self): """Create widgets for frontend. The widgets are: -> An OptionMenu for choosing between the NEW and EDIT modes -> A field for entering level wid...
stack_v2_sparse_classes_36k_train_000012
3,921
no_license
[ { "docstring": "Initialisation params: master -> root window", "name": "__init__", "signature": "def __init__(self, master)" }, { "docstring": "Create widgets for frontend. The widgets are: -> An OptionMenu for choosing between the NEW and EDIT modes -> A field for entering level width -> Variou...
6
stack_v2_sparse_classes_30k_train_011365
Implement the Python class `mainGUI` described below. Class description: Implement the mainGUI class. Method signatures and docstrings: - def __init__(self, master): Initialisation params: master -> root window - def createWidgets(self): Create widgets for frontend. The widgets are: -> An OptionMenu for choosing betw...
Implement the Python class `mainGUI` described below. Class description: Implement the mainGUI class. Method signatures and docstrings: - def __init__(self, master): Initialisation params: master -> root window - def createWidgets(self): Create widgets for frontend. The widgets are: -> An OptionMenu for choosing betw...
b5ef6160b958ece204edf68bad21f8ae39441fa7
<|skeleton|> class mainGUI: def __init__(self, master): """Initialisation params: master -> root window""" <|body_0|> def createWidgets(self): """Create widgets for frontend. The widgets are: -> An OptionMenu for choosing between the NEW and EDIT modes -> A field for entering level wid...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class mainGUI: def __init__(self, master): """Initialisation params: master -> root window""" self.master = master self.mode = Tk.StringVar() self.mode_list = ['Create Level', 'Edit Existing Level'] self.mode_string = '' self.lw = Tk.StringVar() self.newFrame ...
the_stack_v2_python_sparse
worldShifter/levelEditor/ed_GUI.py
sanskarchand/python-projects
train
0
c6bc26e4b89f188750933739a534712cad0b282c
[ "result = get_coverage._get_oss_fuzz_latest_cov_report_info(self.PROJECT)\nself.assertEqual(result, {'coverage': 1})\nmock_error.assert_not_called()\nmock_get_json_from_url.assert_called_with(self.LATEST_REPORT_INFO_URL)", "result = get_coverage._get_oss_fuzz_latest_cov_report_info('project')\nself.assertIsNone(r...
<|body_start_0|> result = get_coverage._get_oss_fuzz_latest_cov_report_info(self.PROJECT) self.assertEqual(result, {'coverage': 1}) mock_error.assert_not_called() mock_get_json_from_url.assert_called_with(self.LATEST_REPORT_INFO_URL) <|end_body_0|> <|body_start_1|> result = get_...
Tests that _get_oss_fuzz_latest_cov_report_info works as intended.
GetOssFuzzLatestCovReportInfo
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GetOssFuzzLatestCovReportInfo: """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error): """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_000013
9,610
permissive
[ { "docstring": "Tests that _get_oss_fuzz_latest_cov_report_info works as intended.", "name": "test_get_oss_fuzz_latest_cov_report_info", "signature": "def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error)" }, { "docstring": "Tests that _get_oss_fuzz_latest_cov_re...
2
stack_v2_sparse_classes_30k_train_016941
Implement the Python class `GetOssFuzzLatestCovReportInfo` described below. Class description: Tests that _get_oss_fuzz_latest_cov_report_info works as intended. Method signatures and docstrings: - def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error): Tests that _get_oss_fuzz_latest_...
Implement the Python class `GetOssFuzzLatestCovReportInfo` described below. Class description: Tests that _get_oss_fuzz_latest_cov_report_info works as intended. Method signatures and docstrings: - def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error): Tests that _get_oss_fuzz_latest_...
f0275421f84b8f80ee767fb9230134ac97cb687b
<|skeleton|> class GetOssFuzzLatestCovReportInfo: """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error): """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GetOssFuzzLatestCovReportInfo: """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" def test_get_oss_fuzz_latest_cov_report_info(self, mock_get_json_from_url, mock_error): """Tests that _get_oss_fuzz_latest_cov_report_info works as intended.""" result = get_coverage._g...
the_stack_v2_python_sparse
infra/cifuzz/get_coverage_test.py
google/oss-fuzz
train
9,438
78eb557cc6892e4804fda13c4dd94944f6d59141
[ "max_len = 0\nfor i in range(len(string)):\n for j in range(i, len(string)):\n curr = string[i:j + 1]\n if len(curr) == len(set(curr)):\n max_len = max(max_len, j - i + 1)\nreturn max_len", "letters = set()\nmax_len = 0\ni = 0\nfor j, char in enumerate(string):\n while letters and c...
<|body_start_0|> max_len = 0 for i in range(len(string)): for j in range(i, len(string)): curr = string[i:j + 1] if len(curr) == len(set(curr)): max_len = max(max_len, j - i + 1) return max_len <|end_body_0|> <|body_start_1|> ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longest_nonrepeat_brute(self, string): """Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(string).""" <|body_0|> def longest_nonrepeat(self, string): """Returns length ...
stack_v2_sparse_classes_36k_train_000014
3,247
no_license
[ { "docstring": "Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(string).", "name": "longest_nonrepeat_brute", "signature": "def longest_nonrepeat_brute(self, string)" }, { "docstring": "Returns length of longest...
4
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longest_nonrepeat_brute(self, string): Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(st...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longest_nonrepeat_brute(self, string): Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(st...
71b722ddfe8da04572e527b055cf8723d5c87bbf
<|skeleton|> class Solution: def longest_nonrepeat_brute(self, string): """Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(string).""" <|body_0|> def longest_nonrepeat(self, string): """Returns length ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longest_nonrepeat_brute(self, string): """Returns length of longest nonrepeating substring. Brute force algorithm. Time complexity: O(n ^ 2). Space complexity: O(1), n is len(string).""" max_len = 0 for i in range(len(string)): for j in range(i, len(string)): ...
the_stack_v2_python_sparse
Hashing/longest_nonrepeating_substring.py
vladn90/Algorithms
train
0
fdcbeca30465d73d5f31219fb3b96b0d6c353a5c
[ "settings.RATE_SERVICE = 'forex'\nfrom_date = datetime.date(year=2020, month=7, day=20)\nto_date = datetime.date(year=2020, month=7, day=25)\nRate.objects.fetch_rates(base_currency=self.base_currency, date_obj=from_date, to_obj=to_date)\nself.user, created = User.objects.get_or_create(username='test', email='test@i...
<|body_start_0|> settings.RATE_SERVICE = 'forex' from_date = datetime.date(year=2020, month=7, day=20) to_date = datetime.date(year=2020, month=7, day=25) Rate.objects.fetch_rates(base_currency=self.base_currency, date_obj=from_date, to_obj=to_date) self.user, created = User.obje...
Test Rate conversion API
RateConverterAPITest
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RateConverterAPITest: """Test Rate conversion API""" def setUp(self) -> None: """setup test environment""" <|body_0|> def test_convert_request(self): """Test conversion request""" <|body_1|> def test_convert_batch_request(self): """Test batch...
stack_v2_sparse_classes_36k_train_000015
34,628
permissive
[ { "docstring": "setup test environment", "name": "setUp", "signature": "def setUp(self) -> None" }, { "docstring": "Test conversion request", "name": "test_convert_request", "signature": "def test_convert_request(self)" }, { "docstring": "Test batch conversion", "name": "test...
4
stack_v2_sparse_classes_30k_train_020257
Implement the Python class `RateConverterAPITest` described below. Class description: Test Rate conversion API Method signatures and docstrings: - def setUp(self) -> None: setup test environment - def test_convert_request(self): Test conversion request - def test_convert_batch_request(self): Test batch conversion - d...
Implement the Python class `RateConverterAPITest` described below. Class description: Test Rate conversion API Method signatures and docstrings: - def setUp(self) -> None: setup test environment - def test_convert_request(self): Test conversion request - def test_convert_batch_request(self): Test batch conversion - d...
23cc075377d47ac631634cd71fd0e7d6b0a57bad
<|skeleton|> class RateConverterAPITest: """Test Rate conversion API""" def setUp(self) -> None: """setup test environment""" <|body_0|> def test_convert_request(self): """Test conversion request""" <|body_1|> def test_convert_batch_request(self): """Test batch...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RateConverterAPITest: """Test Rate conversion API""" def setUp(self) -> None: """setup test environment""" settings.RATE_SERVICE = 'forex' from_date = datetime.date(year=2020, month=7, day=20) to_date = datetime.date(year=2020, month=7, day=25) Rate.objects.fetch_r...
the_stack_v2_python_sparse
src/geocurrency/rates/tests.py
fmeurou/geocurrency
train
5
ae09d0d5153be3695db55eafd04bfd8af1b5c315
[ "ImageProcessor.__init__(self, **kwargs)\nself._max_cache_size = max_cache_size\nself._max_days_bias = max_days_bias\nself._max_days_dark = max_days_dark\nself._max_days_flat = max_days_flat\nself._require_bias = require_bias\nself._require_dark = require_dark\nself._require_flat = require_flat\nself._archive = get...
<|body_start_0|> ImageProcessor.__init__(self, **kwargs) self._max_cache_size = max_cache_size self._max_days_bias = max_days_bias self._max_days_dark = max_days_dark self._max_days_flat = max_days_flat self._require_bias = require_bias self._require_dark = requir...
Calibrate an image.
Calibration
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Calibration: """Calibrate an image.""" def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: bool=True, max_days_bias: Optional[float]=None, max_days_dark: Optional[float]=None, max_days_flat: Optio...
stack_v2_sparse_classes_36k_train_000016
6,281
permissive
[ { "docstring": "Init a new image calibration pipeline step. Args: archive: Archive to fetch calibration frames from.", "name": "__init__", "signature": "def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: boo...
3
null
Implement the Python class `Calibration` described below. Class description: Calibrate an image. Method signatures and docstrings: - def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: bool=True, max_days_bias: Optional[fl...
Implement the Python class `Calibration` described below. Class description: Calibrate an image. Method signatures and docstrings: - def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: bool=True, max_days_bias: Optional[fl...
2d7a06e5485b61b6ca7e51d99b08651ea6021086
<|skeleton|> class Calibration: """Calibrate an image.""" def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: bool=True, max_days_bias: Optional[float]=None, max_days_dark: Optional[float]=None, max_days_flat: Optio...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Calibration: """Calibrate an image.""" def __init__(self, archive: Union[Dict[str, Any], Archive], max_cache_size: int=20, require_bias: bool=True, require_dark: bool=True, require_flat: bool=True, max_days_bias: Optional[float]=None, max_days_dark: Optional[float]=None, max_days_flat: Optional[float]=No...
the_stack_v2_python_sparse
pyobs/images/processors/misc/calibration.py
pyobs/pyobs-core
train
9
448cdc16360c560a94c53289a18ea83413bb1e6f
[ "term1 = tokens[indeks_token_pertama]\nterm2 = tokens[indeks_token_pertama + 1]\nreturn ' '.join([term1, term2])", "vektor_tf_bigram = {}\nsz = len(tokens) - 1\nfor i in range(sz):\n bigram_token = self.__get_term_bigram(i, tokens)\n if bigram_token in vektor_tf_bigram:\n vektor_tf_bigram[bigram_toke...
<|body_start_0|> term1 = tokens[indeks_token_pertama] term2 = tokens[indeks_token_pertama + 1] return ' '.join([term1, term2]) <|end_body_0|> <|body_start_1|> vektor_tf_bigram = {} sz = len(tokens) - 1 for i in range(sz): bigram_token = self.__get_term_bigram...
Bertugas Menghitung TF pada term Bigram
TfBigram
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TfBigram: """Bertugas Menghitung TF pada term Bigram""" def __get_term_bigram(self, indeks_token_pertama: int, tokens: list): """Menggabungkan Dua String (Bigram)""" <|body_0|> def calculate(self, tokens: list): """Mengembalikan Vektor TF-Bigram (Tipe data dictio...
stack_v2_sparse_classes_36k_train_000017
1,423
no_license
[ { "docstring": "Menggabungkan Dua String (Bigram)", "name": "__get_term_bigram", "signature": "def __get_term_bigram(self, indeks_token_pertama: int, tokens: list)" }, { "docstring": "Mengembalikan Vektor TF-Bigram (Tipe data dictionary)", "name": "calculate", "signature": "def calculate...
2
stack_v2_sparse_classes_30k_train_020570
Implement the Python class `TfBigram` described below. Class description: Bertugas Menghitung TF pada term Bigram Method signatures and docstrings: - def __get_term_bigram(self, indeks_token_pertama: int, tokens: list): Menggabungkan Dua String (Bigram) - def calculate(self, tokens: list): Mengembalikan Vektor TF-Big...
Implement the Python class `TfBigram` described below. Class description: Bertugas Menghitung TF pada term Bigram Method signatures and docstrings: - def __get_term_bigram(self, indeks_token_pertama: int, tokens: list): Menggabungkan Dua String (Bigram) - def calculate(self, tokens: list): Mengembalikan Vektor TF-Big...
9742c193251303334ef805c8c94eb075afad777f
<|skeleton|> class TfBigram: """Bertugas Menghitung TF pada term Bigram""" def __get_term_bigram(self, indeks_token_pertama: int, tokens: list): """Menggabungkan Dua String (Bigram)""" <|body_0|> def calculate(self, tokens: list): """Mengembalikan Vektor TF-Bigram (Tipe data dictio...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TfBigram: """Bertugas Menghitung TF pada term Bigram""" def __get_term_bigram(self, indeks_token_pertama: int, tokens: list): """Menggabungkan Dua String (Bigram)""" term1 = tokens[indeks_token_pertama] term2 = tokens[indeks_token_pertama + 1] return ' '.join([term1, term2...
the_stack_v2_python_sparse
ujian_app/penilaian/pemrosesan_teks/ngram.py
anh4rs/Aplikasi-Penilaian-Otomatis-Esai-BI
train
0
ef473b65772d1e5a6fdc756a8353b6bb9e6c6d71
[ "super(DisneyBlock, self).__init__()\nself.f1z = torch.nn.Linear(zD, outD, bias=True)\nself.f1o = torch.nn.Linear(oD, outD, bias=True)\nself.f2 = torch.nn.Linear(outD, outD, bias=True)\nself.activation = torch.nn.ReLU()", "out = self.f1o(o).add_(self.f1z(z))\nout = self.activation(out)\nout = self.f2(out)\nout = ...
<|body_start_0|> super(DisneyBlock, self).__init__() self.f1z = torch.nn.Linear(zD, outD, bias=True) self.f1o = torch.nn.Linear(oD, outD, bias=True) self.f2 = torch.nn.Linear(outD, outD, bias=True) self.activation = torch.nn.ReLU() <|end_body_0|> <|body_start_1|> out = s...
DisneyBlock
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DisneyBlock: def __init__(self, oD, zD, outD): """:param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension of ouput of current block""" <|body_0|> def forward(self, o, z): """:param o: ou...
stack_v2_sparse_classes_36k_train_000018
949
permissive
[ { "docstring": ":param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension of ouput of current block", "name": "__init__", "signature": "def __init__(self, oD, zD, outD)" }, { "docstring": ":param o: output of the prev...
2
stack_v2_sparse_classes_30k_train_006832
Implement the Python class `DisneyBlock` described below. Class description: Implement the DisneyBlock class. Method signatures and docstrings: - def __init__(self, oD, zD, outD): :param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension o...
Implement the Python class `DisneyBlock` described below. Class description: Implement the DisneyBlock class. Method signatures and docstrings: - def __init__(self, oD, zD, outD): :param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension o...
eeb490b5e6afd7f05049c8aca90a5c2e6f253726
<|skeleton|> class DisneyBlock: def __init__(self, oD, zD, outD): """:param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension of ouput of current block""" <|body_0|> def forward(self, o, z): """:param o: ou...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DisneyBlock: def __init__(self, oD, zD, outD): """:param oD: Dimension of output of the previous block :param zD: Dimension of one layer of hierarchical descriptor :param outD: Dimension of ouput of current block""" super(DisneyBlock, self).__init__() self.f1z = torch.nn.Linear(zD, out...
the_stack_v2_python_sparse
DeepestScatter_Train/Disney/DisneyBlock.py
marsermd/DeepestScatter
train
15
32b6a1a2bae60c259386a41216e059a38378b5f0
[ "b = boto_init_s3(bucket)\nif b:\n k = b.get_key(path_bucket)\n if not k:\n k = b.new_key(path_bucket)\n k.set_contents_from_string(content)\n if file_type == 'profile':\n try:\n old_pix = ProfilePicture.objects.get(is_current=True, user_id=user)\n ...
<|body_start_0|> b = boto_init_s3(bucket) if b: k = b.get_key(path_bucket) if not k: k = b.new_key(path_bucket) k.set_contents_from_string(content) if file_type == 'profile': try: old_pix ...
File Management. Up/Download
FileManager
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileManager: """File Management. Up/Download""" def store(bucket, path_bucket, content, filename='', file_type=None, user=None): """Store the file into S3. Return Something if success/ False if not""" <|body_0|> def get_profile_picture(user): """Get a file from S...
stack_v2_sparse_classes_36k_train_000019
2,996
no_license
[ { "docstring": "Store the file into S3. Return Something if success/ False if not", "name": "store", "signature": "def store(bucket, path_bucket, content, filename='', file_type=None, user=None)" }, { "docstring": "Get a file from S3", "name": "get_profile_picture", "signature": "def get...
3
stack_v2_sparse_classes_30k_val_000799
Implement the Python class `FileManager` described below. Class description: File Management. Up/Download Method signatures and docstrings: - def store(bucket, path_bucket, content, filename='', file_type=None, user=None): Store the file into S3. Return Something if success/ False if not - def get_profile_picture(use...
Implement the Python class `FileManager` described below. Class description: File Management. Up/Download Method signatures and docstrings: - def store(bucket, path_bucket, content, filename='', file_type=None, user=None): Store the file into S3. Return Something if success/ False if not - def get_profile_picture(use...
840f31ff203457fa12ba2ac20f3e4ee07a3d3410
<|skeleton|> class FileManager: """File Management. Up/Download""" def store(bucket, path_bucket, content, filename='', file_type=None, user=None): """Store the file into S3. Return Something if success/ False if not""" <|body_0|> def get_profile_picture(user): """Get a file from S...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileManager: """File Management. Up/Download""" def store(bucket, path_bucket, content, filename='', file_type=None, user=None): """Store the file into S3. Return Something if success/ False if not""" b = boto_init_s3(bucket) if b: k = b.get_key(path_bucket) ...
the_stack_v2_python_sparse
files_manager/models.py
gurkarangulati/CMSYapster
train
0
6a3d3141ebb96bb6a2cc8f12949015f363be51d2
[ "queryset = InterviewSchedule.objects.filter(is_direct_hire=True, project=pk).order_by('-id')\nqueryset = self.filter_queryset(queryset)\npage = self.paginate_queryset(queryset)\nif page is not None:\n serializer = self.get_serializer(page, many=True)\n return self.get_paginated_response(serializer.data)\nser...
<|body_start_0|> queryset = InterviewSchedule.objects.filter(is_direct_hire=True, project=pk).order_by('-id') queryset = self.filter_queryset(queryset) page = self.paginate_queryset(queryset) if page is not None: serializer = self.get_serializer(page, many=True) r...
Employee direct hire response
EmployeeDirectHireResponseViewSet
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmployeeDirectHireResponseViewSet: """Employee direct hire response""" def project_interview_response(self, request, pk=None): """Endpoint for project interview responses""" <|body_0|> def send_appointment(self, request, pk=None): """Endpoint for direct hire empl...
stack_v2_sparse_classes_36k_train_000020
49,113
no_license
[ { "docstring": "Endpoint for project interview responses", "name": "project_interview_response", "signature": "def project_interview_response(self, request, pk=None)" }, { "docstring": "Endpoint for direct hire employee", "name": "send_appointment", "signature": "def send_appointment(sel...
4
stack_v2_sparse_classes_30k_train_002011
Implement the Python class `EmployeeDirectHireResponseViewSet` described below. Class description: Employee direct hire response Method signatures and docstrings: - def project_interview_response(self, request, pk=None): Endpoint for project interview responses - def send_appointment(self, request, pk=None): Endpoint...
Implement the Python class `EmployeeDirectHireResponseViewSet` described below. Class description: Employee direct hire response Method signatures and docstrings: - def project_interview_response(self, request, pk=None): Endpoint for project interview responses - def send_appointment(self, request, pk=None): Endpoint...
cf3481991c9cfaba44d8ecc17f5b205ae5591dd0
<|skeleton|> class EmployeeDirectHireResponseViewSet: """Employee direct hire response""" def project_interview_response(self, request, pk=None): """Endpoint for project interview responses""" <|body_0|> def send_appointment(self, request, pk=None): """Endpoint for direct hire empl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmployeeDirectHireResponseViewSet: """Employee direct hire response""" def project_interview_response(self, request, pk=None): """Endpoint for project interview responses""" queryset = InterviewSchedule.objects.filter(is_direct_hire=True, project=pk).order_by('-id') queryset = sel...
the_stack_v2_python_sparse
recruitment/api_recruitment.py
miloradradisic12/team-management-tool-backend
train
0
8f83fbb2cad7eb598374f756b3cba1a3ea1e5c14
[ "params = {'part': enf_parts(resource='commentThreads', value=parts), 'maxResults': max_results, 'moderationStatus': moderation_status, 'order': order, 'pageToken': page_token, 'searchTerms': search_terms, 'textFormat': text_format, **kwargs}\nif all_threads_related_to_channel_id is not None:\n params['allThread...
<|body_start_0|> params = {'part': enf_parts(resource='commentThreads', value=parts), 'maxResults': max_results, 'moderationStatus': moderation_status, 'order': order, 'pageToken': page_token, 'searchTerms': search_terms, 'textFormat': text_format, **kwargs} if all_threads_related_to_channel_id is not N...
A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads
CommentThreadsResource
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CommentThreadsResource: """A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads""" def list(self, parts: Optional[U...
stack_v2_sparse_classes_36k_train_000021
7,024
permissive
[ { "docstring": "Returns a list of comment threads that match the API request parameters. Args: parts: Comma-separated list of one or more comment thread resource properties. all_threads_related_to_channel_id: Instructs the API to return all comment threads associated with the specified channel. channel_id: Inst...
2
stack_v2_sparse_classes_30k_train_014137
Implement the Python class `CommentThreadsResource` described below. Class description: A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads ...
Implement the Python class `CommentThreadsResource` described below. Class description: A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads ...
1ed2f67a55b8df75c5fab9aacd7d9ff4d460812a
<|skeleton|> class CommentThreadsResource: """A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads""" def list(self, parts: Optional[U...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CommentThreadsResource: """A commentThread resource contains information about a YouTube comment thread, which comprises a top-level comment and replies, if any exist, to that comment References: https://developers.google.com/youtube/v3/docs/commentThreads""" def list(self, parts: Optional[Union[str, lis...
the_stack_v2_python_sparse
pyyoutube/resources/comment_threads.py
sns-sdks/python-youtube
train
249
868a96c59ff181065f7ab2d28fb875785ae97fe6
[ "if not hasattr(self, 'plugins'):\n print('Mount initialization')\n self.plugins = PlugPyStruct(PlugPyMount)\nelse:\n print('Registering plugin -- ', type(self))\n self.register_plugin(self)", "plugin = plugin()\nprint('From register_plugin -- ', type(plugin))\nself.plugins[plugin.__class__.__name__] ...
<|body_start_0|> if not hasattr(self, 'plugins'): print('Mount initialization') self.plugins = PlugPyStruct(PlugPyMount) else: print('Registering plugin -- ', type(self)) self.register_plugin(self) <|end_body_0|> <|body_start_1|> plugin = plugin()...
This class acts as a mount point for our plugins
PlugPyMount
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PlugPyMount: """This class acts as a mount point for our plugins""" def __init__(self, name, bases, attr): """Initializing mount, or registering a plugin?""" <|body_0|> def register_plugin(self, plugin): """Registration logic + append to plugins struct""" ...
stack_v2_sparse_classes_36k_train_000022
6,159
no_license
[ { "docstring": "Initializing mount, or registering a plugin?", "name": "__init__", "signature": "def __init__(self, name, bases, attr)" }, { "docstring": "Registration logic + append to plugins struct", "name": "register_plugin", "signature": "def register_plugin(self, plugin)" }, { ...
4
stack_v2_sparse_classes_30k_train_006596
Implement the Python class `PlugPyMount` described below. Class description: This class acts as a mount point for our plugins Method signatures and docstrings: - def __init__(self, name, bases, attr): Initializing mount, or registering a plugin? - def register_plugin(self, plugin): Registration logic + append to plug...
Implement the Python class `PlugPyMount` described below. Class description: This class acts as a mount point for our plugins Method signatures and docstrings: - def __init__(self, name, bases, attr): Initializing mount, or registering a plugin? - def register_plugin(self, plugin): Registration logic + append to plug...
10b5f8ac9468dde825eecdf25caec6b273af2301
<|skeleton|> class PlugPyMount: """This class acts as a mount point for our plugins""" def __init__(self, name, bases, attr): """Initializing mount, or registering a plugin?""" <|body_0|> def register_plugin(self, plugin): """Registration logic + append to plugins struct""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PlugPyMount: """This class acts as a mount point for our plugins""" def __init__(self, name, bases, attr): """Initializing mount, or registering a plugin?""" if not hasattr(self, 'plugins'): print('Mount initialization') self.plugins = PlugPyStruct(PlugPyMount) ...
the_stack_v2_python_sparse
scripts/plugin_tests/self_registering_approach/advanced_plugin/metaclass_plugins_test.py
mlsquare/cook-imly
train
0
57019740b8480f3926887ee06a1cb8e92300a8bf
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn ServiceUpdateMessage()", "from .item_body import ItemBody\nfrom .service_announcement_attachment import ServiceAnnouncementAttachment\nfrom .service_announcement_base import ServiceAnnouncementBase\nfrom .service_update_category import...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return ServiceUpdateMessage() <|end_body_0|> <|body_start_1|> from .item_body import ItemBody from .service_announcement_attachment import ServiceAnnouncementAttachment from .service_an...
ServiceUpdateMessage
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ServiceUpdateMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ServiceUpdateMessage: """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 ...
stack_v2_sparse_classes_36k_train_000023
6,416
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: ServiceUpdateMessage", "name": "create_from_discriminator_value", "signature": "def create_from_discriminato...
3
stack_v2_sparse_classes_30k_train_007836
Implement the Python class `ServiceUpdateMessage` described below. Class description: Implement the ServiceUpdateMessage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ServiceUpdateMessage: Creates a new instance of the appropriate class based o...
Implement the Python class `ServiceUpdateMessage` described below. Class description: Implement the ServiceUpdateMessage class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ServiceUpdateMessage: Creates a new instance of the appropriate class based o...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class ServiceUpdateMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ServiceUpdateMessage: """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 ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ServiceUpdateMessage: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> ServiceUpdateMessage: """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...
the_stack_v2_python_sparse
msgraph/generated/models/service_update_message.py
microsoftgraph/msgraph-sdk-python
train
135
ad466ffa56c8f65eedebac4a8ee0e8f3688b2878
[ "folders = url.split('/')\nthedate = folders[-1] if len(folders[-1]) > 0 else folders[-2]\noutfile = '{}.csv'.format(thedate)\nif os.path.exists(outfile) and usecached:\n decam_transients = pd.read_csv(outfile)\nelse:\n try:\n decam_dets = requests.get(url).text\n except:\n requests.packages....
<|body_start_0|> folders = url.split('/') thedate = folders[-1] if len(folders[-1]) > 0 else folders[-2] outfile = '{}.csv'.format(thedate) if os.path.exists(outfile) and usecached: decam_transients = pd.read_csv(outfile) else: try: decam_d...
DECamLedgerMaker
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DECamLedgerMaker: def __init__(self, url, usecached=True): """Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters ---------- url : str URL for accessing the data. usecached : bool If False, download new data and overwr...
stack_v2_sparse_classes_36k_train_000024
5,257
permissive
[ { "docstring": "Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters ---------- url : str URL for accessing the data. usecached : bool If False, download new data and overwrite cached data. Returns ------- decam_transients : pandas.DataFrame T...
2
null
Implement the Python class `DECamLedgerMaker` described below. Class description: Implement the DECamLedgerMaker class. Method signatures and docstrings: - def __init__(self, url, usecached=True): Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters...
Implement the Python class `DECamLedgerMaker` described below. Class description: Implement the DECamLedgerMaker class. Method signatures and docstrings: - def __init__(self, url, usecached=True): Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters...
573054ffef43e20a742898723cdf140151531cbc
<|skeleton|> class DECamLedgerMaker: def __init__(self, url, usecached=True): """Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters ---------- url : str URL for accessing the data. usecached : bool If False, download new data and overwr...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DECamLedgerMaker: def __init__(self, url, usecached=True): """Download reduced DECam transient data from Texas A&M. Cache the data to avoid lengthy and expensive downloads. Parameters ---------- url : str URL for accessing the data. usecached : bool If False, download new data and overwrite cached dat...
the_stack_v2_python_sparse
too_ledgers/2021A/desitoo.py
desihub/timedomain
train
5
72bf3ca78c47c383c695c4644f4b366813895f9d
[ "if isinstance(dictionary['quantiles'], abc.Mapping):\n quantiles = [(float(key), value) for key, value in dictionary['quantiles'].items()]\n quantiles.sort(key=lambda x: x[0])\nelse:\n quantiles = [tuple(pair) for pair in dictionary['quantiles']]\nreturn cls(count=dictionary['count'], min=dictionary['min'...
<|body_start_0|> if isinstance(dictionary['quantiles'], abc.Mapping): quantiles = [(float(key), value) for key, value in dictionary['quantiles'].items()] quantiles.sort(key=lambda x: x[0]) else: quantiles = [tuple(pair) for pair in dictionary['quantiles']] ret...
Summary statistics for a set of numbers.
SummaryStatistics
[ "Apache-2.0", "CC-BY-4.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SummaryStatistics: """Summary statistics for a set of numbers.""" def from_dict(cls, dictionary): """Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummaryStatistics.from_dict(attr.asdict(stats))` should equal `sta...
stack_v2_sparse_classes_36k_train_000025
24,441
permissive
[ { "docstring": "Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummaryStatistics.from_dict(attr.asdict(stats))` should equal `stats`. Args: dictionary: Dictionary resulting from `stats.to_dict_for_json()` or `attr.asdict(stats)` for some `Sum...
2
stack_v2_sparse_classes_30k_train_001266
Implement the Python class `SummaryStatistics` described below. Class description: Summary statistics for a set of numbers. Method signatures and docstrings: - def from_dict(cls, dictionary): Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummarySt...
Implement the Python class `SummaryStatistics` described below. Class description: Summary statistics for a set of numbers. Method signatures and docstrings: - def from_dict(cls, dictionary): Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummarySt...
5573d9c5822f4e866b6692769963ae819cb3f10d
<|skeleton|> class SummaryStatistics: """Summary statistics for a set of numbers.""" def from_dict(cls, dictionary): """Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummaryStatistics.from_dict(attr.asdict(stats))` should equal `sta...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SummaryStatistics: """Summary statistics for a set of numbers.""" def from_dict(cls, dictionary): """Constructs a `SummaryStatistics` object from a Python dictionary. If `stats` is an instance of `SummaryStatistics`, `SummaryStatistics.from_dict(attr.asdict(stats))` should equal `stats`. Args: di...
the_stack_v2_python_sparse
readtwice/data_utils/beam_utils.py
Jimmy-INL/google-research
train
1
422475ba932b63c6df9416c7898c415c7129420f
[ "value = super(TreeForeignKey, self).clean(value, model_instance)\nself._validate_parent(value, model_instance)\nreturn value", "if not value:\n return\nelif isinstance(value, (int, long_type)):\n model_class = instance.__class__\n try:\n parent = model_class._default_manager.get(pk=value)\n ex...
<|body_start_0|> value = super(TreeForeignKey, self).clean(value, model_instance) self._validate_parent(value, model_instance) return value <|end_body_0|> <|body_start_1|> if not value: return elif isinstance(value, (int, long_type)): model_class = instan...
A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители.
TreeForeignKey
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TreeForeignKey: """A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители.""" def clean(self, value, model_instance): """RUS: Возвращает проверенные данные, которые затем...
stack_v2_sparse_classes_36k_train_000026
2,251
permissive
[ { "docstring": "RUS: Возвращает проверенные данные, которые затем помещаются в словарь cleaned_data формы.", "name": "clean", "signature": "def clean(self, value, model_instance)" }, { "docstring": "RUS: Проверка родителей. Родителем может быть объект, у которого значение равно первичному ключу,...
2
null
Implement the Python class `TreeForeignKey` described below. Class description: A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители. Method signatures and docstrings: - def clean(self, value, model_ins...
Implement the Python class `TreeForeignKey` described below. Class description: A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители. Method signatures and docstrings: - def clean(self, value, model_ins...
2f7c535cb9f91d6bcb2f1e91b58edebc01255612
<|skeleton|> class TreeForeignKey: """A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители.""" def clean(self, value, model_instance): """RUS: Возвращает проверенные данные, которые затем...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TreeForeignKey: """A foreignkey that limits the node types the parent can be. RUS: Внешний ключ отображает поля формы в виде дерева. Ограничивает типы узлов, у которых могут быть родители.""" def clean(self, value, model_instance): """RUS: Возвращает проверенные данные, которые затем помещаются в...
the_stack_v2_python_sparse
backend/edw/models/fields/tree.py
infolabs/django-edw
train
5
b061db72830bdc3f002957ea94f60c1bf12f99c9
[ "if root.left == None and root.right == None:\n foundSoFar.append(pathSoFar)\n return\nif root.left != None:\n self.helper(root.left, '->'.join([pathSoFar, str(root.left.val)]), foundSoFar)\nif root.right != None:\n self.helper(root.right, '->'.join([pathSoFar, str(root.right.val)]), foundSoFar)", "if...
<|body_start_0|> if root.left == None and root.right == None: foundSoFar.append(pathSoFar) return if root.left != None: self.helper(root.left, '->'.join([pathSoFar, str(root.left.val)]), foundSoFar) if root.right != None: self.helper(root.right, '-...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def helper(self, root, pathSoFar, foundSoFar): """:type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str]""" <|body_0|> def binaryTreePaths(self, root): """:type root: TreeNode :rtype: List[str]""" <|body_1|> <|en...
stack_v2_sparse_classes_36k_train_000027
1,006
no_license
[ { "docstring": ":type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str]", "name": "helper", "signature": "def helper(self, root, pathSoFar, foundSoFar)" }, { "docstring": ":type root: TreeNode :rtype: List[str]", "name": "binaryTreePaths", "signature": ...
2
stack_v2_sparse_classes_30k_train_020585
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def helper(self, root, pathSoFar, foundSoFar): :type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str] - def binaryTreePaths(self, root): :type...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def helper(self, root, pathSoFar, foundSoFar): :type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str] - def binaryTreePaths(self, root): :type...
dcf9768aeb120f3ad9925e407193e1a4b282a0a2
<|skeleton|> class Solution: def helper(self, root, pathSoFar, foundSoFar): """:type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str]""" <|body_0|> def binaryTreePaths(self, root): """:type root: TreeNode :rtype: List[str]""" <|body_1|> <|en...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def helper(self, root, pathSoFar, foundSoFar): """:type root: TreeNode :type pathSoFar: string :type foundSoFar: List[str] :rtype: List[str]""" if root.left == None and root.right == None: foundSoFar.append(pathSoFar) return if root.left != None: ...
the_stack_v2_python_sparse
Binary_Tree_Paths.py
O5-2/leetcode
train
0
162248bb0e324e8d7467fba03e58935f797dc7de
[ "if not builder:\n raise ValueError('Builder is not specified')\nself.__builder = builder", "if not containerOsh:\n raise ValueError('Container is not specified')\nosh = self.__builder.buildFile(file_)\nosh.setContainer(containerOsh)\nreturn osh" ]
<|body_start_0|> if not builder: raise ValueError('Builder is not specified') self.__builder = builder <|end_body_0|> <|body_start_1|> if not containerOsh: raise ValueError('Container is not specified') osh = self.__builder.buildFile(file_) osh.setContain...
Reporter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Reporter: def __init__(self, builder): """@types: file_topology.Builder @raise ValueError: Builder is not specified""" <|body_0|> def report(self, file_, containerOsh): """@types: File, ObjectStateHolder -> ObjectStateHolder @raise ValueError: Container is not specif...
stack_v2_sparse_classes_36k_train_000028
12,587
no_license
[ { "docstring": "@types: file_topology.Builder @raise ValueError: Builder is not specified", "name": "__init__", "signature": "def __init__(self, builder)" }, { "docstring": "@types: File, ObjectStateHolder -> ObjectStateHolder @raise ValueError: Container is not specified", "name": "report",...
2
stack_v2_sparse_classes_30k_train_001855
Implement the Python class `Reporter` described below. Class description: Implement the Reporter class. Method signatures and docstrings: - def __init__(self, builder): @types: file_topology.Builder @raise ValueError: Builder is not specified - def report(self, file_, containerOsh): @types: File, ObjectStateHolder ->...
Implement the Python class `Reporter` described below. Class description: Implement the Reporter class. Method signatures and docstrings: - def __init__(self, builder): @types: file_topology.Builder @raise ValueError: Builder is not specified - def report(self, file_, containerOsh): @types: File, ObjectStateHolder ->...
c431e809e8d0f82e1bca7e3429dd0245560b5680
<|skeleton|> class Reporter: def __init__(self, builder): """@types: file_topology.Builder @raise ValueError: Builder is not specified""" <|body_0|> def report(self, file_, containerOsh): """@types: File, ObjectStateHolder -> ObjectStateHolder @raise ValueError: Container is not specif...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Reporter: def __init__(self, builder): """@types: file_topology.Builder @raise ValueError: Builder is not specified""" if not builder: raise ValueError('Builder is not specified') self.__builder = builder def report(self, file_, containerOsh): """@types: File, ...
the_stack_v2_python_sparse
reference/ucmdb/discovery/file_topology.py
madmonkyang/cda-record
train
0
0d1063036868595795e41de81e915077db2296d4
[ "self._conn = Http()\nself._client_key = client_key\nself._output = output", "request_params = urlencode(kwargs)\nuri = u'%s?%s&ywsid=%s&output=%s' % (base_url, request_params, self._client_key, self._output)\nself.LOG.debug('_http_request() - URI: %s', uri)\nheader, response = self._conn.request(uri, method='GET...
<|body_start_0|> self._conn = Http() self._client_key = client_key self._output = output <|end_body_0|> <|body_start_1|> request_params = urlencode(kwargs) uri = u'%s?%s&ywsid=%s&output=%s' % (base_url, request_params, self._client_key, self._output) self.LOG.debug('_htt...
Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection.
HttpApiClient
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HttpApiClient: """Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection.""" def __init__(self, client_key, output): """Initialize base http client.""" <|body_0|> def _http_request(self, base_url, **kwargs):...
stack_v2_sparse_classes_36k_train_000029
8,345
no_license
[ { "docstring": "Initialize base http client.", "name": "__init__", "signature": "def __init__(self, client_key, output)" }, { "docstring": "Perform an HTTP Request using base_url and parameters given by kwargs. Results are expected to be given in JSON format and are parsed to python data structu...
2
null
Implement the Python class `HttpApiClient` described below. Class description: Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection. Method signatures and docstrings: - def __init__(self, client_key, output): Initialize base http client. - def _http_re...
Implement the Python class `HttpApiClient` described below. Class description: Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection. Method signatures and docstrings: - def __init__(self, client_key, output): Initialize base http client. - def _http_re...
8390a0139137574ab237b3ff5fe8ea61e8a0b76b
<|skeleton|> class HttpApiClient: """Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection.""" def __init__(self, client_key, output): """Initialize base http client.""" <|body_0|> def _http_request(self, base_url, **kwargs):...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HttpApiClient: """Base implementation for an HTTP API Client. Used by the different API implementation objects to manage Http connection.""" def __init__(self, client_key, output): """Initialize base http client.""" self._conn = Http() self._client_key = client_key self._o...
the_stack_v2_python_sparse
data/input/adamhadani/python-yelp/yelp/api.py
bopopescu/pythonanalyzer
train
0
04ab08ce29e6f248d90c5dd862be84a028191e39
[ "try:\n return Vrf.objects.filter(id=id_vrf).uniqueResult()\nexcept ObjectDoesNotExist as e:\n raise VrfNotFoundError(u'Vrf id = %s does not exist.' % id_vrf)\nexcept OperationalError as e:\n cls.log.error(u'Lock wait timeout exceeded.')\n raise OperationalError(u'Lock wait timeout exceeded; try restart...
<|body_start_0|> try: return Vrf.objects.filter(id=id_vrf).uniqueResult() except ObjectDoesNotExist as e: raise VrfNotFoundError(u'Vrf id = %s does not exist.' % id_vrf) except OperationalError as e: cls.log.error(u'Lock wait timeout exceeded.') ra...
Vrf
[ "Apache-2.0", "BSD-3-Clause", "MIT", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Vrf: def get_by_pk(cls, id_vrf): """Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait timeout exceed""" <|body_0|> def create(self, authenticated_user): """In...
stack_v2_sparse_classes_36k_train_000030
5,338
permissive
[ { "docstring": "Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait timeout exceed", "name": "get_by_pk", "signature": "def get_by_pk(cls, id_vrf)" }, { "docstring": "Include new Vrf. @retu...
4
stack_v2_sparse_classes_30k_train_007752
Implement the Python class `Vrf` described below. Class description: Implement the Vrf class. Method signatures and docstrings: - def get_by_pk(cls, id_vrf): Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait t...
Implement the Python class `Vrf` described below. Class description: Implement the Vrf class. Method signatures and docstrings: - def get_by_pk(cls, id_vrf): Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait t...
eb27e1d977a1c4bb1fee8fb51b8d8050c64696d9
<|skeleton|> class Vrf: def get_by_pk(cls, id_vrf): """Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait timeout exceed""" <|body_0|> def create(self, authenticated_user): """In...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Vrf: def get_by_pk(cls, id_vrf): """Get Vrf by id. @return: Vrf. @raise VrfNotFoundError: Vrf is not registered. @raise VrfError: Failed to search for the Vrf. @raise OperationalError: Lock wait timeout exceed""" try: return Vrf.objects.filter(id=id_vrf).uniqueResult() exce...
the_stack_v2_python_sparse
networkapi/api_vrf/models.py
globocom/GloboNetworkAPI
train
86
ff305f7b86a6ffb0bd8acc789657a89923a78762
[ "_module = kwargs['module']\ngtk.HBox.__init__(self)\nramstk.RAMSTKBaseView.__init__(self, controller, **kwargs)\nself._module = None\nfor __, char in enumerate(_module):\n if char.isalpha():\n self._module = _module.capitalize()", "_return = False\n_type = gobject.type_name(model.get_column_type(positi...
<|body_start_0|> _module = kwargs['module'] gtk.HBox.__init__(self) ramstk.RAMSTKBaseView.__init__(self, controller, **kwargs) self._module = None for __, char in enumerate(_module): if char.isalpha(): self._module = _module.capitalize() <|end_body_0|>...
Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeView(). :ivar str _module: the capitalized name of the RAMSTK module the List View ...
RAMSTKListView
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RAMSTKListView: """Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeView(). :ivar str _module: the capitalize...
stack_v2_sparse_classes_36k_train_000031
4,051
permissive
[ { "docstring": "Initialize the List View. :param controller: the RAMSTK master data controller instance. :type controller: :class:`ramstk.RAMSTK.RAMSTK`", "name": "__init__", "signature": "def __init__(self, controller, **kwargs)" }, { "docstring": "Handle edits of the List View RAMSTKTreeView()...
3
null
Implement the Python class `RAMSTKListView` described below. Class description: Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeVi...
Implement the Python class `RAMSTKListView` described below. Class description: Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeVi...
488ffed8b842399ddcae93007de6c6f1dda23d05
<|skeleton|> class RAMSTKListView: """Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeView(). :ivar str _module: the capitalize...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RAMSTKListView: """Class to display data in the RAMSTK List Book. This is the meta class for all RAMSTK List View classes. Attributes of the RAMSTKListView are: :ivar list _lst_col_order: list containing the order of the columns in the List View RAMSTKTreeView(). :ivar str _module: the capitalized name of the...
the_stack_v2_python_sparse
src/ramstk/gui/gtk/listviews/ListView.py
JmiXIII/ramstk
train
0
a435e7f9e41df576c7d3988c7958dc4c57f699dc
[ "self.lower = lower\nself.stem = stem\nself.dannet = Dannet()\nself.europarl = Europarl()\nself.gutenberg = Gutenberg()\nself.lcc = LCC()", "dannet_sentence_words = self.dannet.iter_sentence_words(lower=self.lower, stem=self.stem)\neuroparl_sentence_words = self.europarl.iter_sentence_words(lower=self.lower, stem...
<|body_start_0|> self.lower = lower self.stem = stem self.dannet = Dannet() self.europarl = Europarl() self.gutenberg = Gutenberg() self.lcc = LCC() <|end_body_0|> <|body_start_1|> dannet_sentence_words = self.dannet.iter_sentence_words(lower=self.lower, stem=sel...
Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used.
SentenceWordsIterable
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SentenceWordsIterable: """Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used.""" def __init__(self, lower=True, stem=False): """Set up options.""" ...
stack_v2_sparse_classes_36k_train_000032
14,008
permissive
[ { "docstring": "Set up options.", "name": "__init__", "signature": "def __init__(self, lower=True, stem=False)" }, { "docstring": "Restart and return iterable.", "name": "__iter__", "signature": "def __iter__(self)" } ]
2
stack_v2_sparse_classes_30k_train_011767
Implement the Python class `SentenceWordsIterable` described below. Class description: Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used. Method signatures and docstrings: - def __ini...
Implement the Python class `SentenceWordsIterable` described below. Class description: Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used. Method signatures and docstrings: - def __ini...
d8d1c5e68aedf758aee1ba83da063f1e0952c21d
<|skeleton|> class SentenceWordsIterable: """Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used.""" def __init__(self, lower=True, stem=False): """Set up options.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SentenceWordsIterable: """Iterable for words in a sentence. Parameters ---------- lower : bool, default True Lower case the words. stem : bool, default False Apply word stemming. DanishStemmer from nltk is used.""" def __init__(self, lower=True, stem=False): """Set up options.""" self.low...
the_stack_v2_python_sparse
dasem/fullmonty.py
eaksnes/dasem
train
0
10e9de4e5434284eebe66126f323c2810e9aa7af
[ "super(EfficientDet, self).__init__()\nself.image_size = config['image_size']\nfpn_channels = config['fpn_channels']\nanchor_scales = config['anchor_scales']\nanchor_aspect_ratios = config['anchor_aspect_ratios']\nanchor_base_scale = config['anchor_base_scale']\nregressor_classifier_num_repeat = config['regressor_c...
<|body_start_0|> super(EfficientDet, self).__init__() self.image_size = config['image_size'] fpn_channels = config['fpn_channels'] anchor_scales = config['anchor_scales'] anchor_aspect_ratios = config['anchor_aspect_ratios'] anchor_base_scale = config['anchor_base_scale']...
EfficientDet
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EfficientDet: def __init__(self, num_classes, config): """please use _efficientdet()""" <|body_0|> def forward(self, image_list, targets=None, image_size=None, score_thresh=None, nms_thresh=None): """:param image_list: List[Tensor[C, H, W]] [0., 1.] :param targets: D...
stack_v2_sparse_classes_36k_train_000033
6,541
permissive
[ { "docstring": "please use _efficientdet()", "name": "__init__", "signature": "def __init__(self, num_classes, config)" }, { "docstring": ":param image_list: List[Tensor[C, H, W]] [0., 1.] :param targets: Dict['labels': List[Tensor[NUMi]], 'boxes': List[Tensor[NUMi, 4]]] boxes: left, top, right,...
2
stack_v2_sparse_classes_30k_train_008239
Implement the Python class `EfficientDet` described below. Class description: Implement the EfficientDet class. Method signatures and docstrings: - def __init__(self, num_classes, config): please use _efficientdet() - def forward(self, image_list, targets=None, image_size=None, score_thresh=None, nms_thresh=None): :p...
Implement the Python class `EfficientDet` described below. Class description: Implement the EfficientDet class. Method signatures and docstrings: - def __init__(self, num_classes, config): please use _efficientdet() - def forward(self, image_list, targets=None, image_size=None, score_thresh=None, nms_thresh=None): :p...
79616be397b7f57992cd43b772f65b58b5e25a8b
<|skeleton|> class EfficientDet: def __init__(self, num_classes, config): """please use _efficientdet()""" <|body_0|> def forward(self, image_list, targets=None, image_size=None, score_thresh=None, nms_thresh=None): """:param image_list: List[Tensor[C, H, W]] [0., 1.] :param targets: D...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EfficientDet: def __init__(self, num_classes, config): """please use _efficientdet()""" super(EfficientDet, self).__init__() self.image_size = config['image_size'] fpn_channels = config['fpn_channels'] anchor_scales = config['anchor_scales'] anchor_aspect_ratios...
the_stack_v2_python_sparse
models/efficientdet.py
Jintao-Huang/EfficientDet_PyTorch
train
22
5d755d25a57408a713ea354bad709ec6e61f0c12
[ "super(Generator, self).__init__()\nself.conv_dim = conv_dim\nself.fc = nn.Linear(z_size, conv_dim * 4 * 4 * 4)\nself.deconv1 = deconv(conv_dim * 4, conv_dim * 2, 4)\nself.deconv2 = deconv(conv_dim * 2, conv_dim, 4)\nself.deconv3 = deconv(conv_dim, 3, 4, batch_norm=False)", "x = self.fc(x)\nx = x.view(-1, self.co...
<|body_start_0|> super(Generator, self).__init__() self.conv_dim = conv_dim self.fc = nn.Linear(z_size, conv_dim * 4 * 4 * 4) self.deconv1 = deconv(conv_dim * 4, conv_dim * 2, 4) self.deconv2 = deconv(conv_dim * 2, conv_dim, 4) self.deconv3 = deconv(conv_dim, 3, 4, batch_...
Generator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Generator: def __init__(self, z_size, conv_dim=32): """Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the *last* transpose convolutional layer""" <|body_0|> def forward(self, x): """...
stack_v2_sparse_classes_36k_train_000034
12,896
permissive
[ { "docstring": "Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the *last* transpose convolutional layer", "name": "__init__", "signature": "def __init__(self, z_size, conv_dim=32)" }, { "docstring": "Forward pro...
2
stack_v2_sparse_classes_30k_train_019062
Implement the Python class `Generator` described below. Class description: Implement the Generator class. Method signatures and docstrings: - def __init__(self, z_size, conv_dim=32): Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the...
Implement the Python class `Generator` described below. Class description: Implement the Generator class. Method signatures and docstrings: - def __init__(self, z_size, conv_dim=32): Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the...
b9b54564f94aadfc3c71ff513da0f05ef85d22a8
<|skeleton|> class Generator: def __init__(self, z_size, conv_dim=32): """Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the *last* transpose convolutional layer""" <|body_0|> def forward(self, x): """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Generator: def __init__(self, z_size, conv_dim=32): """Initialize the Generator Module :param z_size: The length of the input latent vector, z :param conv_dim: The depth of the inputs to the *last* transpose convolutional layer""" super(Generator, self).__init__() self.conv_dim = conv_...
the_stack_v2_python_sparse
dl/pytorch/gan/face_gan.py
xta0/Python-Playground
train
0
08ea0907314705568cd3dfdc62dd696a20a468c7
[ "trace_id_list = []\ncnt = None\ntry:\n with transaction.atomic():\n count = Count.objects.select_for_update().get(pk=1)\n cnt = count.count_number\n count.count_number = (count.count_number + req) % 1000000000\n count.save()\nexcept Exception as e:\n logger.system_log('LOSM00038',...
<|body_start_0|> trace_id_list = [] cnt = None try: with transaction.atomic(): count = Count.objects.select_for_update().get(pk=1) cnt = count.count_number count.count_number = (count.count_number + req) % 1000000000 cou...
[クラス概要] イベントリクエスト関連の処理をまとめる
EventsRequestCommon
[ "Apache-2.0", "BSD-3-Clause", "LGPL-3.0-only", "MIT", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EventsRequestCommon: """[クラス概要] イベントリクエスト関連の処理をまとめる""" def generate_trace_id(now=None, req=1): """[メソッド概要] トレースIDを生成する""" <|body_0|> def check_events_request_key(cls, req): """[メソッド概要] リクエストのキーをチェックする""" <|body_1|> def check_events_request_len(cls, r...
stack_v2_sparse_classes_36k_train_000035
4,397
permissive
[ { "docstring": "[メソッド概要] トレースIDを生成する", "name": "generate_trace_id", "signature": "def generate_trace_id(now=None, req=1)" }, { "docstring": "[メソッド概要] リクエストのキーをチェックする", "name": "check_events_request_key", "signature": "def check_events_request_key(cls, req)" }, { "docstring": "[メソ...
3
stack_v2_sparse_classes_30k_train_019614
Implement the Python class `EventsRequestCommon` described below. Class description: [クラス概要] イベントリクエスト関連の処理をまとめる Method signatures and docstrings: - def generate_trace_id(now=None, req=1): [メソッド概要] トレースIDを生成する - def check_events_request_key(cls, req): [メソッド概要] リクエストのキーをチェックする - def check_events_request_len(cls, req, ...
Implement the Python class `EventsRequestCommon` described below. Class description: [クラス概要] イベントリクエスト関連の処理をまとめる Method signatures and docstrings: - def generate_trace_id(now=None, req=1): [メソッド概要] トレースIDを生成する - def check_events_request_key(cls, req): [メソッド概要] リクエストのキーをチェックする - def check_events_request_len(cls, req, ...
c00ea4fe1bf4b4a18d545aabeaaf1d95c7664b94
<|skeleton|> class EventsRequestCommon: """[クラス概要] イベントリクエスト関連の処理をまとめる""" def generate_trace_id(now=None, req=1): """[メソッド概要] トレースIDを生成する""" <|body_0|> def check_events_request_key(cls, req): """[メソッド概要] リクエストのキーをチェックする""" <|body_1|> def check_events_request_len(cls, r...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EventsRequestCommon: """[クラス概要] イベントリクエスト関連の処理をまとめる""" def generate_trace_id(now=None, req=1): """[メソッド概要] トレースIDを生成する""" trace_id_list = [] cnt = None try: with transaction.atomic(): count = Count.objects.select_for_update().get(pk=1) ...
the_stack_v2_python_sparse
oase-root/libs/webcommonlibs/events_request.py
exastro-suite/oase
train
10
363a45c6bf1ab508861ef94dedc9776eb690ebd1
[ "self._scenario = []\nself._approaches = []\nself._approaches.append(PatApproach())\nself._approaches.append(MatApproach())\nself._approaches.append(MaxApproach())\nself._approaches.append(PacApproach())", "scenario_file = open(scenario_file_name)\nfor current_line in scenario_file:\n new_customer = Customer(c...
<|body_start_0|> self._scenario = [] self._approaches = [] self._approaches.append(PatApproach()) self._approaches.append(MatApproach()) self._approaches.append(MaxApproach()) self._approaches.append(PacApproach()) <|end_body_0|> <|body_start_1|> scenario_file = ...
A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and methods you want. But because you should not change the interface, you may n...
Simulator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Simulator: """A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and methods you want. But because you shoul...
stack_v2_sparse_classes_36k_train_000036
4,220
no_license
[ { "docstring": "Initialize a Simulation.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Load a scenario from the scenario_file_name and store it in _scenario :param scenario_file_name: Name of the scenario file :type scenario_file_name: str :rtype: None", "name": ...
3
stack_v2_sparse_classes_30k_train_013563
Implement the Python class `Simulator` described below. Class description: A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and ...
Implement the Python class `Simulator` described below. Class description: A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and ...
2b9312b30171686f1bb08f4052edd8c748cf848f
<|skeleton|> class Simulator: """A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and methods you want. But because you shoul...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Simulator: """A Simulator. This class represents the simulator which initiates different approaches, load scenario from the file, and call restaurant function for new customer arrivals and at each turn. Of course, you may add whatever private attributes and methods you want. But because you should not change ...
the_stack_v2_python_sparse
Assignments/a1/simulator.py
Lost-Accountant/csc148_2016_s
train
0
38bcb668b6e7c80f69241e27f5c6b76633808dd5
[ "if len(nums) == 0:\n return 0\npos = 0\nwhile pos < len(nums):\n if nums[pos] >= target:\n return pos\n pos += 1\nreturn len(nums)", "if len(nums) == 1:\n return int(target >= nums[0])\nelif len(nums) == 2:\n if target > nums[1]:\n return 2\n elif nums[0] < target <= nums[1]:\n ...
<|body_start_0|> if len(nums) == 0: return 0 pos = 0 while pos < len(nums): if nums[pos] >= target: return pos pos += 1 return len(nums) <|end_body_0|> <|body_start_1|> if len(nums) == 1: return int(target >= nums[0...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def searchInsert(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def searchInsert2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|...
stack_v2_sparse_classes_36k_train_000037
1,138
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "searchInsert", "signature": "def searchInsert(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "searchInsert2", "signature": "def searchInsert2(self, nums, ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def searchInsert(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def searchInsert2(self, nums, target): :type nums: List[int] :type target: int :rtype:...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def searchInsert(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def searchInsert2(self, nums, target): :type nums: List[int] :type target: int :rtype:...
9f53994d8a123003d5f12a76cf375982cee52806
<|skeleton|> class Solution: def searchInsert(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def searchInsert2(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def searchInsert(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" if len(nums) == 0: return 0 pos = 0 while pos < len(nums): if nums[pos] >= target: return pos pos += 1 return le...
the_stack_v2_python_sparse
Algorithms/Q35_Search_Insert_Position.py
filosfino/leetcode
train
1
ef2d5b53d16b75f885cc9064820b95d0bd44ca37
[ "SetUp.__init__(self)\nself.file_store = OUTPUT\nself.build_drive = 'j:'\nself.drop_file = path('%s/ats/ATSBootupDrop.zip' % OUTPUT).normpath()\nimage_files = '%s/images/image1.fpsx, %s/images/image2.fpsx ' % (OUTPUT, OUTPUT)\nself.flash_images = image_files\nself.config = None", "xml_text = ''\nfile_location = p...
<|body_start_0|> SetUp.__init__(self) self.file_store = OUTPUT self.build_drive = 'j:' self.drop_file = path('%s/ats/ATSBootupDrop.zip' % OUTPUT).normpath() image_files = '%s/images/image1.fpsx, %s/images/image2.fpsx ' % (OUTPUT, OUTPUT) self.flash_images = image_files ...
test BootupTestDrop.py
TestBootupTestPlan
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestBootupTestPlan: """test BootupTestDrop.py""" def __init__(self): """initialize bootup Tests""" <|body_0|> def read_xml(self, file_location, zip_file=False): """reads test.xml file if a path is given""" <|body_1|> def test_xml_file(self): ...
stack_v2_sparse_classes_36k_train_000038
4,922
no_license
[ { "docstring": "initialize bootup Tests", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "reads test.xml file if a path is given", "name": "read_xml", "signature": "def read_xml(self, file_location, zip_file=False)" }, { "docstring": "test bootup_testing....
3
stack_v2_sparse_classes_30k_train_016571
Implement the Python class `TestBootupTestPlan` described below. Class description: test BootupTestDrop.py Method signatures and docstrings: - def __init__(self): initialize bootup Tests - def read_xml(self, file_location, zip_file=False): reads test.xml file if a path is given - def test_xml_file(self): test bootup_...
Implement the Python class `TestBootupTestPlan` described below. Class description: test BootupTestDrop.py Method signatures and docstrings: - def __init__(self): initialize bootup Tests - def read_xml(self, file_location, zip_file=False): reads test.xml file if a path is given - def test_xml_file(self): test bootup_...
f458a4ce83f74d603362fe6b71eaa647ccc62fee
<|skeleton|> class TestBootupTestPlan: """test BootupTestDrop.py""" def __init__(self): """initialize bootup Tests""" <|body_0|> def read_xml(self, file_location, zip_file=False): """reads test.xml file if a path is given""" <|body_1|> def test_xml_file(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestBootupTestPlan: """test BootupTestDrop.py""" def __init__(self): """initialize bootup Tests""" SetUp.__init__(self) self.file_store = OUTPUT self.build_drive = 'j:' self.drop_file = path('%s/ats/ATSBootupDrop.zip' % OUTPUT).normpath() image_files = '%s/...
the_stack_v2_python_sparse
buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_bootup_testing.py
anagovitsyn/oss.FCL.sftools.dev.build
train
0
537afaca93922f63ec238470e55622e3fe17f6cd
[ "self.threshold_method = threshold_method\nself.threshold = threshold\nself.cf = filters.CompoundUniformFilter(samples)\nself.mf = filters.MaximumFilter(2 * samples + 1)", "cfilt = self.cf.filter_image(image)\nmfilt = self.mf.filter_image(cfilt)\nif 'std' in self.threshold_method:\n threshold = np.std(self.cf....
<|body_start_0|> self.threshold_method = threshold_method self.threshold = threshold self.cf = filters.CompoundUniformFilter(samples) self.mf = filters.MaximumFilter(2 * samples + 1) <|end_body_0|> <|body_start_1|> cfilt = self.cf.filter_image(image) mfilt = self.mf.filt...
Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold.
Estimate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Estimate: """Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold.""" def __init__(self, samples, threshold_method, threshold): """Initialise the position estimator. Paramete...
stack_v2_sparse_classes_36k_train_000039
9,306
no_license
[ { "docstring": "Initialise the position estimator. Parameters ---------- samples : int Size of kernel used in filtering. threshold_method : str Threshold method (either `std` or `manual`). threshold : float, optional Intensity threshold for position estimation - to be used if threshold_method is `manual`.", ...
2
stack_v2_sparse_classes_30k_train_017875
Implement the Python class `Estimate` described below. Class description: Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold. Method signatures and docstrings: - def __init__(self, samples, threshold_method...
Implement the Python class `Estimate` described below. Class description: Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold. Method signatures and docstrings: - def __init__(self, samples, threshold_method...
8fdb4122788d0967536ac3f14759e1f32a0c616e
<|skeleton|> class Estimate: """Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold.""" def __init__(self, samples, threshold_method, threshold): """Initialise the position estimator. Paramete...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Estimate: """Estimate the position of bright spots in a fluorescence image using a compound uniform filter. Spots are retained if their grey level value is above the threshold.""" def __init__(self, samples, threshold_method, threshold): """Initialise the position estimator. Parameters ----------...
the_stack_v2_python_sparse
smlm_analysis/localise/estimate.py
drmatthews/SMLM_analysis
train
0
a44d644bdcab37611e664789904aa3b1fd146f15
[ "tree_list = (yield gen.Task(cls.tree, all_state=all_state))\ntd_tree_list = []\n\ndef get_childs(item):\n v = item\n icon = [' -']\n for n in range(0, v['level']):\n icon.append(' -')\n v['icon'] = ''.join(icon)\n child_tree = v.pop('child_tree')\n td_tree_list.append(v)\n for c in chil...
<|body_start_0|> tree_list = (yield gen.Task(cls.tree, all_state=all_state)) td_tree_list = [] def get_childs(item): v = item icon = [' -'] for n in range(0, v['level']): icon.append(' -') v['icon'] = ''.join(icon) chil...
内容分类表
Category
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Category: """内容分类表""" def td_tree(cls, callback, all_state=False): """返回二维树""" <|body_0|> def get_childs(cls, id, callback): """取指定分类的下级""" <|body_1|> def tree(cls, callback, all_state=False): """返回多维树""" <|body_2|> <|end_skeleton|> ...
stack_v2_sparse_classes_36k_train_000040
14,810
no_license
[ { "docstring": "返回二维树", "name": "td_tree", "signature": "def td_tree(cls, callback, all_state=False)" }, { "docstring": "取指定分类的下级", "name": "get_childs", "signature": "def get_childs(cls, id, callback)" }, { "docstring": "返回多维树", "name": "tree", "signature": "def tree(cls...
3
stack_v2_sparse_classes_30k_val_001003
Implement the Python class `Category` described below. Class description: 内容分类表 Method signatures and docstrings: - def td_tree(cls, callback, all_state=False): 返回二维树 - def get_childs(cls, id, callback): 取指定分类的下级 - def tree(cls, callback, all_state=False): 返回多维树
Implement the Python class `Category` described below. Class description: 内容分类表 Method signatures and docstrings: - def td_tree(cls, callback, all_state=False): 返回二维树 - def get_childs(cls, id, callback): 取指定分类的下级 - def tree(cls, callback, all_state=False): 返回多维树 <|skeleton|> class Category: """内容分类表""" def ...
56f910bf3ce1256044270553720072df48b8d2b1
<|skeleton|> class Category: """内容分类表""" def td_tree(cls, callback, all_state=False): """返回二维树""" <|body_0|> def get_childs(cls, id, callback): """取指定分类的下级""" <|body_1|> def tree(cls, callback, all_state=False): """返回多维树""" <|body_2|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Category: """内容分类表""" def td_tree(cls, callback, all_state=False): """返回二维树""" tree_list = (yield gen.Task(cls.tree, all_state=all_state)) td_tree_list = [] def get_childs(item): v = item icon = [' -'] for n in range(0, v['level']): ...
the_stack_v2_python_sparse
app/models/cms.py
kingel/QcoreCMS
train
0
25366ac82942bf99a83d86d505753b9855e40298
[ "dataset = file\nparams_cp = falconn.LSHConstructionParameters()\nparams_cp.dimension = len(dataset[0])\nparams_cp.lsh_family = falconn.LSHFamily.CrossPolytope\nif euclidean == True:\n params_cp.distance_function = falconn.DistanceFunction.EuclideanSquared\nelse:\n params_cp.distance_function = falconn.Distan...
<|body_start_0|> dataset = file params_cp = falconn.LSHConstructionParameters() params_cp.dimension = len(dataset[0]) params_cp.lsh_family = falconn.LSHFamily.CrossPolytope if euclidean == True: params_cp.distance_function = falconn.DistanceFunction.EuclideanSquared ...
Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN
LSH
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LSH: """Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN""" def LSHtable(self, file, euclidean=True, number_of_tables=50, hash_fx=18): """input: 2-D numpy array output: LSH table Params: :file: 2-D n...
stack_v2_sparse_classes_36k_train_000041
4,128
no_license
[ { "docstring": "input: 2-D numpy array output: LSH table Params: :file: 2-D numpy array of document vectors :distance_function: [EuclideanSquared, NegativeInnerProduct] :number_of_tables: (default=50) :num_of_rotations: 1 :seed: 5721840 :num_setup_threads: 0 :hash_fx: 18 (2^18 hash tables)", "name": "LSHtab...
3
stack_v2_sparse_classes_30k_train_017554
Implement the Python class `LSH` described below. Class description: Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN Method signatures and docstrings: - def LSHtable(self, file, euclidean=True, number_of_tables=50, hash_fx=18): inpu...
Implement the Python class `LSH` described below. Class description: Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN Method signatures and docstrings: - def LSHtable(self, file, euclidean=True, number_of_tables=50, hash_fx=18): inpu...
1fd690f32cc6ac6fdd1ddae4f2242c375c9edc2f
<|skeleton|> class LSH: """Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN""" def LSHtable(self, file, euclidean=True, number_of_tables=50, hash_fx=18): """input: 2-D numpy array output: LSH table Params: :file: 2-D n...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LSH: """Local-Sensitivity Hashing (LSH) is a class of methods for the nearest neighbor search problem. https://github.com/FALCONN-LIB/FALCONN""" def LSHtable(self, file, euclidean=True, number_of_tables=50, hash_fx=18): """input: 2-D numpy array output: LSH table Params: :file: 2-D numpy array of...
the_stack_v2_python_sparse
webapp/fast_query/lsh.py
YanshengLiu2000/search-engine
train
0
04c07f4ed4dd26e83238371ada0b03dffca0aea6
[ "super(CloudSQLInstance, self).__init__(resource_id=instance_id, resource_type=resource.ResourceType.CLOUD_SQL_INSTANCE, name=name, display_name=display_name, parent=parent, locations=locations, lifecycle_state=lifecycle_state)\nself.full_name = full_name\nself.data = data", "instance_dict = json.loads(json_strin...
<|body_start_0|> super(CloudSQLInstance, self).__init__(resource_id=instance_id, resource_type=resource.ResourceType.CLOUD_SQL_INSTANCE, name=name, display_name=display_name, parent=parent, locations=locations, lifecycle_state=lifecycle_state) self.full_name = full_name self.data = data <|end_bo...
CloudSQL Instance resource.
CloudSQLInstance
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CloudSQLInstance: """CloudSQL Instance resource.""" def __init__(self, instance_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state=CloudSQLInstanceLifecycleState.UNSPECIFIED): """Initialize. Args: instance_id (str): The cloud sql...
stack_v2_sparse_classes_36k_train_000042
3,326
permissive
[ { "docstring": "Initialize. Args: instance_id (str): The cloud sql instance id. full_name (str): The full resource name and ancestry. data (str): Resource representation of the cloud sql instance. name (str): The cloud_sql_instance's unique GCP name, with the format \"cloud_sql_instances/{id}\". display_name (s...
2
null
Implement the Python class `CloudSQLInstance` described below. Class description: CloudSQL Instance resource. Method signatures and docstrings: - def __init__(self, instance_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state=CloudSQLInstanceLifecycleState.UNSPECI...
Implement the Python class `CloudSQLInstance` described below. Class description: CloudSQL Instance resource. Method signatures and docstrings: - def __init__(self, instance_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state=CloudSQLInstanceLifecycleState.UNSPECI...
d4421afa50a17ed47cbebe942044ebab3720e0f5
<|skeleton|> class CloudSQLInstance: """CloudSQL Instance resource.""" def __init__(self, instance_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state=CloudSQLInstanceLifecycleState.UNSPECIFIED): """Initialize. Args: instance_id (str): The cloud sql...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CloudSQLInstance: """CloudSQL Instance resource.""" def __init__(self, instance_id, full_name=None, data=None, name=None, display_name=None, parent=None, locations=None, lifecycle_state=CloudSQLInstanceLifecycleState.UNSPECIFIED): """Initialize. Args: instance_id (str): The cloud sql instance id....
the_stack_v2_python_sparse
google/cloud/forseti/common/gcp_type/cloudsql_instance.py
kevensen/forseti-security
train
1
4a875e9a1b22812d48e9a755ddd2a758f01e90d5
[ "logger.debug('Generating SPDX JSON document...')\nimage_obj = image_obj_list[0]\ntemplate = SPDX()\nreport = get_document_dict(image_obj, template)\nreturn json.dumps(report)", "logger.debug('Generating SPDX JSON document...')\ntemplate = SPDX()\nreport = get_document_dict_snapshot(layer, template)\nreturn json....
<|body_start_0|> logger.debug('Generating SPDX JSON document...') image_obj = image_obj_list[0] template = SPDX() report = get_document_dict(image_obj, template) return json.dumps(report) <|end_body_0|> <|body_start_1|> logger.debug('Generating SPDX JSON document...') ...
SpdxJSON
[ "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause-Views" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SpdxJSON: def generate(self, image_obj_list, print_inclusive=False): """Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image, in which case, the information in the stub image is not applicable in the SPDX case as it is an ...
stack_v2_sparse_classes_36k_train_000043
6,919
permissive
[ { "docstring": "Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image, in which case, the information in the stub image is not applicable in the SPDX case as it is an empty image object with no metadata as nothing got built. The whole document sho...
2
stack_v2_sparse_classes_30k_train_010793
Implement the Python class `SpdxJSON` described below. Class description: Implement the SpdxJSON class. Method signatures and docstrings: - def generate(self, image_obj_list, print_inclusive=False): Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image,...
Implement the Python class `SpdxJSON` described below. Class description: Implement the SpdxJSON class. Method signatures and docstrings: - def generate(self, image_obj_list, print_inclusive=False): Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image,...
2aab4fb3af706feefe7137f442951108f541b058
<|skeleton|> class SpdxJSON: def generate(self, image_obj_list, print_inclusive=False): """Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image, in which case, the information in the stub image is not applicable in the SPDX case as it is an ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SpdxJSON: def generate(self, image_obj_list, print_inclusive=False): """Generate an SPDX document WARNING: This assumes that the list consists of one image or the base image and a stub image, in which case, the information in the stub image is not applicable in the SPDX case as it is an empty image ob...
the_stack_v2_python_sparse
tern/formats/spdx/spdxjson/generator.py
tern-tools/tern
train
539
4140dc3365a9d84253b945b7657f5a77a641e538
[ "self.token = token\nself.verify = verify\nself.cert = cert\nself.keyfile = keyfile\nself.timeout = timeout\nself.log = logging.getLogger(__name__)", "headers = {'Authorization': 'Api-Token %s' % self.token}\ntry:\n with Session() as session:\n session.headers.update(headers)\n session.verify = s...
<|body_start_0|> self.token = token self.verify = verify self.cert = cert self.keyfile = keyfile self.timeout = timeout self.log = logging.getLogger(__name__) <|end_body_0|> <|body_start_1|> headers = {'Authorization': 'Api-Token %s' % self.token} try: ...
DynatraceClient
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DynatraceClient: def __init__(self, token, verify=False, cert=None, keyfile=None, timeout=None): """Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health check. :param token: token from Dynatrace platform which has access to read the API endpoints :param ver...
stack_v2_sparse_classes_36k_train_000044
2,931
permissive
[ { "docstring": "Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health check. :param token: token from Dynatrace platform which has access to read the API endpoints :param verify: verify the https certificate :param cert: path to certificate file for https verification :param keyfil...
3
stack_v2_sparse_classes_30k_train_016007
Implement the Python class `DynatraceClient` described below. Class description: Implement the DynatraceClient class. Method signatures and docstrings: - def __init__(self, token, verify=False, cert=None, keyfile=None, timeout=None): Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health ...
Implement the Python class `DynatraceClient` described below. Class description: Implement the DynatraceClient class. Method signatures and docstrings: - def __init__(self, token, verify=False, cert=None, keyfile=None, timeout=None): Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health ...
350cb6e239157b50b5943cdf5ca13163da9b9307
<|skeleton|> class DynatraceClient: def __init__(self, token, verify=False, cert=None, keyfile=None, timeout=None): """Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health check. :param token: token from Dynatrace platform which has access to read the API endpoints :param ver...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DynatraceClient: def __init__(self, token, verify=False, cert=None, keyfile=None, timeout=None): """Client for Dynatrace rest API. It's used by dynatrace_topology and dynatrace_health check. :param token: token from Dynatrace platform which has access to read the API endpoints :param verify: verify th...
the_stack_v2_python_sparse
dynatrace_base/stackstate_checks/dynatrace/dynatrance_client.py
StackVista/stackstate-agent-integrations
train
3
b560613f0bb153814a401992ebd735fa08e1160a
[ "res = 0\nfor i in range(len(A)):\n for j in range(len(A)):\n for k in range(len(A)):\n if A[i] & A[j] & A[k] == 0:\n res += 1\nreturn res", "d = {}\nres = 0\nfor a in A:\n for b in A:\n t = a & b\n if t in d:\n d[t] += 1\n else:\n ...
<|body_start_0|> res = 0 for i in range(len(A)): for j in range(len(A)): for k in range(len(A)): if A[i] & A[j] & A[k] == 0: res += 1 return res <|end_body_0|> <|body_start_1|> d = {} res = 0 for a i...
https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n)
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n)""" def countTriplets(self, A): """:type A: List[int] :rtype: int""" <|bod...
stack_v2_sparse_classes_36k_train_000045
6,934
no_license
[ { "docstring": ":type A: List[int] :rtype: int", "name": "countTriplets", "signature": "def countTriplets(self, A)" }, { "docstring": ":type A: List[int] :rtype: int", "name": "countTriplets2", "signature": "def countTriplets2(self, A)" } ]
2
null
Implement the Python class `Solution` described below. Class description: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n) Method signatures and docstrings: - def countTriplets(...
Implement the Python class `Solution` described below. Class description: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n) Method signatures and docstrings: - def countTriplets(...
54d3d9530b25272d4a2e5dc33e7035c44f506dc5
<|skeleton|> class Solution: """https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n)""" def countTriplets(self, A): """:type A: List[int] :rtype: int""" <|bod...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/ explanation: https://leetcode.com/problems/triples-with-bitwise-and-equal-to-zero/discuss/227309/C%2B%2B-naive-O(n-*-n)""" def countTriplets(self, A): """:type A: List[int] :rtype: int""" res = 0 fo...
the_stack_v2_python_sparse
old/Session002/BitManipulation/TripleswithANDEqualToZero.py
MaxIakovliev/algorithms
train
0
30494a7b1a538396380a9897b4209b08a10edfaa
[ "try:\n ScfUser.objects.get(username=data)\n raise ValidationError('User {} name already exist'.format(data))\nexcept ScfUser.DoesNotExist:\n return data", "try:\n ScfUser.objects.get(email=data)\n raise ValidationError('User {} email already exist'.format(data))\nexcept ScfUser.DoesNotExist:\n ...
<|body_start_0|> try: ScfUser.objects.get(username=data) raise ValidationError('User {} name already exist'.format(data)) except ScfUser.DoesNotExist: return data <|end_body_0|> <|body_start_1|> try: ScfUser.objects.get(email=data) rai...
Signup with mandatory fields
SignupSerializer
[ "Apache-2.0", "GPL-3.0-only", "BSD-3-Clause", "AGPL-3.0-only", "GPL-1.0-or-later", "Python-2.0", "BSD-2-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SignupSerializer: """Signup with mandatory fields""" def validate_username(self, data): """check user name is exist or not""" <|body_0|> def validate_email(self, data): """check email is exist or not""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_000046
4,134
permissive
[ { "docstring": "check user name is exist or not", "name": "validate_username", "signature": "def validate_username(self, data)" }, { "docstring": "check email is exist or not", "name": "validate_email", "signature": "def validate_email(self, data)" } ]
2
stack_v2_sparse_classes_30k_train_003422
Implement the Python class `SignupSerializer` described below. Class description: Signup with mandatory fields Method signatures and docstrings: - def validate_username(self, data): check user name is exist or not - def validate_email(self, data): check email is exist or not
Implement the Python class `SignupSerializer` described below. Class description: Signup with mandatory fields Method signatures and docstrings: - def validate_username(self, data): check user name is exist or not - def validate_email(self, data): check email is exist or not <|skeleton|> class SignupSerializer: ...
4df3f46e35eb8fcab796be27fc1cc7fa7ed561f3
<|skeleton|> class SignupSerializer: """Signup with mandatory fields""" def validate_username(self, data): """check user name is exist or not""" <|body_0|> def validate_email(self, data): """check email is exist or not""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SignupSerializer: """Signup with mandatory fields""" def validate_username(self, data): """check user name is exist or not""" try: ScfUser.objects.get(username=data) raise ValidationError('User {} name already exist'.format(data)) except ScfUser.DoesNotExis...
the_stack_v2_python_sparse
SCRM/ums/serializers.py
aricent/secure-cloud-native-fabric
train
2
15840d207be8cfbe0239573bf8d5694867192449
[ "if strs == []:\n return '-.'\nreturn '+&*+'.join(strs)", "if s == '-.':\n return []\nreturn s.split('+&*+')" ]
<|body_start_0|> if strs == []: return '-.' return '+&*+'.join(strs) <|end_body_0|> <|body_start_1|> if s == '-.': return [] return s.split('+&*+') <|end_body_1|>
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def encode(self, strs): """Encodes a list of strings to a single string. :type strs: List[str] :rtype: str""" <|body_0|> def decode(self, s): """Decodes a single string to a list of strings. :type s: str :rtype: List[str]""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_36k_train_000047
722
no_license
[ { "docstring": "Encodes a list of strings to a single string. :type strs: List[str] :rtype: str", "name": "encode", "signature": "def encode(self, strs)" }, { "docstring": "Decodes a single string to a list of strings. :type s: str :rtype: List[str]", "name": "decode", "signature": "def ...
2
stack_v2_sparse_classes_30k_train_006320
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def encode(self, strs): Encodes a list of strings to a single string. :type strs: List[str] :rtype: str - def decode(self, s): Decodes a single string to a list of strings. :type s: st...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def encode(self, strs): Encodes a list of strings to a single string. :type strs: List[str] :rtype: str - def decode(self, s): Decodes a single string to a list of strings. :type s: st...
30bfafb6a7727c9305b22933b63d9d645182c633
<|skeleton|> class Codec: def encode(self, strs): """Encodes a list of strings to a single string. :type strs: List[str] :rtype: str""" <|body_0|> def decode(self, s): """Decodes a single string to a list of strings. :type s: str :rtype: List[str]""" <|body_1|> <|end_skeleton|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def encode(self, strs): """Encodes a list of strings to a single string. :type strs: List[str] :rtype: str""" if strs == []: return '-.' return '+&*+'.join(strs) def decode(self, s): """Decodes a single string to a list of strings. :type s: str :rtype: L...
the_stack_v2_python_sparse
leetcode/String/encode-and-decode-strings.py
iCodeIN/competitive-programming-5
train
0
c47ffbcd8a6e1bfa57fed31ba19d1a05585ef46c
[ "if isinstance(db_value, (int, long, float)):\n return datetime.datetime.fromtimestamp(db_value)\nelse:\n return super(UTC_TimestampColumn, self).dbRestore(db_value, context=context)", "if isinstance(py_value, datetime.datetime):\n return time.mktime(py_value.timetuple())\nelse:\n return super(UTC_Tim...
<|body_start_0|> if isinstance(db_value, (int, long, float)): return datetime.datetime.fromtimestamp(db_value) else: return super(UTC_TimestampColumn, self).dbRestore(db_value, context=context) <|end_body_0|> <|body_start_1|> if isinstance(py_value, datetime.datetime): ...
UTC_TimestampColumn
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UTC_TimestampColumn: def dbRestore(self, db_value, context=None): """Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None""" <|body_0|> def dbStore(self, typ, py_value): """Converts the value to one that is safe to...
stack_v2_sparse_classes_36k_train_000048
16,562
permissive
[ { "docstring": "Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None", "name": "dbRestore", "signature": "def dbRestore(self, db_value, context=None)" }, { "docstring": "Converts the value to one that is safe to store on a record within the re...
3
null
Implement the Python class `UTC_TimestampColumn` described below. Class description: Implement the UTC_TimestampColumn class. Method signatures and docstrings: - def dbRestore(self, db_value, context=None): Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None - def...
Implement the Python class `UTC_TimestampColumn` described below. Class description: Implement the UTC_TimestampColumn class. Method signatures and docstrings: - def dbRestore(self, db_value, context=None): Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None - def...
575be2689cb269e65a0a2678232ff940acc19e5a
<|skeleton|> class UTC_TimestampColumn: def dbRestore(self, db_value, context=None): """Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None""" <|body_0|> def dbStore(self, typ, py_value): """Converts the value to one that is safe to...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UTC_TimestampColumn: def dbRestore(self, db_value, context=None): """Restores the value from a table cache for usage. :param value | <variant> context | <orb.Context> || None""" if isinstance(db_value, (int, long, float)): return datetime.datetime.fromtimestamp(db_value) el...
the_stack_v2_python_sparse
orb/core/column_types/dtime.py
orb-framework/orb
train
7
20b7ba6876119169e2a6403e797dc43e9c1161ed
[ "super(PositionalEncoding, self).__init__()\nself.d_model = d_model\nself.reverse = reverse\nself.xscale = math.sqrt(self.d_model)\nself.dropout = nn.Dropout(p=dropout_rate)\nself.pe = None\nself.extend_pe(torch.tensor(0.0).expand(1, max_len))", "if self.pe is not None:\n if self.pe.size(1) >= x.size(1):\n ...
<|body_start_0|> super(PositionalEncoding, self).__init__() self.d_model = d_model self.reverse = reverse self.xscale = math.sqrt(self.d_model) self.dropout = nn.Dropout(p=dropout_rate) self.pe = None self.extend_pe(torch.tensor(0.0).expand(1, max_len)) <|end_body...
Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position.
PositionalEncoding
[ "LicenseRef-scancode-unknown-license-reference", "MIT", "LGPL-2.1-or-later", "LicenseRef-scancode-free-unknown", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PositionalEncoding: """Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position.""" def __init__(self, d_model, dropout_rate, max_len=5000, reverse=False): """Construct an Positi...
stack_v2_sparse_classes_36k_train_000049
4,950
permissive
[ { "docstring": "Construct an PositionalEncoding object.", "name": "__init__", "signature": "def __init__(self, d_model, dropout_rate, max_len=5000, reverse=False)" }, { "docstring": "Reset the positional encodings.", "name": "extend_pe", "signature": "def extend_pe(self, x)" }, { ...
3
null
Implement the Python class `PositionalEncoding` described below. Class description: Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position. Method signatures and docstrings: - def __init__(self, d_model, dropou...
Implement the Python class `PositionalEncoding` described below. Class description: Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position. Method signatures and docstrings: - def __init__(self, d_model, dropou...
b60c741f746877293bb85eed6806736fc8fa0ffd
<|skeleton|> class PositionalEncoding: """Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position.""" def __init__(self, d_model, dropout_rate, max_len=5000, reverse=False): """Construct an Positi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PositionalEncoding: """Positional encoding. Args: d_model: Embedding dimension. dropout_rate: Dropout rate. max_len: Maximum input length. reverse: Whether to reverse the input position.""" def __init__(self, d_model, dropout_rate, max_len=5000, reverse=False): """Construct an PositionalEncoding ...
the_stack_v2_python_sparse
kosmos-2/fairseq/fairseq/modules/positional_encoding.py
microsoft/unilm
train
15,313
e64c0b7d85446ec91df94db1a1bf23d1b449fa6c
[ "text = unicode(text.lower())\nobj = cls.query.filter_by(user_id=user_id, text=text).first()\nif obj:\n return obj\nobj = cls(user_id=user_id, text=text)\ndb.session.add(obj)\ndb.session.commit()\nreturn obj", "if query == '':\n return []\nobjs = cls.query.filter_by(user_id=user_id)\nif query:\n query = ...
<|body_start_0|> text = unicode(text.lower()) obj = cls.query.filter_by(user_id=user_id, text=text).first() if obj: return obj obj = cls(user_id=user_id, text=text) db.session.add(obj) db.session.commit() return obj <|end_body_0|> <|body_start_1|> ...
Email history.
EmailHistory
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EmailHistory: """Email history.""" def get_or_create(cls, user_id, text): """Returns email history or creates a new one.""" <|body_0|> def get_by_user(cls, user_id, query=None, limit=None): """Returns email history by username.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_36k_train_000050
12,790
no_license
[ { "docstring": "Returns email history or creates a new one.", "name": "get_or_create", "signature": "def get_or_create(cls, user_id, text)" }, { "docstring": "Returns email history by username.", "name": "get_by_user", "signature": "def get_by_user(cls, user_id, query=None, limit=None)" ...
2
stack_v2_sparse_classes_30k_train_009470
Implement the Python class `EmailHistory` described below. Class description: Email history. Method signatures and docstrings: - def get_or_create(cls, user_id, text): Returns email history or creates a new one. - def get_by_user(cls, user_id, query=None, limit=None): Returns email history by username.
Implement the Python class `EmailHistory` described below. Class description: Email history. Method signatures and docstrings: - def get_or_create(cls, user_id, text): Returns email history or creates a new one. - def get_by_user(cls, user_id, query=None, limit=None): Returns email history by username. <|skeleton|> ...
e3947eaf035c2b06b2cee22f18fdec81c434ee84
<|skeleton|> class EmailHistory: """Email history.""" def get_or_create(cls, user_id, text): """Returns email history or creates a new one.""" <|body_0|> def get_by_user(cls, user_id, query=None, limit=None): """Returns email history by username.""" <|body_1|> <|end_skelet...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EmailHistory: """Email history.""" def get_or_create(cls, user_id, text): """Returns email history or creates a new one.""" text = unicode(text.lower()) obj = cls.query.filter_by(user_id=user_id, text=text).first() if obj: return obj obj = cls(user_id=u...
the_stack_v2_python_sparse
eucaby_api/models.py
tayduivn/eucaby
train
0
1bebf5d0ceac2ebb9379f272ee52d5b9dac018d6
[ "key = LibraryLocatorV2.from_string(lib_key_str)\ntext_search = request.query_params.get('text_search', None)\nblock_types = request.query_params.getlist('block_type') or None\napi.require_permission_for_library_key(key, request.user, permissions.CAN_VIEW_THIS_CONTENT_LIBRARY)\nresult = api.get_library_blocks(key, ...
<|body_start_0|> key = LibraryLocatorV2.from_string(lib_key_str) text_search = request.query_params.get('text_search', None) block_types = request.query_params.getlist('block_type') or None api.require_permission_for_library_key(key, request.user, permissions.CAN_VIEW_THIS_CONTENT_LIBRAR...
Views to work with XBlocks in a specific content library.
LibraryBlocksView
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LibraryBlocksView: """Views to work with XBlocks in a specific content library.""" def get(self, request, lib_key_str): """Get the list of all top-level blocks in this content library""" <|body_0|> def post(self, request, lib_key_str): """Add a new XBlock to this...
stack_v2_sparse_classes_36k_train_000051
42,120
permissive
[ { "docstring": "Get the list of all top-level blocks in this content library", "name": "get", "signature": "def get(self, request, lib_key_str)" }, { "docstring": "Add a new XBlock to this content library", "name": "post", "signature": "def post(self, request, lib_key_str)" } ]
2
null
Implement the Python class `LibraryBlocksView` described below. Class description: Views to work with XBlocks in a specific content library. Method signatures and docstrings: - def get(self, request, lib_key_str): Get the list of all top-level blocks in this content library - def post(self, request, lib_key_str): Add...
Implement the Python class `LibraryBlocksView` described below. Class description: Views to work with XBlocks in a specific content library. Method signatures and docstrings: - def get(self, request, lib_key_str): Get the list of all top-level blocks in this content library - def post(self, request, lib_key_str): Add...
5809eaca7079a15ee56b0b7fcfea425337046c97
<|skeleton|> class LibraryBlocksView: """Views to work with XBlocks in a specific content library.""" def get(self, request, lib_key_str): """Get the list of all top-level blocks in this content library""" <|body_0|> def post(self, request, lib_key_str): """Add a new XBlock to this...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LibraryBlocksView: """Views to work with XBlocks in a specific content library.""" def get(self, request, lib_key_str): """Get the list of all top-level blocks in this content library""" key = LibraryLocatorV2.from_string(lib_key_str) text_search = request.query_params.get('text_s...
the_stack_v2_python_sparse
Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/openedx/core/djangoapps/content_libraries/views.py
luque/better-ways-of-thinking-about-software
train
3
10694a2c346c7bbf0ded084c0fbb955183e7446f
[ "m, n = (len(haystack), len(needle))\nif n == 0:\n return 0\nif m < n:\n return -1\nlps = self.compute_lps(needle)\ni = j = 0\nwhile i < m and j < n:\n if haystack[i] == needle[j]:\n i += 1\n j += 1\n elif j > 0:\n j = lps[j - 1]\n else:\n i += 1\nif j == n:\n return i ...
<|body_start_0|> m, n = (len(haystack), len(needle)) if n == 0: return 0 if m < n: return -1 lps = self.compute_lps(needle) i = j = 0 while i < m and j < n: if haystack[i] == needle[j]: i += 1 j += 1 ...
@ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """@ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.""" def strStr_KMP(self, haystack, needle): """Get the index of first occurrence of n...
stack_v2_sparse_classes_36k_train_000052
4,964
no_license
[ { "docstring": "Get the index of first occurrence of needle in haystack. :param haystack: a text of strings :param needle: a string :return: the index of first occurrence of needle in haystack.", "name": "strStr_KMP", "signature": "def strStr_KMP(self, haystack, needle)" }, { "docstring": "Compu...
2
null
Implement the Python class `Solution` described below. Class description: @ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Method signatures and docstrings: - def strStr_KMP(self, ...
Implement the Python class `Solution` described below. Class description: @ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Method signatures and docstrings: - def strStr_KMP(self, ...
cbe6a7e7f05eccb4f9c5fce8651c0d87e5168516
<|skeleton|> class Solution: """@ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.""" def strStr_KMP(self, haystack, needle): """Get the index of first occurrence of n...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """@ Pocket Gems, Microsoft, Apple, Facebook Two Points, String Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.""" def strStr_KMP(self, haystack, needle): """Get the index of first occurrence of needle in hays...
the_stack_v2_python_sparse
src/string/leetcode28_KMP.py
apepkuss/Cracking-Leetcode-in-Python
train
2
36ccda21eaa2d7ed27da4f0d666ca2af786b5327
[ "log.info('Initialize the benchmark-operator object')\nself.args = kwargs\nself.repo = self.args.get('repo', BMO_REPO)\nself.branch = self.args.get('branch', 'master')\nself.namespace = BMO_NAME\nself.pgsql_is_setup = False\nself.ocp = OCP()\nself.ns_obj = OCP(kind='namespace')\nself.pod_obj = OCP(namespace=BMO_NAM...
<|body_start_0|> log.info('Initialize the benchmark-operator object') self.args = kwargs self.repo = self.args.get('repo', BMO_REPO) self.branch = self.args.get('branch', 'master') self.namespace = BMO_NAME self.pgsql_is_setup = False self.ocp = OCP() self...
Workload operation using Benchmark-Operator
BenchmarkOperator
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BenchmarkOperator: """Workload operation using Benchmark-Operator""" def __init__(self, **kwargs): """Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwargs (dict): Following kwargs are valid repo: benchmark-oper...
stack_v2_sparse_classes_36k_train_000053
7,656
permissive
[ { "docstring": "Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwargs (dict): Following kwargs are valid repo: benchmark-operator repo to used - a github link branch: branch to use from the repo Example Usage: r1 = BenchmarkOperator() r1.d...
6
stack_v2_sparse_classes_30k_train_001517
Implement the Python class `BenchmarkOperator` described below. Class description: Workload operation using Benchmark-Operator Method signatures and docstrings: - def __init__(self, **kwargs): Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwarg...
Implement the Python class `BenchmarkOperator` described below. Class description: Workload operation using Benchmark-Operator Method signatures and docstrings: - def __init__(self, **kwargs): Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwarg...
5e9e504957403148e413326f65c3769bf9d8eb39
<|skeleton|> class BenchmarkOperator: """Workload operation using Benchmark-Operator""" def __init__(self, **kwargs): """Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwargs (dict): Following kwargs are valid repo: benchmark-oper...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BenchmarkOperator: """Workload operation using Benchmark-Operator""" def __init__(self, **kwargs): """Initializer function. Initialize object variables, clone the benchmark operator repo. and label the worker nodes. Args: kwargs (dict): Following kwargs are valid repo: benchmark-operator repo to ...
the_stack_v2_python_sparse
ocs_ci/ocs/benchmark_operator.py
red-hat-storage/ocs-ci
train
146
ec55e7e8567fa0615f54ad5159259e02c2c55149
[ "recipe = Recipe.get_by_id(recipe_id=recipe_id)\nif recipe is None:\n return ({'message': 'Recipe not found'}, HTTPStatus.NOT_FOUND)\ncurrent_user = get_jwt_identity()\nif recipe.is_publish == False and recipe.user_id != current_user:\n return ({'message': 'Access is not allowed'}, HTTPStatus.FORBIDDEN)\nretu...
<|body_start_0|> recipe = Recipe.get_by_id(recipe_id=recipe_id) if recipe is None: return ({'message': 'Recipe not found'}, HTTPStatus.NOT_FOUND) current_user = get_jwt_identity() if recipe.is_publish == False and recipe.user_id != current_user: return ({'message'...
RecipeResource
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RecipeResource: def get(self, recipe_id): """This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe.""" <|body_0|> def patch(self, recipe_id): """Makes modifications to a preexisting re...
stack_v2_sparse_classes_36k_train_000054
8,070
no_license
[ { "docstring": "This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe.", "name": "get", "signature": "def get(self, recipe_id)" }, { "docstring": "Makes modifications to a preexisting recipe. The JSON Web Token fr...
3
stack_v2_sparse_classes_30k_train_004280
Implement the Python class `RecipeResource` described below. Class description: Implement the RecipeResource class. Method signatures and docstrings: - def get(self, recipe_id): This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe. - ...
Implement the Python class `RecipeResource` described below. Class description: Implement the RecipeResource class. Method signatures and docstrings: - def get(self, recipe_id): This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe. - ...
875b8bc3cc5315efe8ccee8ce9b312056802c49d
<|skeleton|> class RecipeResource: def get(self, recipe_id): """This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe.""" <|body_0|> def patch(self, recipe_id): """Makes modifications to a preexisting re...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RecipeResource: def get(self, recipe_id): """This function sends the command GET to the backend server in order to get the requested recipe. :param: recipe_id : the id of the recipe.""" recipe = Recipe.get_by_id(recipe_id=recipe_id) if recipe is None: return ({'message': 'R...
the_stack_v2_python_sparse
resources/recipe.py
ShayanRiyaz/TheDailyCook
train
1
e4b9c2768eb989fe35a7bcd58d25ead51fbb4f67
[ "name = 'test'\nplay = player.Player(name)\nself.assertIsInstance(play, player.Player)\nself.assertEqual(play.score, 0)\nself.assertEqual(play.name, name)", "name = 'test'\nplay = player.Player(name)\nrename = 'test2'\nres = play.rename(rename)\nexp = res == play.name\nself.assertTrue(exp)", "name = 'test'\npla...
<|body_start_0|> name = 'test' play = player.Player(name) self.assertIsInstance(play, player.Player) self.assertEqual(play.score, 0) self.assertEqual(play.name, name) <|end_body_0|> <|body_start_1|> name = 'test' play = player.Player(name) rename = 'test2...
Test the class.
TestPlayer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestPlayer: """Test the class.""" def test_init_default_object(self): """Instantiate an object and check its properties.""" <|body_0|> def test_rename(self): """Test the rename method checks if passed name is name.""" <|body_1|> def test_get_name(sel...
stack_v2_sparse_classes_36k_train_000055
1,711
permissive
[ { "docstring": "Instantiate an object and check its properties.", "name": "test_init_default_object", "signature": "def test_init_default_object(self)" }, { "docstring": "Test the rename method checks if passed name is name.", "name": "test_rename", "signature": "def test_rename(self)" ...
6
stack_v2_sparse_classes_30k_val_000204
Implement the Python class `TestPlayer` described below. Class description: Test the class. Method signatures and docstrings: - def test_init_default_object(self): Instantiate an object and check its properties. - def test_rename(self): Test the rename method checks if passed name is name. - def test_get_name(self): ...
Implement the Python class `TestPlayer` described below. Class description: Test the class. Method signatures and docstrings: - def test_init_default_object(self): Instantiate an object and check its properties. - def test_rename(self): Test the rename method checks if passed name is name. - def test_get_name(self): ...
91af7c8807acba9069fb5d1204e63d96b9618141
<|skeleton|> class TestPlayer: """Test the class.""" def test_init_default_object(self): """Instantiate an object and check its properties.""" <|body_0|> def test_rename(self): """Test the rename method checks if passed name is name.""" <|body_1|> def test_get_name(sel...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestPlayer: """Test the class.""" def test_init_default_object(self): """Instantiate an object and check its properties.""" name = 'test' play = player.Player(name) self.assertIsInstance(play, player.Player) self.assertEqual(play.score, 0) self.assertEqual(...
the_stack_v2_python_sparse
Application/player_test.py
mj6meron/dice-game-project
train
1
3f186a212a0a320aaddac7c92036bc2c94a168d4
[ "self.eta = eta\nself.epsilon = epsilon\nself.classifiers = None\nself.penalty = penalty\nself.l2_lambda = l2_lambda\nself.max_iter = max_iter\nself.verbose = verbose", "n_classifiers = _calculate_number_classes(y)\nif self.verbose:\n print('n_classifiers', n_classifiers)\nclassifiers = []\nfor k in range(n_cl...
<|body_start_0|> self.eta = eta self.epsilon = epsilon self.classifiers = None self.penalty = penalty self.l2_lambda = l2_lambda self.max_iter = max_iter self.verbose = verbose <|end_body_0|> <|body_start_1|> n_classifiers = _calculate_number_classes(y) ...
Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions.
MulticlassLogisticRegression
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class MulticlassLogisticRegression: """Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions.""" def __init__(self, eta, epsilon, penalty=None, l2_lambda=0, max_iter=100, ver...
stack_v2_sparse_classes_36k_train_000056
7,643
no_license
[ { "docstring": "Initializes an instance. :param eta: float, learning rate :param epsilon: float, convergence threshold :param penalty: str, penalty type to use. Default is None. Current implementation allows 'l2'. :param l2_lambda: float, value of l2 penalty if that penalty is used. Default is 0. :param max_ite...
4
stack_v2_sparse_classes_30k_train_005558
Implement the Python class `MulticlassLogisticRegression` described below. Class description: Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions. Method signatures and docstrings: - def __ini...
Implement the Python class `MulticlassLogisticRegression` described below. Class description: Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions. Method signatures and docstrings: - def __ini...
13bccaec8d90e70715d2d8791c9098ff141ae377
<|skeleton|> class MulticlassLogisticRegression: """Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions.""" def __init__(self, eta, epsilon, penalty=None, l2_lambda=0, max_iter=100, ver...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class MulticlassLogisticRegression: """Implements multiclass logistic regression. This version stores the binary Logistic Regression classifiers fit to each class, and it uses the classifiers directly for predictions.""" def __init__(self, eta, epsilon, penalty=None, l2_lambda=0, max_iter=100, verbose=False): ...
the_stack_v2_python_sparse
packages/linear_model/MulticlassLogisticRegression.py
ryanquinnnelson/CMU-02620-Taxonomic-Binning-for-Metagenomics
train
0
72e145095956267476b7ebf802d0115640cb0378
[ "if type(point) == type(list()) or type(point) == type(set):\n if keys_only:\n return [db.GqlQuery('SELECT __key__ FROM RoutePoint WHERE point = :1', db.GeoPt(round(p.lat, PRECISION), round(p.lon, PRECISION))).get() for p in point]\n return [RoutePoint.gql('WHERE point = :1', db.GeoPt(round(p.lat, PREC...
<|body_start_0|> if type(point) == type(list()) or type(point) == type(set): if keys_only: return [db.GqlQuery('SELECT __key__ FROM RoutePoint WHERE point = :1', db.GeoPt(round(p.lat, PRECISION), round(p.lon, PRECISION))).get() for p in point] return [RoutePoint.gql('WHER...
Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects`
RoutePointHelper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RoutePointHelper: """Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects`""" def get(self, point, keys_only=False): """Returns the :class:`RoutePoint` for this point or list of poitns :param point: point or list searching :type point: :class:`db.GeoPt` :par...
stack_v2_sparse_classes_36k_train_000057
19,846
no_license
[ { "docstring": "Returns the :class:`RoutePoint` for this point or list of poitns :param point: point or list searching :type point: :class:`db.GeoPt` :param keys_only: True if only wants instances' keys :type keys_only: bool :returns: None or :class:`RoutePoint`", "name": "get", "signature": "def get(se...
2
stack_v2_sparse_classes_30k_train_006849
Implement the Python class `RoutePointHelper` described below. Class description: Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects` Method signatures and docstrings: - def get(self, point, keys_only=False): Returns the :class:`RoutePoint` for this point or list of poitns :param point: po...
Implement the Python class `RoutePointHelper` described below. Class description: Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects` Method signatures and docstrings: - def get(self, point, keys_only=False): Returns the :class:`RoutePoint` for this point or list of poitns :param point: po...
d441693eedb32c36fe853895110df808a9959941
<|skeleton|> class RoutePointHelper: """Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects`""" def get(self, point, keys_only=False): """Returns the :class:`RoutePoint` for this point or list of poitns :param point: point or list searching :type point: :class:`db.GeoPt` :par...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RoutePointHelper: """Helper function for :class:`RoutePoint`, accesed by :class:`RoutePoint.objects`""" def get(self, point, keys_only=False): """Returns the :class:`RoutePoint` for this point or list of poitns :param point: point or list searching :type point: :class:`db.GeoPt` :param keys_only:...
the_stack_v2_python_sparse
src/webapp/georoute/models.py
GeoRemindMe/GeoRemindMe_Web
train
8
8718d7ebfd7c971ab7416f4666f5b80f320e1bfa
[ "if not root:\n return None\nleft = root.left\nright = root.right\nroot.left = None\nroot.right = left\nself.flatten(left)\nwhile root.right:\n root = root.right\nroot.right = right\nself.flatten(right)", "stack = [root] if root else []\nwhile stack:\n tree = stack.pop()\n if tree.right:\n stac...
<|body_start_0|> if not root: return None left = root.left right = root.right root.left = None root.right = left self.flatten(left) while root.right: root = root.right root.right = right self.flatten(right) <|end_body_0|> <...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def flatten(self, root: TreeNode) -> None: """Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return:""" <|body_0|> def flatten_stack(self, root: TreeNode) -> None: """Do not return anything, modify root in-place instead....
stack_v2_sparse_classes_36k_train_000058
1,516
no_license
[ { "docstring": "Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return:", "name": "flatten", "signature": "def flatten(self, root: TreeNode) -> None" }, { "docstring": "Do not return anything, modify root in-place instead. 栈,依次压缩,先进后出,也可以用队列,一样的。 :param root: ...
2
stack_v2_sparse_classes_30k_train_010673
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def flatten(self, root: TreeNode) -> None: Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return: - def flatten_stack(self, root: TreeNode) -...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def flatten(self, root: TreeNode) -> None: Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return: - def flatten_stack(self, root: TreeNode) -...
f2c162654a83c51495ebd161f42a1d0b69caf72d
<|skeleton|> class Solution: def flatten(self, root: TreeNode) -> None: """Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return:""" <|body_0|> def flatten_stack(self, root: TreeNode) -> None: """Do not return anything, modify root in-place instead....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def flatten(self, root: TreeNode) -> None: """Do not return anything, modify root in-place instead. 递归算法,注意要把右节点关联; :param root: :return:""" if not root: return None left = root.left right = root.right root.left = None root.right = left ...
the_stack_v2_python_sparse
114 flatten.py
ABenxj/leetcode
train
1
ae969a4cd5942ec4f9630e9df878edadebf26267
[ "m = len(s)\nif m <= 1:\n return m\nself.memo = set()\ntot = 0\nfor i in range(m):\n for j in range(i + 1, m + 1):\n if self.isPalindrome_memo(s, i, j):\n tot += 1\nreturn tot", "if (i, j) in self.memo:\n return True\nm = len(s)\nif not (i >= 0 and j <= m):\n return False\nif i == j:...
<|body_start_0|> m = len(s) if m <= 1: return m self.memo = set() tot = 0 for i in range(m): for j in range(i + 1, m + 1): if self.isPalindrome_memo(s, i, j): tot += 1 return tot <|end_body_0|> <|body_start_1|> ...
method 3, with memoization, still time out
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: """method 3, with memoization, still time out""" def countSubstrings(self, s): """:type s: str :rtype: int""" <|body_0|> def isPalindrome_memo(self, s, i, j): """is s[i:j] a palindrome?""" <|body_1|> <|end_skeleton|> <|body_start_0|> m...
stack_v2_sparse_classes_36k_train_000059
5,241
no_license
[ { "docstring": ":type s: str :rtype: int", "name": "countSubstrings", "signature": "def countSubstrings(self, s)" }, { "docstring": "is s[i:j] a palindrome?", "name": "isPalindrome_memo", "signature": "def isPalindrome_memo(self, s, i, j)" } ]
2
stack_v2_sparse_classes_30k_train_004766
Implement the Python class `Solution` described below. Class description: method 3, with memoization, still time out Method signatures and docstrings: - def countSubstrings(self, s): :type s: str :rtype: int - def isPalindrome_memo(self, s, i, j): is s[i:j] a palindrome?
Implement the Python class `Solution` described below. Class description: method 3, with memoization, still time out Method signatures and docstrings: - def countSubstrings(self, s): :type s: str :rtype: int - def isPalindrome_memo(self, s, i, j): is s[i:j] a palindrome? <|skeleton|> class Solution: """method 3,...
e00cf94c5b86c8cca27e3bee69ad21e727b7679b
<|skeleton|> class Solution: """method 3, with memoization, still time out""" def countSubstrings(self, s): """:type s: str :rtype: int""" <|body_0|> def isPalindrome_memo(self, s, i, j): """is s[i:j] a palindrome?""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: """method 3, with memoization, still time out""" def countSubstrings(self, s): """:type s: str :rtype: int""" m = len(s) if m <= 1: return m self.memo = set() tot = 0 for i in range(m): for j in range(i + 1, m + 1): ...
the_stack_v2_python_sparse
strings/prob647.py
binchen15/leet-python
train
1
9be5b4cff2d653ec53aa4fb994f953c190cd407b
[ "shortcut = data\nbm1 = BatchNormalization(axis=chanDim, epsilon=bnEps, momentum=bnMom)(data)\nact1 = Activation('relu')(bm1)\nconv1 = Conv2D(int(K * 0.25), (1, 1), use_bias=False, kernel_regularizer=l2(reg))(act1)\nbn2 = BatchNormalization(axis=chanDim, epsilon=bnEps, momentum=bnMom)(conv1)\nact2 = Activation('rel...
<|body_start_0|> shortcut = data bm1 = BatchNormalization(axis=chanDim, epsilon=bnEps, momentum=bnMom)(data) act1 = Activation('relu')(bm1) conv1 = Conv2D(int(K * 0.25), (1, 1), use_bias=False, kernel_regularizer=l2(reg))(act1) bn2 = BatchNormalization(axis=chanDim, epsilon=bnEps...
ResNet
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResNet: def residual_module(data, K, stride, chanDim, red=False, reg=0.0001, bnEps=2e-05, bnMom=0.9): """Args: data: input K: number of output, aka filters stride: convolution stride chanDim: channel dimension red: sign whether this module response to reduce spatial dimension bnEps: bn l...
stack_v2_sparse_classes_36k_train_000060
3,786
permissive
[ { "docstring": "Args: data: input K: number of output, aka filters stride: convolution stride chanDim: channel dimension red: sign whether this module response to reduce spatial dimension bnEps: bn layer eps bnMon: bn layer momentum", "name": "residual_module", "signature": "def residual_module(data, K,...
2
null
Implement the Python class `ResNet` described below. Class description: Implement the ResNet class. Method signatures and docstrings: - def residual_module(data, K, stride, chanDim, red=False, reg=0.0001, bnEps=2e-05, bnMom=0.9): Args: data: input K: number of output, aka filters stride: convolution stride chanDim: c...
Implement the Python class `ResNet` described below. Class description: Implement the ResNet class. Method signatures and docstrings: - def residual_module(data, K, stride, chanDim, red=False, reg=0.0001, bnEps=2e-05, bnMom=0.9): Args: data: input K: number of output, aka filters stride: convolution stride chanDim: c...
69727d76fd652390d9660e9ea4354ba5cc76dd5c
<|skeleton|> class ResNet: def residual_module(data, K, stride, chanDim, red=False, reg=0.0001, bnEps=2e-05, bnMom=0.9): """Args: data: input K: number of output, aka filters stride: convolution stride chanDim: channel dimension red: sign whether this module response to reduce spatial dimension bnEps: bn l...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResNet: def residual_module(data, K, stride, chanDim, red=False, reg=0.0001, bnEps=2e-05, bnMom=0.9): """Args: data: input K: number of output, aka filters stride: convolution stride chanDim: channel dimension red: sign whether this module response to reduce spatial dimension bnEps: bn layer eps bnMon...
the_stack_v2_python_sparse
books/dl-for-cv-with-python/network/pyimage/nn/conv/resnet.py
Bingwen-Hu/hackaway
train
0
074723f526b205c1a680fccc6c0c61f2f2fc7011
[ "certPath = '..\\\\testCerts\\\\caBasicConstNotCrit.pem'\nlint_basic_constraints_not_critical.init()\nwith open(certPath, 'rb') as f:\n cert = x509.load_pem_x509_certificate(f.read(), default_backend())\n out = base.Lints['e_basic_constraints_not_critical'].Execute(cert)\n self.assertEqual(base.LintStatus....
<|body_start_0|> certPath = '..\\testCerts\\caBasicConstNotCrit.pem' lint_basic_constraints_not_critical.init() with open(certPath, 'rb') as f: cert = x509.load_pem_x509_certificate(f.read(), default_backend()) out = base.Lints['e_basic_constraints_not_critical'].Execute(...
Test lint_basic_constraints_not_critical.py
test_lint_basic_constraints_not_critical
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class test_lint_basic_constraints_not_critical: """Test lint_basic_constraints_not_critical.py""" def test_BasicConstNotCrit(self): """Test BasicConstNotCrit""" <|body_0|> def test_BasicConstCrit(self): """Test lint_basic_constraints_critical.py""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_000061
1,324
no_license
[ { "docstring": "Test BasicConstNotCrit", "name": "test_BasicConstNotCrit", "signature": "def test_BasicConstNotCrit(self)" }, { "docstring": "Test lint_basic_constraints_critical.py", "name": "test_BasicConstCrit", "signature": "def test_BasicConstCrit(self)" } ]
2
stack_v2_sparse_classes_30k_train_001058
Implement the Python class `test_lint_basic_constraints_not_critical` described below. Class description: Test lint_basic_constraints_not_critical.py Method signatures and docstrings: - def test_BasicConstNotCrit(self): Test BasicConstNotCrit - def test_BasicConstCrit(self): Test lint_basic_constraints_critical.py
Implement the Python class `test_lint_basic_constraints_not_critical` described below. Class description: Test lint_basic_constraints_not_critical.py Method signatures and docstrings: - def test_BasicConstNotCrit(self): Test BasicConstNotCrit - def test_BasicConstCrit(self): Test lint_basic_constraints_critical.py <...
c7e7ca27e5d04bbaa4e7ad71d8e86ec5c9388987
<|skeleton|> class test_lint_basic_constraints_not_critical: """Test lint_basic_constraints_not_critical.py""" def test_BasicConstNotCrit(self): """Test BasicConstNotCrit""" <|body_0|> def test_BasicConstCrit(self): """Test lint_basic_constraints_critical.py""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class test_lint_basic_constraints_not_critical: """Test lint_basic_constraints_not_critical.py""" def test_BasicConstNotCrit(self): """Test BasicConstNotCrit""" certPath = '..\\testCerts\\caBasicConstNotCrit.pem' lint_basic_constraints_not_critical.init() with open(certPath, 'rb...
the_stack_v2_python_sparse
testlints/test_lint_basic_constraints_not_critical.py
846468230/Plint
train
1
5f36143ce6ac8912a92f1fc74193b40e0de86b37
[ "raw_config = self.config.to_dict()\nraw_config.type = self.config.type\nmap_dict = LossMappingDict()\nself.map_config = ConfigBackendMapping(map_dict.type_mapping_dict, map_dict.params_mapping_dict).backend_mapping(raw_config)\nself._cls = ClassFactory.get_cls(ClassType.LOSS, self.map_config.type)", "params = se...
<|body_start_0|> raw_config = self.config.to_dict() raw_config.type = self.config.type map_dict = LossMappingDict() self.map_config = ConfigBackendMapping(map_dict.type_mapping_dict, map_dict.params_mapping_dict).backend_mapping(raw_config) self._cls = ClassFactory.get_cls(ClassT...
Register and call loss class.
Loss
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Loss: """Register and call loss class.""" def __init__(self): """Initialize.""" <|body_0|> def __call__(self): """Call loss cls.""" <|body_1|> <|end_skeleton|> <|body_start_0|> raw_config = self.config.to_dict() raw_config.type = self.co...
stack_v2_sparse_classes_36k_train_000062
2,965
permissive
[ { "docstring": "Initialize.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Call loss cls.", "name": "__call__", "signature": "def __call__(self)" } ]
2
null
Implement the Python class `Loss` described below. Class description: Register and call loss class. Method signatures and docstrings: - def __init__(self): Initialize. - def __call__(self): Call loss cls.
Implement the Python class `Loss` described below. Class description: Register and call loss class. Method signatures and docstrings: - def __init__(self): Initialize. - def __call__(self): Call loss cls. <|skeleton|> class Loss: """Register and call loss class.""" def __init__(self): """Initialize....
12e37a1991eb6771a2999fe0a46ddda920c47948
<|skeleton|> class Loss: """Register and call loss class.""" def __init__(self): """Initialize.""" <|body_0|> def __call__(self): """Call loss cls.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Loss: """Register and call loss class.""" def __init__(self): """Initialize.""" raw_config = self.config.to_dict() raw_config.type = self.config.type map_dict = LossMappingDict() self.map_config = ConfigBackendMapping(map_dict.type_mapping_dict, map_dict.params_map...
the_stack_v2_python_sparse
vega/modules/loss/loss.py
huawei-noah/vega
train
850
896d982665ddacfd00e271fcae2e6ee926006087
[ "args = self._gcloud_command\nlogging.info('Testapp sent: %s', ' '.join(args))\nresult = subprocess.run(args=args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, check=False)\nlogging.info('Finished: %s\\n%s', ' '.join(args), result.stdout)\nif result.returncode:\n logging.error('gCloud returned no...
<|body_start_0|> args = self._gcloud_command logging.info('Testapp sent: %s', ' '.join(args)) result = subprocess.run(args=args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, check=False) logging.info('Finished: %s\n%s', ' '.join(args), result.stdout) if result.ret...
Holds data related to the testing of one testapp.
Test
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test: """Holds data related to the testing of one testapp.""" def run(self): """Send the testapp to FTL for testing and wait for it to finish.""" <|body_0|> def _gcloud_command(self): """Returns the args to send this testapp to FTL on the command line.""" ...
stack_v2_sparse_classes_36k_train_000063
11,722
permissive
[ { "docstring": "Send the testapp to FTL for testing and wait for it to finish.", "name": "run", "signature": "def run(self)" }, { "docstring": "Returns the args to send this testapp to FTL on the command line.", "name": "_gcloud_command", "signature": "def _gcloud_command(self)" }, {...
3
stack_v2_sparse_classes_30k_train_007112
Implement the Python class `Test` described below. Class description: Holds data related to the testing of one testapp. Method signatures and docstrings: - def run(self): Send the testapp to FTL for testing and wait for it to finish. - def _gcloud_command(self): Returns the args to send this testapp to FTL on the com...
Implement the Python class `Test` described below. Class description: Holds data related to the testing of one testapp. Method signatures and docstrings: - def run(self): Send the testapp to FTL for testing and wait for it to finish. - def _gcloud_command(self): Returns the args to send this testapp to FTL on the com...
2cb4b45dd14a230aa0e800042e893f8dfb23beda
<|skeleton|> class Test: """Holds data related to the testing of one testapp.""" def run(self): """Send the testapp to FTL for testing and wait for it to finish.""" <|body_0|> def _gcloud_command(self): """Returns the args to send this testapp to FTL on the command line.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test: """Holds data related to the testing of one testapp.""" def run(self): """Send the testapp to FTL for testing and wait for it to finish.""" args = self._gcloud_command logging.info('Testapp sent: %s', ' '.join(args)) result = subprocess.run(args=args, stdout=subproce...
the_stack_v2_python_sparse
MY_REPOS/misc-experiments/_FIREBFIRE/firebase-unity-sdk/scripts/gha/test_lab.py
bgoonz/UsefulResourceRepo2.0
train
10
942f7e2ac06f33815a91e6f04e0527deb23a6d66
[ "expected_shape = (1, 5, 5)\nplugin = RecursiveFilter(iterations=self.iterations)\nresult = plugin(self.cube, smoothing_coefficients=self.smoothing_coefficients)\nself.assertIsInstance(result, Cube)\nself.assertEqual(result.shape, expected_shape)\nself.assertEqual(result.shape, expected_shape)", "plugin = Recursi...
<|body_start_0|> expected_shape = (1, 5, 5) plugin = RecursiveFilter(iterations=self.iterations) result = plugin(self.cube, smoothing_coefficients=self.smoothing_coefficients) self.assertIsInstance(result, Cube) self.assertEqual(result.shape, expected_shape) self.assertEq...
Test the process method.
Test_process
[ "BSD-3-Clause", "LicenseRef-scancode-proprietary-license" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Test_process: """Test the process method.""" def test_return_type_and_shape(self): """Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape.""" <|body_0|> def test_smoothing_coefficient_cubes(self): """Test that the RecursiveFilter ...
stack_v2_sparse_classes_36k_train_000064
22,857
permissive
[ { "docstring": "Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape.", "name": "test_return_type_and_shape", "signature": "def test_return_type_and_shape(self)" }, { "docstring": "Test that the RecursiveFilter plugin returns the correct data.", "name": "test_...
5
null
Implement the Python class `Test_process` described below. Class description: Test the process method. Method signatures and docstrings: - def test_return_type_and_shape(self): Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape. - def test_smoothing_coefficient_cubes(self): Test that...
Implement the Python class `Test_process` described below. Class description: Test the process method. Method signatures and docstrings: - def test_return_type_and_shape(self): Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape. - def test_smoothing_coefficient_cubes(self): Test that...
cd2c9019944345df1e703bf8f625db537ad9f559
<|skeleton|> class Test_process: """Test the process method.""" def test_return_type_and_shape(self): """Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape.""" <|body_0|> def test_smoothing_coefficient_cubes(self): """Test that the RecursiveFilter ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Test_process: """Test the process method.""" def test_return_type_and_shape(self): """Test that the RecursiveFilter plugin returns an iris.cube.Cube of the expected shape.""" expected_shape = (1, 5, 5) plugin = RecursiveFilter(iterations=self.iterations) result = plugin(se...
the_stack_v2_python_sparse
improver_tests/nbhood/recursive_filter/test_RecursiveFilter.py
metoppv/improver
train
101
0e854a71321f5444b3a2f992ed4427f0f0f830c8
[ "self.run.start()\ncurrent_stage = self.run.start_stage\ntry:\n intent_input = self.intent_input\n if current_stage == PipelineStage.STT:\n assert self.stt_metadata is not None\n assert self.stt_stream is not None\n intent_input = await self.run.speech_to_text(self.stt_metadata, self.stt_...
<|body_start_0|> self.run.start() current_stage = self.run.start_stage try: intent_input = self.intent_input if current_stage == PipelineStage.STT: assert self.stt_metadata is not None assert self.stt_stream is not None inte...
Input to a pipeline run.
PipelineInput
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PipelineInput: """Input to a pipeline run.""" async def execute(self) -> None: """Run pipeline.""" <|body_0|> async def validate(self) -> None: """Validate pipeline input against start stage.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self....
stack_v2_sparse_classes_36k_train_000065
31,871
permissive
[ { "docstring": "Run pipeline.", "name": "execute", "signature": "async def execute(self) -> None" }, { "docstring": "Validate pipeline input against start stage.", "name": "validate", "signature": "async def validate(self) -> None" } ]
2
stack_v2_sparse_classes_30k_train_019132
Implement the Python class `PipelineInput` described below. Class description: Input to a pipeline run. Method signatures and docstrings: - async def execute(self) -> None: Run pipeline. - async def validate(self) -> None: Validate pipeline input against start stage.
Implement the Python class `PipelineInput` described below. Class description: Input to a pipeline run. Method signatures and docstrings: - async def execute(self) -> None: Run pipeline. - async def validate(self) -> None: Validate pipeline input against start stage. <|skeleton|> class PipelineInput: """Input to...
2e65b77b2b5c17919939481f327963abdfdc53f0
<|skeleton|> class PipelineInput: """Input to a pipeline run.""" async def execute(self) -> None: """Run pipeline.""" <|body_0|> async def validate(self) -> None: """Validate pipeline input against start stage.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PipelineInput: """Input to a pipeline run.""" async def execute(self) -> None: """Run pipeline.""" self.run.start() current_stage = self.run.start_stage try: intent_input = self.intent_input if current_stage == PipelineStage.STT: ass...
the_stack_v2_python_sparse
homeassistant/components/assist_pipeline/pipeline.py
konnected-io/home-assistant
train
24
45495d78dc570079e39a7f66c7581619565bd988
[ "self.var_dict = self.get_raw_dict()\npuller_params = default_config.DEFAULT_PULLER_CONF.copy()\ndb_params = default_config.DEFAULT_DB_CONF.copy()\ntry:\n puller_params.update(self.get_dict('puller'))\n db_params.update(self.get_dict('database'))\nexcept ValueError as error_info:\n sys.stderr.write(error_i...
<|body_start_0|> self.var_dict = self.get_raw_dict() puller_params = default_config.DEFAULT_PULLER_CONF.copy() db_params = default_config.DEFAULT_DB_CONF.copy() try: puller_params.update(self.get_dict('puller')) db_params.update(self.get_dict('database')) ...
StorageConfigParser
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StorageConfigParser: def config_parse(self): """parse configuration from config file and default config""" <|body_0|> def get_db_from_config(self): """get database connection instance from config""" <|body_1|> def get_puller_from_config(self): ""...
stack_v2_sparse_classes_36k_train_000066
1,624
no_license
[ { "docstring": "parse configuration from config file and default config", "name": "config_parse", "signature": "def config_parse(self)" }, { "docstring": "get database connection instance from config", "name": "get_db_from_config", "signature": "def get_db_from_config(self)" }, { ...
3
stack_v2_sparse_classes_30k_train_011039
Implement the Python class `StorageConfigParser` described below. Class description: Implement the StorageConfigParser class. Method signatures and docstrings: - def config_parse(self): parse configuration from config file and default config - def get_db_from_config(self): get database connection instance from config...
Implement the Python class `StorageConfigParser` described below. Class description: Implement the StorageConfigParser class. Method signatures and docstrings: - def config_parse(self): parse configuration from config file and default config - def get_db_from_config(self): get database connection instance from config...
8819fc30456b4bb8576a4c78798ec91cdc8ac062
<|skeleton|> class StorageConfigParser: def config_parse(self): """parse configuration from config file and default config""" <|body_0|> def get_db_from_config(self): """get database connection instance from config""" <|body_1|> def get_puller_from_config(self): ""...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StorageConfigParser: def config_parse(self): """parse configuration from config file and default config""" self.var_dict = self.get_raw_dict() puller_params = default_config.DEFAULT_PULLER_CONF.copy() db_params = default_config.DEFAULT_DB_CONF.copy() try: pu...
the_stack_v2_python_sparse
storage/config/config_parser.py
zhxfei/monitor
train
1
6b8eb61529efe07a400cf6b1ca9a4fcdf2a56e87
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn CallRecordingEventMessageDetail()", "from .call_recording_status import CallRecordingStatus\nfrom .event_message_detail import EventMessageDetail\nfrom .identity_set import IdentitySet\nfrom .call_recording_status import CallRecordingS...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return CallRecordingEventMessageDetail() <|end_body_0|> <|body_start_1|> from .call_recording_status import CallRecordingStatus from .event_message_detail import EventMessageDetail from...
CallRecordingEventMessageDetail
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CallRecordingEventMessageDetail: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> CallRecordingEventMessageDetail: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator...
stack_v2_sparse_classes_36k_train_000067
4,271
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: CallRecordingEventMessageDetail", "name": "create_from_discriminator_value", "signature": "def create_from_d...
3
stack_v2_sparse_classes_30k_train_019672
Implement the Python class `CallRecordingEventMessageDetail` described below. Class description: Implement the CallRecordingEventMessageDetail class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> CallRecordingEventMessageDetail: Creates a new instance...
Implement the Python class `CallRecordingEventMessageDetail` described below. Class description: Implement the CallRecordingEventMessageDetail class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> CallRecordingEventMessageDetail: Creates a new instance...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class CallRecordingEventMessageDetail: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> CallRecordingEventMessageDetail: """Creates a new instance of the appropriate class based on discriminator value Args: parse_node: The parse node to use to read the discriminator...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CallRecordingEventMessageDetail: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> CallRecordingEventMessageDetail: """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 cre...
the_stack_v2_python_sparse
msgraph/generated/models/call_recording_event_message_detail.py
microsoftgraph/msgraph-sdk-python
train
135
4a2ade274fe6ba884361e17cba7132e023e8c16f
[ "if type(ids) != str:\n raise ValueError('ids must be a comma separated string. E.g. ids=BTC,ETH,XRP')\nif interval and type(interval) != str:\n raise ValueError('interval must be a comma separated string. E.g. 1d,7d,30d,365d,ytd')\nurl = self.client.get_url('currencies/ticker')\nparams = {'ids': ids, 'interv...
<|body_start_0|> if type(ids) != str: raise ValueError('ids must be a comma separated string. E.g. ids=BTC,ETH,XRP') if interval and type(interval) != str: raise ValueError('interval must be a comma separated string. E.g. 1d,7d,30d,365d,ytd') url = self.client.get_url('cu...
Currencies
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Currencies: def get_currencies(self, ids, interval=None, convert=None, status=None, filter=None, sort=None, include_transparency=False, per_page=None, page=None): """Returns price, volume, market cap, and rank for all currencies :param str ids: Comma separated list of Nomics Currency IDs...
stack_v2_sparse_classes_36k_train_000068
5,647
permissive
[ { "docstring": "Returns price, volume, market cap, and rank for all currencies :param str ids: Comma separated list of Nomics Currency IDs to filter result rows. :param str interval: Comma separated time interval of the ticker(s). Default is 1d,7d,30d,365d,ytd :param str convert: Currency to quote ticker price,...
4
stack_v2_sparse_classes_30k_train_008606
Implement the Python class `Currencies` described below. Class description: Implement the Currencies class. Method signatures and docstrings: - def get_currencies(self, ids, interval=None, convert=None, status=None, filter=None, sort=None, include_transparency=False, per_page=None, page=None): Returns price, volume, ...
Implement the Python class `Currencies` described below. Class description: Implement the Currencies class. Method signatures and docstrings: - def get_currencies(self, ids, interval=None, convert=None, status=None, filter=None, sort=None, include_transparency=False, per_page=None, page=None): Returns price, volume, ...
70d864b83a0384be2120cbfddc26d55cc1e22065
<|skeleton|> class Currencies: def get_currencies(self, ids, interval=None, convert=None, status=None, filter=None, sort=None, include_transparency=False, per_page=None, page=None): """Returns price, volume, market cap, and rank for all currencies :param str ids: Comma separated list of Nomics Currency IDs...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Currencies: def get_currencies(self, ids, interval=None, convert=None, status=None, filter=None, sort=None, include_transparency=False, per_page=None, page=None): """Returns price, volume, market cap, and rank for all currencies :param str ids: Comma separated list of Nomics Currency IDs to filter res...
the_stack_v2_python_sparse
nomics/api/currencies.py
luisriverag/nomics-python
train
0
471f4eded8f0544aee26a138ae1cfcbdfabfc60e
[ "super(ComposePromoter, self).__init__(client, working_dir)\nself.compose_url = compose_url\nself.supported_promotions = [{'candidate': 'latest-compose', 'target': 'centos-ci-testing'}]", "try:\n latest_compose_id = urllib.request.urlopen(self.compose_url).readline().decode('utf-8')\nexcept Exception:\n msg...
<|body_start_0|> super(ComposePromoter, self).__init__(client, working_dir) self.compose_url = compose_url self.supported_promotions = [{'candidate': 'latest-compose', 'target': 'centos-ci-testing'}] <|end_body_0|> <|body_start_1|> try: latest_compose_id = urllib.request.url...
CentOS compose promoter class.
ComposePromoter
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ComposePromoter: """CentOS compose promoter class.""" def __init__(self, client, working_dir, compose_url=None): """Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: working directory to perform file operations :param compose...
stack_v2_sparse_classes_36k_train_000069
1,989
permissive
[ { "docstring": "Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: working directory to perform file operations :param compose_url: url used to fetch latest compose-id for an specific distro.", "name": "__init__", "signature": "def __init__(self,...
3
stack_v2_sparse_classes_30k_train_006718
Implement the Python class `ComposePromoter` described below. Class description: CentOS compose promoter class. Method signatures and docstrings: - def __init__(self, client, working_dir, compose_url=None): Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: wo...
Implement the Python class `ComposePromoter` described below. Class description: CentOS compose promoter class. Method signatures and docstrings: - def __init__(self, client, working_dir, compose_url=None): Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: wo...
b50bfb6ad52300243876113b1a247e7cff2c0805
<|skeleton|> class ComposePromoter: """CentOS compose promoter class.""" def __init__(self, client, working_dir, compose_url=None): """Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: working directory to perform file operations :param compose...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ComposePromoter: """CentOS compose promoter class.""" def __init__(self, client, working_dir, compose_url=None): """Instantiate a new compose promoter. :param client: client to be used for file operations :param working_dir: working directory to perform file operations :param compose_url: url use...
the_stack_v2_python_sparse
ci-scripts/infra-setup/roles/artifact_promoter/module_utils/artifact_promoter/compose_promoter.py
rdo-infra/ci-config
train
8
2dfc0acf4f820926a52628ddff7e3e74ce11051d
[ "self.conference_id = conference_id\nself.name = name\nself.event_type = event_type\nself.event_time = event_time\nself.tag = tag\nself.call_id = call_id\nself.to = to\nself.mfrom = mfrom\nself.account_id = account_id\nself.recording_id = recording_id\nself.channels = channels\nself.start_time = start_time\nself.en...
<|body_start_0|> self.conference_id = conference_id self.name = name self.event_type = event_type self.event_time = event_time self.tag = tag self.call_id = call_id self.to = to self.mfrom = mfrom self.account_id = account_id self.recording...
Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string): TODO: type description here. event_type (string): TODO: type description here. event...
ConferenceCallback
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ConferenceCallback: """Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string): TODO: type description here. event_typ...
stack_v2_sparse_classes_36k_train_000070
5,207
permissive
[ { "docstring": "Constructor for the ConferenceCallback class", "name": "__init__", "signature": "def __init__(self, conference_id=None, name=None, event_type=None, event_time=None, tag=None, call_id=None, to=None, mfrom=None, account_id=None, recording_id=None, channels=None, start_time=None, end_time=N...
2
null
Implement the Python class `ConferenceCallback` described below. Class description: Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string):...
Implement the Python class `ConferenceCallback` described below. Class description: Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string):...
447df3cc8cb7acaf3361d842630c432a9c31ce6e
<|skeleton|> class ConferenceCallback: """Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string): TODO: type description here. event_typ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ConferenceCallback: """Implementation of the 'ConferenceCallback' model. This object represents all possible fields that may be included in callbacks related to conference events Attributes: conference_id (string): TODO: type description here. name (string): TODO: type description here. event_type (string): T...
the_stack_v2_python_sparse
bandwidth/voice/models/conference_callback.py
Bandwidth/python-sdk
train
10
8f2f6fb1cd424736e57cdbd7f8ef1403faec28e8
[ "if root is None:\n return ''\nq = deque([root])\nres = []\nq.append('#')\nwhile q:\n sz = len(q)\n for _ in range(sz):\n node = q.popleft()\n if node == '#':\n res.append('#')\n continue\n res.append(str(node.val))\n for c in node.children:\n q....
<|body_start_0|> if root is None: return '' q = deque([root]) res = [] q.append('#') while q: sz = len(q) for _ in range(sz): node = q.popleft() if node == '#': res.append('#') ...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root: 'Node') -> str: """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data: str) -> 'Node': """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|e...
stack_v2_sparse_classes_36k_train_000071
1,727
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: Node :rtype: str", "name": "serialize", "signature": "def serialize(self, root: 'Node') -> str" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: Node", "name": "deserialize", "signature": "def des...
2
stack_v2_sparse_classes_30k_train_012640
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: 'Node') -> str: Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data: str) -> 'Node': Decodes your encoded data to tre...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root: 'Node') -> str: Encodes a tree to a single string. :type root: Node :rtype: str - def deserialize(self, data: str) -> 'Node': Decodes your encoded data to tre...
de2727f1cc52ce08a06d63cff77b6ef6bb9d2528
<|skeleton|> class Codec: def serialize(self, root: 'Node') -> str: """Encodes a tree to a single string. :type root: Node :rtype: str""" <|body_0|> def deserialize(self, data: str) -> 'Node': """Decodes your encoded data to tree. :type data: str :rtype: Node""" <|body_1|> <|e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root: 'Node') -> str: """Encodes a tree to a single string. :type root: Node :rtype: str""" if root is None: return '' q = deque([root]) res = [] q.append('#') while q: sz = len(q) for _ in range(sz)...
the_stack_v2_python_sparse
428-serialize-and-deserialize-n-ary-tree/428-serialize-and-deserialize-n-ary-tree.py
vinija/LeetCode
train
116
5d8df2097d8839e0d94f4426e2e57632c8fd9c4d
[ "self.player = player\nself.players = players\nself.deck = deck\nscreen = DiscardScreen(self.player)\nConsoleController.__init__(self, screen, commands={'1': self.discardACard, '2': self.discardACard, '3': self.discardACard, '4': self.discardACard, '5': self.discardACard, '6': self.discardACard, '7': self.discardAC...
<|body_start_0|> self.player = player self.players = players self.deck = deck screen = DiscardScreen(self.player) ConsoleController.__init__(self, screen, commands={'1': self.discardACard, '2': self.discardACard, '3': self.discardACard, '4': self.discardACard, '5': self.discardAC...
Controller for a player discarding a card from their hand
DiscardController
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DiscardController: """Controller for a player discarding a card from their hand""" def __init__(self, player, players, deck): """Initialize the Discard Controller""" <|body_0|> def discardACard(self, event): """Discard a card from the player's hand""" <|b...
stack_v2_sparse_classes_36k_train_000072
2,062
no_license
[ { "docstring": "Initialize the Discard Controller", "name": "__init__", "signature": "def __init__(self, player, players, deck)" }, { "docstring": "Discard a card from the player's hand", "name": "discardACard", "signature": "def discardACard(self, event)" } ]
2
stack_v2_sparse_classes_30k_train_013681
Implement the Python class `DiscardController` described below. Class description: Controller for a player discarding a card from their hand Method signatures and docstrings: - def __init__(self, player, players, deck): Initialize the Discard Controller - def discardACard(self, event): Discard a card from the player'...
Implement the Python class `DiscardController` described below. Class description: Controller for a player discarding a card from their hand Method signatures and docstrings: - def __init__(self, player, players, deck): Initialize the Discard Controller - def discardACard(self, event): Discard a card from the player'...
c46f2e7809b4ffc6443b279ee86edb4a0ac99a09
<|skeleton|> class DiscardController: """Controller for a player discarding a card from their hand""" def __init__(self, player, players, deck): """Initialize the Discard Controller""" <|body_0|> def discardACard(self, event): """Discard a card from the player's hand""" <|b...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DiscardController: """Controller for a player discarding a card from their hand""" def __init__(self, player, players, deck): """Initialize the Discard Controller""" self.player = player self.players = players self.deck = deck screen = DiscardScreen(self.player) ...
the_stack_v2_python_sparse
src/View/Console/Game/Player/discard_controller.py
cloew/KaoPhaseTen
train
0
e063df01da31a836e52be8c53f7d3ed55daa12a0
[ "self.eval_model = eval_model.to(device)\nself.submission = pd.read_csv(submission_template)\nself.test_dataset = test_dataset\nself.device = device", "for image, image_name, image_leaderboard in tqdm(self.test_dataset):\n image = image.to(self.device).unsqueeze(0)\n predicted_class, predicted_kev = self.ev...
<|body_start_0|> self.eval_model = eval_model.to(device) self.submission = pd.read_csv(submission_template) self.test_dataset = test_dataset self.device = device <|end_body_0|> <|body_start_1|> for image, image_name, image_leaderboard in tqdm(self.test_dataset): imag...
SubmissionMaker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SubmissionMaker: def __init__(self, eval_model: nn.Module, submission_template: str, test_dataset: IdaoInferenceDataset, device: str='cuda:0'): """[Use trained model to make prediction and generate a submission file] Args: eval_model (nn.Module): [Eval model after loading weight to archi...
stack_v2_sparse_classes_36k_train_000073
3,102
no_license
[ { "docstring": "[Use trained model to make prediction and generate a submission file] Args: eval_model (nn.Module): [Eval model after loading weight to architecture] submission_template (str): [Submission template file] test_dataset (IdaoInferenceDataset): [Pytorch dataset for private and public test] device (s...
2
stack_v2_sparse_classes_30k_train_009951
Implement the Python class `SubmissionMaker` described below. Class description: Implement the SubmissionMaker class. Method signatures and docstrings: - def __init__(self, eval_model: nn.Module, submission_template: str, test_dataset: IdaoInferenceDataset, device: str='cuda:0'): [Use trained model to make prediction...
Implement the Python class `SubmissionMaker` described below. Class description: Implement the SubmissionMaker class. Method signatures and docstrings: - def __init__(self, eval_model: nn.Module, submission_template: str, test_dataset: IdaoInferenceDataset, device: str='cuda:0'): [Use trained model to make prediction...
56fe9005ebc915acd962a4b17fb057c86ef0ebd8
<|skeleton|> class SubmissionMaker: def __init__(self, eval_model: nn.Module, submission_template: str, test_dataset: IdaoInferenceDataset, device: str='cuda:0'): """[Use trained model to make prediction and generate a submission file] Args: eval_model (nn.Module): [Eval model after loading weight to archi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SubmissionMaker: def __init__(self, eval_model: nn.Module, submission_template: str, test_dataset: IdaoInferenceDataset, device: str='cuda:0'): """[Use trained model to make prediction and generate a submission file] Args: eval_model (nn.Module): [Eval model after loading weight to architecture] submi...
the_stack_v2_python_sparse
src/submission_maker.py
3outeille/IDAO-2021-Qualifier
train
0
b4ce5c07d1ed9ffb0c29c87ddaaf859ee276dfdd
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn RbacApplication()", "from .entity import Entity\nfrom .unified_rbac_resource_namespace import UnifiedRbacResourceNamespace\nfrom .unified_role_assignment import UnifiedRoleAssignment\nfrom .unified_role_assignment_schedule import Unifi...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return RbacApplication() <|end_body_0|> <|body_start_1|> from .entity import Entity from .unified_rbac_resource_namespace import UnifiedRbacResourceNamespace from .unified_role_assignme...
RbacApplication
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RbacApplication: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> RbacApplication: """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 Ret...
stack_v2_sparse_classes_36k_train_000074
7,870
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: RbacApplication", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator_val...
3
null
Implement the Python class `RbacApplication` described below. Class description: Implement the RbacApplication class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> RbacApplication: Creates a new instance of the appropriate class based on discriminator...
Implement the Python class `RbacApplication` described below. Class description: Implement the RbacApplication class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> RbacApplication: Creates a new instance of the appropriate class based on discriminator...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class RbacApplication: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> RbacApplication: """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 Ret...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RbacApplication: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> RbacApplication: """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: RbacAppl...
the_stack_v2_python_sparse
msgraph/generated/models/rbac_application.py
microsoftgraph/msgraph-sdk-python
train
135
47a2344dde34deb1af4a49840057086e5567530e
[ "super().__init__()\nlogger.debug('Create PaddleVectorConnectionHandler to process the vector request')\nself.vector_engine = vector_engine\nself.executor = self.vector_engine.executor\nself.task = self.vector_engine.executor.task\nself.model = self.vector_engine.executor.model\nself.config = self.vector_engine.exe...
<|body_start_0|> super().__init__() logger.debug('Create PaddleVectorConnectionHandler to process the vector request') self.vector_engine = vector_engine self.executor = self.vector_engine.executor self.task = self.vector_engine.executor.task self.model = self.vector_engi...
PaddleVectorConnectionHandler
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PaddleVectorConnectionHandler: def __init__(self, vector_engine): """The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: vector_engine (VectorEngine): The Vector engine""" <|body_0|> def run(self, audio_data, task='spk'): ...
stack_v2_sparse_classes_36k_train_000075
7,306
permissive
[ { "docstring": "The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: vector_engine (VectorEngine): The Vector engine", "name": "__init__", "signature": "def __init__(self, vector_engine)" }, { "docstring": "The connection process the http request a...
4
stack_v2_sparse_classes_30k_train_007932
Implement the Python class `PaddleVectorConnectionHandler` described below. Class description: Implement the PaddleVectorConnectionHandler class. Method signatures and docstrings: - def __init__(self, vector_engine): The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: ...
Implement the Python class `PaddleVectorConnectionHandler` described below. Class description: Implement the PaddleVectorConnectionHandler class. Method signatures and docstrings: - def __init__(self, vector_engine): The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: ...
17854a04d43c231eff66bfed9d6aa55e94a29e79
<|skeleton|> class PaddleVectorConnectionHandler: def __init__(self, vector_engine): """The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: vector_engine (VectorEngine): The Vector engine""" <|body_0|> def run(self, audio_data, task='spk'): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PaddleVectorConnectionHandler: def __init__(self, vector_engine): """The PaddleSpeech Vector Server Connection Handler This connection process every server request Args: vector_engine (VectorEngine): The Vector engine""" super().__init__() logger.debug('Create PaddleVectorConnectionHan...
the_stack_v2_python_sparse
paddlespeech/server/engine/vector/python/vector_engine.py
anniyanvr/DeepSpeech-1
train
0
2f9fdcec09ff9b4d57ed008fb10ad3ba27221bad
[ "x = constant_op.constant([0.5, -0.5, -0.5, 0.5])\ny = constant_op.constant([0.5, -0.5, -0.5, 0.5])\nexact_kernel = exact_kernel_fn(x, y)\nshape = exact_kernel.shape.as_list()\nself.assertLen(shape, 2)\nself.assertAllClose(expected_values, exact_kernel, atol=1e-06)", "x = constant_op.constant([1.0, 0.4, -2.1, -1....
<|body_start_0|> x = constant_op.constant([0.5, -0.5, -0.5, 0.5]) y = constant_op.constant([0.5, -0.5, -0.5, 0.5]) exact_kernel = exact_kernel_fn(x, y) shape = exact_kernel.shape.as_list() self.assertLen(shape, 2) self.assertAllClose(expected_values, exact_kernel, atol=1e...
KernelizedUtilsTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KernelizedUtilsTest: def test_equal_vectors(self, exact_kernel_fn, expected_values): """Identical vectors give exactly the identity kernel value.""" <|body_0|> def test_almost_identical_vectors(self, exact_kernel_fn, expected_values): """Almost identical vectors give...
stack_v2_sparse_classes_36k_train_000076
5,099
permissive
[ { "docstring": "Identical vectors give exactly the identity kernel value.", "name": "test_equal_vectors", "signature": "def test_equal_vectors(self, exact_kernel_fn, expected_values)" }, { "docstring": "Almost identical vectors give the identity kernel value.", "name": "test_almost_identical...
5
null
Implement the Python class `KernelizedUtilsTest` described below. Class description: Implement the KernelizedUtilsTest class. Method signatures and docstrings: - def test_equal_vectors(self, exact_kernel_fn, expected_values): Identical vectors give exactly the identity kernel value. - def test_almost_identical_vector...
Implement the Python class `KernelizedUtilsTest` described below. Class description: Implement the KernelizedUtilsTest class. Method signatures and docstrings: - def test_equal_vectors(self, exact_kernel_fn, expected_values): Identical vectors give exactly the identity kernel value. - def test_almost_identical_vector...
7cbba04a2ee16d21309eefad5be6585183a2d5a9
<|skeleton|> class KernelizedUtilsTest: def test_equal_vectors(self, exact_kernel_fn, expected_values): """Identical vectors give exactly the identity kernel value.""" <|body_0|> def test_almost_identical_vectors(self, exact_kernel_fn, expected_values): """Almost identical vectors give...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KernelizedUtilsTest: def test_equal_vectors(self, exact_kernel_fn, expected_values): """Identical vectors give exactly the identity kernel value.""" x = constant_op.constant([0.5, -0.5, -0.5, 0.5]) y = constant_op.constant([0.5, -0.5, -0.5, 0.5]) exact_kernel = exact_kernel_fn(...
the_stack_v2_python_sparse
tensorflow/python/keras/utils/kernelized_utils_test.py
NVIDIA/tensorflow
train
763
b55967d731f3ea8a3b13613a0822efde5c7c7abb
[ "try:\n username = self.apikey_handler.validate(request.query_params['access_key'], request.query_params['secret_key'])\n if username:\n sciper = get_sciper(username)\n user_units = get_units(username)\n if str(unit_id) not in user_units and (not is_db_admin(user_id=sciper, unit_id=unit_i...
<|body_start_0|> try: username = self.apikey_handler.validate(request.query_params['access_key'], request.query_params['secret_key']) if username: sciper = get_sciper(username) user_units = get_units(username) if str(unit_id) not in user_un...
SchemaListByUnit
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SchemaListByUnit: def get(self, request, unit_id): """Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 message: Access key or secret key no found""" <|body_0|> def post(self, request, unit_id): ...
stack_v2_sparse_classes_36k_train_000077
14,178
permissive
[ { "docstring": "Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 message: Access key or secret key no found", "name": "get", "signature": "def get(self, request, unit_id)" }, { "docstring": "Create a new schema --- R...
2
stack_v2_sparse_classes_30k_train_001473
Implement the Python class `SchemaListByUnit` described below. Class description: Implement the SchemaListByUnit class. Method signatures and docstrings: - def get(self, request, unit_id): Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 ...
Implement the Python class `SchemaListByUnit` described below. Class description: Implement the SchemaListByUnit class. Method signatures and docstrings: - def get(self, request, unit_id): Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 ...
db02f6e0cb0435b84c619dd105b7bee5eafd17e2
<|skeleton|> class SchemaListByUnit: def get(self, request, unit_id): """Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 message: Access key or secret key no found""" <|body_0|> def post(self, request, unit_id): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SchemaListByUnit: def get(self, request, unit_id): """Return the list of schemas by unit --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code 404 message: Access key or secret key no found""" try: username = self.apikey_handler.validate(request....
the_stack_v2_python_sparse
src/api/views.py
epfl-si/amm
train
3
eb76c48b4098b66197a1f57073924a8d8bda6956
[ "reader = csv.reader(data)\nnext(reader)\nreturn collections.Counter(map(lambda item: self.safe_name(item[4]), reader))", "reader = csv.reader(data)\nnext(reader)\nenum = list()\nmiss = [\"extend_enum(cls, 'Unassigned_0x%s' % hex(value)[2:].upper().zfill(2), value)\", 'return cls(value)']\nfor item in reader:\n ...
<|body_start_0|> reader = csv.reader(data) next(reader) return collections.Counter(map(lambda item: self.safe_name(item[4]), reader)) <|end_body_0|> <|body_start_1|> reader = csv.reader(data) next(reader) enum = list() miss = ["extend_enum(cls, 'Unassigned_0x%s' ...
Destination Options and Hop-by-Hop Options
Option
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Option: """Destination Options and Hop-by-Hop Options""" def count(self, data): """Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings.""" <|body_0|> def process(self, data): """Process CSV data. Args: data (List[str]): CSV d...
stack_v2_sparse_classes_36k_train_000078
3,793
permissive
[ { "docstring": "Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings.", "name": "count", "signature": "def count(self, data)" }, { "docstring": "Process CSV data. Args: data (List[str]): CSV data. Returns: List[str]: Enumeration fields. List[str]: Missing fie...
2
null
Implement the Python class `Option` described below. Class description: Destination Options and Hop-by-Hop Options Method signatures and docstrings: - def count(self, data): Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings. - def process(self, data): Process CSV data. Args: da...
Implement the Python class `Option` described below. Class description: Destination Options and Hop-by-Hop Options Method signatures and docstrings: - def count(self, data): Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings. - def process(self, data): Process CSV data. Args: da...
90cd07d67df28d5c5ab0585bc60f467a78d9db33
<|skeleton|> class Option: """Destination Options and Hop-by-Hop Options""" def count(self, data): """Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings.""" <|body_0|> def process(self, data): """Process CSV data. Args: data (List[str]): CSV d...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Option: """Destination Options and Hop-by-Hop Options""" def count(self, data): """Count field records. Args: data (List[str]): CSV data. Returns: Counter: Field recordings.""" reader = csv.reader(data) next(reader) return collections.Counter(map(lambda item: self.safe_nam...
the_stack_v2_python_sparse
pcapkit/vendor/ipv6/option.py
stjordanis/PyPCAPKit
train
0
e1a26068dc36d530a8f438911f57a4c1742df913
[ "Block.__init__(self, scenario, args)\nself.to = None\nself.path = None\nself.add_to_name = None\nif 'to' in args:\n self.to = args['to']\nelif 'path' in args:\n self.path = args['path']\nelif 'add_to_name' in args:\n self.add_to_name = args['add_to_name']", "if self.to:\n return self.to\nif self.path...
<|body_start_0|> Block.__init__(self, scenario, args) self.to = None self.path = None self.add_to_name = None if 'to' in args: self.to = args['to'] elif 'path' in args: self.path = args['path'] elif 'add_to_name' in args: self.a...
Base block for output writing.
BaseWriter
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseWriter: """Base block for output writing.""" def __init__(self, scenario, args): """Empty constructor (just call the base constructor)""" <|body_0|> def get_output_file_name(self, doc): """Create an output file name for the given document.""" <|body_1...
stack_v2_sparse_classes_36k_train_000079
1,836
permissive
[ { "docstring": "Empty constructor (just call the base constructor)", "name": "__init__", "signature": "def __init__(self, scenario, args)" }, { "docstring": "Create an output file name for the given document.", "name": "get_output_file_name", "signature": "def get_output_file_name(self, ...
2
stack_v2_sparse_classes_30k_train_004076
Implement the Python class `BaseWriter` described below. Class description: Base block for output writing. Method signatures and docstrings: - def __init__(self, scenario, args): Empty constructor (just call the base constructor) - def get_output_file_name(self, doc): Create an output file name for the given document...
Implement the Python class `BaseWriter` described below. Class description: Base block for output writing. Method signatures and docstrings: - def __init__(self, scenario, args): Empty constructor (just call the base constructor) - def get_output_file_name(self, doc): Create an output file name for the given document...
73af644ec35c8a1cd0c37cd478c2afc1db717e0b
<|skeleton|> class BaseWriter: """Base block for output writing.""" def __init__(self, scenario, args): """Empty constructor (just call the base constructor)""" <|body_0|> def get_output_file_name(self, doc): """Create an output file name for the given document.""" <|body_1...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseWriter: """Base block for output writing.""" def __init__(self, scenario, args): """Empty constructor (just call the base constructor)""" Block.__init__(self, scenario, args) self.to = None self.path = None self.add_to_name = None if 'to' in args: ...
the_stack_v2_python_sparse
alex/components/nlg/tectotpl/block/write/basewriter.py
oplatek/alex
train
0
92e14ba575e92d51b49e288678774ea02225ea8f
[ "self.relay_for = f'eduid_{config.app_name}'\nif config.am_relay_for_override is not None:\n self.relay_for = config.am_relay_for_override\neduid_am.init_app(config.celery)\nfrom eduid_am.tasks import pong, update_attributes_keep_result\nself._update_attrs = update_attributes_keep_result\nself._pong = pong", "...
<|body_start_0|> self.relay_for = f'eduid_{config.app_name}' if config.am_relay_for_override is not None: self.relay_for = config.am_relay_for_override eduid_am.init_app(config.celery) from eduid_am.tasks import pong, update_attributes_keep_result self._update_attrs =...
AmRelay
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AmRelay: def __init__(self, config: AmConfigMixin): """:param config: celery config :param relay_for: Name of application to relay for""" <|body_0|> def request_user_sync(self, user: User, timeout: int=25) -> bool: """Use Celery to ask eduid-am worker to propagate ch...
stack_v2_sparse_classes_36k_train_000080
2,661
permissive
[ { "docstring": ":param config: celery config :param relay_for: Name of application to relay for", "name": "__init__", "signature": "def __init__(self, config: AmConfigMixin)" }, { "docstring": "Use Celery to ask eduid-am worker to propagate changes from our private UserDB into the central UserDB...
3
stack_v2_sparse_classes_30k_train_017468
Implement the Python class `AmRelay` described below. Class description: Implement the AmRelay class. Method signatures and docstrings: - def __init__(self, config: AmConfigMixin): :param config: celery config :param relay_for: Name of application to relay for - def request_user_sync(self, user: User, timeout: int=25...
Implement the Python class `AmRelay` described below. Class description: Implement the AmRelay class. Method signatures and docstrings: - def __init__(self, config: AmConfigMixin): :param config: celery config :param relay_for: Name of application to relay for - def request_user_sync(self, user: User, timeout: int=25...
d666aec7e47e6b0ccb575d621bb6e9f40bcea4e4
<|skeleton|> class AmRelay: def __init__(self, config: AmConfigMixin): """:param config: celery config :param relay_for: Name of application to relay for""" <|body_0|> def request_user_sync(self, user: User, timeout: int=25) -> bool: """Use Celery to ask eduid-am worker to propagate ch...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AmRelay: def __init__(self, config: AmConfigMixin): """:param config: celery config :param relay_for: Name of application to relay for""" self.relay_for = f'eduid_{config.app_name}' if config.am_relay_for_override is not None: self.relay_for = config.am_relay_for_override ...
the_stack_v2_python_sparse
src/eduid_common/api/am.py
SUNET/eduid-common
train
1
48dc73a1646dd8958b523ee088855d8c80f4c7d4
[ "if index is None:\n index = 0\nif default is None:\n default = self._get_paths(include_application=True, include_pyrin=True)\nsuper().__init__('input_paths', index, default=default, **options)", "include_application = options.get('include_app', False)\ninclude_pyrin = options.get('include_pyrin', False)\np...
<|body_start_0|> if index is None: index = 0 if default is None: default = self._get_paths(include_application=True, include_pyrin=True) super().__init__('input_paths', index, default=default, **options) <|end_body_0|> <|body_start_1|> include_application = optio...
input paths param class.
InputPathsParam
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InputPathsParam: """input paths param class.""" def __init__(self, index=None, default=None, **options): """initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. defaults to 0 if not provided. :param object default: defaul...
stack_v2_sparse_classes_36k_train_000081
27,683
permissive
[ { "docstring": "initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. defaults to 0 if not provided. :param object default: default value to be emitted to cli if this param is not available. if set to None, this param will not be emitted at all. defa...
3
stack_v2_sparse_classes_30k_train_010005
Implement the Python class `InputPathsParam` described below. Class description: input paths param class. Method signatures and docstrings: - def __init__(self, index=None, default=None, **options): initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. def...
Implement the Python class `InputPathsParam` described below. Class description: input paths param class. Method signatures and docstrings: - def __init__(self, index=None, default=None, **options): initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. def...
9d4776498225de4f3d16a4600b5b19212abe8562
<|skeleton|> class InputPathsParam: """input paths param class.""" def __init__(self, index=None, default=None, **options): """initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. defaults to 0 if not provided. :param object default: defaul...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class InputPathsParam: """input paths param class.""" def __init__(self, index=None, default=None, **options): """initializes an instance of InputPathsParam. :param int index: zero based index of this param in cli command inputs. defaults to 0 if not provided. :param object default: default value to be...
the_stack_v2_python_sparse
src/pyrin/globalization/locale/babel/handlers/params.py
mononobi/pyrin
train
20
162132488a9ddd6b96e7da910f9ca2418edd24d2
[ "if cstruct:\n try:\n return json.loads(cstruct)\n except json.JSONDecodeError as e:\n raise colander.Invalid(node, 'Not valid JSON') from e\nelse:\n return None", "if data:\n assert isinstance(data, (list, dict, NestedMutationDict, NestedMutationList)), 'Expected list or dict, got {}'.f...
<|body_start_0|> if cstruct: try: return json.loads(cstruct) except json.JSONDecodeError as e: raise colander.Invalid(node, 'Not valid JSON') from e else: return None <|end_body_0|> <|body_start_1|> if data: assert ...
Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attributes of the object")
JSONValue
[ "MIT", "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JSONValue: """Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attributes of the object")""" def deser...
stack_v2_sparse_classes_36k_train_000082
3,775
permissive
[ { "docstring": "Parse incoming form values to Python objects if needed.", "name": "deserialize", "signature": "def deserialize(self, node: colander.SchemaNode, cstruct: str)" }, { "docstring": "Convert Python objects to JSON string.", "name": "serialize", "signature": "def serialize(self...
2
null
Implement the Python class `JSONValue` described below. Class description: Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attri...
Implement the Python class `JSONValue` described below. Class description: Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attri...
a57de54fb8a3fae859f24f373f0292e1e4b3c344
<|skeleton|> class JSONValue: """Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attributes of the object")""" def deser...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JSONValue: """Serialize / deserialize JSON fields. Example: .. code-block:: python class AssetSchema(CSRFSchema): name = colander.SchemaNode(colander.String()) other_data = colander.SchemaNode( JSONValue(), widget=JSONWidget(), description="JSON bag of attributes of the object")""" def deserialize(self, ...
the_stack_v2_python_sparse
websauna/system/form/fields.py
websauna/websauna
train
294
3f1bc9205ef2e9b89d97356bdc16ffa786f6fbea
[ "self.status = []\npygame.sprite.Sprite.__init__(self)\nsprite_sheet = SpriteSheet('Golem.png')\nimage = sprite_sheet.get_image(165, 547, 389, 28)\nself.status.append(image)\nself.image = image\nself.rect = self.image.get_rect()\nimage = sprite_sheet.get_image(165, 576, 389, 28)\nself.status.append(image)\nimage = ...
<|body_start_0|> self.status = [] pygame.sprite.Sprite.__init__(self) sprite_sheet = SpriteSheet('Golem.png') image = sprite_sheet.get_image(165, 547, 389, 28) self.status.append(image) self.image = image self.rect = self.image.get_rect() image = sprite_sh...
Golem
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Golem: def __init__(self): """This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the custom self.image: The sprite used to represent self.rect: This creates the shape of the sprite s...
stack_v2_sparse_classes_36k_train_000083
3,100
no_license
[ { "docstring": "This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the custom self.image: The sprite used to represent self.rect: This creates the shape of the sprite self.rect.y: The y-position of the spri...
2
null
Implement the Python class `Golem` described below. Class description: Implement the Golem class. Method signatures and docstrings: - def __init__(self): This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the cus...
Implement the Python class `Golem` described below. Class description: Implement the Golem class. Method signatures and docstrings: - def __init__(self): This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the cus...
56fbcfc786dfc373f477270468f06e31b6271749
<|skeleton|> class Golem: def __init__(self): """This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the custom self.image: The sprite used to represent self.rect: This creates the shape of the sprite s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Golem: def __init__(self): """This initializes the health Variables: self.status: Holds the custom sprites sprite_sheet: The spritesheet to where the custom spries came from image: Holds the custom self.image: The sprite used to represent self.rect: This creates the shape of the sprite self.rect.y: Th...
the_stack_v2_python_sparse
Doki Doki Island/bossAttacks/golem/golHealth.py
cashpop5000/DokiProject
train
0
a302fba87981e6d397b57c74e3aff9644dc51682
[ "self.biosqllog = LogIt().default(logname='BioSQL', logfile=None)\nself.biosqlstream = StreamIEO(logname='BioSQL')\nself.scripts = pkg_resources.resource_filename(sql_scripts.__name__, '')\nself.ncbi_taxon_script = pkg_resources.resource_filename(sql_scripts.__name__, 'load_ncbi_taxonomy.pl')\nself.itis_taxon_scrip...
<|body_start_0|> self.biosqllog = LogIt().default(logname='BioSQL', logfile=None) self.biosqlstream = StreamIEO(logname='BioSQL') self.scripts = pkg_resources.resource_filename(sql_scripts.__name__, '') self.ncbi_taxon_script = pkg_resources.resource_filename(sql_scripts.__name__, 'load_...
Base BioSQL class.
BaseBioSQL
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseBioSQL: """Base BioSQL class.""" def __init__(self, database_name, template_name='', project=None, project_path=None, proj_mana=ProjectManagement, **kwargs): """This is the base BioSQL class. It provides a framework for uploading schemas, loading taxonomy data from NCBI and ITIS ...
stack_v2_sparse_classes_36k_train_000084
11,556
permissive
[ { "docstring": "This is the base BioSQL class. It provides a framework for uploading schemas, loading taxonomy data from NCBI and ITIS using the BioSQL perl scripts and .sql schema files provided by the BioPython package. We have created a modified version of the BioSQL scripts in our package, which can be foun...
3
stack_v2_sparse_classes_30k_train_020267
Implement the Python class `BaseBioSQL` described below. Class description: Base BioSQL class. Method signatures and docstrings: - def __init__(self, database_name, template_name='', project=None, project_path=None, proj_mana=ProjectManagement, **kwargs): This is the base BioSQL class. It provides a framework for upl...
Implement the Python class `BaseBioSQL` described below. Class description: Base BioSQL class. Method signatures and docstrings: - def __init__(self, database_name, template_name='', project=None, project_path=None, proj_mana=ProjectManagement, **kwargs): This is the base BioSQL class. It provides a framework for upl...
5b39aa22fe9897322014a7fdad4f25bbceec5fcb
<|skeleton|> class BaseBioSQL: """Base BioSQL class.""" def __init__(self, database_name, template_name='', project=None, project_path=None, proj_mana=ProjectManagement, **kwargs): """This is the base BioSQL class. It provides a framework for uploading schemas, loading taxonomy data from NCBI and ITIS ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseBioSQL: """Base BioSQL class.""" def __init__(self, database_name, template_name='', project=None, project_path=None, proj_mana=ProjectManagement, **kwargs): """This is the base BioSQL class. It provides a framework for uploading schemas, loading taxonomy data from NCBI and ITIS using the Bio...
the_stack_v2_python_sparse
OrthoEvol/Manager/BioSQL/biosql.py
But-I-Play-One-On-TV/OrthoEvolution
train
0
e2e5e8c0e2d2b53ca7738abb0d5991d38c2ada5b
[ "cur_path = os.path.abspath(os.path.dirname(__file__))\nconfig_file = os.path.join(cur_path, '../conf/project_host_mapping.yaml')\nself.project_host_map = FileOperator.filereader(config_file, 'yaml')", "if priority:\n return '[{}]\\nname={}\\nbaseurl={}\\nenabled=1\\ngpgcheck=0\\npriority={}\\n'.format(repo_id...
<|body_start_0|> cur_path = os.path.abspath(os.path.dirname(__file__)) config_file = os.path.join(cur_path, '../conf/project_host_mapping.yaml') self.project_host_map = FileOperator.filereader(config_file, 'yaml') <|end_body_0|> <|body_start_1|> if priority: return '[{}]\nna...
生成obs实时仓作为rpm源的配置
OBSRepoSource
[ "LicenseRef-scancode-mulanpsl-2.0-en", "MulanPSL-2.0", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OBSRepoSource: """生成obs实时仓作为rpm源的配置""" def __init__(self): """:param repo_host: obs仓库host""" <|body_0|> def repo_format(repo_id, repo_name, repo_baseurl, priority=None): """repo内容格式 :param repo_id: :param repo_name: :param repo_baseurl: :param priority: :return:"...
stack_v2_sparse_classes_36k_train_000085
3,903
permissive
[ { "docstring": ":param repo_host: obs仓库host", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "repo内容格式 :param repo_id: :param repo_name: :param repo_baseurl: :param priority: :return:", "name": "repo_format", "signature": "def repo_format(repo_id, repo_name, repo...
4
stack_v2_sparse_classes_30k_train_010723
Implement the Python class `OBSRepoSource` described below. Class description: 生成obs实时仓作为rpm源的配置 Method signatures and docstrings: - def __init__(self): :param repo_host: obs仓库host - def repo_format(repo_id, repo_name, repo_baseurl, priority=None): repo内容格式 :param repo_id: :param repo_name: :param repo_baseurl: :para...
Implement the Python class `OBSRepoSource` described below. Class description: 生成obs实时仓作为rpm源的配置 Method signatures and docstrings: - def __init__(self): :param repo_host: obs仓库host - def repo_format(repo_id, repo_name, repo_baseurl, priority=None): repo内容格式 :param repo_id: :param repo_name: :param repo_baseurl: :para...
6b088eb29a53510eb441338804da79ad6d0623ab
<|skeleton|> class OBSRepoSource: """生成obs实时仓作为rpm源的配置""" def __init__(self): """:param repo_host: obs仓库host""" <|body_0|> def repo_format(repo_id, repo_name, repo_baseurl, priority=None): """repo内容格式 :param repo_id: :param repo_name: :param repo_baseurl: :param priority: :return:"...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OBSRepoSource: """生成obs实时仓作为rpm源的配置""" def __init__(self): """:param repo_host: obs仓库host""" cur_path = os.path.abspath(os.path.dirname(__file__)) config_file = os.path.join(cur_path, '../conf/project_host_mapping.yaml') self.project_host_map = FileOperator.filereader(conf...
the_stack_v2_python_sparse
src/build/obs_repo_source.py
openeuler-mirror/openeuler-jenkins
train
2
1e76a3c1c36a4743b60513081e1b28e6cb68ee10
[ "self.d = collections.defaultdict(set)\nself.u = collections.defaultdict(set)\nself.pool = []", "idx = len(self.u) + 1\nif self.pool:\n idx = heapq.heappop(self.pool)\nself.u[idx] = set(ownedChunks)\nfor x in ownedChunks:\n self.d[x].add(idx)\nreturn idx", "if userID not in self.u:\n return\nfor c in s...
<|body_start_0|> self.d = collections.defaultdict(set) self.u = collections.defaultdict(set) self.pool = [] <|end_body_0|> <|body_start_1|> idx = len(self.u) + 1 if self.pool: idx = heapq.heappop(self.pool) self.u[idx] = set(ownedChunks) for x in owne...
FileSharing
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FileSharing: def __init__(self, m): """:type m: int""" <|body_0|> def join(self, ownedChunks): """:type ownedChunks: List[int] :rtype: int""" <|body_1|> def leave(self, userID): """:type userID: int :rtype: None""" <|body_2|> def req...
stack_v2_sparse_classes_36k_train_000086
1,412
no_license
[ { "docstring": ":type m: int", "name": "__init__", "signature": "def __init__(self, m)" }, { "docstring": ":type ownedChunks: List[int] :rtype: int", "name": "join", "signature": "def join(self, ownedChunks)" }, { "docstring": ":type userID: int :rtype: None", "name": "leave"...
4
stack_v2_sparse_classes_30k_train_015497
Implement the Python class `FileSharing` described below. Class description: Implement the FileSharing class. Method signatures and docstrings: - def __init__(self, m): :type m: int - def join(self, ownedChunks): :type ownedChunks: List[int] :rtype: int - def leave(self, userID): :type userID: int :rtype: None - def ...
Implement the Python class `FileSharing` described below. Class description: Implement the FileSharing class. Method signatures and docstrings: - def __init__(self, m): :type m: int - def join(self, ownedChunks): :type ownedChunks: List[int] :rtype: int - def leave(self, userID): :type userID: int :rtype: None - def ...
20623defecf65cbc35b194d8b60d8b211816ee4f
<|skeleton|> class FileSharing: def __init__(self, m): """:type m: int""" <|body_0|> def join(self, ownedChunks): """:type ownedChunks: List[int] :rtype: int""" <|body_1|> def leave(self, userID): """:type userID: int :rtype: None""" <|body_2|> def req...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FileSharing: def __init__(self, m): """:type m: int""" self.d = collections.defaultdict(set) self.u = collections.defaultdict(set) self.pool = [] def join(self, ownedChunks): """:type ownedChunks: List[int] :rtype: int""" idx = len(self.u) + 1 if se...
the_stack_v2_python_sparse
in_Python/1500 Design a File Sharing System.py
YangLiyli131/Leetcode2020
train
0
8091dc981667607b8d8c9e273ffd291be1ff3e87
[ "if not headA or not headB:\n return None\ncur = headA\npassed_nodes = {cur}\nwhile cur:\n passed_nodes.add(cur)\n cur = cur.next\ncur = headB\nwhile cur:\n if cur in passed_nodes:\n return cur\n cur = cur.next\nelse:\n return None", "pA = headA\npB = headB\nwhile pA != pB:\n pA = pA.n...
<|body_start_0|> if not headA or not headB: return None cur = headA passed_nodes = {cur} while cur: passed_nodes.add(cur) cur = cur.next cur = headB while cur: if cur in passed_nodes: return cur c...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def getIntersectionNode(self, headA, headB): """使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode""" <|body_0|> def getIntersectionNode(self, headA, headB): """神奇的解法, 代码还漂亮""" ...
stack_v2_sparse_classes_36k_train_000087
1,502
no_license
[ { "docstring": "使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode", "name": "getIntersectionNode", "signature": "def getIntersectionNode(self, headA, headB)" }, { "docstring": "神奇的解法, 代码还漂亮", "name": "getIntersectionN...
2
stack_v2_sparse_classes_30k_train_021072
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getIntersectionNode(self, headA, headB): 使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode - def ge...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def getIntersectionNode(self, headA, headB): 使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode - def ge...
99a3abf1774933af73a8405f9b59e5e64906bca4
<|skeleton|> class Solution: def getIntersectionNode(self, headA, headB): """使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode""" <|body_0|> def getIntersectionNode(self, headA, headB): """神奇的解法, 代码还漂亮""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def getIntersectionNode(self, headA, headB): """使用 set 保存走过路径的笨办法, 不满足`程序尽量满足 O(n) 时间复杂度,且仅用 O(1) 内存`要求 O(n+m) 时间复杂度, O(n) 内存h :type head1, head1: ListNode :rtype: ListNode""" if not headA or not headB: return None cur = headA passed_nodes = {cur} ...
the_stack_v2_python_sparse
2018年力扣高频算法面试题汇总/相交链表.py
iamkissg/leetcode
train
0
224d59fa402f543cec160dde5da967848cd9cf7f
[ "for entry in data:\n selected = model.select_pattern(entry['term_name'])\n if selected.count == 0:\n model.add_pattern(dict([(key, entry[key]) for key in entry if key != 'id']))\n elif selected.count == 1:\n model.edit_pattern(entry['term_name'], dict([(key, entry[key]) for key in entry if k...
<|body_start_0|> for entry in data: selected = model.select_pattern(entry['term_name']) if selected.count == 0: model.add_pattern(dict([(key, entry[key]) for key in entry if key != 'id'])) elif selected.count == 1: model.edit_pattern(entry['ter...
DialectTableHandler
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DialectTableHandler: def update_action(self, data: dict) -> dict: """Method for post""" <|body_0|> def delete_action(self, data: dict) -> dict: """Method for post""" <|body_1|> def load_table(self): """Method for get""" <|body_2|> <|end_...
stack_v2_sparse_classes_36k_train_000088
20,061
no_license
[ { "docstring": "Method for post", "name": "update_action", "signature": "def update_action(self, data: dict) -> dict" }, { "docstring": "Method for post", "name": "delete_action", "signature": "def delete_action(self, data: dict) -> dict" }, { "docstring": "Method for get", "...
3
null
Implement the Python class `DialectTableHandler` described below. Class description: Implement the DialectTableHandler class. Method signatures and docstrings: - def update_action(self, data: dict) -> dict: Method for post - def delete_action(self, data: dict) -> dict: Method for post - def load_table(self): Method f...
Implement the Python class `DialectTableHandler` described below. Class description: Implement the DialectTableHandler class. Method signatures and docstrings: - def update_action(self, data: dict) -> dict: Method for post - def delete_action(self, data: dict) -> dict: Method for post - def load_table(self): Method f...
1e1e5d46713bb15519653f4e9151f559f6637e4a
<|skeleton|> class DialectTableHandler: def update_action(self, data: dict) -> dict: """Method for post""" <|body_0|> def delete_action(self, data: dict) -> dict: """Method for post""" <|body_1|> def load_table(self): """Method for get""" <|body_2|> <|end_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DialectTableHandler: def update_action(self, data: dict) -> dict: """Method for post""" for entry in data: selected = model.select_pattern(entry['term_name']) if selected.count == 0: model.add_pattern(dict([(key, entry[key]) for key in entry if key != 'i...
the_stack_v2_python_sparse
spaces/math_space/common/gui/web/server/server_handlers_special.py
dglyzin/tracer
train
0
2929e75c07e92bb1b98eff3b22c687a2e6781f1e
[ "def get_list(n: int) -> List[int]:\n if n == 0:\n return [0]\n ret = []\n while n > 0:\n ret.append(n % 10)\n n //= 10\n return ret\n\ndef compare(x: int, y: int) -> int:\n lx = get_list(x)\n ly = get_list(y)\n lx, ly = (lx[::-1], ly[::-1])\n lx, ly = (lx + ly, ly + lx)...
<|body_start_0|> def get_list(n: int) -> List[int]: if n == 0: return [0] ret = [] while n > 0: ret.append(n % 10) n //= 10 return ret def compare(x: int, y: int) -> int: lx = get_list(x) ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def largestNumber(self, nums: List[int]) -> str: """Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9""" <|body_0|> def largestNumber2(self, nums: List[int]) -> str: """Runtime: 44 ms, fa...
stack_v2_sparse_classes_36k_train_000089
2,196
permissive
[ { "docstring": "Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9", "name": "largestNumber", "signature": "def largestNumber(self, nums: List[int]) -> str" }, { "docstring": "Runtime: 44 ms, faster than 82.75% Memory Usage: 13...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestNumber(self, nums: List[int]) -> str: Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9 - def lar...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def largestNumber(self, nums: List[int]) -> str: Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9 - def lar...
4dd1e54d8d08f7e6590bc76abd08ecaacaf775e5
<|skeleton|> class Solution: def largestNumber(self, nums: List[int]) -> str: """Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9""" <|body_0|> def largestNumber2(self, nums: List[int]) -> str: """Runtime: 44 ms, fa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def largestNumber(self, nums: List[int]) -> str: """Runtime: 77 ms, faster than 26.45% Memory Usage: 13.8 MB, less than 67.07% 1 <= nums.length <= 100 0 <= nums[i] <= 10^9""" def get_list(n: int) -> List[int]: if n == 0: return [0] ret = [] ...
the_stack_v2_python_sparse
src/179-LargestNumber.py
Jiezhi/myleetcode
train
1
b7b68e5f1863258a816370b5bdb2312a38a752e1
[ "Property.property_apparitions[property_name] = {}\nProperty.property_apparitions[property_name][SHOULD_BE_IN] = domain\nProperty.property_apparitions[property_name][IS_IN] = []", "if property_name not in Property.property_apparitions:\n Property.add_property(property_name, domain)\nProperty.property_apparitio...
<|body_start_0|> Property.property_apparitions[property_name] = {} Property.property_apparitions[property_name][SHOULD_BE_IN] = domain Property.property_apparitions[property_name][IS_IN] = [] <|end_body_0|> <|body_start_1|> if property_name not in Property.property_apparitions: ...
This class is used to check if all the classes from the domain of a property implement that property.
Property
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Property: """This class is used to check if all the classes from the domain of a property implement that property.""" def add_property(property_name: str, domain: List[str]): """This method adds a property.""" <|body_0|> def add_class_to_property(property_name: str, clas...
stack_v2_sparse_classes_36k_train_000090
1,077
no_license
[ { "docstring": "This method adds a property.", "name": "add_property", "signature": "def add_property(property_name: str, domain: List[str])" }, { "docstring": "This method adds a class to the list of classes that implement the property.", "name": "add_class_to_property", "signature": "d...
2
stack_v2_sparse_classes_30k_train_011499
Implement the Python class `Property` described below. Class description: This class is used to check if all the classes from the domain of a property implement that property. Method signatures and docstrings: - def add_property(property_name: str, domain: List[str]): This method adds a property. - def add_class_to_p...
Implement the Python class `Property` described below. Class description: This class is used to check if all the classes from the domain of a property implement that property. Method signatures and docstrings: - def add_property(property_name: str, domain: List[str]): This method adds a property. - def add_class_to_p...
09f12f0d7d2a767a56b2e53d0975dcdb18ef8812
<|skeleton|> class Property: """This class is used to check if all the classes from the domain of a property implement that property.""" def add_property(property_name: str, domain: List[str]): """This method adds a property.""" <|body_0|> def add_class_to_property(property_name: str, clas...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Property: """This class is used to check if all the classes from the domain of a property implement that property.""" def add_property(property_name: str, domain: List[str]): """This method adds a property.""" Property.property_apparitions[property_name] = {} Property.property_app...
the_stack_v2_python_sparse
tools/ontology-validator/utils/property.py
PlatformOfTrust/standards
train
2
ca187aac04881c26c4b894294c32172188f2d56c
[ "form = AdminForm(request.args)\nif form.validate():\n if form.admin_token.data != 'admin_platon_group7':\n return make_response(jsonify({'error': 'Unauthorized Input'}), 401)\n try:\n existing_user = User.query.filter_by(id=form.user_id.data).first()\n send_email(existing_user.e_mail, 'Y...
<|body_start_0|> form = AdminForm(request.args) if form.validate(): if form.admin_token.data != 'admin_platon_group7': return make_response(jsonify({'error': 'Unauthorized Input'}), 401) try: existing_user = User.query.filter_by(id=form.user_id.dat...
AdminAPI
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdminAPI: def get(self): """Deletes the specfied user from the system""" <|body_0|> def post(self): """Suspends the specfied user from the system""" <|body_1|> <|end_skeleton|> <|body_start_0|> form = AdminForm(request.args) if form.validate...
stack_v2_sparse_classes_36k_train_000091
36,381
no_license
[ { "docstring": "Deletes the specfied user from the system", "name": "get", "signature": "def get(self)" }, { "docstring": "Suspends the specfied user from the system", "name": "post", "signature": "def post(self)" } ]
2
stack_v2_sparse_classes_30k_test_001178
Implement the Python class `AdminAPI` described below. Class description: Implement the AdminAPI class. Method signatures and docstrings: - def get(self): Deletes the specfied user from the system - def post(self): Suspends the specfied user from the system
Implement the Python class `AdminAPI` described below. Class description: Implement the AdminAPI class. Method signatures and docstrings: - def get(self): Deletes the specfied user from the system - def post(self): Suspends the specfied user from the system <|skeleton|> class AdminAPI: def get(self): ""...
f7aebee17a0a79e8d3c2927733bce8015b4a9da3
<|skeleton|> class AdminAPI: def get(self): """Deletes the specfied user from the system""" <|body_0|> def post(self): """Suspends the specfied user from the system""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdminAPI: def get(self): """Deletes the specfied user from the system""" form = AdminForm(request.args) if form.validate(): if form.admin_token.data != 'admin_platon_group7': return make_response(jsonify({'error': 'Unauthorized Input'}), 401) try...
the_stack_v2_python_sparse
platon/backend/app/auth_system/views.py
bounswe/bounswe2020group7
train
18
87400f0b889db400d6b567e4d6a87240b59e270d
[ "if not isinstance(stage, (encoding_stage.EncodingStageInterface, encoding_stage.AdaptiveEncodingStageInterface)):\n raise TypeError('The input argument is %s but must be an instance of EncodingStageInterface or of AdaptiveEncodingStageInterface' % type(stage))\nself._stage = stage\nself._children = {}\nsuper(En...
<|body_start_0|> if not isinstance(stage, (encoding_stage.EncodingStageInterface, encoding_stage.AdaptiveEncodingStageInterface)): raise TypeError('The input argument is %s but must be an instance of EncodingStageInterface or of AdaptiveEncodingStageInterface' % type(stage)) self._stage = st...
Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method converts this object to an `Encoder`, which e...
EncoderComposer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method co...
stack_v2_sparse_classes_36k_train_000092
26,759
permissive
[ { "docstring": "Constructor for the `EncoderComposer`. Args: stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.", "name": "__init__", "signature": "def __init__(self, stage)" }, { "docstring": "Adds a child node. Args: stage: An `EncodingStageInterface` or an `AdaptiveEnc...
4
stack_v2_sparse_classes_30k_train_018060
Implement the Python class `EncoderComposer` described below. Class description: Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be ...
Implement the Python class `EncoderComposer` described below. Class description: Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be ...
4733c85f21d1eb570fd575ea201cb211a485bfb0
<|skeleton|> class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method co...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EncoderComposer: """Class for composing and creating `Encoder`. This class is a utility for separating the creation of the `Encoder` from its intended functionality. Each instance of `EncoderComposer` corresponds to a node in a tree of encoding stages to be used for encoding. The `make` method converts this o...
the_stack_v2_python_sparse
tensorflow_model_optimization/python/core/internal/tensor_encoding/core/core_encoder.py
tensorflow/model-optimization
train
1,550
57b9a03d623010d22f1b49278971f4561f2ea44e
[ "lLatitude = self.cleaned_data['latitude']\nif lLatitude:\n lValue = lLatitude.strip()\n if lValue:\n lRegEx = re.compile(CO_ORD_REGEX)\n if lRegEx.match(lValue) == None:\n raise forms.ValidationError(\"Please enter the location in decimal notation, for example 53.768761 If it ends w...
<|body_start_0|> lLatitude = self.cleaned_data['latitude'] if lLatitude: lValue = lLatitude.strip() if lValue: lRegEx = re.compile(CO_ORD_REGEX) if lRegEx.match(lValue) == None: raise forms.ValidationError("Please enter the loca...
Form for entering a new venue
EditVenueForm
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EditVenueForm: """Form for entering a new venue""" def clean_latitude(self): """Validate latitude is in correct format""" <|body_0|> def clean_longitude(self): """Validation longitude is in correct format""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_000093
1,542
no_license
[ { "docstring": "Validate latitude is in correct format", "name": "clean_latitude", "signature": "def clean_latitude(self)" }, { "docstring": "Validation longitude is in correct format", "name": "clean_longitude", "signature": "def clean_longitude(self)" } ]
2
stack_v2_sparse_classes_30k_train_012009
Implement the Python class `EditVenueForm` described below. Class description: Form for entering a new venue Method signatures and docstrings: - def clean_latitude(self): Validate latitude is in correct format - def clean_longitude(self): Validation longitude is in correct format
Implement the Python class `EditVenueForm` described below. Class description: Form for entering a new venue Method signatures and docstrings: - def clean_latitude(self): Validate latitude is in correct format - def clean_longitude(self): Validation longitude is in correct format <|skeleton|> class EditVenueForm: ...
05c9d3a53c491cc255e7a351de87273df31a0303
<|skeleton|> class EditVenueForm: """Form for entering a new venue""" def clean_latitude(self): """Validate latitude is in correct format""" <|body_0|> def clean_longitude(self): """Validation longitude is in correct format""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EditVenueForm: """Form for entering a new venue""" def clean_latitude(self): """Validate latitude is in correct format""" lLatitude = self.cleaned_data['latitude'] if lLatitude: lValue = lLatitude.strip() if lValue: lRegEx = re.compile(CO_OR...
the_stack_v2_python_sparse
web/site/venues/forms.py
BrassBandResults/bbr4
train
5
bc3284ac40cf09e87b862269e1b78523f6f64e0e
[ "self.search_expansion = search_expansion\nself.min_search_wh = min_search_wh\nself.pad_pixels = pad_pixels", "for i, _track in enumerate(in_box):\n bbox_w = _track.bbox[:, 2] - _track.bbox[:, 0] + 1\n bbox_h = _track.bbox[:, 3] - _track.bbox[:, 1] + 1\n w_ext = bbox_w * (self.search_expansion / 2.0)\n ...
<|body_start_0|> self.search_expansion = search_expansion self.min_search_wh = min_search_wh self.pad_pixels = pad_pixels <|end_body_0|> <|body_start_1|> for i, _track in enumerate(in_box): bbox_w = _track.bbox[:, 2] - _track.bbox[:, 0] + 1 bbox_h = _track.bbox[:...
A class that includes utility functions unique to track branch
TrackUtils
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TrackUtils: """A class that includes utility functions unique to track branch""" def __init__(self, search_expansion=1.0, min_search_wh=128, pad_pixels=256): """:param search_expansion: expansion ratio (of the search region) w.r.t the size of tracking targets :param min_search_wh: mi...
stack_v2_sparse_classes_36k_train_000094
22,017
permissive
[ { "docstring": ":param search_expansion: expansion ratio (of the search region) w.r.t the size of tracking targets :param min_search_wh: minimal size (width and height) of the search region :param pad_pixels: the padding pixels that are neccessary to keep the feature map pf search region and that of template ta...
3
stack_v2_sparse_classes_30k_train_018859
Implement the Python class `TrackUtils` described below. Class description: A class that includes utility functions unique to track branch Method signatures and docstrings: - def __init__(self, search_expansion=1.0, min_search_wh=128, pad_pixels=256): :param search_expansion: expansion ratio (of the search region) w....
Implement the Python class `TrackUtils` described below. Class description: A class that includes utility functions unique to track branch Method signatures and docstrings: - def __init__(self, search_expansion=1.0, min_search_wh=128, pad_pixels=256): :param search_expansion: expansion ratio (of the search region) w....
da1c277b602606586cd83943ef6b23eb705ec604
<|skeleton|> class TrackUtils: """A class that includes utility functions unique to track branch""" def __init__(self, search_expansion=1.0, min_search_wh=128, pad_pixels=256): """:param search_expansion: expansion ratio (of the search region) w.r.t the size of tracking targets :param min_search_wh: mi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TrackUtils: """A class that includes utility functions unique to track branch""" def __init__(self, search_expansion=1.0, min_search_wh=128, pad_pixels=256): """:param search_expansion: expansion ratio (of the search region) w.r.t the size of tracking targets :param min_search_wh: minimal size (w...
the_stack_v2_python_sparse
object_tracking/siam-mot/track_utils.py
axinc-ai/ailia-models
train
1,554
15bd305e6f27ac02efd48b1cd78c286bb7037a8f
[ "sum_prev = 0\ni = 1\nwhile sum_prev + len(str(i)) < n:\n sum_prev += len(str(i))\n i += 1\nreturn int(str(i)[n - sum_prev - 1])", "start, size, step = (1, 1, 9)\nwhile n > size * step:\n n, size, step, start = (n - size * step, size + 1, step * 10, start * 10)\nreturn int(str(start + (n - 1) // size)[(n...
<|body_start_0|> sum_prev = 0 i = 1 while sum_prev + len(str(i)) < n: sum_prev += len(str(i)) i += 1 return int(str(i)[n - sum_prev - 1]) <|end_body_0|> <|body_start_1|> start, size, step = (1, 1, 9) while n > size * step: n, size, ste...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def findNthDigit(self, n): """:type n: int :rtype: int""" <|body_0|> def findNthDigit(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> sum_prev = 0 i = 1 while sum_prev + len(str(i)) < n...
stack_v2_sparse_classes_36k_train_000095
1,015
no_license
[ { "docstring": ":type n: int :rtype: int", "name": "findNthDigit", "signature": "def findNthDigit(self, n)" }, { "docstring": ":type n: int :rtype: int", "name": "findNthDigit", "signature": "def findNthDigit(self, n)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findNthDigit(self, n): :type n: int :rtype: int - def findNthDigit(self, n): :type n: int :rtype: int
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def findNthDigit(self, n): :type n: int :rtype: int - def findNthDigit(self, n): :type n: int :rtype: int <|skeleton|> class Solution: def findNthDigit(self, n): ""...
6de551327f96ec4d4b63d0045281b65bbb4f5d0f
<|skeleton|> class Solution: def findNthDigit(self, n): """:type n: int :rtype: int""" <|body_0|> def findNthDigit(self, n): """:type n: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def findNthDigit(self, n): """:type n: int :rtype: int""" sum_prev = 0 i = 1 while sum_prev + len(str(i)) < n: sum_prev += len(str(i)) i += 1 return int(str(i)[n - sum_prev - 1]) def findNthDigit(self, n): """:type n: int :...
the_stack_v2_python_sparse
findNthDigit.py
JingweiTu/leetcode
train
0
aeb3ab99d75b26bd66743ad4a6bee3666807a4ab
[ "self.assertEqual(version.inventreeInstanceTitle(), 'InvenTree')\nInvenTreeSetting.set_setting('INVENTREE_INSTANCE_TITLE', True, self.user)\nInvenTreeSetting.set_setting('INVENTREE_INSTANCE', 'Testing title', self.user)\nself.assertEqual(version.inventreeInstanceTitle(), 'Testing title')\nsite_obj = Site.objects.al...
<|body_start_0|> self.assertEqual(version.inventreeInstanceTitle(), 'InvenTree') InvenTreeSetting.set_setting('INVENTREE_INSTANCE_TITLE', True, self.user) InvenTreeSetting.set_setting('INVENTREE_INSTANCE', 'Testing title', self.user) self.assertEqual(version.inventreeInstanceTitle(), 'Te...
Unit tests for instance name.
TestInstanceName
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestInstanceName: """Unit tests for instance name.""" def test_instance_name(self): """Test instance name settings.""" <|body_0|> def test_instance_url(self): """Test instance url settings.""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.as...
stack_v2_sparse_classes_36k_train_000096
41,191
permissive
[ { "docstring": "Test instance name settings.", "name": "test_instance_name", "signature": "def test_instance_name(self)" }, { "docstring": "Test instance url settings.", "name": "test_instance_url", "signature": "def test_instance_url(self)" } ]
2
null
Implement the Python class `TestInstanceName` described below. Class description: Unit tests for instance name. Method signatures and docstrings: - def test_instance_name(self): Test instance name settings. - def test_instance_url(self): Test instance url settings.
Implement the Python class `TestInstanceName` described below. Class description: Unit tests for instance name. Method signatures and docstrings: - def test_instance_name(self): Test instance name settings. - def test_instance_url(self): Test instance url settings. <|skeleton|> class TestInstanceName: """Unit te...
e88a8e99a5f0b201c67a95cba097c729f090d5e2
<|skeleton|> class TestInstanceName: """Unit tests for instance name.""" def test_instance_name(self): """Test instance name settings.""" <|body_0|> def test_instance_url(self): """Test instance url settings.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestInstanceName: """Unit tests for instance name.""" def test_instance_name(self): """Test instance name settings.""" self.assertEqual(version.inventreeInstanceTitle(), 'InvenTree') InvenTreeSetting.set_setting('INVENTREE_INSTANCE_TITLE', True, self.user) InvenTreeSetting...
the_stack_v2_python_sparse
InvenTree/InvenTree/tests.py
inventree/InvenTree
train
3,077
b0b42e26e2bd0c4e8d2823d24a39647ecbc88677
[ "super(HexagonalSampler, self).__init__()\nself.parent = parent\nself.normal_vector = normal_vector\nself.parallel_vector = parallel_vector\nself.vector_2 = None\nself.origin = origin\nself.local_work_size = local_work_size\nif grid_spacing_per_m is None:\n self.delta = grid_spacing_per_wavelength * self.parent....
<|body_start_0|> super(HexagonalSampler, self).__init__() self.parent = parent self.normal_vector = normal_vector self.parallel_vector = parallel_vector self.vector_2 = None self.origin = origin self.local_work_size = local_work_size if grid_spacing_per_m ...
This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points.
HexagonalSampler
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HexagonalSampler: """This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points.""" def __init__(self, parent=None, normal_vector=np.array((0, 0, 1)), parallel_vector=np.array((0, 1, 0)), origin=np....
stack_v2_sparse_classes_36k_train_000097
7,481
permissive
[ { "docstring": "This method intialises an instance of the HexagonalSampler class. Parameters ---------- parent : handybeam.world.World This is an instance of the handybeam world class. normal_vector : numpy array This is the vector normal to the desired sampling grid. parallel_vector : numpy array This is a vec...
4
stack_v2_sparse_classes_30k_train_008069
Implement the Python class `HexagonalSampler` described below. Class description: This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points. Method signatures and docstrings: - def __init__(self, parent=None, normal_vector=...
Implement the Python class `HexagonalSampler` described below. Class description: This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points. Method signatures and docstrings: - def __init__(self, parent=None, normal_vector=...
9f80b97742cde4b75d3478d554dc9bc2cd9dfd96
<|skeleton|> class HexagonalSampler: """This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points.""" def __init__(self, parent=None, normal_vector=np.array((0, 0, 1)), parallel_vector=np.array((0, 1, 0)), origin=np....
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HexagonalSampler: """This is the hexagonal sampling grid class. It takes the specification for a hexagonal sampling array and then samples the acoustic field at these points.""" def __init__(self, parent=None, normal_vector=np.array((0, 0, 1)), parallel_vector=np.array((0, 1, 0)), origin=np.array((0, 0, ...
the_stack_v2_python_sparse
handybeam/samplers/hexagonal_sampler.py
hewhocannotbetamed/HandyBeam
train
0
038253d8d04870fe6448a327cec1e8a9cbcf7583
[ "for row in matrix:\n for num in row:\n print(num, end=' ')\n print()", "n = len(matrix)\nresult = []\nfor j in range(n):\n curr = []\n i = 0\n while i < n and j > -1:\n curr.append(matrix[i][j])\n i += 1\n j -= 1\n result.append(curr)\nfor i in range(1, n):\n curr...
<|body_start_0|> for row in matrix: for num in row: print(num, end=' ') print() <|end_body_0|> <|body_start_1|> n = len(matrix) result = [] for j in range(n): curr = [] i = 0 while i < n and j > -1: ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def display(self, matrix): """Prints out 2-D matrix.""" <|body_0|> def anti_diagonals(self, matrix): """Returns a new matrix(array of arrays) consisting of anti diagonals. Time complexity: O(n ^ n). Space complexity: O(n).""" <|body_1|> def ant...
stack_v2_sparse_classes_36k_train_000098
2,436
no_license
[ { "docstring": "Prints out 2-D matrix.", "name": "display", "signature": "def display(self, matrix)" }, { "docstring": "Returns a new matrix(array of arrays) consisting of anti diagonals. Time complexity: O(n ^ n). Space complexity: O(n).", "name": "anti_diagonals", "signature": "def ant...
3
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def display(self, matrix): Prints out 2-D matrix. - def anti_diagonals(self, matrix): Returns a new matrix(array of arrays) consisting of anti diagonals. Time complexity: O(n ^ n...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def display(self, matrix): Prints out 2-D matrix. - def anti_diagonals(self, matrix): Returns a new matrix(array of arrays) consisting of anti diagonals. Time complexity: O(n ^ n...
71b722ddfe8da04572e527b055cf8723d5c87bbf
<|skeleton|> class Solution: def display(self, matrix): """Prints out 2-D matrix.""" <|body_0|> def anti_diagonals(self, matrix): """Returns a new matrix(array of arrays) consisting of anti diagonals. Time complexity: O(n ^ n). Space complexity: O(n).""" <|body_1|> def ant...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def display(self, matrix): """Prints out 2-D matrix.""" for row in matrix: for num in row: print(num, end=' ') print() def anti_diagonals(self, matrix): """Returns a new matrix(array of arrays) consisting of anti diagonals. Time co...
the_stack_v2_python_sparse
Matrix_problems/anti_diagonals.py
vladn90/Algorithms
train
0
28bec5820bcb2bdaceb49c5b3c0abba7a79001e2
[ "if check_aligned:\n self.check_aligned(list(data.values()))\ndata_arrays = {}\nfor key, rast in data.items():\n keysplit = key.split(const.BAND_INDEX_SEPARATOR)\n variable = keysplit[0]\n if len(keysplit) > 1:\n band_index = int(keysplit[1])\n else:\n band_index = 0\n if rast.bands[...
<|body_start_0|> if check_aligned: self.check_aligned(list(data.values())) data_arrays = {} for key, rast in data.items(): keysplit = key.split(const.BAND_INDEX_SEPARATOR) variable = keysplit[0] if len(keysplit) > 1: band_index = in...
Compute raster algebra expressions using the FormulaParser class.
RasterAlgebraParser
[ "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RasterAlgebraParser: """Compute raster algebra expressions using the FormulaParser class.""" def evaluate_raster_algebra(self, data, formula, check_aligned=False): """Evaluate a raster algebra expression on a set of rasters. All input rasters need to be strictly aligned (same size, g...
stack_v2_sparse_classes_36k_train_000099
10,610
permissive
[ { "docstring": "Evaluate a raster algebra expression on a set of rasters. All input rasters need to be strictly aligned (same size, geotransform and srid). The input raster list will be zipped into a dictionary using the input names. The resulting dictionary will be used as input data for formula evaluation. If...
2
stack_v2_sparse_classes_30k_train_012884
Implement the Python class `RasterAlgebraParser` described below. Class description: Compute raster algebra expressions using the FormulaParser class. Method signatures and docstrings: - def evaluate_raster_algebra(self, data, formula, check_aligned=False): Evaluate a raster algebra expression on a set of rasters. Al...
Implement the Python class `RasterAlgebraParser` described below. Class description: Compute raster algebra expressions using the FormulaParser class. Method signatures and docstrings: - def evaluate_raster_algebra(self, data, formula, check_aligned=False): Evaluate a raster algebra expression on a set of rasters. Al...
34fffe3d1f921b2850d3cad598a3c9b382e1fec7
<|skeleton|> class RasterAlgebraParser: """Compute raster algebra expressions using the FormulaParser class.""" def evaluate_raster_algebra(self, data, formula, check_aligned=False): """Evaluate a raster algebra expression on a set of rasters. All input rasters need to be strictly aligned (same size, g...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RasterAlgebraParser: """Compute raster algebra expressions using the FormulaParser class.""" def evaluate_raster_algebra(self, data, formula, check_aligned=False): """Evaluate a raster algebra expression on a set of rasters. All input rasters need to be strictly aligned (same size, geotransform a...
the_stack_v2_python_sparse
raster/algebra/parser.py
henhuy/django-raster
train
0