prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>permissions.client.service.js<|end_file_name|><|fim▁begin|>'use strict'; angular.module('users').factory('Permissions', ['Authentication', '$location', function(Authentication, $location) { // Permissions service logic // ... // Public API return { //check if user suits the right permissions ...
if (Authentication.user && (Authentication.user.roles.indexOf('admin')> -1 || Authentication.user.roles.indexOf('maintainer')> -1)) { return true;
<|file_name|>_sets-set.js<|end_file_name|><|fim▁begin|>'use strict'; var setPrototypeOf = require('es5-ext/object/set-prototype-of') , mixin = require('es5-ext/object/mixin-prototypes') , iterator = require('es6-iterator/valid-iterable') , forOf = require('es6-iterator/for...
clear: d(function () {
<|file_name|>dataSource.js<|end_file_name|><|fim▁begin|>var GUID = (function () { function _GUID() { return UUIDcreatePart(4) + UUIDcreatePart(2) + UUIDcreatePart(2) + UUIDcreatePart(2) + UUIDcreatePart(6); }; function UUIDcreatePart(length) { ...
k: "Name", t: 1 },
<|file_name|>clientTest.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from pysharegps import sharedGpsClient import logging if __name__ == "__main__": logging.basicConfig(format='%(asctime)s %(message)s',level=logging.DEBUG) client = sharedGpsClient() if client.isInit(): position = client...
<|file_name|>site_dao.py<|end_file_name|><|fim▁begin|>__author__ = 'Bohdan Mushkevych' from bson import ObjectId from threading import RLock from db.model.raw_data import * from db.model.site_statistics import SiteStatistics from synergy.db.manager import ds_manager from synergy.system.decorator import thread_safe ...
document = instance.document if instance.db_id: document['_id'] = ObjectId(instance.db_id)
<|file_name|>test-whatwg-url-searchparams-has.js<|end_file_name|><|fim▁begin|>'use strict'; const common = require('../common'); const assert = require('assert'); const URLSearchParams = require('url').URLSearchParams; const { test, assert_false, assert_true } = require('../common/wpt'); /* The following tests are co...
toString() { throw new Error('toString'); },
<|file_name|>Send2Kindle_command_line.py<|end_file_name|><|fim▁begin|>import argparse import smtplib import mimetypes import os.path as path from email import encoders from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart <|fim▁hole|> parser.add_argument('-t', type=str, default = 'n', help...
def parseOptions(): parser = argparse.ArgumentParser(description='Send e-books to my Kindle Paperwhite.') parser.add_argument('file', type=str, help='The e-book file.') parser.add_argument('-c', type=str, default = 'y', help='Convert?.')
<|file_name|>0002_auto_20170308_2245.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-08 22:45 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration):<|fim▁hole|> dependencies = [ ('topics', '0001_initi...
<|file_name|>servers.py<|end_file_name|><|fim▁begin|>from src.tools.dictionaries import PostLoadedDict # Utility class ################################################ class ServerImplementationDict(PostLoadedDict): def __missing__(self, key): try: return super().__missing__(key) except...
<|file_name|>log.js<|end_file_name|><|fim▁begin|>var path = require('path'); var winston = require('winston'); var config = require('./config.js');<|fim▁hole|> module.exports = initLogger(); function initLogger() { var targetDir = path.join(config('workingdir'), 'log'); util.createDirectoryIfNeeded(targetDir)...
var util = require('./util.js');
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(plugin)] #![plugin(rocket_codegen)] extern crate rocket; #[cfg(test)] mod tests; #[get("/users/<name>")] fn user(name: &str) -> Option<&'static str> { if name == "Sergio" {<|fim▁hole|> None } } fn main() { rocket::ignite().mount("/", ro...
Some("Hello, Sergio!") } else {
<|file_name|>prototype.js<|end_file_name|><|fim▁begin|>define({<|fim▁hole|> name: 'prototype' });<|fim▁end|>
<|file_name|>kendo-dojo.js<|end_file_name|><|fim▁begin|>(function($, window) { var dojo = { postSnippet: function (snippet, baseUrl) { snippet = dojo.fixCDNReferences(snippet); snippet = dojo.addBaseRedirectTag(snippet, baseUrl); snippet = dojo.addConsoleScript(snippet); ...
if ($("#mobile-application-container").length) { $("<input name='mode'>").val("ios7").appendTo(form);
<|file_name|>openshiftcontrolplane_default.go<|end_file_name|><|fim▁begin|>package configdefault import ( openshiftcontrolplanev1 "github.com/openshift/api/openshiftcontrolplane/v1" "github.com/openshift/library-go/pkg/config/configdefaults" leaderelectionconverter "github.com/openshift/library-go/pkg/config/leader...
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.<|fim▁hole|><|fim▁end|>
include!("../build.rs");
<|file_name|>customize_form.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. # MIT License. See license.txt from __future__ import unicode_literals """ Customize Form is a Single DocType used to mask the Property Setter Thus providing a better UI from user perspective """ impor...
self.doctype_properties = [ 'search_fields', 'default_print_format', 'read_only_onload',
<|file_name|>tabset.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core'; import { NgbdSharedModule } from '../../shared'; import { ComponentWrapper } from '../../shared/component-wrapper/component-wrapper.component'; import { NgbdComponentsSharedModule, NgbdDemoList } from '../shared'; impo...
import { NgbdTabsetConfigModule } from './demos/config/tabset-config.module'; import { NgbdTabsetJustify } from './demos/justify/tabset-justify'; import { NgbdTabsetJustifyModule } from './demos/justify/tabset-justify.module'; import { NgbdTabsetOrientation } from './demos/orientation/tabset-orientation';
<|file_name|>resize_services.js<|end_file_name|><|fim▁begin|>define(function (require) { 'use strict'; var modules = require('modules'); var $ = require('jquery'); modules.get('a4c-common').factory('resizeServices', ['$timeout', function($timeout) { // the default min width and height for the application ...
var instance = this; window.onresize = function() {
<|file_name|>pre_assembled_adjoint.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # Copyright (C) 2011-2012 by Imperial College London # Copyright (C) 2013 University of Oxford # Copyright (C) 2014 University of Edinburgh # # This program is free software: you can redistribute it and/or modify # it under the t...
f_a_od = f_solve.tangent_linear()[1] for f_dep in f_a_od:
<|file_name|>entryqueue.py<|end_file_name|><|fim▁begin|># Copyright 2015 Adam Greenstein <adamgreenstein@comcast.net> # # Switcharoo Cartographer 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 ...
self.events.on_adding_to_queue(url) self.queue.append(entry) else:
<|file_name|>eofmultisolve.py<|end_file_name|><|fim▁begin|>"""Multiple EOF analysis for :py:mod:`numpy` array data.""" # (c) Copyright 2010-2012 Andrew Dawson. All Rights Reserved. # # This file is part of eof2. # # eof2 is free software: you can redistribute it and/or modify # it under the terms of the GNU Gener...
pcs = self._solver.projectField(cfields, neofs=neofs,
<|file_name|>site_ockg.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- import urllib2, re, json, time, xbmc, traceback from _header import * BASE_URL = 'http://cinemaonline.kg/' BASE_NAME = 'Cinema Online' BASE_LABEL = 'oc' GA_CODE = 'UA-34889597-1' NK_CODE = '1744' def default_oc_noty(): ...
rating = '&emsp;' + imdb['rating'] + ' (' + imdb['votes'] + ') / ' + kinopoisk[ 'rating'] + ' (' + kinopoisk['votes'] + ')' country = ''
<|file_name|>CourseRepository.java<|end_file_name|><|fim▁begin|>package th.ac.kmitl.ce.ooad.cest.repository; <|fim▁hole|>import th.ac.kmitl.ce.ooad.cest.domain.Faculty; import java.util.List; public interface CourseRepository extends CrudRepository<Course, Long>{ Course findFirstByCourseId(String courseId); C...
import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.CrudRepository; import th.ac.kmitl.ce.ooad.cest.domain.Course;
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># coding=utf-8 from setuptools import setup from Cython.Build import cythonize setup( name="cyfib",<|fim▁hole|><|fim▁end|>
ext_modules=cythonize('cyfib.pyx', compiler_directives={'embedsignature': True}), )
<|file_name|>findbestmatch.py<|end_file_name|><|fim▁begin|># GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redi...
<|file_name|>scraper.rs<|end_file_name|><|fim▁begin|>use std::thread; use std::time::Duration; use crossbeam::scope; use config::CONFIG; use github; use releases; use buildbot; pub fn start_scraping() { let orgs = ["rust-lang", "rust-lang-nursery", "rust-lang-deprecated"]; // spawn the github scraper sc...
});
<|file_name|>calculate_pi_old.py<|end_file_name|><|fim▁begin|>import tensorflow as tf import matplotlib.pyplot as plt import math x_node = tf.random_uniform([1], minval=-1, maxval=1, dtype=tf.float32, name='x_node') y_node = tf.random_uniform([1], minval=-1, maxval=1, dtype=tf.float32, name='y_node')...
pi = 4 * float(hits) / i print(pi)
<|file_name|>ccoding_stds_naming.js<|end_file_name|><|fim▁begin|>var ccoding_stds_naming = [ [ "Naming Overview", "ccoding_stds_naming.html#cstdsNaming", [ [ "Be Descriptive", "ccoding_stds_naming.html#descript", null ],<|fim▁hole|> [ "Files", "ccoding_stds_naming.html#cstdsFiles", null ], [ "Macros", ...
[ "Prefixes", "ccoding_stds_naming.html#prefix", null ], [ "Component Interfaces", "ccoding_stds_naming.html#cstdsInterComponentInterfaces", null ], [ "Module Interfaces", "ccoding_stds_naming.html#cstdsInterModuleInterfaces", null ] ] ],
<|file_name|>FloatDotActivity.java<|end_file_name|><|fim▁begin|>package com.zst.xposed.halo.floatingwindow3.prefs; import android.app.*; import android.content.SharedPreferences.OnSharedPreferenceChangeListener; import android.content.*; import android.os.*; import com.zst.xposed.halo.floatingwindow3.*; import java.uti...
<|file_name|>constants.js<|end_file_name|><|fim▁begin|>{ //using constants const a = 2; console.log( a ); // 2 a = 3; // TypeError! } { //an array constant const a = [1,2,3]; a.push( 4 ); console.log( a ); // [1,2,3,4] a = 42; // TypeError!<|fim▁hole|><|fim▁end|>
} //we can change the object using its methods, we just cannot reassign it...
<|file_name|>aui-affix.js<|end_file_name|><|fim▁begin|>/** * The Affix Component * * @module aui-affix */ var win = A.config.win; /** * A base class for Affix. * * Check the [live demo](http://alloyui.com/examples/affix/). * * @class A.Affix * @extends Base * @param {Object} config Object literal specifyin...
*/ _validateOffset: function(val) { if (A.Lang.isFunction(val)) { val = val.call(this);
<|file_name|>sequential.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 http://mozilla.org/MPL/2.0/. */ //! Implements sequential traversal over the DOM tree. #!...
*depth -= 1; }
<|file_name|>comments.js<|end_file_name|><|fim▁begin|>define([ 'backbone',<|fim▁hole|> 'models/comment' ], function(Backbone, model){ var Collection = Backbone.Collection.extend({ model: model, url: '/api/1/comments' }); return new Collection(init.comments); });<|fim▁end|>
<|file_name|>imagenet.py<|end_file_name|><|fim▁begin|>import json import os import six import tensorflow as tf from PIL import Image from luminoth.tools.dataset.readers import InvalidDataDirectory from luminoth.tools.dataset.readers.object_detection import ( ObjectDetectionReader ) from luminoth.utils.dataset imp...
) def _get_image_annotation(self, image_id): return os.path.join(self._annotations_path, '{}.xml'.format(image_id))
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>pub fn ident_to_string(ident: &syn::PatIdent) -> String { ident.ident.to_string() } pub fn is_literal(expr: &syn::Expr) -> bool { match expr { syn::Expr::Lit(_) => true, _ => false, } } #[cfg(test)] pub fn parse_and_run<T: syn::parse::Pars...
<|file_name|>tkhello2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # $Id: tkhello2.py,v 1.1 2000/02/21 09:04:25 wesc Exp $ # # tkhello2.py -- "Hello World!" 2 in Tkinter: # - "Hello World!" with just a button (which quits the app) # # created by wesc 00/02/20 # # import Tkinter module import Tkinter <|...
# create toplevel window top = Tkinter.Tk() # create button
<|file_name|>dao_test.go<|end_file_name|><|fim▁begin|>// Copyright Project Harbor 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/licenses/LICENSE-2...
tagDao tag_dao.DAO afDao af_dao.DAO id int64 ctx context.Context
<|file_name|>karma.underscore.conf.js<|end_file_name|><|fim▁begin|>// Karma configuration // Generated on Sun Apr 14 2013 18:31:17 GMT+0200 (CEST) // base path, that will be used to resolve files and exclude basePath = ''; // list of files / patterns to load in the browser files = [ JASMINE, JASMINE_ADAPTER, ...
// - Firefox // - Opera
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|>// Generated by typings // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/f3171e4cc00e270852e60d257931c8ea37273f2d/angular-ui-bootstrap/angular-ui-bootstrap.d.ts declare module 'angular-bootstrap' { let _: string; export = _; } dec...
date?: string; 'datetime-local'?: string; month?: string;
<|file_name|>helpers.js<|end_file_name|><|fim▁begin|>Template.registerHelper("itemTypes", function() { return [ {label: i18n.t('choose'), value: ''}, {label: i18n.t('offer'), value: 'offer', icon: 'icon gift'}, {label: i18n.t('need'), value: 'need', icon: 'icon fire'}, {label: i18n.t...
})
<|file_name|>merge_sort.py<|end_file_name|><|fim▁begin|>"""Two different implementations of merge sort. First one is the standard sort that creates the result to new list on each level. Second one is an in-place sort that uses two alternating buffers and offsets to limit memory usage to O(2n). """ def sort(lst): ...
<|file_name|>make.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import os<|fim▁hole|>import zlib import os.path def _ignore(src, name ): if src == './UPLOAD/': print name return ['RESTDIR', 'conf.inc.php', 'Nuked-Klan.zip', '.hg', 'make.py'] else: return [] def _RecImport(src, dst,...
import shutil import zipfile
<|file_name|>newton.py<|end_file_name|><|fim▁begin|>from interval import interval, inf, imath, fpu from complexinterval import ComplexInterval, _one, _zero from complexpolynomial import ComplexPolynomial class Newton: def __init__(self, start, poly): self.start = start self.poly = poly self.iterates = 0 self...
<|file_name|>IsClassMethods.py<|end_file_name|><|fim▁begin|>"""Subclass of IsClassMethods, which is generated by wxFormBuilder.""" from beatle import model from beatle.lib import wxx from beatle.activity.models.ui import ui as ui from beatle.app.utils import cached_type # Implementing IsClassMethods class IsClassMet...
def visit(self, k): """Add inheritance branch"""
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>import os import json from subprocess import check_output, CalledProcessError #Constants _TREE_PATH="data/graph/" def renderGraph(query): """ Returns the path to a svg file that contains the graph render of the query.<|fim▁hole|> Creates th...
<|file_name|>FieldDeclarationCollectorTest.java<|end_file_name|><|fim▁begin|>package br.pucrio.opus.smells.tests.visitor; import java.io.File; import java.io.IOException; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; import org.eclipse.jdt.core.dom.FieldDeclaration; import org.junit.Assert; ...
import br.pucrio.opus.smells.ast.visitors.FieldDeclarationCollector;
<|file_name|>set-barcode-image-height-width-quality-settings.py<|end_file_name|><|fim▁begin|>import asposebarcodecloud from asposebarcodecloud.BarcodeApi import BarcodeApi from asposebarcodecloud.BarcodeApi import ApiException import asposestoragecloud from asposestoragecloud.StorageApi import StorageApi from a...
print "Message:" + ex.message #ExEnd:1
<|file_name|>write_batch.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use std::sync::Arc; use crate::engine::RocksEngine; use crate::options::RocksWriteOptions; use crate::util::get_cf_handle; use engine_traits::{self, Error, Mutable, Result, WriteBatchExt, WriteO...
} else { self.get_db() .write_opt(&self.wbs[0], &opt.into_raw()) .map_err(Error::Engine)
<|file_name|>monster_example.rs<|end_file_name|><|fim▁begin|>extern crate flatbuffers; #[path = "../../monster_test_generated.rs"] mod monster_test_generated; pub use monster_test_generated::my_game; use std::io::Read; fn main() { let mut f = std::fs::File::open("../monsterdata_test.mon").unwrap(); let mut b...
let monster = my_game::example::get_root_as_monster(&buf[..]); println!("{}", monster.hp()); // `80` println!("{}", monster.mana()); // default value of `150`
<|file_name|>triggerHandler.js<|end_file_name|><|fim▁begin|>/* global logger, processWebhookMessage */ import moment from 'moment'; RocketChat.integrations.triggerHandler = new class RocketChatIntegrationHandler { constructor() { this.vm = Npm.require('vm'); this.successResults = [200, 201, 202]; this.compiledS...
<|file_name|>fmt_test.go<|end_file_name|><|fim▁begin|>package tick import "testing" func TestFormat(t *testing.T) { testCases := []struct { script string exp string }{ { script: `var x = 1`, exp: "var x = 1\n", }, { script: `var x=1`, exp: "var x = 1\n", }, { script: `var x=str...
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- <|fim▁hole|><|fim▁end|>
from MainWindow import Controller
<|file_name|>deprecation.py<|end_file_name|><|fim▁begin|>import asyncio import inspect import warnings from asgiref.sync import sync_to_async class RemovedInDjango41Warning(DeprecationWarning): pass class RemovedInDjango50Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDja...
3) Complain whenever an old method is called.
<|file_name|>page_privacy.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, unicode_literals from django.core.exceptions import PermissionDenied from django.shortcuts import get_object_or_404 from wagtail.wagtailadmin.forms import PageViewRestrictionForm from wagtail.wagtailadmin.modal_workflow ...
) else: # no restriction set at ancestor level - can set restrictions here return render_modal_workflow(
<|file_name|>binary.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 4.0.0-a53ec6ee1b (http://hl7.org/fhir/StructureDefinition/Binary) on 2019-05-07. # 2019, SMART Health IT. from . import resource class Binary(resource.Resource): """ Pure binary content def...
import sys try: from . import fhirreference
<|file_name|>ConfigureRelationsPlugin.java<|end_file_name|><|fim▁begin|>package org.opentosca.planbuilder.type.plugin.connectsto.core; import java.util.List; import java.util.Objects; import org.eclipse.winery.model.tosca.TInterface; import org.eclipse.winery.model.tosca.TNodeTemplate; import org.eclipse.winery.model...
public static final String OPERATION_POST_CONFIGURE_TARGET = "postConfigureTarget";
<|file_name|>supertypes.rs<|end_file_name|><|fim▁begin|>use super::{general::StatusedTypeId, imports::Imports}; use crate::{ analysis::{namespaces, rust_type::used_rust_type}, env::Env, library::TypeId, }; pub fn analyze(env: &Env, type_id: TypeId, imports: &mut Imports) -> Vec<StatusedTypeId> { let mu...
let mut parents = Vec::new(); let gobject_id = match env.library.find_type(0, "GObject.Object") {
<|file_name|>CreateControlSystems.hpp<|end_file_name|><|fim▁begin|>#include "../control/ControlSystem_Peep.hpp" #include "../control/ControlSystem_Teach.hpp" #include <iostream> #include "../types.hpp" using namespace pathos::peepingpanel; std::vector<ControlSystem_Peep*> CreateControlSystem(AllConfigArray configData...
SensorsAreasArray sensorsArea_3, SensorsAreasArray sensorsArea_4, SensorsThread* sensorsThread)
<|file_name|>log_f32_relaxed.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#include "log_f32.rs" #pragma rs_fp_relaxed
<|file_name|>p39.py<|end_file_name|><|fim▁begin|>#TODO: make under 1 min. #SOLVED import math MAX_P = 1000 best_p = 120 best_num_sides = 3 for p in range(2, MAX_P+1): num_sides = 0 if p % 30 == 0: print(p)<|fim▁hole|> for a in range(1, MAX_P/2 + 2): for b in range(1, MAX_P/2 + 2): ...
<|file_name|>FilePrintWriter.java<|end_file_name|><|fim▁begin|>package me.hatter.tools.resourceproxy.commons.io; import java.io.File;<|fim▁hole|>import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; public class FilePrintWriter extends PrintWriter { public Fi...
import java.io.FileNotFoundException; import java.io.FileOutputStream;
<|file_name|>mlog.cpp<|end_file_name|><|fim▁begin|>/** * Copyright 2017 Shusheng Shao <iblackangel@163.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 at * * http://www.apache.org/...
std::string logfile = _logdir + DIRECTORY_SEPARATOR + _prefix + MDateTime::currentDateTime().toString("%Y%m%d")
<|file_name|>hw2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #Name: Ian Wong #Date: 1/3/16 #Assignment: Counting Vowels string = input("What is your string?") string = string.lower() count1= string.count('a') count2 = string.count('e') count3 = string.count('i') count4 = string.count('o') count5 = string.co...
print ("There are %i i in the text." % (count3)) print ("There are %i o in the text." % (count4)) print ("There are %i u in the text." % (count5))
<|file_name|>cms_tags.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from classytags.arguments import Argument, MultiValueArgument from classytags.core import Options, Tag from classytags.helpers import InclusionTag from classytags.parser import Parser from cms.models import Page, Placeholder as PlaceholderMod...
site_id = site.id
<|file_name|>EnumParser.java<|end_file_name|><|fim▁begin|>package placebooks.client.parser;<|fim▁hole|>import com.google.gwt.core.client.JsonUtils; public abstract class EnumParser<T extends Enum<?>> implements JSONParser<Enum<?>> { @Override public void write(final StringBuilder builder, final Enum<?> object) { ...
<|file_name|>i18n_base_midddleware.py<|end_file_name|><|fim▁begin|>import contextvars import gettext import os from telebot.asyncio_handler_backends import BaseMiddleware try: from babel.support import LazyProxy babel_imported = True except ImportError: babel_imported = False class I18N(BaseMiddleware)...
if not os.path.isdir(translations_path): continue
<|file_name|>autosubmit.js<|end_file_name|><|fim▁begin|>var AutoSubmit = { setupAutoSubmit: function(field, button) { $(field).keypress(function(evt) { if (AutoSubmit.isEnter(evt)) { return false; } }); $(field).keydown(function(evt) { if (AutoSubmit.isEnter(evt)) {<|fim▁hole|> retur...
$(button).click();
<|file_name|>impl_first.rs<|end_file_name|><|fim▁begin|>// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use std::marker::PhantomData; use tidb_query_codegen::AggrFunction; use tidb_query_common::Result; use tidb_query_datatype::codec::data_type::*; use tidb_query_datatype::expr::EvalContext; use ti...
&[0, 1]
<|file_name|>tuples_basics.py<|end_file_name|><|fim▁begin|>>>> myTuple = (1, 2, 3) >>> myTuple[1] 2 >>> myTuple[1:3]<|fim▁hole|><|fim▁end|>
(2, 3)
<|file_name|>plat_win.py<|end_file_name|><|fim▁begin|># Copyright 2013 Hardcoded Software (http://www.hardcoded.net) # This software is licensed under the "BSD" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at <|fim▁hole|>from ctypes import wind...
# http://www.hardcoded.net/licenses/bsd_license from __future__ import unicode_literals
<|file_name|>bitcoin_tr.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="tr" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Dotcoin</source> ...
<message> <location line="+3"/> <source>Sign &amp;Message</source>
<|file_name|>stkalign.C<|end_file_name|><|fim▁begin|>// { dg-do assemble } // Copyright (C) 2000 Free Software Foundation // by Alexandre Oliva <aoliva@cygnus.com><|fim▁hole|> ~Integer () {} }; void foo (const Integer& y); Integer bar (const Integer& x); void show (const Integer& x) { foo (bar (x)); }<|fim▁end|>
// distilled from libg++'s Fix.cc struct Integer {
<|file_name|>tutorial4.rs<|end_file_name|><|fim▁begin|>use std::process::exit; use std::sync::mpsc; use std::thread::sleep; use std::time::Duration; extern crate unbound; mod util; fn main() { let ctx = unbound::Context::new().unwrap(); let mut i = 0; let (tx, rx) = mpsc::channel(); let mycallback =...
i += 1; println!("time passed ({}) ..", i);
<|file_name|>bitcoin_pt_PT.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Pxlcoin</sourc...
</message> <message> <location line="+1"/> <source>Error loading block database</source>
<|file_name|>overloadingOnConstantsInImplementation.ts<|end_file_name|><|fim▁begin|>function foo(a: 'hi', x: string);<|fim▁hole|>function foo(a: 'hi', x: string); function foo(a: 'hi', x: any) { }<|fim▁end|>
<|file_name|>Streaming2.py<|end_file_name|><|fim▁begin|>from Components.Converter.Converter import Converter from Components.Element import cached from pprint import pprint # the protocol works as the following: # lines starting with '-' are fatal errors (no recovery possible), # lines starting with '=' are progress ...
retval += "\n" return(retval)
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # seamless documentation build configuration file, created by # sphinx-quickstart on Mon Jul 3 17:16:13 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all pos...
# so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static']
<|file_name|>MotanConsumerInterceptor.java<|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 t...
} @Override public void handleMethodException(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes, Throwable t) {
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// The MIT License (MIT) // // Copyright (c) 2016-2022 Ivan Dejanovic // // 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 restrictio...
<|file_name|>azureutils.py<|end_file_name|><|fim▁begin|># Copyright 2009-2014 Justin Riley # # This file is part of TethysCluster. # # TethysCluster is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation, eithe...
self._properties = pg._properties self._service_tags = self._properties.extended_properties
<|file_name|>ResponseInfo.java<|end_file_name|><|fim▁begin|>package com.lling.qiqu.commons; import java.io.Serializable; /** * @ClassName: ResponseInfo<|fim▁hole|>public class ResponseInfo implements Serializable{ private static final long serialVersionUID = 1L; private String code; private String desc; privat...
* @Description: http接口返回数据封装类 * @author lling * @date 2015-5-30 */
<|file_name|>test_geopackage.py<|end_file_name|><|fim▁begin|>import logging import os import os.path import shutil import sys import tempfile import unittest import pytest import fiona from fiona.collection import supported_drivers from fiona.errors import FionaValueError, DriverError, SchemaError, CRSError from fion...
c.writerecords([{ 'geometry': {'type': 'Point', 'coordinates': [2.0, 3.0]},
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>import where_query<|fim▁end|>
<|file_name|>creature.js<|end_file_name|><|fim▁begin|>import { Ability } from "./ability"; import { search } from "./utility/pathfinding"; import { Hex } from "./utility/hex"; import * as arrayUtils from "./utility/arrayUtils"; import { Drop } from "./drops"; import { Effect } from "./effect"; /** * Creature Class ...
<|file_name|>alife_simulator_base2.cpp<|end_file_name|><|fim▁begin|>//////////////////////////////////////////////////////////////////////////// // Module : alife_simulator_base2.cpp // Created : 25.12.2002 // Modified : 12.05.2004 // Author : Dmitriy Iassenev // Description : ALife Simulator base class /////////...
if (add_object)
<|file_name|>wait.py<|end_file_name|><|fim▁begin|># Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache L...
class WebDriverWait(object): def __init__(self, driver, timeout, poll_frequency=POLL_FREQUENCY, ignored_exceptions=None): """Constructor, takes a WebDriver instance and timeout in seconds.
<|file_name|>profile2.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import division import os, traceback, math, re, zlib, base64, time, sys, platform, glob, string, stat import cPickle as pickle if sys.version_info[0] < 3: import ConfigParser else: import configparser as Conf...
if platform.system() == "Windows": basePath = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), ".."))
<|file_name|>video-comments.component.ts<|end_file_name|><|fim▁begin|>import { Subject, Subscription } from 'rxjs' import { Component, ElementRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { AuthServ...
comment.deletedAt = new Date() comment.text = ''
<|file_name|>smallest-hello-world.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-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 // http://www....
extern crate libc; extern { fn puts(s: *const u8); } extern "rust-intrinsic" { fn transmute<T, U>(t: T) -> U; }
<|file_name|>HighAvailability.java<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2002-2018 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU Affer...
@Description( "Whether this instance is alive or not" ) boolean isAlive(); @Description( "The role this instance has in the cluster" )
<|file_name|>GFTTDetector.d.ts<|end_file_name|><|fim▁begin|>import { KeyPointDetector } from './KeyPointDetector'; export class GFTTDetector extends KeyPointDetector {<|fim▁hole|> readonly qualityLevel: number; readonly minDistance: number; readonly k: number; readonly harrisDetector: boolean; constructor(ma...
readonly maxFeatures: number; readonly blockSize: number;
<|file_name|>cpu_unittest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/cpu.h" #include "build/build_config.h" #include "testing/gtest/include/gtest...
<|file_name|>edit-problem.request.ts<|end_file_name|><|fim▁begin|>import {Test} from "../test"; export class EditProblemRequest { timeLimit: number; memoryLimit: number; checkerFile: File; name: string; legend: string; input: string; output: string; notes: string; statementsPdf: Fi...
statementsPdfExists: boolean; }
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># This file is part of trc.me. # # trc.me 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 License, or (at your option) any later<|fim▁...
# version. # # trc.me is distributed in the hope that it will be useful, but WITHOUT ANY
<|file_name|>carrier.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ :copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited :license: BSD, see LICENSE for more details. """ from trytond.model import ModelSQL, ModelView, fields from trytond.pool import PoolMeta, Pool from trytond.pyso...
A helper function that finds the most matching zone from the given address.
<|file_name|>typeGuardOfFormTypeOfNotEqualHasNoEffect.ts<|end_file_name|><|fim▁begin|>class C { private p: string }; var strOrNum: string | number; var strOrBool: string | boolean; var numOrBool: number | boolean var strOrC: string | C; // typeof x != s has not effect on typeguard if (typeof strOrNum != "stri...
}
<|file_name|>toast.js<|end_file_name|><|fim▁begin|>/* */ "format cjs"; /*! * Angular Material Design * https://github.com/angular/material * @license MIT * v1.1.1-master-342ee53 */ (function( window, angular, undefined ){ "use strict"; /** * @ngdoc module * @name material.components.toast * @description ...
if ($mdUtil.hasComputedStyle(options.parent, 'position', 'static')) { options.parent.css('position', ''); }
<|file_name|>home.controller.js<|end_file_name|><|fim▁begin|>(function() { 'use strict'; angular .module('app.home')<|fim▁hole|> Home.$inject = ['$scope', 'template']; function Home($scope, template) { var vm = this; activate(); function activate() { console.log('Activating Home Controlle...
.controller('Home', Home);
<|file_name|>sitemap.py<|end_file_name|><|fim▁begin|>from functools import wraps from flask import current_app, request from flask_sitemap import Sitemap, sitemap_page_needed from udata.app import cache sitemap = Sitemap() CACHE_KEY = 'sitemap-page-{0}' @sitemap_page_needed.connect def create_page(app, page, urls...
@wraps(fn)
<|file_name|>common.py<|end_file_name|><|fim▁begin|>from cherrydo.utils import is_cherrydo_project class CherryDoException(Exception): pass class BaseGenerator(object): def __init__(self, name, params): self.name = name self.params = params def formatted_name(self): return self....