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
737b3b2cd61bb1304a3d3baae3e54ebc9600b451
[ "time_window = config['time_window'] / 365.0\nmag = catalogue.data['magnitude']\nneq = np.shape(mag)[0]\nyear_dec = decimal_year(catalogue.data['year'], catalogue.data['month'], catalogue.data['day'])\nsw_space, _ = config['time_distance_window'].calc(catalogue.data['magnitude'])\nvcl = np.zeros(neq, dtype=int)\nfl...
<|body_start_0|> time_window = config['time_window'] / 365.0 mag = catalogue.data['magnitude'] neq = np.shape(mag)[0] year_dec = decimal_year(catalogue.data['year'], catalogue.data['month'], catalogue.data['day']) sw_space, _ = config['time_distance_window'].calc(catalogue.data['...
This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124
Afteran
[ "BSD-3-Clause", "AGPL-3.0-only" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Afteran: """This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124""" def decluster(self, catalogue, config): """catalogue_matrix, window_opt=TDW_GARDN...
stack_v2_sparse_classes_36k_train_034800
10,047
permissive
[ { "docstring": "catalogue_matrix, window_opt=TDW_GARDNERKNOPOFF, time_window=60.): :param catalogue: a catalogue object :type catalogue: Instance of the openquake.hmtk.seismicity.catalogue.Catalogue() class :keyword window_opt: method used in calculating distance and time windows :type window_opt: string :keywo...
3
null
Implement the Python class `Afteran` described below. Class description: This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124 Method signatures and docstrings: - def decluster(self, c...
Implement the Python class `Afteran` described below. Class description: This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124 Method signatures and docstrings: - def decluster(self, c...
0da9ba5a575360081715e8b90c71d4b16c6687c8
<|skeleton|> class Afteran: """This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124""" def decluster(self, catalogue, config): """catalogue_matrix, window_opt=TDW_GARDN...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Afteran: """This implements the Afteran algorithm as described in this paper: Musson, R. (1999), Probabilistic seismic hazard maps for the North Balkan Region, Annali Di Geofisica, 42(6), 1109 - 1124""" def decluster(self, catalogue, config): """catalogue_matrix, window_opt=TDW_GARDNERKNOPOFF, ti...
the_stack_v2_python_sparse
openquake/hmtk/seismicity/declusterer/dec_afteran.py
GFZ-Centre-for-Early-Warning/shakyground
train
1
58761d0776644488d0157582e30e5b119ac1012f
[ "assert isinstance(response, scrapy.http.response.html.HtmlResponse)\nurls = [response.url]\nparts = str(response.url.split('/')[-1])\nparts = parts.split('.', 1)\ncurboard = parts[0]\nposts_per_page = 25\npagination = response.selector.xpath('//div[contains(@class,\"pagination\")]//span[contains(@class, \"page-dot...
<|body_start_0|> assert isinstance(response, scrapy.http.response.html.HtmlResponse) urls = [response.url] parts = str(response.url.split('/')[-1]) parts = parts.split('.', 1) curboard = parts[0] posts_per_page = 25 pagination = response.selector.xpath('//div[cont...
scrape reports from angling addicts forum
AnglingAddictsBoatYakReportsSpider
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AnglingAddictsBoatYakReportsSpider: """scrape reports from angling addicts forum""" def parse(self, response): """generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html', 'http://www.anglingaddicts.co.uk/forum/north-east-sea-...
stack_v2_sparse_classes_36k_train_034801
10,325
no_license
[ { "docstring": "generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html', 'http://www.anglingaddicts.co.uk/forum/north-east-sea-fishing-reports.html, ...", "name": "parse", "signature": "def parse(self, response)" }, { "docstring": "respo...
3
null
Implement the Python class `AnglingAddictsBoatYakReportsSpider` described below. Class description: scrape reports from angling addicts forum Method signatures and docstrings: - def parse(self, response): generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html...
Implement the Python class `AnglingAddictsBoatYakReportsSpider` described below. Class description: scrape reports from angling addicts forum Method signatures and docstrings: - def parse(self, response): generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html...
9123aa6baf538b662143b9098d963d55165e8409
<|skeleton|> class AnglingAddictsBoatYakReportsSpider: """scrape reports from angling addicts forum""" def parse(self, response): """generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html', 'http://www.anglingaddicts.co.uk/forum/north-east-sea-...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AnglingAddictsBoatYakReportsSpider: """scrape reports from angling addicts forum""" def parse(self, response): """generate links to pages in a board yields: 'http://www.anglingaddicts.co.uk/forum/north-west-fishing-reports.html', 'http://www.anglingaddicts.co.uk/forum/north-east-sea-fishing-repor...
the_stack_v2_python_sparse
imgscrape/spiders/angingaddicts_reports.py
gmonkman/python
train
0
ab1acc31e0da8f7c4c4bc57ec910a867e5683e29
[ "sqrt_L = int(sqrt(L))\nsqrt_R = int(sqrt(R))\nres = 0\nres_list = []\nfor i in range(sqrt_L, sqrt_R):\n if self.isPalindrome(str(i)) and self.isPalindrome(str(i ** 2)):\n res_list.append(i)\n res += 1\nprint(res_list)\nreturn res", "if len(string) == 1:\n return True\nif len(string) == 2:\n ...
<|body_start_0|> sqrt_L = int(sqrt(L)) sqrt_R = int(sqrt(R)) res = 0 res_list = [] for i in range(sqrt_L, sqrt_R): if self.isPalindrome(str(i)) and self.isPalindrome(str(i ** 2)): res_list.append(i) res += 1 print(res_list) ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def superpalindromesInRange(self, L, R): """:type L: str :type R: str :rtype: int""" <|body_0|> def isPalindrome(self, string): """test if a string is palindrome""" <|body_1|> <|end_skeleton|> <|body_start_0|> sqrt_L = int(sqrt(L)) ...
stack_v2_sparse_classes_36k_train_034802
1,622
no_license
[ { "docstring": ":type L: str :type R: str :rtype: int", "name": "superpalindromesInRange", "signature": "def superpalindromesInRange(self, L, R)" }, { "docstring": "test if a string is palindrome", "name": "isPalindrome", "signature": "def isPalindrome(self, string)" } ]
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def superpalindromesInRange(self, L, R): :type L: str :type R: str :rtype: int - def isPalindrome(self, string): test if a string is palindrome
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def superpalindromesInRange(self, L, R): :type L: str :type R: str :rtype: int - def isPalindrome(self, string): test if a string is palindrome <|skeleton|> class Solution: ...
f96a2273c6831a8035e1adacfa452f73c599ae16
<|skeleton|> class Solution: def superpalindromesInRange(self, L, R): """:type L: str :type R: str :rtype: int""" <|body_0|> def isPalindrome(self, string): """test if a string is palindrome""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def superpalindromesInRange(self, L, R): """:type L: str :type R: str :rtype: int""" sqrt_L = int(sqrt(L)) sqrt_R = int(sqrt(R)) res = 0 res_list = [] for i in range(sqrt_L, sqrt_R): if self.isPalindrome(str(i)) and self.isPalindrome(str(i ...
the_stack_v2_python_sparse
Python/SuperPalindromes (2).py
here0009/LeetCode
train
1
4964700ea5197f22120395e7b21236604fdc4b30
[ "status = None\nuser = self.context['request'].user\nurl = validated_data.get('url')\ngame_record_file = validated_data.get('game_record_file')\nif game_record_file:\n status = 'file'\nelif url:\n status = 'url'\nif status is None:\n raise serializers.ValidationError('Status must be url or file')\nreturn m...
<|body_start_0|> status = None user = self.context['request'].user url = validated_data.get('url') game_record_file = validated_data.get('game_record_file') if game_record_file: status = 'file' elif url: status = 'url' if status is None: ...
serializers to handle file object and help with extracting data
GomokuRecordFileSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GomokuRecordFileSerializer: """serializers to handle file object and help with extracting data""" def create(self, validated_data): """Creating GameRecordFile object""" <|body_0|> def validate_game_record_file(self, attrs): """File validation""" <|body_1|...
stack_v2_sparse_classes_36k_train_034803
1,763
no_license
[ { "docstring": "Creating GameRecordFile object", "name": "create", "signature": "def create(self, validated_data)" }, { "docstring": "File validation", "name": "validate_game_record_file", "signature": "def validate_game_record_file(self, attrs)" }, { "docstring": "File validatio...
3
stack_v2_sparse_classes_30k_train_004847
Implement the Python class `GomokuRecordFileSerializer` described below. Class description: serializers to handle file object and help with extracting data Method signatures and docstrings: - def create(self, validated_data): Creating GameRecordFile object - def validate_game_record_file(self, attrs): File validation...
Implement the Python class `GomokuRecordFileSerializer` described below. Class description: serializers to handle file object and help with extracting data Method signatures and docstrings: - def create(self, validated_data): Creating GameRecordFile object - def validate_game_record_file(self, attrs): File validation...
4ce3e6813e16ecaf0a118e0cc5548a091aa97646
<|skeleton|> class GomokuRecordFileSerializer: """serializers to handle file object and help with extracting data""" def create(self, validated_data): """Creating GameRecordFile object""" <|body_0|> def validate_game_record_file(self, attrs): """File validation""" <|body_1|...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GomokuRecordFileSerializer: """serializers to handle file object and help with extracting data""" def create(self, validated_data): """Creating GameRecordFile object""" status = None user = self.context['request'].user url = validated_data.get('url') game_record_fi...
the_stack_v2_python_sparse
src/gomoku_file_app/api/serializers.py
adam-harmasz/gomoku_v_0_2
train
0
3f0a5a07488547fc037a6239c3ca1327b7fb1eac
[ "urllib.request.urlopen = MagicMock(return_value=Response(5))\nsensor = Sensor(ControllerTests.DUMMY_ADDR, ControllerTests.DUMMY_PORT)\ncurrent_height = sensor.measure()\nself.assertEqual(current_height, 5)", "urllib.request.urlopen = MagicMock(return_value=Response(5))\npump = Pump(ControllerTests.DUMMY_ADDR, Co...
<|body_start_0|> urllib.request.urlopen = MagicMock(return_value=Response(5)) sensor = Sensor(ControllerTests.DUMMY_ADDR, ControllerTests.DUMMY_PORT) current_height = sensor.measure() self.assertEqual(current_height, 5) <|end_body_0|> <|body_start_1|> urllib.request.urlopen = Ma...
Unit tests for the Controller class
ControllerTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ControllerTests: """Unit tests for the Controller class""" def test_sensor(self): """Test Sensor Measure.""" <|body_0|> def test_pump_get_state(self): """Test Pump Get State.""" <|body_1|> def test_pump_set_state_true(self): """Test Pump Set ...
stack_v2_sparse_classes_36k_train_034804
4,508
no_license
[ { "docstring": "Test Sensor Measure.", "name": "test_sensor", "signature": "def test_sensor(self)" }, { "docstring": "Test Pump Get State.", "name": "test_pump_get_state", "signature": "def test_pump_get_state(self)" }, { "docstring": "Test Pump Set State True.", "name": "tes...
5
null
Implement the Python class `ControllerTests` described below. Class description: Unit tests for the Controller class Method signatures and docstrings: - def test_sensor(self): Test Sensor Measure. - def test_pump_get_state(self): Test Pump Get State. - def test_pump_set_state_true(self): Test Pump Set State True. - d...
Implement the Python class `ControllerTests` described below. Class description: Unit tests for the Controller class Method signatures and docstrings: - def test_sensor(self): Test Sensor Measure. - def test_pump_get_state(self): Test Pump Get State. - def test_pump_set_state_true(self): Test Pump Set State True. - d...
b1fea0309b3495b3e1dc167d7029bc9e4b6f00f1
<|skeleton|> class ControllerTests: """Unit tests for the Controller class""" def test_sensor(self): """Test Sensor Measure.""" <|body_0|> def test_pump_get_state(self): """Test Pump Get State.""" <|body_1|> def test_pump_set_state_true(self): """Test Pump Set ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ControllerTests: """Unit tests for the Controller class""" def test_sensor(self): """Test Sensor Measure.""" urllib.request.urlopen = MagicMock(return_value=Response(5)) sensor = Sensor(ControllerTests.DUMMY_ADDR, ControllerTests.DUMMY_PORT) current_height = sensor.measure...
the_stack_v2_python_sparse
students/mayc4t/lesson06_part2/waterregulation/test.py
UWPCE-PythonCert-ClassRepos/SP_Online_Course2_2018
train
4
5518c0d98b18581231e36c16df9409b0e6597fd5
[ "local_dim = self.state_manifold.local_dim_from_point(belief.mean)\nassert belief.cov.shape == dynamics_cov.shape == (local_dim, local_dim)\nA: jnp.ndarray = jax.jacfwd(lambda tangent: self.state_manifold.boxminus(self.dynamics_model(self.state_manifold.boxplus(belief.mean, tangent), control_input), belief.mean))(j...
<|body_start_0|> local_dim = self.state_manifold.local_dim_from_point(belief.mean) assert belief.cov.shape == dynamics_cov.shape == (local_dim, local_dim) A: jnp.ndarray = jax.jacfwd(lambda tangent: self.state_manifold.boxminus(self.dynamics_model(self.state_manifold.boxplus(belief.mean, tangent...
Extended Kalman filter definition.
EkfDefinition
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class EkfDefinition: """Extended Kalman filter definition.""" def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]: """EKF prediction step.""" <|body_0|> def correct(self, belief: Mu...
stack_v2_sparse_classes_36k_train_034805
5,265
no_license
[ { "docstring": "EKF prediction step.", "name": "predict", "signature": "def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]" }, { "docstring": "EKF correction step.", "name": "correct", "signa...
2
null
Implement the Python class `EkfDefinition` described below. Class description: Extended Kalman filter definition. Method signatures and docstrings: - def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]: EKF prediction step...
Implement the Python class `EkfDefinition` described below. Class description: Extended Kalman filter definition. Method signatures and docstrings: - def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]: EKF prediction step...
639f8a603aba0b9a357422aa2a0704a023fe564d
<|skeleton|> class EkfDefinition: """Extended Kalman filter definition.""" def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]: """EKF prediction step.""" <|body_0|> def correct(self, belief: Mu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class EkfDefinition: """Extended Kalman filter definition.""" def predict(self, belief: MultivariateGaussian[StateType], control_input: ControlInputType, dynamics_cov: Array) -> MultivariateGaussian[StateType]: """EKF prediction step.""" local_dim = self.state_manifold.local_dim_from_point(beli...
the_stack_v2_python_sparse
lib/manifold_ekf.py
MegaYEye/dfgo
train
0
c1dd6701cd302b62912a156a2b688db4327fe21e
[ "super(Settings, self).__init__(parent)\nself.parent = parent\nself.list_edit = []\nself.populate(conf)", "mainLayout = QtGui.QGridLayout(self)\ni = 0\nfor key in conf.keys():\n mainLayout.addWidget(QtGui.QLabel(key), i, 0)\n self.list_edit.append([key, QtGui.QLineEdit()])\n mainLayout.addWidget(self.lis...
<|body_start_0|> super(Settings, self).__init__(parent) self.parent = parent self.list_edit = [] self.populate(conf) <|end_body_0|> <|body_start_1|> mainLayout = QtGui.QGridLayout(self) i = 0 for key in conf.keys(): mainLayout.addWidget(QtGui.QLabel(k...
display playing list
Settings
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Settings: """display playing list""" def __init__(self, conf, parent=None): """initialisation""" <|body_0|> def populate(self, conf): """create layout""" <|body_1|> def saveClicked(self): """save the config""" <|body_2|> <|end_skelet...
stack_v2_sparse_classes_36k_train_034806
1,467
no_license
[ { "docstring": "initialisation", "name": "__init__", "signature": "def __init__(self, conf, parent=None)" }, { "docstring": "create layout", "name": "populate", "signature": "def populate(self, conf)" }, { "docstring": "save the config", "name": "saveClicked", "signature"...
3
stack_v2_sparse_classes_30k_train_010101
Implement the Python class `Settings` described below. Class description: display playing list Method signatures and docstrings: - def __init__(self, conf, parent=None): initialisation - def populate(self, conf): create layout - def saveClicked(self): save the config
Implement the Python class `Settings` described below. Class description: display playing list Method signatures and docstrings: - def __init__(self, conf, parent=None): initialisation - def populate(self, conf): create layout - def saveClicked(self): save the config <|skeleton|> class Settings: """display playi...
a24b3e4e8acbd4da9ba4c83bf96c0b2d2a2cca9c
<|skeleton|> class Settings: """display playing list""" def __init__(self, conf, parent=None): """initialisation""" <|body_0|> def populate(self, conf): """create layout""" <|body_1|> def saveClicked(self): """save the config""" <|body_2|> <|end_skelet...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Settings: """display playing list""" def __init__(self, conf, parent=None): """initialisation""" super(Settings, self).__init__(parent) self.parent = parent self.list_edit = [] self.populate(conf) def populate(self, conf): """create layout""" m...
the_stack_v2_python_sparse
gui/menusettings.py
sensini42/flvdown
train
0
6851f6320b96f8defc30e40b99b7cb387ac6c84f
[ "self.places = {}\nself.transitions = {}\nself.successful_firings = []\nself.a = {}", "pn_copy = PetriNetModel()\nfor place in petri_net_model.places.values():\n pn_copy.add_place(place.tokens, place.place_id, place.label)\nfor t in petri_net_model.transitions.values():\n input_place_ids = [arc.place.place_...
<|body_start_0|> self.places = {} self.transitions = {} self.successful_firings = [] self.a = {} <|end_body_0|> <|body_start_1|> pn_copy = PetriNetModel() for place in petri_net_model.places.values(): pn_copy.add_place(place.tokens, place.place_id, place.labe...
PetriNetModel
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PetriNetModel: def __init__(self): """Initialize an empty Petri net.""" <|body_0|> def make_copy_of(petri_net_model): """Makes a deep copy of a PetriNetModel instance. Args: petri_net_model: instance of PetriNetModel to be copied""" <|body_1|> def add_pl...
stack_v2_sparse_classes_36k_train_034807
27,136
no_license
[ { "docstring": "Initialize an empty Petri net.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Makes a deep copy of a PetriNetModel instance. Args: petri_net_model: instance of PetriNetModel to be copied", "name": "make_copy_of", "signature": "def make_copy_of(...
5
stack_v2_sparse_classes_30k_train_016559
Implement the Python class `PetriNetModel` described below. Class description: Implement the PetriNetModel class. Method signatures and docstrings: - def __init__(self): Initialize an empty Petri net. - def make_copy_of(petri_net_model): Makes a deep copy of a PetriNetModel instance. Args: petri_net_model: instance o...
Implement the Python class `PetriNetModel` described below. Class description: Implement the PetriNetModel class. Method signatures and docstrings: - def __init__(self): Initialize an empty Petri net. - def make_copy_of(petri_net_model): Makes a deep copy of a PetriNetModel instance. Args: petri_net_model: instance o...
8e9a3a8151069757475808c48511c9d7486ea334
<|skeleton|> class PetriNetModel: def __init__(self): """Initialize an empty Petri net.""" <|body_0|> def make_copy_of(petri_net_model): """Makes a deep copy of a PetriNetModel instance. Args: petri_net_model: instance of PetriNetModel to be copied""" <|body_1|> def add_pl...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PetriNetModel: def __init__(self): """Initialize an empty Petri net.""" self.places = {} self.transitions = {} self.successful_firings = [] self.a = {} def make_copy_of(petri_net_model): """Makes a deep copy of a PetriNetModel instance. Args: petri_net_mode...
the_stack_v2_python_sparse
Stochasticity-Net/Stochastic_PN_Architecture_v2.py
PN-Alzheimers-Parkinsons/PN_Alzheimers_Parkinsons
train
0
c4c14ce7f685d3a09da2ae08d320c65c9aeb1d6a
[ "Frame.__init__(self, master)\nself.grid()\nself.create_widgets()", "Label(self, text='Welcome to Order Up!').grid(row=0, column=0, columnspan=2, sticky=W)\nLabel(self, text='Please choose what you would like to eat.').grid(row=1, column=0, columnspan=2, sticky=W)\nLabel(self, text='******************************...
<|body_start_0|> Frame.__init__(self, master) self.grid() self.create_widgets() <|end_body_0|> <|body_start_1|> Label(self, text='Welcome to Order Up!').grid(row=0, column=0, columnspan=2, sticky=W) Label(self, text='Please choose what you would like to eat.').grid(row=1, column...
GUI application that creates a story based on user input.
Application
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Application: """GUI application that creates a story based on user input.""" def __init__(self, master): """Initialize Frame""" <|body_0|> def create_widgets(self): """Create widgets to create the menu""" <|body_1|> def food_eaten(self): """f...
stack_v2_sparse_classes_36k_train_034808
4,026
no_license
[ { "docstring": "Initialize Frame", "name": "__init__", "signature": "def __init__(self, master)" }, { "docstring": "Create widgets to create the menu", "name": "create_widgets", "signature": "def create_widgets(self)" }, { "docstring": "fill text box list of foods eaten and total...
3
stack_v2_sparse_classes_30k_train_015861
Implement the Python class `Application` described below. Class description: GUI application that creates a story based on user input. Method signatures and docstrings: - def __init__(self, master): Initialize Frame - def create_widgets(self): Create widgets to create the menu - def food_eaten(self): fill text box li...
Implement the Python class `Application` described below. Class description: GUI application that creates a story based on user input. Method signatures and docstrings: - def __init__(self, master): Initialize Frame - def create_widgets(self): Create widgets to create the menu - def food_eaten(self): fill text box li...
272683aa0bfb68889e7dc272797549217f318dda
<|skeleton|> class Application: """GUI application that creates a story based on user input.""" def __init__(self, master): """Initialize Frame""" <|body_0|> def create_widgets(self): """Create widgets to create the menu""" <|body_1|> def food_eaten(self): """f...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Application: """GUI application that creates a story based on user input.""" def __init__(self, master): """Initialize Frame""" Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): """Create widgets to create the menu""" ...
the_stack_v2_python_sparse
CSC_217/CSC_217_470_Assignment2/CIS_217_470_ASSIGNMENT2b_MENU.py
denisetra/SCHOOL
train
0
dce076d89149465719f21ef7bd06283c8c0abeb3
[ "user_id = get_jwt_identity()\nuser = find_user(user_id)\ntarget_user = find_user(following_user_id)\nif not target_user:\n return ({'msg': f'User {following_user_id} is not found'}, 404)\nif not add_following(user, target_user):\n return ({'msg': f'Already following user {following_user_id}'}, 409)", "user...
<|body_start_0|> user_id = get_jwt_identity() user = find_user(user_id) target_user = find_user(following_user_id) if not target_user: return ({'msg': f'User {following_user_id} is not found'}, 404) if not add_following(user, target_user): return ({'msg': ...
Following
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Following: def post(self, following_user_id): """Follow a user""" <|body_0|> def delete(self, following_user_id): """Unfollow a user""" <|body_1|> <|end_skeleton|> <|body_start_0|> user_id = get_jwt_identity() user = find_user(user_id) ...
stack_v2_sparse_classes_36k_train_034809
1,142
permissive
[ { "docstring": "Follow a user", "name": "post", "signature": "def post(self, following_user_id)" }, { "docstring": "Unfollow a user", "name": "delete", "signature": "def delete(self, following_user_id)" } ]
2
stack_v2_sparse_classes_30k_train_019846
Implement the Python class `Following` described below. Class description: Implement the Following class. Method signatures and docstrings: - def post(self, following_user_id): Follow a user - def delete(self, following_user_id): Unfollow a user
Implement the Python class `Following` described below. Class description: Implement the Following class. Method signatures and docstrings: - def post(self, following_user_id): Follow a user - def delete(self, following_user_id): Unfollow a user <|skeleton|> class Following: def post(self, following_user_id): ...
196635e7d0019def1d5ee3b38f82e270085201a0
<|skeleton|> class Following: def post(self, following_user_id): """Follow a user""" <|body_0|> def delete(self, following_user_id): """Unfollow a user""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Following: def post(self, following_user_id): """Follow a user""" user_id = get_jwt_identity() user = find_user(user_id) target_user = find_user(following_user_id) if not target_user: return ({'msg': f'User {following_user_id} is not found'}, 404) if...
the_stack_v2_python_sparse
mini_gplus/resources/followings.py
baronrustamov/pill-city
train
0
685db71c0fef3f4318c1bd110c1f328200b023c5
[ "super(FunctionComponent, self).__init__(opts)\nself.options = opts.get('fn_hibp', {})\nself.PROXIES = {}\nPROXY_HTTP = self.get_config_option('hibp_proxy_http', True)\nPROXY_HTTPS = self.get_config_option('hibp_proxy_https', True)\nif PROXY_HTTP is not None:\n self.PROXIES['http'] = PROXY_HTTP\nif PROXY_HTTPS i...
<|body_start_0|> super(FunctionComponent, self).__init__(opts) self.options = opts.get('fn_hibp', {}) self.PROXIES = {} PROXY_HTTP = self.get_config_option('hibp_proxy_http', True) PROXY_HTTPS = self.get_config_option('hibp_proxy_https', True) if PROXY_HTTP is not None: ...
Component that implements Resilient function 'have_i_been_pwned_get_pastes
FunctionComponent
[ "LicenseRef-scancode-unknown-license-reference", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FunctionComponent: """Component that implements Resilient function 'have_i_been_pwned_get_pastes""" def __init__(self, opts): """constructor provides access to the configuration options""" <|body_0|> def get_config_option(self, option_name, optional=False): """Gi...
stack_v2_sparse_classes_36k_train_034810
3,804
permissive
[ { "docstring": "constructor provides access to the configuration options", "name": "__init__", "signature": "def __init__(self, opts)" }, { "docstring": "Given option_name, checks if it is in appconfig. Raises ValueError if a mandatory option is missing", "name": "get_config_option", "si...
3
stack_v2_sparse_classes_30k_train_009121
Implement the Python class `FunctionComponent` described below. Class description: Component that implements Resilient function 'have_i_been_pwned_get_pastes Method signatures and docstrings: - def __init__(self, opts): constructor provides access to the configuration options - def get_config_option(self, option_name...
Implement the Python class `FunctionComponent` described below. Class description: Component that implements Resilient function 'have_i_been_pwned_get_pastes Method signatures and docstrings: - def __init__(self, opts): constructor provides access to the configuration options - def get_config_option(self, option_name...
2e3c4b6102555517bad22bf87fa4a06341714166
<|skeleton|> class FunctionComponent: """Component that implements Resilient function 'have_i_been_pwned_get_pastes""" def __init__(self, opts): """constructor provides access to the configuration options""" <|body_0|> def get_config_option(self, option_name, optional=False): """Gi...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FunctionComponent: """Component that implements Resilient function 'have_i_been_pwned_get_pastes""" def __init__(self, opts): """constructor provides access to the configuration options""" super(FunctionComponent, self).__init__(opts) self.options = opts.get('fn_hibp', {}) ...
the_stack_v2_python_sparse
fn_hibp/fn_hibp/components/have_i_been_pwned_get_pastes.py
jjfallete/resilient-community-apps
train
1
0bb7af8750ad65c304c29f9968d05b5df70aac91
[ "super().__init__(num_workers, resources)\nself.index_list = ResourceManager.get_index_list(self.num_workers, self.total_num_rsets, resources.zero_resource_workers)\nself.rsets = np.zeros(self.total_num_rsets, dtype=ResourceManager.man_rset_dtype)\nself.rsets['assigned'] = 0\nfor field in self.all_rsets.dtype.names...
<|body_start_0|> super().__init__(num_workers, resources) self.index_list = ResourceManager.get_index_list(self.num_workers, self.total_num_rsets, resources.zero_resource_workers) self.rsets = np.zeros(self.total_num_rsets, dtype=ResourceManager.man_rset_dtype) self.rsets['assigned'] = 0...
Provides methods for managing the assignment of resource sets to workers.
ResourceManager
[ "BSD-3-Clause", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ResourceManager: """Provides methods for managing the assignment of resource sets to workers.""" def __init__(self, num_workers: int, resources: 'GlobalResources') -> None: """Initializes a new ResourceManager instance Instantiates the numpy structured array that holds information fo...
stack_v2_sparse_classes_36k_train_034811
13,935
permissive
[ { "docstring": "Initializes a new ResourceManager instance Instantiates the numpy structured array that holds information for each resource set. Parameters ---------- num_workers: int The number of workers resources: Resources A Resources object containing global nodelist and intranode information", "name":...
4
null
Implement the Python class `ResourceManager` described below. Class description: Provides methods for managing the assignment of resource sets to workers. Method signatures and docstrings: - def __init__(self, num_workers: int, resources: 'GlobalResources') -> None: Initializes a new ResourceManager instance Instanti...
Implement the Python class `ResourceManager` described below. Class description: Provides methods for managing the assignment of resource sets to workers. Method signatures and docstrings: - def __init__(self, num_workers: int, resources: 'GlobalResources') -> None: Initializes a new ResourceManager instance Instanti...
0ffcc5f88f693ebf60ba125a7cae6a44d2c98c6f
<|skeleton|> class ResourceManager: """Provides methods for managing the assignment of resource sets to workers.""" def __init__(self, num_workers: int, resources: 'GlobalResources') -> None: """Initializes a new ResourceManager instance Instantiates the numpy structured array that holds information fo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ResourceManager: """Provides methods for managing the assignment of resource sets to workers.""" def __init__(self, num_workers: int, resources: 'GlobalResources') -> None: """Initializes a new ResourceManager instance Instantiates the numpy structured array that holds information for each resour...
the_stack_v2_python_sparse
libensemble/resources/worker_resources.py
Libensemble/libensemble
train
69
f4f242a022cb30a2e2b16382812157d03c5b0e68
[ "self.driver = driver\nself.comp_name = comp_name\nself.elements = self.get_components()", "try:\n self.get_components()\n return False\nexcept:\n return True" ]
<|body_start_0|> self.driver = driver self.comp_name = comp_name self.elements = self.get_components() <|end_body_0|> <|body_start_1|> try: self.get_components() return False except: return True <|end_body_1|>
手机端单选框控件
RadioPhonePage
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RadioPhonePage: """手机端单选框控件""" def __init__(self, driver, comp_name): """类初始化执行""" <|body_0|> def hide_test(self): """单选按钮条件隐藏""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.driver = driver self.comp_name = comp_name self.e...
stack_v2_sparse_classes_36k_train_034812
1,818
no_license
[ { "docstring": "类初始化执行", "name": "__init__", "signature": "def __init__(self, driver, comp_name)" }, { "docstring": "单选按钮条件隐藏", "name": "hide_test", "signature": "def hide_test(self)" } ]
2
null
Implement the Python class `RadioPhonePage` described below. Class description: 手机端单选框控件 Method signatures and docstrings: - def __init__(self, driver, comp_name): 类初始化执行 - def hide_test(self): 单选按钮条件隐藏
Implement the Python class `RadioPhonePage` described below. Class description: 手机端单选框控件 Method signatures and docstrings: - def __init__(self, driver, comp_name): 类初始化执行 - def hide_test(self): 单选按钮条件隐藏 <|skeleton|> class RadioPhonePage: """手机端单选框控件""" def __init__(self, driver, comp_name): """类初始化执...
78768989a79a14013b983024cf6e4838d51ed595
<|skeleton|> class RadioPhonePage: """手机端单选框控件""" def __init__(self, driver, comp_name): """类初始化执行""" <|body_0|> def hide_test(self): """单选按钮条件隐藏""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RadioPhonePage: """手机端单选框控件""" def __init__(self, driver, comp_name): """类初始化执行""" self.driver = driver self.comp_name = comp_name self.elements = self.get_components() def hide_test(self): """单选按钮条件隐藏""" try: self.get_components() ...
the_stack_v2_python_sparse
test_case/page_obj/form/radio_page.py
pylk/pythonSelenium
train
0
4ded124c159fc0565039ea9e4934a5cf46e782c4
[ "m = len(obstacleGrid)\nif m == 0:\n return 0\nn = len(obstacleGrid[0])\nself.cnt = 0\n\ndef help(obstacleGrid, x, y, m, n):\n if obstacleGrid[x][y]:\n return\n if obstacleGrid[x][y] == 0 and x == m - 1 and (y == n - 1):\n self.cnt += 1\n if x < m and y < n:\n if y + 1 < n and obsta...
<|body_start_0|> m = len(obstacleGrid) if m == 0: return 0 n = len(obstacleGrid[0]) self.cnt = 0 def help(obstacleGrid, x, y, m, n): if obstacleGrid[x][y]: return if obstacleGrid[x][y] == 0 and x == m - 1 and (y == n - 1): ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def uniquePathsWithObstacles1(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int""" <|body_0|> def uniquePathsWithObstacles2(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int""" <|body_1|> def uniquePa...
stack_v2_sparse_classes_36k_train_034813
2,216
no_license
[ { "docstring": ":type obstacleGrid: List[List[int]] :rtype: int", "name": "uniquePathsWithObstacles1", "signature": "def uniquePathsWithObstacles1(self, obstacleGrid)" }, { "docstring": ":type obstacleGrid: List[List[int]] :rtype: int", "name": "uniquePathsWithObstacles2", "signature": "...
3
stack_v2_sparse_classes_30k_train_004532
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def uniquePathsWithObstacles1(self, obstacleGrid): :type obstacleGrid: List[List[int]] :rtype: int - def uniquePathsWithObstacles2(self, obstacleGrid): :type obstacleGrid: List[L...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def uniquePathsWithObstacles1(self, obstacleGrid): :type obstacleGrid: List[List[int]] :rtype: int - def uniquePathsWithObstacles2(self, obstacleGrid): :type obstacleGrid: List[L...
e5b018493bbd12edcdcd0434f35d9c358106d391
<|skeleton|> class Solution: def uniquePathsWithObstacles1(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int""" <|body_0|> def uniquePathsWithObstacles2(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int""" <|body_1|> def uniquePa...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def uniquePathsWithObstacles1(self, obstacleGrid): """:type obstacleGrid: List[List[int]] :rtype: int""" m = len(obstacleGrid) if m == 0: return 0 n = len(obstacleGrid[0]) self.cnt = 0 def help(obstacleGrid, x, y, m, n): if obs...
the_stack_v2_python_sparse
py/leetcode/63.py
wfeng1991/learnpy
train
0
a4b67c39b2e2d375b923ec7857b069de0f2d7cd0
[ "new_urls = set()\nlinks = soup.find_all('a', href=re.compile('/view/\\\\d+\\\\.htm'))\nfor link in links:\n new_url = link['href']\n new_full_url = urlparse.urljoin(page_url, new_url)\n new_urls.add(new_full_url)\nreturn new_urls", "res_data = {}\nres_data['url'] = page_url\ntitle_node = soup.find('dd',...
<|body_start_0|> new_urls = set() links = soup.find_all('a', href=re.compile('/view/\\d+\\.htm')) for link in links: new_url = link['href'] new_full_url = urlparse.urljoin(page_url, new_url) new_urls.add(new_full_url) return new_urls <|end_body_0|> <|...
HtmlParser
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HtmlParser: def _get_new_urls(self, page_url, soup): """获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return:""" <|body_0|> def _get_new_data(self, page_url, soup): """获取数据,解析出了titel与summary两个数据 :param page_url: url地址 :param soup: :return: 返回解析好的数据 url,title,s...
stack_v2_sparse_classes_36k_train_034814
2,723
no_license
[ { "docstring": "获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return:", "name": "_get_new_urls", "signature": "def _get_new_urls(self, page_url, soup)" }, { "docstring": "获取数据,解析出了titel与summary两个数据 :param page_url: url地址 :param soup: :return: 返回解析好的数据 url,title,summary", "name": "_get...
3
stack_v2_sparse_classes_30k_train_019092
Implement the Python class `HtmlParser` described below. Class description: Implement the HtmlParser class. Method signatures and docstrings: - def _get_new_urls(self, page_url, soup): 获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return: - def _get_new_data(self, page_url, soup): 获取数据,解析出了titel与summary两个数据 :p...
Implement the Python class `HtmlParser` described below. Class description: Implement the HtmlParser class. Method signatures and docstrings: - def _get_new_urls(self, page_url, soup): 获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return: - def _get_new_data(self, page_url, soup): 获取数据,解析出了titel与summary两个数据 :p...
5273553a10243744905de92f325ee7d4b2fd94bf
<|skeleton|> class HtmlParser: def _get_new_urls(self, page_url, soup): """获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return:""" <|body_0|> def _get_new_data(self, page_url, soup): """获取数据,解析出了titel与summary两个数据 :param page_url: url地址 :param soup: :return: 返回解析好的数据 url,title,s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HtmlParser: def _get_new_urls(self, page_url, soup): """获取url列表,匹配出页面所有词条的url :param page_url: :param soup: :return:""" new_urls = set() links = soup.find_all('a', href=re.compile('/view/\\d+\\.htm')) for link in links: new_url = link['href'] new_full_ur...
the_stack_v2_python_sparse
baike_spider/html_parser.py
linuxhub/python
train
3
1718fd0de16a4973603bc47f724bde41fbcbc2fe
[ "p = prehead = ListNode()\ncarry = 0\nwhile l1 or l2:\n s = carry\n if l1:\n s += l1.val\n l1 = l1.next\n if l2:\n s += l2.val\n l2 = l2.next\n carry = s // 10\n p.next = ListNode(s % 10)\n p = p.next\nif carry:\n p.next = ListNode(carry)\nreturn prehead.next", "de...
<|body_start_0|> p = prehead = ListNode() carry = 0 while l1 or l2: s = carry if l1: s += l1.val l1 = l1.next if l2: s += l2.val l2 = l2.next carry = s // 10 p.next = ListN...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode: """Use a "prehead" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54%""" <|body_0|> def addTwoNumbers_v2(self, l1: ListNode, l2: ListNode) -> ListNode: """Convert lists to integers...
stack_v2_sparse_classes_36k_train_034815
3,213
no_license
[ { "docstring": "Use a \"prehead\" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54%", "name": "addTwoNumbers_v1", "signature": "def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode" }, { "docstring": "Convert lists to integers and then conver the sume of integers back to ...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode: Use a "prehead" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54% - def addTwoNumbers_v2(self, l1: L...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode: Use a "prehead" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54% - def addTwoNumbers_v2(self, l1: L...
97a2386f5e3adbd7138fd123810c3232bdf7f622
<|skeleton|> class Solution: def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode: """Use a "prehead" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54%""" <|body_0|> def addTwoNumbers_v2(self, l1: ListNode, l2: ListNode) -> ListNode: """Convert lists to integers...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def addTwoNumbers_v1(self, l1: ListNode, l2: ListNode) -> ListNode: """Use a "prehead" to simplify the logic. LeatCode: 64 ms, 14 MB; beats 94.54%""" p = prehead = ListNode() carry = 0 while l1 or l2: s = carry if l1: s += l1.va...
the_stack_v2_python_sparse
python3/linked_list/add_two_numbers.py
victorchu/algorithms
train
0
dc16473254644e2f7153668429fa7ac1750e832e
[ "if location not in LOCATIONS:\n raise NotFoundError('the location provided {!r} was not found in the list of approved locations {}'.format(location, LOCATIONS))\ntry:\n return self._client.apps().create(body={'id': self._config.project, 'locationId': location}).execute()\nexcept errors.HttpError as err:\n ...
<|body_start_0|> if location not in LOCATIONS: raise NotFoundError('the location provided {!r} was not found in the list of approved locations {}'.format(location, LOCATIONS)) try: return self._client.apps().create(body={'id': self._config.project, 'locationId': location}).execut...
App Engine Admin API access.
AdminAPI
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdminAPI: """App Engine Admin API access.""" def create(self, location): """Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be hosted. Returns: A dictionary object representing the new...
stack_v2_sparse_classes_36k_train_034816
3,596
permissive
[ { "docstring": "Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be hosted. Returns: A dictionary object representing the newly created Google App Engine application (Type: google.appengine.v1.Application). Raises...
2
stack_v2_sparse_classes_30k_train_013739
Implement the Python class `AdminAPI` described below. Class description: App Engine Admin API access. Method signatures and docstrings: - def create(self, location): Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be ...
Implement the Python class `AdminAPI` described below. Class description: App Engine Admin API access. Method signatures and docstrings: - def create(self, location): Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be ...
91753e47aff26d78978ebe7aca70f4a7cbf6a3d4
<|skeleton|> class AdminAPI: """App Engine Admin API access.""" def create(self, location): """Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be hosted. Returns: A dictionary object representing the new...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdminAPI: """App Engine Admin API access.""" def create(self, location): """Creates a new Google App Engine application in a given location. Args: location: str, the location in which the Google App Engine application is to be hosted. Returns: A dictionary object representing the newly created Go...
the_stack_v2_python_sparse
loaner/deployments/lib/app_engine.py
ryangugcloudca/loaner
train
0
0c8023968436ae88ac430ff51ecff207bb40fd6c
[ "strs = '#'.join('&{}$'.format(s))\nlength = len(strs)\ntracker = [0] * length\ncenter = right_bound = 0\nfor mid in range(1, length - 1):\n mirror = 2 * center - mid\n if mid < right_bound:\n tracker[mid] = min(right_bound - mid, tracker[mirror])\n while mid + (1 + tracker[mid]) < length and mid - ...
<|body_start_0|> strs = '#'.join('&{}$'.format(s)) length = len(strs) tracker = [0] * length center = right_bound = 0 for mid in range(1, length - 1): mirror = 2 * center - mid if mid < right_bound: tracker[mid] = min(right_bound - mid, tra...
String
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class String: def get_longest_palindrome_substring(self, s: str) -> str: """Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return:""" <|body_0|> def expand_around_center(self, s: str, left: int, right: int): """Expands around the cen...
stack_v2_sparse_classes_36k_train_034817
3,225
no_license
[ { "docstring": "Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return:", "name": "get_longest_palindrome_substring", "signature": "def get_longest_palindrome_substring(self, s: str) -> str" }, { "docstring": "Expands around the center and returns the cente...
3
null
Implement the Python class `String` described below. Class description: Implement the String class. Method signatures and docstrings: - def get_longest_palindrome_substring(self, s: str) -> str: Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return: - def expand_around_center(s...
Implement the Python class `String` described below. Class description: Implement the String class. Method signatures and docstrings: - def get_longest_palindrome_substring(self, s: str) -> str: Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return: - def expand_around_center(s...
65cc78b5afa0db064f9fe8f06597e3e120f7363d
<|skeleton|> class String: def get_longest_palindrome_substring(self, s: str) -> str: """Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return:""" <|body_0|> def expand_around_center(self, s: str, left: int, right: int): """Expands around the cen...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class String: def get_longest_palindrome_substring(self, s: str) -> str: """Approach: Manacher's Algorithm Time Complexity: O(N) Space Complexity: O(N) :param s: :return:""" strs = '#'.join('&{}$'.format(s)) length = len(strs) tracker = [0] * length center = right_bound = 0 ...
the_stack_v2_python_sparse
revisited/math_and_strings/strings/longest_palindromic_substring.py
Shiv2157k/leet_code
train
1
1285ce461d8f440a98ade3c28397c317c5a16b3d
[ "try:\n data = {'first_name': user_data['localizedFirstName'], 'last_name': user_data['localizedLastName'], 'email': user_data['elements'][0]['handle~']['emailAddress'], 'photo_url': None}\n return data\nexcept KeyError:\n raise PermissionException", "data = {'grant_type': 'authorization_code', 'code': a...
<|body_start_0|> try: data = {'first_name': user_data['localizedFirstName'], 'last_name': user_data['localizedLastName'], 'email': user_data['elements'][0]['handle~']['emailAddress'], 'photo_url': None} return data except KeyError: raise PermissionException <|end_body...
Linkedin backend.
LinkedinBackend
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LinkedinBackend: """Linkedin backend.""" def _normalize_user_data(user_data: dict) -> dict: """Normalize user data. :param user_data: User data from Linkedin :return: normalized user data.""" <|body_0|> def _auth(self, auth_code: str) -> None: """Get user access ...
stack_v2_sparse_classes_36k_train_034818
3,876
no_license
[ { "docstring": "Normalize user data. :param user_data: User data from Linkedin :return: normalized user data.", "name": "_normalize_user_data", "signature": "def _normalize_user_data(user_data: dict) -> dict" }, { "docstring": "Get user access token by authorization code. :param auth_code: Autho...
5
stack_v2_sparse_classes_30k_train_001763
Implement the Python class `LinkedinBackend` described below. Class description: Linkedin backend. Method signatures and docstrings: - def _normalize_user_data(user_data: dict) -> dict: Normalize user data. :param user_data: User data from Linkedin :return: normalized user data. - def _auth(self, auth_code: str) -> N...
Implement the Python class `LinkedinBackend` described below. Class description: Linkedin backend. Method signatures and docstrings: - def _normalize_user_data(user_data: dict) -> dict: Normalize user data. :param user_data: User data from Linkedin :return: normalized user data. - def _auth(self, auth_code: str) -> N...
713b9d84ac70d964d46f189ab1f9c7b944b9684b
<|skeleton|> class LinkedinBackend: """Linkedin backend.""" def _normalize_user_data(user_data: dict) -> dict: """Normalize user data. :param user_data: User data from Linkedin :return: normalized user data.""" <|body_0|> def _auth(self, auth_code: str) -> None: """Get user access ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LinkedinBackend: """Linkedin backend.""" def _normalize_user_data(user_data: dict) -> dict: """Normalize user data. :param user_data: User data from Linkedin :return: normalized user data.""" try: data = {'first_name': user_data['localizedFirstName'], 'last_name': user_data['l...
the_stack_v2_python_sparse
jobadvisor/authentication/backends/linkedin.py
ewgen19892/jobadvisor
train
0
b3e27a0bebcfae245436903639233712e2837774
[ "self.__lib_sig = lib_sig\nself.__log_path = log_path\nself.__log_table = {}", "logger = logging.getLogger(log_name)\nif log_level < logger.level or logger.level == logging.NOTSET:\n logger.setLevel(log_level)\nif log_name in self.__log_table and self.__log_table[log_name] == Logger.FILE_AND_CONSOLE:\n retu...
<|body_start_0|> self.__lib_sig = lib_sig self.__log_path = log_path self.__log_table = {} <|end_body_0|> <|body_start_1|> logger = logging.getLogger(log_name) if log_level < logger.level or logger.level == logging.NOTSET: logger.setLevel(log_level) if log_na...
Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the constants: NOTSET, DEBUG, INFO, WARNING, ERROR, and CRITICAL. These constants ...
Logger
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Logger: """Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the constants: NOTSET, DEBUG, INFO, WARNING, ERR...
stack_v2_sparse_classes_36k_train_034819
5,366
permissive
[ { "docstring": "Inits Logger. Args: lib_sig: str Signature of the client library. [optional] log_path: str Absolute or relative path to the logs directory.", "name": "__init__", "signature": "def __init__(self, lib_sig, log_path=os.path.join(os.getcwd(), 'logs'))" }, { "docstring": "Creates the ...
3
stack_v2_sparse_classes_30k_train_011791
Implement the Python class `Logger` described below. Class description: Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the const...
Implement the Python class `Logger` described below. Class description: Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the const...
b30d90f74248cfd5ca52967e9ee77fc4cd1b9abc
<|skeleton|> class Logger: """Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the constants: NOTSET, DEBUG, INFO, WARNING, ERR...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Logger: """Responsible for impementing logging. Allows to write to an external log or a console. There are 4 types of handlers denoted by the handler constants: NONE, FILE, CONSOLE, and FILE_AND_CONSOLE. There are also 6 verbosity levels defined by the constants: NOTSET, DEBUG, INFO, WARNING, ERROR, and CRITI...
the_stack_v2_python_sparse
adspygoogle/common/Logger.py
nearlyfreeapps/python-googleadwords
train
2
0e4170fadaf37e32e407432dd3c19403dd92e9fa
[ "if context:\n extra_flags = context.extra_flags\n for extra_flag in extra_flags:\n if extra_flag.startswith(TEST_DATA_DIR_FLAG) and test_data_dir is None:\n test_data_dir = extra_flag[len(TEST_DATA_DIR_FLAG) + 1:]\n elif extra_flag.startswith(COMPONENT_ID_FLAG) and component_id is No...
<|body_start_0|> if context: extra_flags = context.extra_flags for extra_flag in extra_flags: if extra_flag.startswith(TEST_DATA_DIR_FLAG) and test_data_dir is None: test_data_dir = extra_flag[len(TEST_DATA_DIR_FLAG) + 1:] elif extra_fl...
TFX base stub executor.
BaseStubExecutor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BaseStubExecutor: """TFX base stub executor.""" def __init__(self, component_id: Optional[str]=None, test_data_dir: Optional[str]=None, context: Optional[base_executor.BaseExecutor.Context]=None): """Initializes a BaseStubExecutor. Args: component_id: component id of a component asso...
stack_v2_sparse_classes_36k_train_034820
3,423
permissive
[ { "docstring": "Initializes a BaseStubExecutor. Args: component_id: component id of a component associated with the stub executor. test_data_dir: The directory to test data (pipeline_recorder.py). context: context class for all executors. component_id and test_data_dir can be encoded in the context as well. Rai...
2
stack_v2_sparse_classes_30k_train_013094
Implement the Python class `BaseStubExecutor` described below. Class description: TFX base stub executor. Method signatures and docstrings: - def __init__(self, component_id: Optional[str]=None, test_data_dir: Optional[str]=None, context: Optional[base_executor.BaseExecutor.Context]=None): Initializes a BaseStubExecu...
Implement the Python class `BaseStubExecutor` described below. Class description: TFX base stub executor. Method signatures and docstrings: - def __init__(self, component_id: Optional[str]=None, test_data_dir: Optional[str]=None, context: Optional[base_executor.BaseExecutor.Context]=None): Initializes a BaseStubExecu...
1b328504fa08a70388691e4072df76f143631325
<|skeleton|> class BaseStubExecutor: """TFX base stub executor.""" def __init__(self, component_id: Optional[str]=None, test_data_dir: Optional[str]=None, context: Optional[base_executor.BaseExecutor.Context]=None): """Initializes a BaseStubExecutor. Args: component_id: component id of a component asso...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BaseStubExecutor: """TFX base stub executor.""" def __init__(self, component_id: Optional[str]=None, test_data_dir: Optional[str]=None, context: Optional[base_executor.BaseExecutor.Context]=None): """Initializes a BaseStubExecutor. Args: component_id: component id of a component associated with t...
the_stack_v2_python_sparse
tfx/experimental/pipeline_testing/base_stub_executor.py
tensorflow/tfx
train
2,116
1415b50a597925d7f0c4db41dcf642d935aa187f
[ "cur1 = l1\ncur2 = l2\nresult = []\nhead = ListNode('head')\ncur = head\nwhile cur1 != None or cur2 != None:\n if cur1 != None and cur2 == None:\n rv = cur1.val\n cur1 = cur1.next\n if cur1 == None and cur2 != None:\n rv = cur2.val\n cur2 = cur2.next\n if cur1 != None and cur2 !...
<|body_start_0|> cur1 = l1 cur2 = l2 result = [] head = ListNode('head') cur = head while cur1 != None or cur2 != None: if cur1 != None and cur2 == None: rv = cur1.val cur1 = cur1.next if cur1 == None and cur2 != Non...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def mergeTwoLists(self, l1, l2): """:type l1: ListNode :type l2: ListNode :rtype: ListNode""" <|body_0|> def mergeKLists(self, lists): """:type lists: List[ListNode] :rtype: ListNode""" <|body_1|> <|end_skeleton|> <|body_start_0|> cur1 = l...
stack_v2_sparse_classes_36k_train_034821
1,657
no_license
[ { "docstring": ":type l1: ListNode :type l2: ListNode :rtype: ListNode", "name": "mergeTwoLists", "signature": "def mergeTwoLists(self, l1, l2)" }, { "docstring": ":type lists: List[ListNode] :rtype: ListNode", "name": "mergeKLists", "signature": "def mergeKLists(self, lists)" } ]
2
stack_v2_sparse_classes_30k_train_007463
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def mergeTwoLists(self, l1, l2): :type l1: ListNode :type l2: ListNode :rtype: ListNode - def mergeKLists(self, lists): :type lists: List[ListNode] :rtype: ListNode
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def mergeTwoLists(self, l1, l2): :type l1: ListNode :type l2: ListNode :rtype: ListNode - def mergeKLists(self, lists): :type lists: List[ListNode] :rtype: ListNode <|skeleton|>...
6401928a042f98dbbe513ec5cd673fa029cc4bce
<|skeleton|> class Solution: def mergeTwoLists(self, l1, l2): """:type l1: ListNode :type l2: ListNode :rtype: ListNode""" <|body_0|> def mergeKLists(self, lists): """:type lists: List[ListNode] :rtype: ListNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def mergeTwoLists(self, l1, l2): """:type l1: ListNode :type l2: ListNode :rtype: ListNode""" cur1 = l1 cur2 = l2 result = [] head = ListNode('head') cur = head while cur1 != None or cur2 != None: if cur1 != None and cur2 == None: ...
the_stack_v2_python_sparse
python/023-merge-k-sorted-lists.py
xupingmao/leetcode
train
1
9540a6cd433e360e38b03efcf032b07d58e678f9
[ "processed_dict = {}\nfor key, value in request.GET.items():\n processed_dict[key] = value\nsign = processed_dict.pop('sign', None)\nalipay = AliPay(appid='2016092600599306', app_notify_url='http://47.98.34.221:8888/api/alipay/return', app_private_key_path=PRIVATE_KEY_PATH, alipay_public_key_path=ALIPAY_KEY_PATH...
<|body_start_0|> processed_dict = {} for key, value in request.GET.items(): processed_dict[key] = value sign = processed_dict.pop('sign', None) alipay = AliPay(appid='2016092600599306', app_notify_url='http://47.98.34.221:8888/api/alipay/return', app_private_key_path=PRIVATE_...
支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求
AliPayView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AliPayView: """支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求""" def get(self, request): """处理支付宝的url返回""" <|body_0|> def post(selfs, request): """处理notify_url""" <|body_1|> <|end_skeleton|> <|body_st...
stack_v2_sparse_classes_36k_train_034822
6,458
no_license
[ { "docstring": "处理支付宝的url返回", "name": "get", "signature": "def get(self, request)" }, { "docstring": "处理notify_url", "name": "post", "signature": "def post(selfs, request)" } ]
2
stack_v2_sparse_classes_30k_test_001027
Implement the Python class `AliPayView` described below. Class description: 支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求 Method signatures and docstrings: - def get(self, request): 处理支付宝的url返回 - def post(selfs, request): 处理notify_url
Implement the Python class `AliPayView` described below. Class description: 支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求 Method signatures and docstrings: - def get(self, request): 处理支付宝的url返回 - def post(selfs, request): 处理notify_url <|skeleton|> class AliPayVie...
8414da97036aef52c96ae42e6e760bbbc6f64c05
<|skeleton|> class AliPayView: """支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求""" def get(self, request): """处理支付宝的url返回""" <|body_0|> def post(selfs, request): """处理notify_url""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AliPayView: """支付宝请求回调视图 return_url: 同步通知 url 支付完成之后,支付宝将传入的return_url 通过get请求 app_notify_url: 异步通知 url 通过post方式请求""" def get(self, request): """处理支付宝的url返回""" processed_dict = {} for key, value in request.GET.items(): processed_dict[key] = value sign = process...
the_stack_v2_python_sparse
apps/trade/views.py
lize240810/Shop
train
0
d3004ed74d56612b99e10519549ea90a1aa00994
[ "ms = MessageService()\nms.registerAs('JobEmulatorBulkSubmitter')\nfor jobSpec, cacheDir in self.toSubmit.items():\n logging.debug('SpecFile = %s' % self.specFiles[jobSpec])\n ms.publish('EmulateJob', self.specFiles[jobSpec])\n ms.commit()\n logging.debug('EmulateJob message sent')\nreturn", "if self....
<|body_start_0|> ms = MessageService() ms.registerAs('JobEmulatorBulkSubmitter') for jobSpec, cacheDir in self.toSubmit.items(): logging.debug('SpecFile = %s' % self.specFiles[jobSpec]) ms.publish('EmulateJob', self.specFiles[jobSpec]) ms.commit() ...
_JobEmulatorBulkSubmitter_
JobEmulatorBulkSubmitter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class JobEmulatorBulkSubmitter: """_JobEmulatorBulkSubmitter_""" def doSubmit(self): """_doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin""" <|body_0|> def checkPluginConfig(self): """...
stack_v2_sparse_classes_36k_train_034823
1,629
no_license
[ { "docstring": "_doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin", "name": "doSubmit", "signature": "def doSubmit(self)" }, { "docstring": "_checkPluginConfig_ Make sure config has what is required for this sub...
2
null
Implement the Python class `JobEmulatorBulkSubmitter` described below. Class description: _JobEmulatorBulkSubmitter_ Method signatures and docstrings: - def doSubmit(self): _doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin - def chec...
Implement the Python class `JobEmulatorBulkSubmitter` described below. Class description: _JobEmulatorBulkSubmitter_ Method signatures and docstrings: - def doSubmit(self): _doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin - def chec...
c99608e3e349397fdd1b0b5c011bf4f33a1c3aad
<|skeleton|> class JobEmulatorBulkSubmitter: """_JobEmulatorBulkSubmitter_""" def doSubmit(self): """_doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin""" <|body_0|> def checkPluginConfig(self): """...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class JobEmulatorBulkSubmitter: """_JobEmulatorBulkSubmitter_""" def doSubmit(self): """_doSubmit_ Perform bulk or single submission as needed based on the class data populated by the component that is invoking this plugin""" ms = MessageService() ms.registerAs('JobEmulatorBulkSubmitter...
the_stack_v2_python_sparse
src/python/JobSubmitter/Submitters/JobEmulatorBulkSubmitter.py
giffels/PRODAGENT
train
0
bd487e09af6d18f93bf1d59df677765294db5a40
[ "pm_config = pm.PaddleMobileConfig()\npm_config.precision = pm.PaddleMobileConfig.Precision.FP32\npm_config.device = pm.PaddleMobileConfig.Device.kFPGA\nif model_dir:\n pm_config.model_dir = model_dir\nelse:\n pm_config.prog_file = model_flie\n pm_config.param_file = param_file\npm_config.thread_num = thre...
<|body_start_0|> pm_config = pm.PaddleMobileConfig() pm_config.precision = pm.PaddleMobileConfig.Precision.FP32 pm_config.device = pm.PaddleMobileConfig.Device.kFPGA if model_dir: pm_config.model_dir = model_dir else: pm_config.prog_file = model_flie ...
pm_model
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class pm_model: def load_model(self, model_flie, param_file, thread_num, model_dir): """加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器""" <|body_0|> def data_feed(self, data_shape): """初始化PaddleMobile模型输入数据张量 参数:数据形状 返回:数据张量""" <|body_1|> def predict(self, ...
stack_v2_sparse_classes_36k_train_034824
3,563
permissive
[ { "docstring": "加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器", "name": "load_model", "signature": "def load_model(self, model_flie, param_file, thread_num, model_dir)" }, { "docstring": "初始化PaddleMobile模型输入数据张量 参数:数据形状 返回:数据张量", "name": "data_feed", "signature": "def data_feed(self,...
3
stack_v2_sparse_classes_30k_train_018369
Implement the Python class `pm_model` described below. Class description: Implement the pm_model class. Method signatures and docstrings: - def load_model(self, model_flie, param_file, thread_num, model_dir): 加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器 - def data_feed(self, data_shape): 初始化PaddleMobile模型输入数据张量 ...
Implement the Python class `pm_model` described below. Class description: Implement the pm_model class. Method signatures and docstrings: - def load_model(self, model_flie, param_file, thread_num, model_dir): 加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器 - def data_feed(self, data_shape): 初始化PaddleMobile模型输入数据张量 ...
afbd0e081763c53833617a4892d03043e644d641
<|skeleton|> class pm_model: def load_model(self, model_flie, param_file, thread_num, model_dir): """加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器""" <|body_0|> def data_feed(self, data_shape): """初始化PaddleMobile模型输入数据张量 参数:数据形状 返回:数据张量""" <|body_1|> def predict(self, ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class pm_model: def load_model(self, model_flie, param_file, thread_num, model_dir): """加载PaddleMobile模型 参数:模型文件、模型参数文件、线程数、模型目录 返回:模型预测器""" pm_config = pm.PaddleMobileConfig() pm_config.precision = pm.PaddleMobileConfig.Precision.FP32 pm_config.device = pm.PaddleMobileConfig.Device....
the_stack_v2_python_sparse
mastercar/eblite_smart_car-master/model.py
wpy-111/python
train
1
1f8e1c86f0748235c66ce9c0a9f57fac2c95b8ec
[ "parser.display_info.AddFormat(backend_buckets_flags.DEFAULT_LIST_FORMAT)\nbackend_buckets_utils.AddUpdatableArgs(cls, parser, 'create')\nbackend_buckets_flags.REQUIRED_GCS_BUCKET_ARG.AddArgument(parser)\nparser.display_info.AddCacheUpdater(backend_buckets_flags.BackendBucketsCompleter)\nsigned_url_flags.AddSignedU...
<|body_start_0|> parser.display_info.AddFormat(backend_buckets_flags.DEFAULT_LIST_FORMAT) backend_buckets_utils.AddUpdatableArgs(cls, parser, 'create') backend_buckets_flags.REQUIRED_GCS_BUCKET_ARG.AddArgument(parser) parser.display_info.AddCacheUpdater(backend_buckets_flags.BackendBucke...
Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets.
Create
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Create: """Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets.""" def Args(cls, parser): """Set up arguments for this comm...
stack_v2_sparse_classes_36k_train_034825
3,216
permissive
[ { "docstring": "Set up arguments for this command.", "name": "Args", "signature": "def Args(cls, parser)" }, { "docstring": "Creates and returns the backend bucket.", "name": "CreateBackendBucket", "signature": "def CreateBackendBucket(self, args)" }, { "docstring": "Issues the r...
3
null
Implement the Python class `Create` described below. Class description: Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets. Method signatures and docstrings...
Implement the Python class `Create` described below. Class description: Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets. Method signatures and docstrings...
85bb264e273568b5a0408f733b403c56373e2508
<|skeleton|> class Create: """Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets.""" def Args(cls, parser): """Set up arguments for this comm...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Create: """Create a backend bucket. *{command}* is used to create backend buckets. Backend buckets define Google Cloud Storage buckets that can serve content. URL maps define which requests are sent to which backend buckets.""" def Args(cls, parser): """Set up arguments for this command.""" ...
the_stack_v2_python_sparse
google-cloud-sdk/lib/surface/compute/backend_buckets/create.py
bopopescu/socialliteapp
train
0
e7b0ac669d8868f13a4af5696315ba0bee32b59a
[ "availabilities = Availability.objects.filter(bbs=data['user_bbs'])\ndate = data['date']\nweekday = date.strftime('%A')\nshift = data['shift']\npossible = False\nfor availability in availabilities:\n if availability.day == weekday and shift == availability.shift:\n logging.info('This date and shift is ava...
<|body_start_0|> availabilities = Availability.objects.filter(bbs=data['user_bbs']) date = data['date'] weekday = date.strftime('%A') shift = data['shift'] possible = False for availability in availabilities: if availability.day == weekday and shift == availab...
Create Service Serializer.
CreateServiceSerializer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CreateServiceSerializer: """Create Service Serializer.""" def validate(self, data): """Validate if the date it's a day in the availability registers of the Babysitter.""" <|body_0|> def create(self, data): """Create the Service.""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_36k_train_034826
6,205
permissive
[ { "docstring": "Validate if the date it's a day in the availability registers of the Babysitter.", "name": "validate", "signature": "def validate(self, data)" }, { "docstring": "Create the Service.", "name": "create", "signature": "def create(self, data)" } ]
2
stack_v2_sparse_classes_30k_train_021357
Implement the Python class `CreateServiceSerializer` described below. Class description: Create Service Serializer. Method signatures and docstrings: - def validate(self, data): Validate if the date it's a day in the availability registers of the Babysitter. - def create(self, data): Create the Service.
Implement the Python class `CreateServiceSerializer` described below. Class description: Create Service Serializer. Method signatures and docstrings: - def validate(self, data): Validate if the date it's a day in the availability registers of the Babysitter. - def create(self, data): Create the Service. <|skeleton|>...
5c37c6876ca13b5794ac44e0342b810426acbc76
<|skeleton|> class CreateServiceSerializer: """Create Service Serializer.""" def validate(self, data): """Validate if the date it's a day in the availability registers of the Babysitter.""" <|body_0|> def create(self, data): """Create the Service.""" <|body_1|> <|end_skele...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CreateServiceSerializer: """Create Service Serializer.""" def validate(self, data): """Validate if the date it's a day in the availability registers of the Babysitter.""" availabilities = Availability.objects.filter(bbs=data['user_bbs']) date = data['date'] weekday = date....
the_stack_v2_python_sparse
hisitter/services/serializers/services.py
babysitter-finder/backend
train
1
6175ea630661aec07348e26a9f78165f0cf043b7
[ "self._mount_path = '/usr/local/qai/mnt'\nself._run_id = 1\nself._job_id = 1\nself._output_file_path = f'{self._mount_path}/ip/job_args/{self._job_id}/{self._run_id}/ait.input.json'\nself._ait_inventories = []\nself._ait_method_params = []\nself._ait_manifest_json = None\nwith open(manifest_path, encoding='utf-8') ...
<|body_start_0|> self._mount_path = '/usr/local/qai/mnt' self._run_id = 1 self._job_id = 1 self._output_file_path = f'{self._mount_path}/ip/job_args/{self._job_id}/{self._run_id}/ait.input.json' self._ait_inventories = [] self._ait_method_params = [] self._ait_man...
ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ait.manifest.json beforehand.
AITInputGenerator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AITInputGenerator: """ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ait.manifest.json beforehand.""" def...
stack_v2_sparse_classes_36k_train_034827
5,937
permissive
[ { "docstring": "コンストラクタ Constructor Args: manifest_path : ait.manifest.jsonのパス情報 Path information in ait.manifest.json", "name": "__init__", "signature": "def __init__(self, manifest_path: str)" }, { "docstring": "Inventories項目を設定する。 Set the Inventories item. Args: name (str) : Inventoriesの名称。ai...
4
stack_v2_sparse_classes_30k_train_015887
Implement the Python class `AITInputGenerator` described below. Class description: ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ai...
Implement the Python class `AITInputGenerator` described below. Class description: ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ai...
6444a7b4f22faffbfddd2ef2bfcfda5505ff677c
<|skeleton|> class AITInputGenerator: """ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ait.manifest.json beforehand.""" def...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AITInputGenerator: """ait.input.jsonを出力するためのクラス。 set関数で各項目を入力し、write関数でjsonを出力する。 あらかじめait.manifest.jsonを生成しておく必要がある。 Class for outputting ait.input.json. You input each item with the set function and output json with the write function. You must generate ait.manifest.json beforehand.""" def __init__(sel...
the_stack_v2_python_sparse
src/modules/ait_sdk/src/ait_sdk/common/files/ait_input_generator.py
aistairc/qunomon
train
17
3fbd574bb8baf82c54f2dc36c716fefcff65fb81
[ "if s == '':\n return s\nlongest_palindrome = ''\nfor i in range(len(s)):\n one_char_longest_palindrome = self.get_char_longest_palindrome(i, i, s)\n if len(one_char_longest_palindrome) > len(longest_palindrome):\n longest_palindrome = one_char_longest_palindrome\n two_char_longest_palindrome = s...
<|body_start_0|> if s == '': return s longest_palindrome = '' for i in range(len(s)): one_char_longest_palindrome = self.get_char_longest_palindrome(i, i, s) if len(one_char_longest_palindrome) > len(longest_palindrome): longest_palindrome = on...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def longestPalindrome(self, s): """:type s: str :rtype: str""" <|body_0|> def get_char_longest_palindrome(self, i, j, s): """找到以i, j中点为中心的最长回文子串 以某个字符为中心,则i,j相同 以某两个相邻字符为中心,则j=i+1 :param i: 中心点左边的索引 :param j: 中心点右边的索引. 3 :param s: 字符串 :return: 以i, j中点为中心的最长...
stack_v2_sparse_classes_36k_train_034828
1,639
no_license
[ { "docstring": ":type s: str :rtype: str", "name": "longestPalindrome", "signature": "def longestPalindrome(self, s)" }, { "docstring": "找到以i, j中点为中心的最长回文子串 以某个字符为中心,则i,j相同 以某两个相邻字符为中心,则j=i+1 :param i: 中心点左边的索引 :param j: 中心点右边的索引. 3 :param s: 字符串 :return: 以i, j中点为中心的最长回文子串", "name": "get_cha...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestPalindrome(self, s): :type s: str :rtype: str - def get_char_longest_palindrome(self, i, j, s): 找到以i, j中点为中心的最长回文子串 以某个字符为中心,则i,j相同 以某两个相邻字符为中心,则j=i+1 :param i: 中心点左边的...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def longestPalindrome(self, s): :type s: str :rtype: str - def get_char_longest_palindrome(self, i, j, s): 找到以i, j中点为中心的最长回文子串 以某个字符为中心,则i,j相同 以某两个相邻字符为中心,则j=i+1 :param i: 中心点左边的...
707829268535a80cfe0ffa1dc0623520c3fcbecf
<|skeleton|> class Solution: def longestPalindrome(self, s): """:type s: str :rtype: str""" <|body_0|> def get_char_longest_palindrome(self, i, j, s): """找到以i, j中点为中心的最长回文子串 以某个字符为中心,则i,j相同 以某两个相邻字符为中心,则j=i+1 :param i: 中心点左边的索引 :param j: 中心点右边的索引. 3 :param s: 字符串 :return: 以i, j中点为中心的最长...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def longestPalindrome(self, s): """:type s: str :rtype: str""" if s == '': return s longest_palindrome = '' for i in range(len(s)): one_char_longest_palindrome = self.get_char_longest_palindrome(i, i, s) if len(one_char_longest_pali...
the_stack_v2_python_sparse
leetcode/1-50/_5_longest_palindrome.py
blackwings001/algorithm
train
0
0225ec3e6194ffdb41c1705fdce0256baae7b90e
[ "user = self.params['user']\naccount = AccountRepository(user).get_account_by_user_id()\nparam_object = ParamObject({'account_id': account.id, 'circle_id': self.params['circle_id']})\nJoinInService(user).join(param_object)\nreturn {}", "user = self.params['user']\naccount = AccountRepository(user).get_account_by_...
<|body_start_0|> user = self.params['user'] account = AccountRepository(user).get_account_by_user_id() param_object = ParamObject({'account_id': account.id, 'circle_id': self.params['circle_id']}) JoinInService(user).join(param_object) return {} <|end_body_0|> <|body_start_1|> ...
加入的圈子
AJoinedCircle
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AJoinedCircle: """加入的圈子""" def put(self): """加入圈子""" <|body_0|> def delete(self): """退出圈子""" <|body_1|> <|end_skeleton|> <|body_start_0|> user = self.params['user'] account = AccountRepository(user).get_account_by_user_id() param...
stack_v2_sparse_classes_36k_train_034829
1,044
no_license
[ { "docstring": "加入圈子", "name": "put", "signature": "def put(self)" }, { "docstring": "退出圈子", "name": "delete", "signature": "def delete(self)" } ]
2
stack_v2_sparse_classes_30k_train_019100
Implement the Python class `AJoinedCircle` described below. Class description: 加入的圈子 Method signatures and docstrings: - def put(self): 加入圈子 - def delete(self): 退出圈子
Implement the Python class `AJoinedCircle` described below. Class description: 加入的圈子 Method signatures and docstrings: - def put(self): 加入圈子 - def delete(self): 退出圈子 <|skeleton|> class AJoinedCircle: """加入的圈子""" def put(self): """加入圈子""" <|body_0|> def delete(self): """退出圈子""" ...
d7a6d9d701031c28d1c7572f5c204600fbecb53a
<|skeleton|> class AJoinedCircle: """加入的圈子""" def put(self): """加入圈子""" <|body_0|> def delete(self): """退出圈子""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AJoinedCircle: """加入的圈子""" def put(self): """加入圈子""" user = self.params['user'] account = AccountRepository(user).get_account_by_user_id() param_object = ParamObject({'account_id': account.id, 'circle_id': self.params['circle_id']}) JoinInService(user).join(param_o...
the_stack_v2_python_sparse
api/account/a_joined_circle.py
Peri-albert/membership
train
0
f32b567fbb5784421eae8e19fe51d260b3c9010f
[ "self.capacity = capacity\nself.key_node = {}\nself.count_node = {}\nself.minV = None", "if not key in self.key_node:\n return -1\nnode = self.key_node[key]\ndel self.count_node[node.count][key]\nif not self.count_node[node.count]:\n del self.count_node[node.count]\nnode.count += 1\nif not node.count in sel...
<|body_start_0|> self.capacity = capacity self.key_node = {} self.count_node = {} self.minV = None <|end_body_0|> <|body_start_1|> if not key in self.key_node: return -1 node = self.key_node[key] del self.count_node[node.count][key] if not sel...
LFUCache
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k_train_034830
2,045
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type key: int :rtype: int", "name": "get", "signature": "def get(self, key)" }, { "docstring": ":type key: int :type value: int :rtype: void", "name": "pu...
3
stack_v2_sparse_classes_30k_train_020915
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void
Implement the Python class `LFUCache` described below. Class description: Implement the LFUCache class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def get(self, key): :type key: int :rtype: int - def put(self, key, value): :type key: int :type value: int :rtype: void <|sk...
08b3d9cab3c1806c37d36587372b1e8fb1683f64
<|skeleton|> class LFUCache: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def get(self, key): """:type key: int :rtype: int""" <|body_1|> def put(self, key, value): """:type key: int :type value: int :rtype: void""" <|body_2|> <|end_s...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class LFUCache: def __init__(self, capacity): """:type capacity: int""" self.capacity = capacity self.key_node = {} self.count_node = {} self.minV = None def get(self, key): """:type key: int :rtype: int""" if not key in self.key_node: return ...
the_stack_v2_python_sparse
history/460.py
HonniLin/leetcode
train
0
568f6149f0344a47790484c2fc8a327c753c916e
[ "while path and path[-1] == '\\\\':\n path = path[:-1]\nif path:\n _, _, path = path.rpartition('\\\\')\nreturn path", "user_account = artifacts.UserAccountArtifact(identifier=registry_key.name, path_separator='\\\\')\nregistry_value = registry_key.GetValueByName('ProfileImagePath')\nif registry_value:\n ...
<|body_start_0|> while path and path[-1] == '\\': path = path[:-1] if path: _, _, path = path.rpartition('\\') return path <|end_body_0|> <|body_start_1|> user_account = artifacts.UserAccountArtifact(identifier=registry_key.name, path_separator='\\') regi...
The Windows user account plugin.
WindowsUserAccountsPlugin
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class WindowsUserAccountsPlugin: """The Windows user account plugin.""" def _GetUsernameFromProfilePath(self, path): """Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a Windows path with '\\' as path segment separator. Returns:...
stack_v2_sparse_classes_36k_train_034831
17,923
permissive
[ { "docstring": "Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a Windows path with '\\\\' as path segment separator. Returns: str: basename which is the last path segment.", "name": "_GetUsernameFromProfilePath", "signature": "def _GetUserna...
2
null
Implement the Python class `WindowsUserAccountsPlugin` described below. Class description: The Windows user account plugin. Method signatures and docstrings: - def _GetUsernameFromProfilePath(self, path): Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a W...
Implement the Python class `WindowsUserAccountsPlugin` described below. Class description: The Windows user account plugin. Method signatures and docstrings: - def _GetUsernameFromProfilePath(self, path): Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a W...
f9299b8ad0cb2a6bbbd5e65f01d2ba06406c70ac
<|skeleton|> class WindowsUserAccountsPlugin: """The Windows user account plugin.""" def _GetUsernameFromProfilePath(self, path): """Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a Windows path with '\\' as path segment separator. Returns:...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class WindowsUserAccountsPlugin: """The Windows user account plugin.""" def _GetUsernameFromProfilePath(self, path): """Retrieves the username from a Windows profile path. Trailing path path segment are ignored. Args: path (str): a Windows path with '\\' as path segment separator. Returns: str: basenam...
the_stack_v2_python_sparse
engine/preprocessors/windows.py
dfrc-korea/carpe
train
75
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 schema = Rancher.get_schema(schema_id)\n unit_id = schema['unit_id']\n if Rancher.validate(schema_id, sciper) or ...
<|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) schema = Rancher.get_schema(schema_id) unit_id = schema['unit_i...
SchemaDetail
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SchemaDetail: def get(self, request, schema_id): """Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: This user isn't allowed to access to the schema - code: 404 message: Access key or secret key no found...
stack_v2_sparse_classes_36k_train_034832
14,178
permissive
[ { "docstring": "Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: This user isn't allowed to access to the schema - code: 404 message: Access key or secret key no found", "name": "get", "signature": "def get(self, reques...
3
stack_v2_sparse_classes_30k_train_011641
Implement the Python class `SchemaDetail` described below. Class description: Implement the SchemaDetail class. Method signatures and docstrings: - def get(self, request, schema_id): Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: T...
Implement the Python class `SchemaDetail` described below. Class description: Implement the SchemaDetail class. Method signatures and docstrings: - def get(self, request, schema_id): Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: T...
db02f6e0cb0435b84c619dd105b7bee5eafd17e2
<|skeleton|> class SchemaDetail: def get(self, request, schema_id): """Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: This user isn't allowed to access to the schema - code: 404 message: Access key or secret key no found...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SchemaDetail: def get(self, request, schema_id): """Return the schema 'schema_id' --- Response messages: - code: 200 message: OK - code: 403 message: Invalid APIKey - code: 403 message: This user isn't allowed to access to the schema - code: 404 message: Access key or secret key no found""" tr...
the_stack_v2_python_sparse
src/api/views.py
epfl-si/amm
train
3
b1fe5806dc28bd18b47f1798b1f4e4e8b3bf12e1
[ "if not history:\n return\nhistory = self._history_dt_fmt(dt=history)\nvalid_dates = history_dates.value[asset_type]\nif history not in valid_dates:\n known = '\\n ' + '\\n '.join(list(valid_dates))\n expl = 'known history dates'\n err = f'Unknown history date {history!r}'\n msg = f'{err}, {expl}: ...
<|body_start_0|> if not history: return history = self._history_dt_fmt(dt=history) valid_dates = history_dates.value[asset_type] if history not in valid_dates: known = '\n ' + '\n '.join(list(valid_dates)) expl = 'known history dates' err...
Pass.
AssetMixins
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AssetMixins: """Pass.""" def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str: """Pass.""" <|body_0|> def _history_dt_fmt(dt: Union[str, datetime.timedelta, datetime.datetime], tmpl: str='%Y-%...
stack_v2_sparse_classes_36k_train_034833
16,427
permissive
[ { "docstring": "Pass.", "name": "set_history", "signature": "def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str" }, { "docstring": "Parse a string into the format used by the REST API. Args: dt: date time to parse u...
2
null
Implement the Python class `AssetMixins` described below. Class description: Pass. Method signatures and docstrings: - def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str: Pass. - def _history_dt_fmt(dt: Union[str, datetime.timedelta, dat...
Implement the Python class `AssetMixins` described below. Class description: Pass. Method signatures and docstrings: - def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str: Pass. - def _history_dt_fmt(dt: Union[str, datetime.timedelta, dat...
8321788df279ffb7794f179a4bd8943fe1ac44c4
<|skeleton|> class AssetMixins: """Pass.""" def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str: """Pass.""" <|body_0|> def _history_dt_fmt(dt: Union[str, datetime.timedelta, datetime.datetime], tmpl: str='%Y-%...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AssetMixins: """Pass.""" def set_history(self, history: Union[str, datetime.timedelta, datetime.datetime], history_dates: DictValue, asset_type: str) -> str: """Pass.""" if not history: return history = self._history_dt_fmt(dt=history) valid_dates = history_dat...
the_stack_v2_python_sparse
axonius_api_client/api/json_api/assets.py
zahediss/axonius_api_client
train
0
53514dee67f852b21609f2a78ffffd971e3e4069
[ "for function_checker in FUNCTION_CALL_MODIFIERS:\n node = function_checker.check_and_modify_node(node)\nreturn ast.fix_missing_locations(node) if node else None", "for name_checker in NAME_MODIFIERS:\n node = name_checker.check_and_modify_node(node)\nreturn ast.fix_missing_locations(node) if node else None...
<|body_start_0|> for function_checker in FUNCTION_CALL_MODIFIERS: node = function_checker.check_and_modify_node(node) return ast.fix_missing_locations(node) if node else None <|end_body_0|> <|body_start_1|> for name_checker in NAME_MODIFIERS: node = name_checker.check_an...
An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code.
ASTTransformer
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ASTTransformer: """An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code.""" def visit_Call(self, node): """Visits an ``ast.Call`` node and returns a modified node or None. See https://docs.python.org...
stack_v2_sparse_classes_36k_train_034834
6,468
permissive
[ { "docstring": "Visits an ``ast.Call`` node and returns a modified node or None. See https://docs.python.org/3/library/ast.html#ast.NodeTransformer. Args: node (ast.Call): a node that represents a function call. Returns: ast.AST: if the returned node is None, the original node is removed from its location. Othe...
5
null
Implement the Python class `ASTTransformer` described below. Class description: An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code. Method signatures and docstrings: - def visit_Call(self, node): Visits an ``ast.Call`` node and ret...
Implement the Python class `ASTTransformer` described below. Class description: An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code. Method signatures and docstrings: - def visit_Call(self, node): Visits an ``ast.Call`` node and ret...
8d5d7fd8ae1a917ed3e2b988d5e533bce244fd85
<|skeleton|> class ASTTransformer: """An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code.""" def visit_Call(self, node): """Visits an ``ast.Call`` node and returns a modified node or None. See https://docs.python.org...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ASTTransformer: """An ``ast.NodeTransformer`` subclass that walks the abstract syntax tree. It modifies nodes to upgrade the given SageMaker Python SDK code.""" def visit_Call(self, node): """Visits an ``ast.Call`` node and returns a modified node or None. See https://docs.python.org/3/library/as...
the_stack_v2_python_sparse
src/sagemaker/cli/compatibility/v2/ast_transformer.py
aws/sagemaker-python-sdk
train
2,050
6806e0d3dcfae4849b8586447c1c77d7c28763f6
[ "exp_value = 42\nicpw_obj = Int32(exp_value)\nself.assertEqual(exp_value, icpw_obj.icpw_value)", "exp_value = 84\nobj0 = Int32(exp_value)\nobj1 = Int32(exp_value)\nself.assertEqual(obj0, obj1)", "exp_value = 84\nobj0 = Int32(exp_value)\nobj1 = Int32(2 * exp_value + 1)\nself.assertNotEqual(obj0, obj1)", "exp_v...
<|body_start_0|> exp_value = 42 icpw_obj = Int32(exp_value) self.assertEqual(exp_value, icpw_obj.icpw_value) <|end_body_0|> <|body_start_1|> exp_value = 84 obj0 = Int32(exp_value) obj1 = Int32(exp_value) self.assertEqual(obj0, obj1) <|end_body_1|> <|body_start_2...
Int32Tester
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Int32Tester: def test_value(self): """Test retrieving the value of an Int32.""" <|body_0|> def test_eq(self): """Test that two Int32's with the same value compare equal.""" <|body_1|> def test_ne(self): """Test that two Int32's with the same valu...
stack_v2_sparse_classes_36k_train_034835
42,194
permissive
[ { "docstring": "Test retrieving the value of an Int32.", "name": "test_value", "signature": "def test_value(self)" }, { "docstring": "Test that two Int32's with the same value compare equal.", "name": "test_eq", "signature": "def test_eq(self)" }, { "docstring": "Test that two In...
5
stack_v2_sparse_classes_30k_train_013163
Implement the Python class `Int32Tester` described below. Class description: Implement the Int32Tester class. Method signatures and docstrings: - def test_value(self): Test retrieving the value of an Int32. - def test_eq(self): Test that two Int32's with the same value compare equal. - def test_ne(self): Test that tw...
Implement the Python class `Int32Tester` described below. Class description: Implement the Int32Tester class. Method signatures and docstrings: - def test_value(self): Test retrieving the value of an Int32. - def test_eq(self): Test that two Int32's with the same value compare equal. - def test_ne(self): Test that tw...
a626f881d55c307bd857d0ff980cc526f2b18de2
<|skeleton|> class Int32Tester: def test_value(self): """Test retrieving the value of an Int32.""" <|body_0|> def test_eq(self): """Test that two Int32's with the same value compare equal.""" <|body_1|> def test_ne(self): """Test that two Int32's with the same valu...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Int32Tester: def test_value(self): """Test retrieving the value of an Int32.""" exp_value = 42 icpw_obj = Int32(exp_value) self.assertEqual(exp_value, icpw_obj.icpw_value) def test_eq(self): """Test that two Int32's with the same value compare equal.""" exp...
the_stack_v2_python_sparse
icypaw/test_types.py
sandialabs/IcyPaw
train
0
84564bc3cc7dbe7da0fa315308088f687545a02d
[ "page_info = load_test_json('fb_page_pgh_marathon.json')\npage_id = page_info['id']\norg_count_before = Organization.objects.count()\nwith self.assertRaises(FacebookOrgRecord.DoesNotExist):\n FacebookOrgRecord.objects.get(fb_id=page_id)\nwith self.assertRaises(Organization.DoesNotExist):\n Organization.object...
<|body_start_0|> page_info = load_test_json('fb_page_pgh_marathon.json') page_id = page_info['id'] org_count_before = Organization.objects.count() with self.assertRaises(FacebookOrgRecord.DoesNotExist): FacebookOrgRecord.objects.get(fb_id=page_id) with self.assertRais...
Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data.
OrgStorageTest
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class OrgStorageTest: """Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data.""" def test_fb_org_insertion(self): """Tests that all fields from a Facebook page to org are inserted correctly. (uses predefined page both to test cache functionality and t...
stack_v2_sparse_classes_36k_train_034836
14,911
no_license
[ { "docstring": "Tests that all fields from a Facebook page to org are inserted correctly. (uses predefined page both to test cache functionality and to ensure data is as expected)", "name": "test_fb_org_insertion", "signature": "def test_fb_org_insertion(self)" }, { "docstring": "Tests that an o...
2
null
Implement the Python class `OrgStorageTest` described below. Class description: Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data. Method signatures and docstrings: - def test_fb_org_insertion(self): Tests that all fields from a Facebook page to org are inserted correctly. (us...
Implement the Python class `OrgStorageTest` described below. Class description: Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data. Method signatures and docstrings: - def test_fb_org_insertion(self): Tests that all fields from a Facebook page to org are inserted correctly. (us...
3ed85e856a026001a1d91d09d31d944c64704824
<|skeleton|> class OrgStorageTest: """Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data.""" def test_fb_org_insertion(self): """Tests that all fields from a Facebook page to org are inserted correctly. (uses predefined page both to test cache functionality and t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class OrgStorageTest: """Collection of tests for outsoucing.fbpages.store_fbpage_organization using fixed json data.""" def test_fb_org_insertion(self): """Tests that all fields from a Facebook page to org are inserted correctly. (uses predefined page both to test cache functionality and to ensure data...
the_stack_v2_python_sparse
scenable/outsourcing/subtests/fbpages.py
gregarious/betasite
train
0
1b092a95b449c370c424c99435276797fe30572d
[ "super().__init__(opt, name=name)\nself._opt = opt\nif num_mini_batches < 1:\n raise ValueError('num_mini_batches must be a positive number.')\nself._num_mini_batches = num_mini_batches\nself._offload_weight_update_variables = offload_weight_update_variables\nself._replicated_optimizer_state_sharding = replicate...
<|body_start_0|> super().__init__(opt, name=name) self._opt = opt if num_mini_batches < 1: raise ValueError('num_mini_batches must be a positive number.') self._num_mini_batches = num_mini_batches self._offload_weight_update_variables = offload_weight_update_variables...
An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the weight update. This feature of neural networks allows us to simulate bigger batch sizes. For exam...
GradientAccumulationOptimizerV2
[ "MIT", "Apache-2.0", "BSD-2-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class GradientAccumulationOptimizerV2: """An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the weight update. This feature of neural ...
stack_v2_sparse_classes_36k_train_034837
18,009
permissive
[ { "docstring": "Construct a Gradient Accumulation Optimizer V2. Args: opt: An existing `Optimizer` to encapsulate. num_mini_batches: Number of mini-batches the gradients will be accumulated for. offload_weight_update_variables: When enabled, any `tf.Variable` which is only used by the weight update of the pipel...
2
stack_v2_sparse_classes_30k_train_019689
Implement the Python class `GradientAccumulationOptimizerV2` described below. Class description: An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the...
Implement the Python class `GradientAccumulationOptimizerV2` described below. Class description: An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the...
085b20a4b6287eff8c0b792425d52422ab8cbab3
<|skeleton|> class GradientAccumulationOptimizerV2: """An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the weight update. This feature of neural ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class GradientAccumulationOptimizerV2: """An optimizer where instead of performing the weight update for every batch, gradients across multiple batches are accumulated. After multiple batches have been processed, their accumulated gradients are used to compute the weight update. This feature of neural networks allo...
the_stack_v2_python_sparse
tensorflow/python/ipu/optimizers/gradient_accumulation_optimizer.py
graphcore/tensorflow
train
84
052a09159bd663e80b96e8d6a2d98efed53b1ae7
[ "lowest = float('inf')\nmaxc = 0\nfor i in xrange(1, len(prices)):\n lowest = min(lowest, prices[i - 1])\n maxc = max(maxc, prices[i] - lowest)\nreturn maxc", "local_max = 0\nmmax = 0\nfor i in xrange(1, len(prices)):\n local_max += prices[i] - prices[i - 1]\n local_max = max(0, local_max)\n mmax =...
<|body_start_0|> lowest = float('inf') maxc = 0 for i in xrange(1, len(prices)): lowest = min(lowest, prices[i - 1]) maxc = max(maxc, prices[i] - lowest) return maxc <|end_body_0|> <|body_start_1|> local_max = 0 mmax = 0 for i in xrange(1,...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit_2(self, prices): """:type prices: List[int] :rtype: int kadane algorithm 利用差具有累加性的特性.""" <|body_1|> def rewrite(self, prices): """:type pric...
stack_v2_sparse_classes_36k_train_034838
2,506
no_license
[ { "docstring": ":type prices: List[int] :rtype: int", "name": "maxProfit", "signature": "def maxProfit(self, prices)" }, { "docstring": ":type prices: List[int] :rtype: int kadane algorithm 利用差具有累加性的特性.", "name": "maxProfit_2", "signature": "def maxProfit_2(self, prices)" }, { "d...
3
stack_v2_sparse_classes_30k_train_008921
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices): :type prices: List[int] :rtype: int - def maxProfit_2(self, prices): :type prices: List[int] :rtype: int kadane algorithm 利用差具有累加性的特性. - def rewrite(...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, prices): :type prices: List[int] :rtype: int - def maxProfit_2(self, prices): :type prices: List[int] :rtype: int kadane algorithm 利用差具有累加性的特性. - def rewrite(...
6350568d16b0f8c49a020f055bb6d72e2705ea56
<|skeleton|> class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" <|body_0|> def maxProfit_2(self, prices): """:type prices: List[int] :rtype: int kadane algorithm 利用差具有累加性的特性.""" <|body_1|> def rewrite(self, prices): """:type pric...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxProfit(self, prices): """:type prices: List[int] :rtype: int""" lowest = float('inf') maxc = 0 for i in xrange(1, len(prices)): lowest = min(lowest, prices[i - 1]) maxc = max(maxc, prices[i] - lowest) return maxc def maxProf...
the_stack_v2_python_sparse
co_fb/121_Best_Time_to_Buy_and_Sell_Stock.py
vsdrun/lc_public
train
6
c49b71a98c945dd2b5204dd3b55155f80b836eb4
[ "self._cap = capacity\nself._q = deque()\nself._cv = Condition()", "self._cv.acquire()\nwhile len(self._q) == self._cap:\n self._cv.wait()\n self._q.append(element)\n self._cv.notify_all()\n self._cv.release()", "self._cv.acquire()\nwhile len(self._q) == 0:\n self._cv.wait()\nres = self._q.pop()\...
<|body_start_0|> self._cap = capacity self._q = deque() self._cv = Condition() <|end_body_0|> <|body_start_1|> self._cv.acquire() while len(self._q) == self._cap: self._cv.wait() self._q.append(element) self._cv.notify_all() self._...
BoundedBlockingQueue
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BoundedBlockingQueue: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def enqueue(self, element): """:type element: int :rtype: void""" <|body_1|> def dequeue(self): """:rtype: int""" <|body_2|> def size(self): ...
stack_v2_sparse_classes_36k_train_034839
938
no_license
[ { "docstring": ":type capacity: int", "name": "__init__", "signature": "def __init__(self, capacity)" }, { "docstring": ":type element: int :rtype: void", "name": "enqueue", "signature": "def enqueue(self, element)" }, { "docstring": ":rtype: int", "name": "dequeue", "sig...
4
null
Implement the Python class `BoundedBlockingQueue` described below. Class description: Implement the BoundedBlockingQueue class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def enqueue(self, element): :type element: int :rtype: void - def dequeue(self): :rtype: int - def siz...
Implement the Python class `BoundedBlockingQueue` described below. Class description: Implement the BoundedBlockingQueue class. Method signatures and docstrings: - def __init__(self, capacity): :type capacity: int - def enqueue(self, element): :type element: int :rtype: void - def dequeue(self): :rtype: int - def siz...
bfd16678f179bbfc7564bfc079d2fa4b3e554be6
<|skeleton|> class BoundedBlockingQueue: def __init__(self, capacity): """:type capacity: int""" <|body_0|> def enqueue(self, element): """:type element: int :rtype: void""" <|body_1|> def dequeue(self): """:rtype: int""" <|body_2|> def size(self): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BoundedBlockingQueue: def __init__(self, capacity): """:type capacity: int""" self._cap = capacity self._q = deque() self._cv = Condition() def enqueue(self, element): """:type element: int :rtype: void""" self._cv.acquire() while len(self._q) == se...
the_stack_v2_python_sparse
SystemDesign/design-bounded-blocking-queue.py
HeliWang/upstream
train
0
0d1c887a8fd12b8f64849a937e33c746faa9b10a
[ "super().__init__(cv)\nself.cid = cv.create_polygon(x - 12, 530, x + 12, 530, x, 500, fill='red')\nself.x = x\nself.rps = rps\nself.colors = colors\nself._tospawn = 0", "self.age += dt\nfor p in self.particles:\n p.update(dt)\nself._tospawn += self.rps * dt\ncolor = choice(self.colors)\nfor i in range(int(self...
<|body_start_0|> super().__init__(cv) self.cid = cv.create_polygon(x - 12, 530, x + 12, 530, x, 500, fill='red') self.x = x self.rps = rps self.colors = colors self._tospawn = 0 <|end_body_0|> <|body_start_1|> self.age += dt for p in self.particles: ...
Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn.
RocketLauncher
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RocketLauncher: """Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn.""" def __init__(self, cv, x, rps, colors): """Init Volcano objects. Args: cv (Tk.canvas)...
stack_v2_sparse_classes_36k_train_034840
17,823
no_license
[ { "docstring": "Init Volcano objects. Args: cv (Tk.canvas): the canvas in which the rocket is drawn. x (float): x-coordinate of the rocketlauncher. rps (float): the number of rockets to spawn per second. colors (list of string): the colors of the rockets to spawn.", "name": "__init__", "signature": "def...
2
stack_v2_sparse_classes_30k_val_000248
Implement the Python class `RocketLauncher` described below. Class description: Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn. Method signatures and docstrings: - def __init__(self, cv, x,...
Implement the Python class `RocketLauncher` described below. Class description: Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn. Method signatures and docstrings: - def __init__(self, cv, x,...
5e51c57c17ee8c233a0fe63f32942e80549040fd
<|skeleton|> class RocketLauncher: """Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn.""" def __init__(self, cv, x, rps, colors): """Init Volcano objects. Args: cv (Tk.canvas)...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RocketLauncher: """Attributes: x (float): x-coordinate of the rocketlauncher rps (float): the number of particles to spawn per second. colors (list of string): the colors of the rockets to spawn.""" def __init__(self, cv, x, rps, colors): """Init Volcano objects. Args: cv (Tk.canvas): the canvas ...
the_stack_v2_python_sparse
semester_one/infoI/sheet10/fireworks.py
fkarg/uni-stuff
train
0
15fa9d8676e75800004e2e5bae4eecbb369e77bb
[ "super().__init__()\nself.dueling = dueling\nself.conv = Conv2dHeadModel(image_shape=image_shape, channels=channels or [32, 64, 64], kernel_sizes=kernel_sizes or [8, 4, 3], strides=strides or [4, 2, 1], paddings=paddings or [0, 1, 1], use_maxpool=use_maxpool, hidden_sizes=fc_size)\nself.lstm = torch.nn.LSTM(self.co...
<|body_start_0|> super().__init__() self.dueling = dueling self.conv = Conv2dHeadModel(image_shape=image_shape, channels=channels or [32, 64, 64], kernel_sizes=kernel_sizes or [8, 4, 3], strides=strides or [4, 2, 1], paddings=paddings or [0, 1, 1], use_maxpool=use_maxpool, hidden_sizes=fc_size) ...
2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set.
AtariR2d1Model
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AtariR2d1Model: """2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set.""" def __init__(self, image_shape, output_size, fc_size=512, lstm_size=512, head_size=512, dueling=False, use_maxpool=Fal...
stack_v2_sparse_classes_36k_train_034841
3,009
permissive
[ { "docstring": "Instantiates the neural network according to arguments; network defaults stored within this method.", "name": "__init__", "signature": "def __init__(self, image_shape, output_size, fc_size=512, lstm_size=512, head_size=512, dueling=False, use_maxpool=False, channels=None, kernel_sizes=No...
2
null
Implement the Python class `AtariR2d1Model` described below. Class description: 2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set. Method signatures and docstrings: - def __init__(self, image_shape, output_size, fc_si...
Implement the Python class `AtariR2d1Model` described below. Class description: 2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set. Method signatures and docstrings: - def __init__(self, image_shape, output_size, fc_si...
98681a23bae9e8e5e9fbf68a0316ca2a22a27593
<|skeleton|> class AtariR2d1Model: """2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set.""" def __init__(self, image_shape, output_size, fc_size=512, lstm_size=512, head_size=512, dueling=False, use_maxpool=Fal...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AtariR2d1Model: """2D convolutional neural network (for multiple video frames per observation) feeding into an LSTM and MLP output for Q-value outputs for the action set.""" def __init__(self, image_shape, output_size, fc_size=512, lstm_size=512, head_size=512, dueling=False, use_maxpool=False, channels=...
the_stack_v2_python_sparse
dependencies/rlpyt/rlpyt/models/dqn/atari_r2d1_model.py
keirp/glamor
train
5
8cf8bf9880a3d2a33dfe91a1f85e1d2b400c86e4
[ "super().__init__(c, language='c')\naSet = set(self.type_keywords + (c.config.getData('c_import_typedefs') or []))\nself.c_type_names = f\"({'|'.join(list(aSet))})\"\nself.c_types_pattern = re.compile(self.c_type_names)\nself.c_class_pattern = re.compile('\\\\s*(%s\\\\s*)*\\\\s*class\\\\s+(\\\\w+)' % self.c_type_na...
<|body_start_0|> super().__init__(c, language='c') aSet = set(self.type_keywords + (c.config.getData('c_import_typedefs') or [])) self.c_type_names = f"({'|'.join(list(aSet))})" self.c_types_pattern = re.compile(self.c_type_names) self.c_class_pattern = re.compile('\\s*(%s\\s*)*\...
C_Importer
[ "BSD-3-Clause", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class C_Importer: def __init__(self, c: Cmdr) -> None: """C_Importer.__init__""" <|body_0|> def new_starts_block(self, i: int) -> Optional[int]: """Return None if lines[i] does not start a class, function or method. Otherwise, return the index of the first line of the body...
stack_v2_sparse_classes_36k_train_034842
4,770
permissive
[ { "docstring": "C_Importer.__init__", "name": "__init__", "signature": "def __init__(self, c: Cmdr) -> None" }, { "docstring": "Return None if lines[i] does not start a class, function or method. Otherwise, return the index of the first line of the body.", "name": "new_starts_block", "si...
3
stack_v2_sparse_classes_30k_train_021596
Implement the Python class `C_Importer` described below. Class description: Implement the C_Importer class. Method signatures and docstrings: - def __init__(self, c: Cmdr) -> None: C_Importer.__init__ - def new_starts_block(self, i: int) -> Optional[int]: Return None if lines[i] does not start a class, function or me...
Implement the Python class `C_Importer` described below. Class description: Implement the C_Importer class. Method signatures and docstrings: - def __init__(self, c: Cmdr) -> None: C_Importer.__init__ - def new_starts_block(self, i: int) -> Optional[int]: Return None if lines[i] does not start a class, function or me...
76b60e5c58781f84c86a603b9c50b709250682b8
<|skeleton|> class C_Importer: def __init__(self, c: Cmdr) -> None: """C_Importer.__init__""" <|body_0|> def new_starts_block(self, i: int) -> Optional[int]: """Return None if lines[i] does not start a class, function or method. Otherwise, return the index of the first line of the body...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class C_Importer: def __init__(self, c: Cmdr) -> None: """C_Importer.__init__""" super().__init__(c, language='c') aSet = set(self.type_keywords + (c.config.getData('c_import_typedefs') or [])) self.c_type_names = f"({'|'.join(list(aSet))})" self.c_types_pattern = re.compile(...
the_stack_v2_python_sparse
leo/plugins/importers/c.py
tbpassin/leo-editor
train
0
32af63a45eb4ac41d598473142bf4c74e61b0b92
[ "myThread = threading.currentThread()\nif logger is None:\n logger = myThread.logger\nif dbi is None:\n dbi = myThread.dbi\ntablespaceIndex = ''\nif params:\n if 'tablespace_index' in params:\n tablespaceIndex = 'USING INDEX TABLESPACE %s' % params['tablespace_index']\nDBCreator.__init__(self, logge...
<|body_start_0|> myThread = threading.currentThread() if logger is None: logger = myThread.logger if dbi is None: dbi = myThread.dbi tablespaceIndex = '' if params: if 'tablespace_index' in params: tablespaceIndex = 'USING INDEX...
This should create the BossAir schema; since they don't do it.
Create
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Create: """This should create the BossAir schema; since they don't do it.""" def __init__(self, logger=None, dbi=None, params=None): """_init_ Call the DBCreator constructor and create the list of required tables.""" <|body_0|> def execute(self, conn=None, transaction=No...
stack_v2_sparse_classes_36k_train_034843
3,528
permissive
[ { "docstring": "_init_ Call the DBCreator constructor and create the list of required tables.", "name": "__init__", "signature": "def __init__(self, logger=None, dbi=None, params=None)" }, { "docstring": "_execute_ Check to make sure that all required tables have been defined. If everything is i...
2
null
Implement the Python class `Create` described below. Class description: This should create the BossAir schema; since they don't do it. Method signatures and docstrings: - def __init__(self, logger=None, dbi=None, params=None): _init_ Call the DBCreator constructor and create the list of required tables. - def execute...
Implement the Python class `Create` described below. Class description: This should create the BossAir schema; since they don't do it. Method signatures and docstrings: - def __init__(self, logger=None, dbi=None, params=None): _init_ Call the DBCreator constructor and create the list of required tables. - def execute...
de110ccf6fc63ef5589b4e871ef4d51d5bce7a25
<|skeleton|> class Create: """This should create the BossAir schema; since they don't do it.""" def __init__(self, logger=None, dbi=None, params=None): """_init_ Call the DBCreator constructor and create the list of required tables.""" <|body_0|> def execute(self, conn=None, transaction=No...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Create: """This should create the BossAir schema; since they don't do it.""" def __init__(self, logger=None, dbi=None, params=None): """_init_ Call the DBCreator constructor and create the list of required tables.""" myThread = threading.currentThread() if logger is None: ...
the_stack_v2_python_sparse
src/python/WMCore/BossAir/MySQL/Create.py
vkuznet/WMCore
train
0
7be15996c028f9465222161469983854f37d1277
[ "def inorder(root, k):\n if root is None or Solution.RES is not None:\n return\n inorder(root.left, k)\n Solution.COUNTER += 1\n if Solution.COUNTER == k:\n Solution.RES = root\n return\n inorder(root.right, k)\ninorder(root, k)\nreturn Solution.RES.val", "def inorder(root, con...
<|body_start_0|> def inorder(root, k): if root is None or Solution.RES is not None: return inorder(root.left, k) Solution.COUNTER += 1 if Solution.COUNTER == k: Solution.RES = root return inorder(root.rig...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def kthSmallest(self, root, k): """This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type k: int :rtype: int""" <|body_0|> def kthSmallestWithExtraSpace(self, root, k): ...
stack_v2_sparse_classes_36k_train_034844
2,279
no_license
[ { "docstring": "This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type k: int :rtype: int", "name": "kthSmallest", "signature": "def kthSmallest(self, root, k)" }, { "docstring": "Extra O(n) space. :type ...
3
stack_v2_sparse_classes_30k_val_000083
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kthSmallest(self, root, k): This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def kthSmallest(self, root, k): This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type...
33c623f226981942780751554f0593f2c71cf458
<|skeleton|> class Solution: def kthSmallest(self, root, k): """This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type k: int :rtype: int""" <|body_0|> def kthSmallestWithExtraSpace(self, root, k): ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def kthSmallest(self, root, k): """This one requires two global(in class scope) varirables to track the ith node it's visiting and ref desired node to it. :type root: TreeNode :type k: int :rtype: int""" def inorder(root, k): if root is None or Solution.RES is not None: ...
the_stack_v2_python_sparse
tree/leetcode_Kth_Smallest_Element_In_A_BST.py
monkeylyf/interviewjam
train
59
388e19e86531f83882c4c2e943181f1aaec409fb
[ "timestamp = deserialize_timestamp_from_date(date=csv_row['Date'], formatstr=timestamp_format, location='BlockFi')\nbuy_asset = asset_from_blockfi(csv_row['Buy Currency'])\nbuy_amount = deserialize_asset_amount(csv_row['Buy Quantity'])\nsold_asset = asset_from_blockfi(csv_row['Sold Currency'])\nsold_amount = deseri...
<|body_start_0|> timestamp = deserialize_timestamp_from_date(date=csv_row['Date'], formatstr=timestamp_format, location='BlockFi') buy_asset = asset_from_blockfi(csv_row['Buy Currency']) buy_amount = deserialize_asset_amount(csv_row['Buy Quantity']) sold_asset = asset_from_blockfi(csv_ro...
BlockfiTradesImporter
[ "AGPL-3.0-only", "AGPL-3.0-or-later", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BlockfiTradesImporter: def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row: dict[str, Any], timestamp_format: str='%Y-%m-%d %H:%M:%S') -> None: """Consume the file containing only trades from BlockFi. As per my investigations (@yabirgb) this file can only contain confirmed t...
stack_v2_sparse_classes_36k_train_034845
3,637
permissive
[ { "docstring": "Consume the file containing only trades from BlockFi. As per my investigations (@yabirgb) this file can only contain confirmed trades. - UnknownAsset - DeserializationError", "name": "_consume_blockfi_trade", "signature": "def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row:...
2
null
Implement the Python class `BlockfiTradesImporter` described below. Class description: Implement the BlockfiTradesImporter class. Method signatures and docstrings: - def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row: dict[str, Any], timestamp_format: str='%Y-%m-%d %H:%M:%S') -> None: Consume the file c...
Implement the Python class `BlockfiTradesImporter` described below. Class description: Implement the BlockfiTradesImporter class. Method signatures and docstrings: - def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row: dict[str, Any], timestamp_format: str='%Y-%m-%d %H:%M:%S') -> None: Consume the file c...
496948458b89afc41458f19d1cba0e971ab67c8b
<|skeleton|> class BlockfiTradesImporter: def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row: dict[str, Any], timestamp_format: str='%Y-%m-%d %H:%M:%S') -> None: """Consume the file containing only trades from BlockFi. As per my investigations (@yabirgb) this file can only contain confirmed t...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BlockfiTradesImporter: def _consume_blockfi_trade(self, write_cursor: DBCursor, csv_row: dict[str, Any], timestamp_format: str='%Y-%m-%d %H:%M:%S') -> None: """Consume the file containing only trades from BlockFi. As per my investigations (@yabirgb) this file can only contain confirmed trades. - Unkno...
the_stack_v2_python_sparse
rotkehlchen/data_import/importers/blockfi_trades.py
LefterisJP/rotkehlchen
train
0
94eeae95ba4ce272c0493d1c40fc016ac7834b7a
[ "if np.any(periods < 0.01):\n raise ValueError('The periods must be greater or equal to 0.01s')\nif np.any(periods > 10):\n raise ValueError('The periods must be less or equal to 10s')\nself.periods = periods.copy()", "if np.any(h < 0):\n raise ValueError('The separation distance must be positive')\nif n...
<|body_start_0|> if np.any(periods < 0.01): raise ValueError('The periods must be greater or equal to 0.01s') if np.any(periods > 10): raise ValueError('The periods must be less or equal to 10s') self.periods = periods.copy() <|end_body_0|> <|body_start_1|> if np...
Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations.
DummyCorrelation
[ "LicenseRef-scancode-warranty-disclaimer", "CC0-1.0", "Python-2.0", "LicenseRef-scancode-public-domain" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DummyCorrelation: """Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations.""" def __init__(self, periods): """Initialize the cross-correlation object. Args: periods (ndarray): An array of periods that wil...
stack_v2_sparse_classes_36k_train_034846
2,664
permissive
[ { "docstring": "Initialize the cross-correlation object. Args: periods (ndarray): An array of periods that will be requested from the function. Values must be in the range [0.01, 10.0], and must me sorted from smallest to largest. Returns: An instance of :class:`DummyCorrelation`.", "name": "__init__", ...
2
stack_v2_sparse_classes_30k_train_000443
Implement the Python class `DummyCorrelation` described below. Class description: Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations. Method signatures and docstrings: - def __init__(self, periods): Initialize the cross-correlation obje...
Implement the Python class `DummyCorrelation` described below. Class description: Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations. Method signatures and docstrings: - def __init__(self, periods): Initialize the cross-correlation obje...
8094736e43cc8043044344116b064917d5560c5a
<|skeleton|> class DummyCorrelation: """Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations.""" def __init__(self, periods): """Initialize the cross-correlation object. Args: periods (ndarray): An array of periods that wil...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DummyCorrelation: """Simplified correlation module for testing purposes. Should not be used in productions runs as it does not produce valid correlations.""" def __init__(self, periods): """Initialize the cross-correlation object. Args: periods (ndarray): An array of periods that will be requeste...
the_stack_v2_python_sparse
shakelib/correlation/dummy.py
GeoscienceAustralia/shakemap
train
1
7d30add9a01cecdcd566bca67de339a4bf9ba343
[ "SpsSequence.__init__(self, cams, **seqKeys)\ncameraWithHexapodPowerCycled = [cam for cam in cams if cam.specName in hexapodOff]\nif cameraWithHexapodPowerCycled:\n self.expose('arc', lampsKeys, cameraWithHexapodPowerCycled, duplicate=duplicate)\nself.add('sps', 'slit start', cams=cams)\nself.add('sps', 'slit ho...
<|body_start_0|> SpsSequence.__init__(self, cams, **seqKeys) cameraWithHexapodPowerCycled = [cam for cam in cams if cam.specName in hexapodOff] if cameraWithHexapodPowerCycled: self.expose('arc', lampsKeys, cameraWithHexapodPowerCycled, duplicate=duplicate) self.add('sps', 's...
hexapod stability sequence
HexapodStability
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HexapodStability: """hexapod stability sequence""" def __init__(self, cams, lampsKeys, duplicate, positions, hexapodOff, **seqKeys): """Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions for the slit dither and shift grid. Default=[0.05, 0.04,...
stack_v2_sparse_classes_36k_train_034847
4,346
no_license
[ { "docstring": "Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions for the slit dither and shift grid. Default=[0.05, 0.04, 0.03, 0.02, 0.01, 0, -0.01, -0.02, -0.03, -0.04, -0.05] duplicate : `int` the number of exposures to take at each position. Notes ----- The cams/sm...
2
stack_v2_sparse_classes_30k_train_019966
Implement the Python class `HexapodStability` described below. Class description: hexapod stability sequence Method signatures and docstrings: - def __init__(self, cams, lampsKeys, duplicate, positions, hexapodOff, **seqKeys): Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions...
Implement the Python class `HexapodStability` described below. Class description: hexapod stability sequence Method signatures and docstrings: - def __init__(self, cams, lampsKeys, duplicate, positions, hexapodOff, **seqKeys): Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions...
4de50d621193346af0933e85ecdc6fe8b82eed3e
<|skeleton|> class HexapodStability: """hexapod stability sequence""" def __init__(self, cams, lampsKeys, duplicate, positions, hexapodOff, **seqKeys): """Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions for the slit dither and shift grid. Default=[0.05, 0.04,...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HexapodStability: """hexapod stability sequence""" def __init__(self, cams, lampsKeys, duplicate, positions, hexapodOff, **seqKeys): """Acquire a hexapod repeatability grid. Args ---- positions : vector of `float` the positions for the slit dither and shift grid. Default=[0.05, 0.04, 0.03, 0.02, ...
the_stack_v2_python_sparse
python/ics/iicActor/sequenceList/sps/engineering.py
Subaru-PFS/ics_iicActor
train
0
7fff6e1b6d69d0f59b6483df6bb86636850deeeb
[ "self.external_tagging_restriction = external_tagging_restriction\nself.node_template = node_template\nself.fix_it = fix_it\nself.active_only = active_only\nsuper(TermTreeWidget, self).__init__(attrs)", "if value is None:\n value = []\nreturn render_to_string('edw/admin/term/widgets/tree/widget.html', {'name':...
<|body_start_0|> self.external_tagging_restriction = external_tagging_restriction self.node_template = node_template self.fix_it = fix_it self.active_only = active_only super(TermTreeWidget, self).__init__(attrs) <|end_body_0|> <|body_start_1|> if value is None: ...
Приложение терминов дерева
TermTreeWidget
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TermTreeWidget: """Приложение терминов дерева""" def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0): """Конструктор класса""" <|body_0|> def render(self, name, value, attrs=None, choices=(), renderer=N...
stack_v2_sparse_classes_36k_train_034848
1,868
permissive
[ { "docstring": "Конструктор класса", "name": "__init__", "signature": "def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0)" }, { "docstring": "Выполняет запрос и возвращает страницу терминов", "name": "render", "signatu...
2
stack_v2_sparse_classes_30k_train_008879
Implement the Python class `TermTreeWidget` described below. Class description: Приложение терминов дерева Method signatures and docstrings: - def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0): Конструктор класса - def render(self, name, value, at...
Implement the Python class `TermTreeWidget` described below. Class description: Приложение терминов дерева Method signatures and docstrings: - def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0): Конструктор класса - def render(self, name, value, at...
2f7c535cb9f91d6bcb2f1e91b58edebc01255612
<|skeleton|> class TermTreeWidget: """Приложение терминов дерева""" def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0): """Конструктор класса""" <|body_0|> def render(self, name, value, attrs=None, choices=(), renderer=N...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TermTreeWidget: """Приложение терминов дерева""" def __init__(self, attrs=None, external_tagging_restriction=False, node_template='extended', fix_it=True, active_only=0): """Конструктор класса""" self.external_tagging_restriction = external_tagging_restriction self.node_template =...
the_stack_v2_python_sparse
backend/edw/admin/term/widgets.py
infolabs/django-edw
train
5
018245f5e9437d459cd7b52ed813d5cd7e64c530
[ "node, rule_kw = node_from_uri(uri)\nif node == None:\n abort(404)\nrule_kw.update(node)\nvalues = rule_kw\nxhr_data = request.get_json()\nif xhr_data:\n values.update(xhr_data)\nvalues.update(request.form.to_dict(flat=True))\nvalues.update(request.args.to_dict(flat=True))\nvalues.update(request.cookies)\nval...
<|body_start_0|> node, rule_kw = node_from_uri(uri) if node == None: abort(404) rule_kw.update(node) values = rule_kw xhr_data = request.get_json() if xhr_data: values.update(xhr_data) values.update(request.form.to_dict(flat=True)) ...
Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `render_node`.)
PageView
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PageView: """Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `render_node`.)""" def get(self, uri=...
stack_v2_sparse_classes_36k_train_034849
9,625
no_license
[ { "docstring": "For sql queries that start with 'SELECT ...'", "name": "get", "signature": "def get(self, uri='')" }, { "docstring": "For sql queries that start with 'INSERT ...'", "name": "post", "signature": "def post(self, uri='')" }, { "docstring": "For sql queries that start...
5
stack_v2_sparse_classes_30k_train_007010
Implement the Python class `PageView` described below. Class description: Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `re...
Implement the Python class `PageView` described below. Class description: Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `re...
ee6b57cfef2119523a083e82d902a6024e0d995a
<|skeleton|> class PageView: """Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `render_node`.)""" def get(self, uri=...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PageView: """Handles access to a uri. The uri is first matched directly with a route to get a node. If that fails, it will load up the custom map and check the uri with any matching routes. When a node is retrieved (get) it renders that nodes value. (See `render_node`.)""" def get(self, uri=''): ...
the_stack_v2_python_sparse
BugSwarm/jkenlooper-chill-330840536/buggy_files/src/chill/public.py
tdurieux/BugSwarm-dissection
train
1
89287db9ca453d6775f00b091909301711461dd2
[ "self.uname = 'testuser'\nself.email = 'test+courses@edx.org'\nself.password = 'foo'\nself.user = User.objects.create_user(self.uname, self.email, self.password)\nself.user.is_active = True\nself.user.is_staff = True\nself.user.save()\nself.course_data = {'template': 'i4x://edx/templates/course/Empty', 'org': 'MITx...
<|body_start_0|> self.uname = 'testuser' self.email = 'test+courses@edx.org' self.password = 'foo' self.user = User.objects.create_user(self.uname, self.email, self.password) self.user.is_active = True self.user.is_staff = True self.user.save() self.course...
Tests to validate Internationalization.
InternationalizationTest
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InternationalizationTest: """Tests to validate Internationalization.""" def setUp(self): """These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so that the mongodb collection will be cleared out before each...
stack_v2_sparse_classes_36k_train_034850
3,349
no_license
[ { "docstring": "These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so that the mongodb collection will be cleared out before each test case execution and deleted afterwards.", "name": "setUp", "signature": "def setUp(self)" ...
4
null
Implement the Python class `InternationalizationTest` described below. Class description: Tests to validate Internationalization. Method signatures and docstrings: - def setUp(self): These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so th...
Implement the Python class `InternationalizationTest` described below. Class description: Tests to validate Internationalization. Method signatures and docstrings: - def setUp(self): These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so th...
5fa3a818c3d41bd9c3eb25122e1d376c8910269c
<|skeleton|> class InternationalizationTest: """Tests to validate Internationalization.""" def setUp(self): """These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so that the mongodb collection will be cleared out before each...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class InternationalizationTest: """Tests to validate Internationalization.""" def setUp(self): """These tests need a user in the DB so that the django Test Client can log them in. They inherit from the ModuleStoreTestCase class so that the mongodb collection will be cleared out before each test case ex...
the_stack_v2_python_sparse
ExtractFeatures/Data/pratik98/test_i18n.py
vivekaxl/LexisNexis
train
9
d00fc890167500ec246f7df90188b898f24fcecf
[ "self.points = points\nself.min_x = min(self.points, key=lambda pt: pt[0])[0]\nself.max_x = max(self.points, key=lambda pt: pt[0])[0]\nself.min_y = min(self.points, key=lambda pt: pt[1])[1]\nself.max_y = max(self.points, key=lambda pt: pt[1])[1]\nself._double_collision = False\nself._intercept = None", "self._dou...
<|body_start_0|> self.points = points self.min_x = min(self.points, key=lambda pt: pt[0])[0] self.max_x = max(self.points, key=lambda pt: pt[0])[0] self.min_y = min(self.points, key=lambda pt: pt[1])[1] self.max_y = max(self.points, key=lambda pt: pt[1])[1] self._double_c...
This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball.
PinballObstacle
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PinballObstacle: """This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball.""" def __init__(self, points): """:par...
stack_v2_sparse_classes_36k_train_034851
19,800
permissive
[ { "docstring": ":param points: A list of points defining the polygon :type points: list of lists", "name": "__init__", "signature": "def __init__(self, points)" }, { "docstring": "Determines if the ball hits this obstacle :param ball: An instance of :class:`BallModel` :type ball: :class:`BallMod...
6
stack_v2_sparse_classes_30k_train_012815
Implement the Python class `PinballObstacle` described below. Class description: This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball. Method sign...
Implement the Python class `PinballObstacle` described below. Class description: This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball. Method sign...
32f06bd38d80f0b1ffc945bf0aeebe572104e809
<|skeleton|> class PinballObstacle: """This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball.""" def __init__(self, points): """:par...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PinballObstacle: """This class represents a single polygon obstacle in the pinball domain and detects when a :class:`BallModel` hits it. When a collision is detected, it also provides a way to compute the appropriate effect to apply on the ball.""" def __init__(self, points): """:param points: A ...
the_stack_v2_python_sparse
rlpy/Domains/Pinball.py
tunnelshade/rlpy
train
1
069a78f6d08d9da6214e04de9e55354470edcde9
[ "import hashlib\nh = hashlib.sha1(user.password + unicode(user.last_login_date) + unicode(user.id)).hexdigest()[::2]\nreturn '%s-%s' % (int_to_base36(user.id), h)", "try:\n ts_b36 = token.split('-')[0]\nexcept ValueError:\n return False\ntry:\n uid = base36_to_int(ts_b36)\nexcept ValueError:\n return ...
<|body_start_0|> import hashlib h = hashlib.sha1(user.password + unicode(user.last_login_date) + unicode(user.id)).hexdigest()[::2] return '%s-%s' % (int_to_base36(user.id), h) <|end_body_0|> <|body_start_1|> try: ts_b36 = token.split('-')[0] except ValueError: ...
Class for generating tokens during password reset.
PasswordResetTokenGenerator
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PasswordResetTokenGenerator: """Class for generating tokens during password reset.""" def make_token(self, user): """@parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with timestamp generated for specified User""" <|body_0|> ...
stack_v2_sparse_classes_36k_train_034852
2,235
permissive
[ { "docstring": "@parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with timestamp generated for specified User", "name": "make_token", "signature": "def make_token(self, user)" }, { "docstring": "@parameter{user,User} instance of the User whose T...
2
null
Implement the Python class `PasswordResetTokenGenerator` described below. Class description: Class for generating tokens during password reset. Method signatures and docstrings: - def make_token(self, user): @parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with time...
Implement the Python class `PasswordResetTokenGenerator` described below. Class description: Class for generating tokens during password reset. Method signatures and docstrings: - def make_token(self, user): @parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with time...
8113673fa13b6fe195cea99dedab9616aeca3ae8
<|skeleton|> class PasswordResetTokenGenerator: """Class for generating tokens during password reset.""" def make_token(self, user): """@parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with timestamp generated for specified User""" <|body_0|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PasswordResetTokenGenerator: """Class for generating tokens during password reset.""" def make_token(self, user): """@parameter{user,User} instance of the User whom Token should be generated for @returns{string} Token with timestamp generated for specified User""" import hashlib h...
the_stack_v2_python_sparse
src/clm/utils/tokens.py
jochym/cc1
train
0
6beae9c5229d4f1aa0559b2200bf4c9a499ac1f4
[ "host = DATABASE[DataBase]['host']\nuser = DATABASE[DataBase]['user']\npassword = DATABASE[DataBase]['password']\ndatabase = DATABASE[DataBase]['database']\nself._connector = ''\ntry:\n self._connector = MySQLdb.connect(host, user, password, database)\nexcept (MySQLdb.Error, MySQLdb.Warning) as errorMessage:\n ...
<|body_start_0|> host = DATABASE[DataBase]['host'] user = DATABASE[DataBase]['user'] password = DATABASE[DataBase]['password'] database = DATABASE[DataBase]['database'] self._connector = '' try: self._connector = MySQLdb.connect(host, user, password, database)...
Klass twożący sesje do bazy dany
IDataConnector
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class IDataConnector: """Klass twożący sesje do bazy dany""" def __init__(self, DataBase='test_cloud'): """reconstruct SQL requests and create a table""" <|body_0|> def _reconfigurate_connection(self, DataBase='test_cloud'): """reconstruct SQL requests and create a tab...
stack_v2_sparse_classes_36k_train_034853
1,408
no_license
[ { "docstring": "reconstruct SQL requests and create a table", "name": "__init__", "signature": "def __init__(self, DataBase='test_cloud')" }, { "docstring": "reconstruct SQL requests and create a table", "name": "_reconfigurate_connection", "signature": "def _reconfigurate_connection(sel...
2
stack_v2_sparse_classes_30k_train_016160
Implement the Python class `IDataConnector` described below. Class description: Klass twożący sesje do bazy dany Method signatures and docstrings: - def __init__(self, DataBase='test_cloud'): reconstruct SQL requests and create a table - def _reconfigurate_connection(self, DataBase='test_cloud'): reconstruct SQL requ...
Implement the Python class `IDataConnector` described below. Class description: Klass twożący sesje do bazy dany Method signatures and docstrings: - def __init__(self, DataBase='test_cloud'): reconstruct SQL requests and create a table - def _reconfigurate_connection(self, DataBase='test_cloud'): reconstruct SQL requ...
6a15ea5239d22ba111863e66250a59301022c018
<|skeleton|> class IDataConnector: """Klass twożący sesje do bazy dany""" def __init__(self, DataBase='test_cloud'): """reconstruct SQL requests and create a table""" <|body_0|> def _reconfigurate_connection(self, DataBase='test_cloud'): """reconstruct SQL requests and create a tab...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class IDataConnector: """Klass twożący sesje do bazy dany""" def __init__(self, DataBase='test_cloud'): """reconstruct SQL requests and create a table""" host = DATABASE[DataBase]['host'] user = DATABASE[DataBase]['user'] password = DATABASE[DataBase]['password'] databas...
the_stack_v2_python_sparse
static/classes/datacontroller/IDataManager.py
Morfeu5z/Trashpanda-Cloud
train
2
24c0eca60e4b90b60e8991bbd27f5d587f97dfc2
[ "pc = DotDict()\nf2jd = copy.deepcopy(cannonical_json_dump)\npc.upload_file_minidump_flash2 = DotDict()\npc.upload_file_minidump_flash2.json_dump = f2jd\npc.upload_file_minidump_flash2.signature = 'hang | NtUserWaitMessage | F34033164________________________________'\nfake_processor = create_basic_fake_processor()\...
<|body_start_0|> pc = DotDict() f2jd = copy.deepcopy(cannonical_json_dump) pc.upload_file_minidump_flash2 = DotDict() pc.upload_file_minidump_flash2.json_dump = f2jd pc.upload_file_minidump_flash2.signature = 'hang | NtUserWaitMessage | F34033164________________________________' ...
TestBug811804
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestBug811804: def test_action_success(self): """success - target signature fonud""" <|body_0|> def test_action_failure(self): """success - target signature not found""" <|body_1|> <|end_skeleton|> <|body_start_0|> pc = DotDict() f2jd = copy...
stack_v2_sparse_classes_36k_train_034854
27,276
no_license
[ { "docstring": "success - target signature fonud", "name": "test_action_success", "signature": "def test_action_success(self)" }, { "docstring": "success - target signature not found", "name": "test_action_failure", "signature": "def test_action_failure(self)" } ]
2
stack_v2_sparse_classes_30k_train_016495
Implement the Python class `TestBug811804` described below. Class description: Implement the TestBug811804 class. Method signatures and docstrings: - def test_action_success(self): success - target signature fonud - def test_action_failure(self): success - target signature not found
Implement the Python class `TestBug811804` described below. Class description: Implement the TestBug811804 class. Method signatures and docstrings: - def test_action_success(self): success - target signature fonud - def test_action_failure(self): success - target signature not found <|skeleton|> class TestBug811804:...
9c9b7701d7ddf9f3cbba1a4d0aa65758e8b49528
<|skeleton|> class TestBug811804: def test_action_success(self): """success - target signature fonud""" <|body_0|> def test_action_failure(self): """success - target signature not found""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestBug811804: def test_action_success(self): """success - target signature fonud""" pc = DotDict() f2jd = copy.deepcopy(cannonical_json_dump) pc.upload_file_minidump_flash2 = DotDict() pc.upload_file_minidump_flash2.json_dump = f2jd pc.upload_file_minidump_flas...
the_stack_v2_python_sparse
socorro/unittest/processor/test_skunk_classifiers.py
v1ka5/socorro
train
0
d4c0422c97195fb79950977c565e2ad2c56b54d7
[ "size = len(prices)\nif size <= 0:\n return 0\nmemo = {}\n\ndef dp(start, k):\n if k == 0:\n return 0\n if start >= size:\n return 0\n if (start, k) in memo:\n return memo[start, k]\n minIdx = start\n maxPro = 0\n for i in range(start + 1, size):\n if prices[i] < pri...
<|body_start_0|> size = len(prices) if size <= 0: return 0 memo = {} def dp(start, k): if k == 0: return 0 if start >= size: return 0 if (start, k) in memo: return memo[start, k] ...
Solution
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def maxProfit(self, k: int, prices: List[int]) -> int: """暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化""" <|body_0|> def maxProfit_dp(self, k: int, prices: List[int]) -> int: """动态规划:三个操作状态buy, sell, rest。 通用状态转移方程:s[0,1]两种(有无股票)状态的两种情况,昨天的股票持有状态和今天的操作影响今天的收益情况 dp[i][k]...
stack_v2_sparse_classes_36k_train_034855
5,547
permissive
[ { "docstring": "暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化", "name": "maxProfit", "signature": "def maxProfit(self, k: int, prices: List[int]) -> int" }, { "docstring": "动态规划:三个操作状态buy, sell, rest。 通用状态转移方程:s[0,1]两种(有无股票)状态的两种情况,昨天的股票持有状态和今天的操作影响今天的收益情况 dp[i][k][0] = max(dp[i - 1][k][0], dp[i - 1][k][1] + ...
3
stack_v2_sparse_classes_30k_test_000772
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, k: int, prices: List[int]) -> int: 暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化 - def maxProfit_dp(self, k: int, prices: List[int]) -> int: 动态规划:三个操作状态buy, sell, rest。 通用状...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def maxProfit(self, k: int, prices: List[int]) -> int: 暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化 - def maxProfit_dp(self, k: int, prices: List[int]) -> int: 动态规划:三个操作状态buy, sell, rest。 通用状...
e8a1c6cae6547cbcb6e8494be6df685f3e7c837c
<|skeleton|> class Solution: def maxProfit(self, k: int, prices: List[int]) -> int: """暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化""" <|body_0|> def maxProfit_dp(self, k: int, prices: List[int]) -> int: """动态规划:三个操作状态buy, sell, rest。 通用状态转移方程:s[0,1]两种(有无股票)状态的两种情况,昨天的股票持有状态和今天的操作影响今天的收益情况 dp[i][k]...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def maxProfit(self, k: int, prices: List[int]) -> int: """暴力优化2:消除一层循环+备忘录,超时90分吧,后续状态机优化""" size = len(prices) if size <= 0: return 0 memo = {} def dp(start, k): if k == 0: return 0 if start >= size: ...
the_stack_v2_python_sparse
123-best-time-to-buy-and-sell-stock-iii.py
yuenliou/leetcode
train
0
972bc0c46efb864e06950a1ff9cc4b46fe6f95ef
[ "if init in self._fun2str:\n return self._fun2str[init]\nelse:\n raise Exception(\"Shared-memory graph store doesn't support user's initializer\")", "if init in self._str2fun:\n return self._str2fun[init]\nelse:\n raise Exception(\"Shared-memory graph store doesn't support initializer \" + str(init))"...
<|body_start_0|> if init in self._fun2str: return self._fun2str[init] else: raise Exception("Shared-memory graph store doesn't support user's initializer") <|end_body_0|> <|body_start_1|> if init in self._str2fun: return self._str2fun[init] else: ...
Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer.
InitializerManager
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class InitializerManager: """Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer.""" def serialize(self, init): "...
stack_v2_sparse_classes_36k_train_034856
40,469
permissive
[ { "docstring": "Convert the initializer function to string. Parameters ---------- init : callable the initializer function. Returns ------ string The name of the built-in initializer function.", "name": "serialize", "signature": "def serialize(self, init)" }, { "docstring": "Convert the string t...
2
stack_v2_sparse_classes_30k_train_005041
Implement the Python class `InitializerManager` described below. Class description: Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer. Meth...
Implement the Python class `InitializerManager` described below. Class description: Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer. Meth...
195f99362d883f8b6d131b70a7868a537e55b786
<|skeleton|> class InitializerManager: """Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer.""" def serialize(self, init): "...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class InitializerManager: """Manage initializer. We need to convert built-in frame initializer to strings and send them to the graph store server through RPC. Through the conversion, we need to convert local built-in initializer to shared-memory initializer.""" def serialize(self, init): """Convert the...
the_stack_v2_python_sparse
python/dgl/contrib/graph_store.py
hengruizhang98/dgl
train
3
4bd055cb4e97dbe890feea524825af93a150e07b
[ "self.arr = []\nself.d = {}\nself.size = 0", "self.size += 1\nif timestamp not in self.d:\n self.arr.append(timestamp)\n self.d[timestamp] = self.size\nelse:\n self.d[timestamp] += 1", "if not self.arr:\n return 0\nstart = 0\nstop = len(self.arr) - 1\nwhile start + 1 < stop:\n mid = (start + stop...
<|body_start_0|> self.arr = [] self.d = {} self.size = 0 <|end_body_0|> <|body_start_1|> self.size += 1 if timestamp not in self.d: self.arr.append(timestamp) self.d[timestamp] = self.size else: self.d[timestamp] += 1 <|end_body_1|> <...
HitCounter
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class HitCounter: def __init__(self): """Initialize your data structure here.""" <|body_0|> def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity).""" <|body_1|> def getHits(self, timestamp: in...
stack_v2_sparse_classes_36k_train_034857
2,328
no_license
[ { "docstring": "Initialize your data structure here.", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "Record a hit. @param timestamp - The current timestamp (in seconds granularity).", "name": "hit", "signature": "def hit(self, timestamp: int) -> None" }, { ...
3
null
Implement the Python class `HitCounter` described below. Class description: Implement the HitCounter class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def hit(self, timestamp: int) -> None: Record a hit. @param timestamp - The current timestamp (in seconds granulari...
Implement the Python class `HitCounter` described below. Class description: Implement the HitCounter class. Method signatures and docstrings: - def __init__(self): Initialize your data structure here. - def hit(self, timestamp: int) -> None: Record a hit. @param timestamp - The current timestamp (in seconds granulari...
c937fe19be665ba7ac345e1729ff531f370f30e8
<|skeleton|> class HitCounter: def __init__(self): """Initialize your data structure here.""" <|body_0|> def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity).""" <|body_1|> def getHits(self, timestamp: in...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class HitCounter: def __init__(self): """Initialize your data structure here.""" self.arr = [] self.d = {} self.size = 0 def hit(self, timestamp: int) -> None: """Record a hit. @param timestamp - The current timestamp (in seconds granularity).""" self.size += 1 ...
the_stack_v2_python_sparse
google/designHitCounter.py
nguyenngochuy91/companyQuestions
train
1
712b7de089d6ba04f6d241b1ea0ea3c5328c401a
[ "gAEAttrPresetCurrentTarget = mel.eval('$tmpVar=$gAEAttrPresetCurrentTarget;')\ngAEAttrPresetBlend = mel.eval('$tmpVar=$gAEAttrPresetBlend;')\nntype = cmds.nodeType(node)\nppath = cmds.internalVar(userPrefDir=True)\nif presetName[-4:] == '.mel':\n ppath = presetName\nelse:\n ppath = ppath.replace('prefs', 'pr...
<|body_start_0|> gAEAttrPresetCurrentTarget = mel.eval('$tmpVar=$gAEAttrPresetCurrentTarget;') gAEAttrPresetBlend = mel.eval('$tmpVar=$gAEAttrPresetBlend;') ntype = cmds.nodeType(node) ppath = cmds.internalVar(userPrefDir=True) if presetName[-4:] == '.mel': ppath = pr...
Helper class for finding attribute presets and reading them
fn_attr
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class fn_attr: """Helper class for finding attribute presets and reading them""" def applyAttrPreset(node, presetName, blend): """Apply the named preset to the given node.""" <|body_0|> def findAttrPresets(node): """Build a list of attribute presets for the given node ...
stack_v2_sparse_classes_36k_train_034858
2,296
no_license
[ { "docstring": "Apply the named preset to the given node.", "name": "applyAttrPreset", "signature": "def applyAttrPreset(node, presetName, blend)" }, { "docstring": "Build a list of attribute presets for the given node (the node's type is determined first)", "name": "findAttrPresets", "s...
2
stack_v2_sparse_classes_30k_train_019644
Implement the Python class `fn_attr` described below. Class description: Helper class for finding attribute presets and reading them Method signatures and docstrings: - def applyAttrPreset(node, presetName, blend): Apply the named preset to the given node. - def findAttrPresets(node): Build a list of attribute preset...
Implement the Python class `fn_attr` described below. Class description: Helper class for finding attribute presets and reading them Method signatures and docstrings: - def applyAttrPreset(node, presetName, blend): Apply the named preset to the given node. - def findAttrPresets(node): Build a list of attribute preset...
3891e40c3c4c3a054e5ff1ff16d051d4e690cc4a
<|skeleton|> class fn_attr: """Helper class for finding attribute presets and reading them""" def applyAttrPreset(node, presetName, blend): """Apply the named preset to the given node.""" <|body_0|> def findAttrPresets(node): """Build a list of attribute presets for the given node ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class fn_attr: """Helper class for finding attribute presets and reading them""" def applyAttrPreset(node, presetName, blend): """Apply the named preset to the given node.""" gAEAttrPresetCurrentTarget = mel.eval('$tmpVar=$gAEAttrPresetCurrentTarget;') gAEAttrPresetBlend = mel.eval('$tm...
the_stack_v2_python_sparse
luxPlugin/Lux/LuxMiscModules/fn_attr.py
LuxRender/LuxMaya
train
0
10a992aa6aa356853d8348f4d7521e65ae6bb39b
[ "mock_client = Taxii2FeedClient(url='', collection_to_fetch='', proxies=[], verify=False, objects_to_fetch=[])\nmock_client.init_server()\nassert isinstance(mock_client.server, v20.Server)", "mock_client = Taxii2FeedClient(url='', collection_to_fetch='', proxies=[], verify=False, objects_to_fetch=[])\nmock_client...
<|body_start_0|> mock_client = Taxii2FeedClient(url='', collection_to_fetch='', proxies=[], verify=False, objects_to_fetch=[]) mock_client.init_server() assert isinstance(mock_client.server, v20.Server) <|end_body_0|> <|body_start_1|> mock_client = Taxii2FeedClient(url='', collection_to...
Scenario: Initialize server
TestInitServer
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TestInitServer: """Scenario: Initialize server""" def test_default_v20(self): """Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server""" <|body_0|> def test_v21(self): """Scenario: Int...
stack_v2_sparse_classes_36k_train_034859
15,321
permissive
[ { "docstring": "Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server", "name": "test_default_v20", "signature": "def test_default_v20(self)" }, { "docstring": "Scenario: Intialize server with v21 Given: - v21 version ...
3
null
Implement the Python class `TestInitServer` described below. Class description: Scenario: Initialize server Method signatures and docstrings: - def test_default_v20(self): Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server - def test_v21...
Implement the Python class `TestInitServer` described below. Class description: Scenario: Initialize server Method signatures and docstrings: - def test_default_v20(self): Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server - def test_v21...
01b57f8c658c2faed047313d3034e8052ffa83ce
<|skeleton|> class TestInitServer: """Scenario: Initialize server""" def test_default_v20(self): """Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server""" <|body_0|> def test_v21(self): """Scenario: Int...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TestInitServer: """Scenario: Initialize server""" def test_default_v20(self): """Scenario: Intialize server with the default option Given: - no version is provided to init_server Then: - initalize with v20.Server""" mock_client = Taxii2FeedClient(url='', collection_to_fetch='', proxies=[]...
the_stack_v2_python_sparse
Packs/ApiModules/Scripts/TAXII2ApiModule/TAXII2ApiModule_test.py
adambaumeister/content
train
2
d0565f83db422e3d3436761b64934a05366ebf17
[ "value = '<div>'\nclase = 'actions'\ncontexto = ''\nperm_mod = PoseePermiso('modificar rol')\nperm_del = PoseePermiso('eliminar rol')\nurl_cont = '/rolesplantilla/'\ntipo = obj.tipo.lower()\nif tipo.find(u'proyecto') >= 0:\n contexto = 'proyecto'\nelif tipo.find(u'fase') >= 0:\n contexto = 'fase'\nelse:\n ...
<|body_start_0|> value = '<div>' clase = 'actions' contexto = '' perm_mod = PoseePermiso('modificar rol') perm_del = PoseePermiso('eliminar rol') url_cont = '/rolesplantilla/' tipo = obj.tipo.lower() if tipo.find(u'proyecto') >= 0: contexto = '...
RolPlantillaTableFiller
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RolPlantillaTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" <|body_0|> def _do_get_provider_count_and_objs(self, **kw): """Se muestra la lista de rol si se tiene un permiso necesario. Caso contrario le muestra sus roles.""" ...
stack_v2_sparse_classes_36k_train_034860
31,597
no_license
[ { "docstring": "Links de acciones para un registro dado", "name": "__actions__", "signature": "def __actions__(self, obj)" }, { "docstring": "Se muestra la lista de rol si se tiene un permiso necesario. Caso contrario le muestra sus roles.", "name": "_do_get_provider_count_and_objs", "si...
2
stack_v2_sparse_classes_30k_train_018085
Implement the Python class `RolPlantillaTableFiller` described below. Class description: Implement the RolPlantillaTableFiller class. Method signatures and docstrings: - def __actions__(self, obj): Links de acciones para un registro dado - def _do_get_provider_count_and_objs(self, **kw): Se muestra la lista de rol si...
Implement the Python class `RolPlantillaTableFiller` described below. Class description: Implement the RolPlantillaTableFiller class. Method signatures and docstrings: - def __actions__(self, obj): Links de acciones para un registro dado - def _do_get_provider_count_and_objs(self, **kw): Se muestra la lista de rol si...
997531e130d1951b483f4a6a67f2df7467cd9fd1
<|skeleton|> class RolPlantillaTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" <|body_0|> def _do_get_provider_count_and_objs(self, **kw): """Se muestra la lista de rol si se tiene un permiso necesario. Caso contrario le muestra sus roles.""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RolPlantillaTableFiller: def __actions__(self, obj): """Links de acciones para un registro dado""" value = '<div>' clase = 'actions' contexto = '' perm_mod = PoseePermiso('modificar rol') perm_del = PoseePermiso('eliminar rol') url_cont = '/rolesplantill...
the_stack_v2_python_sparse
lpm/controllers/rol.py
jorgeramirez/LPM
train
1
d8e7f21617294b53a94ba68b60afa9c53fde879d
[ "pivot = len(nums) - 1\nfor i in range(len(nums) - 1):\n if nums[i] > nums[i + 1]:\n pivot = i\nif nums == [] or target > nums[pivot] or target < nums[(pivot + 1) % len(nums)]:\n return False\nif target >= nums[0]:\n l = 0\n r = pivot\n return self.binarySearch(target, nums, l, r)\nelif target...
<|body_start_0|> pivot = len(nums) - 1 for i in range(len(nums) - 1): if nums[i] > nums[i + 1]: pivot = i if nums == [] or target > nums[pivot] or target < nums[(pivot + 1) % len(nums)]: return False if target >= nums[0]: l = 0 ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def binarySearch(self, target, nums, l, r): """:type nums: List[int] :type target: int :rtyep: int (index of target in the nums)""" <|body_1|> <|en...
stack_v2_sparse_classes_36k_train_034861
1,257
no_license
[ { "docstring": ":type nums: List[int] :type target: int :rtype: int", "name": "search", "signature": "def search(self, nums, target)" }, { "docstring": ":type nums: List[int] :type target: int :rtyep: int (index of target in the nums)", "name": "binarySearch", "signature": "def binarySea...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def search(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def binarySearch(self, target, nums, l, r): :type nums: List[int] :type target: int :rtyep: ...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def search(self, nums, target): :type nums: List[int] :type target: int :rtype: int - def binarySearch(self, target, nums, l, r): :type nums: List[int] :type target: int :rtyep: ...
a6d0e392134afe19d1aed2dfe7914b674e05ecc6
<|skeleton|> class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" <|body_0|> def binarySearch(self, target, nums, l, r): """:type nums: List[int] :type target: int :rtyep: int (index of target in the nums)""" <|body_1|> <|en...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def search(self, nums, target): """:type nums: List[int] :type target: int :rtype: int""" pivot = len(nums) - 1 for i in range(len(nums) - 1): if nums[i] > nums[i + 1]: pivot = i if nums == [] or target > nums[pivot] or target < nums[(pivot...
the_stack_v2_python_sparse
81SrchRtatStr.py
Ting007/leetcodePractice
train
0
cd47aff80484e8c62e3d00e6396d5386f14d1fa9
[ "ruleTableName = 'Rule %s %s' % (indicatorTable, indicatorRule)\nRule.__init__(self, ruleTableName)\nself._selectQuery = 'select Date, Code, %s as Match from %s' % (indicatorRule, indicatorTable)", "self._tickerCode = tickerCode\nstart = self._getLatestDate()\nLogger.log(logging.INFO, 'Evaluating Rule', {'scope':...
<|body_start_0|> ruleTableName = 'Rule %s %s' % (indicatorTable, indicatorRule) Rule.__init__(self, ruleTableName) self._selectQuery = 'select Date, Code, %s as Match from %s' % (indicatorRule, indicatorTable) <|end_body_0|> <|body_start_1|> self._tickerCode = tickerCode start =...
Simple Rule Class.
SimpleRule
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class SimpleRule: """Simple Rule Class.""" def __init__(self, indicatorTable, indicatorRule): """Class Constructor. :param ?""" <|body_0|> def evaluateRule(self, tickerCode): """?.""" <|body_1|> <|end_skeleton|> <|body_start_0|> ruleTableName = 'Rule ...
stack_v2_sparse_classes_36k_train_034862
1,528
no_license
[ { "docstring": "Class Constructor. :param ?", "name": "__init__", "signature": "def __init__(self, indicatorTable, indicatorRule)" }, { "docstring": "?.", "name": "evaluateRule", "signature": "def evaluateRule(self, tickerCode)" } ]
2
stack_v2_sparse_classes_30k_train_010958
Implement the Python class `SimpleRule` described below. Class description: Simple Rule Class. Method signatures and docstrings: - def __init__(self, indicatorTable, indicatorRule): Class Constructor. :param ? - def evaluateRule(self, tickerCode): ?.
Implement the Python class `SimpleRule` described below. Class description: Simple Rule Class. Method signatures and docstrings: - def __init__(self, indicatorTable, indicatorRule): Class Constructor. :param ? - def evaluateRule(self, tickerCode): ?. <|skeleton|> class SimpleRule: """Simple Rule Class.""" d...
08b07b50ead69decd381cf5f866f4d8ffb80fa54
<|skeleton|> class SimpleRule: """Simple Rule Class.""" def __init__(self, indicatorTable, indicatorRule): """Class Constructor. :param ?""" <|body_0|> def evaluateRule(self, tickerCode): """?.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class SimpleRule: """Simple Rule Class.""" def __init__(self, indicatorTable, indicatorRule): """Class Constructor. :param ?""" ruleTableName = 'Rule %s %s' % (indicatorTable, indicatorRule) Rule.__init__(self, ruleTableName) self._selectQuery = 'select Date, Code, %s as Match f...
the_stack_v2_python_sparse
pyswing/objects/rules/simpleRule.py
garyjoy/pyswing
train
1
afe0d9490691e77ae33bc2729289bbbc67ce7260
[ "if not root:\n return 'None'\nleft = self.serialize(root.left)\nright = self.serialize(root.right)\nreturn str(root.val) + ',' + left + ',' + right", "tree_list = data.split(',')\ntree_list = tree_list[::-1]\n\ndef preorder():\n curr_val = tree_list.pop()\n if curr_val == 'None':\n return\n no...
<|body_start_0|> if not root: return 'None' left = self.serialize(root.left) right = self.serialize(root.right) return str(root.val) + ',' + left + ',' + right <|end_body_0|> <|body_start_1|> tree_list = data.split(',') tree_list = tree_list[::-1] de...
Codec
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|> <|body_...
stack_v2_sparse_classes_36k_train_034863
1,363
no_license
[ { "docstring": "Encodes a tree to a single string. :type root: TreeNode :rtype: str", "name": "serialize", "signature": "def serialize(self, root)" }, { "docstring": "Decodes your encoded data to tree. :type data: str :rtype: TreeNode", "name": "deserialize", "signature": "def deserializ...
2
stack_v2_sparse_classes_30k_train_004146
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
Implement the Python class `Codec` described below. Class description: Implement the Codec class. Method signatures and docstrings: - def serialize(self, root): Encodes a tree to a single string. :type root: TreeNode :rtype: str - def deserialize(self, data): Decodes your encoded data to tree. :type data: str :rtype:...
b6589ede25aa20ee96b20ed65f0cb7459c740034
<|skeleton|> class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" <|body_0|> def deserialize(self, data): """Decodes your encoded data to tree. :type data: str :rtype: TreeNode""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str""" if not root: return 'None' left = self.serialize(root.left) right = self.serialize(root.right) return str(root.val) + ',' + left + ',' + right de...
the_stack_v2_python_sparse
Serialize_Deserialize_BT.py
akarshn95/Coding_Challenges
train
0
e7ad0b40810b8e714729951a8dfef37fc332b4a8
[ "super().__init__(mol, cuda)\nself.order = order\nself.fc = nn.Linear(order, 1, bias=False)\nself.fc.weight.data *= 0.0\nself.fc.weight.data[0, 0] = 1.0\nself.weight = nn.Parameter(torch.as_tensor([0.001]))", "eye = torch.eye(self.nelec, self.nelec).to(self.device)\nmask = torch.ones_like(ree) - eye\nreturn self....
<|body_start_0|> super().__init__(mol, cuda) self.order = order self.fc = nn.Linear(order, 1, bias=False) self.fc.weight.data *= 0.0 self.fc.weight.data[0, 0] = 1.0 self.weight = nn.Parameter(torch.as_tensor([0.001])) <|end_body_0|> <|body_start_1|> eye = torch.e...
BackFlowKernelAutoInverse
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class BackFlowKernelAutoInverse: def __init__(self, mol, cuda, order=2): """Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and j This kernel is used in the backflow transformation .. math: q_i = r_i + \\sum_{j\\neq i} f(r_{ij}) (r_i-r_j)""" ...
stack_v2_sparse_classes_36k_train_034864
1,085
permissive
[ { "docstring": "Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and j This kernel is used in the backflow transformation .. math: q_i = r_i + \\\\sum_{j\\\\neq i} f(r_{ij}) (r_i-r_j)", "name": "__init__", "signature": "def __init__(self, mol, cuda, ord...
2
null
Implement the Python class `BackFlowKernelAutoInverse` described below. Class description: Implement the BackFlowKernelAutoInverse class. Method signatures and docstrings: - def __init__(self, mol, cuda, order=2): Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and ...
Implement the Python class `BackFlowKernelAutoInverse` described below. Class description: Implement the BackFlowKernelAutoInverse class. Method signatures and docstrings: - def __init__(self, mol, cuda, order=2): Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and ...
439a79e97ee63057e3032d28a1a5ebafd2d5b5e4
<|skeleton|> class BackFlowKernelAutoInverse: def __init__(self, mol, cuda, order=2): """Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and j This kernel is used in the backflow transformation .. math: q_i = r_i + \\sum_{j\\neq i} f(r_{ij}) (r_i-r_j)""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class BackFlowKernelAutoInverse: def __init__(self, mol, cuda, order=2): """Compute the back flow kernel, i.e. the function f(rij) where rij is the distance between electron i and j This kernel is used in the backflow transformation .. math: q_i = r_i + \\sum_{j\\neq i} f(r_{ij}) (r_i-r_j)""" super(...
the_stack_v2_python_sparse
qmctorch/wavefunction/orbitals/backflow/kernels/backflow_kernel_autodiff_inverse.py
NLESC-JCER/QMCTorch
train
22
05cb529d49bae0a53ce68bf302aa96207362aaca
[ "fast, slow = (head, head)\nwhile fast and fast.next:\n fast = fast.next.next\n slow = slow.next\n if fast == slow:\n start = head\n while start.next:\n if slow == start:\n return start\n start = start.next\n slow = slow.next\nreturn None", "n...
<|body_start_0|> fast, slow = (head, head) while fast and fast.next: fast = fast.next.next slow = slow.next if fast == slow: start = head while start.next: if slow == start: return start ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def detectCycle(self, head: ListNode) -> ListNode: """1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b""" <|body_0|> def detectCycle2(self, head: ListNode) -> ListNode: """2. 集合保存访问过的节点,额外的空间 O(N)""" ...
stack_v2_sparse_classes_36k_train_034865
2,631
no_license
[ { "docstring": "1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b", "name": "detectCycle", "signature": "def detectCycle(self, head: ListNode) -> ListNode" }, { "docstring": "2. 集合保存访问过的节点,额外的空间 O(N)", "name": "detectCycle2", "signatu...
2
null
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def detectCycle(self, head: ListNode) -> ListNode: 1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b - def detectCycle2(self...
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def detectCycle(self, head: ListNode) -> ListNode: 1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b - def detectCycle2(self...
4732fb80710a08a715c3e7080c394f5298b8326d
<|skeleton|> class Solution: def detectCycle(self, head: ListNode) -> ListNode: """1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b""" <|body_0|> def detectCycle2(self, head: ListNode) -> ListNode: """2. 集合保存访问过的节点,额外的空间 O(N)""" ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def detectCycle(self, head: ListNode) -> ListNode: """1. 快慢指针: 入环点的位置为 r,fast、slow 两个指针在环 a 处相遇,环长度 a+b slow 移动长度 l1=r+a,则 fast 移动长度 l2=r+a+b+a,l2=2*l1-->r=b""" fast, slow = (head, head) while fast and fast.next: fast = fast.next.next slow = slow.next ...
the_stack_v2_python_sparse
02-linkedlist/142.环形链表-ii.py
xiaoruijiang/algorithm
train
0
0c8661e80ae8379e9693192cb33d3275e81c71de
[ "RadianceDefault.__init__(self, name, descriptive_name)\nself._relative_path = relative_path\nself._check_exists = check_exists\nself._extension = extension", "if value is not None:\n value = str(value)\n assert isinstance(value, str), 'The input for %s should be string containing the path name. %s %s was p...
<|body_start_0|> RadianceDefault.__init__(self, name, descriptive_name) self._relative_path = relative_path self._check_exists = check_exists self._extension = extension <|end_body_0|> <|body_start_1|> if value is not None: value = str(value) assert isins...
This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are actually keywords in python. For example -or in rcollate or -as in rtrace. In su...
RadiancePath
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RadiancePath: """This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are actually keywords in python. For example...
stack_v2_sparse_classes_36k_train_034866
32,374
no_license
[ { "docstring": "Init path descriptor.", "name": "__init__", "signature": "def __init__(self, name, descriptive_name=None, relative_path=None, check_exists=False, extension=None)" }, { "docstring": "Set the value. Run tests based on _expandRelative, _check_exists and _extension before assigning t...
2
stack_v2_sparse_classes_30k_train_017590
Implement the Python class `RadiancePath` described below. Class description: This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are a...
Implement the Python class `RadiancePath` described below. Class description: This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are a...
5be53caaf412d247ca88c90ebe4e193b2ff7a780
<|skeleton|> class RadiancePath: """This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are actually keywords in python. For example...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RadiancePath: """This input is expected to be a file path. (Attributes inherited from base-class are explained there.) Attributes: name: Required for all cases. Name of the flag, like 'ab' for '-ab 5' in rtrace etc. Note that some of the radiance flags are actually keywords in python. For example -or in rcoll...
the_stack_v2_python_sparse
honeybee/radiance/datatype.py
ladybug-tools/honeybee-anvil
train
0
173fc93ae5b885d7d7a00b818edeae5f0a9fde72
[ "self.name = 'Burstiness'\nself.improvement = improvement\nsuper(Burstiness, self).__init__(self.name, mean_trajectories, use_logger)\nif self.use_logger:\n self.logger = ml.SciopeLogger().get_logger()\n self.logger.info('Burstiness summary statistic initialized')", "trajs = []\nfor i in range(np.shape(data...
<|body_start_0|> self.name = 'Burstiness' self.improvement = improvement super(Burstiness, self).__init__(self.name, mean_trajectories, use_logger) if self.use_logger: self.logger = ml.SciopeLogger().get_logger() self.logger.info('Burstiness summary statistic init...
Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008.
Burstiness
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Burstiness: """Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008.""" def __init__(self, mean_trajectories=False, improvement=False, use_logger=False): """[summary] Parameters ---------- ...
stack_v2_sparse_classes_36k_train_034867
3,856
permissive
[ { "docstring": "[summary] Parameters ---------- mean_trajectories : bool, optional [description], by default True improvement : bool, optional [description], by default False", "name": "__init__", "signature": "def __init__(self, mean_trajectories=False, improvement=False, use_logger=False)" }, { ...
3
stack_v2_sparse_classes_30k_train_019734
Implement the Python class `Burstiness` described below. Class description: Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008. Method signatures and docstrings: - def __init__(self, mean_trajectories=False, improvement=F...
Implement the Python class `Burstiness` described below. Class description: Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008. Method signatures and docstrings: - def __init__(self, mean_trajectories=False, improvement=F...
5122107dedcee9c39458e83d853ec35f91268780
<|skeleton|> class Burstiness: """Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008.""" def __init__(self, mean_trajectories=False, improvement=False, use_logger=False): """[summary] Parameters ---------- ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Burstiness: """Burstiness Summary statictics Burstiness = (sigma-mu)/(sigma+mu) Ref: Burstiness and memory in complex systems, Europhys. Let., 81, pp. 48002, 2008.""" def __init__(self, mean_trajectories=False, improvement=False, use_logger=False): """[summary] Parameters ---------- mean_trajecto...
the_stack_v2_python_sparse
sciope/utilities/summarystats/burstiness.py
rmjiang7/sciope
train
0
01937a48602655b93701941497a9605e4d6d02e1
[ "fsm = cls.FSM[operator_type]\nnext_state_info = fsm.get((current_status, event), None)\nreturn next_state_info", "if current_status is None:\n current_status = shop.status if shop.status else cls.STATUS_INIT\nnext_state = cls.get_next_state(operator_type, current_status, event)\nnext_status = next_state['next...
<|body_start_0|> fsm = cls.FSM[operator_type] next_state_info = fsm.get((current_status, event), None) return next_state_info <|end_body_0|> <|body_start_1|> if current_status is None: current_status = shop.status if shop.status else cls.STATUS_INIT next_state = cls....
商户有限状态机
ShopFSM
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class ShopFSM: """商户有限状态机""" def get_next_state(cls, operator_type, current_status, event): """获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件""" <|body_0|> def update_status(cls, operator_type, shop, e...
stack_v2_sparse_classes_36k_train_034868
6,677
permissive
[ { "docstring": "获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件", "name": "get_next_state", "signature": "def get_next_state(cls, operator_type, current_status, event)" }, { "docstring": "更新对象的状态 :param operator_type: 'OU...
2
stack_v2_sparse_classes_30k_train_017623
Implement the Python class `ShopFSM` described below. Class description: 商户有限状态机 Method signatures and docstrings: - def get_next_state(cls, operator_type, current_status, event): 获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件 - def update_st...
Implement the Python class `ShopFSM` described below. Class description: 商户有限状态机 Method signatures and docstrings: - def get_next_state(cls, operator_type, current_status, event): 获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件 - def update_st...
a7c9567975b5372b2edabddb0fec8d73bc01c3dc
<|skeleton|> class ShopFSM: """商户有限状态机""" def get_next_state(cls, operator_type, current_status, event): """获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件""" <|body_0|> def update_status(cls, operator_type, shop, e...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class ShopFSM: """商户有限状态机""" def get_next_state(cls, operator_type, current_status, event): """获取下一状态 :param operator_type: 'OUTSIDE'/'FE_INSIDE' :param current_status: 当前状态 :param event: 条件 :return: 如果返回None表示错误状态或条件""" fsm = cls.FSM[operator_type] next_state_info = fsm.get((current_st...
the_stack_v2_python_sparse
Dispatcher/data_and_service/shop/model_logics/fsm.py
cash2one/Logistics
train
0
5a72f648c91433466e9fcaeca14595ef16a158db
[ "super(FSSD, self).__init__(p, alpha)\nself.k = k\nself.V = V\nself.null_sim = null_sim", "alpha = self.alpha\nnull_sim = self.null_sim\nn_simulate = null_sim.n_simulate\nn = X.shape[0]\nJ = self.V.shape[0]\nnfssd, fea_tensor = self.statistic(X, return_feature_tensor=True)\nsim_results = null_sim.simulate(self, X...
<|body_start_0|> super(FSSD, self).__init__(p, alpha) self.k = k self.V = V self.null_sim = null_sim <|end_body_0|> <|body_start_1|> alpha = self.alpha null_sim = self.null_sim n_simulate = null_sim.n_simulate n = X.shape[0] J = self.V.shape[0] ...
Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H1` : the sample does not follow :math:`p` :math:`p` is specified to the...
FSSD
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class FSSD: """Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H1` : the sample does not follow :math:`...
stack_v2_sparse_classes_36k_train_034869
16,140
permissive
[ { "docstring": "Parameters ---------- p : an instance of UnnormalizedDensity k : a DifferentiableKernel object V : J x dx numpy array of J locations to test the difference null_sim : an instance of H0Simulator for simulating from the null distribution. alpha : significance level", "name": "__init__", "s...
5
stack_v2_sparse_classes_30k_train_009099
Implement the Python class `FSSD` described below. Class description: Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H...
Implement the Python class `FSSD` described below. Class description: Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H...
9e7fc39f215a7f2b9174ab02bcf71a36067d7e19
<|skeleton|> class FSSD: """Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H1` : the sample does not follow :math:`...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class FSSD: """Goodness-of-fit test using The Finite Set Stein Discrepancy statistic. and a set of paired test locations. The statistic is n*FSSD^2. The statistic can be negative because of the unbiased estimator. :math:`H0` : the sample follows :math:`p` :math:`H1` : the sample does not follow :math:`p` :math:`p` ...
the_stack_v2_python_sparse
hyppo/kgof/fssd.py
neurodata/hyppo
train
186
0ab52e6d5942aa0bb88658c59359233b6d7a637f
[ "if context is None:\n context = {}\nres = super(stock_inventory_merge, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False)\nif context.get('active_model', '') == 'stock.inventory' and len(context['active_ids']) < 2:\n raise osv.except_osv(_('W...
<|body_start_0|> if context is None: context = {} res = super(stock_inventory_merge, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=False) if context.get('active_model', '') == 'stock.inventory' and len(context['active_i...
stock_inventory_merge
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class stock_inventory_merge: def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """Changes the view dynamically @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param conte...
stack_v2_sparse_classes_36k_train_034870
3,791
no_license
[ { "docstring": "Changes the view dynamically @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return: New arch of view.", "name": "fields_view_get", "signature": "def fields_view_get(self, cr, uid, view_id...
2
stack_v2_sparse_classes_30k_train_011108
Implement the Python class `stock_inventory_merge` described below. Class description: Implement the stock_inventory_merge class. Method signatures and docstrings: - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): Changes the view dynamically @param self...
Implement the Python class `stock_inventory_merge` described below. Class description: Implement the stock_inventory_merge class. Method signatures and docstrings: - def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): Changes the view dynamically @param self...
e6b06ea17fa44e35e3c99a83c6f3ec433c33c894
<|skeleton|> class stock_inventory_merge: def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """Changes the view dynamically @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param conte...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class stock_inventory_merge: def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """Changes the view dynamically @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard...
the_stack_v2_python_sparse
stock/wizard/stock_inventory_merge.py
rvalyi/openerp-addons
train
2
9b433925de3a69053df70c4fa8beb9a285498806
[ "super().__init__(api, coordinator, name, dev_id, sensor)\nself._cooling_state = False\nself._heating_state = False", "data = self._api.get_device_data(self._dev_id)\nif not data:\n _LOGGER.error('Received no data for device %s', self._entity_name)\n self.async_write_ha_state()\n return\nif data.get('hea...
<|body_start_0|> super().__init__(api, coordinator, name, dev_id, sensor) self._cooling_state = False self._heating_state = False <|end_body_0|> <|body_start_1|> data = self._api.get_device_data(self._dev_id) if not data: _LOGGER.error('Received no data for device %s...
Auxiliary Device Sensors.
PwAuxDeviceSensor
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PwAuxDeviceSensor: """Auxiliary Device Sensors.""" def __init__(self, api, coordinator, name, dev_id, sensor): """Set up the Plugwise API.""" <|body_0|> def _async_process_data(self): """Update the entity.""" <|body_1|> <|end_skeleton|> <|body_start_0|>...
stack_v2_sparse_classes_36k_train_034871
11,153
permissive
[ { "docstring": "Set up the Plugwise API.", "name": "__init__", "signature": "def __init__(self, api, coordinator, name, dev_id, sensor)" }, { "docstring": "Update the entity.", "name": "_async_process_data", "signature": "def _async_process_data(self)" } ]
2
null
Implement the Python class `PwAuxDeviceSensor` described below. Class description: Auxiliary Device Sensors. Method signatures and docstrings: - def __init__(self, api, coordinator, name, dev_id, sensor): Set up the Plugwise API. - def _async_process_data(self): Update the entity.
Implement the Python class `PwAuxDeviceSensor` described below. Class description: Auxiliary Device Sensors. Method signatures and docstrings: - def __init__(self, api, coordinator, name, dev_id, sensor): Set up the Plugwise API. - def _async_process_data(self): Update the entity. <|skeleton|> class PwAuxDeviceSenso...
2fee32fce03bc49e86cf2e7b741a15621a97cce5
<|skeleton|> class PwAuxDeviceSensor: """Auxiliary Device Sensors.""" def __init__(self, api, coordinator, name, dev_id, sensor): """Set up the Plugwise API.""" <|body_0|> def _async_process_data(self): """Update the entity.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PwAuxDeviceSensor: """Auxiliary Device Sensors.""" def __init__(self, api, coordinator, name, dev_id, sensor): """Set up the Plugwise API.""" super().__init__(api, coordinator, name, dev_id, sensor) self._cooling_state = False self._heating_state = False def _async_pr...
the_stack_v2_python_sparse
homeassistant/components/plugwise/sensor.py
BenWoodford/home-assistant
train
11
0ae6229273ce5fbbde426a7c5fcdd788f95e287c
[ "self.factory = RequestFactory()\nself.user = User.objects.create(username='Abdullah', email='abd@gmail.com', password=\"Abdullah's passwd\")\nself.trip = Trip.objects.create(title='Summer Break', passenger=self.user, arrive_at='BOS', terminal='G')", "get_request = self.factory.get('trips/2/')\nresponse = TripDet...
<|body_start_0|> self.factory = RequestFactory() self.user = User.objects.create(username='Abdullah', email='abd@gmail.com', password="Abdullah's passwd") self.trip = Trip.objects.create(title='Summer Break', passenger=self.user, arrive_at='BOS', terminal='G') <|end_body_0|> <|body_start_1|> ...
Tests for the TripDetail view.
TripDetailTests
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TripDetailTests: """Tests for the TripDetail view.""" def setUp(self): """Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns: None""" <|body_0|> def test_get_details_fo...
stack_v2_sparse_classes_36k_train_034872
10,206
permissive
[ { "docstring": "Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns: None", "name": "setUp", "signature": "def setUp(self)" }, { "docstring": "A user sees instructions for a Trip on its details ...
2
stack_v2_sparse_classes_30k_train_011113
Implement the Python class `TripDetailTests` described below. Class description: Tests for the TripDetail view. Method signatures and docstrings: - def setUp(self): Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns...
Implement the Python class `TripDetailTests` described below. Class description: Tests for the TripDetail view. Method signatures and docstrings: - def setUp(self): Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns...
65d933c64a3bf830f51ac237f5781ddfb69f342c
<|skeleton|> class TripDetailTests: """Tests for the TripDetail view.""" def setUp(self): """Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns: None""" <|body_0|> def test_get_details_fo...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TripDetailTests: """Tests for the TripDetail view.""" def setUp(self): """Instantiate RequestFactory, Trip, and User objects to pass requests to the TripDetail view. Parameters: self(TripDetailTests): the calling object Returns: None""" self.factory = RequestFactory() self.user = ...
the_stack_v2_python_sparse
travelly/trips/tests.py
UPstartDeveloper/fiercely-souvenir
train
0
c3a8c7f4e389872df9d951fe78ea39b5b5daa9a1
[ "self.surface = surface\nself.pos = pos\nself.color = color\nself.params = params\nself.radius, self.start_angle, self.stop_angle, self.width, self.speed = params\nself.framecount = 0\nself._draw()", "step = math.pi / 180\ndirection = 1\nif self.stop_angle < self.start_angle:\n direction = -1\ninner = []\noute...
<|body_start_0|> self.surface = surface self.pos = pos self.color = color self.params = params self.radius, self.start_angle, self.stop_angle, self.width, self.speed = params self.framecount = 0 self._draw() <|end_body_0|> <|body_start_1|> step = math.pi ...
Draw Superformula Object, most basic form static drawing
Arc
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Arc: """Draw Superformula Object, most basic form static drawing""" def __init__(self, surface: pygame.Surface, pos: pygame.Vector2, color: tuple, params: list): """a particle in 2D space :param dim: dimensio of surface to draw on :param pos: position to set particle, center of parti...
stack_v2_sparse_classes_36k_train_034873
5,052
no_license
[ { "docstring": "a particle in 2D space :param dim: dimensio of surface to draw on :param pos: position to set particle, center of particle :param size: size of particle :param color: color of particle :param width of circle arc", "name": "__init__", "signature": "def __init__(self, surface: pygame.Surfa...
3
null
Implement the Python class `Arc` described below. Class description: Draw Superformula Object, most basic form static drawing Method signatures and docstrings: - def __init__(self, surface: pygame.Surface, pos: pygame.Vector2, color: tuple, params: list): a particle in 2D space :param dim: dimensio of surface to draw...
Implement the Python class `Arc` described below. Class description: Draw Superformula Object, most basic form static drawing Method signatures and docstrings: - def __init__(self, surface: pygame.Surface, pos: pygame.Vector2, color: tuple, params: list): a particle in 2D space :param dim: dimensio of surface to draw...
1fd421195a2888c0588a49f5a043a1110eedcdbf
<|skeleton|> class Arc: """Draw Superformula Object, most basic form static drawing""" def __init__(self, surface: pygame.Surface, pos: pygame.Vector2, color: tuple, params: list): """a particle in 2D space :param dim: dimensio of surface to draw on :param pos: position to set particle, center of parti...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Arc: """Draw Superformula Object, most basic form static drawing""" def __init__(self, surface: pygame.Surface, pos: pygame.Vector2, color: tuple, params: list): """a particle in 2D space :param dim: dimensio of surface to draw on :param pos: position to set particle, center of particle :param si...
the_stack_v2_python_sparse
effects/CircleArcs.py
gunny26/pygame
train
5
2dbfc183a5864f6724f23a69cc44bc9a53a2156b
[ "res = {}\nfor rec in self:\n reserv_bed = 0\n for bed_line in rec.room_id.bed_ids:\n if bed_line.employee_id and bed_line.employee_id.emp_country_id.id and (rec.nationality_id.id == bed_line.employee_id.emp_country_id.id):\n reserv_bed += 1\n res[rec.id] = rec.number_of_quota - reserv_be...
<|body_start_0|> res = {} for rec in self: reserv_bed = 0 for bed_line in rec.room_id.bed_ids: if bed_line.employee_id and bed_line.employee_id.emp_country_id.id and (rec.nationality_id.id == bed_line.employee_id.emp_country_id.id): reserv_bed ...
visa_quota
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class visa_quota: def get_quota_available(self): """This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records set @multi : The decorator of multi""" <|body_0|> def unlink(self): """This me...
stack_v2_sparse_classes_36k_train_034874
24,603
no_license
[ { "docstring": "This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records set @multi : The decorator of multi", "name": "get_quota_available", "signature": "def get_quota_available(self)" }, { "docstring": "This...
3
stack_v2_sparse_classes_30k_train_015908
Implement the Python class `visa_quota` described below. Class description: Implement the visa_quota class. Method signatures and docstrings: - def get_quota_available(self): This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records ...
Implement the Python class `visa_quota` described below. Class description: Implement the visa_quota class. Method signatures and docstrings: - def get_quota_available(self): This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records ...
46e15330b5d642053da61754247f3fbf9d02717e
<|skeleton|> class visa_quota: def get_quota_available(self): """This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records set @multi : The decorator of multi""" <|body_0|> def unlink(self): """This me...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class visa_quota: def get_quota_available(self): """This method used to get total calculate of quota available ------------------------------------------------------------- @param self : Records set @multi : The decorator of multi""" res = {} for rec in self: reserv_bed = 0 ...
the_stack_v2_python_sparse
core/sg_accommodation/models/accommodation_agreement.py
Muhammad-SF/Test
train
0
e79a3e633f9654584bce9620cfc53c2815f63442
[ "super().__init__()\nself.generator = generator_cls(latent_dim=latent_dim, img_shape=img_shape)\nself.discriminator = discriminator_cls(latent_dim=latent_dim)\nself._latent_dim = latent_dim", "results_gen = self.generator(x)\nz = torch.randn_like(results_gen['encoded'])\nreturn {**results_gen, 'discr_encoded': se...
<|body_start_0|> super().__init__() self.generator = generator_cls(latent_dim=latent_dim, img_shape=img_shape) self.discriminator = discriminator_cls(latent_dim=latent_dim) self._latent_dim = latent_dim <|end_body_0|> <|body_start_1|> results_gen = self.generator(x) z = ...
Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variational inference by matching the aggregated posterior of the hidden code vector of the autoencoder...
AdversarialAutoEncoderPyTorch
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class AdversarialAutoEncoderPyTorch: """Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variational inference by matching the aggregat...
stack_v2_sparse_classes_36k_train_034875
4,295
permissive
[ { "docstring": "Parameters ---------- latent_dim : int the size of the autoencoders latend dimension img_shape : tuple the shape of the input/output image generator_cls : a class implementing the actual generator model (consisting of encoder and decoder) discriminator_cls : a class implementing the actual discr...
2
stack_v2_sparse_classes_30k_train_005550
Implement the Python class `AdversarialAutoEncoderPyTorch` described below. Class description: Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variati...
Implement the Python class `AdversarialAutoEncoderPyTorch` described below. Class description: Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variati...
1078f5030b8aac2bf022daf5fa14d66f74c3c893
<|skeleton|> class AdversarialAutoEncoderPyTorch: """Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variational inference by matching the aggregat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class AdversarialAutoEncoderPyTorch: """Class implementing the Combined Adversarial Autoencoder and it's behavior during training. An adversarial autoencoder is basically aprobabilistic autoencoder that uses generative adversarial networks (GAN) to perform variational inference by matching the aggregated posterior ...
the_stack_v2_python_sparse
dlutils/models/gans/adversarial_autoencoder/aae.py
justusschock/dl-utils
train
15
604302862d9d71679915f730cb6233360bbd34a0
[ "self._C = desc.C\nself._stem_multi = desc.stem_multi\nself.C_curr = self._stem_multi * self._C\nself.data_format = desc.data_format", "x = tf.layers.conv2d(x, self.C_curr, 3, padding='same', use_bias=False, data_format=self.data_format)\nx = tf.layers.batch_normalization(x, axis=1 if self.data_format == 'channel...
<|body_start_0|> self._C = desc.C self._stem_multi = desc.stem_multi self.C_curr = self._stem_multi * self._C self.data_format = desc.data_format <|end_body_0|> <|body_start_1|> x = tf.layers.conv2d(x, self.C_curr, 3, padding='same', use_bias=False, data_format=self.data_format)...
Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config
PreOneStem
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class PreOneStem: """Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config""" def __init__(self, desc): """Init PreOneStem.""" <|body_0|> def __call__(self, x, training): """Forward function of PreOneStem.""" <|body_1|> <|end...
stack_v2_sparse_classes_36k_train_034876
9,137
permissive
[ { "docstring": "Init PreOneStem.", "name": "__init__", "signature": "def __init__(self, desc)" }, { "docstring": "Forward function of PreOneStem.", "name": "__call__", "signature": "def __call__(self, x, training)" } ]
2
null
Implement the Python class `PreOneStem` described below. Class description: Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config Method signatures and docstrings: - def __init__(self, desc): Init PreOneStem. - def __call__(self, x, training): Forward function of PreOneStem.
Implement the Python class `PreOneStem` described below. Class description: Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config Method signatures and docstrings: - def __init__(self, desc): Init PreOneStem. - def __call__(self, x, training): Forward function of PreOneStem. <|skel...
df51ed9c1d6dbde1deef63f2a037a369f8554406
<|skeleton|> class PreOneStem: """Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config""" def __init__(self, desc): """Init PreOneStem.""" <|body_0|> def __call__(self, x, training): """Forward function of PreOneStem.""" <|body_1|> <|end...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class PreOneStem: """Class of one stem convolution. :param desc: description of PreOneStem :type desc: Config""" def __init__(self, desc): """Init PreOneStem.""" self._C = desc.C self._stem_multi = desc.stem_multi self.C_curr = self._stem_multi * self._C self.data_format...
the_stack_v2_python_sparse
built-in/TensorFlow/Official/cv/image_classification/ResnetVariant_for_TensorFlow/automl/vega/search_space/networks/tensorflow/blocks/darts_ops.py
Huawei-Ascend/modelzoo
train
1
42097f4703baab088a3861b4e08e7c127354508c
[ "super().__init__()\nself.model_cfg = model_cfg\nself.num_heights = grid_size[-1]\nself.num_bev_features = self.model_cfg.NUM_BEV_FEATURES\nself.block = BasicBlock2D(in_channels=self.num_bev_features * self.num_heights, out_channels=self.num_bev_features, **self.model_cfg.ARGS)", "voxel_features = batch_dict['vox...
<|body_start_0|> super().__init__() self.model_cfg = model_cfg self.num_heights = grid_size[-1] self.num_bev_features = self.model_cfg.NUM_BEV_FEATURES self.block = BasicBlock2D(in_channels=self.num_bev_features * self.num_heights, out_channels=self.num_bev_features, **self.model...
Conv2DCollapse
[ "Apache-2.0", "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Conv2DCollapse: def __init__(self, model_cfg, grid_size): """Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid size""" <|body_0|> def forward(self, batch_dict): """Collapses voxel features to BEV...
stack_v2_sparse_classes_36k_train_034877
1,451
permissive
[ { "docstring": "Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid size", "name": "__init__", "signature": "def __init__(self, model_cfg, grid_size)" }, { "docstring": "Collapses voxel features to BEV via concatenation and ch...
2
null
Implement the Python class `Conv2DCollapse` described below. Class description: Implement the Conv2DCollapse class. Method signatures and docstrings: - def __init__(self, model_cfg, grid_size): Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid si...
Implement the Python class `Conv2DCollapse` described below. Class description: Implement the Conv2DCollapse class. Method signatures and docstrings: - def __init__(self, model_cfg, grid_size): Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid si...
249d4a3122b4a52556fa124ff0411182b9cbede3
<|skeleton|> class Conv2DCollapse: def __init__(self, model_cfg, grid_size): """Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid size""" <|body_0|> def forward(self, batch_dict): """Collapses voxel features to BEV...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Conv2DCollapse: def __init__(self, model_cfg, grid_size): """Initializes 2D convolution collapse module Args: model_cfg: EasyDict, Model configuration grid_size: (X, Y, Z) Voxel grid size""" super().__init__() self.model_cfg = model_cfg self.num_heights = grid_size[-1] ...
the_stack_v2_python_sparse
src/site_model/src/LidCamFusion/OpenPCDet/pcdet/models/backbones_2d/map_to_bev/conv2d_collapse.py
OrangeSodahub/CRLFnet
train
63
ddc2789d2459299c4f6c6be9ade9c56644d87a52
[ "if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0):\n raise Exception('server_ip和server_port必须同时指定')\nself._server_ip = server_ip\nself._server_port = server_port\nself._service_name = service_name\nself._host = host", "headers = {'org': org, 'user': user}\nroute_name = ''\nserv...
<|body_start_0|> if server_ip == '' and server_port != 0 or (server_ip != '' and server_port == 0): raise Exception('server_ip和server_port必须同时指定') self._server_ip = server_ip self._server_port = server_port self._service_name = service_name self._host = host <|end_bod...
DeployClient
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DeployClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和servic...
stack_v2_sparse_classes_36k_train_034878
7,561
permissive
[ { "docstring": "初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,server_ip优先级更高 :param host: 指定sdk请求服务的host名称, 如cmdb.easyops-only.com", "name": "__ini...
5
stack_v2_sparse_classes_30k_train_019126
Implement the Python class `DeployClient` described below. Class description: Implement the DeployClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_por...
Implement the Python class `DeployClient` described below. Class description: Implement the DeployClient class. Method signatures and docstrings: - def __init__(self, server_ip='', server_port=0, service_name='', host=''): 初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_por...
adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0
<|skeleton|> class DeployClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和servic...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DeployClient: def __init__(self, server_ip='', server_port=0, service_name='', host=''): """初始化client :param server_ip: 指定sdk请求的server_ip,为空时走名字服务路由 :param server_port: 指定sdk请求的server_port,与server_ip一起使用, 为空时走名字服务路由 :param service_name: 指定sdk请求的service_name, 为空时按契约名称路由。如果server_ip和service_name同时设置,ser...
the_stack_v2_python_sparse
easy_flow_sdk/api/deploy/deploy_client.py
easyopsapis/easyops-api-python
train
5
9e0b10800f3d82a285e57d3bb85e378c8470ed99
[ "with tempfile.TemporaryDirectory() as tmp_dir:\n repo_manager.RepoManager('https://github.com/curl/curl.git', tmp_dir)\n repo_manager.RepoManager('https://github.com/weinrank/usrsctp', tmp_dir)\n repo_manager.RepoManager('https://github.com/ntop/nDPI.git', tmp_dir)\n repo_manager.RepoManager('https://g...
<|body_start_0|> with tempfile.TemporaryDirectory() as tmp_dir: repo_manager.RepoManager('https://github.com/curl/curl.git', tmp_dir) repo_manager.RepoManager('https://github.com/weinrank/usrsctp', tmp_dir) repo_manager.RepoManager('https://github.com/ntop/nDPI.git', tmp_dir)...
Class to test the functionality of the detect_repo module.
DetectRepoTest
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DetectRepoTest: """Class to test the functionality of the detect_repo module.""" def test_infer_main_repo(self): """Tests that the main repo can be inferred based on an example commit.""" <|body_0|> def test_infer_main_repo_from_name(self): """Tests that the main...
stack_v2_sparse_classes_36k_train_034879
5,500
permissive
[ { "docstring": "Tests that the main repo can be inferred based on an example commit.", "name": "test_infer_main_repo", "signature": "def test_infer_main_repo(self)" }, { "docstring": "Tests that the main project repo can be inferred from a repo name.", "name": "test_infer_main_repo_from_name...
4
stack_v2_sparse_classes_30k_train_000808
Implement the Python class `DetectRepoTest` described below. Class description: Class to test the functionality of the detect_repo module. Method signatures and docstrings: - def test_infer_main_repo(self): Tests that the main repo can be inferred based on an example commit. - def test_infer_main_repo_from_name(self)...
Implement the Python class `DetectRepoTest` described below. Class description: Class to test the functionality of the detect_repo module. Method signatures and docstrings: - def test_infer_main_repo(self): Tests that the main repo can be inferred based on an example commit. - def test_infer_main_repo_from_name(self)...
8e2d57684bd49355b80572592c3af5cefc19a69c
<|skeleton|> class DetectRepoTest: """Class to test the functionality of the detect_repo module.""" def test_infer_main_repo(self): """Tests that the main repo can be inferred based on an example commit.""" <|body_0|> def test_infer_main_repo_from_name(self): """Tests that the main...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DetectRepoTest: """Class to test the functionality of the detect_repo module.""" def test_infer_main_repo(self): """Tests that the main repo can be inferred based on an example commit.""" with tempfile.TemporaryDirectory() as tmp_dir: repo_manager.RepoManager('https://github.c...
the_stack_v2_python_sparse
infra/base-images/base-builder/detect_repo_test.py
DeepInThought/oss-fuzz
train
2
a1102c9acca3fb04c1aea59fb682fc4e5d40d8df
[ "user = self.request.user\nqueryset = Notification.objects.filter(recipient=user).order_by('-date_created')\nreturn queryset", "context = super().get_context_data(**kwargs)\nunread_notifications = []\ncurrent_page_notifications = list(context['object_list'])\nfor notification in current_page_notifications:\n i...
<|body_start_0|> user = self.request.user queryset = Notification.objects.filter(recipient=user).order_by('-date_created') return queryset <|end_body_0|> <|body_start_1|> context = super().get_context_data(**kwargs) unread_notifications = [] current_page_notifications = ...
User notifications dashboard
NotificationListView
[ "ISC" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NotificationListView: """User notifications dashboard""" def get_queryset(self): """Only notifications where the user is recipient are available""" <|body_0|> def get_context_data(self, **kwargs): """Notifications are marked as read when the list page is displaye...
stack_v2_sparse_classes_36k_train_034880
3,613
permissive
[ { "docstring": "Only notifications where the user is recipient are available", "name": "get_queryset", "signature": "def get_queryset(self)" }, { "docstring": "Notifications are marked as read when the list page is displayed", "name": "get_context_data", "signature": "def get_context_dat...
2
null
Implement the Python class `NotificationListView` described below. Class description: User notifications dashboard Method signatures and docstrings: - def get_queryset(self): Only notifications where the user is recipient are available - def get_context_data(self, **kwargs): Notifications are marked as read when the ...
Implement the Python class `NotificationListView` described below. Class description: User notifications dashboard Method signatures and docstrings: - def get_queryset(self): Only notifications where the user is recipient are available - def get_context_data(self, **kwargs): Notifications are marked as read when the ...
af9f6e6e8b1918363793fbf291f3518ef1454169
<|skeleton|> class NotificationListView: """User notifications dashboard""" def get_queryset(self): """Only notifications where the user is recipient are available""" <|body_0|> def get_context_data(self, **kwargs): """Notifications are marked as read when the list page is displaye...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NotificationListView: """User notifications dashboard""" def get_queryset(self): """Only notifications where the user is recipient are available""" user = self.request.user queryset = Notification.objects.filter(recipient=user).order_by('-date_created') return queryset ...
the_stack_v2_python_sparse
src/notifications/views.py
MTES-MCT/aides-territoires
train
21
dc0f266dabf1b03b53175019a50a547c21b45be5
[ "if current_user in self.event.participants:\n return jsonify({'status': 200, 'message': 'You are registered as a participant'})\nelif current_user in self.event.guests:\n return jsonify({'status': 200, 'message': 'You are registered as a guest'})\nelse:\n return jsonify({'status': 200, 'message': 'You are...
<|body_start_0|> if current_user in self.event.participants: return jsonify({'status': 200, 'message': 'You are registered as a participant'}) elif current_user in self.event.guests: return jsonify({'status': 200, 'message': 'You are registered as a guest'}) else: ...
Resource for registering and unregistering as a participant fo event
UserAsParticipant
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class UserAsParticipant: """Resource for registering and unregistering as a participant fo event""" def get(self, event_id: int) -> Response: """Method for checking registration as a participant Parameters ---------- event_id : int Event id Returns ------- Response Response message with st...
stack_v2_sparse_classes_36k_train_034881
7,636
no_license
[ { "docstring": "Method for checking registration as a participant Parameters ---------- event_id : int Event id Returns ------- Response Response message with status code", "name": "get", "signature": "def get(self, event_id: int) -> Response" }, { "docstring": "Method for registering as a parti...
3
stack_v2_sparse_classes_30k_train_021261
Implement the Python class `UserAsParticipant` described below. Class description: Resource for registering and unregistering as a participant fo event Method signatures and docstrings: - def get(self, event_id: int) -> Response: Method for checking registration as a participant Parameters ---------- event_id : int E...
Implement the Python class `UserAsParticipant` described below. Class description: Resource for registering and unregistering as a participant fo event Method signatures and docstrings: - def get(self, event_id: int) -> Response: Method for checking registration as a participant Parameters ---------- event_id : int E...
51e4d69f88c120cfc587fd007f21528a7bd661a0
<|skeleton|> class UserAsParticipant: """Resource for registering and unregistering as a participant fo event""" def get(self, event_id: int) -> Response: """Method for checking registration as a participant Parameters ---------- event_id : int Event id Returns ------- Response Response message with st...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class UserAsParticipant: """Resource for registering and unregistering as a participant fo event""" def get(self, event_id: int) -> Response: """Method for checking registration as a participant Parameters ---------- event_id : int Event id Returns ------- Response Response message with status code""" ...
the_stack_v2_python_sparse
flask_app/resources/participant.py
Kyrylo-Kotelevets/Flask_Events
train
0
93bd7b80fd6d3b9ff3a63926277619aadf7f8bc8
[ "super().__init__(sensitivity, initial_x, initial_y, lives, game_width, game_height, None, bullet_grp, debug)\nself.delta_x = self.sensitivity\nself.delta_y = self.sensitivity // 2\nself.set_points(100 * lives)", "if self.touch_edge():\n self.delta_x = -self.delta_x\n if self.delta_x > 0:\n self.imag...
<|body_start_0|> super().__init__(sensitivity, initial_x, initial_y, lives, game_width, game_height, None, bullet_grp, debug) self.delta_x = self.sensitivity self.delta_y = self.sensitivity // 2 self.set_points(100 * lives) <|end_body_0|> <|body_start_1|> if self.touch_edge(): ...
Scout
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Scout: def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool): """Main class for the scout ship""" <|body_0|> def update(self) -> None: """Overridden update class for the scout boss...
stack_v2_sparse_classes_36k_train_034882
1,459
permissive
[ { "docstring": "Main class for the scout ship", "name": "__init__", "signature": "def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool)" }, { "docstring": "Overridden update class for the scout boss", "nam...
2
stack_v2_sparse_classes_30k_train_006099
Implement the Python class `Scout` described below. Class description: Implement the Scout class. Method signatures and docstrings: - def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool): Main class for the scout ship - def update...
Implement the Python class `Scout` described below. Class description: Implement the Scout class. Method signatures and docstrings: - def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool): Main class for the scout ship - def update...
6f8f2da4fd26ef1d77c0c6183230c3a5e6bf0bb9
<|skeleton|> class Scout: def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool): """Main class for the scout ship""" <|body_0|> def update(self) -> None: """Overridden update class for the scout boss...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Scout: def __init__(self, sensitivity: int, initial_x: int, initial_y: int, lives: int, game_width: int, game_height: int, bullet_grp, debug: bool): """Main class for the scout ship""" super().__init__(sensitivity, initial_x, initial_y, lives, game_width, game_height, None, bullet_grp, debug) ...
the_stack_v2_python_sparse
gym_invaders/gym_game/envs/classes/Game/Sprites/Scout.py
Jh123x/Orbital
train
4
1a24651b2c711492f6dd3e6a6596b57059001220
[ "self.leads, self.times, count = ([], times, {})\nlead = -1\nfor p, t in zip(persons, times):\n count[p] = count.get(p, 0) + 1\n if count.get(lead, 0) <= count[p]:\n lead = p\n self.leads.append(lead)", "l, r = (0, len(self.times) - 1)\nwhile l <= r:\n mid = (l + r) // 2\n if self.times[mid]...
<|body_start_0|> self.leads, self.times, count = ([], times, {}) lead = -1 for p, t in zip(persons, times): count[p] = count.get(p, 0) + 1 if count.get(lead, 0) <= count[p]: lead = p self.leads.append(lead) <|end_body_0|> <|body_start_1|> ...
TopVotedCandidate
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.leads, self.times, count = ([], ...
stack_v2_sparse_classes_36k_train_034883
1,680
no_license
[ { "docstring": ":type persons: List[int] :type times: List[int]", "name": "__init__", "signature": "def __init__(self, persons, times)" }, { "docstring": ":type t: int :rtype: int", "name": "q", "signature": "def q(self, t)" } ]
2
stack_v2_sparse_classes_30k_test_000300
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int
Implement the Python class `TopVotedCandidate` described below. Class description: Implement the TopVotedCandidate class. Method signatures and docstrings: - def __init__(self, persons, times): :type persons: List[int] :type times: List[int] - def q(self, t): :type t: int :rtype: int <|skeleton|> class TopVotedCandi...
035ef08434fa1ca781a6fb2f9eed3538b7d20c02
<|skeleton|> class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" <|body_0|> def q(self, t): """:type t: int :rtype: int""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TopVotedCandidate: def __init__(self, persons, times): """:type persons: List[int] :type times: List[int]""" self.leads, self.times, count = ([], times, {}) lead = -1 for p, t in zip(persons, times): count[p] = count.get(p, 0) + 1 if count.get(lead, 0) <...
the_stack_v2_python_sparse
leetcode_python/Binary_Search/online-election.py
yennanliu/CS_basics
train
64
046468ce32fbe7984b5a3f4b70cb3474ad576586
[ "mobile_ = attrs.get('mobile')\nsms_code_ = attrs.get('sms_code')\npassword_ = attrs.get('password')\nopenid_ = attrs.get('openid')\nopenid_ = check_encrypted_openid(openid_)\nif not openid_:\n raise serializers.ValidationError({'message': '无效的openid'})\nredis_conn = get_redis_connection('sms_codes')\nreal_sms_c...
<|body_start_0|> mobile_ = attrs.get('mobile') sms_code_ = attrs.get('sms_code') password_ = attrs.get('password') openid_ = attrs.get('openid') openid_ = check_encrypted_openid(openid_) if not openid_: raise serializers.ValidationError({'message': '无效的openid'...
QQ登录创建用户序列化器
QQUserSerializer
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class QQUserSerializer: """QQ登录创建用户序列化器""" def validate(self, attrs): """校验 :param attrs: 反序列化数据 :return:""" <|body_0|> def create(self, validated_data): """创建记录 :param validated_data: 校验后数据 :return:""" <|body_1|> <|end_skeleton|> <|body_start_0|> mob...
stack_v2_sparse_classes_36k_train_034884
3,079
no_license
[ { "docstring": "校验 :param attrs: 反序列化数据 :return:", "name": "validate", "signature": "def validate(self, attrs)" }, { "docstring": "创建记录 :param validated_data: 校验后数据 :return:", "name": "create", "signature": "def create(self, validated_data)" } ]
2
stack_v2_sparse_classes_30k_train_005873
Implement the Python class `QQUserSerializer` described below. Class description: QQ登录创建用户序列化器 Method signatures and docstrings: - def validate(self, attrs): 校验 :param attrs: 反序列化数据 :return: - def create(self, validated_data): 创建记录 :param validated_data: 校验后数据 :return:
Implement the Python class `QQUserSerializer` described below. Class description: QQ登录创建用户序列化器 Method signatures and docstrings: - def validate(self, attrs): 校验 :param attrs: 反序列化数据 :return: - def create(self, validated_data): 创建记录 :param validated_data: 校验后数据 :return: <|skeleton|> class QQUserSerializer: """QQ登...
c841e7d1aa0616b070b10924f44b2c418f222cd8
<|skeleton|> class QQUserSerializer: """QQ登录创建用户序列化器""" def validate(self, attrs): """校验 :param attrs: 反序列化数据 :return:""" <|body_0|> def create(self, validated_data): """创建记录 :param validated_data: 校验后数据 :return:""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class QQUserSerializer: """QQ登录创建用户序列化器""" def validate(self, attrs): """校验 :param attrs: 反序列化数据 :return:""" mobile_ = attrs.get('mobile') sms_code_ = attrs.get('sms_code') password_ = attrs.get('password') openid_ = attrs.get('openid') openid_ = check_encrypted_...
the_stack_v2_python_sparse
meiduo_mall/meiduo_mall/apps/oauth/serializers.py
Echo-xie/meiduo_mall
train
0
3cf1996c512d8f3da3a5622bcca33848d0a93395
[ "def invert(node):\n node.left, node.right = (node.right, node.left)\n if node.left:\n invert(node.left)\n if node.right:\n invert(node.right)\ninvert(root)\nreturn root", "def invert(node) -> TreeNode:\n node_copy = TreeNode(node.val)\n if node.left:\n node_copy.right = invert...
<|body_start_0|> def invert(node): node.left, node.right = (node.right, node.left) if node.left: invert(node.left) if node.right: invert(node.right) invert(root) return root <|end_body_0|> <|body_start_1|> def invert(no...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def invertTree_v1(self, root: TreeNode) -> TreeNode: """Invert in place .""" <|body_0|> def invertTree_v2(self, root: TreeNode) -> TreeNode: """Clone and invert.""" <|body_1|> <|end_skeleton|> <|body_start_0|> def invert(node): ...
stack_v2_sparse_classes_36k_train_034885
2,223
no_license
[ { "docstring": "Invert in place .", "name": "invertTree_v1", "signature": "def invertTree_v1(self, root: TreeNode) -> TreeNode" }, { "docstring": "Clone and invert.", "name": "invertTree_v2", "signature": "def invertTree_v2(self, root: TreeNode) -> TreeNode" } ]
2
stack_v2_sparse_classes_30k_train_001721
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def invertTree_v1(self, root: TreeNode) -> TreeNode: Invert in place . - def invertTree_v2(self, root: TreeNode) -> TreeNode: Clone and invert.
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def invertTree_v1(self, root: TreeNode) -> TreeNode: Invert in place . - def invertTree_v2(self, root: TreeNode) -> TreeNode: Clone and invert. <|skeleton|> class Solution: ...
97a2386f5e3adbd7138fd123810c3232bdf7f622
<|skeleton|> class Solution: def invertTree_v1(self, root: TreeNode) -> TreeNode: """Invert in place .""" <|body_0|> def invertTree_v2(self, root: TreeNode) -> TreeNode: """Clone and invert.""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def invertTree_v1(self, root: TreeNode) -> TreeNode: """Invert in place .""" def invert(node): node.left, node.right = (node.right, node.left) if node.left: invert(node.left) if node.right: invert(node.right) ...
the_stack_v2_python_sparse
python3/trees_and_graphs/invert_tree.py
victorchu/algorithms
train
0
69891e9fdce4619a4a9b093225cf7c8fd9c063a5
[ "self.producers = list()\nif isinstance(columns, list) or isinstance(columns, tuple):\n self.is_unary = is_unary if is_unary is not None else False\n for c in columns:\n self.producers.append(to_column_eval(c))\nelif is_unary is not None and (not is_unary):\n raise TypeError('cannot call ternary con...
<|body_start_0|> self.producers = list() if isinstance(columns, list) or isinstance(columns, tuple): self.is_unary = is_unary if is_unary is not None else False for c in columns: self.producers.append(to_column_eval(c)) elif is_unary is not None and (not i...
Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values from a single column and ternary evaluation functions that extract value...
Eval
[ "BSD-3-Clause" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Eval: """Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values from a single column and ternary evaluat...
stack_v2_sparse_classes_36k_train_034886
44,356
permissive
[ { "docstring": "Create an instance of an evaluation function that extracts values from the specified columns and applies a given function (consumer) on the extracted values. The `is_unary` flag indicates if the consumer expects a single argument value or a tuple of values. Raises a TypeError if the list of inpu...
4
stack_v2_sparse_classes_30k_train_006769
Implement the Python class `Eval` described below. Class description: Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values f...
Implement the Python class `Eval` described below. Class description: Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values f...
e3d0e04f90468c49f29ca53edc2feb12465c24d5
<|skeleton|> class Eval: """Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values from a single column and ternary evaluat...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Eval: """Eval is a factory for evaluation functions that extract values from one or more columns in data frame rows and that evaluate a given function (consumer) on the extracted values. We distinguish between unary evaluation functions that extract values from a single column and ternary evaluation functions...
the_stack_v2_python_sparse
openclean/function/eval/base.py
Denisfench/openclean-core
train
0
811a8a367e47b4b81b59a9a3ce8ed44bbf87866f
[ "super(TranslatorData, self).build()\nif self.config.outlet_state_defined and self.config.has_phase_equilibrium:\n raise ConfigurationError('{} cannot calculate phase equilibrium (has_phase_equilibrium = True) when outlet state is set to be fully defined (outlet_state_defined = True).'.format(self.name))\nself.p...
<|body_start_0|> super(TranslatorData, self).build() if self.config.outlet_state_defined and self.config.has_phase_equilibrium: raise ConfigurationError('{} cannot calculate phase equilibrium (has_phase_equilibrium = True) when outlet state is set to be fully defined (outlet_state_defined = ...
Standard Translator Block Class
TranslatorData
[ "BSD-2-Clause", "LicenseRef-scancode-unknown-license-reference" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TranslatorData: """Standard Translator Block Class""" def build(self): """Begin building model. Args: None Returns: None""" <|body_0|> def initialize_build(blk, state_args_in=None, state_args_out=None, outlvl=idaeslog.NOTSET, solver=None, optarg=None): """This me...
stack_v2_sparse_classes_36k_train_034887
9,225
permissive
[ { "docstring": "Begin building model. Args: None Returns: None", "name": "build", "signature": "def build(self)" }, { "docstring": "This method calls the initialization method of the state blocks. Keyword Arguments: state_args_in : a dict of arguments to be passed to the inlet property package (...
2
null
Implement the Python class `TranslatorData` described below. Class description: Standard Translator Block Class Method signatures and docstrings: - def build(self): Begin building model. Args: None Returns: None - def initialize_build(blk, state_args_in=None, state_args_out=None, outlvl=idaeslog.NOTSET, solver=None, ...
Implement the Python class `TranslatorData` described below. Class description: Standard Translator Block Class Method signatures and docstrings: - def build(self): Begin building model. Args: None Returns: None - def initialize_build(blk, state_args_in=None, state_args_out=None, outlvl=idaeslog.NOTSET, solver=None, ...
deacf4c422bc9e50cb347e11a8cbfa0195bd4274
<|skeleton|> class TranslatorData: """Standard Translator Block Class""" def build(self): """Begin building model. Args: None Returns: None""" <|body_0|> def initialize_build(blk, state_args_in=None, state_args_out=None, outlvl=idaeslog.NOTSET, solver=None, optarg=None): """This me...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TranslatorData: """Standard Translator Block Class""" def build(self): """Begin building model. Args: None Returns: None""" super(TranslatorData, self).build() if self.config.outlet_state_defined and self.config.has_phase_equilibrium: raise ConfigurationError('{} canno...
the_stack_v2_python_sparse
idaes/models/unit_models/translator.py
IDAES/idaes-pse
train
173
711531443d0c21bcf7d27aa9deb84aa2cf48f533
[ "aliases = cls.code_aliases.copy()\naliases['yue'] = 'zh-yue'\ncls.code_aliases = aliases", "if code == 'pl':\n return ('utf-8', 'iso8859-2')\nif code == 'ru':\n return ('utf-8', 'iso8859-5')\nif code in self.latin1old:\n return ('utf-8', 'iso-8859-1')\nreturn super().encodings(code)" ]
<|body_start_0|> aliases = cls.code_aliases.copy() aliases['yue'] = 'zh-yue' cls.code_aliases = aliases <|end_body_0|> <|body_start_1|> if code == 'pl': return ('utf-8', 'iso8859-2') if code == 'ru': return ('utf-8', 'iso8859-5') if code in self.l...
Family module for Wikipedia.
Family
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Family: """Family module for Wikipedia.""" def __post_init__(cls): """Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3""" <|body_0|> def encodings(self, code): """Return a list of historical encodings for a specific site.""" <|body_1|> ...
stack_v2_sparse_classes_36k_train_034888
10,767
permissive
[ { "docstring": "Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3", "name": "__post_init__", "signature": "def __post_init__(cls)" }, { "docstring": "Return a list of historical encodings for a specific site.", "name": "encodings", "signature": "def encodings(self, code)...
2
null
Implement the Python class `Family` described below. Class description: Family module for Wikipedia. Method signatures and docstrings: - def __post_init__(cls): Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3 - def encodings(self, code): Return a list of historical encodings for a specific site.
Implement the Python class `Family` described below. Class description: Family module for Wikipedia. Method signatures and docstrings: - def __post_init__(cls): Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3 - def encodings(self, code): Return a list of historical encodings for a specific site. <...
5c01e6bfcd328bc6eae643e661f1a0ae57612808
<|skeleton|> class Family: """Family module for Wikipedia.""" def __post_init__(cls): """Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3""" <|body_0|> def encodings(self, code): """Return a list of historical encodings for a specific site.""" <|body_1|> ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Family: """Family module for Wikipedia.""" def __post_init__(cls): """Add 'yue' code alias due to :phab:`T341960`. .. versionadded:: 8.3""" aliases = cls.code_aliases.copy() aliases['yue'] = 'zh-yue' cls.code_aliases = aliases def encodings(self, code): """Ret...
the_stack_v2_python_sparse
pywikibot/families/wikipedia_family.py
wikimedia/pywikibot
train
432
2874baaa24f1c2cdafe8577cd7b68d50be0329b1
[ "items = range(15)\nall_items = set()\nfor _ in xrange(50):\n combination = random_combination(items, 5)\n all_items |= set(combination)\neq_(all_items, set(items))", "items = range(15)\nfor _ in xrange(50):\n combination = random_combination(items, len(items))\n eq_(len(combination), len(set(combinat...
<|body_start_0|> items = range(15) all_items = set() for _ in xrange(50): combination = random_combination(items, 5) all_items |= set(combination) eq_(all_items, set(items)) <|end_body_0|> <|body_start_1|> items = range(15) for _ in xrange(50): ...
Tests for ``random_combination()``
RandomCombinationTests
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class RandomCombinationTests: """Tests for ``random_combination()``""" def test_psuedorandomness(self): """ensure different subsets of the iterable get returned over many samplings of random combinations""" <|body_0|> def test_no_replacement(self): """ensure that eleme...
stack_v2_sparse_classes_36k_train_034889
47,145
no_license
[ { "docstring": "ensure different subsets of the iterable get returned over many samplings of random combinations", "name": "test_psuedorandomness", "signature": "def test_psuedorandomness(self)" }, { "docstring": "ensure that elements are sampled without replacement", "name": "test_no_replac...
2
null
Implement the Python class `RandomCombinationTests` described below. Class description: Tests for ``random_combination()`` Method signatures and docstrings: - def test_psuedorandomness(self): ensure different subsets of the iterable get returned over many samplings of random combinations - def test_no_replacement(sel...
Implement the Python class `RandomCombinationTests` described below. Class description: Tests for ``random_combination()`` Method signatures and docstrings: - def test_psuedorandomness(self): ensure different subsets of the iterable get returned over many samplings of random combinations - def test_no_replacement(sel...
0ac6653219c2701c13c508c5c4fc9bc3437eea06
<|skeleton|> class RandomCombinationTests: """Tests for ``random_combination()``""" def test_psuedorandomness(self): """ensure different subsets of the iterable get returned over many samplings of random combinations""" <|body_0|> def test_no_replacement(self): """ensure that eleme...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class RandomCombinationTests: """Tests for ``random_combination()``""" def test_psuedorandomness(self): """ensure different subsets of the iterable get returned over many samplings of random combinations""" items = range(15) all_items = set() for _ in xrange(50): com...
the_stack_v2_python_sparse
repoData/erikrose-more-itertools/allPythonContent.py
aCoffeeYin/pyreco
train
0
7a1e023fa3edb113c505014eca75c1cf85bde9ff
[ "self._pat = pat\nself._M = len(pat)\nself._miss = [0 for i in range(self._M)]\nself._dfa = collections.defaultdict(lambda: [0 for i in range(self._M)])\nself._dfa[self._pat[0]][0] = 1\nX = 0\nfor j, letter in enumerate(self._pat[1:], 1):\n for c in self._dfa.keys():\n self._dfa[c][j] = self._dfa[c][X]\n ...
<|body_start_0|> self._pat = pat self._M = len(pat) self._miss = [0 for i in range(self._M)] self._dfa = collections.defaultdict(lambda: [0 for i in range(self._M)]) self._dfa[self._pat[0]][0] = 1 X = 0 for j, letter in enumerate(self._pat[1:], 1): for...
Find and return the index of first occurance of substring
KMP
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class KMP: """Find and return the index of first occurance of substring""" def __init__(self, pat): """pre-process pattern string""" <|body_0|> def search(self, txt): """Returns the idx of the 1st occurrrence of the pattern string in the text string.""" <|body_...
stack_v2_sparse_classes_36k_train_034890
1,311
permissive
[ { "docstring": "pre-process pattern string", "name": "__init__", "signature": "def __init__(self, pat)" }, { "docstring": "Returns the idx of the 1st occurrrence of the pattern string in the text string.", "name": "search", "signature": "def search(self, txt)" } ]
2
null
Implement the Python class `KMP` described below. Class description: Find and return the index of first occurance of substring Method signatures and docstrings: - def __init__(self, pat): pre-process pattern string - def search(self, txt): Returns the idx of the 1st occurrrence of the pattern string in the text strin...
Implement the Python class `KMP` described below. Class description: Find and return the index of first occurance of substring Method signatures and docstrings: - def __init__(self, pat): pre-process pattern string - def search(self, txt): Returns the idx of the 1st occurrrence of the pattern string in the text strin...
6878fe4cad7daf7067014029d7aae303ad4c1182
<|skeleton|> class KMP: """Find and return the index of first occurance of substring""" def __init__(self, pat): """pre-process pattern string""" <|body_0|> def search(self, txt): """Returns the idx of the 1st occurrrence of the pattern string in the text string.""" <|body_...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class KMP: """Find and return the index of first occurance of substring""" def __init__(self, pat): """pre-process pattern string""" self._pat = pat self._M = len(pat) self._miss = [0 for i in range(self._M)] self._dfa = collections.defaultdict(lambda: [0 for i in range(...
the_stack_v2_python_sparse
ds/KMP.py
comicxmz001/LeetCode
train
2
f8a8c0ae49a906382844e3bf70f9c24985b78624
[ "ts = TopologicalSorter()\nfor cur, pre in prerequisites:\n ts.add(cur, pre)\ntry:\n ts.prepare()\n return True\nexcept CycleError:\n return False", "adjList = [[] for _ in range(numCourses)]\ndeg = [0] * numCourses\nfor cur, pre in prerequisites:\n adjList[pre].append(cur)\n deg[cur] += 1\nretu...
<|body_start_0|> ts = TopologicalSorter() for cur, pre in prerequisites: ts.add(cur, pre) try: ts.prepare() return True except CycleError: return False <|end_body_0|> <|body_start_1|> adjList = [[] for _ in range(numCourses)] ...
Solution
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class Solution: def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool: """有向图是否无环""" <|body_0|> def canFinish2(self, numCourses: int, prerequisites: list[list[int]]) -> bool: """有向图是否无环""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_034891
1,875
no_license
[ { "docstring": "有向图是否无环", "name": "canFinish", "signature": "def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool" }, { "docstring": "有向图是否无环", "name": "canFinish2", "signature": "def canFinish2(self, numCourses: int, prerequisites: list[list[int]]) -> bool" } ]
2
stack_v2_sparse_classes_30k_train_012280
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool: 有向图是否无环 - def canFinish2(self, numCourses: int, prerequisites: list[list[int]]) -> bool: 有向图是否无环
Implement the Python class `Solution` described below. Class description: Implement the Solution class. Method signatures and docstrings: - def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool: 有向图是否无环 - def canFinish2(self, numCourses: int, prerequisites: list[list[int]]) -> bool: 有向图是否无环 <|...
7e79e26bb8f641868561b186e34c1127ed63c9e0
<|skeleton|> class Solution: def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool: """有向图是否无环""" <|body_0|> def canFinish2(self, numCourses: int, prerequisites: list[list[int]]) -> bool: """有向图是否无环""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class Solution: def canFinish(self, numCourses: int, prerequisites: list[list[int]]) -> bool: """有向图是否无环""" ts = TopologicalSorter() for cur, pre in prerequisites: ts.add(cur, pre) try: ts.prepare() return True except CycleError: ...
the_stack_v2_python_sparse
7_graph/拓扑排序/课程表/207. 课程表拓扑排序调库.py
981377660LMT/algorithm-study
train
225
17918a3867b2c5f682070d9f9b862cdfc75b799b
[ "if not parse_node:\n raise TypeError('parse_node cannot be null.')\nreturn DatePostRequestBody()", "from ........models.json import Json\nfrom ........models.json import Json\nfields: Dict[str, Callable[[Any], None]] = {'day': lambda n: setattr(self, 'day', n.get_object_value(Json)), 'month': lambda n: setatt...
<|body_start_0|> if not parse_node: raise TypeError('parse_node cannot be null.') return DatePostRequestBody() <|end_body_0|> <|body_start_1|> from ........models.json import Json from ........models.json import Json fields: Dict[str, Callable[[Any], None]] = {'day':...
DatePostRequestBody
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class DatePostRequestBody: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DatePostRequestBody: """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 ob...
stack_v2_sparse_classes_36k_train_034892
2,757
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: DatePostRequestBody", "name": "create_from_discriminator_value", "signature": "def create_from_discriminator...
3
stack_v2_sparse_classes_30k_train_005721
Implement the Python class `DatePostRequestBody` described below. Class description: Implement the DatePostRequestBody class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DatePostRequestBody: Creates a new instance of the appropriate class based on d...
Implement the Python class `DatePostRequestBody` described below. Class description: Implement the DatePostRequestBody class. Method signatures and docstrings: - def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DatePostRequestBody: Creates a new instance of the appropriate class based on d...
27de7ccbe688d7614b2f6bde0fdbcda4bc5cc949
<|skeleton|> class DatePostRequestBody: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DatePostRequestBody: """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 ob...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class DatePostRequestBody: def create_from_discriminator_value(parse_node: Optional[ParseNode]=None) -> DatePostRequestBody: """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/drives/item/items/item/workbook/functions/date/date_post_request_body.py
microsoftgraph/msgraph-sdk-python
train
135
33e0c34d2b472f0ddeb3fc3179167bab7bf9bbb4
[ "self.list = []\nf = open('../names.txt')\nself.NAMES = f.read().splitlines()\nf.close()\nself.FAMILY = ['JAMES', 'JOHN', 'ROBERT', 'MICHAEL', 'WILLIAM', 'DAVID', 'RICHARD', 'CHARLES', 'JOSEPH', 'THOMAS', 'CHRISTOPHER', 'DANIEL', 'PAUL', 'MARK', 'DONALD', 'GEORGE', 'KENNETH', 'STEVEN', 'EDWARD', 'BRIAN', 'RONALD', ...
<|body_start_0|> self.list = [] f = open('../names.txt') self.NAMES = f.read().splitlines() f.close() self.FAMILY = ['JAMES', 'JOHN', 'ROBERT', 'MICHAEL', 'WILLIAM', 'DAVID', 'RICHARD', 'CHARLES', 'JOSEPH', 'THOMAS', 'CHRISTOPHER', 'DANIEL', 'PAUL', 'MARK', 'DONALD', 'GEORGE', 'K...
NamesGenerator
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class NamesGenerator: def __init__(self): """GENERATE NAMES""" <|body_0|> def gerenate(self): """RETURN A LIST FULL OF VALID STRING NAMES :return: list of strings""" <|body_1|> <|end_skeleton|> <|body_start_0|> self.list = [] f = open('../names.tx...
stack_v2_sparse_classes_36k_train_034893
4,951
no_license
[ { "docstring": "GENERATE NAMES", "name": "__init__", "signature": "def __init__(self)" }, { "docstring": "RETURN A LIST FULL OF VALID STRING NAMES :return: list of strings", "name": "gerenate", "signature": "def gerenate(self)" } ]
2
stack_v2_sparse_classes_30k_train_008683
Implement the Python class `NamesGenerator` described below. Class description: Implement the NamesGenerator class. Method signatures and docstrings: - def __init__(self): GENERATE NAMES - def gerenate(self): RETURN A LIST FULL OF VALID STRING NAMES :return: list of strings
Implement the Python class `NamesGenerator` described below. Class description: Implement the NamesGenerator class. Method signatures and docstrings: - def __init__(self): GENERATE NAMES - def gerenate(self): RETURN A LIST FULL OF VALID STRING NAMES :return: list of strings <|skeleton|> class NamesGenerator: de...
382323c5ae1b919dcc59212e4a0036d9fe845d9d
<|skeleton|> class NamesGenerator: def __init__(self): """GENERATE NAMES""" <|body_0|> def gerenate(self): """RETURN A LIST FULL OF VALID STRING NAMES :return: list of strings""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class NamesGenerator: def __init__(self): """GENERATE NAMES""" self.list = [] f = open('../names.txt') self.NAMES = f.read().splitlines() f.close() self.FAMILY = ['JAMES', 'JOHN', 'ROBERT', 'MICHAEL', 'WILLIAM', 'DAVID', 'RICHARD', 'CHARLES', 'JOSEPH', 'THOMAS', 'CHRI...
the_stack_v2_python_sparse
Semester 1/FP/W7/Project/Generators/Names.py
cinnamonbreakfast/uni_implementations
train
0
4184af7a9550194a650379a96a557656b4750b63
[ "if not email:\n raise ValueError('The Email must be set')\nemail = self.normalize_email(email)\nif not check_ncsu_email(email):\n raise ValueError('Please use NCSU Email Id!')\nuser = self.model(email=email, **extra_fields)\nuser.set_password(password)\nuser.save()\nreturn user", "extra_fields.setdefault('...
<|body_start_0|> if not email: raise ValueError('The Email must be set') email = self.normalize_email(email) if not check_ncsu_email(email): raise ValueError('Please use NCSU Email Id!') user = self.model(email=email, **extra_fields) user.set_password(pass...
Custom user model manager where email is the unique identifiers for authentication instead of usernames.
CustomUserManager
[ "MIT" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Create and save a User with the given email and password.""" <|body_0|> def create...
stack_v2_sparse_classes_36k_train_034894
2,595
permissive
[ { "docstring": "Create and save a User with the given email and password.", "name": "create_user", "signature": "def create_user(self, email, password, **extra_fields)" }, { "docstring": "Create and save a SuperUser with the given email and password.", "name": "create_superuser", "signat...
2
stack_v2_sparse_classes_30k_train_006699
Implement the Python class `CustomUserManager` described below. Class description: Custom user model manager where email is the unique identifiers for authentication instead of usernames. Method signatures and docstrings: - def create_user(self, email, password, **extra_fields): Create and save a User with the given ...
Implement the Python class `CustomUserManager` described below. Class description: Custom user model manager where email is the unique identifiers for authentication instead of usernames. Method signatures and docstrings: - def create_user(self, email, password, **extra_fields): Create and save a User with the given ...
c40b5f642577926e01dbc5d95d4abdf2a08bdbb5
<|skeleton|> class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Create and save a User with the given email and password.""" <|body_0|> def create...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class CustomUserManager: """Custom user model manager where email is the unique identifiers for authentication instead of usernames.""" def create_user(self, email, password, **extra_fields): """Create and save a User with the given email and password.""" if not email: raise ValueEr...
the_stack_v2_python_sparse
src/base/managers.py
Nikhil1912/FindMyRoomie_2.0
train
1
70cbf1143f0f4852d037371a0e7f0bab4791dc81
[ "self.prefix = ''\nself.trie = TrieNode()\nfor word in words:\n cur_node = self.trie\n word = word[::-1]\n for char in word:\n cur_node = cur_node.dict[char]\n cur_node.is_word = True", "self.prefix += letter\ncur_node = self.trie\nfor char in reversed(self.prefix):\n if char not in cur_node...
<|body_start_0|> self.prefix = '' self.trie = TrieNode() for word in words: cur_node = self.trie word = word[::-1] for char in word: cur_node = cur_node.dict[char] cur_node.is_word = True <|end_body_0|> <|body_start_1|> sel...
StreamChecker
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class StreamChecker: def __init__(self, words: List[str]): """Build a trie for each word in reversed order""" <|body_0|> def query(self, letter: str) -> bool: """Search user input in trie with reversed order""" <|body_1|> <|end_skeleton|> <|body_start_0|> ...
stack_v2_sparse_classes_36k_train_034895
1,299
no_license
[ { "docstring": "Build a trie for each word in reversed order", "name": "__init__", "signature": "def __init__(self, words: List[str])" }, { "docstring": "Search user input in trie with reversed order", "name": "query", "signature": "def query(self, letter: str) -> bool" } ]
2
stack_v2_sparse_classes_30k_train_017679
Implement the Python class `StreamChecker` described below. Class description: Implement the StreamChecker class. Method signatures and docstrings: - def __init__(self, words: List[str]): Build a trie for each word in reversed order - def query(self, letter: str) -> bool: Search user input in trie with reversed order
Implement the Python class `StreamChecker` described below. Class description: Implement the StreamChecker class. Method signatures and docstrings: - def __init__(self, words: List[str]): Build a trie for each word in reversed order - def query(self, letter: str) -> bool: Search user input in trie with reversed order...
875a7de772b8923518abb5e98e5a068456e6b2ee
<|skeleton|> class StreamChecker: def __init__(self, words: List[str]): """Build a trie for each word in reversed order""" <|body_0|> def query(self, letter: str) -> bool: """Search user input in trie with reversed order""" <|body_1|> <|end_skeleton|>
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class StreamChecker: def __init__(self, words: List[str]): """Build a trie for each word in reversed order""" self.prefix = '' self.trie = TrieNode() for word in words: cur_node = self.trie word = word[::-1] for char in word: cur_no...
the_stack_v2_python_sparse
streamOfCharacters_1.py
zenithude/Python-Leetcode
train
0
4167d038012875409bfb0b38c3dfb21ed523bccc
[ "if context is None:\n context = {}\nif view_type == 'tree':\n view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'stock.location.tree2')])\n if context.get('product_id', ''):\n view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'stock.location.tree')])\n view_...
<|body_start_0|> if context is None: context = {} if view_type == 'tree': view_id = self.pool.get('ir.ui.view').search(cr, uid, [('name', '=', 'stock.location.tree2')]) if context.get('product_id', ''): view_id = self.pool.get('ir.ui.view').search(cr, ...
stock_location
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class stock_location: def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): """Changes the view dynamically @return: New arch of view.""" <|body_0|> def name_get(self, cr, uid, ids, context=None): """Inherit fuction ...
stack_v2_sparse_classes_36k_train_034896
27,204
no_license
[ { "docstring": "Changes the view dynamically @return: New arch of view.", "name": "fields_view_get", "signature": "def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False)" }, { "docstring": "Inherit fuction to return name (not full hierarchic...
2
stack_v2_sparse_classes_30k_test_000693
Implement the Python class `stock_location` described below. Class description: Implement the stock_location class. Method signatures and docstrings: - def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): Changes the view dynamically @return: New arch of view....
Implement the Python class `stock_location` described below. Class description: Implement the stock_location class. Method signatures and docstrings: - def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): Changes the view dynamically @return: New arch of view....
0b997095c260d58b026440967fea3a202bef7efb
<|skeleton|> class stock_location: def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): """Changes the view dynamically @return: New arch of view.""" <|body_0|> def name_get(self, cr, uid, ids, context=None): """Inherit fuction ...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class stock_location: def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): """Changes the view dynamically @return: New arch of view.""" if context is None: context = {} if view_type == 'tree': view_id = self.p...
the_stack_v2_python_sparse
v_7/Dongola/common/stock_multi_company/stock.py
musabahmed/baba
train
0
46a2d580ef6af9d05a5015cf5439162ec2245ea9
[ "super().__init__(device, device_manager)\nself.entity_description = description\nself._attr_unique_id = f'{super().unique_id}{description.key}'\nif (int_type := self.find_dpcode(description.key, dptype=DPType.INTEGER, prefer_function=True)):\n self._number = int_type\n self._attr_native_max_value = self._num...
<|body_start_0|> super().__init__(device, device_manager) self.entity_description = description self._attr_unique_id = f'{super().unique_id}{description.key}' if (int_type := self.find_dpcode(description.key, dptype=DPType.INTEGER, prefer_function=True)): self._number = int_t...
Tuya Number Entity.
TuyaNumberEntity
[ "Apache-2.0" ]
stack_v2_sparse_python_classes_v1
<|skeleton|> class TuyaNumberEntity: """Tuya Number Entity.""" def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None: """Init Tuya sensor.""" <|body_0|> def native_value(self) -> float | None: """Return the entity va...
stack_v2_sparse_classes_36k_train_034897
15,310
permissive
[ { "docstring": "Init Tuya sensor.", "name": "__init__", "signature": "def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None" }, { "docstring": "Return the entity value to represent the entity state.", "name": "native_value", ...
3
null
Implement the Python class `TuyaNumberEntity` described below. Class description: Tuya Number Entity. Method signatures and docstrings: - def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None: Init Tuya sensor. - def native_value(self) -> float | None:...
Implement the Python class `TuyaNumberEntity` described below. Class description: Tuya Number Entity. Method signatures and docstrings: - def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None: Init Tuya sensor. - def native_value(self) -> float | None:...
80caeafcb5b6e2f9da192d0ea6dd1a5b8244b743
<|skeleton|> class TuyaNumberEntity: """Tuya Number Entity.""" def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None: """Init Tuya sensor.""" <|body_0|> def native_value(self) -> float | None: """Return the entity va...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class TuyaNumberEntity: """Tuya Number Entity.""" def __init__(self, device: TuyaDevice, device_manager: TuyaDeviceManager, description: NumberEntityDescription) -> None: """Init Tuya sensor.""" super().__init__(device, device_manager) self.entity_description = description self....
the_stack_v2_python_sparse
homeassistant/components/tuya/number.py
home-assistant/core
train
35,501
4763735b4fa68861caa792a99561d755cb471917
[ "with tf.variable_scope(scope) as scope:\n if not reuse_variables:\n W = tf.get_variable('W_conv', weight_shape, tf.float32, tf.random_normal_initializer(0.0, stddev), trainable=trainable)\n b = tf.get_variable('b_conv', weight_shape[-1], tf.float32, tf.constant_initializer(0.1), trainable=trainabl...
<|body_start_0|> with tf.variable_scope(scope) as scope: if not reuse_variables: W = tf.get_variable('W_conv', weight_shape, tf.float32, tf.random_normal_initializer(0.0, stddev), trainable=trainable) b = tf.get_variable('b_conv', weight_shape[-1], tf.float32, tf.cons...
graph_construction_helper
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class graph_construction_helper: def conv(self, x, weight_shape, scope, stddev=0.1, trainable=True, reuse_variables=False): """x should be the 4d tensor which is being convolved weight shape should be a list of the form [Kernel Width, Kernel Width, input channels, output channels] scope should...
stack_v2_sparse_classes_36k_train_034898
13,931
no_license
[ { "docstring": "x should be the 4d tensor which is being convolved weight shape should be a list of the form [Kernel Width, Kernel Width, input channels, output channels] scope should be string specifying the scope of the variables in question", "name": "conv", "signature": "def conv(self, x, weight_sha...
3
null
Implement the Python class `graph_construction_helper` described below. Class description: Implement the graph_construction_helper class. Method signatures and docstrings: - def conv(self, x, weight_shape, scope, stddev=0.1, trainable=True, reuse_variables=False): x should be the 4d tensor which is being convolved we...
Implement the Python class `graph_construction_helper` described below. Class description: Implement the graph_construction_helper class. Method signatures and docstrings: - def conv(self, x, weight_shape, scope, stddev=0.1, trainable=True, reuse_variables=False): x should be the 4d tensor which is being convolved we...
cbea8bd086c4b1b97c263cef91a9ea5db74b5fb5
<|skeleton|> class graph_construction_helper: def conv(self, x, weight_shape, scope, stddev=0.1, trainable=True, reuse_variables=False): """x should be the 4d tensor which is being convolved weight shape should be a list of the form [Kernel Width, Kernel Width, input channels, output channels] scope should...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class graph_construction_helper: def conv(self, x, weight_shape, scope, stddev=0.1, trainable=True, reuse_variables=False): """x should be the 4d tensor which is being convolved weight shape should be a list of the form [Kernel Width, Kernel Width, input channels, output channels] scope should be string spe...
the_stack_v2_python_sparse
my_tf_util.py
shay93/Motor-Represenations
train
0
67cae395decd2f28d9dd7f4305297142fa716c20
[ "num_dens_mean = {}\nnum_dens_std = {}\nfor key in HOD_params['tracer_flags'].keys():\n if HOD_params['tracer_flags'][key]:\n num_dens_mean[key] = data_params['tracer_density_mean'][key]\n num_dens_std[key] = data_params['tracer_density_std'][key]\nself.num_dens_mean = num_dens_mean\nself.num_dens_...
<|body_start_0|> num_dens_mean = {} num_dens_std = {} for key in HOD_params['tracer_flags'].keys(): if HOD_params['tracer_flags'][key]: num_dens_mean[key] = data_params['tracer_density_mean'][key] num_dens_std[key] = data_params['tracer_density_std'][k...
Dummy object for calculating a likelihood
xirppi_Data
[]
stack_v2_sparse_python_classes_v1
<|skeleton|> class xirppi_Data: """Dummy object for calculating a likelihood""" def __init__(self, data_params, HOD_params): """Constructor of the power spectrum data""" <|body_0|> def compute_likelihood(self, theory_clustering, theory_density): """Computes the likelihood using inf...
stack_v2_sparse_classes_36k_train_034899
5,451
no_license
[ { "docstring": "Constructor of the power spectrum data", "name": "__init__", "signature": "def __init__(self, data_params, HOD_params)" }, { "docstring": "Computes the likelihood using information from the context", "name": "compute_likelihood", "signature": "def compute_likelihood(self,...
2
stack_v2_sparse_classes_30k_train_000340
Implement the Python class `xirppi_Data` described below. Class description: Dummy object for calculating a likelihood Method signatures and docstrings: - def __init__(self, data_params, HOD_params): Constructor of the power spectrum data - def compute_likelihood(self, theory_clustering, theory_density): Computes the...
Implement the Python class `xirppi_Data` described below. Class description: Dummy object for calculating a likelihood Method signatures and docstrings: - def __init__(self, data_params, HOD_params): Constructor of the power spectrum data - def compute_likelihood(self, theory_clustering, theory_density): Computes the...
1323009ee34c4a9111b52a4810d8e9d0b0bc62ee
<|skeleton|> class xirppi_Data: """Dummy object for calculating a likelihood""" def __init__(self, data_params, HOD_params): """Constructor of the power spectrum data""" <|body_0|> def compute_likelihood(self, theory_clustering, theory_density): """Computes the likelihood using inf...
stack_v2_sparse_classes_36k
data/stack_v2_sparse_classes_30k
class xirppi_Data: """Dummy object for calculating a likelihood""" def __init__(self, data_params, HOD_params): """Constructor of the power spectrum data""" num_dens_mean = {} num_dens_std = {} for key in HOD_params['tracer_flags'].keys(): if HOD_params['tracer_flags...
the_stack_v2_python_sparse
likelihood_lowz.py
SandyYuan/BOSSfits
train
0