text
stringlengths
232
16.3k
domain
stringclasses
1 value
difficulty
stringclasses
3 values
meta
dict
<|fim_suffix|> __version_name__ += " [%s]" % versionMeta if versionMeta else "" except ImportError: # Not generated by package.sh pass<|fim_prefix|># repo: spiricn/DevUtils path: /du/__init__.py __version__ = "1.11.0" __version_name__ = __version__ try: from du.VersionMeta import versionName...
code_fim
medium
{ "lang": "python", "repo": "spiricn/DevUtils", "path": "/du/__init__.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_export_svg_fallbackFont(self): expectedPath = os.path.join(testDataDir, "expected_svgSaveFallback.svg") drawBot.newDrawing() drawBot.newPage(100, 100) drawBot.fallbackFont("Courier") drawBot.font("Times") drawBot.text("a", (10, 10)) with...
code_fim
hard
{ "lang": "python", "repo": "typemytype/drawbot", "path": "/tests/testExport.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: typemytype/drawbot path: /tests/testExport.py AndReturnSize(self, extension, **options): with TempFile(suffix=extension) as tmp: drawBot.saveImage(tmp.path, **options) fileSize = os.stat(tmp.path).st_size return fileSize def test_with_drawing(self): ...
code_fim
hard
{ "lang": "python", "repo": "typemytype/drawbot", "path": "/tests/testExport.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: typemytype/drawbot path: /tests/testExport.py ): drawBot.newDrawing() self.assertEqual(drawBot.pageCount(), 0) with drawBot.drawing(): for i in range(10): drawBot.newPage() drawBot.rect(10, 10, 10, 10) self.assertEqua...
code_fim
hard
{ "lang": "python", "repo": "typemytype/drawbot", "path": "/tests/testExport.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> return [ { 'id': fields.cpe_norm('cpe23', cpe23.attrib['name']), 'prod': fields.cpe_norm('cpe23', cpe23.getparent().attrib['name']), } for cpe23 in root.iter('{*}cpe23-item') ] def to_dict(self) -> dict: retur...
code_fim
hard
{ "lang": "python", "repo": "esedeerre/patton", "path": "/patton/dal/product/models.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> __tablename__ = 'prod_reference' id = Column(String, primary_key=True, default=fields.uuid) prod_id = Column(String, ForeignKey('prod.id')) href = Column(String) description = Column(String) def loader_map(root): return [ { 'id': fields.uuid(), ...
code_fim
hard
{ "lang": "python", "repo": "esedeerre/patton", "path": "/patton/dal/product/models.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: esedeerre/patton path: /patton/dal/product/models.py from sqlalchemy import Column, String, ForeignKey from sqlalchemy.orm import relationship from patton.dal.database import Base from . import fields class Prod(Base): __tablename__ = 'prod' id = Column(String, primary_key=True) ti...
code_fim
hard
{ "lang": "python", "repo": "esedeerre/patton", "path": "/patton/dal/product/models.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: gnibeil/pygrace path: /PyGrace/Extensions/latex_string.py CONVERT = { r'$\pm$': r'\f{Symbol}\c1\C\f{}', r'$\aleph$': r'\f{Symbol}\c@\C\f{}', r'$\ge$': r'\f{Symbol}\c3\C\f{}', r'$\le$': r'\f{Symbol}\c#\C\f{}', r'$\propto$': r'\f{Symbol}\c5\C\f{}', r'$\in$': r'\f{Symbol}\cN\...
code_fim
hard
{ "lang": "python", "repo": "gnibeil/pygrace", "path": "/PyGrace/Extensions/latex_string.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> result = self for (latex, grace) in SORTED_CONVERT: result = result.replace(latex, grace) return result def __add__(self,other): return str(self) + other def __radd__(self,other): return other + str(self) if __name__ == '__main__': s = La...
code_fim
hard
{ "lang": "python", "repo": "gnibeil/pygrace", "path": "/PyGrace/Extensions/latex_string.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: bhuvi3/camera_trap_animal_classification path: /code/generate_mask_weights.py import os import numpy as np import tensorflow as tf def save_weights_resnet152_10channel(): # Initialize configuration required_input_shape = (7, 7, 10, 64) output_file_prefix = "resnet152_10channel" ...
code_fim
hard
{ "lang": "python", "repo": "bhuvi3/camera_trap_animal_classification", "path": "/code/generate_mask_weights.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> new_weights[:, :, 12:15, :] = input_layer_weights # Third image. # Mask always uses newly initialized weights. # Reassign new weights. weights[0] = new_weights # Save the new weights np.save(os.path.join("..", 'data', ...
code_fim
hard
{ "lang": "python", "repo": "bhuvi3/camera_trap_animal_classification", "path": "/code/generate_mask_weights.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: yosoyjay/ocean_data_gateway path: /ocean_data_gateway/readers/axds.py + f'[{self.kw["max_lon"]},{self.kw["max_lat"]}],' \ + f'[{self.kw["min_lon"]},{self.kw["max_lat"]}],' \ + f'[{self.kw["min_lon"]},{self....
code_fim
hard
{ "lang": "python", "repo": "yosoyjay/ocean_data_gateway", "path": "/ocean_data_gateway/readers/axds.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> slicedict = {timekey: slice(self.kw['min_time'],self.kw['max_time'])} _, index = np.unique(data[timekey], return_index=True) data = data.isel({timekey: index}).sel(slicedict) except Exception as e: logger_axds....
code_fim
hard
{ "lang": "python", "repo": "yosoyjay/ocean_data_gateway", "path": "/ocean_data_gateway/readers/axds.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> geospatial_lat_min, geospatial_lat_max = dataset['data']['min_lat'], dataset['data']['max_lat'] geospatial_lon_min, geospatial_lon_max = dataset['data']['min_lng'], dataset['data']['max_lng'] lines = \ f''' {dataset_id}: description: {label} driver: opendap args: ...
code_fim
hard
{ "lang": "python", "repo": "yosoyjay/ocean_data_gateway", "path": "/ocean_data_gateway/readers/axds.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> #outputs, _ = pad_packed_sequence(outputs, batch_first=False) #hidden = torch.tanh(self.fc(torch.cat((hidden[-1][-2,:,:], hidden[-1][-1,:,:]), dim = 1))) # returning the last state of the hidden layer return outputs, hidden class GRU_ATTENTIONDecoder(nn.Module): def __init__(self, outpu...
code_fim
hard
{ "lang": "python", "repo": "hec44/SCAN-reproduction", "path": "/models.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: hec44/SCAN-reproduction path: /models.py import random from typing import Tuple import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch import Tensor import pdb from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence class LSTMEn...
code_fim
hard
{ "lang": "python", "repo": "hec44/SCAN-reproduction", "path": "/models.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> cachedproperty = lambda func: property(cache(func)) # noqa: E731 # make the type checker believe that `cachedproperty` is a type alias of `property`, which fixes IDE type hints and autocompletion if TYPE_CHECKING: cachedproperty = property<|fim_prefix|># repo: arcticdiv/nus_tools path: /nus_tools/u...
code_fim
hard
{ "lang": "python", "repo": "arcticdiv/nus_tools", "path": "/nus_tools/utils/misc.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: arcticdiv/nus_tools path: /nus_tools/utils/misc.py import functools import itertools from typing import Callable, Iterable, Iterator, List, Dict, Any, Tuple, TypeVar, TYPE_CHECKING from .typing import TFuncAny class dotdict(Dict[str, Any]): def __getattr__(self, attr): return self....
code_fim
hard
{ "lang": "python", "repo": "arcticdiv/nus_tools", "path": "/nus_tools/utils/misc.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> return functools.lru_cache(maxsize=None)(func) # type: ignore cachedproperty = lambda func: property(cache(func)) # noqa: E731 # make the type checker believe that `cachedproperty` is a type alias of `property`, which fixes IDE type hints and autocompletion if TYPE_CHECKING: cachedproperty = p...
code_fim
hard
{ "lang": "python", "repo": "arcticdiv/nus_tools", "path": "/nus_tools/utils/misc.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> class Section(SimpleAbstract): class Meta: verbose_name = u'Раздел' verbose_name_plural = u'Разделы'<|fim_prefix|># repo: Guest007/vgid path: /apps/events/models.py # -*- coding: utf-8 -*- from django.db import models from core.models import (ParentModel, SimpleAbstract, Image, Gall...
code_fim
hard
{ "lang": "python", "repo": "Guest007/vgid", "path": "/apps/events/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Guest007/vgid path: /apps/events/models.py # -*- coding: utf-8 -*- from django.db import models from core.models import (ParentModel, SimpleAbstract, Image, Gallery, get_file_name) from django.utils.translation import ugettext, ugettext_lazy as _ from datetime import date...
code_fim
medium
{ "lang": "python", "repo": "Guest007/vgid", "path": "/apps/events/models.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>class Section(SimpleAbstract): class Meta: verbose_name = u'Раздел' verbose_name_plural = u'Разделы'<|fim_prefix|># repo: Guest007/vgid path: /apps/events/models.py # -*- coding: utf-8 -*- from django.db import models from core.models import (ParentModel, SimpleAbstract, Image, Galle...
code_fim
hard
{ "lang": "python", "repo": "Guest007/vgid", "path": "/apps/events/models.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> # 사용자가 6개의 번호를 뽑는다. user_list = user_random() print "[+] 결과: %s" % user_list global match3 global match4 global match5 global match6 match3 = 0 match4 = 0 match5 = 0 match6 = 0 # computer는 아래의 숫자만큼 번호를 다시 뽑는다. tickets_sold = 8145060 print "[+] 계산: 1...
code_fim
hard
{ "lang": "python", "repo": "5l1v3r1/lotto", "path": "/get_random_generate_number.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def calculate(): # 사용자가 6개의 번호를 뽑는다. user_list = user_random() print "[+] 결과: %s" % user_list global match3 global match4 global match5 global match6 match3 = 0 match4 = 0 match5 = 0 match6 = 0 # computer는 아래의 숫자만큼 번호를 다시 뽑는다. tickets_sold = 8145060 ...
code_fim
hard
{ "lang": "python", "repo": "5l1v3r1/lotto", "path": "/get_random_generate_number.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: 5l1v3r1/lotto path: /get_random_generate_number.py #!/usr/local/bin/python2.7 # -*- coding: utf-8 -*- __author__ = 'https://github.com/password123456/' import random import numpy as np import sys reload(sys) sys.setdefaultencoding('utf-8') import requests import urllib import urllib2 import json...
code_fim
hard
{ "lang": "python", "repo": "5l1v3r1/lotto", "path": "/get_random_generate_number.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>from tests import test_editor if __name__ == '__main__': # test_editor() # unittest.main() test_editor.TestEditor() print("run tests ")<|fim_prefix|># repo: sasujadhav1/dictionary path: /pythoncode/pyamidict/test_runner.py #!/usr/bin/env python # -*- coding: utf-8 -*- # tests/test_runner.p...
code_fim
medium
{ "lang": "python", "repo": "sasujadhav1/dictionary", "path": "/pythoncode/pyamidict/test_runner.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>"""Convenience wrapper for running tests.""" from tests import test_editor if __name__ == '__main__': # test_editor() # unittest.main() test_editor.TestEditor() print("run tests ")<|fim_prefix|># repo: sasujadhav1/dictionary path: /pythoncode/pyamidict/test_runner.py #!/usr/bin/env python...
code_fim
easy
{ "lang": "python", "repo": "sasujadhav1/dictionary", "path": "/pythoncode/pyamidict/test_runner.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: sasujadhav1/dictionary path: /pythoncode/pyamidict/test_runner.py #!/usr/bin/env python # -*- coding: utf-8 -*- # tests/test_runner.py import unittest import numpy as np <|fim_suffix|>from tests import test_editor if __name__ == '__main__': # test_editor() # unittest.main() test_edit...
code_fim
easy
{ "lang": "python", "repo": "sasujadhav1/dictionary", "path": "/pythoncode/pyamidict/test_runner.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def onZwaveMessage(self, message): self.cbLog("debug", "onZwaveMessage, message: " + str(message)) if message["content"] == "init": self.updateTime = 0 self.lastUpdateTime = time.time() # Energy - KWh cmd = {"id": self.id, ...
code_fim
hard
{ "lang": "python", "repo": "ContinuumBridge/aeotec_heavy_duty_switch", "path": "/adaptor_a.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ContinuumBridge/aeotec_heavy_duty_switch path: /adaptor_a.py #!/usr/bin/env python # zwave_power_meter_socket.py # Copyright (C) ContinuumBridge Limited, 2014 - All Rights Reserved # Unauthorized copying of this file, via any medium is strictly prohibited # Proprietary and confidential # Written ...
code_fim
hard
{ "lang": "python", "repo": "ContinuumBridge/aeotec_heavy_duty_switch", "path": "/adaptor_a.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def onAppInit(self, message): self.cbLog("debug", "onAppInit, message: " + str(message)) resp = {"name": self.name, "id": self.id, "status": "ok", "service": [{"characteristic": "energy", "interval": INTERVAL, "type": "switch"}, ...
code_fim
hard
{ "lang": "python", "repo": "ContinuumBridge/aeotec_heavy_duty_switch", "path": "/adaptor_a.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Arnapappo/Progetto-I19 path: /backend/i19_backend/backend/migrations/0003_auto_20190618_1937.py # Generated by Django 2.2.2 on 2019-06-18 19:37 from django.db import migrations, models <|fim_suffix|> operations = [ migrations.AddField( model_name='prodottoordinato', ...
code_fim
medium
{ "lang": "python", "repo": "Arnapappo/Progetto-I19", "path": "/backend/i19_backend/backend/migrations/0003_auto_20190618_1937.py", "mode": "psm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.AddField( model_name='prodottoordinato', name='id_tavolo', field=models.CharField(default=131, max_length=5), preserve_default=False, ), migrations.DeleteModel( name='Ordinazione', ), ...
code_fim
medium
{ "lang": "python", "repo": "Arnapappo/Progetto-I19", "path": "/backend/i19_backend/backend/migrations/0003_auto_20190618_1937.py", "mode": "spm", "license": "BSD-2-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: landlab/landlab path: /tests/components/pet/test_pet.py """ Unit tests for landlab.components.pet.potential_evapotranspiration_field """ import numpy as np import pytest from numpy.testing import assert_array_almost_equal (_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e0, 10e0), (0.0, 0.0)) _ARGS =...
code_fim
hard
{ "lang": "python", "repo": "landlab/landlab", "path": "/tests/components/pet/test_pet.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def test_grid_x_extent(pet): assert pet.grid.extent[1] == (_SHAPE[1] - 1) * _SPACING[1] def test_grid_y_extent(pet): assert pet.grid.extent[0] == (_SHAPE[0] - 1) * _SPACING[0] def test_field_getters(pet): for name in pet.grid["node"]: field = pet.grid["node"][name] assert ...
code_fim
hard
{ "lang": "python", "repo": "landlab/landlab", "path": "/tests/components/pet/test_pet.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: pombredanne/snuba path: /tests/migrations/test_groups.py from snuba.migrations.groups import MigrationGroup, get_group_loader <|fim_suffix|> for group in MigrationGroup: group_loader = get_group_loader(group) for migration in group_loader.get_migrations(): group_lo...
code_fim
easy
{ "lang": "python", "repo": "pombredanne/snuba", "path": "/tests/migrations/test_groups.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> for group in MigrationGroup: group_loader = get_group_loader(group) for migration in group_loader.get_migrations(): group_loader.load_migration(migration)<|fim_prefix|># repo: pombredanne/snuba path: /tests/migrations/test_groups.py from snuba.migrations.groups import Migr...
code_fim
easy
{ "lang": "python", "repo": "pombredanne/snuba", "path": "/tests/migrations/test_groups.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> if request.method == 'GET': forms = [] songs = Song.query.all() for song in songs: form = EditSongForm() form.id.data = song.id form.name.data = song.name form.artist.data = song.artist form.country.data = song.country form.length.data = song.length form.flag.data = song.count...
code_fim
medium
{ "lang": "python", "repo": "Ploddish/eurovision-webapp", "path": "/Eurovision/Eurovision/app/admin/routes.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Ploddish/eurovision-webapp path: /Eurovision/Eurovision/app/admin/routes.py from flask import render_template, request from flask_login import login_required from app.admin import bp from app.models import Song from app.admin.forms import EditSongForm <|fim_suffix|> return render_template('admin...
code_fim
medium
{ "lang": "python", "repo": "Ploddish/eurovision-webapp", "path": "/Eurovision/Eurovision/app/admin/routes.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: cattale93/pytorch_self_supervised_learning path: /Lib/Datasets/runner/cut_in_patches.py import os from Lib.Datasets.processing.utility import cut_tiles, cut_tiles_radar # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # """ A...
code_fim
hard
{ "lang": "python", "repo": "cattale93/pytorch_self_supervised_learning", "path": "/Lib/Datasets/runner/cut_in_patches.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> cut_tiles(data_orig, dest_path, '1', patch_size, max_n_bad_pix, overlapping, padding) cut_tiles_radar(data_orig, dest_path_trans, '1', patch_size, max_n_bad_pix, overlapping, padding) print(typ) print(dest_path) for i in os.listdir(dest_path): if '.' not...
code_fim
medium
{ "lang": "python", "repo": "cattale93/pytorch_self_supervised_learning", "path": "/Lib/Datasets/runner/cut_in_patches.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> try: first_number = int(input("Введите положительное целое число: ")) second_number = int(input("Введите положительное целое число: ")) if second_number == 0: raise OwnError("На ноль делить нельзя!") else: result = first_number / second_number except ValueError: print(...
code_fim
medium
{ "lang": "python", "repo": "kati-Ist/python_geekbrains", "path": "/lesson8/task2.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: kati-Ist/python_geekbrains path: /lesson8/task2.py class OwnError(Exception): def __init__(self, txt): <|fim_suffix|> try: first_number = int(input("Введите положительное целое число: ")) second_number = int(input("Введите положительное целое число: ")) if second_number == 0: ...
code_fim
medium
{ "lang": "python", "repo": "kati-Ist/python_geekbrains", "path": "/lesson8/task2.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>ride(gamestate, upgrade): newstate = gamestate return newstate<|fim_prefix|># repo: ysjin94/Slaying-the-Spire path: /curse_card.py #This is curse_card import help_function #Pride : Innate, Ate the end of turn, put a copy of this card on top of your draw pile. Exhuast <|fim_middle|># Innat...
code_fim
medium
{ "lang": "python", "repo": "ysjin94/Slaying-the-Spire", "path": "/curse_card.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ysjin94/Slaying-the-Spire path: /curse_card.py #This is curse_card import help_function #Pride : Innate, Ate the end of turn, put a copy of this card on top of your draw pile. Exhuast <|fim_suffix|>ride(gamestate, upgrade): newstate = gamestate return newstate<|fim_middle|># Innat...
code_fim
medium
{ "lang": "python", "repo": "ysjin94/Slaying-the-Spire", "path": "/curse_card.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: echr-od/ECHR-OD_process path: /tests/test_deploy.py from echr.steps.deploy import parse_server_parameters, runner class TestRunner: @staticmethod def test_params_none(): ok, params = parse_server_parameters(params_str=None) assert not ok assert params == [] ...
code_fim
hard
{ "lang": "python", "repo": "echr-od/ECHR-OD_process", "path": "/tests/test_deploy.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> rc = runner(params_str="user=foo password=bar", build="example", title='test', detach=False, force=False, update=False) assert rc == 2 @staticmethod def test_running_exception_params(): rc = runner(params_str=None, build="example", title='test', detach=False, force=False, ...
code_fim
hard
{ "lang": "python", "repo": "echr-od/ECHR-OD_process", "path": "/tests/test_deploy.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>oll[5:7] branch = branch_dict[t] return year, branch<|fim_prefix|># repo: variable17/aidns path: /app/auth/functions.py def parse(roll): branch_dict = { '00': 'CE', <|fim_middle|> '10': 'CSE', '13': 'IT', '30': 'EE', '43': 'ME' } year = '20' + ro...
code_fim
medium
{ "lang": "python", "repo": "variable17/aidns", "path": "/app/auth/functions.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: variable17/aidns path: /app/auth/functions.py def parse(roll): branch_dict = { '00': 'CE', <|fim_suffix|>oll[5:7] branch = branch_dict[t] return year, branch<|fim_middle|> '10': 'CSE', '13': 'IT', '30': 'EE', '43': 'ME' } year = '20' + ro...
code_fim
medium
{ "lang": "python", "repo": "variable17/aidns", "path": "/app/auth/functions.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>websocket_urlpatterns = [ re_path(r"ws/planning/(?P<topic_name>\w+)/$", consumers.PlanningConsumer.as_asgi()), ]<|fim_prefix|># repo: mattiaslundberg/planning_poker path: /planning/routing.py from django.urls import re_path <|fim_middle|>from . import consumers
code_fim
easy
{ "lang": "python", "repo": "mattiaslundberg/planning_poker", "path": "/planning/routing.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: mattiaslundberg/planning_poker path: /planning/routing.py from django.urls import re_path <|fim_suffix|>websocket_urlpatterns = [ re_path(r"ws/planning/(?P<topic_name>\w+)/$", consumers.PlanningConsumer.as_asgi()), ]<|fim_middle|>from . import consumers
code_fim
easy
{ "lang": "python", "repo": "mattiaslundberg/planning_poker", "path": "/planning/routing.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Aand1/vigir_behavior_synthesis path: /vigir_synthesis_manager/src/vigir_synthesis_manager/behavior_synthesis_client.py #! /usr/bin/env python import rospy import actionlib from vigir_synthesis_msgs.msg import * def behavior_synthesis_client(system, goals, initial_conditions): '''...''' ...
code_fim
hard
{ "lang": "python", "repo": "Aand1/vigir_behavior_synthesis", "path": "/vigir_synthesis_manager/src/vigir_synthesis_manager/behavior_synthesis_client.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> # Fill ot any options (all False by default). action_goal.synthesis_options = SynthesisOptions() # Send the goal to the action server. client.send_goal(action_goal) # Wait for the server to finish performing the action. client.wait_for_result() return client.get_result() if...
code_fim
hard
{ "lang": "python", "repo": "Aand1/vigir_behavior_synthesis", "path": "/vigir_synthesis_manager/src/vigir_synthesis_manager/behavior_synthesis_client.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> return { 'ua': correct_edges, 'la': correct_labels, 'total': total, 'uas': correct_edges / total, 'las': correct_labels / total }<|fim_prefix|># repo: andersjo/hals path: /hals/transition_parser/performance.py def measure_performance(sentences, parses): ...
code_fim
hard
{ "lang": "python", "repo": "andersjo/hals", "path": "/hals/transition_parser/performance.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: andersjo/hals path: /hals/transition_parser/performance.py def measure_performance(sentences, parses): correct_labels = 0 correct_edges = 0 total = 0 <|fim_suffix|> return { 'ua': correct_edges, 'la': correct_labels, 'total': total, 'uas': correct_e...
code_fim
hard
{ "lang": "python", "repo": "andersjo/hals", "path": "/hals/transition_parser/performance.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: spacekitcat/reinforcement-learning-tic-tac-toe path: /rendering/display_user_input_menu.py import qprompt def create_menu(node_list): <|fim_suffix|>def display_user_input_menu(root): menu = create_menu(root.get_children()) return menu.show(returns="desc", header=str.format("Turn {}, {} to mo...
code_fim
medium
{ "lang": "python", "repo": "spacekitcat/reinforcement-learning-tic-tac-toe", "path": "/rendering/display_user_input_menu.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> menu = create_menu(root.get_children()) return menu.show(returns="desc", header=str.format("Turn {}, {} to move", root.get_move_count(), root.get_player()))<|fim_prefix|># repo: spacekitcat/reinforcement-learning-tic-tac-toe path: /rendering/display_user_input_menu.py import qprompt def create_menu(...
code_fim
easy
{ "lang": "python", "repo": "spacekitcat/reinforcement-learning-tic-tac-toe", "path": "/rendering/display_user_input_menu.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>def display_user_input_menu(root): menu = create_menu(root.get_children()) return menu.show(returns="desc", header=str.format("Turn {}, {} to move", root.get_move_count(), root.get_player()))<|fim_prefix|># repo: spacekitcat/reinforcement-learning-tic-tac-toe path: /rendering/display_user_input_menu....
code_fim
easy
{ "lang": "python", "repo": "spacekitcat/reinforcement-learning-tic-tac-toe", "path": "/rendering/display_user_input_menu.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: gauravjain2/opennem path: /opennem/db/migrations/versions/d130be833a0c_total_demand_on_balancing_summary_per_.py # pylint: disable=no-member """ Total demand on balancing summary per region Revision ID: d130be833a0c Revises: 1057033fe1ea Create Date: 2021-01-21 16:54:01.264342 """ import sqlalc...
code_fim
medium
{ "lang": "python", "repo": "gauravjain2/opennem", "path": "/opennem/db/migrations/versions/d130be833a0c_total_demand_on_balancing_summary_per_.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def downgrade() -> None: op.drop_column("balancing_summary", "demand_total")<|fim_prefix|># repo: gauravjain2/opennem path: /opennem/db/migrations/versions/d130be833a0c_total_demand_on_balancing_summary_per_.py # pylint: disable=no-member """ Total demand on balancing summary per region <|fim_middl...
code_fim
hard
{ "lang": "python", "repo": "gauravjain2/opennem", "path": "/opennem/db/migrations/versions/d130be833a0c_total_demand_on_balancing_summary_per_.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def generate_suit(self): return self.__generate_suit() def __generate_suit(self): card_set = set(["Ace", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"]) suit_set = set() for suit_value in card_set: card_value = Card(self...
code_fim
medium
{ "lang": "python", "repo": "YazzyYaz/codinginterviews", "path": "/practice_problems/oop/deck_of_cards.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> card_set = set(["Ace", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"]) suit_set = set() for suit_value in card_set: card_value = Card(self.suit_type, suit_value) suit_set.add(card_value) return suit_set class Card(objec...
code_fim
hard
{ "lang": "python", "repo": "YazzyYaz/codinginterviews", "path": "/practice_problems/oop/deck_of_cards.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: YazzyYaz/codinginterviews path: /practice_problems/oop/deck_of_cards.py import random class Deck(object): def __init__(self, special_cards=False): self.cards = self.generate_cards() def get_cards(self): return self.cards def generate_cards(self): return sel...
code_fim
hard
{ "lang": "python", "repo": "YazzyYaz/codinginterviews", "path": "/practice_problems/oop/deck_of_cards.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sxfang32/meiduo_29 path: /meiduo_mall/meiduo_mall/apps/goods/utils.py def get_breadcrumb(cat3): """包装指定类别的面包屑""" cat1 = cat3.parent.parent # 给一级类别定义URL属性 cat1.url = cat1.goodschannel_set.all()[0].url <|fim_suffix|> 'cat2': cat3.parent, 'cat3': cat3 } return br...
code_fim
medium
{ "lang": "python", "repo": "sxfang32/meiduo_29", "path": "/meiduo_mall/meiduo_mall/apps/goods/utils.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> 'cat2': cat3.parent, 'cat3': cat3 } return breadcrumb<|fim_prefix|># repo: sxfang32/meiduo_29 path: /meiduo_mall/meiduo_mall/apps/goods/utils.py def get_breadcrumb(cat3): """包装指定类别的面包屑""" cat1 = cat3.parent.par<|fim_middle|>ent # 给一级类别定义URL属性 cat1.url = cat1.goodschan...
code_fim
medium
{ "lang": "python", "repo": "sxfang32/meiduo_29", "path": "/meiduo_mall/meiduo_mall/apps/goods/utils.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def parse_item(self, response): yield { "title": response.xpath("//div[@class='col-sm-6 product_main']/h1/text()").get(), "price": response.xpath("//p[@class='price_color']/text()").get() }<|fim_prefix|># repo: Hegelim/web_crawler path: /bookbug/bookbug/spiders...
code_fim
hard
{ "lang": "python", "repo": "Hegelim/web_crawler", "path": "/bookbug/bookbug/spiders/book.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> yield { "title": response.xpath("//div[@class='col-sm-6 product_main']/h1/text()").get(), "price": response.xpath("//p[@class='price_color']/text()").get() }<|fim_prefix|># repo: Hegelim/web_crawler path: /bookbug/bookbug/spiders/book.py import scrapy from scrapy.l...
code_fim
hard
{ "lang": "python", "repo": "Hegelim/web_crawler", "path": "/bookbug/bookbug/spiders/book.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: Hegelim/web_crawler path: /bookbug/bookbug/spiders/book.py import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import CrawlSpider, Rule <|fim_suffix|> def parse_item(self, response): yield { "title": response.xpath("//div[@class='col-sm-6 prod...
code_fim
hard
{ "lang": "python", "repo": "Hegelim/web_crawler", "path": "/bookbug/bookbug/spiders/book.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: aleph-im/py-libp2p path: /libp2p/tools/pubsub/floodsub_integration_test_settings.py # type: ignore # To add typing to this module, it's better to do it after refactoring test cases into classes import asyncio import pytest from libp2p.tools.constants import FLOODSUB_PROTOCOL_ID, LISTEN_MADDR f...
code_fim
hard
{ "lang": "python", "repo": "aleph-im/py-libp2p", "path": "/libp2p/tools/pubsub/floodsub_integration_test_settings.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> # Allow time for subscribing before continuing await asyncio.sleep(0.01) # Step 3) Publish messages topics_in_msgs_ordered = [] messages = obj["messages"] tasks_publish = [] for msg in messages: topics = msg["topics"] data = msg["data"] node_id = msg["...
code_fim
hard
{ "lang": "python", "repo": "aleph-im/py-libp2p", "path": "/libp2p/tools/pubsub/floodsub_integration_test_settings.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> tasks_topic = [] tasks_topic_data = [] for topic, node_ids in topic_map.items(): for node_id in node_ids: tasks_topic.append(pubsub_map[node_id].subscribe(topic)) tasks_topic_data.append((node_id, topic)) tasks_topic.append(asyncio.sleep(2)) # Gather is...
code_fim
hard
{ "lang": "python", "repo": "aleph-im/py-libp2p", "path": "/libp2p/tools/pubsub/floodsub_integration_test_settings.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>text = "{} + {} = {}".format(a, b, calcSum) print(text)<|fim_prefix|># repo: hamburgcodingschool/L2C-1903 path: /lesson 1/p4-text format.py # text formatting name = "Baby Joe" age = 5 greeting = "hello my name is {} and I am {} years old".format(name, age) print(greeting) <|fim_middle|>a = 7 b = 3 ...
code_fim
easy
{ "lang": "python", "repo": "hamburgcodingschool/L2C-1903", "path": "/lesson 1/p4-text format.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: hamburgcodingschool/L2C-1903 path: /lesson 1/p4-text format.py # text formatting name = "Baby Joe" age = 5 greeting = "hello my name is {} and I am {} years old".format(name, age) print(greeting) a = 7 b = 3 <|fim_suffix|>text = "{} + {} = {}".format(a, b, calcSum) print(text)<|fim_middle|>...
code_fim
easy
{ "lang": "python", "repo": "hamburgcodingschool/L2C-1903", "path": "/lesson 1/p4-text format.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|>pec=ValueSizeConstraint(1, 9))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipdcSystemType.setStatus('current') ipdcSystemID = MibScalar((1, 3, 6, 1, 4, 1, 2158, 5, 1, 2, 1, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 24))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipdc...
code_fim
hard
{ "lang": "python", "repo": "agustinhenze/mibs.snmplabs.com", "path": "/pysnmp/SALIX-MGMCP-MIB.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: agustinhenze/mibs.snmplabs.com path: /pysnmp/SALIX-MGMCP-MIB.py # # PySNMP MIB module SALIX-MGMCP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SALIX-MGMCP-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:52:14 2019 # On host DAVWANG4-M-1475 platfo...
code_fim
hard
{ "lang": "python", "repo": "agustinhenze/mibs.snmplabs.com", "path": "/pysnmp/SALIX-MGMCP-MIB.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def each_statement_in_batch_uses_proper_timestamp_test(self): """ Test that each statement will be executed with its own timestamp """ session = self.prepare() session.execute(""" BEGIN BATCH INSERT INTO users (id, firstname, lastname) VALUES (0, 'Jack',...
code_fim
hard
{ "lang": "python", "repo": "dkua/cassandra-dtest", "path": "/batch_test.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: dkua/cassandra-dtest path: /batch_test.py import time from assertions import assert_invalid, assert_unavailable from dtest import Tester from cassandra import ConsistencyLevel, Timeout from cassandra.query import SimpleStatement class TestBatch(Tester): def counter_batch_accepts_counter_mu...
code_fim
hard
{ "lang": "python", "repo": "dkua/cassandra-dtest", "path": "/batch_test.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def _test_fused_weighted_sum(test_case, shape, n, device, dtype): inputs = [np.random.randn(*shape) for _ in range(n)] init_grad = np.random.randn(*shape) weights = [random.random() for _ in range(n)] alpha = random.random() out, grads = _fused_weighted_sum(inputs, weights, alpha, ini...
code_fim
hard
{ "lang": "python", "repo": "Oneflow-Inc/oneflow", "path": "/python/oneflow/test/modules/test_fused_weighted_sum.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|>def _test_fused_weighted_sum(test_case, shape, n, device, dtype): inputs = [np.random.randn(*shape) for _ in range(n)] init_grad = np.random.randn(*shape) weights = [random.random() for _ in range(n)] alpha = random.random() out, grads = _fused_weighted_sum(inputs, weights, alpha, init...
code_fim
hard
{ "lang": "python", "repo": "Oneflow-Inc/oneflow", "path": "/python/oneflow/test/modules/test_fused_weighted_sum.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: Oneflow-Inc/oneflow path: /python/oneflow/test/modules/test_fused_weighted_sum.py """ Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of...
code_fim
hard
{ "lang": "python", "repo": "Oneflow-Inc/oneflow", "path": "/python/oneflow/test/modules/test_fused_weighted_sum.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> driver.get(url) time.sleep(2 + random.random()) drop_down = Select(driver.find_element_by_class_name("drop-down__select")) drop_down.select_by_value("newest") time.sleep(1 + random.random()) drop_down.select_by_value("newest") time.sleep(1 + random.random()) soup = Beautifu...
code_fim
hard
{ "lang": "python", "repo": "rheembranson/Web_Scraping_Customer_Reviews", "path": "/homedepot.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: rheembranson/Web_Scraping_Customer_Reviews path: /homedepot.py from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException, TimeoutException from bs4 import BeautifulSoup import tqdm import pandas as pd import re im...
code_fim
hard
{ "lang": "python", "repo": "rheembranson/Web_Scraping_Customer_Reviews", "path": "/homedepot.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: sorapon/pointnet path: /chainer_pointnet/models/kdcontextnet/kdcontextnet_seg.py import numpy import chainer from chainer import functions from chainer import links from chainer import reporter from chainer_pointnet.models.conv_block import ConvBlock from chainer_pointnet.models.kdcontextnet.kd...
code_fim
hard
{ "lang": "python", "repo": "sorapon/pointnet", "path": "/chainer_pointnet/models/kdcontextnet/kdcontextnet_seg.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> h = self.calc(x) cls_loss = functions.softmax_cross_entropy(h, t) # reporter.report({'cls_loss': cls_loss}, self) loss = cls_loss reporter.report({'loss': loss}, self) if self.compute_accuracy: acc = functions.accuracy(h, t) reporter....
code_fim
hard
{ "lang": "python", "repo": "sorapon/pointnet", "path": "/chainer_pointnet/models/kdcontextnet/kdcontextnet_seg.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def __call__(self, x, t): h = self.calc(x) cls_loss = functions.softmax_cross_entropy(h, t) # reporter.report({'cls_loss': cls_loss}, self) loss = cls_loss reporter.report({'loss': loss}, self) if self.compute_accuracy: acc = functions.accura...
code_fim
hard
{ "lang": "python", "repo": "sorapon/pointnet", "path": "/chainer_pointnet/models/kdcontextnet/kdcontextnet_seg.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: ToucanToco/peakina path: /peakina/readers/xml.py """ Module to add xml support """ from typing import Any, cast import jq import pandas as pd import xmltodict PdDatalist = list[dict[str, Any]] PdDatadict = dict[str, list[Any]] <|fim_suffix|> def read_xml( filepath: str, encoding: str =...
code_fim
hard
{ "lang": "python", "repo": "ToucanToco/peakina", "path": "/peakina/readers/xml.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|>def read_xml( filepath: str, encoding: str = "utf-8", preview_offset: int = 0, preview_nrows: int | None = None, filter: str | None = None, ) -> pd.DataFrame: data = xmltodict.parse(open(filepath).read(), encoding=encoding) if filter is not None: data = transform_with_j...
code_fim
hard
{ "lang": "python", "repo": "ToucanToco/peakina", "path": "/peakina/readers/xml.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: cash2one/xai path: /xai/brain/wordbase/adjectives/_partial.py #calss header class _PARTIAL(): def __init__(self,): <|fim_suffix|> self.parents = [] self.childen = [] self.properties = [] self.jsondata = {} self.specie = 'adjectives' def run(self, obj1, obj2): self.jsondata[obj...
code_fim
hard
{ "lang": "python", "repo": "cash2one/xai", "path": "/xai/brain/wordbase/adjectives/_partial.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: toru-ver4/sample_code path: /ty_lib/light.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # 概要 光に関するモジュール # 使い方 # references these data have been downloaded from following site. [Munsell Color Science Laboratory](https://www.rit.edu/cos/colorscience/rc_useful_data.php) """ import os im...
code_fim
hard
{ "lang": "python", "repo": "toru-ver4/sample_code", "path": "/ty_lib/light.py", "mode": "psm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_suffix|> """ # brief return (wavelength, spectrum) pair. # source Selected Colorimetric Tables(cie) http://www.cie.co.at/index.php/LEFTMENUE/DOWNLOADS """ filename = os.path.dirname(os.path.abspath(__file__))\ + os.path.normpath("/data/d65_spectrum.csv") data = np.loadt...
code_fim
hard
{ "lang": "python", "repo": "toru-ver4/sample_code", "path": "/ty_lib/light.py", "mode": "spm", "license": "BSD-3-Clause", "source": "the-stack-v2" }
<|fim_prefix|># repo: fengcolin/cloudify-netconf-plugin path: /tests/test_netconf_connection.py # Copyright (c) 2015 GigaSpaces Technologies Ltd. All rights reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a...
code_fim
hard
{ "lang": "python", "repo": "fengcolin/cloudify-netconf-plugin", "path": "/tests/test_netconf_connection.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> with mock.patch.object( paramiko, 'SSHClient', return_value=will_be_ssh ) as mock_ssh_client: with mock.patch.object( paramiko, 'AutoAddPolicy', return_value="I'm policy" ) as mock_policy: netconf = netconf_connection.conn...
code_fim
hard
{ "lang": "python", "repo": "fengcolin/cloudify-netconf-plugin", "path": "/tests/test_netconf_connection.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_suffix|> def __init__(self, d=None, **kwargs): if d is None: d = {} if kwargs: d.update(**kwargs) for k, v in d.items(): setattr(self, k, v) # Class attributes for k in self.__class__.__dict__.keys(): if not (k.startswith('...
code_fim
medium
{ "lang": "python", "repo": "intel-analytics/BigDL", "path": "/python/nano/src/bigdl/nano/automl/utils/edict.py", "mode": "spm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: intel-analytics/BigDL path: /python/nano/src/bigdl/nano/automl/utils/edict.py # # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
code_fim
medium
{ "lang": "python", "repo": "intel-analytics/BigDL", "path": "/python/nano/src/bigdl/nano/automl/utils/edict.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }
<|fim_prefix|># repo: zerolfx/eoj3 path: /account/migrations/0009_auto_20170908_1652.py # -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-09-08 16:52 from __future__ import unicode_literals from django.db import migrations, models <|fim_suffix|> dependencies = [ ('account', '0008_auto_20170827_...
code_fim
medium
{ "lang": "python", "repo": "zerolfx/eoj3", "path": "/account/migrations/0009_auto_20170908_1652.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> operations = [ migrations.AlterField( model_name='user', name='magic', field=models.CharField(blank=True, choices=[('red', 'Red'), ('green', 'Green'), ('teal', 'Teal'), ('blue', 'Blue'), ('purple', 'Purple'), ('orange', 'Orange'), ('grey', 'Grey')], max_leng...
code_fim
medium
{ "lang": "python", "repo": "zerolfx/eoj3", "path": "/account/migrations/0009_auto_20170908_1652.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> dependencies = [ ('account', '0008_auto_20170827_1517'), ] operations = [ migrations.AlterField( model_name='user', name='magic', field=models.CharField(blank=True, choices=[('red', 'Red'), ('green', 'Green'), ('teal', 'Teal'), ('blue', 'Blu...
code_fim
medium
{ "lang": "python", "repo": "zerolfx/eoj3", "path": "/account/migrations/0009_auto_20170908_1652.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: microsoftgraph/msgraph-sdk-python path: /msgraph/generated/models/delegated_admin_relationship_request.py from __future__ import annotations import datetime from dataclasses import dataclass, field from kiota_abstractions.serialization import Parsable, ParseNode, SerializationWriter from typing i...
code_fim
hard
{ "lang": "python", "repo": "microsoftgraph/msgraph-sdk-python", "path": "/msgraph/generated/models/delegated_admin_relationship_request.py", "mode": "psm", "license": "MIT", "source": "the-stack-v2" }
<|fim_suffix|> def serialize(self,writer: SerializationWriter) -> None: """ Serializes information the current object Args: writer: Serialization writer to use to serialize this model """ if not writer: raise TypeError("writer cannot be null.") ...
code_fim
hard
{ "lang": "python", "repo": "microsoftgraph/msgraph-sdk-python", "path": "/msgraph/generated/models/delegated_admin_relationship_request.py", "mode": "spm", "license": "MIT", "source": "the-stack-v2" }
<|fim_prefix|># repo: FINESCE/HybridCloudDataManagement path: /at-rest encryption/src/decrypter.py # Copyright (c) 2015, Alex Roig Dominguez, La Salle URL # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of th...
code_fim
hard
{ "lang": "python", "repo": "FINESCE/HybridCloudDataManagement", "path": "/at-rest encryption/src/decrypter.py", "mode": "psm", "license": "Apache-2.0", "source": "the-stack-v2" }