prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>disconnected.controller.ts<|end_file_name|><|fim▁begin|>import {
Body,
Controller,
InternalServerErrorException,<|fim▁hole|> Post,
RequestTimeoutException,
} from '@nestjs/common';
import { ClientProxyFactory } from '@nestjs/microservices';
import { Observable, throwError } from 'rxjs';
import { c... | |
<|file_name|>old-closure-fn-coerce.rs<|end_file_name|><|fim▁begin|>// run-pass<|fim▁hole|>
fn force<F>(f: F) -> isize where F: FnOnce() -> isize { return f(); }
pub fn main() {
fn f() -> isize { return 7; }
assert_eq!(force(f), 7);
let g = {||force(f)};
assert_eq!(g(), 7);
}<|fim▁end|> | #![allow(unused_braces)] |
<|file_name|>retention.rs<|end_file_name|><|fim▁begin|>use crate::{Error, FsStats};
use iml_command_utils::wait_for_cmds_success;
use iml_influx::{Client as InfluxClient, InfluxClientExt as _};
use iml_manager_client::{graphql, Client};
use iml_postgres::{sqlx, PgPool};
use iml_tracing::tracing;
use iml_wire_types::{sn... | Err(e) => {
tracing::error!("Retention Rule processing error: {:?}", e);
prev_stats
} |
<|file_name|>cli.py<|end_file_name|><|fim▁begin|>"""
Lua pattern matcher based on a NFA
inspired by
http://swtch.com/~rsc/regexp/regexp1.html
"""
from rpyre.interface.lua import compile_re
from rpyre.matching import find
def main(args):
n = 20
s = args[1]
#s = "(a|b)*a%sa(a|b)*$" % ("(a|b)" * n, )
pr... |
def jitpolicy(*args):
from rpython.jit.codewriter.policy import JitPolicy |
<|file_name|>netconsole.py<|end_file_name|><|fim▁begin|>from argparse import ArgumentParser
import socket
import struct
import sys
import threading
import time
from ._fakeds import FakeDS<|fim▁hole|>__all__ = ["Netconsole", "main", "run"]
def _output_fn(s):
sys.stdout.write(
s.encode(sys.stdout.encoding... | |
<|file_name|>blackbody.py<|end_file_name|><|fim▁begin|># Licensed under a 3-clause BSD style license - see LICENSE.rst
"""Functions related to blackbody radiation."""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
# LOCAL
from ..modeling import blackbody as... | |
<|file_name|>Nikon_DX.py<|end_file_name|><|fim▁begin|>import bpy
camera = bpy.context.edit_movieclip.tracking.camera<|fim▁hole|>camera.units = 'MILLIMETERS'
camera.pixel_aspect = 1
camera.k1 = 0.0
camera.k2 = 0.0
camera.k3 = 0.0<|fim▁end|> |
camera.sensor_width = 23.6 |
<|file_name|>terms_of_service.py<|end_file_name|><|fim▁begin|>import json
from typing import TYPE_CHECKING, Optional
from boxsdk.util.text_enum import TextEnum
from boxsdk.exception import BoxAPIException
from .base_object import BaseObject
if TYPE_CHECKING:
from boxsdk.object.user import User
from boxsdk.obj... | def get_user_status(self, user: Optional['User'] = None) -> 'TermsOfServiceUserStatus':
""" |
<|file_name|>playlist.py<|end_file_name|><|fim▁begin|>import asyncio
import discord
from discord.ext import commands
if not discord.opus.is_loaded():
# the 'opus' library here is opus.dll on windows
# or libopus.so on linux in the current directory
# you should replace this with the location the
# opus... |
if state.is_playing():
player = state.player
player.stop() |
<|file_name|>archive_rt.py<|end_file_name|><|fim▁begin|>#
# Gordon McMillan (as inspired and influenced by Greg Stein)
#
# subclasses may not need marshal or struct, but since they're
# builtin, importing is safe.
#
# While an Archive is really an abstraction for any "filesystem
# within a file", it is tuned for use w... | ## """Default - MAGIC + Python's magic + tocpos"""
## self.lib.seek(self.start)
## self.lib.write(self.MAGIC)
## self.lib.write(self.pymagic) |
<|file_name|>permissions.ts<|end_file_name|><|fim▁begin|>import { AccessToken, Project, User, UserFeatureFlag, UserRole } from '@dev/translatr-model';
import { map } from 'rxjs/operators';
// General
export const isAdmin = (user?: User): boolean => user !== undefined && user.role === UserRole.Admin;
// Users
export... | |
<|file_name|>factorial.ts<|end_file_name|><|fim▁begin|>import { Machine, actions } from '../../src';
const { assign } = actions;
// @ts-ignore
const factorialMachine = Machine<{ n: number; fac: number }>(
{
initial: 'iteration',
states: {
iteration: {
on: {
ITERATE: [
{
... | |
<|file_name|>KeyParceler.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Square 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/LICENS... |
import android.os.Parcelable;
import android.support.annotation.NonNull; |
<|file_name|>VK_SPIRV_13_Shaders.py<|end_file_name|><|fim▁begin|>import renderdoc as rd
import rdtest
class VK_SPIRV_13_Shaders(rdtest.TestCase):
demos_test_name = 'VK_SPIRV_13_Shaders'
def check_capture(self):
action = self.find_action("Draw")
self.check(action is not None)
self.co... | refl: rd.ShaderReflection = pipe.GetShaderReflection(rd.ShaderStage.Fragment) |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# 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 limitation the rights to ... | date_created = models.DateTimeField(auto_now_add=True)
|
<|file_name|>component.ts<|end_file_name|><|fim▁begin|>namespace Mist {
/**
* @class Component
*/
export class Component {
static responses: any = {};
/**
* @param {} component
* @param {} o
* @returns {}
* @summary for all components
*/
... | |
<|file_name|>part2.go<|end_file_name|><|fim▁begin|>package main
<|fim▁hole|> "github.com/asarturas/adventofcode/day03/solution"
"fmt"
)
func main() {
santa := solution.NewGps();
robo := solution.NewGps();
for pos, move := range io.ReadLine() {
if pos % 2 == 0 {
santa.Move(move);
} else {
robo.Move(move);... | import(
"github.com/asarturas/adventofcode/io" |
<|file_name|>CheckFieldAdapter.java<|end_file_name|><|fim▁begin|>/***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2007 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted ... | |
<|file_name|>__main__.py<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | #!/usr/bin/python3
import gui
gui.main() |
<|file_name|>sliverauth.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -tt
# vim:set ts=4 sw=4 expandtab:
#
# NodeManager plugin for creating credentials in slivers
# (*) empower slivers to make API calls throught hmac
# (*) also create a ssh key - used by the OMF resource controller
# for authenticating itself... | if chunk['value'] in (True, 1, '1') or chunk['value'].lower() == "true": |
<|file_name|>15.2.3.6-3-80.js<|end_file_name|><|fim▁begin|>/// Copyright (c) 2012 Ecma International. All rights reserved.
/// Ecma International makes this code available under the terms and conditions set
/// forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the
/// "Use Terms"). Any redis... | var proto = {};
Object.defineProperty(proto, "configurable", {
|
<|file_name|>ProcessUtilTest.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2012-2015 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License... | |
<|file_name|>CountDurableCQEventsCommand.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... | import org.springframework.shell.core.annotation.CliOption; |
<|file_name|>specs.py<|end_file_name|><|fim▁begin|>import re
import os
import logging
from collections import defaultdict
from insights.config.static import get_config
from insights.config import AnalysisTarget, META_FILE_LIST, CommandSpec
logger = logging.getLogger(__name__)
logger.setLevel(logging.FATAL)
class Spe... | return match |
<|file_name|>price.ts<|end_file_name|><|fim▁begin|>// third-party deps
import { reduce, sortBy, isNil, isEmpty, mapValues, each, Dictionary } from 'lodash';
import { IHttpService, ILogService, IPromise } from 'angular';
import * as moment from 'moment';
type ILocalStorageService = angular.local.storage.ILocalStorageSer... | export interface IPriceGroupItem {
productId: number; |
<|file_name|>ring-king-one-direction.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
var wg sync.WaitGroup
type Process struct {
in chan int
out chan int
id int
}
func (process *Process) run() {
for {
go func() {
process.out <- process.id
fmt.Printf("sent ri... | } else {
fmt.Printf("live! (%d)\n", process.id)
}
} |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>r"""
Utilities and helper classes/functions
======================================
This module contains two very important classes (Project and Workspace)
as well as a number of helper classes.
"""
import logging as logging<|fim▁hole|>from ._project import *
# ... | from .misc import *
from ._settings import *
from ._workspace import * |
<|file_name|>main.cpp<|end_file_name|><|fim▁begin|>// min example
#include <cassert>
#include <iostream>
#include <algorithm>
using namespace std;
int main () {
cout << "min(1,2)==" << min(1,2) << endl;
assert(min(1,2) == 1);
cout << "min(2,1)==" << min(2,1) << endl;
cout << "min('a','z')==" << min('a','z') <<... | assert(min(3.14,2.72) == 2.72); |
<|file_name|>gdt.rs<|end_file_name|><|fim▁begin|>use core::mem::size_of;
use core::ptr;
use core::sync::atomic::{AtomicU8, Ordering};
use x86_64::structures::gdt::SegmentSelector;<|fim▁hole|>use x86_64::structures::tss::TaskStateSegment;
use x86_64::{PrivilegeLevel, VirtAddr};
pub use x86_64::structures::gdt::Descript... | |
<|file_name|>macro-use-all.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/l... | } |
<|file_name|>HealthyInfoDetailEntity.java<|end_file_name|><|fim▁begin|>package com.dream.plmm.bean;
/**
* Created by likun on 16/8/19.
*/
public class HealthyInfoDetailEntity {
/**
* count : 1754
* description : 平时要注意开窗通风,要多吃“补氧”食物,例如葵花子油、杏仁、奇异果、红薯等,还要多进行一些慢跑等有氧运动,这些都助于身体吸纳氧气
* fcount : 0
* id... | private String keywords;
private int loreclass;
private String message;
private int rcount; |
<|file_name|>add-userid.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
# Copyright (C) 2018 Ben McGinnes <ben@gnupg.org>
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of t... | # Lesser General Public License for more details.
# |
<|file_name|>ShieldIcon.tsx<|end_file_name|><|fim▁begin|><|fim▁hole|>import { createIcon } from '../Icon';
export const ShieldIcon = createIcon(
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />,
'ShieldIcon'
);<|fim▁end|> | import * as React from 'react'; |
<|file_name|>drop.ts<|end_file_name|><|fim▁begin|>import * as R_drop from '../ramda/dist/src/drop';
declare const number: number;
declare const string: string;
declare const boolean_array: boolean[];<|fim▁hole|>// @dts-jest:pass
R_drop(number, string);
// @dts-jest:pass
R_drop(number, boolean_array);<|fim▁end|> | |
<|file_name|>issue-6344-let.rs<|end_file_name|><|fim▁begin|>// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/... | let A { x: ref x } = a;
info!("{:?}", x)
} |
<|file_name|>DeleteDelta.java<|end_file_name|><|fim▁begin|>/**
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... | verify(target);
int position = getOriginal().getPosition();
int size = getOriginal().size(); |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
<|fim▁hole|>
if __name__ == "__main__":
from django.core.management import execute_from_command_line
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "worldmap.settings")
execute_from_command_line(sys.argv)<|fim▁end|> | import os
import sys |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>// These are the pages you can go to.
// They are all wrapped in the App component, which should contain the navbar etc
// See http://blog.mxstbr.com/2016/01/react-apps-with-pages for more information
// about the code splitting business
import { getAsyncInjectors } f... | |
<|file_name|>login.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { FormControl, Validators, FormGroup, FormArray, FormBuilder } from '@angular/forms';
import { Store } from '@ngrx/store';
import { StoreMainAc... | /** |
<|file_name|>script.js<|end_file_name|><|fim▁begin|>(function(){
if ( !window.File || !window.FileReader || !window.FileList || !window.Blob)
return alert('La API de Archivos no es compatible con tu navegador. Considera actualizarlo.');
var Fractal = {
loaded: false,
imagen: null,
tipo: "mandelbrot",
... |
process.render();
console.log("Tiempo: " + Fractal.lastTime);
|
<|file_name|>atmega328p.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
impl chips::Chip for Chip
{
fn flash_size() -> usize {
32 * 1024 // 32 KB
}
fn memory_size() -> usize {
2 * 1024 // 2KB
}
fn io_ports() -> Vec<io::Port> {
vec![
io::Port::new(0x03), // PINB
... | use chips;
use io;
pub struct Chip; |
<|file_name|>ghost.py<|end_file_name|><|fim▁begin|>###################################################
# This is a basic script to carry on a conversation<|fim▁hole|>###################################################
# create service
ghost = Runtime.start("ghost", "WebGui")
ear = Runtime.start("ear", "WebkitSpeechRe... | # with ghost |
<|file_name|>filter-options.ts<|end_file_name|><|fim▁begin|>/**
* @module HomeModule
*/ /** */
/**
* Options used by the {@link FilterComponent}.
*/
export interface FilterOptions {
items: FilterItems;
searchFields: Array<string>;
}<|fim▁hole|> * should be different.
* - type sepcifies what kind of input shoul... | /**
* A single item used to filter.
* - It can contain differernt ordering priorities if needed. For example, if the order for mobile |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from setuptools import setup
from os import path, environ
from sys import argv
here = path.abspath(path.dirname(__file__))
try:
if argv[1] == "test":
environ['PYTHONPATH'] = here
except IndexError:
pass
with open(path.join(here, 'README.rst'), encodi... | 'Development Status :: 4 - Beta', |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>//! Primitive auto completion and type quering on ASTs
#![doc(html_root_url = "https://docs.rs/gluon_completion/0.17.2")] // # GLUON
extern crate gluon_base as base;
use std::{borrow::Cow, cmp::Ordering, iter::once, path::PathBuf, sync::Arc};
use codespan::ByteOffset;... |
pub trait Extract<'a>: Sized {
type Output; |
<|file_name|>sub.js<|end_file_name|><|fim▁begin|>var assert = require('assert');
var num = require('../');
test('sub', function() {
assert.equal(num.sub(0, 0), '0');
assert.equal(num.sub('0', '-0'), '0');
assert.equal(num.sub('1.0', '-1.0'), '2.0');
assert.equal(num('987654321987654321.12345678901').... | test('sub#constness', function() { |
<|file_name|>test_opsgenie_alert.py<|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 und... | |
<|file_name|>client.rs<|end_file_name|><|fim▁begin|>use connection::{ConnectionInfo, IntoConnectionInfo, Connection, connect, PubSub, connect_pubsub,
ConnectionLike};
use types::{RedisResult, Value};
/// The client type.
#[derive(Debug, Clone)]
pub struct Client {
connection_info: ConnectionInfo,... |
impl ConnectionLike for Client { |
<|file_name|>shirtsinbulk.d.ts<|end_file_name|><|fim▁begin|>// TypeScript Version: 2.1
import * as React from 'react';<|fim▁hole|><|fim▁end|> | import { IconBaseProps } from 'react-icon-base';
export default class FaShirtsinbulk extends React.Component<IconBaseProps, any> { } |
<|file_name|>__init__.py<|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 Apache ... | # pylint: disable=wrong-import-order, wrong-import-position |
<|file_name|>user_timeline_event.py<|end_file_name|><|fim▁begin|># listenbrainz-server - Server for the ListenBrainz project.
#
# Copyright (C) 2021 Param Singh <me@param.codes>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | "max_ts": datetime.utcfromtimestamp(max_ts),
"count": count, |
<|file_name|>OnPageSelectedListener.java<|end_file_name|><|fim▁begin|>package com.kit.imagelib.imagelooker;
public interface OnPageSelectedListener {
public void onPageSelected();<|fim▁hole|> }<|fim▁end|> | |
<|file_name|>driver.cpp<|end_file_name|><|fim▁begin|>//********************************************************
// *
// Instructor: Franck Xia *
// Class: CS236 Fall 2002 *
// Assignment: Program 6 ... | // Function: driver program testing the parser *
// * |
<|file_name|>sort.rs<|end_file_name|><|fim▁begin|>use par_exec::{Executor, WorkAmount, JobIterBuild, ExecutorJobError, JobExecuteError};
use super::{Set, SetManager, merge};
pub trait SortManager {
type S: Set;
type E;
fn sort<SF>(&mut self, set: &mut Self::S, pred: SF) -> Result<(), Self::E> where SF: Fn... | use super::super::vec;
use par_exec::{Executor, WorkAmount};
use par_exec::par::{ParallelExecutor, ByEqualChunks};
|
<|file_name|>graph.py<|end_file_name|><|fim▁begin|>"""
Unit tests for nyx.panel.graph.
"""
import datetime
import unittest
import stem.control
import nyx.curses
import nyx.panel.graph
import test
from test import require_curses
from mock import patch
EXPECTED_BLANK_GRAPH = """
Download:
0 b
0 b
5s 10 ... | 0 b ********* |
<|file_name|>TimeParseBenchmark.java<|end_file_name|><|fim▁begin|>/*
* Licensed to Metamarkets Group Inc. (Metamarkets) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. Metamarkets licenses this file
* t... | public static void main(String[] args) throws RunnerException |
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
<|fim▁hole|> name = 'developers'<|fim▁end|> | from django.apps import AppConfig
class DevelopersConfig(AppConfig): |
<|file_name|>slope_orientation.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import getopt
import sys
class SlopeOrientation:
def __init__(self, dem, out_layer):
print "Entering SlopeOrientation"
#ALGORITHM: Aspect
# INPUT <ParameterRaster>
# BAND <ParameterN... | processing.runalg("gdalogr:aspect", dem, 1, False, False, False, False, out_layer) |
<|file_name|>ast.rs<|end_file_name|><|fim▁begin|>//! # Abstract Syntax Tree
//!
//! This module defines the abstact syntax tree and how the nodes in the tree are evaluated
//! Tree nodes are generated by the parser
//! Each tree node has it's own struct associated with it
use itertools::{join, Itertools};
use error::... | // Evaluation of numbers means just converting the number to a string |
<|file_name|>collection.rs<|end_file_name|><|fim▁begin|>/* Copyright 2017 Christopher Bacher
*
* 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|>test_ftp.py<|end_file_name|><|fim▁begin|>from scoring_engine.engine.basic_check import CHECKS_BIN_PATH
from tests.scoring_engine.checks.check_test import CheckTest
<|fim▁hole|> properties = {
'remotefilepath': '/adir/textfile.txt',
'filecontents': 'Sample contents'
}
accounts =... | class TestFTPCheck(CheckTest):
check_name = 'FTPCheck' |
<|file_name|>TrxFormController.java<|end_file_name|><|fim▁begin|>/*
* TrxFormController.java
*
* Created on Jan 9, 2010 8:22:32 PM
*
* Copyright (c) 2002 - 2010 : Swayam Inc.
*
* P R O P R I E T A R Y & C O N F I D E N T I A L
*
* The copyright of this document is vested in Swayam Inc. without
* whose prior w... | * @author paawak |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from django.utils.translation import ugettext_lazy as _ugl
<|fim▁hole|><|fim▁end|> | default_app_config = 'django_sendgrid_parse.apps.DjangoSendgridParseAppConfig' |
<|file_name|>all_10.js<|end_file_name|><|fim▁begin|>var searchData=
[
['textobject',['TextObject',['../class_oxy_1_1_framework_1_1_objects_1_1_text_object.html',1,'Oxy::Framework::Objects']]],
['textrenderer',['TextRenderer',['../class_oxy_1_1_framework_1_1_text_renderer.html',1,'Oxy::Framework']]],
['textrendere... | ['translate',['Translate',['../class_oxy_1_1_framework_1_1_graphics.html#ac854767976984446279c8cfbc04f2099',1,'Oxy::Framework::Graphics']]]
]; |
<|file_name|>facebook-login.service.spec.ts<|end_file_name|><|fim▁begin|>import { HttpClientTestingModule } from '@angular/common/http/testing';
import { inject, TestBed } from '@angular/core/testing';
import { UserService } from '../core/user/user.service';
import { FacebookLoginService } from './facebook-login.servi... | |
<|file_name|>MathUtil.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2013 Google 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-... | *
* Unless required by applicable law or agreed to in writing, software |
<|file_name|>objdump.rs<|end_file_name|><|fim▁begin|>extern crate capstone;
extern crate macho;
use capstone::prelude::*;
use std::env;
use std::fs;
use std::io::Read;
use std::process;
fn main() {
let cs = Capstone::new()
.x86()
.mode(arch::x86::ArchMode::Mode64)
.build()
.expect(... | |
<|file_name|>VRSS.cpp<|end_file_name|><|fim▁begin|>/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This pro... |
elem->Update = &VIRS_update;
elem->Graphics = &VRSS_graphics;
elem->Init = &VRSS_init_element; |
<|file_name|>0008_auto_20161209_0129.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-12-09 01:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("hordak", "0007_auto_20161209... | |
<|file_name|>iotrace-test.cc<|end_file_name|><|fim▁begin|>#include "config.h"
#include <arki/tests/tests.h>
#include <arki/iotrace.h>
namespace {
using namespace std;
using namespace arki;
using namespace arki::tests;
class Tests : public TestCase
{
using TestCase::TestCase;
void register_tests() override;
}... | |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>from rest_framework import serializers
from models import SurveyDraft
from taggit.models import Tag
class WritableJSONField(serializers.Field):
""" Serializer for JSONField -- required to make field writable"""
""" ALSO REQUIRED because the default JSON... | class Meta:
model = SurveyDraft
fields = ('id', 'name', 'asset_type', 'summary', 'date_modified', 'description')
|
<|file_name|>PostDeleteEventListenerImpl.java<|end_file_name|><|fim▁begin|>package org.hivedb.hibernate.simplified;
import org.apache.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.action.Executable;
import org.hibernate.event.PostDeleteEvent;
import org.hibernate.event.PostDeleteEventList... | try { |
<|file_name|>geo.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
import os
import geoip2.database
from geoip2.errors import AddressNotFoundError
from cortexutils.analyzer import Analyzer
class MaxMindAnalyzer(Analyzer):
def dump_city(self, city):
return {
'confidence':... | 'latitude': location.latitude,
'longitude': location.longitude,
'metro_code': location.metro_code,
'time_zone': location.time_zone |
<|file_name|>properties.mako.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/. */
// This file is a Mako template: http://www.makotempl... | |
<|file_name|>SerialExceptionTest.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... | } |
<|file_name|>BasicPantheonGenerator.java<|end_file_name|><|fim▁begin|>package pl.dzielins42.dmtools.generator.religion;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import pl.dzielins42.dmtools.model.enumeration.Alignment;
import pl.dzielins42.dmtools.model.enumeration.Gender;
import pl... |
/** |
<|file_name|>quote_test.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# 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.
import optparse
import quote
import sys
import unittest
verbose = False
... | |
<|file_name|>predicates.rs<|end_file_name|><|fim▁begin|>use std::fmt::{Display, Formatter};
use std::fmt::Error;
pub trait Predicate<T>: Display
where T: Display
{
fn name(&self) -> &str;
fn len(&self) -> usize;
fn ids(&self) -> &Vec<T>;
fn is_empty(&self) -> bool;
}
#[derive(Debug)]
pub struct Pr... | } |
<|file_name|>FairExhibitors.jest.tsx<|end_file_name|><|fim▁begin|>import { FairExhibitors_Test_Query } from "v2/__generated__/FairExhibitors_Test_Query.graphql"<|fim▁hole|>import { setupTestWrapperTL } from "v2/DevTools/setupTestWrapper"
import { screen } from "@testing-library/react"
jest.unmock("react-relay")
jest.... | import { graphql } from "react-relay"
import { FairExhibitorsFragmentContainer } from "../FairExhibitors" |
<|file_name|>type2name.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************\
Module: Type Naming for C
Author: Daniel Kroening, kroening@cs.cmu.edu
\*******************************************************************/
#include <ctype.h>
#include <i2string.h>
#includ... | result+="$";
forall_subtypes(it, type)
{
result+=type2name(*it); |
<|file_name|>c_ai_basenpc.cpp<|end_file_name|><|fim▁begin|>//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "c_AI_BaseNPC.h"
#includ... | } |
<|file_name|>TextPasteCommand.cpp<|end_file_name|><|fim▁begin|>/*
This file is part of the KDE project
* Copyright (C) 2009 Pierre Stirnweiss <pstirnweiss@googlemail.com>
* Copyright (C) 2011 Boudewijn Rempt <boud@kde.org>
*
* This library is free software; you can redistribute it and/or
* modify it under the ter... |
KoTextDocument textDocument(m_document);
KoTextEditor *editor = textDocument.textEditor();
|
<|file_name|>OpenmrsProfile.java<|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/. OpenMRS is also distributed under
* the terms of th... | * OpenMRS version and/or started modules.
*
* @since 1.10, 1.9.8, 1.8.5, 1.7.5
*/ |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
//go:generate go run main.go
import (
"os"
chart "github.com/wcharczuk/go-chart/v2"
)
func main() {
/*
In this example we add a new type of series, a `SimpleMovingAverageSeries` that takes another series as a required argument.
InnerSeries only ... | } |
<|file_name|>0006_auto_20161015_2113.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-16 00:13
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [<... | ('api', '0005_queue_name'), |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import mdDialog from './mdDialog.vue';
import mdDialogTitle from './mdDialogTitle.vue';
import mdDialogContent from './mdDialogContent.vue';
import mdDialogActions from './mdDialogActions.vue';
import mdDialogAlert from './presets/mdDialogAlert.vue';
import mdDialogCon... | Vue.component('md-dialog-prompt', mdDialogPrompt);
Vue.material.styles.push(mdDialogTheme); |
<|file_name|>basic_no_conf.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
This example explores how logging behaves if no special
configuration is performed.
conclusions:
- we get an error printout which DOES NOT stop the program
that we do not have handlers.
"No handlers could be found for logger ... | print("error")
logger.error("this is an error message") |
<|file_name|>point_vector.go<|end_file_name|><|fim▁begin|>// Copyright 2017 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.or... | |
<|file_name|>set_cookie.rs<|end_file_name|><|fim▁begin|>use header::{Header, HeaderFormat};
use std::fmt::{self, Display};
use std::str::from_utf8;
use cookie::Cookie;
use cookie::CookieJar;
/// `Set-Cookie` header, defined [RFC6265](http://tools.ietf.org/html/rfc6265#section-4.1)
///
/// The Set-Cookie HTTP response... | |
<|file_name|>CreateTodoForm.js<|end_file_name|><|fim▁begin|>import {Component} from 'react';<|fim▁hole|>import './CreateTodoForm.styl';
class CreateTodoForm extends Component {
render() {
return (
<form className="create-todo-form" onSubmit={this.props.handleSubmit} autoComplete="off">
<input type=... | import {reduxForm} from 'redux-form';
|
<|file_name|>DataDigest.ts<|end_file_name|><|fim▁begin|>namespace KGS {
export class DataDigest {
public timestamp: Date = new Date();
public perfstamp: number = performance.now();
public username: boolean = false;
public joinedChannelIds: boolean = false;
public joinFailedC... | public gameClocks: { [channelId: number]: boolean } = {};
public touchGameClocks(channelId: number) { this.gameClocks[channelId] = true; } |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>use std::collections::HashMap;<|fim▁hole|> *nucleotide_counts(strain).get(&c).unwrap()
}
pub fn nucleotide_counts (strain: &str) -> HashMap<char, usize> {
let mut map = HashMap::new();
// Default values
for c in "AGTC".chars() { map.insert(c, 0); }
// Count o... |
pub fn count (c: char, strain: &str) -> usize { |
<|file_name|>master.py<|end_file_name|><|fim▁begin|>"""Controlles a bunch of remotes."""
import asyncio
import functools
import logging
import os
import pathlib
import signal
import sys
import traceback
from implant import commands, connect, core, testing
log = logging.getLogger(__name__)
PLUGINS_ENTRY_POINT_GROUP = ... | error_log.cancel()
await error_log |
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warning... | ## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [copy constructor]
cls.add_constructor([param('ns3::Socket const &', 'arg0')])
## socket.h (module 'network'): ns3::Socket::Socket() [constructor] |
<|file_name|>Data.java<|end_file_name|><|fim▁begin|>package ibxm;
/* A data array dynamically loaded from an InputStream. */
public class Data {
private int bufLen;
private byte[] buffer;
private java.io.InputStream stream;
public Data( java.io.InputStream inputStream ) throws java.io.IOException {
bufLen = 1 <... | }
|
<|file_name|>test_resource.py<|end_file_name|><|fim▁begin|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | }],
'logical_resource_id': 'the_resource',
'name': 'the_resource',
'physical_resource_id': '9f38ab5a-37c8-4e40-9702-ce27fc5f6954', |
<|file_name|>hi.py<|end_file_name|><|fim▁begin|># !usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under a 3-clause BSD license.
#
# @Author: Brian Cherinka
# @Date: 2018-10-11 17:51:43
# @Last modified by: Brian Cherinka
# @Last Modified time: 2018-11-29 17:23:15
from __future__ import print_function, div... | from marvin.utils.plot.scatter import plot as scatplot
from marvin import log |
<|file_name|>latex.py<|end_file_name|><|fim▁begin|>"""LaTeX Exporter class"""
<|fim▁hole|># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import os
from traitlets import Unicode, default
from traitlets.config import Config
from nbconvert.filters.highlight import H... | |
<|file_name|>macros.rs<|end_file_name|><|fim▁begin|>macro_rules! assert_almost_eq {
($cond1:expr, $cond2:expr, $err:expr) => ({
use std::num::Float;
let c1 = $cond1;<|fim▁hole|> assert!((c1 - c2).abs() < $err, "{} is not almost equal to {}", c1, c2);
})
}<|fim▁end|> | let c2 = $cond2; |
<|file_name|>storwize_svc_common.py<|end_file_name|><|fim▁begin|># Copyright 2015 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.