ngram listlengths 0 67.8k |
|---|
[
"███╗░░██╗██╗██╗░░██╗░█████╗░██████╗░░█████╗░██╗░░██╗███████╗ # ████╗░██║██║██║░░██║██╔══██╗██╔══██╗██╔══██╗██║░██╔╝╚════██║ # ██╔██╗██║██║███████║███████║██████╔╝██║░░██║█████═╝░░░███╔═╝ # ██║╚████║██║██╔══██║██╔══██║██╔══██╗██║░░██║██╔═██╗░██╔══╝░░ # ██║░╚███║██║██║░░██║██║░░██║██║░░██║╚█████╔╝██║░╚██╗███████╗ # ... |
[
"actual.pose, tolerance) elif type(goal) is geometry_msgs.msg.Pose: return all_close(pose_to_list(goal), pose_to_list(actual), tolerance) return True def",
"if abs(actual[index] - goal[index]) > tolerance: return False elif type(goal) is geometry_msgs.msg.PoseStamped: return",
"anonymous=True) rospy.Subscriber(... |
[
"_exec_cmd(debugger, command, capture_output=False): if capture_output: cmdretobj = lldb.SBCommandReturnObject() debugger.GetCommandInterpreter().HandleCommand(command, cmdretobj) return cmdretobj else:",
"assert 0 <= bpid <= 254 assert not vm.is_breakpoint_hit() vm.resume() time.sleep(0.100) vm.halt() assert",
... |
[
"@staticmethod def read(q: dict, *args) -> \"WriteGeneratedFilePart\": generation_id = q.get('generation_id') offset = q.get('offset')",
"*args) -> \"WriteGeneratedFilePart\": generation_id = q.get('generation_id') offset = q.get('offset') data = q.get('data') return",
"write Returns: Ok Raises: :class:`telegra... |
[
"in range(0, total - interval, interval * 2): lists[i] = self.merge2(lists[i], lists[i +",
"the current list which saves us o (N) space # to become O(1)",
"< total: for i in range(0, total - interval, interval * 2): lists[i]",
"= l1 l1 = l1.next else: cur.next = l2 l2 = l2.next cur",
"[] def merge2(self, l1... |
[
"bruteforce ## import sys import crypt import itertools def main(): # check if",
"characters aA = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\" h = sys.argv[1] # check the hash length if",
"## import sys import crypt import itertools def main(): # check if called",
"crypt.crypt(''.join(p), h) == h:... |
[
"the signal from django.dispatch import receiver from .models import Review @receiver(post_save,sender=Post) def create_review(sender,instance,created,**kwargs):",
".models import Post #reciever of the signal from django.dispatch import receiver from .models",
"#signal fired after an obj is saved in this cas wh... |
[
"Gaussian elimination \"\"\" A = deepcopy(A) A.dtype = np.float if isinstance(A, CoordinateSparseMatrix): A",
"n): Ajk = A.get(j, k) if Ajk == 0: continue for i in",
"range(k + 1, n): Aki = A.get(k, i) if Aki == 0: continue",
"of shape (n, n) :return: matrix A after Gaussian elimination \"\"\" n =",
"Coordi... |
[
"'MultiResUNet implementation in PyTorch; MultiResUNet: Rethinking the U-Net Architecture for Multimodal', author =",
"implementation in PyTorch; MultiResUNet: Rethinking the U-Net Architecture for Multimodal', author = '<NAME>',",
"in PyTorch; MultiResUNet: Rethinking the U-Net Architecture for Multimodal', au... |
[
"# Find each shade html_shades = color_group.find_all('li') shades = [] for shade in",
"foreground = foreground_color_dark if has_class(shade, 'dark') else foreground_color_light shades.append({ 'name': shade_name, 'hex': hex,",
"for color_group in color_groups: name_span = color_group.find(attrs={'class', 'nam... |
[
"__init__(self, settings): self.money = settings['money'] self.apples = settings['apples'] self.price = settings['price'] def buy_apples(self,",
"self.apples = settings['apples'] self.price = settings['price'] def buy_apples(self, num_apples): needed = calc.multiply(self.price, num_apples)",
"+= num_apples else... |
[
"in range(len(dd)): ri = dd[i] / 2 make_block_mesh(mesh, [x0, 0, 0], [d3 -",
"= 2 # slope 30 degree d3 = d1 / np.cos(theta) mesh =",
"as np # version3 slope 15 degree theta = np.pi / 12.0 #",
"d5 = d4 * np.cos(theta) d6 = d2 * np.cos(theta) d7 = 40",
"0], [d4, 0, 0], [0, 0, 8*d2]) om.write_mesh(\"coin_sorte... |
[
"consisting of 50 univariate time series of length 150. The Markov transition field",
"# Load the GunPoint dataset X, _, _, _ = load_gunpoint(return_X_y=True) # Get",
"dataset X, _, _, _ = load_gunpoint(return_X_y=True) # Get the recurrence plots for",
"probabilities for a discretized time series. Different s... |
[
"def find_match(self, known_faces, person_names, face): matches = self.get_face_matches(known_faces, face) # get a list",
"python3.5 import os import dlib import numpy as np import cv2 import time",
"cap.read() draw_frame = frame_read.copy() gray = cv2.cvtColor(frame_read, cv2.COLOR_BGR2GRAY) overlay = frame_re... |
[
"the correct choice questionText = Text(Point(500, 225), f\"rgb({colors[correctChoice][0]}, {colors[correctChoice][1]}, {colors[correctChoice][2]})\") questionText.setFill('white') questionText.setSize(25) questionText.setStyle('bold')",
"global colors global correctChoice colors = [] for i in range(4): rand_r ="... |
[
"LevelBuilder from sprites import * def render(name,bg): lb = LevelBuilder.LevelBuilder(name+\".plist\",background=bg) lb.addObject(Beam.BeamSprite(x=217, y=83,width=167,height=36,angle='90' ,restitution=0.2,static='false',friction=0.5,density=20",
"<gh_stars>0 import LevelBuilder from sprites import * def render... |
[
"#!/usr/bin/python3 import nvidia_smi import json mydict = nvidia_smi.JsonDeviceQuery() # Example print JSON print(json.dumps(mydict,",
"import nvidia_smi import json mydict = nvidia_smi.JsonDeviceQuery() # Example print JSON print(json.dumps(mydict, indent=2))"
] |
[
"updater = new_updater() self.assertEqual(updater.from_dict({'be never': self.ADD_5}), 5) self.assertFalse(updater.save_ini) def test_5_0_str(self): add = json.dumps({'be",
"self.assertEqual(updater.from_dict({'be never': self.ADD_5}), 5) self.assertFalse(updater.save_ini) def test_5_0_str(self): add = json.dumps... |
[
"import Organism class Dirt(Organism): # Default block that makes our world def __init__(self,",
"if self.currentWorld.getWorldType() == 1: self.image = pygame.image.load(os.path.join('icons', 'dirthex.jpg')) else: self.image = pygame.image.load(os.path.join('icons', 'dirt.jpg'))",
"self.image = pygame.image.lo... |
[
"distances. \"\"\" from numpy.random import randint from numpy import abs, int import pandas",
"pd.Series, target: pd.Series, answers: pd.DataFrame, answer_scale=5, answer_source=None, answer_target=None): def _maybe_random(answer: int) -> int:",
"or random - distances. \"\"\" from numpy.random import randint f... |
[
"from path (filename or directory) if it doesn't already exist. Args: path (str):",
"to_abs (bool): If True, convert the path to absolute path. If False, assume",
"deal with relative paths. \" \"Use `to_abs` if you want to explicitly convert",
"raise OSError(\"Path already exists but is not a directory! Path:... |
[
"names.discard(\"rr\") #we can use \"remove\" also for elem in names: print(elem) #To remove",
"if luke in cast: for tony in sorted(cast) : print (tony) cast =",
"cast = set([\"tony\",\"preetha\",\"luke\"]) cast.add(\"tessa\") #to get to know the hash print(hash(\"tony\")) namelist =",
"but in a list we can r... |
[
"in range(self.n_layers): encode_block = self.layers[i] x = encode_block(x) #block1 = F.dropout(self.bn1(F.elu(self.e1(input))), p=self.drop_prob) #encoded_representation",
"hidden_size, encoded_size, n_layers=3, drop_prob=0.5): super(Decoder, self).__init__() self.n_layers = n_layers self.drop_prob = drop_prob s... |
[
"= r.pipeline() for device_id in device_list: p.hdel(redis_device_key, device_id) p.execute() def update_device(self, device_id, websocket_send_data):",
"datetime.datetime.strptime(values[1], \"%Y-%m-%d %H:%M:%S.%f\") now_time = datetime.datetime.today() expire_time_delta = datetime.timedelta(seconds=device_expir... |
[
"def to(line: int, col: int) -> str: # * Move cursor to line,",
"* Restore saved cursor postion t = to r = right l =",
"left(dx: int) -> str: return \"\\033[{}D\".format(dx) @staticmethod def up(dy: int) -> str: return",
".u[p](lines) | .d[own](lines) | .save() | .restore()\"\"\" @staticmethod def to(line: in... |
[] |
[
"final_layer.append(image_layers[j][i]) break return np.array(final_layer) # Prep layers = load(image_dimensions) # First wanted_layer =",
"np image_dimensions = (25, 6) def load(image_dims, path: str = \"input/08.txt\"): with open(path)",
"stacked_layer = stack_layers(layers).reshape(image_dimensions[::-1]) fi... |
[
"class College(models.Model): name = models.CharField( max_length=255, blank=False, verbose_name='College Name' ) abbv = models.CharField(",
"models.CharField( max_length=255, blank=False, verbose_name='College Name' ) abbv = models.CharField( max_length=30, blank=False, verbose_name='Abbreviation' )",
"models.... |
[
"import SE_ResNet_18, SE_ResNet_50, SE_ResNet_101, SE_ResNet_152 class TestModelArchitectures(keras_parameterized.TestCase): def test_se_resnet_18(self): model_type = \"SE_ResNet_18\" input_shape",
"SE_ResNet_50( include_top=True, weights=None, input_shape=input_shape, classes=num_classes ) plot_model(model, to_f... |
[
"logger.info(f\"Clearing vitals delta: {delta_path}\") shutil.rmtree(delta_path, ignore_errors=True) # logger.info(f\"Creating vitals delta: {output_path}\") # delta_path",
"-> None: \"\"\" \"\"\" # TODO: Import spark_etl to Jupyter container # TODO:",
"I'm not sure how to use this. It may be that Kafka is",
... |
[
"from rest_framework.response import Response from rest_framework import status from runner.tasks import start_flow_task class",
"rest_framework import status from runner.tasks import start_flow_task class RunnerStartFlow(APIView): def post(self, request): flow_uuid",
"flow_uuid or not flow_repo_url: return Res... |
[
"reader, writer, initiator): # pylint: disable=too-many-arguments self.conn_ip = ip self.conn_port = port self.reader",
"self._next_id = 0 if initiator else 1 self.initiator = initiator async def write(self,",
"else 1 self.initiator = initiator async def write(self, data): self.writer.write(data) self.writer.wr... |
[
"ColorDescriptor app = Flask(__name__) INDEX = os.path.join(os.path.dirname(__file__), 'index.csv') cd = ColorDescriptor() @app.route('/', methods=['GET',",
"jsonify import numpy as np import cv2 from Searcher import Searcher from ColorDescriptor",
"str(score)}) context = {\"images\": res} print(context) return... |
[
"The unique id of the service account. \"\"\" if id and not isinstance(id,",
"https://github.com/terraform-providers/terraform-provider-google/blob/master/website/docs/d/compute_default_service_account.html.markdown. \"\"\" __args__ = dict() __args__['project'] = project if opts is None: opts",
"None: opts = pu... |
[
"plt.axis([0, 1100, 0, 1100000]) plt.scatter(x_values, y_values, c=y_values, cmap=plt.cm.Reds, edgecolor='none', s=40) plt.savefig('squares_plot.png', bbox_inches='tight') plt.show()",
"1001)) y_values = [x**2 for x in x_values] plt.title(\"Square Numbers\", fontsize=24) plt.xlabel(\"Value\", fontsize=14)",
"wh... |
[
"100 else: print('extra potency: ' + str((ambient_area - 6))) potency = 100 +",
"ambient_name in class2: number_tugs = math.ceil(perimeter/3.5) if number_tugs <= 3: power_tugs = number_tugs",
"Potency: '+ str(100) +' (VA)') potency = 100 else: print('extra potency: ' +",
"(number_tugs - 3) elif ambient_name i... |
[
"open(SAVE_PATH, \"w\") as fw: for pair in pairs: support = two_deg[pair] / itemsets_len",
"itemset_3[k] for itemset in itemsets: if item_i in itemset and item_j in itemset",
"in itemset: two_deg[key] = two_deg.get(key, 0) + 1 pairs = list(two_deg.keys()) two_deg_count =",
"three_deg[tup] print(f\"频繁三项集数量: {t... |
[
"import LBFGSOptimizeAcquisition from ..models.meanstd_acqfunc_impl import EIAcquisitionFunction DEFAULT_ACQUISITION_FUNCTION = EIAcquisitionFunction DEFAULT_LOCAL_OPTIMIZER_CLASS = LBFGSOptimizeAcquisition DEFAULT_NUM_INITIAL_CANDIDATES",
"from .bo_algorithm_components import LBFGSOptimizeAcquisition from ..mode... |
[
"# Patients with Autism autism = patients.with_these_clinical_events( Autism_codes, on_or_before=index_date, returning=\"binary_flag\", return_expectations={\"incidence\": 0.5}, )",
") # Patients with Autism autism = patients.with_these_clinical_events( Autism_codes, on_or_before=index_date, returning=\"binary_fl... |
[
"@ GitHub : https://github.com/JackyPJB @ Contact : <EMAIL> ------------------------------------------------- Description : ------------------------------------------------- \"\"\"",
": ------------------------------------------------- \"\"\" import datetime __author__ = 'Max_Pengjb' from app.models import db fro... |
[] |
[
"import StreamExecutionEnvironment, TimeCharacteristic from pyflink.table import StreamTableEnvironment, DataTypes, EnvironmentSettings from pyflink.table.descriptors import (",
"as fopen: dic = json.load(fopen) sentences = [string] x = np.zeros((len(sentences), maxlen)) for",
"sess import tensorflow as tf impo... |
[
"dependencies = [ ('servers', '0003_auto_20170523_1409'), ] operations = [ migrations.AlterField( model_name='server', name='operating_system', field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,",
"import migrations, models import django.db.models.deletion class Migration(migrations.Migration): ... |
[
"step=1, description='Fold:', disabled=False, continuous_update=False, orientation='horizontal', readout=True, readout_format='d', ) if show: display(select) return select",
"value=False, description='CPLEX linking', disabled=False, indent=False ) if show: display(select) return select def load_info(dataset,",
... |
[
"of r. If we require # the number of terms to be finite",
"10 = r -10 + r -7 + r 6. # Interestingly, the",
"n = 1000 i = 10000 prob_id = 558 timed.caller(dummy, n, i, prob_id)",
"http://github.com/lcsm29/project-euler import timed def dummy(n): pass if __name__ == '__main__': n = 1000",
"'__main__': n = 100... |
[
"# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A",
"materials provided with the # distribution. # * Neither the name of the",
"of the nor the names of its # contributors may be used to",
"ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT #",
"in the docume... |
[
"np from message_ix import Scenario msg_args = ('canning problem (MESSAGE scheme)', 'standard') msg_multiyear_args",
"message_ix import Scenario msg_args = ('canning problem (MESSAGE scheme)', 'standard') msg_multiyear_args = ('canning",
"('canning problem (MESSAGE scheme)', 'standard') msg_multiyear_args = ('c... |
[
"yourself...\", ) return await ctx.send(embed=embed69) em = nextcord.Embed( title=\"Are you sure?\", description=\"This is",
"is None: embed = nextcord.Embed( title=\"Add Role Error\", description=\"Please ping a user to",
"sync class AllConfirm(nextcord.ui.View): def __init__(self,ctx): super().__init__(timeou... |
[
"Announcements:\" \" SUB={}, PUB={}\" .format(self.sub, self.pub)) msg = json.dumps({'downlink': self.sub, 'uplink': self.pub}) self.discovery_pipe.send(msg.encode('utf_8'))",
"ctx, pipe): self.log.debug(\"Pyre on iface : {}\".format(self.iface)) n = Pyre(self.groupName, sel_iface=self.iface) n.set_header(\"DISCO... |
[
"import SessionMiddleware from spire.context import ContextMiddleware, HeaderParser, SessionParser from bastion.security.middleware import RedirectMiddleware class",
"Configuration, Unit, Dependency from spire.util import uniqid from spire.wsgi.util import Mount from spire.wsgi.sessions",
"spire.wsgi.sessions i... |
[
"maior que 1250 é 10%, menor é 15%. salario = int(input('Qual o valor",
"que 1250 é 10%, menor é 15%. salario = int(input('Qual o valor do",
"10%, menor é 15%. salario = int(input('Qual o valor do seu salário? '))",
"= int(input('Qual o valor do seu salário? ')) salario1= (1250*0.1)+salario salario2=(1250*0.1... |
[] |
[
"Statistics.getPercentile(benchmark_samples_to_process, 50) benchmark_stats.q3 = Statistics.getPercentile(benchmark_samples_to_process, 75) benchmark_stats.upper_fence = benchmark_results.sorted_no_outliers_samples[-1] # Plotly uses last",
"exact lower_fence set to: lower_fence benchmark_stats.q1 = Statistics.get... |
[
"LearningStrategyEnum from running_modes.enums.logging_mode_enum import LoggingModeEnum from running_modes.enums.running_mode_enum import RunningModeEnum from running_modes.enums.generative_model_regime import GenerativeModelRegimeEnum",
"import LoggingModeEnum from running_modes.enums.running_mode_enum import Ru... |
[
"import MyDataloader from .transforms import Resize, Rotate, RandomCrop, CenterCrop, \\ ColorJitter, HorizontalFlip, ToTensor,",
"from .transforms import Resize, Rotate, RandomCrop, CenterCrop, \\ ColorJitter, HorizontalFlip, ToTensor, \\ Compose,",
"import NYUDataset from .kitti_dataloader import KITTIDataset ... |
[
"valor <= 50: print \"Intervalo (25,50]\" elif valor >= 0 and valor <=",
"50: print \"Intervalo (25,50]\" elif valor >= 0 and valor <= 75: print",
"\"Intervalo (25,50]\" elif valor >= 0 and valor <= 75: print \"Intervalo (50,",
"valor = float(input()) if valor >= 0 and valor <= 25: print \"Intervalo",
"valo... |
[
"new_filename = 'data/csv/%s.csv' % idx with open(org_filename) as input_csv: with open(new_filename, 'w') as",
"0 or x > 170: continue if y < 30 or y >",
"continue if y < 30 or y > 220: continue if z >",
"csv.writer(output_csv) row_id = 0 for row in csv.reader(input_csv): row_id = row_id + 1",
"2101 k_skip... |
[
"def last_known_position(self): \"\"\"Grabs the player's last known location from the report set.\"\"\" try:",
"is None: return last_spotted elif last_spotted is None: return last_filed else: if last_filed.reported_date",
"from the report set.\"\"\" try: last_filed = self.report_set.filter(zombies_only=False) l... |
[
"- k + 1)).most_common() occur.update({word[0] for word in words if word[1] == t})",
"Counter def find_occurrencies(): text = str(input()) num_inputs = input().split(\" \") k = int(num_inputs[0])",
"= int(num_inputs[1]) t = int(num_inputs[2]) curr_pos = 0 occur = set() for curr_pos,",
"Counter(curr_str[i:i+k]... |
[
"for key, value in doc.iteritems()) elif isinstance(doc, (list, tuple)): return [self.deep_sub(item) for item",
"the same directory as the package spec YAML-file can be found in the",
"filename, target_name=None): \"\"\" Makes sure that a file located in the same directory",
"spec YAML-file can be found in th... |
[
"license terms in the LICENSE.txt file found in the # top-level directory of",
"that should be unique: # TODO - we assume that the count is",
"from its parent. Helper method for :meth:`set_item_count_per_profile`. Args: new_item (OVFItem): Newly cloned Item",
"+= 1 for (profile, count) in count_dict.items(): ... |
[
"parameter to define the numbers of indents: #Use the separators parameter change the",
"24.1} ] } print(json.dumps(x)) #Use the indent parameter to define the numbers of",
"\"John\", \"age\": 30, \"married\": True, \"divorced\": False, \"children\": (\"Ann\",\"Billy\"), \"pets\": None, \"cars\": [",
"result ... |
[
"\"#<SYSTEM-MACRO {0} {{{1:X}}}>\".format(self.__class__.__name__, id(self)) # ============================================================================== # Defines system macro classes. # ==============================================================================",
"import Expander bindings, body = forms.c... |
[
"# TODO: implement program loop involving vertical/horiontal scrolling if __name__ == \"__main__\": curses.wrapper(main)",
"range(len(years)): monthsRange = (1, 13) # normal year covers between months 1-12 if",
"#ppage:339, #npage:338 # TODO: implement program loop involving vertical/horiontal scrolling if __na... |
[
"an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND,",
"distributed on an # \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY",
"of sampler will build an internal method to prune or reduce number of",
"express or implied. See the License for the # specific language governing permissio... |
[
"/ resolution.y; float col = 0.0; for (int i = 1; i <=",
"gl_FragCoord.xy / resolution.xy; vec2 p = -1.0 + 2.0 * q; p.x *=",
"i = 1; i <= 7; ++i) { col += ball(p, float(i), 0.3);",
"0.3); } for (int i = 1; i <= 5; ++i) { col",
"q = gl_FragCoord.xy / resolution.xy; vec2 p = -1.0 + 2.0 * q;",
"vec2 r = vec2... |
[
"flask import Flask, Request, Response, request import json def devices(): dict_device = request.get_data(as_text=True)",
"Request, Response, request import json def devices(): dict_device = request.get_data(as_text=True) dados_device = json.loads(dict_device)",
"Flask, Request, Response, request import json de... |
[
"import FermionOperator as FOp from openfermion.ops import QubitOperator as QOp from openfermion.transforms import",
"{'gradient-strategy':'parameter-shift'}) optimizer = createOptimizer('nlopt', {'nlopt-optimizer':'l-bfgs'}) results = optimizer.optimize(obj) self.assertAlmostEqual(results[0], -1.74, places=1) de... |
[
"model.eval() for data, target in validation_batches: data, target = data.to(device), target.cuda(device) output =",
"(p=0.25) self.dropout = nn.Dropout(0.25) return def forward(self, x): # add sequence of convolutional",
"imagenet # the output won't show up if you don't flush it when",
"= nn.Linear(FULLY_CON... |
[
"in items_and_annotations} == set( [i.reference_id for i in items] ) ref_item = dataset.refloc(target_item.reference_id)",
"for _ in items_and_annotations} == set( [i.reference_id for i in items] ) ref_item",
"dataset.items_and_annotations() target_item = items[0] assert {_[\"item\"].reference_id for _ in items... |
[
"getpass.getuser() if username.lower() == 'youval': osType = sys.platform if osType.startswith('win'): tempdir = (r'C:\\Phenix\\Dev\\Work\\work\\NCS\\junk')",
"phenix_sources\\phenix_regression\\development\\ncs_constraints.py \"\"\" username = getpass.getuser() if username.lower() == 'youval': osType = sys.platf... |
[] |
[] |
[
"title = parse.urlparse(url).netloc prefix = '\\033[32m' if code == 404 else '\\033[31m' suffix",
"== 404 else '\\033[31m' suffix = '\\033[0m' result = '{}{}{}'.format(prefix, code, suffix) print(title.ljust(16),",
"] def inspect_status_code(url): try: response = request.urlopen(url) return response.code except... |
[
"for i, cap in enumerate(right_captions): end = right_caption_lengths[i] collate_data['right_captions'][i, :end] = cap[:end] #",
"batch_size, num_workers): self.data_dir = data_dir self.which_set = which_set self.dataset_name = dataset_name assert self.which_set",
"COCOTextImageDataLoader(BaseDataLoader): \"\"\... |
[
"_ = guest.versions[0] with admin_session() as session: guest = session.query(Guest).where(Guest.guid == guid).one() assert",
"import pytest from sqlalchemy.exc import ProgrammingError from sqlalchemy_continuum.utils import count_versions from kokon.orm import",
"session: guest = session.query(Guest).where(Gues... |
[
"\"django.utils.log.RequireDebugTrue\"}, \"readable_sql\": {\"()\": \"project_runpy.ReadableSqlFilter\"}, }, \"handlers\": { \"console\": { \"level\": \"DEBUG\", \"formatter\": \"dev\",",
"= \"bandc.wsgi.application\" # Database # https://docs.djangoproject.com/en/stable/ref/settings/#databases DATABASES = {\"def... |
[
"f\"{response.url.scheme.upper()}/\" f\"{response.version.major}.{response.version.minor}\", \"data\": data, \"status\": f\"{response.status}:{response.reason}\", }, ) return response.status, response.headers, await response.read()",
"# host is always going to be 'api.github.com'. \"path\": response.url.raw_path_... |
[
"return bcl.huffman_compress_quant_buffer(buf, self._offset, self._scale) def decode(self, buf, out=None): ret = bcl.huffman_decompress_buffer(buf, None) ret",
"from . import bcl import numcodecs from numcodecs.abc import Codec class Huffman(Codec): codec_id='pymecompress.huffman'",
"config): return cls() numco... |
[] |
[
"= normalize(x) print(y) x = gaussian(x, 0.0, 1.0, 1.0) print(x) if __name__ ==",
"import normalize, gaussian def main(): x = torch.tensor([1, 2, 3], dtype=torch.float) y =",
"cppexample import normalize, gaussian def main(): x = torch.tensor([1, 2, 3], dtype=torch.float) y",
"= torch.tensor([1, 2, 3], dtype=... |
[
"super().__init__() self.M = M self.angle = 359 / 10 * self.M def forward(self,",
"__init__(self, M): super().__init__() self.M = M def forward(self, img): return ttf.functional.autocontrast(img) class Sharpness(nn.Module):",
"import torch.nn as nn from torchvision import transforms as ttf class RandAugment(nn.... |
[
"Testload(unittest.TestCase): def setUp(self): self.kuorma_1=load(name=\"Lattialämmitys\", ID=12345, sensorPin=\"P11\", relayPin=2, maximumCurrent=10, phase=1, priority=0) self.kuorma_2=load(\"Kiuas\",12346,\"P12\",2,10,1,0) def tearDown(self):",
"load from main import * #Testaa funktiot pääohjelmasta class TestM... |
[
"NON_INHERITABLE_PATTERN = re.compile(\"^qual(.)*|ikats(.)*|funcId\") class IkatsTimeseriesMgr(IkatsGenericApiEndPoint): \"\"\" Ikats EndPoint specific to Timeseries management \"\"\"",
"check_type(value=ts, allowed_types=[str, Timeseries], var_name=\"ts\", raise_exception=True) tsuid = ts if isinstance(ts, Times... |
[
"lw=lw, label=f'{model_name} curve (area = {roc_auc:.5f})') # plot thresholds for it, thr in",
"= 0 for cfi, c_family in enumerate(c_families): project_id = c_families[c_family] print(c_family, project_id) #",
"= './data' # mpl colors: colors = plt.rcParams['axes.prop_cycle'].by_key()['color'] # [u'#1f77b4', u'... |
[
"f = Field(self.team_a, self.team_b) f.possession = Possession.AWAY_TEAM f.set_position(Position(FIELD_CENTER_X, FIELD_MAX_Y)) f.move_laterally(LateralDirection.RIGHT) self.assertEqual(f.position.x, FIELD_CENTER_X) self.assertEqual(f.position.y,",
"1)) zone = f.get_field_zone() self.assertEqual(zone, FieldZone.RU... |
[
"getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x,",
")) elif isinstance(value, Enum): result[attr] = value.value else: result[attr] = value if issubclass(SubscriptionVersion,",
"id @property def language(self): \"\"\"Gets the language of this Subscript... |
[
"in range(valor_inicial, valor_final + 1): digitos_str = str(numero) check = True # essa",
"número é par, adiciona ele à lista saida.append(numero) return saida inicio = 0",
"saida = [] # usando (valor final + 1) pois a função range",
"é par check = False break # após o primeiro dígito ímpar, sai",
"é par, ... |
[
"def get_key(row): key_parts = [] for col in row.keys(): if col == 'zone':",
"CSV instead of letting pandas do it, due to composite header # we",
"key_parts.append(str(row[col])) start = time.time() infilename = '/tmp/test.csv' df = pandas.read_csv(infilename) df['key'] = df.apply(lambda",
"Return a pipe-deli... |
[
"def test_sample_input(caplog): # caplog.set_level(logging.INFO) assert evaluate_expression(\"1 + 2 * 3 + 4 *",
"+ 6) + 2 + 4 * 2\") == 13632 def test_sample_input_with_advanced_priorities(caplog): #",
"2 + 4 * 2\", use_advanced_precedence=True) == 23340 def test_big_input(caplog): # caplog.set_level(logging.IN... |
[
"1 return True for i in range(numCourses): if not dfs(i): return [] return",
"coursesCanBeTaken = [] for i in range(numCourses): if num_pre[i] == 0: coursesCanBeTaken.append(i) res",
"[] while coursesCanBeTaken: course = coursesCanBeTaken.pop() res.append(course) for c in graph[course]: num_pre[c] -=",
"= [0 ... |
[
"import os from typing import Dict from fastapi_sso.sso.base import OpenID, SSOBase class KakaoSSO(SSOBase):",
"scope = [\"openid\"] version = \"v2\" async def get_discovery_document(self) -> Dict[str, str]: return",
"f\"https://kauth.kakao.com/oauth/token\", \"userinfo_endpoint\": f\"https://kapi.kakao.com/{se... |
[
"tasks = [asyncio.create_task(job.close(timeout=timeout)) for job in self._jobs] closed = True for task in",
"def is_running(self) -> bool: return not self._task.done() async def close(self, *, timeout: float",
"-> bool: return all(job.is_running for job in self._jobs) async def close(self, *, timeout:",
"Col... |
[
"# provide status of all jobs import ulmodb dbname = \"ulmodb.db\" db =",
"provide status of all jobs import ulmodb dbname = \"ulmodb.db\" db = ulmodb.UlmoDB(dbname)"
] |
[
"import numpy as np import nimfa V = np.random.rand(40, 100) nmf = nimfa.Nmf(V,",
"np.random.rand(40, 100) nmf = nimfa.Nmf(V, seed=\"nndsvd\", rank=10, max_iter=12, update='euclidean', objective='fro') nmf_fit = nmf()",
"as np import nimfa V = np.random.rand(40, 100) nmf = nimfa.Nmf(V, seed=\"nndsvd\", rank=10,... |
[
"# ############################################################################## from PyQt4 import QtCore import logging ############################################################################## class QParser(QtCore.QThread): def __init__(self,",
"utf-8 -*- # ################################################... |
[
"to decode message in order to show to user. if msg: print(msg.decode()) else:",
"Receive messages sent by the server and display them to user ''' while",
"= '127.0.0.1' SERVER_PORT = 12000 try: # Instantiate socket and start connection with",
"SERVER_PORT = 12000 try: # Instantiate socket and start connectio... |
[
"'short_id'], help=\"Attribute\") parser.add_argument('-m', '--miniconda-version', default='latest', help='Add Miniconda version (or use \"latest\").', type=str) args",
"import sys import argparse def _find_config_file(): config = 'etc/minicondas.json' while not os.path.isfile(config): config",
"_av_ints = sort... |
[
"from transformers import GPT2Tokenizer tokenizer = GPT2Tokenizer.from_pretrained('gpt2', bos_token='<|startoftext|>', eos_token='<|endoftext|>', pad_token='<|pad|>') tokenizer.pad_token = tokenizer.eos_token"
] |
[
"- color (string; optional) - name (string; optional) - selectCommand (string; optional) -",
"- activeNodes (list of dicts; optional): Active node selections (nodes not saved with",
"activeClades=Component.UNDEFINED, activeLeaves=Component.UNDEFINED, saved=Component.UNDEFINED, **kwargs): self._prop_names = ['id... |