prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>bf_lexer.rs<|end_file_name|><|fim▁begin|>use traits::*; #[derive(PartialEq, Clone, Debug, Copy)] pub enum BFTokenType { IncrementPtr(usize), // > DecrementPtr(usize), // < IncrementData(usize), // + DecrementData(usize), // - Output, // . Input, ...
<|file_name|>greetings.rs<|end_file_name|><|fim▁begin|>pub fn hello() -> String { <|fim▁hole|> "Annyoung!".to_string() }<|fim▁end|>
<|file_name|>LogService.js<|end_file_name|><|fim▁begin|>module.exports = { login: function(user, req) { // Parse detailed information from user-agent string var r = require('ua-parser').parse(req.headers['user-agent']); // Create new UserLogin row to database sails.models.loglogin.create({ ip...
// } else {
<|file_name|>concat2concatws.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.enums import PRIORITY __priority__ = PRIORITY.HIGHEST def dependencies(): pass def tamper(pay...
<|file_name|>modifiers.py<|end_file_name|><|fim▁begin|>import os from select import select from subprocess import PIPE import sys import time from itertools import chain from plumbum.commands.processes import run_proc, ProcessExecutionError from plumbum.commands.processes import BY_TYPE import plumbum.commands.base fr...
useful output.
<|file_name|>test_script.py<|end_file_name|><|fim▁begin|>"""The tests for the Script component.""" # pylint: disable=protected-access import asyncio from contextlib import contextmanager from datetime import timedelta import logging from unittest import mock import pytest import voluptuous as vol # Otherwise can't te...
hass.states.async_set("sensor.test", "next") await asyncio.wait_for(wait_started.wait(), 1) wait_started.clear() hass.states.async_set("sensor.test", index)
<|file_name|>mail-extractor.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; export default Ember.Mixin.create({<|fim▁hole|> }).then(function(mailThread) { return mailThread.get('mails'); }); }, getMailByIdFromMailThreads: function getMailByIdFromMailThreads(mailId){ return this.store.find('mail-th...
getMailsFromMailThreadByThreadId: function getMailsFromMailThreadByThreadId(mailThreadId) { return this.store.find('mail-thread').then(function(mailThreads) { return mailThreads.filterBy('id', mailThreadId)[0];
<|file_name|>DirectoryNodeAlbumCompilations.cpp<|end_file_name|><|fim▁begin|>/* * Copyright (C) 2005-2013 Team XBMC * http://xbmc.org * * 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 Fou...
{ }
<|file_name|>images.go<|end_file_name|><|fim▁begin|>package phaul import ( "fmt" "os" "path/filepath" ) <|fim▁hole|>} func preparePhaulImages(wdir string) (*images, error) { return &images{dir: wdir}, nil } func (i *images) getPath(idx int) string { return fmt.Sprintf(i.dir+"/%d", idx) } func (i *images) openN...
type images struct { cursor int dir string
<|file_name|>StepSwitch.java<|end_file_name|><|fim▁begin|>package com.mygame; import java.util.Vector; import loon.geom.RectBox; public class StepSwitch extends Switch { StepSwitch(int x, int y, Vector<Thing> blocks) { this.x = x; this.y = y; this.blocks = blocks; orgblocks =...
for(int i = 0; i < orgblocks.size(); i++) blocks.add((Thing)orgblocks.get(i));
<|file_name|>cli.rs<|end_file_name|><|fim▁begin|>extern crate tetrs; use std::io::prelude::*; // FIXME! Little hack to clear the screen :) extern "C" { fn system(s: *const u8); } fn clear_screen() { unsafe { system("@clear||cls\0".as_ptr()); }} #[derive(Copy, Clone, Debug, Eq, PartialEq)] enum Input { None, Left,...
<|file_name|>types.rs<|end_file_name|><|fim▁begin|>//! Type represents a data type. Its implementation is pluggable. //! So, Types are loaded from the packages. //! use std::fmt; use std::rc::Rc; use itertools::Itertools; use err::Result; pub type TypeFactory = Rc<Fn(&str) -> Result<Ty>>; pub mod name { pub stat...
// // Ty::Array(ref ty) => { // panic!("Undefined Operator")
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Code related to generating tokenizers. <|fim▁hole|>pub mod nfa; pub mod re;<|fim▁end|>
#![allow(dead_code)] // not yet fully activated pub mod dfa; pub mod intern_token;
<|file_name|>file.go<|end_file_name|><|fim▁begin|>package file import ( "context" "encoding/json" "io/ioutil" "math/rand" "sync" "time" "github.com/DMarby/picsum-photos/internal/database" ) // Provider implements a file-based image storage type Provider struct { path string images []database.Image random...
return &p.images[random.Intn(len(p.images))], nil
<|file_name|>comp-1376.component.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 */ import { async, ComponentFixture, TestBed } fr...
<|file_name|>HelloWorldMutualTlsEndpointTest.java<|end_file_name|><|fim▁begin|>package io.quarkus.grpc.examples.hello; import static io.restassured.RestAssured.get; import static org.assertj.core.api.Assertions.assertThat; import org.junit.jupiter.api.Test; import io.quarkus.test.junit.QuarkusTest; @QuarkusTest cla...
public void testHelloWorldServiceUsingMutinyStub() {
<|file_name|>adapt.py<|end_file_name|><|fim▁begin|>import numpy as np from matplotlib import pyplot as plt from astropy.io import fits from glob import glob import os #Author: Trevor Dorn-Wallenstein #Date: 9.20.17 #Author's note: the data reduction portion of this does almost exactly what acronym #(Weisenburger et a...
print('Reducing {0} science frames!'.format(len(sciencelist)))
<|file_name|>sync.js<|end_file_name|><|fim▁begin|>'use strict'; const $ = use('chalk', 'syncy'); function task(done) { $.syncy([ 'app/fonts/**', 'app/images/**/*.{gif,jpg,png,svg}', 'app/{scripts,styles}/vendor/**', 'app/*' ], 'build', { base: 'app', ignoreInDest: [ 'styles/*.{css,ma...
done();
<|file_name|>Canvas.js<|end_file_name|><|fim▁begin|>com.chanjet.gzq.aflow.Canvas = draw2d.Canvas.extend({ canvasName: "com.chanjet.gzq.aflow.Canvas", init: function(id){ this._super(id); this.setScrollArea("#"+id); this.id = id; var MyInterceptorPolicy = draw2d.policy.canvas.ConnectionInterceptorPolicy.exte...
app.canvas.figures.data.forEach(function (e, i) { if (e.cssClass != "Connection") { e.getOutputPorts().each( function (i, p) {
<|file_name|>OptionsPanelImpl.java<|end_file_name|><|fim▁begin|>/* * Copyright 2000-2009 JetBrains s.r.o. * * 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/lice...
if (typeToSelect.equals(((EditorSchemeAttributeDescriptor)o).getType())) { ListScrollingUtil.selectItem(myOptionsList, i);
<|file_name|>messageWindow.py<|end_file_name|><|fim▁begin|>from __future__ import print_function, division, absolute_import # # Copyright (c) 2010 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, ...
self.dialog.set_icon_name('subscription-manager')
<|file_name|>mask_ops.py<|end_file_name|><|fim▁begin|>""" Ops for masked arrays. """ from typing import ( Optional, Union, ) import numpy as np from pandas._libs import ( lib, missing as libmissing, ) def kleene_or( left: Union[bool, np.ndarray], right: Union[bool, np.ndarray], left_mask...
""" if left_mask is None:
<|file_name|>cleanDates.py<|end_file_name|><|fim▁begin|>import pandas as pd from typing import List from datetime import datetime from .clean_list import clean_dates<|fim▁hole|> def clean_dates(self, inputs: pd.DataFrame) -> pd.DataFrame: return inputs.apply(clean_dates)<|fim▁end|>
class CleanDates():
<|file_name|>deep.rs<|end_file_name|><|fim▁begin|>// run-pass // ignore-emscripten apparently blows the stack fn f(x: isize) -> isize { if x == 1 { return 1; } else { let y: isize = 1 + f(x - 1); return y; } } <|fim▁hole|><|fim▁end|>
pub fn main() { assert_eq!(f(5000), 5000); }
<|file_name|>BaseResource.java<|end_file_name|><|fim▁begin|>package se.solit.timeit.resources;<|fim▁hole|>import java.net.URI; import java.net.URISyntaxException; import javax.servlet.http.HttpSession; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Response; public class BaseResource { protecte...
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>#[macro_export] macro_rules! stateset { () => { { use std::collections::{BTreeSet}; let temp_set: BTreeSet<String> = BTreeSet::new(); temp_set } }; ( $( $x:expr ),+ ) => { { use std::c...
use std::collections::{BTreeSet}; let mut aux: BTreeSet<(char, String)> = BTreeSet::new();
<|file_name|>controller.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import ########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # ...
<|file_name|>wavetable.js<|end_file_name|><|fim▁begin|>// Copyright 2011, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retai...
} // Great, now do inverse FFT into our wavetable...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># ============================================================================= # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
# You may obtain a copy of the License at
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.core.validators import RegexValidator from django.db import models from event.models import Event class Job(models.Model):<|fim▁hole|> max_length=75, validators=[ RegexValidator( r'^[(A-Z)|(a-z)|(\s)|(\')]+$', ...
id = models.AutoField(primary_key=True) event = models.ForeignKey(Event) name = models.CharField(
<|file_name|>community.py<|end_file_name|><|fim▁begin|>from flask import Blueprint, render_template, jsonify from flask_website.utils import request_wants_json from flask_website.listings.projects import projects mod = Blueprint('community', __name__, url_prefix='/community') @mod.route('/') def index(): return ...
@mod.route('/badges/') def badges(): return render_template('community/badges.html')
<|file_name|>imaging_utils.py<|end_file_name|><|fim▁begin|>''' Scripts for automatically setting clean parameters ''' import numpy as np from warnings import warn import os from taskinit import tb from cleanhelper import cleanhelper def set_imagermode(vis, source): tb.open(os.path.join(vis, 'FIELD')) names...
syn_beam : float
<|file_name|>setup.js<|end_file_name|><|fim▁begin|>import $ from 'jquery'; module.exports = function(root) { root = root ? root : global; root.expect = root.chai.expect; root.$ = $; beforeEach(() => { // Using these globally-available Sinon features is preferrable, as they're // automatically restored...
root.sandbox.restore();
<|file_name|>UserCards.js<|end_file_name|><|fim▁begin|>import React, {Component} from 'react'; import { Router, IndexRoute, Route, browserHistory } from 'react-router'; import UserCard from './UserCard'; import firebase from './firebase'; import NewContact from './NewContact'; class UserCards extends Component { con...
}
<|file_name|>metrics-server.go<|end_file_name|><|fim▁begin|>// Copyright 2018 The Kubernetes 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.apache.org/licen...
<|file_name|>addon.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Tristan Fischer (sphere@dersphere.de) # # 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 Fre...
def watch_video(video_id): video = scraper.get_video(video_id) if 'hls_playlist' in video:
<|file_name|>test_sphinxext_mockcoderefs.py<|end_file_name|><|fim▁begin|>"""Tests for documenteer.sphinext.mockcoderefs.""" from shutil import rmtree from tempfile import mkdtemp import pytest from sphinx.application import Sphinx import documenteer.sphinxext.mockcoderefs as mockcoderefs try: from unittest.moc...
<|file_name|>test_mixins.py<|end_file_name|><|fim▁begin|>from django.test import TestCase from django.views.generic import TemplateView from django.contrib.contenttypes.models import ContentType from jsonattrs import models, mixins from . import factories class XLangLabelsTest(TestCase): def test_dict(self): ...
<|file_name|>bookmarks.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2016-2018 Boucher, Antoni <bouanto@zoho.com> * * Permission is hereby granted, free of charge, to any person obtaining a copy of * this software and associated documentation files (the "Software"), to deal in * the Software without restricti...
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
<|file_name|>groups.py<|end_file_name|><|fim▁begin|>import boto,sys,euca_admin from boto.exception import EC2ResponseError from euca_admin.generic import BooleanResponse from euca_admin.generic import StringList from boto.resultset import ResultSet from euca_admin import EucaAdmin from optparse import OptionParser SER...
<|file_name|>namelist_answer.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*- __author__ = 'shin' import jieba namelist_answer=[] ''' namelist_answer.append('[slot_name]。') namelist_answer.append('叫[slot_name]。') namelist_answer.append('姓名是[slot_name]。') namelist_answer.append('我是[slot_name]。') namelist_answer.a...
<|file_name|>engine.py<|end_file_name|><|fim▁begin|>from collections import namedtuple, OrderedDict from functools import wraps from queue import Queue import os import shutil import threading from plover import log, system from plover.dictionary.loading_manager import DictionaryLoadingManager from plover.exception im...
def _set_output(self, enabled):
<|file_name|>parallel_for_ast_print.cpp<|end_file_name|><|fim▁begin|>// RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=50 -ast-print %s | FileCheck %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -x c++ -std=c++11 -emit-pch -o %t %s // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -std=c++11 -include-pch %t -fsynt...
<|file_name|>alkane_monolayer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # -- ==alkane_monolayer== -- import mbuild as mb from mbuild.lib.surfaces import Betacristobalite from mbuild.lib.atoms import H from mbuild.examples.alkane_monolayer.alkylsilane import AlkylSilane class AlkaneMonolayer(mb.Monola...
def __init__(self, pattern, tile_x=1, tile_y=1, chain_length=10): """Create an alkylsilane monolayer on beta-cristobalite.
<|file_name|>views.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import render_template, request, redirect, session, flash, url_for from functools import wraps from user import app import services2db import log2db import users import json import time import sys import asset r...
_username = params.get('username', 'Null')
<|file_name|>util.js<|end_file_name|><|fim▁begin|>var urlRegexp = /^(http|udp|ftp|dht)s?:\/\//; /** * Returns true if str is a URL. * * @param {String} str * @return {Boolean} */ exports.isURL = function(str) { return urlRegexp.test(str); }; /** * Returns true if n is an integer. * * @param {Number} n * @...
<|file_name|>PTX_oandaInfo.py<|end_file_name|><|fim▁begin|>from configparser import ConfigParser import v20 # Create an object config config = ConfigParser() # Read the config config.read("../API_Connection_Oanda/pyalgo.cfg") ctx = v20.Context( 'api-fxpractice.oanda.com', 443, True, application = 'sam...
for instrument in instruments: ins = instrument.dict() print('%20s | %10s' % (ins['displayName'],
<|file_name|>local_nvbn.py<|end_file_name|><|fim▁begin|>DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. ...
}
<|file_name|>publisher_stub.cc<|end_file_name|><|fim▁begin|>// Copyright 2020 Google LLC // // 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/LICENSE-2...
}
<|file_name|>counted.hpp<|end_file_name|><|fim▁begin|>/////////////////////////////////////////////////////////////////////////////// // Copyright (c) Lewis Baker // Licenced under MIT license. See LICENSE.txt for details. /////////////////////////////////////////////////////////////////////////////// #ifndef CPPCORO_T...
{ default_construction_count = 0; copy_construction_count = 0;
<|file_name|>landing-controller.js<|end_file_name|><|fim▁begin|>/* 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/LICENSE-2.0 * * Unless required by...
$scope.urls = { editor: baseUrl + '/editor/',
<|file_name|>graph.rs<|end_file_name|><|fim▁begin|>use std::f32; use std::u16; use std::fmt; use std::cmp::Ordering; use crate::utils::vec_filter; //TODO: rename to Links and GraphState to Graph pub type ID = u32; #[derive(Clone, PartialEq)] pub struct Link { pub from: ID, pub to: ID, pub quality: u16, //band...
for b in ns {
<|file_name|>test_migration.py<|end_file_name|><|fim▁begin|>## # Copyright (c) 2015-2017 Apple Inc. 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....
record01 = yield txn.directoryService().recordWithUID(u"user01") record02 = yield txn.directoryService().recordWithUID(u"user02")
<|file_name|>ada.js<|end_file_name|><|fim▁begin|>ace.define('ace/snippets/ada', ['require', 'exports', 'module' ], function(require, exports, module) { <|fim▁hole|> exports.snippetText = ""; exports.scope = "ada"; });<|fim▁end|>
<|file_name|>reusing_model.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from keras.models import load_model sys.path.append("/Users/alexpapiu/Documents/Conv/OpenCV_CNN") from webcam_cnn_pipeline import return_compiled_model_2, real_time_pred model_name = sys.argv[1] w = 1.5*144 h = 2*144 #keep track of all labels: al...
import sys import os import cv2
<|file_name|>pig_operator.py<|end_file_name|><|fim▁begin|>import logging import re from airflow.hooks import PigCliHook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class PigOperator(BaseOperator): """ Executes pig script. :param pig: the pig latin script t...
:param pig_cli_conn_id: reference to the Hive database
<|file_name|>customBlockHandler.ts<|end_file_name|><|fim▁begin|>import { Process, BlockHandler } from '../blockHandlers'; import { isSpaceOrTab, peek } from '../blockHelper'; import { unescapeString } from '../common'; import { CustomBlockNode, BlockNode } from '../node'; const reClosingCustomBlock = /^\$\$$/; export...
block.info = unescapeString(infoString![2].trim()); block.literal = rest; block.stringContent = null;
<|file_name|>confidence_check_test.py<|end_file_name|><|fim▁begin|>import torch from allennlp.data.vocabulary import Vocabulary<|fim▁hole|> class FakeModelForTestingNormalizationBiasVerification(Model): def __init__(self, use_bias=True): super().__init__(vocab=Vocabulary()) self.conv = torch.nn.Conv...
from allennlp.models.model import Model
<|file_name|>ports.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|>from cfme.utils.log import logger class Ports(object): SSH = 22 DB = 5432 TOWER = 54322 logger = logger @property def _top(self, m=sys.modules): mod = m.get('utils.appliance') return mod an...
"""Storage for ports. Set defaults here, then :py:mod:`fixtures.portset` will make overrides.""" import sys from cfme.utils import clear_property_cache
<|file_name|>PollResultImpl.java<|end_file_name|><|fim▁begin|>/* * #%L * ===================================================== * _____ _ ____ _ _ _ _ * |_ _|_ __ _ _ ___| |_ / __ \| | | | ___ | | | | * | | | '__| | | / __| __|/ / _` | |_| |/ __|| |_| | * | | | | | |_| ...
for (SearchResult sr : mResults) { if (sr.getType() == type) { ret.add(sr);
<|file_name|>str_len.py<|end_file_name|><|fim▁begin|># YouTube Video: https://www.youtube.com/watch?v=RRK0gd77Ln0 # Given a string, calculate the length of the string. input_str = "LucidProgramming" # Standard Pythonic way:<|fim▁hole|> input_str_len = 0 for i in range(len(input_str)): input_str_len +=...
# print(len(input_str)) # Iterative length calculation: O(n) def iterative_str_len(input_str):
<|file_name|>any.rs<|end_file_name|><|fim▁begin|>use gl; use GlObject; use backend::Facade; use version::Version; use context::Context; use context::CommandContext; use CapabilitiesSource; use ContextExt; use TextureExt; use TextureMipmapExt; use version::Api; use Rect; use image_format::{self, TextureFormatRequest, ...
/// pub fn raw_read<T>(&self, rect: &Rect) -> T where T: Texture2dDataSink<(u8, u8, u8, u8)> { assert!(rect.left + rect.width <= self.width);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
from .synonym import *
<|file_name|>global.ts<|end_file_name|><|fim▁begin|>import { css, Theme } from "@emotion/react"; import "@fontsource/roboto/400.css"; import "@fontsource/roboto/500.css"; import "@fontsource/roboto/700.css"; import "@fontsource/roboto/900.css"; export const global = (theme: Theme) => css` * { box-sizing: border-...
li, ul,
<|file_name|>main.js<|end_file_name|><|fim▁begin|>$(document).ready(function(){ //fancybox.js init /*$('.fancybox').fancybox({ openEffect : 'none', closeEffect : 'none', prevEffect : 'none', nextEffect : 'none', arrows : false, helpers : { media : {}, buttons : {} } });*/ ...
});
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod test; use sourcefile::SourceFile as SourceFile; use dispatch::InvokeReceivier as InvokeReceivier; use dispatch::Dispatch as Dispatch; use dispatch::Invoke as Invoke; use type_name::TypeName as TypeName; use common::ParseError as ParseError; use arguments::Argument a...
match dispatch.stack[0].receiver {
<|file_name|>race.ts<|end_file_name|><|fim▁begin|>import { tee } from "./tee"; import { pump } from "./pump"; import { createDuplex } from "./duplex"; import { wrapAsyncIterableIterator } from "./wrap-async-iterable-iterator"; /** * Calls all target functions in parallel, and returns the yielded values of the _fastes...
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>import re from simpleparse.parser import Parser from simpleparse.dispatchprocessor import * grammar = """ root := transformation transformation := ( name, index, assign, expr ) assign := '=' expr := ( trinary ) / ( term ) trinary := ( term, '?', term, ':...
return " ".join(res) def binaryop(self, info, buffer):
<|file_name|>heroes.component.ts<|end_file_name|><|fim▁begin|>/** * Created by rohit on 7/9/16. */ import {Component, OnInit} from '@angular/core'; import {Router} from "@angular/router"; import {Hero} from "../hero"; import {HeroService} from "./heroes.service"; @Component({ selector: 'my-heroes', template...
<|file_name|>control-brace-style-always-same-line.rs<|end_file_name|><|fim▁begin|>// rustfmt-control_brace_style: AlwaysSameLine fn main() { loop { (); (); } 'label: loop // loop comment { (); } cond = true;<|fim▁hole|> 'while_label: while cond { // while c...
while cond { (); }
<|file_name|>CharStateDatasAI.py<|end_file_name|><|fim▁begin|># File: C (Python 2.4) from otp.ai.AIBaseGlobal import * from direct.distributed.ClockDelta import * from direct.fsm import StateData from direct.directnotify import DirectNotifyGlobal import random from direct.task import Task from toontown.toonbase import...
StateData.StateData.enter(self)
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.contrib.auth.models import AbstractUser from django.db import models STATUT = ['docteur', 'secrétaire', 'interne', 'remplaçant'] class UnoUser(AbstractUser): """ Base User class for unolog<|fim▁hole|> SECRETAIRE = "secretaire" INTERNE = "...
define statu """ MEDECIN = "medecin"
<|file_name|>HistogramFieldTypeTests.java<|end_file_name|><|fim▁begin|>/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License;<|fim▁hole|> package org.elasticsearch.xpack.analytics.mapper; import org.elasticsearch...
* you may not use this file except in compliance with the Elastic License. */
<|file_name|>client.py<|end_file_name|><|fim▁begin|>from datetime import datetime import functools import os import uuid from time import time from django.conf import settings from django_statsd.clients import statsd from mock import Mock from requests import post from suds import client as sudsclient from suds.trans...
from solitude.logger import getLogger from .constants import (ACCESS_DENIED, HEADERS_SERVICE, INTERNAL_ERROR, SERVICE_UNAVAILABLE)
<|file_name|>image-upload.component.ts<|end_file_name|><|fim▁begin|><|fim▁hole|> OnInit, ElementRef, ViewChild } from '@angular/core'; import { MatDialogRef } from '@angular/material'; import { ImgurApiService } from '../../services'; @Component({ selector: 'app-dialog-image-upload', templateUrl: './image...
import { Component,
<|file_name|>ProposalDevelopmentRejectionRule.java<|end_file_name|><|fim▁begin|>/* * Kuali Coeus, a comprehensive research administration system for higher education. * * Copyright 2005-2016 Kuali, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affe...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .assign_role import AssignRoleBulkAction from .delete import DeleteBulkAction from .set_active_state import SetActiveStateBulkAction <|fim▁hole|><|fim▁end|>
__all__ = ["AssignRoleBulkAction", "DeleteBulkAction", "SetActiveStateBulkAction"]
<|file_name|>LayeredDictTest.py<|end_file_name|><|fim▁begin|>########################################################################## # # Copyright (c) 2008-2010, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provi...
} )
<|file_name|>scikit_radon.py<|end_file_name|><|fim▁begin|># Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL 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 ...
sinogram : `DiscreteLpElement` Sinogram (projections) to backproject. geometry : `Geometry` The projection geometry to use.
<|file_name|>process_context_filter.cc<|end_file_name|><|fim▁begin|>#include "test/integration/filters/process_context_filter.h" #include <memory> #include <string> #include "envoy/http/filter.h" #include "envoy/http/header_map.h" #include "envoy/registry/registry.h" #include "envoy/server/filter_config.h" #include ...
// ProcessContext is unhealthy, and responds OK to all requests otherwise. class ProcessContextFilter : public Http::PassThroughFilter { public: ProcessContextFilter(ProcessContext& process_context)
<|file_name|>located.go<|end_file_name|><|fim▁begin|>package graphql import ( "errors" "github.com/equinux/graphql/gqlerrors" "github.com/equinux/graphql/language/ast" ) func NewLocatedError(err interface{}, nodes []ast.Node) *gqlerrors.Error { return newLocatedError(err, nodes, nil) } func NewLocatedErrorWithP...
stack,
<|file_name|>exception.d.ts<|end_file_name|><|fim▁begin|>import Mark = require("./mark"); declare class YAMLException { message: string; reason: string; name: string; mark: Mark; isWarning: boolean; private static CLASS_IDENTIFIER; static isInstance(instance: any): instance is YAMLException;...
} export = YAMLException;
<|file_name|>torrents.geektool.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from sys import argv from GeekToolKickassTorrentFeed import GeekToolKickassTorrentFeed if __name__ == "__main__" and len(argv) > 1: mode = argv[1] print(str.format("{0}{1}", "\t" * 4, mode.capitalize())) feed = GeekToolKickassTorr...
#!/usr/bin/env python
<|file_name|>strx.rs<|end_file_name|><|fim▁begin|>pub fn remove_to<'s>(s: &'s str, c: char) -> &'s str { match s.rfind(c) { Some(pos) => s.slice_from(pos + 1), None => s } } #[allow(dead_code)] pub fn remove_from_last<'s>(s: &'s str, c: char) -> &'s str { match s.rfind(c) { Some(pos...
pub fn remove_suffix<'s>(s: &'s str, suffix: &str) -> &'s str { if !s.ends_with(suffix) { panic!(); }
<|file_name|>fetch_avhrr_calcoeffs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Satpy developers # # This file is part of satpy. # # satpy is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by ...
if __name__ == "__main__":
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // exce...
hx1 == hx2 && kvs1.len() == kvs2.len() && kvs1.iter().all(|kv| kvs2.contains(kv)) }
<|file_name|>teamspeak.py<|end_file_name|><|fim▁begin|>from flask.blueprints import Blueprint import logging from flask_login import login_required, current_user from waitlist.ts3.connection import send_poke from flask import jsonify<|fim▁hole|>@bp.route("/test_poke") @login_required def test_poke(): send_poke(curr...
bp = Blueprint('api_ts3', __name__) logger = logging.getLogger(__name__)
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This software may be used and distributed according to the terms of the * GNU General Public License version 2. */ #![feature(trait_alias)] #![deny(warnings)] use anyhow::{anyhow, Error}; use blobrepo::Bl...
if &MPath::new("dir1/file_1_in_dir1").unwrap() == p { return Ok(Some(MPath::new("newdir/dir1/file_1_in_dir1").unwrap())); }
<|file_name|>decoder.rs<|end_file_name|><|fim▁begin|>use std::io; use std::io::Read; use std::default::Default; use byteorder::{ReadBytesExt, LittleEndian}; use image; use image::ImageResult; use image::ImageDecoder; use color; use super::vp8::Frame; use super::vp8::VP8Decoder; /// A Representation of a Webp Imag...
<|file_name|>test_job_log_url_api.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse from tests.test_utils import create_generic_job from treeherder.model.models import JobLog def test_get_job_log_urls(test_repository, result_set_stored, failure_classifications, ...
assert resp.status_int == 200 assert len(resp.json) == 3
<|file_name|>StaticDataSeries.js<|end_file_name|><|fim▁begin|>'use strict'; // dependencies var DataManager = require('./../../core/DataManager'); var Enums = require('./../../core/Enums'); var makeTokenParameters = require('../../core/Utils').makeTokenParameters; /** * It exports a object with StaticDataSeries cont...
new: function(request, response) { response.render('configuration/dataset', {type: "static", "Enums": Enums});
<|file_name|>getters-setters.js<|end_file_name|><|fim▁begin|>/*<|fim▁hole|> var result = []; if(index<rowsCount-1){ result = this.source.slice(index*perRow, (index*perRow)+perRow); } return result; } */<|fim▁end|>
Threesixty.prototype.getRow = function(index){ var perRow = this.perRow; var rowsCount = Math.round(this.source.length/perRow);
<|file_name|>vector_selectbypoint.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ /*************************************************************************** vector_selectbypoint A QGIS plugin Select vector features, point and click. --------...
# Activate click tool
<|file_name|>ConnectionTor.js<|end_file_name|><|fim▁begin|>var Peer = require('../lib/Peer'); var Connection = require('../lib/Connection'); var dns = require('dns');<|fim▁hole|> // get a peer from dns seed dns.resolve('dnsseed.bluematt.me', function(err, seeds) { // use the first peer var peer = new P...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from .column_pair_values_equal import ColumnPairValuesEqual from .column_pair_values_greater import ColumnPairValuesAGreaterThanB<|fim▁hole|><|fim▁end|>
from .column_pair_values_in_set import ColumnPairValuesInSet
<|file_name|>shared.rs<|end_file_name|><|fim▁begin|>// Zinc, the bare metal stack for rust. // Copyright 2014 Ben Gamari <bgamari@gmail.com> // // 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 a...
<|file_name|>GeoDBGeometryTypeDescriptor.java<|end_file_name|><|fim▁begin|>/* * Hibernate, Relational Persistence for Idiomatic Java * * License: GNU Lesser General Public License (LGPL), version 2.1 or later. * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. */ package...
<|file_name|>globalSettings.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2012-2014 Lotaris SA // // This file is part of ROX Center. // // ROX Center 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, eithe...
// // ROX Center is distributed in the hope that it will be useful,
<|file_name|>gitdox_sql.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Data access functions to read from and write to the SQLite backend. """ import sqlite3 import codecs import os import re def setup_db(): dbpath = os.path.dirname(os.path.realpath(__file__)) + os.sep +".."+os.s...
def get_doc_meta(doc_id, corpus=False):
<|file_name|>SourceMgr.java<|end_file_name|><|fim▁begin|>package tools; /* * Extremely Compiler Collection * Copyright (c) 2015-2020, Jianping Zeng. * * 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...
&& curMB.getCharAt(columnStart) != '\n' && curMB.getCharAt(columnStart) != '\r') --columnStart;