prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>index.py<|end_file_name|><|fim▁begin|>import tornado import tornado.gen from req import Service from req import ApiRequestHandler<|fim▁hole|> @tornado.gen.coroutine def get(self): self.render()<|fim▁end|>
class Index(ApiRequestHandler):
<|file_name|>custom_home.js<|end_file_name|><|fim▁begin|>ar_menu=new Array('downloaded','featured','popular','new','free','random'); str=1; id_component=0; ctype_component=""; flag_auto=true; res=""; function zcomponent(id,ctype,page) { if(id!=id_component) { document.getElementById('home_boxes').innerHTML = "";...
if(res!="") { //zcomponent(id_component,ctype_component,str); }
<|file_name|>regex_route.rs<|end_file_name|><|fim▁begin|>use util::*; use hyper::status::StatusCode; use hyper::client::Response; fn with_path<F>(path: &str, f: F) where F: FnOnce(&mut Response) { run_example("regex_route", |port| { let url = format!("http://localhost:{}{}", port, path); let ref m...
f(res) }) }
<|file_name|>Cube.js<|end_file_name|><|fim▁begin|>import * as React from 'react'; function CubeIcon(props) { return ( <svg xmlns="http://www.w3.org/2000/svg" fill="none"<|fim▁hole|> <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M20 7l-8-4-8...
viewBox="0 0 24 24" stroke="currentColor" {...props} >
<|file_name|>naive_fibinocci.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import sys def fib(n): if(n<=2): return (n-1) else: return fib(n-1)+fib(n-2) if ( len(sys.argv) == 2 ):<|fim▁hole|> print fib(int(sys.argv[1])) else: print "Usage : "+sys.argv[0]+" <term required>"<|fim▁end|>
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__all__ = ['Constraint', 'ConstraintGroup', 'TotalSumValueConstraint', 'UniqueValueConstraint'] from .constraint import Constraint<|fim▁hole|><|fim▁end|>
from .constraintgroup import ConstraintGroup from .totalsumvalueconstraint import TotalSumValueConstraint from .uniquevalueconstraint import UniqueValueConstraint
<|file_name|>community.py<|end_file_name|><|fim▁begin|>import os import time import hashlib import logging from base64 import b64encode from collections import OrderedDict, defaultdict from twisted.internet.task import LoopingCall from twisted.internet.defer import Deferred from dispersy.authentication import MemberA...
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; // 1. npm install body-parser express request // 2. Download and install ngrok from https://ngrok.com/download // 3. ./ngrok http 8445 // 4. WIT_TOKEN=your_access_token FB_PAGE_ID=your_page_id FB_PAGE_TOKEN=your_page_token FB_VERIFY_TOKEN=verify_token n...
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os<|fim▁hole|> if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "like.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)<|fim▁end|>
import sys
<|file_name|>test.ts<|end_file_name|><|fim▁begin|>import rearrangeDutch from './main'; declare function require(name: string): any; const assert = require('assert'); const tests: {arrayBefore: number[], pivotIndex: number, arrayAfter: number[]}[] = [ { arrayBefore: [1], pivotIndex: 0, arra...
rearrangeDutch(array, pivotIndex);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf-8 """ Profiler utility for python Erik de Jonge erik@a8.nl license: gpl2 """ from __future__ import print_function from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from future import standard...
""" print("\033[33m$", x, "\033[0m")
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # __init__.py - Startup and module loading logic for Mercurial. # # Copyright 2015 Gregor...
def shoulduselegacy(name): legacy = getattr(os, "environ").get("HGLEGACY") if legacy is not None:
<|file_name|>fortios_vpn_ipsec_phase1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as pu...
suboptions: state: description: - B(Deprecated)
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import patterns, url<|fim▁hole|> urlpatterns = patterns('', url(r'^sql/$', 'sqlparser.views.parse_sql'), )<|fim▁end|>
<|file_name|>noop_animation_engine.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 {AnimationEvent, AnimationMetadataType, Ani...
<|file_name|>theme_factory.py<|end_file_name|><|fim▁begin|><|fim▁hole|> from questionnaire.models import Theme class ThemeFactory(factory.DjangoModelFactory): class Meta: model = Theme name = "A title" description = 'Description'<|fim▁end|>
import factory
<|file_name|>package-info.java<|end_file_name|><|fim▁begin|>/** * Utility classes for converting between granularities of SI (power-of-ten) and IEC (power-of-two) * byte units and bit units. * <p> * <h3>Example Usage</h3> * What's the difference in hard drive space between perception and actual? * <pre><code> * ...
* Method parameter for specifying a resource size. * <pre><code> * public void installDiskCache(long count, ByteUnit unit) { * long size = unit.toBytes(count);
<|file_name|>Display.cpp<|end_file_name|><|fim▁begin|>#include "Display.h" #include <memory> #include <GL/glew.h><|fim▁hole|>/* Display source file * Used for handling and managing the display portion of the engine */ namespace Display { constexpr static int Width = 640; constexpr static int Height = 480; ...
#include <SFML/Graphics.hpp>
<|file_name|>git_test.rs<|end_file_name|><|fim▁begin|>mod git_helper; use git_helper::temp_git::TempGit; #[test] fn test_current_branch() { let git = TempGit::new(); assert_eq!("master", git.git.current_branch().unwrap()); git.run_git(&["checkout", "-b", "other-branch"]); assert_eq!("other-branch", g...
let new_falcon_commit = git.run_git(&["rev-parse", "HEAD"]); assert_eq!( new_base_commit,
<|file_name|>loop.go<|end_file_name|><|fim▁begin|>package fishly import ( "bufio" "fmt" "io" "log" "os" "strconv" "strings" ) // // loop -- main file in fishly which receives input lines from driver // which would be either readline (terminal) or HTTP client (web), // starts cancel handler and interprets inp...
} else if err == io.EOF { ctx.exitCode = 0 return
<|file_name|>issue-11740.rs<|end_file_name|><|fim▁begin|>// check-pass // revisions: mir thir // [thir]compile-flags: -Zthir-unsafeck struct Attr { name: String, value: String, } struct Element { attrs: Vec<Box<Attr>>, } <|fim▁hole|>impl Element { pub unsafe fn get_attr<'a>(&'a self, name: &str) { ...
<|file_name|>family-manager.component.ts<|end_file_name|><|fim▁begin|>import {Component} from "angular2/core"; import {FamilyEditorComponent} from "./family-editor.component";<|fim▁hole|> selector: "family-manager", templateUrl: '/templates/products/family/family-manager.template.html', directives: [FamilyEd...
import {FamilyListComponent} from "./family-list.component"; @Component({
<|file_name|>ragna.py<|end_file_name|><|fim▁begin|>import re def read_lua(): PATTERN = r'\s*\[(?P<id>\d+)\] = {\s*unidentifiedDisplayName = ' \ r'"(?P<unidentifiedDisplayName>[^"]+)",\s*unidentifie' \ <|fim▁hole|> r')",\s*unidentifiedDescriptionName = {\s*"(?P<uniden' \ ...
r'dResourceName = "(?P<unidentifiedResourceName>[^"]+' \
<|file_name|>dependency-wheel.src.js<|end_file_name|><|fim▁begin|>/** * @license Highcharts JS v9.0.1 (2021-02-16) * @module highcharts/modules/dependency-wheel * @requires highcharts * @requires highcharts/modules/sankey * * Dependency wheel module<|fim▁hole|> * (c) 2010-2021 Torstein Honsi * * License: www.hi...
*
<|file_name|>sender.py<|end_file_name|><|fim▁begin|># Copyright (c) 2014 Mirantis 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
SERVICE = 'sahara' CLUSTER_EVENT_TEMPLATE = "sahara.cluster.%s" HEALTH_EVENT_TYPE = CLUSTER_EVENT_TEMPLATE % "health"
<|file_name|>PolyCollisionScene.cpp<|end_file_name|><|fim▁begin|>/* Copyright (C) 2011 by Ivan Safrin 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 restriction, including without limitat...
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
<|file_name|>model-field-meta.js<|end_file_name|><|fim▁begin|><|fim▁hole|> /** * Represents a specific field meta data extending from {@link ModelAttributeMetaData} * * @author Svetlozar Iliev */ export class ModelFieldMetaData extends ModelAttributeMetaData { constructor(id) { super(id); } }<|fim▁end|>
import {ModelAttributeMetaData} from 'administration/model-management/meta/model-attribute-meta';
<|file_name|>sfc_main.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Testing module from creating product using http://www.sendfromchina.com/default/index/webservice """ from flask import Flask, render_template, request from flask_wtf.csrf import CSRFProtect from werkzeug.datastr...
if __name__ == "__main__": app.run(host='0.0.0.0', debug=True)
<|file_name|>jumps.rs<|end_file_name|><|fim▁begin|>/// Module for jump and related instructions (call, return, reset) use jeebie::core::cpu::CPU; use jeebie::core::registers::{Flags, Register16}; // TODO: make appropriate timings for jumps when a branch is taken or not. // 'JP nn' C3 12 pub fn JP_nn(cpu: &mut CPU) ->...
<|file_name|>elasticache.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # # Copyright (c) 2017 Ansible Project # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], '...
if self.data: info['data'] = self.data return info
<|file_name|>serial_title.py<|end_file_name|><|fim▁begin|>from collections import namedtuple from pybliometrics.scopus.superclasses import Retrieval from pybliometrics.scopus.utils import check_parameter_value, get_link class SerialTitle(Retrieval): @property def aggregation_type(self): """The type o...
return self._entry.get('openaccessStartDate') @property def openaccesstype(self):
<|file_name|>data_trigger.py<|end_file_name|><|fim▁begin|>########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, tr...
<|file_name|>account_tax_registry.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright (C) 2015 Agile Business Group # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as publish...
('supplier', 'Supplier Invoices'), ('corrispettivi', 'Corrispettivi'), ], 'Layout', required=True)
<|file_name|>DSXOrderHistoryReturn.java<|end_file_name|><|fim▁begin|>package org.knowm.xchange.dsx.dto.trade; import com.fasterxml.jackson.annotation.JsonProperty;<|fim▁hole|>public class DSXOrderHistoryReturn extends DSXReturn<Map<Long, DSXOrderHistoryResult>> { public DSXOrderHistoryReturn( @JsonProperty("s...
import java.util.Map; import org.knowm.xchange.dsx.dto.DSXReturn; /** @author Mikhail Wall */
<|file_name|>config.js<|end_file_name|><|fim▁begin|>module.exports = { stores: process.env.STORES ? process.env.STORES.split(',') : [ 'elasticsearch', 'postgresql', 'leveldb' ], postgresql: { host: process.env.POSTGRESQL_HOST || 'localhost', port: process.env.POSTGRESQL_PORT || '5432', ...
<|file_name|>buildbug.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2014 airbug inc. http://airbug.com * * bugpack-registry may be freely distributed under the MIT license. */ //------------------------------------------------------------------------------- // Requires //-------------------------------------...
<|file_name|>PreApprovalSummaryXML.java<|end_file_name|><|fim▁begin|>/* * 2007-2016 [PagSeguro Internet Ltda.] * * NOTICE OF LICENSE * * 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 ...
} @XmlElement public void setTracker(String tracker) {
<|file_name|>python_test.cpp<|end_file_name|><|fim▁begin|>/* This file is part of Clementine. Copyright 2010, David Sansome <me@davidsansome.com> Clementine 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 Foundat...
TemporaryScript script( "from PythonQt.QtCore import QFile, QObject\n"
<|file_name|>trollcoin_af.ts<|end_file_name|><|fim▁begin|><TS language="af" version="2.1"> <context> <name>AddressBookPage</name> <message> <source>Right-click to edit address or label</source> <translation>Regs-kliek om die adres of etiket te verander</translation> </message> <message> ...
<translation>Wys inligting oor %1</translation> </message> <message>
<|file_name|>command_utils.py<|end_file_name|><|fim▁begin|>""" Useful utilities for management commands. """ from django.core.management.base import CommandError from opaque_keys import InvalidKeyError<|fim▁hole|> def get_mutually_exclusive_required_option(options, *selections): """ Validates that exactly on...
from opaque_keys.edx.keys import CourseKey
<|file_name|>getters.js<|end_file_name|><|fim▁begin|>const pkg = state => state.pkg const app = state => state.app const device = state => state.app.device<|fim▁hole|>const sidebar = state => state.app.sidebar const effect = state => state.app.effect const menuitems = state => state.menu.items const componententry = st...
<|file_name|>reducer.js<|end_file_name|><|fim▁begin|>import { UPDATE_BOMB_LOCATIONS, REMOVE_PLAYER_BOMBS } from './constants' const initialState = { } //the bombs are stored in an 'allBombs' object within the state, that has keys of the user's socket ID, each with a property of an array of that user's bomb objects ex...
newState = Object.assign({}, state); for (let key in action.allBombs) { newState[key] = action.allBombs[key] }
<|file_name|>const.go<|end_file_name|><|fim▁begin|>package proto const ( UserLogin = "user_login" UserLoginResult = "user_login_result" UserRegister = "user_register"<|fim▁hole|> const ( UserOnline = 1 UserOffline = 2 )<|fim▁end|>
UserStatusNotifyRes = "user_status_notify" )
<|file_name|>aci_switch_leaf_selector.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, divisio...
sample: '<?xml version="1.0" encoding="UTF-8"?><imdata totalCount="1"><error code="122" text="unknown managed object class foo"/></imdata>' sent: description: The actual/minimal configuration pushed to the APIC
<|file_name|>object-curly-newline.js<|end_file_name|><|fim▁begin|>/** * @fileoverview Rule to require or disallow line breaks inside braces. * @author Toru Nagashima */ "use strict"; //------------------------------------------------------------------------------ // Requirements //---------------------------------...
<|file_name|>test.js<|end_file_name|><|fim▁begin|>'use strict'; const gulpMocha = require('gulp-mocha'); module.exports = function (simpleBuild) { const gulp = simpleBuild.gulp; gulp.task('test', ['test:server']); gulp.task('test:watch', ['test:server:watch']); <|fim▁hole|> return gulp.src('./src/server/**/...
gulp.task('test:server', function () {
<|file_name|>routers.ts<|end_file_name|><|fim▁begin|>import {Routes} from '@angular/router'; import {JournalComponent} from '../journal/journal.component'; export const LUOO_APP_ROUTERS: Routes = [ {path: 'journal', component: JournalComponent}<|fim▁hole|><|fim▁end|>
]
<|file_name|>Spectrum.js<|end_file_name|><|fim▁begin|>Clazz.declarePackage ("JSV.common"); Clazz.load (["java.lang.Enum", "JSV.source.JDXDataObject", "JU.Lst"], "JSV.common.Spectrum", ["java.lang.Boolean", "$.Double", "java.util.Hashtable", "JU.PT", "JSV.common.Coordinate", "$.Parameters", "$.PeakInfo", "JSV.source.JD...
if (irMode === JSV.common.Spectrum.IRMode.TO_ABS || irMode === JSV.common.Spectrum.IRMode.TO_TRANS) for (var i = 0; i < specs.size (); i++) specs.set (i, JSV.common.Spectrum.taConvert (specs.get (i), irMode));
<|file_name|>FragmentBase.java<|end_file_name|><|fim▁begin|>package com.example.dell.texttwo.ui; import com.example.dell.texttwo.R; import android.content.BroadcastReceiver; import android.content.IntentFilter; import android.database.ContentObserver; import android.net.Uri; import android.os.Bundle; import android.s...
public class FragmentBase extends Fragment {
<|file_name|>observeOn.ts<|end_file_name|><|fim▁begin|>import { Observable } from '../Observable'; import { Scheduler } from '../Scheduler'; import { Operator } from '../Operator'; import { PartialObserver } from '../Observer'; import { Subscriber } from '../Subscriber'; import { Notification } from '../Notification'; ...
constructor(private scheduler: Scheduler, private delay: number = 0) { }
<|file_name|>models.rs<|end_file_name|><|fim▁begin|>use data::schema::pages; #[derive(Insertable)] #[table_name="pages"] pub struct NewPage<'a> { pub slug: &'a str,<|fim▁hole|> #[derive(Queryable)] pub struct Page { pub id: i32, pub slug: String, pub title: String, pub body: String, }<|fim▁end|>
pub title: &'a str, pub body: &'a str, }
<|file_name|>SihateJismaniPart2.java<|end_file_name|><|fim▁begin|>package com.aliumujib.majlis.mkan_report_app.addnew.fragments; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.aliumujib.majlis.mkan_report_app.R; import com.stepstone.st...
<|file_name|>boxed.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/lice...
/// }
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup import os import codecs here = os.path.abspath(os.path.dirname(__file__)) def read(*parts): # intentionally *not* adding an encoding option to open return codecs.open(os.path.join(here, *parts), 'r').read() setup( name='clo...
license='LICENSE',
<|file_name|>Canvas.js<|end_file_name|><|fim▁begin|>/* function Canvas(paper, props){ var props = $.extend(true, { "x" : 0, "y" : 0, "width" : "100%", "height" : "100%" }, (props || {})), _scale = 1, _translateX = 0, _translateY = 0, self = this, lx = 0, ly = 0, ox = 0, oy...
<|file_name|>signalActions.py<|end_file_name|><|fim▁begin|>import models<|fim▁hole|>def borradoPlan(sender, **kwargs): borrada = kwargs['instance'] if borrada.tipo == "pr": aBorrar = models.PlanPrepago.objects.filter(codplan=borrada) else: aBorrar = models.PlanPostpago.objects.filter(codplan=borrada) ...
<|file_name|>usb_dbus_system.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python # DBus to turn USB on or off (by unbinding the driver) # The System D-bus import dbus import dbus.service from gi.repository import GLib from dbus.mainloop.glib import DBusGMainLoop from usb_inhibit import USB_inhibit class USB_Servi...
inhibitor_work = False def __init__(self): self.usb_monitor = USB_inhibit(True)
<|file_name|>utils.rs<|end_file_name|><|fim▁begin|>use std::collections::{HashSet, HashMap}; use std::iter::FromIterator; use std::cmp::min; use std::error::Error; use rand::{thread_rng, Rng}; use image::{GenericImage, DynamicImage, ImageBuffer, Luma, FilterType}; use image::imageops::rotate270; use image::imageops::co...
<|file_name|>day07-pt1.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Advent of Code 2016 - Day 7, Part One import sys import re from itertools import islice def window(seq, n=2): "Returns a sliding window (of width n) over data from the iterable" " s -> (s0,s1,...s[n-1]), (s1,s2,...,sn), ... ...
sys.exit(main(sys.argv))
<|file_name|>elFinder4.quickLook.js<|end_file_name|><|fim▁begin|>/** * @class Create quick look window (similar to MacOS X Quick Look) * @author dio dio@std42.ru **/ (function($) { elFinder.prototype.quickLook = function(fm, el) { var self = this; this.fm = fm; this._hash = ''; this.title = $('<strong/>...
var id = self.fm.selected[0], el = self.fm.view.cwd.find('[key="'+id+'"]'), o = el.offset();
<|file_name|>colaborador.js<|end_file_name|><|fim▁begin|>module.exports = function (app) { var colaboradorCtrl = app.controllers.colaborador; app.get('/colaborador', colaboradorCtrl.index);<|fim▁hole|> app.get('/buscar_colaborador_id/:id', colaboradorCtrl.buscarId); app.post('/editar_colaborador/:id', c...
app.post('/buscar_colaborador', colaboradorCtrl.find);
<|file_name|>menu.py<|end_file_name|><|fim▁begin|>response.title = settings.title<|fim▁hole|>response.meta.description = settings.description response.menu = [ (T('Index'),URL('default','index')==URL(),URL('default','index'),[]), (T('Video'),URL('default','video')==URL(),URL('default','video'),[]), (T('Info...
response.subtitle = settings.subtitle response.meta.author = '%(author)s <%(author_email)s>' % settings response.meta.keywords = settings.keywords
<|file_name|>archjs_tools.js<|end_file_name|><|fim▁begin|>/** * Created by caimiao on 15-6-14.<|fim▁hole|> */ define(function(require, exports, module) { exports.hello= function (echo) { alert(echo); }; })<|fim▁end|>
<|file_name|>class_receiveDataThread.py<|end_file_name|><|fim▁begin|>doTimingAttackMitigation = False import base64 import errno import math import time import threading import shared import hashlib import os import select import socket import random import ssl from struct import unpack, pack import sys import traceba...
if shared.verbose >= 1:
<|file_name|>deferredcontent.min.js<|end_file_name|><|fim▁begin|><|fim▁hole|>"use strict";module.exports=require("./components/deferredcontent/DeferredContent");<|fim▁end|>
<|file_name|>ppaux.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 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/licenses/...
/*for def_id in ty::type_def_id(typ).iter() {
<|file_name|>per_sequence_gc_content.rs<|end_file_name|><|fim▁begin|>use crate::trust_seq::gc_model::GCModel; use crate::trust_seq::qc::{QCModule, QCReport, QCResult}; use crate::trust_seq::trust_seq::{TrustSeqConfig, TrustSeqErr}; use crate::trust_seq::utils::Sequence; use serde_json::map::Map; use serde_json::value; ...
let length = (sequence.len() / 100) * 100; return &sequence[..length];
<|file_name|>cartridgesavecouk.py<|end_file_name|><|fim▁begin|>import re from scrapy.spider import BaseSpider from scrapy.selector import HtmlXPathSelector from scrapy.http import Request, FormRequest, HtmlResponse from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin_rfc from scrapy.ht...
url = urljoin_rfc(self.URL_BASE, url) yield Request(url)
<|file_name|>httpclient.js<|end_file_name|><|fim▁begin|>var http=require('http'); var url = require('url') var httpget = function ( url ) { return new Promise(( resolve,reject)=>{ http.get( url ,function(req,res){ var html=''; req.on('data',function(data){ html...
var cred = b.toString('base64');
<|file_name|>cari.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core'; import { NavController, ToastController } from 'ionic-angular'; import { Http } from '@angular/http'; import { ActionSheetController } from 'ionic-angular'; import { NotifikasiPage } from '../notifikasi/notifikasi'; import { A...
baca(idArtikel){ this.navCtrl.push(ArtikelBacaPage, idArtikel);
<|file_name|>auth.py<|end_file_name|><|fim▁begin|>"""Authentication for HTTP component.""" import base64 import logging from aiohttp import hdrs from aiohttp.web import middleware import jwt from homeassistant.auth.providers import legacy_api_password from homeassistant.auth.util import generate_secret from homeassis...
elif trusted_networks and await async_validate_trusted_networks(request):
<|file_name|>Productos.java<|end_file_name|><|fim▁begin|>package Vistas; import Conexion.ConexioSQLite; import static Vistas.Cuenta.modeloCuenta; import static Vistas.Cuenta.sumaProductos; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import java.util.logging.Logger; import j...
new String [] { "Title 1", "Title 2", "Title 3", "Title 4" } ));
<|file_name|>tokenization_bert.py<|end_file_name|><|fim▁begin|># coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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...
text: A single token or whitespace separated tokens. This should have already been passed through `BasicTokenizer`.
<|file_name|>.eslintrc.js<|end_file_name|><|fim▁begin|>module.exports = { root: true, parser: 'babel-eslint', parserOptions: { sourceType: 'module', ecmaFeatures: { 'jsx': true }, }, globals: { enz: true, xhr_calls: true, }, plugins: [ 'react' ], extends: 'react-app', r...
'space-before-function-paren': 2,
<|file_name|>testAPI.cc<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant...
AudioFrame audioFrame; while( audioNotDone || videoNotDone) {
<|file_name|>test.py<|end_file_name|><|fim▁begin|># Create the data. from numpy import pi, sin, cos, mgrid dphi, dtheta = pi/250.0, pi/250.0 [phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta] m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4; r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*the...
# View it. from mayavi import mlab s = mlab.mesh(x, y, z)
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = versionTransform; var _path2 = require('path'); var _path3 = _interopRequireDefault(_path2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj :...
<|file_name|>coprocessor.go<|end_file_name|><|fim▁begin|>// Copyright 2016 PingCAP, 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 // // http://www.apache.org/licenses/LICENSE-2...
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>#![feature(asm)] #![feature(thread_local)] use std::thread; #[thread_local] static mut TLS_DATA: usize = 1; #[thread_local] static mut TLS_BSS: usize = 0; fn main() { unsafe { asm!("xchg bx, bx" : : : "memory" : "intel", "volatile") }; unsafe { TLS_D...
<|file_name|>index.test.ts<|end_file_name|><|fim▁begin|>import './configuration.test'; import './database.test';<|fim▁hole|><|fim▁end|>
import './email.test'; import './project.test'; import './projects.test'; import './volunteer.test';
<|file_name|>progressDirective.d.ts<|end_file_name|><|fim▁begin|>import { BarComponent } from './barComponent'; export declare class ProgressDirective { animate: boolean; max: number;<|fim▁hole|> removeBar(bar: BarComponent): void; }<|fim▁end|>
addClass: boolean; bars: any[]; protected _max: number; addBar(bar: BarComponent): void;
<|file_name|>SimpleNotificationProducer.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...
clientConfigurations.setSubject((String) exchange.getProperty(SmnProperties.NOTIFICATION_SUBJECT)); }
<|file_name|>mtrlogobserver.py<|end_file_name|><|fim▁begin|># This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope tha...
dbpool = self.step.dbpool
<|file_name|>or-pattern.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>#![allow(non_camel_case_types)] enum blah { a(isize, isize, usize), b(isize, isize), c, } fn or_alt(q: blah) -> isize { match q { blah::a(x, y, _) | blah::b(x, y) => { return x + y; } blah::c => { return 0; } } } pub fn main() { assert_eq!(o...
// run-pass
<|file_name|>main.ts<|end_file_name|><|fim▁begin|>/// <reference path="../typings/react/react.d.ts" /> import React = require('react'); import { App } from './app.react' <|fim▁hole|>const { DOM, render } = React; function main() { render(App({ label: 'foo' }), document.body) } main()<|fim▁end|>
<|file_name|>ontology_reader.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # publ...
both_skw_and_ckw = [] # Build a dictionary we will reason on later.
<|file_name|>PrimitiveBean.java<|end_file_name|><|fim▁begin|>/* * Copyright 2015 JBoss 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 * * http://www.apache.org/licenses/LICEN...
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
<|file_name|>parser.js<|end_file_name|><|fim▁begin|>var _ = require('lodash'), moment = require('moment-timezone'); function dateStringToTimestampWithZone(timeIn, zone) { // 07/09/2015 11:00 AM var pieces = timeIn.split(' '), dateString = pieces[0], timeString = pieces[1], ampm = pi...
<|file_name|>keystonejs__fields-tests.ts<|end_file_name|><|fim▁begin|>import { Keystone } from '@keystonejs/keystone'; import { KnexAdapter } from '@keystonejs/adapter-knex'; import { Text, Checkbox, Password } from '@keystonejs/fields'; const keystone = new Keystone({ adapter: new KnexAdapter(), }); keystone.cre...
password: { type: Password }, }, access: true, });
<|file_name|>runge_kutta_4.C<|end_file_name|><|fim▁begin|>/* Copyright 2004-2015 Manuel Baptista This file is part of GODESS GODESS 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 2 of the Licens...
#include "odebase.h" #include <string>
<|file_name|>CreateProfile.java<|end_file_name|><|fim▁begin|>// // Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 generiert // Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // �nderungen an dieser Datei gehen bei einer Neukompi...
/**
<|file_name|>verify_data.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Verify data doesn't have basic mistakes, like empty text fie...
warn("warning: missing labels/eval_labels field:\n", act, opt) counts['missing_labels'] += 1 else:
<|file_name|>objects.rs<|end_file_name|><|fim▁begin|>//! Various functions operating on any object. use remacs_macros::lisp_fn; use remacs_sys::{EqualKind, Qnil}; use remacs_sys::internal_equal; use lisp::LispObject; use lisp::defsubr; /// Return t if OBJECT is nil, and return nil otherwise. #[lisp_fn] fn null(objec...
/// Return t if the two args are the same Lisp object. /// Floating-point numbers of equal value are `eql', but they may not be `eq'. #[lisp_fn]
<|file_name|>PermIdentity.js<|end_file_name|><|fim▁begin|>import React from 'react'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(<|fim▁hole|>, 'PermIdentity');<|fim▁end|>
<g><path d="M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4z" /></g>
<|file_name|>AccordionTitle.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _extends2 = require('babel-runtime/helpers/extends'); var _extends3 = _interopRequireDefault(_extends2); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck...
}(_react.Component); AccordionTitle.displayName = 'AccordionTitle'; AccordionTitle._meta = {
<|file_name|>ssh_client2.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding:utf-8 -*- ''' 使用paramiko模块远程管理服务器 通过key登录 ''' import paramiko private_key_path = 'D:\workspace\Python-oldboy\day07\zhangyage_pass' #key = paramiko.RSAKey.from_private_key_file(filename, password) key = paramiko.RSAKey.from_p...
<|file_name|>scraper.js<|end_file_name|><|fim▁begin|>var gplay = require('google-play-scraper'); var fs = require('fs') var Promise = require('promise'); var myArgs = process.argv.slice(2); var passed_appid = myArgs[0]; var passed_appcount = myArgs[1]; console.log(passed_appid); var read = Promise.denodeify(fs.readFile...
} }) .then(function (){process.exit()});
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # plot.py # Purpose: plot Temp of running LIGGGHTS simulation via GnuPlot in Pizza.py # Syntax: plot.py in.liggghts Nfreq Nsteps compute-ID # in.liggghts = LIGGGHTS input s...
from gnu import gnu
<|file_name|>googlesuggestclone.js<|end_file_name|><|fim▁begin|>var gsc_basicmatch = /[a-z0-9]/i; function gsc_getquery(elt, q) { q = ltrim(q); q = q.replace('\s+', ' '); if (q.length == 0 || !gsc_basicmatch.test(q)) { gsc_emptyresults(elt); return ''; } if (elt.currentQ...
if (elt.selectedIndex == elt.numResults - 1) return; else if (elt.selectedIndex < 0)
<|file_name|>netcopy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python #Protocol: # num_files:uint(4) # repeat num_files times: # filename:string # size:uint(8) # data:bytes(size) import sys, socket import os from time import time DEFAULT_PORT = 52423 PROGRESSBAR_WIDTH = 50 BUFSIZE = 1024*1024 CONNECTION_TI...