prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>common.rs<|end_file_name|><|fim▁begin|>//! This module contains various infrastructure that is common across all assembler backends
use proc_macro2::{Span, TokenTree};
use quote::ToTokens;
use quote::quote;
use syn::spanned::Spanned;
use syn::parse;
use syn::Token;
use crate::parse_helpers::{ParseOpt, eat... | |
<|file_name|>organization_summary.py<|end_file_name|><|fim▁begin|>definition = {
"where": "?subj a foaf:Organization .",
"fields": {<|fim▁hole|> "name": {
"where": "?subj rdfs:label ?obj ."
}
}
}<|fim▁end|> | |
<|file_name|>document.rs<|end_file_name|><|fim▁begin|>use rustc_serialize::{Encodable, Encoder};
#[derive(Debug, PartialEq)]
pub enum SolrValue {
I64(i64),
U64(u64),
F64(f64),
String(String),
Boolean(bool),
Null<|fim▁hole|>impl Encodable for SolrValue {
fn encode<E: Encoder>(&self, e: &mut ... | } |
<|file_name|>DateFormatMask_Ui.js<|end_file_name|><|fim▁begin|>/**
* Solutii Ecommerce, Automatizare, Validare si Analiza | Seava.ro
* Copyright: 2013 Nan21 Electronics SRL. All rights reserved.
* Use is subject to license terms.
*/
Ext.define("seava.ad.ui.extjs.frame.DateFormatMask_Ui", {
extend: "e4e.ui.Abstract... | .end();
}
|
<|file_name|>listing_6_20.py<|end_file_name|><|fim▁begin|>def percDown(self,i):
while (i * 2) <= self.currentSize:
mc = self.minChild(i)
if self.heapList[i] > self.heapList[mc]:<|fim▁hole|> self.heapList[i] = self.heapList[mc]
self.heapList[mc] = tmp
i = mc
def minChi... | tmp = self.heapList[i] |
<|file_name|>0005_auto_20170521_0103.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):<|fim▁hole|> ]
operations = [
migrations.AlterField(
model_name='maprendering... |
dependencies = [
('maposmatic', '0004_maprenderingjob_track'), |
<|file_name|>TokenizerNormalizedString.java<|end_file_name|><|fim▁begin|>/*
Copyright 2013 Semantic Discovery, Inc. (www.semanticdiscovery.com)
This file is part of the Semantic Discovery Toolkit.
The Semantic Discovery Toolkit is free software: you can redistribute it and/or modify
it under the terms... | final int origIdx = entry.getValue(); |
<|file_name|>ng-wig.js<|end_file_name|><|fim▁begin|>/**
* version: 1.1.3
*/
angular.module('ngWig', ['ngwig-app-templates']);
angular.module('ngWig').directive('ngWig', function () {
return {
scope: {
content: '=ngWig'
},
restrict: 'A',
replace: true,
template... | );
/**
* No box-sizing, such a shame |
<|file_name|>test_parse_tree.py<|end_file_name|><|fim▁begin|>import unittest
from lib.data_structures.trees.parse_tree import ParseTree
class TestParseTree(unittest.TestCase):
def evaluate(self, expression, result):
parser = ParseTree()<|fim▁hole|> parse_tree = parser.build_parse_tree(expression)
... | |
<|file_name|>floodfill_he.cpp<|end_file_name|><|fim▁begin|>/* Cabal - Legacy Game Implementations
*
* Cabal is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you c... | * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<|file_name|>label_image.py<|end_file_name|><|fim▁begin|>import tensorflow as tf, sys
image_path = sys.argv[1]
# Read in the image_data
image_data = tf.gfile.FastGFile(image_path, 'rb').read()
# Loads label file, strips off carriage return
label_lines = [line.rstrip() for line
in tf.gfile.GFile("/... | with tf.Session() as sess:
# Feed the image_data as input to the graph and get first prediction |
<|file_name|>test.js<|end_file_name|><|fim▁begin|><|fim▁hole|>/**
* Created by admin on 16/10/11.
*/
var a=12,b=12,c=12;console.log(a,b,c,'hello')<|fim▁end|> | |
<|file_name|>code-parser.unit.ts<|end_file_name|><|fim▁begin|>import path from "path";
import { assert } from "chai";
import { extract, toJson, isPseudoCode } from "../data/scripts/index";
import { Done } from "mocha";
describe("ONS Code Extraction", () => {
it("returns an error if no data directory provided", (done... | }, null);
});
}); |
<|file_name|>commons.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Common structures and functions used by other scripts.
"""
from xml.etree import cElementTree as ET
<|fim▁hole|> 'paraphrase': 2}
entailment_to_str = {v: k for k, v in str_to_entailment.items()}
class Pair(object):
... | str_to_entailment = {'none': 0,
'entailment': 1, |
<|file_name|>pipelinetemplatedefinitions.go<|end_file_name|><|fim▁begin|>package devops
// Copyright (c) Microsoft and contributors. 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 o... | // NewPipelineTemplateDefinitionsClientWithBaseURI creates an instance of the PipelineTemplateDefinitionsClient client.
func NewPipelineTemplateDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) PipelineTemplateDefinitionsClient { |
<|file_name|>Test.py<|end_file_name|><|fim▁begin|>"""<|fim▁hole|>modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce... | Copyright (c) 2011, The MITRE Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without |
<|file_name|>viewsets.py<|end_file_name|><|fim▁begin|># pylint: disable=missing-docstring
from rest_framework import mixins, serializers, viewsets
from resolwe.elastic.viewsets import ElasticSearchBaseViewSet, ElasticSearchCombinedViewSet
from .elastic_indexes import TestSearchDocument
from .models import TestModel
... |
class TestCustomFieldFilterViewSet(ElasticSearchBaseViewSet):
document_class = TestSearchDocument |
<|file_name|>createuser.go<|end_file_name|><|fim▁begin|>// Copyright © 2015 Luc Stepniewski <luc@stepniewski.fr>
//
// 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.apach... | import (
"github.com/lstep/2fanginx/server"
"github.com/spf13/cobra" |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from django.contrib.admin.filters import RelatedFieldListFilter
from .models import ClientLog, Client, Feedback
def client_id(obj):
return obj.client.externid
class AliveClientsRelatedFieldListFilter(RelatedFieldListFilter):
d... | class ClientAdmin(admin.ModelAdmin):
list_display = ("status", "externid", "ip", "updated", "created", "useragent") |
<|file_name|>pid_interfaces.py<|end_file_name|><|fim▁begin|>from bioscrape.inference import DeterministicLikelihood as DLL
from bioscrape.inference import StochasticTrajectoriesLikelihood as STLL
from bioscrape.inference import StochasticTrajectories
from bioscrape.inference import BulkData
import warnings
import numpy... | Returns the log prior probability or np.inf if the param_value is invalid. |
<|file_name|>aiplatform_generated_aiplatform_v1beta1_vizier_service_suggest_trials_sync.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 obt... |
# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-aiplatform
|
<|file_name|>rephistorychart.ts<|end_file_name|><|fim▁begin|>import {BarChartsBar} from "../models/barcharts/barchartsbar";
import {RepHistory} from "../models/barcharts/rephistory";
import {BarCharts} from "./barcharts";
/**
* Intermediate class in the hierarchy of BarCharts. Any RepExercise bar chart should extend ... | return historyObjectArray;
} |
<|file_name|>win_volume_object.py<|end_file_name|><|fim▁begin|># Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import entities, fields
import cybox.bindings.win_volume_object as win_volume_binding
from cybox.objects.volume_object import Volume
from c... |
class WindowsVolumeAttributesList(entities.EntityList): |
<|file_name|>InfPpiObject.py<|end_file_name|><|fim▁begin|>## @file
# This file is used to define class objects of INF file [Ppis] section.
# It will consumed by InfParser.
#
# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made availabl... | |
<|file_name|>EppCommandInfoDomain.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015 Neustar Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software an... | return new EppCommandInfoDomain(s);
} |
<|file_name|>components-helper.service.d.ts<|end_file_name|><|fim▁begin|>import { ApplicationRef, ComponentFactoryResolver, ComponentRef, Injector, ViewContainerRef, ResolvedReflectiveProvider, Type } from '@angular/core';
/**
* Components helper class to easily work with
* allows to:
* - get application root view c... | * @param location - reference to the location
* @param providers - optional array of providers |
<|file_name|>TCPConduit.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 to You under the Ap... | public void removeEndpoint(DistributedMember mbr, String reason, boolean notifyDisconnect) {
ConnectionTable ct = this.conTable;
if (ct == null) { |
<|file_name|>sickrfi341.cc<|end_file_name|><|fim▁begin|>/*
* Player - One Hell of a Robot Server
* Copyright (C) 2007
* Radu Bogdan Rusu (rusu@cs.tum.edu)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published... | - Rate at which we connect to the RFID unit. Valid values are 1200, 2400,
4800, 9600, 19200, 38400, 57600 and 115200. |
<|file_name|>qad_array_maptool.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
/***************************************************************************
QAD Quantum Aided Design plugin ok
classe per gestire il map tool in ambito del comando array
----------------... | |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django import forms
from cms_content.settings import EDITOR
from cms_content.models import CMSArticle<|fim▁hole|>
WIDGET = getattr(widgets, EDITOR)
class CMSArticleAdminForm(forms.ModelForm):
content = forms.CharField(widget=WIDGET)
... | from cms_content import widgets |
<|file_name|>libsndfile.py<|end_file_name|><|fim▁begin|>#!/bin/python
import os, subprocess
import logging
from autotest.client import test
from autotest.client.shared import error
class libsndfile(test.test):
"""
Autotest module for testing basic functionality
of libsndfile
@author Anitha MallojiRa... | |
<|file_name|>random_tuples_from_single.rs<|end_file_name|><|fim▁begin|>use core::hash::Hash;
use itertools::Itertools;
use malachite_base::num::random::random_primitive_ints;
use malachite_base::random::EXAMPLE_SEED;
use malachite_base::tuples::random::{random_pairs_from_single, random_triples_from_single};
use malachi... | );
}
|
<|file_name|>implementsAbstractType.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | import { GraphQLType, GraphQLSchema } from 'graphql';
export default function implementsAbstractType(schema: GraphQLSchema, typeA: GraphQLType, typeB: GraphQLType): boolean; |
<|file_name|>entrypoint.cpp<|end_file_name|><|fim▁begin|>#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <iostream>
#include <string>
#include "parser.h"
#include "CLI/wrapper.h"<|fim▁hole|>
#include "Libraries/linenoise.h"
#include "CLI/interface.h"
#define HIST_FILENAME ".polyB... | |
<|file_name|>DateTimeTest.js<|end_file_name|><|fim▁begin|>const DateTime = Jymfony.Component.DateTime.DateTime;
const DateTimeZone = Jymfony.Component.DateTime.DateTimeZone;
const TimeSpan = Jymfony.Component.DateTime.TimeSpanInterface;
const { expect } = require('chai');
describe('[DateTime] DateTime', function () {... | dt = new DateTime('2020 Oct 25 01:59:59', 'Europe/Rome'); |
<|file_name|>windows.rs<|end_file_name|><|fim▁begin|>extern crate winapi;
use std::fs::File;
use std::io;
use std::io::{Write, Seek, SeekFrom};
use std::mem;
use std::ptr;
use std::cmp::min;
use std::os::windows::fs::FileExt;
use std::os::windows::io::AsRawHandle;
use self::winapi::shared::basetsd::SIZE_T;
use self::... | Ok(result) |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
readme = open('README.rst').read()
history = open('HISTORY.rst').read().replace('.. :changelog:', '')
requirements = [
... |
setup(
name='sphinx_numfig',
version='0.1.0', |
<|file_name|>CommonProxy.java<|end_file_name|><|fim▁begin|>/**
*
*/
package com.ingenitor.blockenvy.proxy;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
/**<|fim▁hole|>public abstract class CommonProxy implements IProxy {
}<|fim▁end|> | * @author ingenitor
*
*/ |
<|file_name|>classfile.rs<|end_file_name|><|fim▁begin|>use std::fmt;
use std::vec::Vec;
use super::{Attributes, ConstantPool, FieldInfo, MethodInfo};
#[derive(Debug)]
pub struct ClassFile {
/// Java classfile magic number. `0xcafebabe` is the only valid value for
/// this field.
pub magic: u32,
/// Th... | pub attrs: Attributes,
} |
<|file_name|>sheriff_unittest.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010 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 retain t... | # copyright notice, this list of conditions and the following disclaimer |
<|file_name|>issue-18252.rs<|end_file_name|><|fim▁begin|>// Copyright 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.apache.org/lic... | Variant { x: uint }
}
fn main() { |
<|file_name|>mutex.rs<|end_file_name|><|fim▁begin|>// Copyright 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.apache.org/licenses/... | |
<|file_name|>ConflictingInheritedNameInNamespaceProblem.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... |
/**
* Diagnostic emitted when the code generator detects
* a definition that conflicts with an inherited definition |
<|file_name|>directive.rs<|end_file_name|><|fim▁begin|>use std::collections::hash_map::Entry;
use syn::parse;
use syn::Token;
use quote::quote;
use proc_macro_error::emit_error;
use crate::common::{Stmt, Size, delimited};
use crate::arch;
use crate::DynasmContext;
use crate::parse_helpers::ParseOptExt;
pub(crate) fn... | |
<|file_name|>parse_url.py<|end_file_name|><|fim▁begin|>from mabozen.lib.url import parse_rfc1738_args
def parse_url(db_url):<|fim▁hole|>
return components<|fim▁end|> | """parse url"""
components = parse_rfc1738_args(db_url) |
<|file_name|>test_send_email_base_command.py<|end_file_name|><|fim▁begin|>"""
Tests for send_email_base_command
"""
import datetime
from unittest import skipUnless
import ddt
import pytz
from django.conf import settings
from mock import DEFAULT, Mock, patch
from openedx.core.djangoapps.schedules.management.commands... | |
<|file_name|>requests.py<|end_file_name|><|fim▁begin|>## Copyright 2009 Luc Saffre
## This file is part of the Lino project.
## Lino is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the L... | |
<|file_name|>issue-16597-empty.rs<|end_file_name|><|fim▁begin|>// Copyright 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.apache.o... | |
<|file_name|>intf.rs<|end_file_name|><|fim▁begin|>//! formatter for unsigned and signed int subs
//! unsigned ints: %X %x (hex u64) %o (octal u64) %u (base ten u64)
//! signed ints: %i %d (both base ten i64)
use std::u64;
use std::i64;
use super::super::format_field::FormatField;
use super::super::formatter::{InPrefix,... | |
<|file_name|>websearch_external_collections_templates.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
... | _ = gettext_set_language(lang) |
<|file_name|>tag-align-u64.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.... | |
<|file_name|>ArrayAccess.java<|end_file_name|><|fim▁begin|>package ir.ops;
import ir.visitor.IrVisitor;
public class ArrayAccess implements Expression
{
private Expression reference;
private DataType type;
private Expression index;
public ArrayAccess(Expression reference, DataType type, Expression index)
{
... | public String toString() |
<|file_name|>CustomUserDetailsService.java<|end_file_name|><|fim▁begin|>package mx.gob.sct.utic.mimappir.admseg.postgreSQL.services;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import mx.gob.sct.utic.mimappir.admseg.postgreSQL.model.SEGUSUARIO;
... | |
<|file_name|>BackgroundDaemon.java<|end_file_name|><|fim▁begin|>package jlib.datastream.intraprocess;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
import jlib.datastream.ezio.LineReaderObject;
import jlib.events.Command;
import jlib.utils.e.event.DuplicateCommandException;... | _checkStarted();
if(commands.contains(c)){
throw new DuplicateCommandException("Command already exists in this daemon's list of commands.");
}
|
<|file_name|>lastimport.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2015, Rafael Bodill http://github.com/rafi
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), ... | log.info('finished processing {0} song pages', page_total)
log.info('{0} unknown play-counts', unknown_total)
log.info('{0} play-counts imported', found_total) |
<|file_name|>signal-cellular-connected-no-internet-2-bar.js<|end_file_name|><|fim▁begin|>'use strict';
var React = require('react');
var mui = require('material-ui');
var SvgIcon = mui.SvgIcon;
var DeviceSignalCellularConnectedNoInternet2Bar = React.createClass({
displayName: 'DeviceSignalCellularConnectedNoInterne... | React.createElement('path', { d: 'M14 22V10L2 22h12zm6-12v8h2v-8h-2zm0 12h2v-2h-2v2z' })
);
} |
<|file_name|>gistodon.py<|end_file_name|><|fim▁begin|>import os, sys, re, argparse, time, json, logging
import requests
from glob import glob
from urlparse import urlsplit
from getpass import getpass
from mastodon import Mastodon
from markdown import markdown
from html_text import extract_text
from flask import (Flask,... | |
<|file_name|>gemini.bemjson.js<|end_file_name|><|fim▁begin|>({
block : 'page',
title : 'bem-components: spin',
mods : { theme : 'islands' },
head : [
{ elem : 'css', url : 'gemini.css' }
],
content : [
{ tag : 'h2', content : 'islands' },<|fim▁hole|> return {
... | ['xs', 's', 'm', 'l', 'xl'].map(function(size){ |
<|file_name|>MLDB-1678-rowname-optimizations.js<|end_file_name|><|fim▁begin|>// This file is part of MLDB. Copyright 2016 mldb.ai inc. All rights reserved.
var mldb = require('mldb')
var unittest = require('mldb/unittest')
function expectEmpty(query)
{
var expected = [];
var resp = mldb.query(query);
mld... | |
<|file_name|>setup_skytools.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python
# this script does not perform full installation,
# it is meant for use from Makefile
import sys, os.path, re
from distutils.core import setup
from distutils.extension import Extension
# check if configure has run
if not os.path.isfil... | ]),
('share/skytools' + sfx, share_dup_files)], |
<|file_name|>bcm.rs<|end_file_name|><|fim▁begin|>use libc::{
c_int, c_short, c_uint, c_void, close, connect, fcntl, read, sockaddr, socket, timeval, write,
F_SETFL, O_NONBLOCK,
};
use futures;
// use mio::{Evented, PollOpt, Ready, Token};
use nix::net::if_::if_nametoindex;
use std::collections::VecDeque;
use s... | |
<|file_name|>native-edit-registration.js<|end_file_name|><|fim▁begin|>"use strict";
/*
* Native edits
*/
/**
WYMeditor.NativeEditRegistration
================================
Constructs a native edits registration mechanism for a provided editor.
*/
WYMeditor.NativeEditRegistration = function (wym) {
... | nativeEditRegistration._onSensibleNativeEdit
.bind(nativeEditRegistration),
nativeEditRegistration._onAnyNativeEdit |
<|file_name|>point.py<|end_file_name|><|fim▁begin|>"""Points and related utilities
"""
from ctypes import c_double
from ctypes import cast, POINTER
from shapely.coords import required
from shapely.geos import lgeos, DimensionError
from shapely.geometry.base import BaseGeometry
from shapely.geometry.proxy import Cachi... | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>#[macro_use]
extern crate rustfbp;
#[macro_use]
extern crate log;
agent! {
output(output: bool),
fn run(&mut self) -> Result<Signal> {<|fim▁hole|>}<|fim▁end|> | debug!("{:?}", env!("CARGO_PKG_NAME"));
self.output.output.send(true)?;
Ok(End)
} |
<|file_name|>removed-syntax-with-2.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// htt... | |
<|file_name|>14-longest-collatz-sequence.py<|end_file_name|><|fim▁begin|>from functools import lru_cache
def sequence(n):
'bad idea'
while n is not 1:
yield n
n = 3*n+1 if n%2 else n/2
yield n
def next_num(n):
if n % 2:
return 3 * n + 1
else:
return n / 2
@lru_cach... | return 1 + collatz_length(next_num(n))
|
<|file_name|>array_slice.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under th... | c.bench_function("array_slice 512", |b| {
b.iter(|| create_array_slice(&array, 512))
});
c.bench_function("array_slice 2048", |b| { |
<|file_name|>file_handle_object.py<|end_file_name|><|fim▁begin|># *****************************************************************
# Copyright (c) 2013 Massachusetts Institute of Technology
#
# Developed exclusively at US Government expense under US Air Force contract
# FA8721-05-C-002. The rights of the United States... | |
<|file_name|>BBLModule.java<|end_file_name|><|fim▁begin|>package com.nilhcem.bblfr.core.dagger;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.jakewharton.picasso.OkHttp3Downloader;
import com.nilhcem.bblfr.BBLApplication;
import com.nilhcem... | |
<|file_name|>ServerPathCellEditor.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See License.txt in the project root.
/*
* Copyright 2000-2010 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not us... | |
<|file_name|>settings.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | /** settings.js */ |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Evcxr 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
//
// https://www.apache.org/licenses/LICENSE-2.0... | |
<|file_name|>spotify.js<|end_file_name|><|fim▁begin|>// New Spotify object
function Spotify(tab){
this.tab = tab;
}
// search for a song
// open spotify if theres a match
Spotify.prototype.search = function(title, artist, album){
var query = 'title:"' + title + '"';
query += 'artist:"' + artist + '"';
... | |
<|file_name|>S11.13.2_A4.8_T1.3.js<|end_file_name|><|fim▁begin|>// Copyright 2009 the Sputnik authors. All rights reserved.
/**
* The production x >>>= y is the same as x = x >>> y
*
* @path ch11/11.13/11.13.2/S11.13.2_A4.8_T1.3.js
* @description Type(x) and Type(y) vary between primitive string and String object
... | $ERROR('#2: x = new String("1"); x >>>= "1"; x === 0. Actual: ' + (x)); |
<|file_name|>file_watch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import sys
import logging
import time
import subprocess
import shlex
import os
import StringIO
import tempfile
<|fim▁hole|>class CreatedFilesHandler(RegexMatchingEventHandler):
def on_created(self, event):
if isinstance(event, FileCre... | from watchdog.observers import Observer
from watchdog.events import FileCreatedEvent, RegexMatchingEventHandler
|
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""optboard URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatt... | |
<|file_name|>test_ndk_build.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import unittest
import os, sys, subprocess, argparse, shutil, re
TEMPLATE_ANDROID_MK = '''\
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
{cut}
LOCAL_MODULE := mixed_sample
LOCAL_SRC_FILES := {cpp1}
LOCAL_LDLIBS += -llog -ldl
i... | abis.extend(["arm64-v8a", "x86_64"])
abis.append("all") |
<|file_name|>event_stack.py<|end_file_name|><|fim▁begin|>import websocket
import logging
import json
import config
import threading
from time import sleep
from pprint import pformat
class TimeOutReached(Exception):
pass
class EventListenerThread(threading.Thread):
log = None
ws = None
... | |
<|file_name|>jquery.zenpen.url.js<|end_file_name|><|fim▁begin|>/*
* jQuery ZenPen url/link action
*
* Copyright (c) 2013 Deux Huit Huit (http://www.deuxhuithuit.com/)
* Licensed under the MIT (http://deuxhuithuit.mit-license.org)
* Based on the work of Tim Holman (https://github.com/tholman/zenpen)
* License... | document.execCommand( 'unlink', false );
if (!!url) { |
<|file_name|>CRealMoveRequestDelayCheckerRegister.hpp<|end_file_name|><|fim▁begin|>// This file auto generated by plugin for ida pro. Generated code only for x64. Please, dont change manually
#pragma once
#include <common/common.h>
#include <CRealMoveRequestDelayCheckerDetail.hpp>
#include <common/ATFCore.hpp>
START... | |
<|file_name|>graphics.cpp<|end_file_name|><|fim▁begin|>/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can ... | |
<|file_name|>dim4.rs<|end_file_name|><|fim▁begin|>use poisson::Type::*;<|fim▁hole|>
mod helper;
use crate::helper::test_with_samples;
#[test]
fn test_4d_1_80_normal() {
test_with_samples::<Vect>(1, 0.8, 200, Normal);
}
#[test]
fn test_4d_1_80_perioditic() {
test_with_samples::<Vect>(1, 0.8, 100, Perioditic);
... |
extern crate nalgebra as na;
pub type Vect = na::Vector4<f64>; |
<|file_name|>botworker.ts<|end_file_name|><|fim▁begin|>/**
* @module botbuilder-adapter-twilio-sms
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { BotWorker } from 'botkit';
import * as Twilio from 'twilio';
import { ConversationAccount, ChannelAcco... | |
<|file_name|>test_noop_elimination.py<|end_file_name|><|fim▁begin|># Copyright (c) 2020, Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
import itertools
import numpy as n... | assert_model_is_valid( |
<|file_name|>aggregator.py<|end_file_name|><|fim▁begin|>import numpy as np
from scipy.io import netcdf_file
import bz2
import os
from fnmatch import fnmatch
from numba import jit
@jit
def binsum2D(data, i, j, Nx, Ny):<|fim▁hole|> for n in range(N):
data_binned[j[n],i[n]] += data[n]
return data_binned
c... | data_binned = np.zeros((Ny,Nx), dtype=data.dtype)
N = len(data) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf8<|fim▁hole|>from . import views, errors<|fim▁end|> |
from flask import Blueprint
main = Blueprint('main', __name__) |
<|file_name|>assistant_ru.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="ru">
<context>
<name>AboutDialog</name>
<message>
<source>&Close</source>
<translation>&Закрыть</translation>
</message>
</context>
<context>
... | </message>
</context>
<context> |
<|file_name|>conversion.go<|end_file_name|><|fim▁begin|>package v1
import (
"sort"
"strings"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
v1 "k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/conversion"
"k8s.io/kubernetes/pkg/runtime"
oapi "github.com/openshift/origin/pkg/api"
new... | out.DockerImageReference = in.DockerImageReference |
<|file_name|>core-asynclistener-remove-inflight.simple.js<|end_file_name|><|fim▁begin|><|fim▁hole|>// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal... | |
<|file_name|>config.py<|end_file_name|><|fim▁begin|>"""
Data and methods to retrieve app specific configuration
"""
import json
import requests
APP_BACKDROP = "E8C28D3C"
APP_YOUTUBE = "233637DE"
APP_MEDIA_RECEIVER = "CC1AD845"
APP_PLEX = "06ee44ee-e7e3-4249-83b6-f5d0b6f07f34_1"<|fim▁hole|>APP_HOME_ASSISTANT = "B12CE3... | APP_DASHCAST = "84912283"
APP_SPOTIFY = "CC32E753" |
<|file_name|>type.test.ts<|end_file_name|><|fim▁begin|>import * as type from '../../../src/validators/type';
describe('type Unit Tests', () => {
describe('isArray method', () => {
describe('when the node does not exist in the package.json file', () => {
test('true should be returned', () => {
const... | |
<|file_name|>symbols.py<|end_file_name|><|fim▁begin|>#!/bin/env python2.7
# -*- coding: utf-8 -*-
# This file is part of AT-Platform.
#
# AT-Platform 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 ver... | |
<|file_name|>partial.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 Pierre Talbot (IRCAM)
// 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... | //! not prevent the compilation of a second function to detect more errors in one run.
//! This intermediate state is represented by `Fake`.
use monad::partial::Partial::*; |
<|file_name|>password_store_mac_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 "chrome/browser/password_manager/password_store_mac.h"
#include "ba... | TEST_F(PasswordStoreMacInternalsTest, TestPasswordGetAll) { |
<|file_name|>common.js<|end_file_name|><|fim▁begin|>/* JavaScript User Interface Library -- Common datatypes for user elements
* Copyright 2010 Jaakko-Heikki Heusala <jhh@jhh.me>
* $Id: common.js 415 2010-10-15 05:00:51Z jheusala $
*/
/** Simple message box constructor
* @params type The message type: error, notic... | JSONObject.revivers.UIMessage = function(value) {
var parts = (""+value).split(":"); |
<|file_name|>sleep_register.rs<|end_file_name|><|fim▁begin|>use std::io::prelude::*;
use std::fs::File;
use std::path::{Path, PathBuf};
use std::io::SeekFrom;
use std::os::unix::fs::FileExt;
use integer_encoding::FixedInt;
use std::fs::OpenOptions;
use crypto::blake2b::Blake2b;
use crypto::digest::Digest;
use crypto::e... | assert_eq!(HyperRegister::tree_root_nodes(1), vec![0]);
assert_eq!(HyperRegister::tree_root_nodes(2), vec![1]);
assert_eq!(HyperRegister::tree_root_nodes(3), vec![1, 4]);
assert_eq!(HyperRegister::tree_root_nodes(4), vec![3]); |
<|file_name|>tests.rs<|end_file_name|><|fim▁begin|>use common::dialer::Dialer;
use netkeeper4::dialer::{Configuration, Netkeeper4Dialer};
#[test]
fn test_netkeeper4_username_encrypt() {
let dialer = Netkeeper4Dialer::load_from_config(Configuration::Zhejiang);
let encrypted = dialer.encrypt_account("05802278989... | } |
<|file_name|>Monomial.hh<|end_file_name|><|fim▁begin|>/*
* Monomial.hh, part of the RotationShield program
* Copyright (c) 2007-2014 Michael P. Mendenhall
*
* 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 Sof... | |
<|file_name|>operations.go<|end_file_name|><|fim▁begin|>package containerinstance
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may ca... | sc := -1
if result.Response().Response.Response != nil {
sc = result.page.Response().Response.Response.StatusCode
} |
<|file_name|>spammer.cpp<|end_file_name|><|fim▁begin|>#include "spammer.h"
SpammerType Settings::Spammer::type = SpammerType::SPAMMER_NONE;
bool Settings::Spammer::say_team = false;
bool Settings::Spammer::KillSpammer::enabled = false;
bool Settings::Spammer::KillSpammer::sayTeam = false;
std::vector<std::string> Sett... | } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.