seed stringlengths 1 14k | source stringclasses 2
values |
|---|---|
def test_wrong_float_type():
"""
In this test we check error when we received wrong float type.
"""
assert FloatMapper({"field": "string"}).is_valid() is False
assert FloatMapper({"field": []}).is_valid() is False
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"pos": output_pos[i]
}
result.append(output)
return result
def run_inference(self, data):
self.logger.info("Received " + data + " for inference--!!")
tokens, valid_positions = self.preprocess.tokenize(copy.copy(data))
tags, pos_s = self.__pr... | ise-uiuc/Magicoder-OSS-Instruct-75K |
{
public partial class SettingsForm : Form
{
public SettingsForm()
{
InitializeComponent();
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if (num[pos] == '0') {
break;
}
}
}
public:
vector<string> addOperators(string num, int target) {
if (num.size() == 0)
{
| ise-uiuc/Magicoder-OSS-Instruct-75K |
/// </summary>
/// <remarks>
/// This class is used to define request parameters that can only take certain string values.
/// We use it instead of defining a regular <c>enum</c> with
/// <see cref="System.Runtime.Serialization.EnumMemberAttribute"/> annotations for
/// serialization because <c>... | ise-uiuc/Magicoder-OSS-Instruct-75K |
VERSION = '0.7.0.dev'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
SNAKUR1XHNIT(300),
// y hnit snáka í eins og tveggja leikmanna útgáfu
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export function map<T, U>(o: Record<string, T>, f: (o: T, key: string, index: number) => U): Record<string, U>;
export function map<T, U>(o: Record<string, T> | ReadonlyMap<unknown, T>, f: (o: T, key: string, index: number) => U) {
if (o instanceof Map) {
return new Map(mapIterator(o.entries(), ([k, v]) => ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
def getCheckTags(key):
try:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
and a list with the interests paid '''
bal_st = [N]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
elapsed = time.time() - start
print(f'Finished execution after {elapsed} seconds.')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import com.venky.core.collections.SequenceSet;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<?php dynamic_sidebar( 'sidebar1' ); ?>
<?php endif; ?>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
skip = True
if skip:
continue
pos = mod.GetPosition()
rot = mod.GetOrientationDegrees()
desc = mod.GetDescription()
layer = board.GetLayerName(mod.GetLayer())
mid_x = Decimal(pos[0]) / Decimal(1000000)
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
alg.aStar()
if __name__ == "__main__":
main()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>SteveMitto/neighborhood<filename>neigh1/migrations/0018_auto_20191027_2207.py
# Generated by Django 2.2.5 on 2019-10-27 19:07
from django.db import migrations
class Migration(migrations.Migration):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
assert len(got) == 1
# TODO: data_in is not the same as data_out??
data_out = got[0]
assert data_out["id"] == 1 # extra key, once in db
# get
response = client.get("/v0/dags/1")
assert response.status_code == 200
assert response.json() == data_out
# delete
response = client.d... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>RuanBarretodosSantos/python
cont = 3
t1 = 0
t2 = 1
print('-----' * 12)
print('Sequência de Fibonacci')
print('-----' * 12)
valor = int(input('Quantos termos você quer mostrar ? '))
print('~~~~~' * 12)
print(f'{t1} ➙ {t2} ' , end='➙ ')
while cont <= valor:
t3 = t1 + t2
print(f' {t3}', end=' ➙ ')
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
protected $fillable = ['id_ketua_kelas', 'kelas', 'tipe_kelas', 'created_at', 'updated_at', 'deleted_at'];
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class Parsing extends Facade
{
/**
* Get the registered name of the component.
*
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return Binding.DoNothing;
}
} | ise-uiuc/Magicoder-OSS-Instruct-75K |
if (r.json().get('continuation')):
print(r.json()['continuation'])
| ise-uiuc/Magicoder-OSS-Instruct-75K |
__version__ = "0.12.1.dev0"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print('Pay: ', pay)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
edges.append(binary_edge(edge_index, factor_index, var_map[vid[0]], var_map[vid[1]]))
for id in vid:
fmap[fmp_index]["vid"] = var_map[id]
# To support subsequent binary-factor functionalization
if self.features[feature_id]['parameterize'] == 1:
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
static func getRandomLocation(size rectSize: CGSize, screenSize: CGSize) -> CGPoint {
// Get the screen dimensions
let screenWidth = screenSize.width
let screenHeight = screenSize.height - 100.0
// Create a random location/point
let rectX = randomFloatZeroThroughOne() * (screenWidth - rectSize.w... | ise-uiuc/Magicoder-OSS-Instruct-75K |
pub fn read<W>(&mut self, bytes: W, offset: libc::off_t, event_queue: &mut EventQueue) -> SyscallResult
where W: std::io::Write + std::io::Seek
);
```
**/
macro_rules! enum_passthrough_generic {
($self:ident, $args2:tt, $($variant:ident),+; $v:vis fn $name:ident <$($generics:ident),+> $args:tt $(-> $($rv:tt... | ise-uiuc/Magicoder-OSS-Instruct-75K |
* <p>
* [1,2,1], [1,1,2]
* 输出: false
* @author xiehai
* @date 2019/07/23 11:19
* @Copyright(c) tellyes tech. inc. co.,ltd
*/
public class Solution100 {
public boolean isSameTree(TreeNode p, TreeNode q) {
return
| ise-uiuc/Magicoder-OSS-Instruct-75K |
device.display(&[receipt]);
})
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// Initialize all of the views
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export declare function sha512gen_salt(): string;
export declare function crypt(plain_text: any, _salt: any): any;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
export default BindComponentProps(bindStateToProps)(Card);
| ise-uiuc/Magicoder-OSS-Instruct-75K |
:return: (X_train, Y_train), (X_test, Y_test)
dtype: ndarry
'''
print('load train data...')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
for dir in ${NANORC_DIRS[@]}
do
echo '##################### generated by enable-syntax.sh' >> ~/.nanorc
find ${dir} -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc
done
| ise-uiuc/Magicoder-OSS-Instruct-75K |
var member = AutoMapper.Mapper.Map<MemberViewModel, Member>(model);
if (isEdit)
{
try
{
_unitOfWork.MemberRepositories.InsertEditMember(member);
}
catch (Exc... | ise-uiuc/Magicoder-OSS-Instruct-75K |
}
sync_module = self.blink.sync["test"]
sync_module.cameras = {"foo": None}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
</li>
<li className="menu-item py-1">
<a href="#" className="menu-link px-3">
<span className="menu-icon">
<KTSVG
className="svg-icon-1"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return torch.autograd.grad(loss, training_variables, create_graph=False)[0].numpy()
# optimization function with Jacobian from pytorch
trained_variances = optimize.minimize(evidence_loss_fn_np, evidence_training_variables,
jac=evidence_loss_jaco... | ise-uiuc/Magicoder-OSS-Instruct-75K |
orm_regression(executed)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from genetica.dna import DNA, genify
from genetica.model import Genetica | ise-uiuc/Magicoder-OSS-Instruct-75K |
job.set_status(JobLifeCycle.STOPPED, message='Stop triggered by the cleaning hook.')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
* - ctr: string, по цтр
*/
public $order = 'ctr';
/**
* @var int Сколько роликов выводить
*/
public $limit = 20;
/**
* @var string Ограничение по времени
*/
public $timeAgoLimit = 'all-time';
| ise-uiuc/Magicoder-OSS-Instruct-75K |
class AttributeAutoValueMapping(models.Model):
"""A single key-value pair related to an auto value attribute pair"""
auto_attr = models.ForeignKey(
AttributeAutoValue,
on_delete=models.CASCADE,
related_name="value_map",
verbose_name=_("attribute link"),
)
key_str = models... | ise-uiuc/Magicoder-OSS-Instruct-75K |
private RandomNumberGenerator rng = RandomNumberGenerator.Create();
public byte[] GetBytes(int length) {
byte[] b = new byte[length];
rng.GetBytes(b);
return b;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
print 'Usage: python main.py predict [predict file]'
sys.exit()
image = process_image(sys.argv[2])
# Define a new input function for prediction which outputs a single image
| ise-uiuc/Magicoder-OSS-Instruct-75K |
await message.reply("Button!", component=row)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "RteModelTestConfig.h"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
handled_types = ['application/wavefront-obj',
'application/fbx']
def __init__(self):
IAnalyzer.__init__(self)
def activate(self):
pass
def analyze(self, an_uri):
fileid = FileId(filename=os.path.abspath(an_uri))
file_descr = FileDescription(file=fi... | ise-uiuc/Magicoder-OSS-Instruct-75K |
self.graph[d]['keyd'] = torch.cat(keyd1[:-1] + keyd2[-1:], dim=0)
def add_node_xyzd(self):
xyz1, xyz2 = [], []
for d in range(self.full_depth, self.depth + 1):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return jinja_context
def template_render(filename, template_path, render_type, context):
'''
render the jinja template using the context value from config_variables.yaml
:param filename: name of the template file
:param template_path: path for the template file
:param render_type: type if full... | ise-uiuc/Magicoder-OSS-Instruct-75K |
#include <tiramisu/core.h>
#include <tiramisu/debug.h>
#include <tiramisu/tiramisu.h>
#include <string.h>
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Revises: 1e0b1d3e3cca
Create Date: 2016-09-08 09:59:15.023182
"""
# revision identifiers, used by Alembic.
revision = '9aa153cb12a4'
down_revision = '1e0b1d3e3cca'
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# coding=utf-8
"""
Definition of constants.
"""
from xbmcswift2.plugin import Plugin
PLUGIN = Plugin()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
use game::{MessageType, Message};
pub trait Language {
fn translate_repeated(&self, message_type: MessageType, repeated: usize, message: &mut Message);
fn translate(&self, message_type: MessageType, message: &mut Message) {
self.translate_repeated(message_type, 1, message);
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
plt.close() | ise-uiuc/Magicoder-OSS-Instruct-75K |
def maxlinedev(x, y):
# Number of points is the size of the input array.
num_pts = len(x)
# Check whether array has enough points to form a contour.
if num_pts == 1:
# print "error: contour of length 1."
maxdev = 0
index_max = 1
dist_contour = 1
return maxdev, in... | ise-uiuc/Magicoder-OSS-Instruct-75K |
"nwmwjcgrqiwgfqel",
"wjgxmebfmyjnxyyp",
"durpspyljdykvzxf",
"zuslbrpooyetgafh",
"kuzrhcjwbdouhyme",
"wyxuvbciodscbvfm",
"kbnpvuqwmxwfqtqe",
"zddzercqogdpxmft",
"sigrdchxtgavzzjh",
"lznjolnorbuddgcs",
"ycnqabxlcajagwbt",
"bnaudeaexahdgxsj",
"rlnykxvoctfwanms",
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def get_all_posts():
posts = db(db.posts).select() #get all posts entries in post table
post_list = []
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Returns:
Zero if the inlining was successful; a non-zero value otherwise.
"""
command = _generateHandlerCommand(projectConfig, HandlerMode.DETECTOR)
proc = subprocess.call(command, shell=True)
return proc
def runUnroller(projectConfig):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
pass
if __name__ == '__main__':
unittest.main()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
let descriptors = [
PacketDescriptor::new(60, false).unwrap(),
PacketDescriptor::new(60, true).unwrap(),
];
simulate_handshake(descriptors.as_ref(), data.as_ref(), &mut output);
});
| ise-uiuc/Magicoder-OSS-Instruct-75K |
#===============================================================================
output = 'output_figs/'
#------------------------------------------------------------------------------#
# Load in the summary csv file
#------------------------------------------------------------------------------#
df = pd.read_csv('Re... | ise-uiuc/Magicoder-OSS-Instruct-75K |
'url': data['images']['icon'],
'type': {
'value': data['type'],
'displayValue': (
self.l(data['type']).get_text()
),
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def dataset_url(code):
return f"{FAIR_API_ENDPOINT}{code}"
| ise-uiuc/Magicoder-OSS-Instruct-75K |
$breadcrumbs_data=$breadcrumbs->name_ne." ".$breadcrumbs->last_name." [".$breadcrumbs->name_ur."]";
return View::make("dashboard.reports.report",['reporte'=> $reporte, 'breadcrumbs_data' => $breadcrumbs_data]);
}
public function GeneraReportePagos()
{
$user_id=Auth::user()->id;
ini_set('max_execution_ti... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return np.hstack([X, new_columns])
@staticmethod
def update_tabu_edges(
idx_group: List[int],
tabu_edges: List[Tuple[int, int]],
tabu_idx_group: bool,
) -> List[Tuple[int, int]]:
"""
Tabu edges are:
| ise-uiuc/Magicoder-OSS-Instruct-75K |
reverse: true,
holo: false,
firstEdition: false
},
stage: "Stage2",
| ise-uiuc/Magicoder-OSS-Instruct-75K |
import { DiscoveryModule } from '@golevelup/nestjs-discovery'
import { ModuleRef } from '@nestjs/core'
import { DynamicModule, Global, Module, OnModuleDestroy, OnModuleInit } from '@nestjs/common'
import { AMQPContainer } from './amqp.container'
import { AMQPExplorer } from './amqp.explorer'
import { getAMQPConnectionO... | ise-uiuc/Magicoder-OSS-Instruct-75K |
from models.losses.perceptual_loss import PerceptualLoss
from models.losses.ssim_loss import SSIM
from torch.optim.lr_scheduler import StepLR
from tqdm import tqdm
class ImageDeblur:
def __init__(self, opt):
self.opt = opt
| ise-uiuc/Magicoder-OSS-Instruct-75K |
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this... | ise-uiuc/Magicoder-OSS-Instruct-75K |
<reponame>diegodlh/operations-software-tools-webservice
from .backend import Backend
from .gridengine import GridEngineBackend
from .kubernetes import KubernetesBackend
__all__ = [Backend, GridEngineBackend, KubernetesBackend]
| ise-uiuc/Magicoder-OSS-Instruct-75K |
double dx1, double dy1,
double dx2, double dy2,
double lw1, double lw2,
Region clip,
int b... | ise-uiuc/Magicoder-OSS-Instruct-75K |
"description": description,
"is_active": random.choice([True, False]),
}
return result
| ise-uiuc/Magicoder-OSS-Instruct-75K |
lazy_import('sage.symbolic.expression', 'PynacConstant', deprecation=32386)
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from dropconnect_tensorflow.dropconnect_tensorflow import DropConnectDense, DropConnectConv2D, DropConnect
| ise-uiuc/Magicoder-OSS-Instruct-75K |
public protocol ImageCache {
/// Adds the image to the cache with the given identifier.
func add(_ image: Image, withIdentifier identifier: String)
/// Removes the image from the cache matching the given identifier.
func removeImage(withIdentifier identifier: String) -> Bool
/// Removes all images... | ise-uiuc/Magicoder-OSS-Instruct-75K |
use serde::Deserialize;
use serde::Serialize;
///
/// The contract representation.
///
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct Contract {
/// The `solc` hashes output.
#[serde(skip_serializing_if = "Option::is_none")]
pub hashes: Option<BTreeMap<String, Strin... | ise-uiuc/Magicoder-OSS-Instruct-75K |
export class PriorityQueue {
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
partner_id = fields.Many2one('res.partner', string='Partner')
@api.multi
def action_context_demo(self):
# if self._context.get('context_data', False):
if self.env.context.get('context_data'):
raise ValidationError('have context data')
raise ValidationError('hello')
| ise-uiuc/Magicoder-OSS-Instruct-75K |
if n.localName() in ('a', 'au', 'aq'):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"ip-address": vpn_binding.ipaddress
}
],
"network-id": network_id,
"admin-state-up": "true",
"neutron-binding:vnic-type": "normal",
"neutron-binding:host-id": port.host_id,
"neutro... | ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* @param string $address2
*/
public function setAddress2(?string $address2)
{
$this->address2 = $address2;
}
/**
* @return string
*/
public function getCity(): ?string
{
return $this->city;
| ise-uiuc/Magicoder-OSS-Instruct-75K |
os.chmod(nugetExe, st.st_mode | stat.S_IEXEC)
if (sys.platform != "win32"):
# shutil.which can be used for python 3.3 or later, instead.
for mono in ["/usr/bin/mono", "/usr/local/bin/mono"]:
if os.path.exists(mono):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
def process_instructions(self, instructions: List[Instruction]) -> NoReturn:
for instruction in instructions:
if Axis.is_axis(instruction.action):
self.move(Axis(instruction.action), instruction.value)
elif Direction.is_direction(instruction.action):
... | ise-uiuc/Magicoder-OSS-Instruct-75K |
// Already empty word should result in Zero fields
];
// With splitting
assert_eq!(At.eval(true, &env), Some(Fields::At(fields_args.clone())));
assert_eq!(Star.eval(true, &env), Some(Fields::Star(fields_args)));
let fields_foo_bar = Fields::Split(vec![
"foo".to_owned(),
"".... | ise-uiuc/Magicoder-OSS-Instruct-75K |
if i == 0 or j == 0:
dp[i][j] = 0
elif a[i - 1] == b[j - 1]:
dp[i][j] = 1 + dp[i - 1][j - 1]
else:
dp[i][j] = max(dp[i - 1][j], dp[i][j - 1])
lcs = dp[x][y]
return (len(a) - lcs) + (len(b) - lcs)
def main():
f... | ise-uiuc/Magicoder-OSS-Instruct-75K |
except (EOFError, KeyboardInterrupt):
print()
break
except ValueError:
print("Invalid guess")
break
print()
guess = check_same(guess, output)
tries = check_letter(guess, word, tries)
if check_finished(output, tries):
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<form method="POST" action="{{ route('students.store') }}">
@csrf
<div class="form-group">
<label for="nameStudent" class="control-label">Nombres</label>
<input type="text" class="form-control onlyLetter" id="nameStudent" name="nameSt... | ise-uiuc/Magicoder-OSS-Instruct-75K |
/**
* 是否返回base64编码的数据
*/
private boolean base64Encoded = false;
/**
* 忽略不存在的文件
*/
private boolean ignoreNonExistent = false;
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
{
}
@Override
public void changeState(TCPHandler h)
{
// TODO Auto-generated method stub
h.setState(new WriteState());
}
@Override
public void handle(TCPHandler h, SelectionKey sk, SocketChannel sc,
| ise-uiuc/Magicoder-OSS-Instruct-75K |
return redirect()->route('roles.index')->with('success', 'The resource has been deleted successfully.');
}
}
| ise-uiuc/Magicoder-OSS-Instruct-75K |
res.append(repeatedNum)
missingNum = (set(stdList) - set(nums)).pop()
res.append(missingNum)
return res
| ise-uiuc/Magicoder-OSS-Instruct-75K |
obs.next(<Status>{ Code: 0, Message: 'Success' });
} else {
this.error.next(result.Status);
obs.next(result.Status);
}
},
(err) => {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Update Pricing</div>
<div class="panel-body">
On this page, you can updat... | ise-uiuc/Magicoder-OSS-Instruct-75K |
def mock_usa_request(repeats=2):
k_s = random.randint(1, len(samples))
s = random.sample(samples, k=k_s)
k_v = random.randint(1, len(variables))
v = random.sample(variables, k=k_v)
u = random.choice(users)
params = {
"samples[]": s,
| ise-uiuc/Magicoder-OSS-Instruct-75K |
"""
import logging
from random import randint
from website.app import setup_django
setup_django()
from django.apps import apps
from django.contrib.auth.models import Permission, Group
from osf.utils.permissions import PERMISSIONS, reduce_permissions
from osf.models import AbstractNode, Contributor, Preprint, Node, R... | ise-uiuc/Magicoder-OSS-Instruct-75K |
CryptError {
errno: libc::EINVAL,
desc: Some(desc),
}
}
pub fn errno(&self) -> c_int {
| ise-uiuc/Magicoder-OSS-Instruct-75K |
from configparser import ConfigParser
import subprocess
import plexapi
import schedule
import time
from datetime import datetime
import re
from colorama import Fore, Back, Style
import socket
from urllib import parse
from plexapi.server import PlexServer
config_object = ConfigParser()
| ise-uiuc/Magicoder-OSS-Instruct-75K |
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE ... | ise-uiuc/Magicoder-OSS-Instruct-75K |
return salary
| ise-uiuc/Magicoder-OSS-Instruct-75K |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.