text stringlengths 232 16.3k | domain stringclasses 1
value | difficulty stringclasses 3
values | meta dict |
|---|---|---|---|
<|fim_suffix|> if pipe.returncode != 0:
raise Exception(
"subprocess run: {0}\nFailed with stdout: \n-- \n{1} \n--\nstderr: \n--\n{2} \n--".format(
" ".join(processArgs), output, error))
def load2Tile(loader_config_file, callset_mapping_file, vid_mapping_file):
... | code_fim | hard | {
"lang": "python",
"repo": "GenomicsDB/GenomicsSampleAPIs",
"path": "/utils/loader.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: GenomicsDB/GenomicsSampleAPIs path: /utils/loader.py
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2016 Intel Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to... | code_fim | hard | {
"lang": "python",
"repo": "GenomicsDB/GenomicsSampleAPIs",
"path": "/utils/loader.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> """
Reads config for loading parameters
"""
parser = ConfigParser.RawConfigParser()
parser.read(config_file)
self.NUM_PROCESSES = parser.getint('loader', 'NUM_PROCESSES')
self.EXEC = parser.get('loader', 'EXECUTABLE')
self.TILE_LOADER_JSON = ... | code_fim | hard | {
"lang": "python",
"repo": "GenomicsDB/GenomicsSampleAPIs",
"path": "/utils/loader.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>view.ResetCamera()
view.Render()
view.GetInteractor().Start()<|fim_prefix|># repo: t3dbrida/VTK path: /Examples/Infovis/Python/treering_view_simple.py
#!/usr/bin/env python
from vtk import *
reader1 = vtkXMLTreeReader()
reader1.SetFileName("treetest.xml")
reader1.Update()
<|fim_middle|>view = vtkTreeR... | code_fim | hard | {
"lang": "python",
"repo": "t3dbrida/VTK",
"path": "/Examples/Infovis/Python/treering_view_simple.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: t3dbrida/VTK path: /Examples/Infovis/Python/treering_view_simple.py
#!/usr/bin/env python
from vtk import *
reader1 = vtkXMLTreeReader()
reader1.SetFileName("treetest.xml")
reader1.Update()
<|fim_suffix|># Apply a theme to the views
theme = vtkViewTheme.CreateMellowTheme()
view.ApplyViewTheme(t... | code_fim | hard | {
"lang": "python",
"repo": "t3dbrida/VTK",
"path": "/Examples/Infovis/Python/treering_view_simple.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>###################################################################
################################################################### ... | code_fim | hard | {
"lang": "python",
"repo": "Acribbs/CGATPipelines",
"path": "/CGATPipelines/pipeline_docs/pipeline_metagenomeassembly/pipeline_metagenomeassembly.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Acribbs/CGATPipelines path: /CGATPipelines/pipeline_docs/pipeline_metagenomeassembly/pipeline_metagenomeassembly.py
ile)s'''
P.run()
################################################################### ... | code_fim | hard | {
"lang": "python",
"repo": "Acribbs/CGATPipelines",
"path": "/CGATPipelines/pipeline_docs/pipeline_metagenomeassembly/pipeline_metagenomeassembly.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> '''
run meta-velvet on each track
'''
to_cluster = True
job_options = " -l mem_free=30G"
statement = PipelineGenomeAssembly.Metavelvet().build(infile)
P.run()
################################################################### ... | code_fim | hard | {
"lang": "python",
"repo": "Acribbs/CGATPipelines",
"path": "/CGATPipelines/pipeline_docs/pipeline_metagenomeassembly/pipeline_metagenomeassembly.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: gistable/gistable path: /all-gists/2410c9f835f41834d630/snippet.py
#!/usr/bin/env python
import sys
import os
import json
import argparse
import collections
__description__ = """Ansible Dynamic Inventory for Terraform."""
__epilog__ = """
The environment variable `TERRAFORM_TFSTATE` must p... | code_fim | hard | {
"lang": "python",
"repo": "gistable/gistable",
"path": "/all-gists/2410c9f835f41834d630/snippet.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> if "hosts" not in inventory[role]:
inventory[role]["hosts"] = []
inventory[name]["hosts"].append(addressable_host)
inventory[name]["hosts"] = list(set(inventory[name]["hosts"]))
inventory[role]["hosts"].append(addressable_host)
... | code_fim | hard | {
"lang": "python",
"repo": "gistable/gistable",
"path": "/all-gists/2410c9f835f41834d630/snippet.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: cclairec/fmri path: /niftybold/pipeline/ica_nii__2__mat.py
from niftybold.img.Image import Image
import scipy.io as sio
import argparse
import numpy as np
<|fim_suffix|>img = Image(img_filename=args.img, mask_filename=args.mask, fwhm=args.fwhm, asl=args.asl)
if args.normalise:
_mat = img.im... | code_fim | hard | {
"lang": "python",
"repo": "cclairec/fmri",
"path": "/niftybold/pipeline/ica_nii__2__mat.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>img = Image(img_filename=args.img, mask_filename=args.mask, fwhm=args.fwhm, asl=args.asl)
if args.normalise:
_mat = img.image_mat_in_mask_normalised.T
else:
_mat = img.image_mat_in_mask.T
sio.savemat(args.mat, {'mat': _mat})<|fim_prefix|># repo: cclairec/fmri path: /niftybold/pipeline/ica_nii__... | code_fim | hard | {
"lang": "python",
"repo": "cclairec/fmri",
"path": "/niftybold/pipeline/ica_nii__2__mat.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: luca-heltai/pymor path: /src/pymor/la/basic.py
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import absolute_import, divi... | code_fim | hard | {
"lang": "python",
"repo": "luca-heltai/pymor",
"path": "/src/pymor/la/basic.py",
"mode": "psm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> Parameters
----------
product
The scalar product for which the norm is to be calculated,
given as a linear |Operator|.
Returns
-------
norm
A function `norm(U, mu=None)` taking a |VectorArray| `U`
as input together with the |Parameter| `mu` which is... | code_fim | hard | {
"lang": "python",
"repo": "luca-heltai/pymor",
"path": "/src/pymor/la/basic.py",
"mode": "spm",
"license": "BSD-2-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> # ____________________________________________
# above_threshold = example['bbox_corner'] > 0.15
# react_tms = np.argmax(above_threshold, axis=1)
# ______________________________________-
myval=000000+int(img_idx[0])
myval=str(myval)
# myval=('{myval:06}')
myval=myval.zfil... | code_fim | hard | {
"lang": "python",
"repo": "mayanks888/second.pytorch",
"path": "/second/pytorch/mayank_play/lidar_bbox_on_nuscne_Data/annotated_multiple_box_on_point_cloud_i-pickle.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: mayanks888/second.pytorch path: /second/pytorch/mayank_play/lidar_bbox_on_nuscne_Data/annotated_multiple_box_on_point_cloud_i-pickle.py
import pandas as pd
import numpy as np
import pickle
import cv2
import os
import mayavi.mlab as mlab
def draw_lidar_simple(pc, location, color=None):
''' Dr... | code_fim | hard | {
"lang": "python",
"repo": "mayanks888/second.pytorch",
"path": "/second/pytorch/mayank_play/lidar_bbox_on_nuscne_Data/annotated_multiple_box_on_point_cloud_i-pickle.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> ####################################################################################################
# color=None
# scan = np.fromfile(point_cloud_path,dtype=np.float32)
#
# points = scan.reshape(-1, 4)
# pc=points
# fig = mlab.figure(figure=None, bgcolor=(0, 0, 0), fgcolor=Non... | code_fim | hard | {
"lang": "python",
"repo": "mayanks888/second.pytorch",
"path": "/second/pytorch/mayank_play/lidar_bbox_on_nuscne_Data/annotated_multiple_box_on_point_cloud_i-pickle.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|># Instanciate and init tcPR object.
tc_pr = tcPR.tcPR()
tc_pr.init("NH3,N2,H2")
z = np.array([0.85, 0.1, 0.05])
T = 273.15 + 115.0 # K
P = 2.0e7 # Pa
x, y, beta_g, beta_l, phase = tc_pr.two_phase_tpflash(T, P, z)
print("Gas molar fraction: {} (-)".format(beta_g))
s_l, = tc_pr.entropy(T, P, x, tc_pr.LIQ... | code_fim | hard | {
"lang": "python",
"repo": "ibell/thermopack",
"path": "/addon/pyExamples/flashes.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>v_l, = tc_pr.specific_volume(T, P, x, tc_pr.LIQPH)
v_g, = tc_pr.specific_volume(T, P, y, tc_pr.VAPPH)
v = v_g*beta_g + v_l*beta_l
temp, x, y, beta_g, beta_l, phase = tc_pr.two_phase_psflash(P, z, s, temp=None)
print(u"Temperature from entropy-pressure flash: {} (\N{DEGREE SIGN}C)".format(temp - 273.15))
... | code_fim | hard | {
"lang": "python",
"repo": "ibell/thermopack",
"path": "/addon/pyExamples/flashes.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ibell/thermopack path: /addon/pyExamples/flashes.py
#!/usr/bin/python
# Support for python2
from __future__ import print_function
#Modify system path
import sys
sys.path.append('../pycThermopack/')
# Importing pyThermopack
from pyctp import tcPR
# Importing Numpy (math, arrays, etc...)
import num... | code_fim | hard | {
"lang": "python",
"repo": "ibell/thermopack",
"path": "/addon/pyExamples/flashes.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>#run just the new stuff
new_and_simpler_stuff()
#old_more_complex_stuff()
# Visualize the winner network and plot/log statistics.
#visualize.plot_stats(pop)
#visualize.plot_species(pop)
#visualize.draw_net(winner, view=True, filename="xor2-all.gv")
#visualize.draw_net(winner, view=True, filename="xor2-en... | code_fim | hard | {
"lang": "python",
"repo": "vladiibine/machine-learning-examples",
"path": "/NEAT-ML/identity_function/ident.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: vladiibine/machine-learning-examples path: /NEAT-ML/identity_function/ident.py
""" 2-input XOR example """
from __future__ import print_function
from neat import nn, population, statistics, visualize
import sys
xor_inputs = [[0, 0], [0, 1], [1, 0], [1, 1]]
xor_outputs = [0, 1, 1, 0]
simpler_in... | code_fim | hard | {
"lang": "python",
"repo": "vladiibine/machine-learning-examples",
"path": "/NEAT-ML/identity_function/ident.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> global edgesPool
edgesPool.append(edge)
if len(edgesPool) >= MAX_EDGES_POOL:
for e in edgesPool:
pg.draw.circle(treeSurface, (255, 128, 0), e[1], 2)
pg.draw.line(treeSurface, (255, 255, 255), e[0], e[1])
edgesPool = []
update()
def clearEdgesPool():
global edgesPool
edgesPool = []
def t... | code_fim | hard | {
"lang": "python",
"repo": "jagatiyakeval/rrt_simulator",
"path": "/drawing.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> global showInfo
showInfo = not showInfo
def updateInfo(elapsed, nodes, height, length = None):
infoSurface.fill(0)
elapsed = format(elapsed, '.4f')
lines = [
f'Time: {elapsed}s',
f'Nodes: {nodes}',
f'Height: {height}'
]
if length:
lines.append(f'Path length: {length}')
for i in range(len(... | code_fim | hard | {
"lang": "python",
"repo": "jagatiyakeval/rrt_simulator",
"path": "/drawing.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jagatiyakeval/rrt_simulator path: /drawing.py
"""
This is the module responsible for handling drawings to the screen.
All pygame.draw commands must be executed inside this module.
It also contains important variables related to drawing and other uses,
that are accessible by other modules, such ... | code_fim | hard | {
"lang": "python",
"repo": "jagatiyakeval/rrt_simulator",
"path": "/drawing.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: globalwordnet/OMW path: /scripts/load-core.py
###
### Read the core data
### Map it to ili
### load it into the xlink table
###
import sys, sqlite3
# It takes three arguments: the db filename, the TSV file of core
# synsets, and the TSV file of ILI mappings
if (len(sys.argv) < 4):
sys.stderr... | code_fim | hard | {
"lang": "python",
"repo": "globalwordnet/OMW",
"path": "/scripts/load-core.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>################################################################
# Enter core data
################################################################
rname='core'
#uname='load-core.py'
values=list()
c.execute('select id, ili_id from ss')
for (ss_id, ili_id) in c:
#print(ss_id, ili_id)
if ili_id in ... | code_fim | hard | {
"lang": "python",
"repo": "globalwordnet/OMW",
"path": "/scripts/load-core.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>################################################################
# GET PWN3.0-ILI ORIGINAL MAPPING
################################################################
f = open(ilimapfile, 'r')
ili_map = dict()
ili2ss=dict()
for line in f:
if line.strip() == "":
continue
else:
tab = li... | code_fim | hard | {
"lang": "python",
"repo": "globalwordnet/OMW",
"path": "/scripts/load-core.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: pytorch/pytorch path: /torch/utils/_sympy/interp.py
"""
This is a simple interpreter for Sympy expressions that dispatches to
classes following the torch._inductor.virtualized calling convention.
For directness, the interpreter takes the handler directly rather than
consulting the TLS. It does n... | code_fim | hard | {
"lang": "python",
"repo": "pytorch/pytorch",
"path": "/torch/utils/_sympy/interp.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> # TODO add CeilDiv (it doesn't appear in the index_expr)
# TODO default to some decompositions if the interpreter doesn't have them
# like decomposing ModularIndexing or implementing Le(a,b) as Ge(b, a)
HANDLERS = {
sympy.Or: "or_",
sympy.And: "and_",
sympy.Eq: "e... | code_fim | hard | {
"lang": "python",
"repo": "pytorch/pytorch",
"path": "/torch/utils/_sympy/interp.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def sympy_interp(
analysis, env: Dict[sympy.Symbol, Any], expr: Union[sympy.Expr, SympyBoolean]
):
# Handle base cases
dtype = None
if isinstance(expr, BooleanAtom):
dtype = torch.bool
elif isinstance(expr, sympy.Integer):
dtype = torch.int64
elif isinstance(expr, ... | code_fim | hard | {
"lang": "python",
"repo": "pytorch/pytorch",
"path": "/torch/utils/_sympy/interp.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ducheneaut/dyno-monitor path: /dynos/models.py
from django.db import models
from django.conf import settings
# Create your models here.
class App(models.Model):
<|fim_suffix|> # FK
app_fk = models.ForeignKey(App, blank=False, null=False, on_delete=models.CASCADE)
name = models.CharF... | code_fim | hard | {
"lang": "python",
"repo": "ducheneaut/dyno-monitor",
"path": "/dynos/models.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> # Override unicode to return something meaningful
def __str__(self):
return str(self.name)
class Dyno(models.Model):
# FK
app_fk = models.ForeignKey(App, blank=False, null=False, on_delete=models.CASCADE)
name = models.CharField(blank=False, null=False, max_length=40)
cn... | code_fim | medium | {
"lang": "python",
"repo": "ducheneaut/dyno-monitor",
"path": "/dynos/models.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> @depends(after='test_04')
def test_03(self):
pass
def test_04(self):
pass<|fim_prefix|># repo: Zitrax/nose-dep path: /test_scripts/dir_test/dir_test_2/dir_tests.py
import unittest
from nosedep import depends
class DisplayNodeList(unittest.TestCase):
@depends(after='test... | code_fim | medium | {
"lang": "python",
"repo": "Zitrax/nose-dep",
"path": "/test_scripts/dir_test/dir_test_2/dir_tests.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: Zitrax/nose-dep path: /test_scripts/dir_test/dir_test_2/dir_tests.py
import unittest
from nosedep import depends
class DisplayNodeList(unittest.TestCase):
@depends(after='test_02')
def test_01(self):
<|fim_suffix|> pass
@depends(after='test_04')
def test_03(self):
... | code_fim | medium | {
"lang": "python",
"repo": "Zitrax/nose-dep",
"path": "/test_scripts/dir_test/dir_test_2/dir_tests.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> '''Returns the same value guiven as input
'''
return x
## Testing ####################################
if __name__ == '__main__':
bb = [[0, 2, 5, 7, 9], [1, 2, 3]]
my_map = rectilinear_mapper(bb)
coords = [5.5, 2]
print(my_map(coords))
voronoi_centers = [i * 0.5 for i i... | code_fim | hard | {
"lang": "python",
"repo": "ZuckermanLab/NMpathAnalysis",
"path": "/nmpath/mappers.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ZuckermanLab/NMpathAnalysis path: /nmpath/mappers.py
'''
Created on Aug 8, 2016
@author: ernesto
'''
from numbers import Number
from auxfunctions import euclidean_distance
def rectilinear_mapper(bb):
'''Returns a function:
f : R^n --> N
that maps the coordinates in R^n to an... | code_fim | hard | {
"lang": "python",
"repo": "ZuckermanLab/NMpathAnalysis",
"path": "/nmpath/mappers.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> return closest_center_index
return v_mapper
def identity(x):
'''Returns the same value guiven as input
'''
return x
## Testing ####################################
if __name__ == '__main__':
bb = [[0, 2, 5, 7, 9], [1, 2, 3]]
my_map = rectilinear_mapper(bb)
coords ... | code_fim | hard | {
"lang": "python",
"repo": "ZuckermanLab/NMpathAnalysis",
"path": "/nmpath/mappers.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: openstack/python-barbicanclient path: /functionaltests/cli/v1/smoke/test_secret.py
# Copyright (c) 2015 Rackspace, Inc.
#
# 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 | hard | {
"lang": "python",
"repo": "openstack/python-barbicanclient",
"path": "/functionaltests/cli/v1/smoke/test_secret.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> secret_href = self.secret_behaviors.store_secret(
payload=self.expected_payload)
self.secret_behaviors.get_secret_file(secret_href=secret_href)
payload = self.secret_behaviors.read_secret_test_file()
self.assertEqual(payload, self.expected_payload)
@testcas... | code_fim | hard | {
"lang": "python",
"repo": "openstack/python-barbicanclient",
"path": "/functionaltests/cli/v1/smoke/test_secret.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> secret = self.secret_behaviors.get_secret(secret_href)
self.assertEqual(secret_href, secret['Secret href'])
@testcase.attr('positive')
def test_secret_update(self):
secret_href = self.secret_behaviors.store_secret(
payload=None)
payload = 'time for an ... | code_fim | hard | {
"lang": "python",
"repo": "openstack/python-barbicanclient",
"path": "/functionaltests/cli/v1/smoke/test_secret.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: detiber/lib_openshift path: /lib_openshift/models/v1_image_source.py
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this ... | code_fim | hard | {
"lang": "python",
"repo": "detiber/lib_openshift",
"path": "/lib_openshift/models/v1_image_source.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> @property
def pull_secret(self):
"""
Gets the pull_secret of this V1ImageSource.
PullSecret is a reference to a secret to be used to pull the image from a registry If the image is pulled from the OpenShift registry, this field does not need to be set.
:return: The ... | code_fim | hard | {
"lang": "python",
"repo": "detiber/lib_openshift",
"path": "/lib_openshift/models/v1_image_source.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>nd 3.x system releases.')
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdCopsAgentV1 = usdCopsAgentV1.setStatus('current')
usdCopsAgentV2 = AgentCapabilities((1, 3, 6, 1, 4, 1, 4874, 5, 2, 7, 2))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdCopsAgentV2 = usdCopsAgentV... | code_fim | hard | {
"lang": "python",
"repo": "agustinhenze/mibs.snmplabs.com",
"path": "/pysnmp/Unisphere-Data-COPS-CONF.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: agustinhenze/mibs.snmplabs.com path: /pysnmp/Unisphere-Data-COPS-CONF.py
#
# PySNMP MIB module Unisphere-Data-COPS-CONF (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-COPS-CONF
# Produced by pysmi-0.3.4 at Mon Apr 29 21:23:28 2019
# On ... | code_fim | hard | {
"lang": "python",
"repo": "agustinhenze/mibs.snmplabs.com",
"path": "/pysnmp/Unisphere-Data-COPS-CONF.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>def destroy_buckets(names: list):
return {n: destroy_bucket(n) for n in names}
def setup(names):
create_buckets(names)
return {"names": names}
def teardown(names):
destroy_buckets(names)<|fim_prefix|># repo: awichmann-mintel/boto3-fixtures path: /boto3_fixtures/s3.py
"""
Example Usage... | code_fim | hard | {
"lang": "python",
"repo": "awichmann-mintel/boto3-fixtures",
"path": "/boto3_fixtures/s3.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: awichmann-mintel/boto3-fixtures path: /boto3_fixtures/s3.py
"""
Example Usage:
```python
@pytest.fixture(scope="class")
def s3(localstack, s3_buckets):
with boto3_fixtures.setup_s3(s3_buckets) as buckets:
yield buckets
```
"""
import backoff
from botocore.exceptions import ClientEr... | code_fim | hard | {
"lang": "python",
"repo": "awichmann-mintel/boto3-fixtures",
"path": "/boto3_fixtures/s3.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> class Meta(AbstractUser.Meta):
swappable = 'AUTH_USER_MODEL'<|fim_prefix|># repo: dannyvi/pomelo-server path: /pomelo_server/pomelo/authjwt/models.py
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _
class... | code_fim | hard | {
"lang": "python",
"repo": "dannyvi/pomelo-server",
"path": "/pomelo_server/pomelo/authjwt/models.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> phone = models.CharField(verbose_name=_('Phone'), null=True, blank=True, default=None,
unique=True, max_length=20)
email = models.EmailField(_('email address'), null=True, unique=True, blank=True)
REQUIRED_FIELDS = ['email']
class Meta(AbstractUser.Meta):
... | code_fim | medium | {
"lang": "python",
"repo": "dannyvi/pomelo-server",
"path": "/pomelo_server/pomelo/authjwt/models.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: dannyvi/pomelo-server path: /pomelo_server/pomelo/authjwt/models.py
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.utils.translation import gettext_lazy as _
class BaseUser(AbstractUser):
<|fim_suffix|> class Meta(AbstractUser.Meta):
swap... | code_fim | hard | {
"lang": "python",
"repo": "dannyvi/pomelo-server",
"path": "/pomelo_server/pomelo/authjwt/models.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: gao-lab/Cell_BLAST path: /Cell_BLAST/latent.py
"""
def __init__(
self,
input_dim: int,
latent_dim: int,
h_dim: int = 128,
depth: int = 1,
dropout: float = 0.0,
lambda_reg: float = 0.001,
fine_tune: bool = False,
devi... | code_fim | hard | {
"lang": "python",
"repo": "gao-lab/Cell_BLAST",
"path": "/Cell_BLAST/latent.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: gao-lab/Cell_BLAST path: /Cell_BLAST/latent.py
h_dim: int = 128,
depth: int = 1,
dropout: float = 0.0,
lambda_reg: float = 0.001,
fine_tune: bool = False,
deviation_reg: float = 0.0,
name: str = "Gau",
_class: str = "Gau",
**... | code_fim | hard | {
"lang": "python",
"repo": "gao-lab/Cell_BLAST",
"path": "/Cell_BLAST/latent.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> x = self.mlp(x)
gau = self.gau(x)
cat = self.softmax(self.cat(x))
latent = gau + self.mat(cat)
return latent
def fetch_cat(self, x: torch.Tensor) -> torch.Tensor:
x = self.mlp(x)
cat = self.softmax(self.cat(x))
return cat
def fetch_... | code_fim | hard | {
"lang": "python",
"repo": "gao-lab/Cell_BLAST",
"path": "/Cell_BLAST/latent.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> assert len(inputs) == len(golds)
assert len(golds) == len(preds)
total_gold_err, total_pred_err, right_pred_err = 0, 0, 0
check_right_pred_err = 0
fout = open('sent_pred_result.txt', 'w', encoding='utf-8')
for ori_tags, god_tags, prd_tags in zip(inputs, golds, preds):
asser... | code_fim | hard | {
"lang": "python",
"repo": "kg-nlp/PLOME",
"path": "/finetune_src/tagging_eval.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: kg-nlp/PLOME path: /finetune_src/tagging_eval.py
#-*-coding:utf8-*-
import sys, os
import numpy as np
import tensorflow as tf
import modeling
import optimization
import time
os.environ["PYTHONIOENCODING"] = "utf-8"
tf.logging.set_verbosity(tf.logging.ERROR)
def score_f(ans, print_flg=False, onl... | code_fim | hard | {
"lang": "python",
"repo": "kg-nlp/PLOME",
"path": "/finetune_src/tagging_eval.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def score_f_sent(inputs, golds, preds):
assert len(inputs) == len(golds)
assert len(golds) == len(preds)
total_gold_err, total_pred_err, right_pred_err = 0, 0, 0
check_right_pred_err = 0
fout = open('sent_pred_result.txt', 'w', encoding='utf-8')
for ori_tags, god_tags, prd_tags i... | code_fim | hard | {
"lang": "python",
"repo": "kg-nlp/PLOME",
"path": "/finetune_src/tagging_eval.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: streamlit/streamlit path: /lib/tests/streamlit/util_test.py
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# 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 Licens... | code_fim | hard | {
"lang": "python",
"repo": "streamlit/streamlit",
"path": "/lib/tests/streamlit/util_test.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> @parameterized.expand(
[
({"x": ["a"]}, "x", {"a"}),
({"a": ["a1"], "b": ["b1", "b2"]}, "a", {"a1"}),
({"c": ["c1", "c2"]}, "no_existing_key", set()),
(
{
"embed": ["true"],
"embed_options":... | code_fim | hard | {
"lang": "python",
"repo": "streamlit/streamlit",
"path": "/lib/tests/streamlit/util_test.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def add_allowed_program_families_to_nav_items(item_props_list):
for item_props in item_props_list:
_add_allowed_program_families_to_item(item_props)
def add_user_roles_to_nav_items(item_props_list):
for item_props in item_props_list:
_add_user_roles_to_item(item_props)
def add... | code_fim | hard | {
"lang": "python",
"repo": "masschallenge/django-accelerator",
"path": "/accelerator/sitetree_navigation/utils.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>def _add_user_roles_to_item(item_props):
allowed_user_roles = item_props.get('user_roles', [])
if not allowed_user_roles:
return
user_roles = UserRole.objects.filter(name__in=allowed_user_roles)
tree_item = NavTreeItem.objects.filter(alias=item_props["alias"]).first()
tree_ite... | code_fim | hard | {
"lang": "python",
"repo": "masschallenge/django-accelerator",
"path": "/accelerator/sitetree_navigation/utils.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: masschallenge/django-accelerator path: /accelerator/sitetree_navigation/utils.py
from accelerator.models import (
NavTree,
NavTreeItem,
UserRole,
Program,
ProgramFamily,
)
FLUENT_REDIRECT_URL = '/nav/fluent-redirect'
REGISTER_FOR_EVENTS_URL = '/events/'
def create_items(tr... | code_fim | hard | {
"lang": "python",
"repo": "masschallenge/django-accelerator",
"path": "/accelerator/sitetree_navigation/utils.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: JayjeetAtGithub/spack path: /var/spack/repos/builtin/packages/py-cffi/package.py
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from s... | code_fim | hard | {
"lang": "python",
"repo": "JayjeetAtGithub/spack",
"path": "/var/spack/repos/builtin/packages/py-cffi/package.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> def setup_build_environment(self, env):
# This sets the compiler (and flags) that distutils will use
# to create the final shared library. It will use the
# compiler specified by the environment variable 'CC' for all
# other compilation. We are setting 'LDSHARED' to t... | code_fim | hard | {
"lang": "python",
"repo": "JayjeetAtGithub/spack",
"path": "/var/spack/repos/builtin/packages/py-cffi/package.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: levinsamuel/coursera_datascience path: /course2_files/Assignment3.py
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import animation, gridspec, widgets, cm
from matplotlib.lines import Line2D
from matplotlib.patches im... | code_fim | hard | {
"lang": "python",
"repo": "levinsamuel/coursera_datascience",
"path": "/course2_files/Assignment3.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> ax2.set_frame_on(False)
ax2.tick_params(bottom=False, labelbottom=False, left=False, labelleft=False)
ax2.text(-0.1, 1, ("Directions: Click once to establish a single mean value to compare against "
"depicted means.\nClick and drag to establish a vertical range to assess... | code_fim | hard | {
"lang": "python",
"repo": "levinsamuel/coursera_datascience",
"path": "/course2_files/Assignment3.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: tsbxmw/allure-python path: /allure-pytest/test/status/xfail_setup_status_test.py
import pytest
@pytest.mark.xfail(run=False)
def test_xfail_with_run_false():
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_xf... | code_fim | hard | {
"lang": "python",
"repo": "tsbxmw/allure-python",
"path": "/allure-pytest/test/status/xfail_setup_status_test.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
@pytest.mark.xfail()
def test_xfail_fixture(broken_fixture):
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_xfail_fixture',
... with_status('skipped'),
... h... | code_fim | medium | {
"lang": "python",
"repo": "tsbxmw/allure-python",
"path": "/allure-pytest/test/status/xfail_setup_status_test.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> """
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_xfail_with_run_false_and_with_reason',
... with_status('skipped'),
... has_status_details(with_message_contains... | code_fim | medium | {
"lang": "python",
"repo": "tsbxmw/allure-python",
"path": "/allure-pytest/test/status/xfail_setup_status_test.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: MFernandez96/cars-python-cleaning path: /Country cleaning/Chile/BBDD/Unir.py
# %% IMPORTAR LIBRERIAS
import os
import pandas as pd
import numpy as np
import datetime
from vininfo import Vin # ORIGEN Y MARCA
from pyvin import VIN
# %% CARGA DE DATOS
BBDD = pd.read_csv(r'D:\Basededatos\Limpiopara... | code_fim | hard | {
"lang": "python",
"repo": "MFernandez96/cars-python-cleaning",
"path": "/Country cleaning/Chile/BBDD/Unir.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
# %% OBTENER ORIGIN SEGUN VIN
# CONDICIONES DE UN VIN VALIDO
sincaracter = base["NUMERO CHASIS / VIN"].str.isalnum() == True
cantidad = base["NUMERO CHASIS / VIN"].str.len() == 17
letras = base["NUMERO CHASIS / VIN"].str.contains('Q|O|I', regex=True) == False
# DIVIDIR BASE EN 2: CON Y SIN VIN
baseconv... | code_fim | hard | {
"lang": "python",
"repo": "MFernandez96/cars-python-cleaning",
"path": "/Country cleaning/Chile/BBDD/Unir.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
# %% ELIMINAR DATOS SIN PATENTE O CHASIS COMO ELEMENTO INDIVIDUALIZADOR
sinpatente = base["PATENTE"].isna()
sinvin = base["NUMERO CHASIS / VIN"].isna()
base = base.drop(base[sinpatente & sinvin].index)
# %% OBTENER ORIGIN SEGUN VIN
# CONDICIONES DE UN VIN VALIDO
sincaracter = base["NUMERO CHASIS / VIN"... | code_fim | hard | {
"lang": "python",
"repo": "MFernandez96/cars-python-cleaning",
"path": "/Country cleaning/Chile/BBDD/Unir.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: ostamand/dog-project-app path: /model/dog_classifier.py
from keras.callbacks import ModelCheckpoint
from keras.layers import GlobalAveragePooling2D
from keras.layers import Dropout, Dense
from keras.models import Sequential
from keras.applications.xception import Xception, preprocess_input
impor... | code_fim | hard | {
"lang": "python",
"repo": "ostamand/dog-project-app",
"path": "/model/dog_classifier.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> self.dog_names = ['Affenpinscher',
'Afghan hound',
'Airedale terrier',
'Akita',
'Alaskan malamute',
'American eskimo dog',
'American foxhound',
'American staffordshire terrier',
'American water spaniel',
'Anatolian shepherd do... | code_fim | hard | {
"lang": "python",
"repo": "ostamand/dog-project-app",
"path": "/model/dog_classifier.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sg0/Elemental path: /include/El/core/Element.py
ile in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
from environment import *
# Basic element manipulation
# ==========================
# Return the complex argument of a scalar
# ------------------------------------... | code_fim | hard | {
"lang": "python",
"repo": "sg0/Elemental",
"path": "/include/El/core/Element.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sg0/Elemental path: /include/El/core/Element.py
if type(alpha) is iType:
result = iType()
lib.ElAbs_i(alpha,pointer(result))
return result
elif type(alpha) is sType:
result = sType()
lib.ElAbs_s(alpha,pointer(result))
return result
elif type(alpha) is dType:
resu... | code_fim | hard | {
"lang": "python",
"repo": "sg0/Elemental",
"path": "/include/El/core/Element.py",
"mode": "psm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|>lib.ElAtan2_s.argtypes = [sType,sType,POINTER(sType)]
lib.ElAtan2_s.restype = c_uint
lib.ElAtan2_d.argtypes = [dType,dType,POINTER(dType)]
lib.ElAtan2_d.restype = c_uint
def Atan2(y,x):
if type(y) is sType:
result = sType()
lib.ElAtan2_s(y,x,pointer(result))
return result
elif type(y) is... | code_fim | hard | {
"lang": "python",
"repo": "sg0/Elemental",
"path": "/include/El/core/Element.py",
"mode": "spm",
"license": "BSD-3-Clause",
"source": "the-stack-v2"
} |
<|fim_suffix|> samples = augmenter(samples=samples, sample_rate=sample_rate)
self.assertEqual(samples.dtype, np.float32)
self.assertEqual(len(samples), 2048)
def test_multichannel(self):
num_channels = 3
samples = np.random.normal(0, 0.1, size=(num_channels, 5555)).astype(np... | code_fim | hard | {
"lang": "python",
"repo": "notmatthancock/audiomentations",
"path": "/tests/test_time_stretch.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: notmatthancock/audiomentations path: /tests/test_time_stretch.py
import unittest
import numpy as np
from audiomentations.augmentations.transforms import TimeStretch
class TestTimeStretch(unittest.TestCase):
def test_dynamic_length(self):
samples = np.zeros((2048,), dtype=np.float3... | code_fim | hard | {
"lang": "python",
"repo": "notmatthancock/audiomentations",
"path": "/tests/test_time_stretch.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>current = 0
visit = set()
color = [0] * (10 ** 5)
dfs(graph, current, visit, color)
for i in sorted(ans):
print(i+1)<|fim_prefix|># repo: FGtatsuro/myatcoder path: /beginner_contest/198/E.py
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
N = int(input())
C = list(map(int, input... | code_fim | hard | {
"lang": "python",
"repo": "FGtatsuro/myatcoder",
"path": "/beginner_contest/198/E.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: FGtatsuro/myatcoder path: /beginner_contest/198/E.py
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
N = int(input())
C = list(map(int, input().split()))
for i, v in enumerate(C):
C[i] = v-1
graph = [[] for _ in range(N)]
for _ in range(N-1):
A, B = map(int, input().... | code_fim | medium | {
"lang": "python",
"repo": "FGtatsuro/myatcoder",
"path": "/beginner_contest/198/E.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: whille/face_recognition path: /examples/my_facerec_rasp.py
# -*- coding: utf-8 -*-
# To run this, you need a Raspberry Pi 2 (or greater) with face_recognition and
# the picamera[array] module installed.
# You can follow this installation instructions to get your RPi set up:
# https://gist.github... | code_fim | hard | {
"lang": "python",
"repo": "whille/face_recognition",
"path": "/examples/my_facerec_rasp.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> print(bid_names)
output = np.empty((240, 320, 3), dtype=np.uint8)
while True:
print("Capturing image.")
camera.capture(output, format="rgb")
# Find all the faces and face encodings in the current frame of video
face_locations = face_recognition.face_locations(ou... | code_fim | hard | {
"lang": "python",
"repo": "whille/face_recognition",
"path": "/examples/my_facerec_rasp.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>
def most_like(lst, target):
min_v, argmin = 1e10, -1
for i, a in enumerate(lst):
v = np.linalg.norm(a - target)
if v < 0.6 and v < min_v:
min_v, argmin = v, i
if argmin >= 0:
print('most_like: %s, v: %s' % (argmin, min_v))
return argmin
def main(camer... | code_fim | hard | {
"lang": "python",
"repo": "whille/face_recognition",
"path": "/examples/my_facerec_rasp.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> # This is a slightly clunky check to know whether login required is
# applied but we're essentially specifying that all of our views need
# to inherit from a mixin that does have the login_required decorator
# applied
for pattern in urlpatterns:
view_cla... | code_fim | medium | {
"lang": "python",
"repo": "uktrade/dit-helpdesk",
"path": "/dit_helpdesk/cms/tests/test_login_required.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: uktrade/dit-helpdesk path: /dit_helpdesk/cms/tests/test_login_required.py
from django.test import TestCase
from ..views import BaseCMSMixin
from ..urls import urlpatterns
<|fim_suffix|> # This is a slightly clunky check to know whether login required is
# applied but we're essen... | code_fim | medium | {
"lang": "python",
"repo": "uktrade/dit-helpdesk",
"path": "/dit_helpdesk/cms/tests/test_login_required.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: hammer/data_pipeline path: /mrtarget/plugins/gene/uniprot.py
from yapsy.IPlugin import IPlugin
import jsonpickle
import base64
from elasticsearch_dsl import Search
from elasticsearch_dsl.query import MatchAll, Match
import logging
class ReactomeRetriever():
def __init__(self, es, index):
... | code_fim | hard | {
"lang": "python",
"repo": "hammer/data_pipeline",
"path": "/mrtarget/plugins/gene/uniprot.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>
index = es_config.uni.name
reactome_retriever = ReactomeRetriever(es, es_config.rea.name)
c = 0
for seqrec in Search().using(es).index(index).query(MatchAll()).scan():
#these are base 64 encoded json - need to decode
#TODO access the source directl... | code_fim | hard | {
"lang": "python",
"repo": "hammer/data_pipeline",
"path": "/mrtarget/plugins/gene/uniprot.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: sreeja/soteria_tool path: /specs/bank_one_client.spec
type ReplicaID = int;
const unique me:ReplicaID;
const nr : ReplicaID;
axiom 0 < nr;
axiom 0 <= me && me < nr;
type Txn;
const unique w:Txn;
const unique d:Txn;
function max(one:int, two:int) returns(int);
axiom(forall a:int :: max(a, a) == a... | code_fim | hard | {
"lang": "python",
"repo": "sreeja/soteria_tool",
"path": "/specs/bank_one_client.spec",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>{
(forall r:ReplicaID :: (0 <= r && r < nr) ==> (balances[r][d] - balances[r][w] >= min))
}
procedure deposit(value:int)
modifies balances;
requires value > 0;
ensures (balances[me][d] == old(balances)[me][d] + value);
ensures (forall r:ReplicaID :: ((r != me) ==> balances[r][d] == old(balances)[r][d]... | code_fim | hard | {
"lang": "python",
"repo": "sreeja/soteria_tool",
"path": "/specs/bank_one_client.spec",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>@gteq
function gteq_counter(balances1:[ReplicaID][Txn]int, balances2:[ReplicaID][Txn]int) returns(bool)
{
(forall r:ReplicaID :: (0 <= r && r < nr) ==> (balances1[r][d] >= balances2[r][d] && balances1[r][w] >= balances2[r][w]))
}
@invariant
function inv(balances:[ReplicaID][Txn]int) returns(bool)
{
(f... | code_fim | hard | {
"lang": "python",
"repo": "sreeja/soteria_tool",
"path": "/specs/bank_one_client.spec",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|>verbose_name='ID')),
('question', models.TextField()),
('op1', models.CharField(max_length=200, verbose_name='Option1')),
('op2', models.CharField(max_length=200, verbose_name='Option2')),
('op3', models.CharField(max_length=200, verbose_name... | code_fim | hard | {
"lang": "python",
"repo": "SJIT-Hackerspace/SJIT-CodingPortal",
"path": "/Questions/migrations/0001_initial.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|>ngth=200, verbose_name='Option2')),
('op3', models.CharField(max_length=200, verbose_name='Option3')),
('op4', models.CharField(max_length=200, verbose_name='Option4')),
('Answer', models.CharField(max_length=200)),
('subCategory', models.Cha... | code_fim | hard | {
"lang": "python",
"repo": "SJIT-Hackerspace/SJIT-CodingPortal",
"path": "/Questions/migrations/0001_initial.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: SJIT-Hackerspace/SJIT-CodingPortal path: /Questions/migrations/0001_initial.py
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-09-11 11:39
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
... | code_fim | hard | {
"lang": "python",
"repo": "SJIT-Hackerspace/SJIT-CodingPortal",
"path": "/Questions/migrations/0001_initial.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: jvpersuhn/vasconcelos path: /Ex13/app/history/model.py
import datetime
from Ex13.database import db
class Empresa(db.Model):
<|fim_suffix|> id = db.Column(db.Integer, primary_key=True)
nome = db.Column(db.String(45))
confiabilidade = db.Column(db.Float())
def serialize(self):
... | code_fim | easy | {
"lang": "python",
"repo": "jvpersuhn/vasconcelos",
"path": "/Ex13/app/history/model.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> return {'id': self.id,
'nome' : self.nome,
'confiabilidade' : self.confiabilidade
}<|fim_prefix|># repo: jvpersuhn/vasconcelos path: /Ex13/app/history/model.py
import datetime
from Ex13.database import db
class Empresa(db.Model):
__tablename__ ... | code_fim | easy | {
"lang": "python",
"repo": "jvpersuhn/vasconcelos",
"path": "/Ex13/app/history/model.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: demisto/demisto-sdk path: /demisto_sdk/commands/create_id_set/create_id_set.py
import os
from collections import OrderedDict
from pathlib import Path
from typing import Optional
from genericpath import exists
from demisto_sdk.commands.common.constants import (
GENERIC_COMMANDS_NAMES,
Ma... | code_fim | hard | {
"lang": "python",
"repo": "demisto/demisto-sdk",
"path": "/demisto_sdk/commands/create_id_set/create_id_set.py",
"mode": "psm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> playbooks_list = self.id_set["playbooks"]
for playbook_dict in playbooks_list:
playbook_name = list(playbook_dict.keys())[0]
playbook_data = playbook_dict[playbook_name]
commands_to_integration = playbook_data.get("command_to_integration", {})
... | code_fim | hard | {
"lang": "python",
"repo": "demisto/demisto-sdk",
"path": "/demisto_sdk/commands/create_id_set/create_id_set.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_suffix|> self.add_command_to_implementing_integrations_mapping()
self.save_id_set()
return self.id_set, excluded_items_by_pack, excluded_items_by_type
def add_command_to_implementing_integrations_mapping(self):
"""
Modifies playbook set in id_set dictionary once it was ... | code_fim | hard | {
"lang": "python",
"repo": "demisto/demisto-sdk",
"path": "/demisto_sdk/commands/create_id_set/create_id_set.py",
"mode": "spm",
"license": "MIT",
"source": "the-stack-v2"
} |
<|fim_prefix|># repo: feitiandemiaomi/seg-for-fun path: /data/code/dygraph/models/fcn.py
# Copyright (c) 2020 PaddlePaddle 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 the ... | code_fim | hard | {
"lang": "python",
"repo": "feitiandemiaomi/seg-for-fun",
"path": "/data/code/dygraph/models/fcn.py",
"mode": "psm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
<|fim_suffix|> return FCN(backbone='HRNet_W18_Small_V2', in_channels=270, **kwargs)
@manager.MODELS.add_component
def fcn_hrnet_w18(*args, **kwargs):
return FCN(backbone='HRNet_W18', in_channels=270, **kwargs)
@manager.MODELS.add_component
def fcn_hrnet_w30(*args, **kwargs):
return FCN(backbone='HRNet_W3... | code_fim | hard | {
"lang": "python",
"repo": "feitiandemiaomi/seg-for-fun",
"path": "/data/code/dygraph/models/fcn.py",
"mode": "spm",
"license": "Apache-2.0",
"source": "the-stack-v2"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.