prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>EndCompensationEvent.java<|end_file_name|><|fim▁begin|>/* * Copyright 2018 Red Hat, Inc. and/or its affiliates. * * 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 * * htt...
<|file_name|>ammoToDmgPattern.py<|end_file_name|><|fim▁begin|># noinspection PyPackageRequirements import wx import gui.globalEvents as GE import gui.mainFrame from gui.contextMenu import ContextMenuSingle from service.fit import Fit class AmmoToDmgPattern(ContextMenuSingle):<|fim▁hole|> def __init__(self): ...
visibilitySetting = 'ammoPattern'
<|file_name|>DescribeClusterResultJsonUnmarshaller.java<|end_file_name|><|fim▁begin|>/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the...
int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1;
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The syscall.rs Project Developers. See the // COPYRIGHT file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <L...
<|file_name|>common.py<|end_file_name|><|fim▁begin|>import logging from abc import ABCMeta, abstractmethod from collections import deque from typing import List, Union, Iterable, Sequence log = logging.getLogger(__name__) class NoSensorsFoundException(RuntimeError): pass class Controller(metaclass=ABCMeta): ...
raise NotImplementedError
<|file_name|>tdf006_ranges.py<|end_file_name|><|fim▁begin|>## \file ## \ingroup tutorial_tdataframe ## \notebook -nodraw ## This tutorial shows how to express the concept of ranges when working with the TDataFrame. ## \macro_code ## ## \date March 2017 ## \author Danilo Piparo import ROOT fill_tree_code = ''' void fi...
print(" - Entries from 15 onwards in steps of 3:", c_15_end_3.GetValue()) print(" - Entries from 0 to 50, odd only:", c_0_50_odd_b1.GetValue()) print(" - First three entries of all even entries:", c_0_3_after_even_b1.GetValue())
<|file_name|>log.py<|end_file_name|><|fim▁begin|>import logging, sys from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL class InfoFilter(logging.Filter): def filter(self, rec): return rec.levelno in (logging.DEBUG, logging.INFO) def _new_custom_logger(name='BiblioPixel', f...
logger.setLevel(logging.INFO) h1 = logging.StreamHandler(sys.stdout)
<|file_name|>environment.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>// The build system defaults to the dev environment which uses `environment.ts`, but if you do // `ng build --env=prod` then `environment.prod.ts` will be used instead. // The list of which env maps to which file can be found in `.angular-cli.json`. ...
// The file contents for the current environment will overwrite these during build.
<|file_name|>parseXML.js<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2015-2016 Fraunhofer FOKUS * * Licensed under the Apache License, Version 2.0 (the "License");<|fim▁hole|> * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache...
<|file_name|>se_group.py<|end_file_name|><|fim▁begin|># GENERATED FILE - DO NOT EDIT THIS FILE UNLESS YOU ARE A WIZZARD #pylint: skip-file from heat.engine import properties from heat.engine import constraints from heat.engine import attributes from heat.common.i18n import _ from avi.heat.avi_resource import AviResour...
properties.Schema.NUMBER, _("(Introduced in: 18.1.2) Minimum required shared memory to apply any configuration. (Units: MB) (Default: 4)"), required=False,
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.conf.urls.defaults import patterns, url<|fim▁hole|>urlpatterns = patterns('', url('^json/get/$', 'django_notify.views.get_notifications', name='json_get', kwargs={}), url('^json/mark-read/$', 'django_notify.views.mark_read'...
<|file_name|>user-socket.routes.spec.ts<|end_file_name|><|fim▁begin|>import * as io from "socket.io-client"; import {UserSocketRoutes} from "./user-socket.routes"; import {SocketServer} from "../../../socketio/socket.server"; import {Server} from "../../../core/server"; import {UserComponent} from "../component/user.c...
<|file_name|>GameBoardUtil.js<|end_file_name|><|fim▁begin|>define(function(require) { var Checker = require("checkers/controller/Checker"), GameBoard = require("checkers/controller/GameBoard"), GameSpace = require("checkers/controller/GameSpace"); var instance = null; function ...
}
<|file_name|>genetic_searcher.py<|end_file_name|><|fim▁begin|>import logging import numpy as np from ray.tune.automl.search_policy import AutoMLSearcher logger = logging.getLogger(__name__) LOGGING_PREFIX = "[GENETIC SEARCH] " class GeneticSearch(AutoMLSearcher): """Implement the genetic search. Keep a col...
>>> gene1 = np.array([[0, 0, 1], [0, 1], [1, 0]]) >>> gene2 = np.array([[0, 1, 0], [1, 0], [0, 1]])
<|file_name|>new-post.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; export default Ember.Route.extend({ /** * Instance of the posts service. * * @property postsService * @type {Ember.Service} */ postsService: Ember.inject.service('posts'), /** * Instance of the t...
} });
<|file_name|>manifest.go<|end_file_name|><|fim▁begin|>package manifest import ( "encoding/json" "fmt" "log" "reflect" "regexp" "strconv" "strings" "github.com/fatih/color" "github.com/servehub/serve/manifest/processor" "github.com/servehub/utils" "github.com/servehub/utils/gabs" ) type Manifest struct { ...
for k, v := range mmap { out[k] = Manifest{v} }
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # testgdt documentation build configuration file, created by # sphinx-quickstart on Sun Feb 12 17:11:03 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values...
# -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples
<|file_name|>server.py<|end_file_name|><|fim▁begin|>import tornado.ioloop import tornado.web import socket import os import sys import time import signal # import datetime import h5py from datetime import datetime, date import tornado.httpserver from browserhandler import BrowseHandler from annotationhandler impor...
def print_status(self): Utility.print_msg ('.')
<|file_name|>app.module.js<|end_file_name|><|fim▁begin|>"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "obj...
AppModule = __decorate([ core_1.NgModule({ imports: [platform_browser_1.BrowserModule, app_routes_1.routing, forms_1.FormsModule, http_1.HttpModule, angular_datatables_module_1.DataTablesModule], declarations: [app_component_1.AppComponent, people_list_component_1.PeopleListComponent...
<|file_name|>issue-18501.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...
<|file_name|>label_break_value_illegal_uses.rs<|end_file_name|><|fim▁begin|>// Copyright 2018 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:/...
// These are forbidden occurrences of label-break-value fn labeled_unsafe() { unsafe 'b: {} //~ ERROR expected one of `extern`, `fn`, or `{`
<|file_name|>strutil.cc<|end_file_name|><|fim▁begin|>// Copyright 2015 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.org/lic...
return buf; }
<|file_name|>Accessor.js<|end_file_name|><|fim▁begin|>export default class ModelAccessor { constructor() { this.value = 10<|fim▁hole|> get highCount() { return this.value + 100 } set highCount(v) { this.value = v - 100 } get doubleHigh() { return this.highCount * 2 } incr() { this.value++ } }<|fim...
}
<|file_name|>xc_path8.py<|end_file_name|><|fim▁begin|>import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=8, path_list=[ [TestAction.create_vm, 'vm1', 'flag=ceph'], [TestAction.create_volume, 'volume1'...
attached:['volume1', 'volume2', 'volume3', 'clone@volume1', 'clone@volume2', 'clone@volume3'] Detached:[] Deleted:['vm1-snapshot1', 'volume1-snapshot1', 'volume2-snapshot1', 'volume3-snapshot1', 'vm1-snapshot5', 'vm2-snapshot9']
<|file_name|>test_execute.py<|end_file_name|><|fim▁begin|>import os import io import shutil import tempfile import unittest from functools import partial from pathlib import Path from nbformat import validate try: from unittest.mock import patch except ImportError: from mock import patch from .. import engi...
class TestBrokenNotebook1(unittest.TestCase): def setUp(self): self.test_dir = tempfile.mkdtemp()
<|file_name|>index.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>export * from './home';<|fim▁end|>
export * from './about'; export * from './no-content';
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate libc; use std::os::raw; use std::ffi::CString; use std::mem::{transmute, size_of}; use std::default::Default; #[link(name = "kleeRuntest")] extern {<|fim▁hole|> fn klee_make_symbolic(data: *mut raw::c_void, length: libc::size_t, name: *const raw::c_char...
<|file_name|>choice_30.test.py<|end_file_name|><|fim▁begin|><|fim▁hole|>""" output = """ """<|fim▁end|>
input = """ :- not b. b :- a, not a. a v c.
<|file_name|>json.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016 CERN. # # Zenodo is free software; you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2...
class RecordSchemaV1(common.CommonRecordSchemaV1): """Schema for records v1 in JSON."""
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># ----------------------------------------------------------------------------- # Karajlug.org # Copyright (C) 2010 Karajlug community # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public L...
search_fields = ("name", ) prepopulated_fields = {"slug": ("name",)}
<|file_name|>train_classifier.py<|end_file_name|><|fim▁begin|># Copyright 2021 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
import tensorflow as tf from tensorflow import keras from tensorflow.keras.preprocessing.image import ImageDataGenerator
<|file_name|>get_relatives.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python from phamerator import * from phamerator.phamerator_manage_db import * from phamerator.db_conf import db_conf import sys, getpass GeneID = sys.argv[1] password = getpass.getpass() db = raw_input('database: ') c = db_conf(username='root'...
print get_relatives(c, GeneID, alignmentType='both', clustalwThreshold=0.275, blastThreshold=0.0001)
<|file_name|>mainserver.py<|end_file_name|><|fim▁begin|>import os import pwd import grp import argparse import shutil from twisted.web import server, resource, static, script from twisted.internet import reactor from zope.interface import Interface, Attribute, implements from twisted.python.components impor...
root.putChild('api',api.Api())
<|file_name|>mock.go<|end_file_name|><|fim▁begin|>// // # Mock // // A series of testing aids. // package muta import ( "fmt" "io" "github.com/leeola/muta/mutil" ) // A streamer that creates files and contents, based on the Files // and Contents slices. // // TODO: Find a way to move this into the `muta/mtesting`...
<|file_name|>git.go<|end_file_name|><|fim▁begin|>// Package services provides Github Integration. package services import ( "encoding/json" ) // Git structs type User struct { Name string Email string Username string Display_name string } type GitRepository struct { Id ...
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>extern crate libc; pub mod job_control; pub mod signals; use libc::{c_int, pid_t, sighandler_t}; use std::io; use std::os::unix::io::RawFd; pub(crate) const PATH_SEPARATOR: &str = ":"; pub(crate) const O_CLOEXEC: usize = libc::O_CLOEXEC as usize; pub(crate) const SIG...
cvt(unsafe { libc::pipe(fds.as_mut_ptr()) })?; Ok((fds[0], fds[1]))
<|file_name|>SegmentTree.java<|end_file_name|><|fim▁begin|>import java.util.Scanner; public class SegmentTree { private static class Node { public int left, right; public long add, sum; public Node(int left, int right, long sum) { this.left = left; ...
updateHelp(0, p, r, delt);
<|file_name|>aarch64.rs<|end_file_name|><|fim▁begin|>//! AArch64-specific definitions for 64-bit linux-like values pub type c_char = u8; pub type wchar_t = u32; pub type nlink_t = u32; pub type blksize_t = i32; pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; pub con...
pub st_nlink: ::nlink_t,
<|file_name|>type.py<|end_file_name|><|fim▁begin|>import re import sjconfparts.exceptions class Error(sjconfparts.exceptions.Error): pass class ConversionError(Error): pass class ConversionList: """Custom list implementation, linked to the related Conf. Each modification of the list will auto-up...
for (key_to_test, value) in dict_source.items(): if key_to_test == key or regexp.match(key_to_test):
<|file_name|>tools.py<|end_file_name|><|fim▁begin|>#-*- coding: utf-8 -*- from django.core.exceptions import PermissionDenied def popup_status(request): return '_popup' in request.REQUEST or 'pop' in request.REQUEST def selectfolder_status(request): return 'select_folder' in request.REQUEST def popup_para...
check_files_read_permissions(request, f.files) check_folder_read_permissions(request, f.children.all())
<|file_name|>main.js<|end_file_name|><|fim▁begin|>/* * jQuery File Upload Plugin JS Example 8.9.1 * https://github.com/blueimp/jQuery-File-Upload * * Copyright 2010, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT */ /* global $, window */ $...
<|file_name|>problem-0003.rs<|end_file_name|><|fim▁begin|>extern crate rust; use rust::primes; /// Problem 3 /// /// The prime factors of 13195 are 5, 7, 13 and 29. /// /// What is the largest prime factor of the number 600851475143 ? fn main() { println!("Problem 3"); let num: u64 = 600851475143; let sq: u64 = (n...
<|file_name|>hello.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- def helloworld(): """<|fim▁hole|> Hello world routine ! """ print("Hello world!")<|fim▁end|>
<|file_name|>exclusive_conditions.py<|end_file_name|><|fim▁begin|># Copyright 2013-present Barefoot Networks, 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....
<|file_name|>Array.js<|end_file_name|><|fim▁begin|>/** The MIT License (MIT) Copyright (c) 2014 MyChannel-Apps.de 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, includi...
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>from django.forms import ModelForm,forms<|fim▁hole|> class PortaForm(ModelForm): class Meta: model = Porta fields = ('descricao',) class GrupoForm(ModelForm): class Meta: model = Grupo fields = ('descricao',)<|fim▁end|>
from django import forms from appPortas.models import * from django.forms.models import inlineformset_factory
<|file_name|>mdtra_resultDialog.cpp<|end_file_name|><|fim▁begin|>/*************************************************************************** * Copyright (C) 2011-2017 Alexander V. Popov. * * This file is part of Molecular Dynamics Trajectory * Reader & Analyzer (MDTRA) source code. * * MDTRA source code is free sof...
void MDTRA_ResultDialog :: exec_on_down_result_data_source( void )
<|file_name|>pin-needed-to-poll.rs<|end_file_name|><|fim▁begin|>use std::{ future::Future, pin::Pin, task::{Context, Poll}, }; struct Sleep; impl Future for Sleep {<|fim▁hole|> type Output = (); fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { Poll::Ready(()) ...
<|file_name|>set_nots.go<|end_file_name|><|fim▁begin|>package set import ( "fmt" "strings" ) // Provides a common set baseline for both threadsafe and non-ts Sets. type set struct { m map[interface{}]struct{} // struct{} doesn't take up space } // SetNonTS defines a non-thread safe set data structure. type SetNon...
} // IsEmpty reports whkrypton the Set is empty. func (s *set) IsEmpty() bool {
<|file_name|>srcgen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import sys import os import argparse parser = argparse.ArgumentParser() parser.add_argument('--input', dest='input', help='the input file') parser.add_argument('--output', dest='output', help='the output...
<|file_name|>base.cpp<|end_file_name|><|fim▁begin|>/***************************************************************************** * * This file is part of Mapnik (c++ mapping toolkit) * * Copyright (C) 2021 Artem Pavlenko * * This library is free software; you can redistribute it and/or * modify it under the ter...
}
<|file_name|>journal.go<|end_file_name|><|fim▁begin|>// Copyright 2011 The LevelDB-Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Taken from: https://code.google.com/p/leveldb-go/source/browse/leveldb/record/record.go?r=1d5ccb...
<|file_name|>mod.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/licenses/LI...
Ok(n) } }
<|file_name|>UnixProcessManager.java<|end_file_name|><|fim▁begin|>/******************************************************************************* * Copyright (c) 2012-2017 Codenvy, S.A. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public Lice...
private static final Field PID_FIELD; static {
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Copyright 2013-2015 ARM Limited # # 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 #...
parameters = [ Parameter('number_of_threads', kind=int,
<|file_name|>extension_fullscreen_apitest.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2013 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/extensions/extension_apitest.h" #include "chrome/br...
<|file_name|>threadmanager.rs<|end_file_name|><|fim▁begin|>// rustyVM - Java VM written in pure Rust // Copyright (c) 2013 Alexander Gessler // // 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 Softw...
assert_eq!(t.get_state(), TMS_AllNonDaemonsDead); } // TODO: test stopped-tid
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python import os from app import create_app, db from app.models import User, Role<|fim▁hole|> app = create_app(os.getenv('FLASK_CONFIG') or 'default') manager = Manager(app) migrate = Migrate(app, db) def make_shell_context(): return dict(app=app,...
from flask.ext.script import Manager, Shell from flask.ext.migrate import Migrate, MigrateCommand
<|file_name|>record_type.rs<|end_file_name|><|fim▁begin|>use crate::library; #[derive(PartialEq, Eq)] pub enum RecordType { /// Boxed record that use g_boxed_copy, g_boxed_free. /// Must have glib_get_type function AutoBoxed, /// Boxed record with custom copy/free functions Boxed, /// Reference...
if has_destroy && has_copy { has_free = true;
<|file_name|>apps.py<|end_file_name|><|fim▁begin|>from django.apps import AppConfig <|fim▁hole|> class ScrapperConfig(AppConfig): name = 'scrapper'<|fim▁end|>
<|file_name|>logger_setup.py<|end_file_name|><|fim▁begin|>''' logger_setup.py customizes the app's logging module. Each time an event is logged the logger checks the level of the event (eg. debug, warning, info...). If the event is above the approved threshold then it goes through. The handlers do the same thing; they ...
# Set the logging level app.logger.setLevel(app.config['LOG_LEVEL']) # Remove the stdout handler
<|file_name|>half_normal.py<|end_file_name|><|fim▁begin|># Copyright 2017 The TensorFlow Authors. 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.apach...
shape=shape, mean=0., stddev=1., dtype=self.dtype, seed=seed)
<|file_name|>register.service.js<|end_file_name|><|fim▁begin|>"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;<|fim▁hole|> return c >...
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
<|file_name|>filter_modules.py<|end_file_name|><|fim▁begin|>""" Query modules mapping functions to their query strings structured: module_name { query_string: function_for_query } """ from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function from __future__ i...
def getAllTrips_Date(uid, dys):
<|file_name|>issue-23304-2.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<|fim▁hole|>// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the...
// http://rust-lang.org/COPYRIGHT. //
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>"""nubrain URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatter...
from django.contrib import admin from nubrain.settings import BASE_URL, APP_NAME from django.views.generic import RedirectView from django.utils.translation import ugettext_lazy
<|file_name|>grid.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/. */ //! CSS handling for the computed value of //! [grids](https://d...
let vec = mem::replace(&mut prev_names, vec![]); line_names.push(vec.into_boxed_slice()); values.push(TrackListValue::TrackSize(size.to_computed_value(context))); }
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from PIL import Image from maskgen import exif import numpy as np import PIL """ Save the image as PDF. If the image has a orientation and 'Image Rotated', rotate the image according to the EXIF. """ def transform(img,source,target, **kwargs): if 'resolution' i...
<|file_name|>test_weewx.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # (c) 2020-2021 Andreas Motl <andreas@getkotori.org> import logging import pytest import pytest_twisted from twisted.internet import threads from test.settings.mqttkit import settings, influx_sensors, PROCESS_DELAY_MQTT from test.util imp...
"windSpeed_kph": "3.95409343049", "forecastRule": "40.0", "windrun_km": "1.07449640224", "outHumidity": "90.0",
<|file_name|>StatsCollection.d.ts<|end_file_name|><|fim▁begin|>/** * Tracks a collection of stats. * * @constructor */ export declare class StatsCollection { private counters_; incrementCounter(name: string, amount?: number): void; get(): { [k: string]: number; };<|fim▁hole|>}<|fim▁end|>
<|file_name|>aixc++.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.aixc++ Tool-specific initialization for IBM xlC / Visual Age C++ compiler. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # __COPYRIGHT__ ...
# vim: set expandtab tabstop=4 shiftwidth=4:
<|file_name|>get_all_ship_fields.py<|end_file_name|><|fim▁begin|>__author__ = 'thorsteinn' def get_all_ship_fields(db): ships = db.keys() fields = [] for ship in ships: shipDB = db[ship] shipKeys = shipDB.keys() for oneKey in shipKeys:<|fim▁hole|> if oneKey not in fields:...
<|file_name|>mock_backend_spec.ts<|end_file_name|><|fim▁begin|>import {AsyncTestCompleter, afterEach, beforeEach, ddescribe, describe, expect, iit, inject, it, xit, SpyObject} from 'angular2/testing_internal'; import {ObservableWrapper} from 'angular2/src/facade/async'; import {BrowserXhr} from 'angular2/src/http/backe...
<|file_name|>boundaries.py<|end_file_name|><|fim▁begin|>""" OpenStreetMap boundary generator. Author: Andrzej Talarczyk <andrzej@talarczyk.com> Based on work of Michał Rogalski (Rogal). License: GPLv3. """ import os import platform import shutil def clean(src_dir):<|fim▁hole|> src_dir (string): path to the...
"""Remove target files. Args:
<|file_name|>bbolt.go<|end_file_name|><|fim▁begin|>package bolt import ( "context" "fmt" "os" "path/filepath" "time" platform "github.com/influxdata/influxdb/v2" platform2 "github.com/influxdata/influxdb/v2/kit/platform" "github.com/influxdata/influxdb/v2/rand" "github.com/influxdata/influxdb/v2/snowflake" ...
<|file_name|>x86register.rs<|end_file_name|><|fim▁begin|>use crate::error::*; use crate::il::Expression as Expr; use crate::il::*; use crate::translator::x86::mode::Mode; use falcon_capstone::capstone_sys::x86_reg; const X86REGISTERS: &[X86Register] = &[ X86Register { name: "ah", capstone_reg: x86_...
name: "r15d", capstone_reg: x86_reg::X86_REG_R15D, full_reg: x86_reg::X86_REG_R15, offset: 0,
<|file_name|>one_line_if_v2.rs<|end_file_name|><|fim▁begin|>// rustfmt-version: Two fn plain_if(x: bool) -> u8 { if x { 0 } else { 1 } } fn paren_if(x: bool) -> u8 { (if x { 0 } else { 1 }) } fn let_if(x: bool) -> u8 { let x = if x { foo() } else { bar() }; x } fn return_if(x: bool) -> u8 { retu...
} else { bar()
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.urls import path from . import views urlpatterns = [<|fim▁hole|> path('', views.events), ]<|fim▁end|>
<|file_name|>Schema.java<|end_file_name|><|fim▁begin|>// Copyright 2017 Yahoo Inc. // Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms. package com.yahoo.bard.webservice.table; import com.yahoo.bard.webservice.data.time.Granularity; import com.yahoo.bard.w...
<|file_name|>route.js<|end_file_name|><|fim▁begin|>import Ember from 'ember'; <|fim▁hole|> model(params) { return this.get('k8s').getService(params.name); } });<|fim▁end|>
export default Ember.Route.extend({ k8s: Ember.inject.service(),
<|file_name|>big64.js<|end_file_name|><|fim▁begin|>import test from 'ava'; import {big64, get64} from '../../src/index.js'; function macro(t, a, o, expected) { expected = get64(...expected); t.deepEqual(big64(a, o), expected); } macro.title = (providedTitle, a, o, expected) => `${providedTitle || ''} big64(${a}, ...
);
<|file_name|>toolTip.js<|end_file_name|><|fim▁begin|>/* See license.txt for terms of usage */ require.def("domplate/toolTip", [ "domplate/domplate", "core/lib", "core/trace" ], function(Domplate, Lib, Trace) { with (Domplate) { // **************************************************************************...
var body = Lib.getBody(document); this.element = this.tag.append({options: options}, body, this);
<|file_name|>geolocip.py<|end_file_name|><|fim▁begin|><|fim▁hole|># This file is part of weboob. # # weboob 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 version 3 of the License, or # (at your...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon #
<|file_name|>CacheRemoteImageAsyncJob.java<|end_file_name|><|fim▁begin|>package it.ninjatech.kvo.async.job; import it.ninjatech.kvo.model.ImageProvider; import it.ninjatech.kvo.util.Logger; import java.awt.Dimension; import java.awt.Image; import java.util.EnumSet; public class CacheRemoteImageAsyncJob exte...
}
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>mod arrays; mod strings; use self::strings::unescape; pub use self::{arrays::ArrayMethod, strings::StringMethod}; use super::Expander; use crate::{parser::lexers::ArgumentSplitter, types}; use thiserror::Error; #[derive(Debug, PartialEq, Clone)] pub enum Pattern<'a> {...
InvalidRegex(String, #[source] regex::Error), }
<|file_name|>copy-button.js<|end_file_name|><|fim▁begin|>!((document, $) => {<|fim▁hole|> clip.on('success', function(e) { $('.copied').show(); $('.copied').fadeOut(2000); }); })(document, jQuery);<|fim▁end|>
var clip = new Clipboard('.copy-button');
<|file_name|>graphicsRequestBroker.py<|end_file_name|><|fim▁begin|>#! /usr/bin/env python """ ############################################################################## ## ## ## @Name : graphicsRequestBroker.py ## ## ## @author : Nicholas Lemay ## ## @since : 2007-06-28, last updated on 2008-04-23 ## ## ## @...
querier = getQuerierLocation( form ) reply = "images=;error=" + "Error in query broker. Cannot proceed with query. %s is not a supported language." %language #Unsupported language, do not translate. returnToQueriersLocationWithReply( querier, reply )
<|file_name|>request.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::{consume_body, BodyOperations, BodyType}; u...
// https://fetch.spec.whatwg.org/#dom-body-json
<|file_name|>test.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/licenses/L...
<|file_name|>test_aspp.py<|end_file_name|><|fim▁begin|>import unittest import chainer from chainer import testing from chainer.testing import attr <|fim▁hole|> class TestSeparableASPP(unittest.TestCase): def setUp(self): self.in_channels = 128 self.out_channels = 32 self.link = SeparableAS...
from chainercv.links.model.deeplab import SeparableASPP
<|file_name|>views.py<|end_file_name|><|fim▁begin|>from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponseBadRequest, HttpResponse from bootcamp.tasks.models import Task from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from bootcamp.tasks.forms impor...
if vrf == 'True': data['vrf']="True" else:
<|file_name|>convert_weights_to_keras.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import from __future__ import division from __future__ import print_function import sys sys.path.insert(0,'..') import tensorflow as tf import numpy as np import itertools import pickle import os import re import in...
bn,cv,fn=result[:int((len(result)-1)/2)],result[int((len(result)-1)/2):],result[-1] res_zipped = zip(cv, bn)
<|file_name|>ManufacturingData.java<|end_file_name|><|fim▁begin|>package model.dataModels; /** * Class ManufacturingData. * @author Daniel * */ public class ManufacturingData { private String customerNumber; private String materialNumber; private String orderNumber; private String timeStamp; private Machine...
this.machineData = new MachineData[1]; machineData[0] = data; } else {
<|file_name|>test_cookies.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2017-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foun...
with open(cls.cookiefile, "w") as file: file.write("""# HTTP Cookie File .example.org\tTRUE\t/\tFALSE\t253402210800\tNAME\tVALUE """)
<|file_name|>presence.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" ?><!DOCTYPE TS><TS language="uk" sourcelanguage="en" version="2.0"> <context> <name>Presence</name> <message> <source>XMPP stream closed unexpectedly</source> <translation>XMPP-потік несподівано завершився</translation><|f...
</message> </context> <context> <name>PresenceManager</name>
<|file_name|>global_entry.rs<|end_file_name|><|fim▁begin|>use std::fmt::Debug; use crate::utils::*; use crate::wasm::*; #[derive(Debug)] pub struct GlobalEntry { content_type: DataTypes, mutable: bool, body: FunctionBody, } impl GlobalEntry { pub fn from<T: std::io::Read>(f: &mut T) -> Result<Self, Was...
<|file_name|>regions-fn-subtyping.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apach...
of::<&fn<'b>(&'b T)>()); //~ ERROR mismatched types subtype::<&fn<'a,'b>(&'a T, &'b T)>( of::<&fn<'a>(&'a T, &'a T)>());
<|file_name|>streamio-consumer.js<|end_file_name|><|fim▁begin|>var stream = require('getstream'); // Instantiate a new client (server side) client = stream.connect('9jtyb249ejzp', 'jnbe82eryq4qvquj4wn5dc8nh85bry33jpbmu84jn58xc3uk4y697xke4rcz9kyk', '24985'); // Instantiate a new client (client side) //client = stream.co...
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import include, url<|fim▁hole|>import accounts.urls from . import views urlpatterns = [ url(r'^$', views.HomePage.as_view(), name='home'), url(r'^about/$', views.AboutPage.as_view(), name='about'), url(r'^users/', include(profiles.urls...
from django.contrib import admin from django.conf import settings from django.conf.urls.static import static import profiles.urls
<|file_name|>cgroup_path.go<|end_file_name|><|fim▁begin|>package bundlerules import ( "path/filepath" <|fim▁hole|> "code.cloudfoundry.org/guardian/rundmc/goci" ) type CGroupPath struct { Path string } func (r CGroupPath) Apply(bndl goci.Bndl, spec spec.DesiredContainerSpec, _ string) (goci.Bndl, error) { if spec....
spec "code.cloudfoundry.org/guardian/gardener/container-spec"