prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>GuiSolidifier.java<|end_file_name|><|fim▁begin|>package com.teambrmodding.neotech.client.gui.machines.processors;
import com.teambr.bookshelf.client.gui.GuiColor;
import com.teambr.bookshelf.client.gui.GuiTextFormat;
import com.teambr.bookshelf.client.gui.component.control.GuiComponentItemStackButton;
imp... | |
<|file_name|>view_environment.py<|end_file_name|><|fim▁begin|># coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Script to visualize the model coordination environments
"""
__author__ = "David Waroquiers"
... | if any([algo.algorithm_type == SEPARATION_PLANE for algo in cg.algorithms]): |
<|file_name|>EPGWindow.py<|end_file_name|><|fim▁begin|># Copyright (C) 2013 Lunatixz
#
#
# This file is part of PseudoTV.
#
# PseudoTV 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 ... | while reftime + self.MyOverlayWindow.channels[curchannel - 1].getItemDuration(playlistpos) < starttime:
reftime += self.MyOverlayWindow.channels[curchannel - 1].getItemDuration(playlistpos) |
<|file_name|>initMultiple.js<|end_file_name|><|fim▁begin|>$(function () {
$('.imageUploadMultiple').each(function (index, item) {
var $item = $(item);
var $group = $item.closest('.form-group');
var $innerGroup = $item.find('.form-group');
var $errors = $item.find('.errors');
... | onUpdate: function () {
updateValue();
}
}); |
<|file_name|>0003_auto__add_field_calendar_slug.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Calendar.slug'
... | 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
<|file_name|>delimited-token-groups.rs<|end_file_name|><|fim▁begin|>// pp-exact
#![feature(rustc_attrs)]
macro_rules! mac { ($($tt : tt) *) => () }
mac! {
struct S { field1 : u8, field2 : u16, } impl Clone for S
{
fn clone() -> S
{
panic! () ;
}
}
}
<|fim▁hole|>mac! {... | |
<|file_name|>dda.hpp<|end_file_name|><|fim▁begin|>/* Copyright (c) 2010 by CodeSourcery. All rights reserved. */
#ifndef vsip_core_dda_hpp_
#define vsip_core_dda_hpp_
#include <vsip/core/static_assert.hpp>
#include <vsip/core/block_traits.hpp>
#include <vsip/core/metaprogramming.hpp>
#include <vsip/core/storage.hpp>
... | adjust_type<Local_map, map_type>::equiv;
static bool const is_local = is_same<Local_map, map_type>::value; |
<|file_name|>trimFilename.tsx<|end_file_name|><|fim▁begin|>function trimFilename(filename: string) {
const pieces = filename.split(/\//g);<|fim▁hole|><|fim▁end|> | return pieces[pieces.length - 1];
}
export default trimFilename; |
<|file_name|>error.go<|end_file_name|><|fim▁begin|>// Copyright 2015 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
... | ErrValueProvided = Error(ErrGRPCValueProvided)
ErrLeaseProvided = Error(ErrGRPCLeaseProvided)
ErrTooManyOps = Error(ErrGRPCTooManyOps)
ErrDuplicateKey = Error(ErrGRPCDuplicateKey) |
<|file_name|>ViewConfiguration.cpp<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2013-2014 Quentin Smetz <qsmetz@gmail.com>, Sebastien
* Jodogne <s.jodogne@gmail.com>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "S... | |
<|file_name|>discord.rs<|end_file_name|><|fim▁begin|>use inth_oauth2::provider::Provider;
use inth_oauth2::token::{Bearer, Refresh};
use inth_oauth2::Client;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Discord;
#[derive(RustcDecodable)]<|fim▁hole|>pub struct DiscordUser {
pub username: String,
pub... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>__VERSION__="ete2-2.2rev1026"
# -*- coding: utf-8 -*-
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://ete.cgenomics.org
#
# ETE is free software: ... | |
<|file_name|>build.rs<|end_file_name|><|fim▁begin|>// Copyright 2020 The Exonum 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 of the License at
//<|fim▁hole|>// http://www.apache.org/licenses/LICE... | |
<|file_name|>geturi.js<|end_file_name|><|fim▁begin|><|fim▁hole|> var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = h... | function getUrlVars() { |
<|file_name|>comment_crlf_newline.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | // rustfmt-normalize_comments: true
/* Block comments followed by CRLF newlines should not an extra newline at the end */
/* Something else */ |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or any plugin's vendor/assets/javas... | // about supported directives.
//
//= require jquery
//= require jquery_ujs |
<|file_name|>simple_fun_#3_late_ride.py<|end_file_name|><|fim▁begin|>#Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Simple Fun #3: Late Ride
#Problem level: 7 kyu
def late_ride(n):<|fim▁hole|><|fim▁end|> | return sum([int(x) for x in list(str(n//60)+str(n%60))]) |
<|file_name|>miner.cpp<|end_file_name|><|fim▁begin|>// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2013 The NovaCoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mi... | printf("COrphan(hash=%s, dPriority=%.1f, dFeePerKb=%.1f)\n",
ptx->GetHash().ToString().substr(0,10).c_str(), dPriority, dFeePerKb);
BOOST_FOREACH(uint256 hash, setDependsOn)
printf(" setDependsOn %s\n", hash.ToString().substr(0,10).c_str()); |
<|file_name|>cliffWalk_QL.py<|end_file_name|><|fim▁begin|># solve cliff-walking task with Q-Learning, very similar to SARSA
# original example problem from the book, introduction for reinforcement learning
# Author: Wenbin Li
# numeric backend
import pygame
from pygame.locals import *
import numpy as np
grid_size = 1... | |
<|file_name|>spsc_queue.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 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... |
if (*tail).cached {
self.consumer.tail_prev.store(tail, Ordering::Release); |
<|file_name|>config_flow.py<|end_file_name|><|fim▁begin|>"""Config flow for Google Maps Travel Time integration."""
from __future__ import annotations
import logging
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_API_KEY, CONF_MODE, CONF_NAME
from homeassistant... | |
<|file_name|>005reset.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import atexit
import argparse
import getpass
import sys
import textwrap
import time
from pyVim import connect
from pyVmomi import vim
import requests
requests.packages.urllib3.disable_warnings()
import ssl
try:
_create_unverified_htt... | (args.host, args.user))
return args |
<|file_name|>main.go<|end_file_name|><|fim▁begin|>package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/codegangsta/cli"
"github.com/yudai/gotty/app"
)
func main() {
cmd := cli.NewApp()
cmd.Version = "0.0.9"
cmd.Name = "gotty"
cmd.Usage = "Share your terminal as a web application"
cmd.HideHe... | } |
<|file_name|>middleware.js<|end_file_name|><|fim▁begin|>/**<|fim▁hole|> * Express middleware
*/<|fim▁end|> | * boot/middleware.js |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url
<|fim▁hole|>
urlpatterns = [
url(r'^$', views.map, name='map'),
url(r'^mapSim', views.mapSim, name='mapSim'),
url(r'^api/getPos', views.getPos, name='getPos'),
url(r'^api/getProjAndPos', views.getProjAndPos, name='getProjAndPos'),
]<... | from . import views |
<|file_name|>extra.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export declare class UtilExtraClass {} |
<|file_name|>features.rs<|end_file_name|><|fim▁begin|>//! Feature tests for OS functionality
pub use self::os::*;
#[cfg(any(target_os = "linux", target_os = "android"))]
mod os {
use crate::sys::utsname::uname;
// Features:
// * atomic cloexec on socket: 2.6.27
// * pipe2: 2.6.27
// * accept4: 2.6... | }
b'0'..=b'9' => {
match curr {
0 => digit(&mut major, b), |
<|file_name|>run_gitserver.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from django.conf import settings
from django.core.management.base import BaseCommand
from twisted.conch.interfaces import ISession
from twisted.internet import reactor
from twisted.python import components
from brigitte.gitserver.serve... | |
<|file_name|>OPD_panel.py<|end_file_name|><|fim▁begin|>from Plugins.Plugin import PluginDescriptor
from Screens.PluginBrowser import *
from Screens.Ipkg import Ipkg
from Screens.HarddiskSetup import HarddiskSetup
from Components.ProgressBar import ProgressBar
from Components.SelectionList import SelectionList
from Scre... | except:
o = ''
return o
|
<|file_name|>parser.py<|end_file_name|><|fim▁begin|>import json
from datetime import datetime
from dojo.models import Finding
class MeterianParser(object):
def get_scan_types(self):
return ["Meterian Scan"]
def get_label_for_scan_types(self, scan_type):
return scan_type
def get_descrip... | def get_findings(self, report, test): |
<|file_name|>ripple.js<|end_file_name|><|fim▁begin|>import { strToEl } from '../utils';
export default class Ripple {
constructor() {
this.container = strToEl('<div class="ripple"></div>');
}
<|fim▁hole|> animate() {
this.container.classList.remove('animate');
this.container.offsetLeft;
this.conta... | |
<|file_name|>TerrainTexturePack.java<|end_file_name|><|fim▁begin|>package textures;
public class TerrainTexturePack {
private TerrainTexture backgroundTexture;
private TerrainTexture rTexture;
private TerrainTexture gTexture;
private TerrainTexture bTexture;
public TerrainTexture getBackgroundTexture() {
retu... | return rTexture;
} |
<|file_name|>create_new.py<|end_file_name|><|fim▁begin|># Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Create a new document with defaults set
"""
import webnotes
from webnotes.utils import nowdate, nowtime, cint, flt
import webnotes.d... | else:
ref_docname = webnotes.conn.get_default(ref_fieldname)
doc.fields[d.fieldname] = webnotes.conn.get_value(d.default[1:], |
<|file_name|>AbstractScalaFormatterTestBase.java<|end_file_name|><|fim▁begin|>package org.jetbrains.plugins.scala.lang.formatter;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.ed... | TextRange rangeToUse = myTextRange; |
<|file_name|>views.py<|end_file_name|><|fim▁begin|>import datetime
import logging
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import Group
from django.shortcuts import render, redirect
from allianceauth.services.for... | 'message'] + "\n##### SENT BY: " + "[" + main_char.corporation_ticker + "]" + \ |
<|file_name|>DailyQuestsManager.java<|end_file_name|><|fim▁begin|>package l2s.gameserver.instancemanager;
import java.util.ArrayList;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import l2s.commons.util.Rnd;
import l2s.gameserver.model.Player;
import l2s.gameserver.model.quest.Ques... | public static void EngageSystem()
{ |
<|file_name|>constEnumsEmitOutputInMultipleFiles.ts<|end_file_name|><|fim▁begin|>/// <reference path='fourslash.ts'/>
// @Filename: a.ts
////const enum TestEnum {
//// Foo, Bar
////}
////var testFirstFile = TestEnum.Bar;
// @Filename: b.ts
/////// <reference path="a.ts" />
/////*1*/
////var testInOtherF... | var testInOtherFile = 1 /* TestEnum.Bar */;\r\n"
|
<|file_name|>pb0027.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# *-* coding:utf-8 *-*
"""
Date :
Author : Vianney Gremmel loutre.a@gmail.com
"""
def memo(f):
class Memo(dict):
def __missing__(self, key):
r = self[key] = f(key)
return r
return Memo().__getitem__
@mem... | break |
<|file_name|>utils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Helper functions used in views.
"""
from json import dumps
from functools import wraps
from flask import Response
<|fim▁hole|> """
@wraps(function)
def inner(*args, **kwargs):
return Response(dumps(function(*args, **kwar... |
def jsonify(function):
"""
Creates a response with the JSON representation of wrapped function result. |
<|file_name|>location.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/. */
use dom::bindings::codegen::Bindings::LocationBinding;
use d... | |
<|file_name|>Arez_ObservableWithSpecificExceptionModel.java<|end_file_name|><|fim▁begin|>import arez.Arez;
import arez.ArezContext;
import arez.Component;
import arez.Disposable;
import arez.ObservableValue;
import arez.SafeProcedure;
import arez.component.DisposeNotifier;
import arez.component.Identifiable;
import are... | this.$$arezi$$_kernel.componentConstructed();
this.$$arezi$$_kernel.componentReady();
} |
<|file_name|>Pinger.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2011 Witoslaw Koczewsi <wi@koczewski.de>, Artjom Kochtchi
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero
* General Public License as published by the Free Software Foundation, either ... | |
<|file_name|>NodalMutationTest.java<|end_file_name|><|fim▁begin|>/*
Grammatical Evolution in Java
Release: GEVA-v2.0.zip
Copyright (C) 2008 Michael O'Neill, Erik Hemberg, Anthony Brabazon, Conor Gilligan
Contributors Patrick Middleburgh, Eliott Bartley, Jonathan Hugosson, Jeff Wrigh
Separate licences for asm, bsf, a... | * Test of doOperation method, of class NodalMutation.
* create an instance, mutate it, see if its okay
*/
@Test |
<|file_name|>testutil.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import
import os
import socket
import random
import string
import time
import uuid
import pytest
from . import unittest
from kafka import SimpleClient, create_message
from kafka.client_async import KafkaClient
from kafka.errors imp... | |
<|file_name|>validators.d.ts<|end_file_name|><|fim▁begin|>import { OpaqueToken } from 'angular2/src/core/di';
import * as modelModule from './model';
export declare const NG_VALIDATORS: OpaqueToken;
/**
* Provides a set of validators used by form controls.
*
* # Example
*
* ```<|fim▁hole|> * var loginControl = new... | |
<|file_name|>client_simple.rs<|end_file_name|><|fim▁begin|>//! An example of usage of the `solicit::client::SimpleClient` API.
//!
//! This is a simple implementation of an HTTP/2 client, built on top of the API of `solicit::http`
//! that performs all IO in the main thread.
extern crate solicit;
use std::env;
use st... |
let host = env::args().nth(1);
let paths: Vec<_> = env::args().skip(2).collect();
|
<|file_name|>test-logger.js<|end_file_name|><|fim▁begin|>#!/usr/bin/env node
var logger = require('../lib/logger')('test-logger');
var config = require('../lib/config');
var count = 1;
<|fim▁hole|>setInterval(function() {
logger.debug(count);
logger.info(count);
count += 1;
}, 1000);<|fim▁end|> | |
<|file_name|>id3v1.rs<|end_file_name|><|fim▁begin|>extern crate byteorder;
use std::io::{self, Read, Write, Seek, SeekFrom};
use num::Bounded;
use std::fmt;
use self::byteorder::{BigEndian, ReadBytesExt};
/// The fields in an ID3v1 tag, including the "1.1" track number field.
#[derive(Copy, Clone)]
#[allow(missing_do... | |
<|file_name|>microbatched_model.py<|end_file_name|><|fim▁begin|>import tensorflow as tf
import numpy as np
from baselines.ppo2.model import Model
class MicrobatchedModel(Model):
"""
Model that does training one microbatch at a time - when gradient computation
on the entire minibatch causes some overflow
... | policy=policy,
ob_space=ob_space, |
<|file_name|>interaction.py<|end_file_name|><|fim▁begin|>__author__ = 'rohe0002'
import json
import logging
from urlparse import urlparse
from bs4 import BeautifulSoup
from mechanize import ParseResponseEx
from mechanize._form import ControlNotFoundError, AmbiguityError
from mechanize._form import ListControl
logge... | :param orig_response: The original response (as returned by requests) |
<|file_name|>handler_console.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
This module implements a console output writer.
"""
import tensorflow as tf
from niftynet.engine.application_variables import CONSOLE
from niftynet.engine.signal import ITER_STARTED, ITER_FINISHED
class ConsoleLogger(object):
... | |
<|file_name|>Namespace_Base.cpp<|end_file_name|><|fim▁begin|>#include "Namespace_Base.h"
#include <co/Coral.h>
#include <co/IComponent.h>
#include <co/IPort.h>
#include <co/IInterface.h>
namespace co {
//------ co.Namespace has a facet named 'namespace', of type co.INamespace ------//
co::IInterface* Namespace_co_IN... | |
<|file_name|>test_db.py<|end_file_name|><|fim▁begin|># Copyright 2012 NEC Corporation. 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.ap... | |
<|file_name|>saveAddress.ts<|end_file_name|><|fim▁begin|>import { UpdateUserAddressMutationResponse } from "v2/__generated__/UpdateUserAddressMutation.graphql"
import { CreateUserAddressMutationResponse } from "v2/__generated__/CreateUserAddressMutation.graphql"
import { DeleteUserAddressMutationResponse } from "v2/__g... | },
} |
<|file_name|>titanic_data_heuristic1.py<|end_file_name|><|fim▁begin|>import numpy
import pandas
import statsmodels.api as sm
'''
In this exercise, we will perform some rudimentary practices similar to those of
an actual data scientist.
Part of a data scientist's job is to use her or his ... | http://www.kaggle.com/c/titanic-gettingStarted
In this exercise and the following ones, you are given a list of Titantic passengers
|
<|file_name|>oop_utils.rs<|end_file_name|><|fim▁begin|>use super::Universe;
use super::oop::*;
use ast::sexpr::SExpr;
<|fim▁hole|>unsafe fn fmt_oop(oop: Oop, u: &Universe, fmt: &mut Formatter) -> fmt::Result {
if oop == NULL_OOP {
write!(fmt, "<null>")?;
} else if Singleton::is_singleton(oop) {
... | use std::fmt::{self, Formatter, Display};
// Format impl
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
"""
Model for testing arithmetic expressions.
"""
from django.db import models<|fim▁hole|>class Number(models.Model):
integer = models.BigIntegerField(db_column='... |
@python_2_unicode_compatible |
<|file_name|>previous_elections_spain_analysis.py<|end_file_name|><|fim▁begin|>import numpy as np
import pandas as pd
from ElectionsTools.Seats_assignation import DHondt_assignation
from previous_elections_spain_parser import *
import os
pathfiles = '../data/spain_previous_elections_results/provincia/'
pathfiles = '/'... | filename = fles[years.index(year)]
d, d1, d2, parties = compute_diputes_DHont(filename)
exp_d, exp_d1, exp_d2, exp_parties = prepare2export(d, d1, d2, parties) |
<|file_name|>canvas.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/. */
use cssparser::RGBA;
use euclid::{Point2D, Rect, Size2D, Trans... | repeat_x,
repeat_y, |
<|file_name|>MultimapSideInputTest.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
* ... | |
<|file_name|>xmlhttprequest.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 https://mozilla.org/MPL/2.0/. */
use crate::body::{BodySource, Extractable, ExtractedB... | #[ignore_malloc_size_of = "Defined in hyper"]
request_method: DomRefCell<Method>,
request_url: DomRefCell<Option<ServoUrl>>, |
<|file_name|>590_remove_brief_status_column.py<|end_file_name|><|fim▁begin|>"""Remove brief status column
Revision ID: 590
Revises: 580
Create Date: 2016-03-03 14:56:59.218753<|fim▁hole|>revision = '590'
down_revision = '580'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.drop_column('briefs',... |
"""
# revision identifiers, used by Alembic. |
<|file_name|>HelpCommand.java<|end_file_name|><|fim▁begin|>package fr.lteconsulting.pomexplorer.commands;
import fr.lteconsulting.pomexplorer.AppFactory;
import fr.lteconsulting.pomexplorer.Client;
import fr.lteconsulting.pomexplorer.Log;
public class HelpCommand
{<|fim▁hole|> @Help( "gives this message" )
public vo... | |
<|file_name|>str.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 https://mozilla.org/MPL/2.0/. */
//! The `ByteString` struct.
use chrono::prelude::{Utc, Weekday}... | self.parse_month_string().is_ok()
}
|
<|file_name|>states.rs<|end_file_name|><|fim▁begin|>use v3::messages::a2a::MessageId;
use v3::messages::issuance::credential_request::CredentialRequest;
use v3::messages::issuance::credential_offer::CredentialOffer;
use v3::messages::issuance::credential::Credential;
use v3::messages::status::Status;
use v3::messages::... | } |
<|file_name|>test_baseIterable.py<|end_file_name|><|fim▁begin|>import os
from unittest import TestCase
import mock
from marvel.iterables import BaseIterable
class FooIterable(BaseIterable):
def __init__(self):
self.total_pages = 20
super(FooIterable, self).__init__()
def get_items(self):
... | return [self.total_pages] |
<|file_name|>ldp.py<|end_file_name|><|fim▁begin|># kamene.contrib.description = Label Distribution Protocol (LDP)
# kamene.contrib.status = loads
# http://git.savannah.gnu.org/cgit/ldpscapy.git/snapshot/ldpscapy-5285b81d6e628043df2a83301b292f24a95f0ba1.tar.gz
# This program is free software: you can redistribute it a... |
# 3.5.5. Address Message |
<|file_name|>base.py<|end_file_name|><|fim▁begin|><|fim▁hole|># -*- coding: utf-8 -*-
from tornado.web import RequestHandler, HTTPError
from schema import Session, Feed
from jinja2.exceptions import TemplateNotFound
class Base(RequestHandler):
@property
def env(self):
return self.application.env
... | #!/usr/bin/env python |
<|file_name|>trendfile.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# encoding: utf-8
"""
trend.datasource.trendfile.py
Handling and parsing of trendfiles (*.hdb)
Copyright (C) 2016/2017 Stefan Braun
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General P... | for curr_list in self.get_dbdata_lists_generator(start_datetime, stop_datetime):
sr = DBData_Timestamp_Search_Result()
# returning this list of DBData elements as exact search hit |
<|file_name|>tut2.go<|end_file_name|><|fim▁begin|>package main
import (
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
)
type User struct {
gorm.Model
Name string
}
// `Profile` belongs to `User`, `UserID` is the foreign key
type Profile struct {
gorm.Model
UserID int // Cho nay quan trong => Tao ... | User User |
<|file_name|>issue-78549-ref-pat-and-str.rs<|end_file_name|><|fim▁begin|>// check-pass
// From https://github.com/rust-lang/rust/issues/78549
fn main() {
match "foo" {
"foo" => {},
&_ => {},
}
match "foo" {<|fim▁hole|> }
match ("foo", 0, "bar") {
(&_, 0, &_) => {},
... | &_ => {},
"foo" => {}, |
<|file_name|>TargetQueryRenderer.java<|end_file_name|><|fim▁begin|>package it.unibz.inf.ontop.renderer;
/*
* #%L
* ontop-obdalib-core
* %%
* Copyright (C) 2009 - 2014 Free University of Bozen-Bolzano
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in com... | sb.append("^^");
sb.append(fname);
}
} else if (functionSymbol instanceof URITemplatePredicate) { |
<|file_name|>package_test.go<|end_file_name|><|fim▁begin|>package packages
import (
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/stretchr/testify/assert"
)
func TestNewPackageFromImage(t *testing.T) {
// with tag
pkg, err := NewPackageFromImage("whal... | "io.whalebrew.config.volumes": "[\"/somesource:/somedest\"]",
"io.whalebrew.config.ports": "[\"8100:8100\"]",
"io.whalebrew.config.networks": "[\"host\"]",
}, |
<|file_name|>gui_charts.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk
from tkinter import ttk
from multiprocessing import pool
import numpy as np
import stat_functions as stat
from scipy import stats as scstats
from gui import gui_functions as guif
import os
import... | guif.save(subplot,f)
def correlogram(self,ll,subplot,f=None): |
<|file_name|>migrations.go<|end_file_name|><|fim▁begin|>package accesscontrol
import "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
func AddMigration(mg *migrator.Migrator) {
permissionV1 := migrator.Table{
Name: "permission",
Columns: []*migrator.Column{
{Name: "id", Type: migrator.DB_BigInt, Is... | {Name: "created", Type: migrator.DB_DateTime, Nullable: false},
{Name: "updated", Type: migrator.DB_DateTime, Nullable: false}, |
<|file_name|>conftest.py<|end_file_name|><|fim▁begin|>""" pytest fixtures for test suite """
import pytest
import sqlalchemy as sa
import sqlalchemy.orm as orm
import testing.postgresql
import temporal_sqlalchemy as temporal
from . import models
@pytest.yield_fixture(scope='session')
def engine():
"""Creates a p... | |
<|file_name|>GuestMutations.test.ts<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import config from 'config';
import gqlV2 from 'fake-tag';
import sinon from 'sinon';
import { verifyJwt } from '../../../../../server/lib/auth';
import emailLib from '../../../../../server/lib/email';
import { randEmail } ... | const result = await callSendConfirmation(randEmail(), user);
expect(result.errors).to.exist;
expect(result.errors[0].message).to.include("You're signed in");
}); |
<|file_name|>PromiseObservable.d.ts<|end_file_name|><|fim▁begin|>import { Scheduler } from '../Scheduler';
import { Observable } from '../Observable';
import { Subscriber } from '../Subscriber';
import { TeardownLogic } from '../Subscription';
/**
* We need this JSDoc comment for affecting ESDoc.
* @extends {Ignored}... | |
<|file_name|>files.py<|end_file_name|><|fim▁begin|>"""The image module provides basic functions for working with images in nipy.
Functions are provided to load, save and create image objects, along with
iterators to easily slice through volumes.
load : load an image from a file
save : save an image to a file
... | zooms = hdr.get_zooms()
except AttributeError: |
<|file_name|>multilevel-path-1.rs<|end_file_name|><|fim▁begin|>// edition:2021
#![feature(rustc_attrs)]
#![allow(unused)]
struct Point {
x: i32,
y: i32,
}
struct Wrapper {
p: Point,
}
fn main() {
let mut w = Wrapper { p: Point { x: 10, y: 10 } };
// Only paths that appears within the closure tha... | let py = &mut w.p.y; |
<|file_name|>SimulateP2PNetwork.py<|end_file_name|><|fim▁begin|># Author:
# Ross Sbriscia, April 2016
import random
import sys
import traceback
import os
import math
import argparse
import time
import random_connected_graph
# Parses Arguments
parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelp... | |
<|file_name|>app.routing.ts<|end_file_name|><|fim▁begin|>import { ModuleWithProviders } from '@angular/core'
import { Routes, RouterModule } from '@angular/router'
//anything not maching a registered URL will go to the login page
const routes: Routes = [
{ path: '**', redirectTo: '/login', pathMatch: 'full' }
]
<|f... | export const routing: ModuleWithProviders = RouterModule.forRoot(routes) |
<|file_name|>ClangFunctionDifferenceBear.py<|end_file_name|><|fim▁begin|>import functools
from itertools import combinations
from bears.c_languages.ClangBear import clang_available, ClangBear
from bears.c_languages.codeclone_detection.ClangCountingConditions import (
condition_dict)
from bears.c_languages.codeclon... | |
<|file_name|>SetUserPictureCmd.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... | |
<|file_name|>gen.rs<|end_file_name|><|fim▁begin|><|fim▁hole|>
include!(concat!(env!("OUT_DIR"), "/glk.rs"));<|fim▁end|> | #![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)] |
<|file_name|>json.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
import json
import sys
from importlib import import_module
from importlib.util import find_spec
from owlmixin import OwlMixin, TOption
from owlmixin.util import load_json
from jumeaux.addons.res2res import Res2ResExecutor
from jumeaux.logger imp... | sys.exit(1)
|
<|file_name|>setupSampledLOSO_writeIndices.py<|end_file_name|><|fim▁begin|># @Author
# Chloe-Agathe Azencott
# chloe-agathe.azencott@mines-paristech.fr
# April 2016
import argparse
import h5py
import numpy as np
import os
import sys
def main():
""" Create train/test indices for one repeat of a 10-fold sampled l... | with the following structure:
For k=1..numFolds: |
<|file_name|>transactions.rs<|end_file_name|><|fim▁begin|>use crypto::digest::Digest;
use crypto::sha2::Sha256;
use preamble::*;
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct Transactions<'a> {
pub count: u64,
pub slice: &'a [u8],
}
#[derive(PartialEq, Eq, Debug, Clone, Copy)]
pub struct Transaction... | |
<|file_name|>DisabledFacetForPropertyAnnotation.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 licen... | return null;
}
|
<|file_name|>_core.py<|end_file_name|><|fim▁begin|>"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
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 by the Free Software ... | |
<|file_name|>app.js<|end_file_name|><|fim▁begin|>$(function() {
$(".navbar-expand-toggle").click(function() {
$(".app-container").toggleClass("expanded");
return $(".navbar-expand-toggle").toggleClass("fa-rotate-90");<|fim▁hole|> $(".navbar-right").toggleClass("expanded");
return $(".navbar-right-expan... | });
return $(".navbar-right-expand-toggle").click(function() { |
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as published by
* the Free Software Foundation... | * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
|
<|file_name|>test_swe_adjoint.py<|end_file_name|><|fim▁begin|>"""
Tests whether we can compute a consistent gradient of some functional
based on the forward model with respect to the bottom friction
via firedrake_adjoint.
Stephan Kramer 25-05-16
"""
import pytest
from thetis import *
from firedrake_adjoint import *
o... | solver_obj.assign_initial_conditions(uv=as_vector((velocity_u, 0.0)), elev=Constant(0.0))
solver_obj.iterate()
J0 = assemble(solver_obj.fields.solution_2d[0]*dx) |
<|file_name|>NewDTDTemplatesWizardPage.java<|end_file_name|><|fim▁begin|>/*******************************************************************************
* Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of t... |
Template template = getSelectedTemplate();
if (template != null) { |
<|file_name|>hex.rs<|end_file_name|><|fim▁begin|>// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licens... | }
/// Errors that can occur when decoding a hex encoded string
#[derive(Copy, Clone, Debug)] |
<|file_name|>countingones.cpp<|end_file_name|><|fim▁begin|>#include <bits/stdc++.h>
using namespace std;
long long unsigned v[63], a, b;
long long unsigned S(long long unsigned n){
if(!n) return 0;
if((1LL<<((sizeof(long long)<<3) - __builtin_clzll(n)))-1 == n)
return v[(sizeof(long long)<<3) - __builtin_clzll(n)... | |
<|file_name|>logging.js<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2014 TopCoder Inc., All Rights Reserved.
* @version 1.1
* @author Sky_, TCSASSEMBLER
* changes in 1.1:
* 1. change handleError. Return sql error with unique constrains as Bad Request.
* 2. close db when request ends.
* 3. don't create trans... | }, function (result, cb) {
apiResult = result;
if (useGlobalDB) { |
<|file_name|>conf.py<|end_file_name|><|fim▁begin|>import sys
import os
extensions = [
'sphinx.ext.todo',
]
source_suffix = '.txt'
master_doc = 'index'
### part to update ###################################
project = u'domogik-plugin-daikcode'
copyright = u'2014, Nico0084'
version = '0.1'
release = version
#####... | pygments_style = 'sphinx' |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import configs.module
import wsgiref.simple_server
import select
import json
import bot
from urllib import parse
import irc.fullparse
import irc.splitparse
import os.path
def init(options):
m = configs.module.Module(__name__)
if 'ws... |
def timer():
for server in bot.servers(): |
<|file_name|>Orbit.cpp<|end_file_name|><|fim▁begin|>#include "Orbit.hpp"
#include <cmath>
Orbit::Orbit(ThreeVector startPosition, ThreeVector startVelocity, time_t startTime)
{
currentPosition = startPosition::DeepCopy();
currentVelocity = startVelocity::DeepCopy();
time_t = startTime;
}
float Orbit::EscapeVelo... | if (SpecificEnergy() >= 0)
{
// We have an infinite apoapsis height. Try to express that in a way the compiler understands.
#ifdef INFINITY |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.