prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>composition_query.py<|end_file_name|><|fim▁begin|>from citrination_client.search.pif.query.chemical.chemical_field_operation import ChemicalFieldOperation
from citrination_client.search.pif.query.core.base_object_query import BaseObjectQuery
from citrination_client.search.pif.query.core.field_operation imp... | @property
def ideal_atomic_percent(self):
return self._ideal_atomic_percent |
<|file_name|>command.go<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2017 The "MysteriumNetwork/node" Authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the L... |
func parseServiceOptions(serviceType string, args ...string) (service.Options, error) {
var flags []cli.Flag |
<|file_name|>Enemy.java<|end_file_name|><|fim▁begin|>package sprites;
public class Enemy extends Paddle
{
public Enemy(int x, int y)
{
super(x,y);
}
int updateFrameCounter = 0;
float moveDirection = 0;
public void update(float dt, Ball ball)
{
//if(++updateFrameCounter%3==0)
//{
updateFrameCoun... | //}
setVVelocity(moveDirection, dt);
|
<|file_name|>fsevents-with-hack.js<|end_file_name|><|fim▁begin|><|fim▁hole|>var chokidar = require('chokidar');
process.chdir(__dirname + '/../');
chokidar.watch('.', {ignoreInitial: true, useFsEvents: true}).on('all', function(event, path) {
console.log(new Date, event, path);
});<|fim▁end|> | |
<|file_name|>int_log.rs<|end_file_name|><|fim▁begin|>//! This tests the `Integer::{log,log2,log10}` methods. These tests are in a
//! separate file because there's both a large number of them, and not all tests
//! can be run on Android. This is because in Android `log2` uses an imprecise
//! approximation:https://gith... | #[test] |
<|file_name|>console_play.rs<|end_file_name|><|fim▁begin|>use clap::App;
use std::default::Default;
use thud_game;
use thud_ui_common;
use thud_ui_console;
fn main() {
let mut agents = thud_ui_common::agent_registry::AgentRegistry::new();
agents
.register(Box::new(
thud_ui_common::agent_registry::StdinAg... | |
<|file_name|>logs.component.ts<|end_file_name|><|fim▁begin|>import { Component, AfterViewInit, OnInit, ChangeDetectorRef } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { TdLoadingService, TdMediaService } from '@covalent/core';
import { ItemsService, ProductsService } from '../.... | selector: 'ag-logs',
templateUrl: './logs.component.html',
styleUrls: ['./logs.component.scss'],
viewProviders: [ ItemsService, ProductsService ], |
<|file_name|>_hoverlabel.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class HoverlabelValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="hoverlabel", parent_name="scattermapbox", **kwargs):
super(HoverlabelValidator, self).__init__(
... | bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font |
<|file_name|>repo.go<|end_file_name|><|fim▁begin|>// Copyright 2014 The Gogs Authors. All rights reserved.
// Copyright 2020 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package repo
import (
"fmt"
"net/url"
"os"
"p... | Name: form.RepoName,
Description: form.Description, |
<|file_name|>opaque_pointer.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
/// <div rustbindgen opaque></div>
#[repr(C)]
#[repr(align(4))]
#[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OtherOpaque {
pub _... | unsafe {
&(*(::std::ptr::null::<WithOpaquePtr>())).whatever as *const _ |
<|file_name|>pakbase.py<|end_file_name|><|fim▁begin|>"""
pakbase module
This module contains the base package class from which
all of the other packages inherit from.
"""
from __future__ import print_function
import os
import webbrowser as wb
import numpy as np
from numpy.lib.recfunctions import stack_arrays
f... | |
<|file_name|>imdb.py<|end_file_name|><|fim▁begin|># Copyright (c) 2016 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 License at
#
# http://www.apache.org/... | |
<|file_name|>node-inspector.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | /**
* Dummy file for grunt-nodemon to run node-inspector task
*/ |
<|file_name|>SFContentBlockerManager.java<|end_file_name|><|fim▁begin|>/*
Copyright 2014-2016 Intel Corporation
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
http://www.apache.org/licenses/LI... | @Selector("description") |
<|file_name|>pisa_util.py<|end_file_name|><|fim▁begin|># -*- coding: ISO-8859-1 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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
#
# http:... | return getattr(self._delegate, name)
except AttributeError: |
<|file_name|>flow.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Servo's experimental layout system builds a tree of `Flow` ... | fn is_table_cell(self) -> bool {
match self.class() {
FlowClass::TableCell => true, |
<|file_name|>naver.py<|end_file_name|><|fim▁begin|># coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
update_url_query,
)
class NaverIE(InfoExtractor):
_VALID_URL = r'https?://(?:m\.)?tv(?:cast)?\.naver\.com/v/(... | |
<|file_name|>control.py<|end_file_name|><|fim▁begin|>import os
import rospy
import rospkg
from python_qt_binding import QT_BINDING
from rqt_gui_py.plugin import Plugin
from python_qt_binding import loadUi
from python_qt_binding.QtCore import QTimer
# Attempt to load QWidget from pyqt4
try:
from python_qt_binding.... | |
<|file_name|>fluidsub_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Tests.
"""
import unittest
from bruges.rockphysics import fluidsub
# Inputs... GAS case
vp_gas = 2429.0
vs_gas = 1462.4
rho_gas = 2080.
# Expected outputs... BRINE case
vp_brine = 2850.5
vs_brine = 1416.1
rho_brine = 2210.0
phi =... | rhow=rhow,
sw=sw,
swnew=swnew,
khc=khc, |
<|file_name|>signus.rs<|end_file_name|><|fim▁begin|>use futures::Future;
use indy::did;
use settings;
use utils::libindy::wallet::get_wallet_handle;
use error::prelude::*;<|fim▁hole|> if settings::indy_mocks_enabled() {
return Ok((::utils::constants::DID.to_string(), ::utils::constants::VERKEY.to_string()))... |
pub fn create_and_store_my_did(seed: Option<&str>, method_name: Option<&str>) -> VcxResult<(String, String)> { |
<|file_name|>_separatethousands.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
<|fim▁hole|> self,
plotly_name="separatethousands",
parent_name="scattermapbox.marker.colorbar",
**kwargs
):
super(SeparatethousandsValidator, self).__init__(
plotly... |
class SeparatethousandsValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__( |
<|file_name|>guard.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Machinery to conditionally expose things.
use js::jsapi::... |
/// A condition to expose things. |
<|file_name|>process_start_request.go<|end_file_name|><|fim▁begin|>package dto
<|fim▁hole|>type ProcessStartRequest struct {
Variables VariableList `json:"variables"`
}<|fim▁end|> | |
<|file_name|>draw_cache.rs<|end_file_name|><|fim▁begin|>use std::cell::RefCell;
use std::fmt;
use ggez::{
graphics::{BlendMode, DrawParam, Drawable},
Context, GameResult,
};
pub trait TryIntoDrawable<T>
where
T: Drawable,
{
fn try_into_drawable(&self, ctx: &mut Context) -> GameResult<T>;
}
pub stru... |
impl<T, U> Drawable for DrawCache<T, U>
where |
<|file_name|>move_export.py<|end_file_name|><|fim▁begin|>from openerp import models, api, _
from openerp.exceptions import UserError
class ExportMoveExport(models.TransientModel):
_name = 'export.move.export'
_description = 'Export Moves'
@api.multi<|fim▁hole|> def create_export_file(self):
con... | |
<|file_name|>gulpfile.js<|end_file_name|><|fim▁begin|><|fim▁hole|>
gulp.task('test', function() {
new karma.Server({configFile: __dirname + '/karma.conf.js', reporters: 'dots'}).start();
var content = fs.readFileSync('copyAndRenameTest.js');
console.log(content);
});<|fim▁end|> | var gulp = require('gulp');
var karma = require('karma');
var fs = require('fs'); |
<|file_name|>453.cpp<|end_file_name|><|fim▁begin|>class Solution {<|fim▁hole|> sort(nums.begin(), nums.end());
int ans = 0;
for(int i = 1; i < nums.size(); i++){
ans += nums[i] - nums[0];
}
return ans;
}
};<|fim▁end|> | public:
int minMoves(vector<int>& nums) { |
<|file_name|>0005_auto_20180717_1615.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-17 21:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('book', '0004_auto_2018... | name='authors', |
<|file_name|>TerminateInstanceInAutoScalingGroupResult.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2010-2011 Amazon.com, Inc. or its affiliates. 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.
* A copy... | |
<|file_name|>tree_reduce.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file ostap/frames/tree_reduce.py
# Helper module to "Reduce" tree using frames
# @see Ostap::DataFrame
# @see ROOT::RDataFrame
# ... | result = Chain ( reduced.chain ) |
<|file_name|>FileInputStreamTest.java<|end_file_name|><|fim▁begin|>package org.github.mervyn.io;
import static org.junit.Assert.*;
<|fim▁hole|>import java.io.IOException;
import java.io.InputStream;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @ClassName: FileIn... | import java.io.File;
import java.io.FileInputStream;
|
<|file_name|>lt.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>mod tests {
// impl<A, B> PartialEq<[B]> for [A] where A: PartialEq<B> {
// fn eq(&self, other: &[B]) -> bool {
// self.len() == other.len() &&
// order::eq(self.iter(), other.iter())
// }
// fn ne(&self,... | #![feature(core)]
extern crate core;
#[cfg(test)] |
<|file_name|>snmp-test.py<|end_file_name|><|fim▁begin|>from snmp_helper import snmp_get_oid,snmp_extract
COMMUNITY_STRING = 'galileo'
SNMP_PORT = 161
IP = '184.105.247.70'
a_device = (IP, COMMUNITY_STRING, SNMP_PORT)<|fim▁hole|>print output<|fim▁end|> | OID = '1.3.6.1.2.1.1.1.0'
snmp_data = snmp_get_oid(a_device, oid=OID)
output = snmp_extract(snmp_data) |
<|file_name|>section_positive_test1.java<|end_file_name|><|fim▁begin|>//Pyjama compiler version:v1.5.3
package PyjamaCode.TestingDirectives.Sections;
import pj.Pyjama;
import pj.pr.*;
import pj.PjRuntime;
import pj.Pyjama;
import pi.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicBoolean;
i... | } |
<|file_name|>partsum1.cpp<|end_file_name|><|fim▁begin|>// STLport regression testsuite component.
// To compile as a separate example, please #define MAIN.
#include <iterator>
#include <vector>
#include <algorithm><|fim▁hole|>#include <iterator>
#ifdef MAIN
#define partsum1_test main
#endif
#if !defined (STLPORT) |... | #include <iostream>
#include <numeric> |
<|file_name|>AssertWrapper.java<|end_file_name|><|fim▁begin|>package junit.util;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;
/**
* JUnit4からのassertThatアサーションを使いやすくするためのラッパー処理群。<br>
* isのためのimportが面倒、Boxingは避けたいという御仁向け。<br>
* assertThatのシグネチャが改善される可能性を考慮してメソッド名は別名にしています。
*
* @aut... | assertThat(message, Long.valueOf(actual), is(Long.valueOf(expected)));
}
public static void assertThatWrapper(String actual, String expected, String message) { |
<|file_name|>WebAssetStatementDeserializerTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2016 The OpenYOLO 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 Licen... | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<|file_name|>blocklist-file.rs<|end_file_name|><|fim▁begin|>#![allow(
dead_code,
non_snake_case,
non_camel_case_types,
non_upper_case_globals
)]
#[repr(C)]
#[derive(Debug, Default, Copy, Clone)]
pub struct SizedIntegers {
pub x: u8,
pub y: u16,
pub z: u32,
}
#[test]
fn bindgen_test_layout_S... | },
4usize,
concat!(
"Offset of field: ", |
<|file_name|>interface.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
export interface Position {
readonly offset: number;
read... | } |
<|file_name|>Community_Basic.js<|end_file_name|><|fim▁begin|>/*:
* @plugindesc Basic plugin for manipulating important parameters.
* @author RM CoreScript team
*
* @help
* Basic plugin for manipulating important parameters.
* There is no plugin command.
*
* Caching images improves performance but increases memo... | |
<|file_name|>test_lib_datfile.py<|end_file_name|><|fim▁begin|>import os
import unittest
import synapse
import synapse.lib.datfile as s_datfile
from synapse.tests.common import *
syndir = os.path.dirname(synapse.__file__)
class DatFileTest(SynTest):
def test_datfile_basic(self):
with s_datfile.openDatFi... | self.nn(fd)
self.eq(fd.read(), b'woot\n') |
<|file_name|>Example_2_2_3b.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
from pyliferisk import MortalityTable
from pyliferisk.mortalitytables import GKM95
import numpy as np
mt = MortalityTable(nt=GKM95)
x = 40 #age
n = 20 #horizon
C = 10000 #capital
i = 0.03 #interest rate
payments = []
for t in range(0,n... |
for t in range(0,n):
print('{0:2} {1:10} {2:10}'.format(t, np.around(discount_factor[t], 5), np.around(payments[t], 4))) |
<|file_name|>infinite-loops.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or<|fim▁hole|>// <LICEN... | // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
<|file_name|>loader.py<|end_file_name|><|fim▁begin|># --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Zheng Zhang
# -----------... |
class TrainDataLoader(mx.io.DataIter):
def __init__(self, sym, segdb, config, batch_size=1, crop_height = 768, crop_width = 1024, shuffle=False, ctx=None, work_load_list=None): |
<|file_name|>lmgtfy_bot.py<|end_file_name|><|fim▁begin|>from urllib.parse import quote_plus
import praw
QUESTIONS = ['what is', 'who is', 'what are']
REPLY_TEMPLATE = '[Let me google that for you](http://lmgtfy.com/?q={})'
def main():
reddit = praw.Reddit(user_agent='LMGTFY (by /u/USERNAME)',
... | # questions. |
<|file_name|>reserved-prefixes-migration.rs<|end_file_name|><|fim▁begin|>// check-pass
// run-rustfix
// compile-flags: -Z unstable-options --edition 2018
#![warn(rust_2021_prefixes_incompatible_syntax)]
macro_rules! m2 {
($a:tt $b:tt) => {};
}
macro_rules! m3 {
($a:tt $b:tt $c:tt) => {};
}
<|fim▁hole|> m... | fn main() {
m2!(z"hey");
//~^ WARNING prefix `z` is unknown [rust_2021_prefixes_incompatible_syntax]
//~| WARNING hard error in Rust 2021 |
<|file_name|>top-panel-wrapper.component.ts<|end_file_name|><|fim▁begin|>/*
* Lumeer: Modern Data Definition and Processing Platform
*
* Copyright (C) since 2017 Lumeer.io, s.r.o. and/or its affiliates.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Genera... | |
<|file_name|>exceptions.py<|end_file_name|><|fim▁begin|>class InvalidValueState(ValueError):<|fim▁hole|><|fim▁end|> | pass |
<|file_name|>QueryDAO.java<|end_file_name|><|fim▁begin|>package dao.inf;
// Generated 27/11/2014 02:39:51 AM by Hibernate Tools 3.4.0.CR1
import java.util.List;
import javax.naming.InitialContext;
import model.Query;
import model.QueryId;
import org.apache.commons.logging.Log;
import org.apache.commons.l... | * @see .Query
|
<|file_name|>vec-to_str.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lice... |
pub fn main() {
assert_eq!((~[0, 1]).to_str(), ~"[0, 1]"); |
<|file_name|>purchase_order.py<|end_file_name|><|fim▁begin|><|fim▁hole|># Copyright 2015 AvanzOsc (http://www.avanzosc.es)
# Copyright 2015-2016 - Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl)
from odoo import api, models
class PurchaseOrder(models.Model):
... | # -*- coding: utf-8 -*- |
<|file_name|>0001_initial.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Alloy',
fields=[
('i... | from django.db import models, migrations
|
<|file_name|>e3_2012_7_calendar.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
'''
@author Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic
@license This software is free - http://www.gnu.org/licenses/gpl.html
'''
WEEK_DAYS = 7
MAX_WEEKS = 6<|fim▁hole|>first = int(input("first (0-6)? "))
length = int... | |
<|file_name|>backgroundClip.js<|end_file_name|><|fim▁begin|>"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function _default() {
return function ({
addUtilities,
variants
}) {
addUtilities({
'.bg-clip-border': {
'background-clip... | 'background-clip': 'text' |
<|file_name|>WeatherActivity.java<|end_file_name|><|fim▁begin|>package com.ty.activity;
import com.ty.app.R;
import com.ty.service.AutoUpdateService;
import com.ty.util.HttpCallbackListener;
import com.ty.util.HttpUtil;
import com.ty.util.Utility;
import android.app.Activity;
import android.content.Intent;
import and... | * 更新天气按钮
*/ |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>#
# Ophidia WPS Module
# Copyright (C) 2015-2021 CMCC Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by<|fim▁hole|># but WITHOUT ANY WARRANTY; wit... | # the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, |
<|file_name|>GenesisShaderBison.cpp<|end_file_name|><|fim▁begin|>/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton implementation for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free... | |
<|file_name|>add-csv-modal.js<|end_file_name|><|fim▁begin|>/**
* This file is part of agora-gui-admin.
* Copyright (C) 2015-2016 Agora Voting SL <agora@agoravoting.com>
* agora-gui-admin is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as publis... | |
<|file_name|>tests_defined.js<|end_file_name|><|fim▁begin|>Tinytest.add('peerdb - defined', function (test) {
var isDefined = false;
try {
Document;
isDefined = true;
}<|fim▁hole|> }
test.isTrue(isDefined, "Document is not defined");
test.isTrue(Package['peerlibrary:peerdb'].Document, "Package.peerli... | catch (e) { |
<|file_name|>day14.rs<|end_file_name|><|fim▁begin|>#[cfg(target_family = "unix")]
extern crate cursive;
#[cfg(target_family = "unix")]
use cursive::Cursive;
#[cfg(target_family = "unix")]
use cursive::traits::*;
#[cfg(target_family = "unix")]
use cursive::views::{Dialog, DummyView, LinearLayout, SelectView, TextView};... | view.add_item(file_name, e);
} |
<|file_name|>ItemTweakConfig.java<|end_file_name|><|fim▁begin|>package com.oitsjustjose.vtweaks.common.config;
import net.minecraftforge.common.ForgeConfigSpec;
public class ItemTweakConfig {
private static final String CATEGORY_ITEM_TWEAKS = "item tweaks";
public static ForgeConfigSpec.BooleanValue ENABLE_E... | public static ForgeConfigSpec.BooleanValue ENABLE_CONCRETE_TWEAKS;
public static void init(ForgeConfigSpec.Builder COMMON_BUILDER) {
COMMON_BUILDER.comment("Item Tweaks").push(CATEGORY_ITEM_TWEAKS); |
<|file_name|>lexer_rules.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
tokens = [
'LPAREN',
'RPAREN',
'LBRACE',
'RBRACE',
'EQUAL',
'DOUBLE_EQUAL',
'NUMBER',
'COMMA',
'VAR_DEFINITION',
'IF',
'ELSE',
'END',
'ID',
'PRINT'
]
t_LPAREN = r"\("
t_RPAREN = r"\)... | |
<|file_name|>calibrate.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright 2010, Intel Corporation
*
* This file is part of PowerTOP
*
* This program file is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; ver... | * 51 Franklin Street, Fifth Floor, |
<|file_name|>graphics.py<|end_file_name|><|fim▁begin|>from reportlab.lib.colors import black
from reportlab.lib.units import cm
from base import BAND_WIDTH, BAND_HEIGHT, Element
class Graphic(Element):
"""Base graphic class"""
visible = True
stroke = True
stroke_color = black
stroke_width = 1
... | |
<|file_name|>lamp.py<|end_file_name|><|fim▁begin|>"""
LAMP
"""
import numpy as np
tol = 1.e-6 # zero tolerance
def pdist(x):
"""
Pairwise distance between pairs of objects
TODO: find a fast function
"""
n, d = x.shape
dist = np.zeros((n, n))
for i in range(n):
for j in range(n)... | ytilde = np.zeros(p) |
<|file_name|>issue-20186.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/lic... | |
<|file_name|>registerer_test.go<|end_file_name|><|fim▁begin|>// Copyright 2020 Anapaya Systems
//
// 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
//
// http://www.apache.org/licenses/LICEN... | hpServer func(*gomock.Controller) hidden_segment.HiddenSegmentRegistrationServiceServer |
<|file_name|>service-32.service.spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license<|fim▁hole|>import { TestBed, inject } from '@angular... | */
|
<|file_name|>compression_op.py<|end_file_name|><|fim▁begin|># coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | is_b_matrix_trainable: bool
indicates whether the b_matrix matrix in the factorization is to be |
<|file_name|>weibos.py<|end_file_name|><|fim▁begin|># coding: utf-8
from leancloud import Object
from leancloud import Query
from leancloud import LeanCloudError
from flask import Blueprint
from flask import request
from flask import redirect
from flask import url_for
from flask import render_template
import sys
sys.pa... | else:
raise e
return render_template('todos.html', todos=todos) |
<|file_name|>screen.rs<|end_file_name|><|fim▁begin|>use crate::portal::PortalRef;
use alloc::sync::Weak;
use cairo::bindings::{CAIRO_FORMAT_A8, CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24};
use cairo::{Cairo, Surface};
use core::mem;
use graphics_base::frame_buffer::{AsSurface, AsSurfaceMut, FrameBuffer};
use graphics_base... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>import datetime
from backend import db
from cruds.crud_user_type_destinations.models import UserTypeDestinations
from cruds.crud_users.models import Users
from cruds import format_urls_in_text
class WallMessages(db.Model):
id = db.Column(db.Integer, primary_key=... | query = UserTypeDestinations.query.filter_by(id=self.destination).first().users_query
query = str(query).replace('$', str(self.param_value)) |
<|file_name|>const.py<|end_file_name|><|fim▁begin|>"""Constants for Sonarr."""
DOMAIN = "sonarr"
# Config Keys
CONF_BASE_PATH = "base_path"
CONF_DAYS = "days"
CONF_INCLUDED = "include_paths"
CONF_UNIT = "unit"
CONF_UPCOMING_DAYS = "upcoming_days"
CONF_WANTED_MAX_ITEMS = "wanted_max_items"
# Data
DATA_HOST_CONFIG = "h... | DATA_SYSTEM_STATUS = "system_status"
# Defaults |
<|file_name|>name.go<|end_file_name|><|fim▁begin|>package commands
import cmds "github.com/ipfs/go-ipfs/commands"
type IpnsEntry struct {
Name string
Value string
}
var NameCmd = &cmds.Command{
Helptext: cmds.HelpText{
Tagline: "IPFS namespace (IPNS) tool",
Synopsis: `
ipfs name publish [<name>] <ipfs-path> ... | the private key enables publishing new (signed) values. In both publish |
<|file_name|>rush.rs<|end_file_name|><|fim▁begin|>extern crate libc;
///! Rush main
/// Rush module
mod rush
{
use std::ptr;
use std::io::stdio;
use libc::funcs::posix88::unistd::execvp;
use libc::funcs::posix88::unistd::fork;
use libc::types::os::arch::posix88::pid_t;
/// Wait.
#[link(na... | { |
<|file_name|>morestats.py<|end_file_name|><|fim▁begin|># Author: Travis Oliphant, 2002
#
# Further updates and enhancements by many SciPy developers.
#
from __future__ import division, print_function, absolute_import
import math
import types
import warnings
from . import statlib
from . import stats
from .stats impor... | """
Perform Fligner's test for equal variances.
|
<|file_name|>ssw_wrap.py<|end_file_name|><|fim▁begin|>"""
@package ssw_wrap
@brief Simple python wrapper for SSW align library
To use the dynamic library libssw.so you may need to modify the LD_LIBRARY_PATH environment
variable to include the library directory (export LD_LIBRARY_PATH=$PWD) or for definitive
inclusion o... | """
Parse CAlignRes structure and copy its values in object variables
@param Res A CAlignRes structure
@param query_len length of the query sequence |
<|file_name|>seed.js<|end_file_name|><|fim▁begin|>/*
* Populate DB with sample data on server start
* to disable, edit config/environment/index.js, and set `seedDB: false`
*/
'use strict';
var mongoose = require('mongoose');
var ObjectId = mongoose.Schema.Types.ObjectId;
var env = process.env.NODE_ENV || 'developm... | });
});
|
<|file_name|>at_sep.js<|end_file_name|><|fim▁begin|>AT.prototype.atSepHelpers = {
sepText: function(){<|fim▁hole|> },
};<|fim▁end|> | return T9n.get(AccountsTemplates.texts.sep, markIfMissing=false); |
<|file_name|>placeholder.go<|end_file_name|><|fim▁begin|>package soymsg
import (
"bytes"
"regexp"
"strconv"
"strings"
"github.com/robfig/soy/ast"
)
// setPlaceholderNames generates the placeholder names for all children of the
// given message node, setting the .Name property on them.
func setPlaceholderNames(n... | tagType = "END_"
case bytes.HasSuffix(text, []byte("/>")):
tagType = "" |
<|file_name|>RobotData.java<|end_file_name|><|fim▁begin|>package frc.team5333.lib;
import java.util.HashMap;
/**
* A static class that contains all kinds of Launch data for the robot,
* such as network ports, current state and more
*
* @author Jaci
*/
public class RobotData {
/**<|fim▁hole|> */
publ... | * A blackboard containing objects that are common throughout the
* program, along with their String Identifier |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from pyd.support import setup, Extension, pydexe_sanity_check
pydexe_sanity_check()
projName = 'interpcontext'
setup(
name=projName,
version='1.0',<|fim▁hole|> build_deimos=True, d_lump=True
)
],
)<|fim▁end|> | ext_modules=[
Extension(projName, ['interpcontext.d'], |
<|file_name|>ExtendedToolTip.java<|end_file_name|><|fim▁begin|>/*
* aTunes
* Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
*
* See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
*
* http://www.atunes.org
* http://sourceforge.net/projects/atunes
*
* This... | private final FadeInPanel imagePanel;
private final JLabel image;
private final JLabel line1; |
<|file_name|>builders.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the A... | let _primitive_array = primitive_array_builder.finish();
} |
<|file_name|>builder_test.go<|end_file_name|><|fim▁begin|>// +build !windows
package iso
import (
"context"
"fmt"
"reflect"
"strconv"
"testing"
"github.com/hashicorp/packer-plugin-sdk/common"
"github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
hypervc... | if len(warns) == 0 {
t.Fatalf("bad: %#v", warns)
} |
<|file_name|>CRConfigMaterialTest.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2022 ThoughtWorks, 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
*<|fim▁hole|> *
* Unless requ... | * http://www.apache.org/licenses/LICENSE-2.0 |
<|file_name|>cl_todo_category.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol ... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> println!("Hello World!");
}<|fim▁end|> | fn main() { |
<|file_name|>notification-system.test.js<|end_file_name|><|fim▁begin|>/* global sinon */
import React, { Component } from 'react';
import TestUtils from 'react-dom/test-utils';
import { expect } from 'chai';
import NotificationSystem from 'NotificationSystem';
import { positions, levels } from 'constants';
import merg... | done();
});
it('should not render message if not provided', done => { |
<|file_name|>DigitalEcho.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #include "RhythmComposerOS.h" |
<|file_name|>output_writers_end_to_end_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2011 Google Inc. All Rights Reserved.
import unittest
from google.appengine.api import files
from google.appengine.ext import db
from mapreduce import control
from mapreduce import model
from mapreduce... | with files.open(filenames[0], "r") as f: |
<|file_name|>_permissions_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Co... | self,
resource_group_name: str,
resource_provider_namespace: str, |
<|file_name|>greek_numerals.py<|end_file_name|><|fim▁begin|># coding: utf8
# Greek Numeral Converter<|fim▁hole|>#
# https://en.wikipedia.org/wiki/Greek_numerals
keraia = 'ʹ'
# Multiply by 10000
myriads = 'Μ'
numbers_to_letters = {
1: 'Α',
2: 'Β',
3: 'Γ',
4: 'Δ',
5: 'Ε',
6: 'ΣΤ',
7: 'Ζ',
... | |
<|file_name|>AWTChangeNotifier.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 1998, 2012 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the... | new Runnable() {
|
<|file_name|>GridTable.delegate.js<|end_file_name|><|fim▁begin|>/*
* ! ${copyright}
*/
sap.ui.define([
"delegates/odata/v4/TableDelegate",
"sap/ui/core/Core"
], function(
TableDelegate,
Core
) {
"use strict";
/**
* Test delegate for OData V4.
*/
var ODataTableDelegate = Object.assign({}, TableDelegate);
... | } |
<|file_name|>ax_hpo_iris.py<|end_file_name|><|fim▁begin|>import argparse
import mlflow
from ax.service.ax_client import AxClient
from iris import IrisClassification
from iris_data_module import IrisDataModule
import pytorch_lightning as pl
def train_evaluate(params, max_epochs=100):
model = IrisClassification(**p... | |
<|file_name|>ember-weakmap-polyfill.js<|end_file_name|><|fim▁begin|>/* globals Ember, require */
(function() {
var _Ember;
var id = 0;
var dateKey = new Date().getTime();
if (typeof Ember !== 'undefined') {
_Ember = Ember;
} else {
_Ember = require('ember').default;
}
function symbol() {
re... | var metaInfo = meta(obj); |
<|file_name|>add-test.js<|end_file_name|><|fim▁begin|>var add = require('./add');
QUnit.test('add example', function () {
// add function returns sum of numbers<|fim▁hole|> // it also concatenates strings
QUnit.equal(add('foo', 'bar'), 'foobar')
});<|fim▁end|> | QUnit.equal(add(2, 3), 5); |
<|file_name|>scormdropdownidevice_tmp.py<|end_file_name|><|fim▁begin|># ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public ... | from exe.engine.field import ClozeField, TextAreaField |
<|file_name|>core.rs<|end_file_name|><|fim▁begin|>pub extern crate nalgebra as na;
use std::fmt;
use std::ops::{Add, Sub, Index};
use self::na::DMatrix;
#[derive(Clone, Debug)]
/// A coordinate point in degree, minute, second.
pub struct Coordinate {
pub deg: i8,
pub min: i8,
pub sec: f32,
}
impl Coordi... | pub data: DMatrix<i16>, |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.