prompt
large_stringlengths
70
991k
completion
large_stringlengths
0
1.02k
<|file_name|>opt_test.rs<|end_file_name|><|fim▁begin|><|fim▁hole|> pub fn f_value(i: int) -> int { i + 1 }<|fim▁end|>
pub fn f_borrowed(i: &int) -> int { *i + 1 }
<|file_name|>LinkedNotificationHub.java<|end_file_name|><|fim▁begin|>// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.communication.models; import com.azure.resourcemanager.comm...
/** * Gets the inner com.azure.resourcemanager.communication.fluent.models.LinkedNotificationHubInner object. *
<|file_name|>iframe.py<|end_file_name|><|fim▁begin|>import pytest from tests.support.asserts import assert_success """ Tests that WebDriver can transcend site origins. Many modern browsers impose strict cross-origin checks, and WebDriver should be able to transcend these. Although an implementation detail, certain...
response = get_title(session) assert_success(response, "foo")
<|file_name|>drtbldls.cc<|end_file_name|><|fim▁begin|>/* * * Copyright (C) 2008-2012, OFFIS e.V. and ICSMED AG, Oldenburg, Germany * Copyright (C) 2013-2015, J. Riesmeier, Oldenburg, Germany * All rights reserved. See COPYRIGHT file for details. * * Source file for class DRTBeamLimitingDeviceLeafPairsSequenc...
item = new Item(); if (item != NULL) {
<|file_name|>change_healthcare_desktop_icons.py<|end_file_name|><|fim▁begin|>import frappe from frappe import _ change_icons_map = [ { "module_name": "Patient", "color": "#6BE273", "icon": "fa fa-user", "doctype": "Patient", "type": "link", "link": "List/Patient", "label": _("Patient") }, { "module_...
<|file_name|>IPUtils.java<|end_file_name|><|fim▁begin|>/** * 项目名: java-code-tutorials-tools * 包名: net.fantesy84.common.util * 文件名: IPUtils.java * Copy Right © 2015 Andronicus Ge * 时间: 2015年11月9日 */ package net.fantesy84.common.util; import java.net.InetAddress; import java.net.UnknownHostException; import javax...
<|file_name|>metric_test.js<|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 unde...
describe("#getActiveWidgetLayout() for Enhanced Dashboard", function () {
<|file_name|>actiongroup.py<|end_file_name|><|fim▁begin|># # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2015 Nick Hall # # 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;...
self.fix_icon_name(action_list) def add_toggle_actions(self, action_list, **kwargs):
<|file_name|>eventQueueThread.cpp<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
#include "EventQueueThread.h"
<|file_name|>bloomFilter.cpp<|end_file_name|><|fim▁begin|>/* This file is part of cpp-ethereum. cpp-ethereum 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) an...
<|file_name|>jquery-css-dimensions-effects-offset-wrap.js<|end_file_name|><|fim▁begin|>/*! * jQuery JavaScript Library v1.10.2 -wrap,-css,-effects,-offset,-dimensions * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Rele...
<|file_name|>styles.060d376bf8bba46c929d.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|>
webpackJsonp([2,3],[function(n,c){}]);
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by...
from ._models_py3 import KeyValue from ._models_py3 import KeyValueListResult from ._models_py3 import Label
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|><|fim▁hole|>""" Created on 05 Apr 2014 3:30 AM @author: <'Ronny Eichler'> ronny.eichler@gmail.com UI """<|fim▁end|>
# -*- coding: utf-8 -*-
<|file_name|>PersistenceStrategy.py<|end_file_name|><|fim▁begin|>import copy import logging from strategy import Strategy logging.basicConfig(level=logging.INFO) LOG = logging.getLogger(__name__) class PersistenceStrategy(Strategy): def __init__(self, strategy): self.__dict__ = copy.deepcopy(strategy._...
<|file_name|>gen_models.py<|end_file_name|><|fim▁begin|>import csv def model_name(table_name): if table_name in [ 'vtm', 'vpi', 'vmp', 'vmpp', 'amp', 'ampp', 'gtin', ]: return table_name.upper() else: return ''.join(tok.title() for to...
for line in lines: if line['table'] == 'ccontent':
<|file_name|>Protocol_Manager.cpp<|end_file_name|><|fim▁begin|>#include "ace/config-all.h" #include "ace/Log_Msg.h" #include "ace/OS_Memory.h" #include "ace/OS_NS_string.h" #include "Options.h" #include "Protocol_Manager.h" // Returns a pointer to the Drwho_Node associated with HOST_NAME (if // it exists, otherwise a...
{
<|file_name|>OffsetableBranch.cpp<|end_file_name|><|fim▁begin|>/* Craft Compiler v0.1.0 - The standard compiler for the Craft programming language. Copyright (C) 2016 Daniel McCarthy This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licen...
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
<|file_name|>actual.js<|end_file_name|><|fim▁begin|><|fim▁hole|> for (var key in object) { await key; } }<|fim▁end|>
async function test(object) {
<|file_name|>wrapper_head_tail.py<|end_file_name|><|fim▁begin|>import sys import petsc4py petsc4py.init(sys.argv) from ecoli_in_pipe import head_tail # import numpy as np # from scipy.interpolate import interp1d # from petsc4py import PETSc # from ecoli_in_pipe import single_ecoli, ecoliInPipe, head_tail, ecoli_U # f...
head_tail.main_fun()
<|file_name|>pluginmanager.py<|end_file_name|><|fim▁begin|>from havocbot.common import catch_exceptions from havocbot.plugin import HavocBotPlugin import imp import logging import os logger = logging.getLogger(__name__) class StatefulPlugin: def __init__(self, havocbot, name, path): self.path = path ...
for plugin in havocbot.plugins_custom: # Unregister the triggers set for the plugin havocbot.unregister_triggers(plugin.handler.plugin_triggers)
<|file_name|>CSEntityUtil.java<|end_file_name|><|fim▁begin|>/** * This file is part of d:swarm graph extension. * * d:swarm graph extension is free software: you can redistribute it and/or modify<|fim▁hole|> * (at your option) any later version. * * d:swarm graph extension is distributed in the hope that it will b...
* it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or
<|file_name|>_config.js<|end_file_name|><|fim▁begin|>module.exports = { description: 'deconflict entry points with the same name in different directories', command:<|fim▁hole|><|fim▁end|>
'rollup --input main.js --input sub/main.js --format esm --dir _actual --experimentalCodeSplitting' };
<|file_name|>bgp_ip_test2.cc<|end_file_name|><|fim▁begin|>/* * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. */ #define __BGP_IP_TEST_WRAPPER_TEST_SUITE__ #include "bgp_ip_test.cc" int main(int argc, char **argv) { const char *largv[] = { __FILE__, "--nexthop-address-family=inet6...
<|file_name|>services.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from users import models as m # write your business logic here<|fim▁end|>
# coding: utf-8
<|file_name|>promise.py<|end_file_name|><|fim▁begin|># -*- test-case-name: twisted.pb.test.test_promise -*- from twisted.python import util, failure from twisted.internet import defer id = util.unsignedID EVENTUAL, FULFILLED, BROKEN = range(3) class Promise: """I am a promise of a future result. I am a lot like...
def __init__(self, d): self._watchers = [] self._pendingMethods = []
<|file_name|>google_app_setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-<|fim▁hole|># For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class GoogleAppSetup(Document): pass<|fim▁end|>
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
<|file_name|>utils_tests_helper.py<|end_file_name|><|fim▁begin|>""" @file @brief This extension contains various functionalities to help unittesting. """ import os import stat import sys import re import warnings import time import importlib from contextlib import redirect_stdout, redirect_stderr from io import StringI...
<|file_name|>slim.py<|end_file_name|><|fim▁begin|># Copyright 2016 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/licenses/LICENSE-...
# ============================================================================== """TF-Slim grouped API. Please see README.md for details and usage.""" # pylint: disable=unused-import
<|file_name|>partner.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribut...
<|file_name|>DataLinks.test.tsx<|end_file_name|><|fim▁begin|>import React from 'react'; import { mount } from 'enzyme'; import { DataLinks } from './DataLinks'; import { Button } from '@grafana/ui'; import { DataLink } from './DataLink'; import { act } from 'react-dom/test-utils'; describe('DataLinks', () => { let o...
// @ts-ignore we shouldn't use Promises in act => the "void | undefined" is here to forbid any sneaky "Promise" returns. async () => { wrapper = await mount(<DataLinks onChange={() => {}} />); }
<|file_name|>i18n.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<|fim▁hole|># # Unless required by applicable law or agreed to in writing, software # distributed under the Lic...
# a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>app.py<|end_file_name|><|fim▁begin|>#encoding:utf-8 subreddit = 'comedynecrophilia' t_channel = '@comedynecrophilia' <|fim▁hole|><|fim▁end|>
def send_post(submission, r2t): return r2t.send_simple(submission)
<|file_name|>elasticsearch_service.py<|end_file_name|><|fim▁begin|># Copyright 2015 Netflix, 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...
arn=arn, new_config=config)
<|file_name|>home.js<|end_file_name|><|fim▁begin|>define(function() { var ctor = function () { }; //Note: This module exports a function. That means that you, the developer, can create multiple instances. //This pattern is also recognized by Durandal so that it can create instances on demand. //If y...
return ctor; });
<|file_name|>gen.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python import json from random import randint INPUT = "Tweet.size1000page1cnt849.json" OUTPUT = 'new.json' objs = json.load(open(INPUT,'r')) print len(objs) # for k,v in objs[0].items(): # print "%s=\n\t%s | " % (str(k),str(v))<|fim▁hole|> se = [] for...
def date_handler(obj): import datetime return obj.strftime("%Y-%m-%d %H:%M:%S") if isinstance(obj,datetime.datetime) else obj
<|file_name|>settings.py<|end_file_name|><|fim▁begin|><|fim▁hole|>BASE_DIR = os.path.dirname(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django_mongodb_engine', ...
# Django settings for flexy project. import os
<|file_name|>repeated_timer.py<|end_file_name|><|fim▁begin|>from threading import Timer class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function self.args = args s...
<|file_name|>OrgLDIF.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # Copyright 2004-2020 University of Oslo, Norway # # This file is part of Cerebrum. # # Cerebrum 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 Softwa...
self.id2labeledURI = contacts[-1][1]
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """The application's model objects""" from zope.sqlalchemy import ZopeTransactionExtension from sqlalchemy.orm import scoped_session, sessionmaker # from sqlalchemy import MetaData from sqlalchemy.ext.declarative import declarative_base # Gl...
<|file_name|>test_county_bulk.py<|end_file_name|><|fim▁begin|># coding: utf-8 """ Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. ## Getting Started Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an...
```
<|file_name|>links.py<|end_file_name|><|fim▁begin|>import os from os import path import sqlite3 from .link import Link class Links(object): def __init__(self): self._links = {}<|fim▁hole|> def add(self, link): self._links[link.url] = link def find_by_tag(self, tag): return [link f...
<|file_name|>create.js<|end_file_name|><|fim▁begin|>/* -------------------------------------------------------------------------- */ /* Copyright 2002-2017, OpenNebula Project, OpenNebula Systems */ /* */ /* Licensed under the Apa...
*/
<|file_name|>resource_container_cluster_test.go<|end_file_name|><|fim▁begin|>package google import ( "fmt" "testing" "strconv" "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func TestAccContainerCluster_basic(t *tes...
})
<|file_name|>sar_grapher.py<|end_file_name|><|fim▁begin|>import hashlib import matplotlib # Force matplotlib to not use any Xwindows backend. matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.dates as mdates import matplotlib.colors as colors import matplotlib.cm as cm from matplotlib.patches impo...
# We want the legends box roughly square shaped # and not take up too much room props = matplotlib.font_manager.FontProperties(size='xx-small') if len(datanames) < LEGEND_THRESHOLD:
<|file_name|>receipt-outlined.js<|end_file_name|><|fim▁begin|>import { h } from 'omi'; import createSvgIcon from './utils/createSvgIcon'; export default createSvgIcon(h("path", {<|fim▁hole|><|fim▁end|>
d: "M19.5 3.5L18 2l-1.5 1.5L15 2l-1.5 1.5L12 2l-1.5 1.5L9 2 7.5 3.5 6 2 4.5 3.5 3 2v20l1.5-1.5L6 22l1.5-1.5L9 22l1.5-1.5L12 22l1.5-1.5L15 22l1.5-1.5L18 22l1.5-1.5L21 22V2l-1.5 1.5zM19 19.09H5V4.91h14v14.18zM6 15h12v2H6zm0-4h12v2H6zm0-4h12v2H6z" }), 'ReceiptOutlined');
<|file_name|>htmlbodyelement.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 dom::attr::Attr; use dom::bi...
/// How long we should wait before performing the initial reflow after `<body>` is parsed, in /// nanoseconds. const INITIAL_REFLOW_DELAY: u64 = 200_000_000;
<|file_name|>get_info.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # coding=utf-8 from mcurl.utils import monkey_patch import zmq.green as zmq import sys import json __author__ = 'chenfengyuan' monkey_patch.dummy() def client(port): host = '127.0.0.1' context = zmq.Context() socket = context.so...
message = socket.recv() socket.close() data = json.loads(message.decode('utf-8')) """:type: list"""
<|file_name|>test_mongo.py<|end_file_name|><|fim▁begin|># Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
check_update({"$set": {"b": {"0": {"c": 100}}}})
<|file_name|>test_telnet_default_creds.py<|end_file_name|><|fim▁begin|>from routersploit.modules.creds.cameras.acti.telnet_default_creds import Exploit def test_check_success(generic_target): """ Test scenario - testing against Telnet server """ exploit = Exploit() <|fim▁hole|> assert exploit.stop_on_succ...
assert exploit.target == "" assert exploit.port == 23 assert exploit.threads == 1 assert exploit.defaults == ["admin:12345", "admin:123456", "Admin:12345", "Admin:123456"]
<|file_name|>thermodynamics.py<|end_file_name|><|fim▁begin|>"""Basic thermodynamic calculations for pickaxe.""" from typing import Union import pint from equilibrator_api import ( Q_, ComponentContribution, Reaction, default_physiological_ionic_strength, default_physiological_p_h, default_phys...
pickaxe : Pickaxe pickaxe object to look for the compound in, by default None. db_name : str
<|file_name|>mlnxos_module.py<|end_file_name|><|fim▁begin|># (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible 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, ...
fixture_data = {}
<|file_name|>local.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals <|fim▁hole|>from .base import * GI_APPLICATION = u'wsgi.local.application'<|fim▁end|>
<|file_name|>showspec.py<|end_file_name|><|fim▁begin|>""" showspec is my homegrown spectrum plotter, meant to somewhat follow STARLINK's SPLAT and have functionality similar to GAIA, but with an emphasis on producing publication-quality plots (which, while splat may do, it does unreproducibly) .. todo:: -add spec...
else: self.guesses = [height,1,0,1] mpp,model,mpperr,chi2 = gaussfitter.onedgaussfit( self.specplotter.vind[self.gx1:self.gx2], self.spectofit[self.gx1:self.gx2],
<|file_name|>thermo.py<|end_file_name|><|fim▁begin|>import scipy.integrate as intg import numpy as np #Physical Constants #Everything is in MKS units #Planck constant [J/s] h = 6.6261e-34 #Boltzmann constant [J/K] kB = 1.3806e-23 #Speed of light [m/s] c = 299792458.0 #Pi PI = 3.14159265 #Vacuum Permitivity eps0 = 8.85...
return 1.0 - np.exp((-2*PI*index*lossTan*thickness)/lamb(freq/GHz))
<|file_name|>manifests_test.go<|end_file_name|><|fim▁begin|>/* Copyright 2016 The Kubernetes 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 ...
<|file_name|>input_layers.rs<|end_file_name|><|fim▁begin|>use std::borrow::Cow; use std::fmt; use std::io::BufRead; use std::result; use enum_map::{Enum, EnumMap}; use failure::Error; use tensorflow::Tensor; use crate::features::addr; use crate::features::lookup::LookupResult; use crate::features::parse_addr::parse_a...
lookup_layers[layer] = vec![0; size];
<|file_name|>pilfont.py<|end_file_name|><|fim▁begin|>#!/home/firlism/tools/css_platform/sleepyenv/bin/python # EASY-INSTALL-SCRIPT: 'Pillow==2.8.2','pilfont.py' __requires__ = 'Pillow==2.8.2'<|fim▁hole|>__import__('pkg_resources').run_script('Pillow==2.8.2', 'pilfont.py')<|fim▁end|>
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _index = require('../../../_lib/setUTCDay/index.js'); var _index2 = _interopRequireDefault(_index); var _index3 = require('../../../_lib/setUTCISODay/index.js'); var _index4 = _inte...
isoWeek: {
<|file_name|>playlist.component.spec.ts<|end_file_name|><|fim▁begin|>import { async, ComponentFixture, TestBed } from '@angular/core/testing';<|fim▁hole|> import { PlaylistComponent } from './playlist.component'; describe('PlaylistComponent', () => { let component: PlaylistComponent; let fixture: ComponentFixture<...
<|file_name|>slug.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- from django.utils import baseconv from django.template.defaultfilters import slugify import time def slugify_uniquely(value, model, slugfield="slug"):<|fim▁hole|> suffix = 0 potential = base = slugify(value) if len(potential) == 0:...
""" Returns a slug on a name which is unique within a model's table """
<|file_name|>client_request_source.go<|end_file_name|><|fim▁begin|><|fim▁hole|>type ClientRequestSource interface { Get() (<-chan *ClientRequest, error) }<|fim▁end|>
package main // ClientRequestSource is an interface which returns a channel across which will // be sent a feed of ClientRequests which may then be sent to a server.
<|file_name|>minimal.cpp<|end_file_name|><|fim▁begin|>#if USE_SDL_BACKEND<|fim▁hole|> #include <GG/StyleFactory.h> #include <GG/dialogs/ThreeButtonDlg.h> #include <GG/dialogs/FileDlg.h> #include <iostream> // Tutorial 1: Minimal // This contains the minimal interesting GG application. It contains 3D as // well as G...
#include "../test/SDLBackend.h" #else #include "../test/OgreBackend.h" #endif
<|file_name|>basis_forms.py<|end_file_name|><|fim▁begin|>from dec.grid1 import * import matplotlib.pyplot as plt N = 4 #g = Grid_1D.periodic(N) g = Grid_1D.regular(N) #g = Grid_1D.chebyshev(N)<|fim▁hole|> z = linspace(g.xmin, g.xmax, 100) #+ 1e-16 B0, B1, B0d, B1d = g.basis_fn() H0, H1, H0d, H1d = hodge_star_matrix(g....
<|file_name|>input-v5.js<|end_file_name|><|fim▁begin|>(function($) { function ACFTableField() { var t = this; t.version = '1.3.4'; t.param = {}; // DIFFERENT IN ACF VERSION 4 and 5 { t.param.classes = { btn_small: 'acf-icon small', // "acf-icon-plus" becomes "-plus" since ACF Pro Version 5.3...
ui.children().each( function() { var that = $( this );
<|file_name|>kendo.culture.ms-BN.js<|end_file_name|><|fim▁begin|>/* * Kendo UI v2014.2.1008 (http://www.telerik.com/kendo-ui) * Copyright 2014 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete * If you do not own a ...
symbol: "%" }, currency: { pattern: ["($n)","$n"],
<|file_name|>models.py<|end_file_name|><|fim▁begin|>__author__ = 'oskyar' from django.db import models from django.utils.translation import ugettext as _ from s3direct.fields import S3DirectField from smart_selects.db_fields import ChainedManyToManyField # Manager de Asignatura class SubjectManager(models.Manager): ...
<|file_name|>match_expr.rs<|end_file_name|><|fim▁begin|>fn test() <fold text='{...}'>{ match 1 <fold text='{...}'>{<|fim▁hole|><|fim▁end|>
_ => println!("Hello!") }</fold>; }</fold>
<|file_name|>syscall.cpp<|end_file_name|><|fim▁begin|>/* * syscall.cpp * * Created on: Jun 3, 2017 * Author: warlo */ #include "syscall.hpp" #include <diag\Trace.h> namespace os {<|fim▁hole|> __asm__ __volatile__ ( " sub sp, sp, #16\n" /* Create a stack frame to hold 3 parms + lr */ "...
#if 0 static void dispatch_syscall(void) naked_function; static void dispatch_syscall(void) {
<|file_name|>alarm-summary.js<|end_file_name|><|fim▁begin|>/** Create by Huy: codocmm@gmail.com ~ nqhuy2k6@gmail.com 07/31/2015 */ define(["durandal/app", "knockout", "bootstrap", "viewmodels/component-4"], function (app, ko, bootstrap, Component4) { return function () { var me = this; var dashbo...
dashboardViewModel.compoment4 = ko.observable(); dashboardViewModel.activate = function () { me.compoment4(new Component4(0)) }
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls.defaults import * import frontend.views as frontend_views import codewiki.views import codewiki.viewsuml from django.contrib.syndication.views import feed as feed_view from django.views.generic import date_based, list_detail from django...
url(r'^accounts/', include('registration.urls')), url(r'^accounts/resend_activation_email/', frontend_views.resend_activation_email, name="resend_activation_email"), url(r'^captcha/', include('captcha.urls')), url(r'^attachauth', codewiki.views.attachauth),
<|file_name|>frame.js<|end_file_name|><|fim▁begin|>import * as React from 'react'; import {Items,Item,Row,Col,Table,Code} from 'yrui'; let thead=[{ key:'key', value:'参数', },{ key:'expr', value:'说明', },{ key:'type', value:'类型', },{ key:'values', value:'可选值', },{ key:'default', value:'默认值', }]; // l...
expr:'标题', type:'string', values:'-', default:'-',
<|file_name|>directory.rs<|end_file_name|><|fim▁begin|>//! The directory displays all the available settings and lets users change them //! from within the configurator. use cursive::Cursive; use cursive::views::{Dialog, TextView, EditView, ListView, BoxView, LinearLayout, SelectView}; use super::*; /// Draws the gl...
<|file_name|>errorevent.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::ErrorEventBinding; u...
fn Lineno(self) -> u32 { self.lineno.get()
<|file_name|>data.py<|end_file_name|><|fim▁begin|>import collections import yaml import netCDF4 import numpy as np from pyresample import geometry from pyresample import kd_tree from pyresample import utils from pyresample import grid from satistjenesten.utils import get_area_filepath class GenericScene(object): ...
valid_input_index, valid_output_index, index_array, distance_array = \
<|file_name|>user.js<|end_file_name|><|fim▁begin|>/** * index.js * * The purpose of this module is to provide user model classes * corresponding to DTOs used by the GoomY API. * * Created on: 2015-12-05 * * Author: Eléonore d'Agostino (paranoodle) * Author: Karim Ghozlani (gweezer7) * Author: Yassin Kammoun (...
this.id = id;
<|file_name|>raw_gradients.py<|end_file_name|><|fim▁begin|>import numpy as np def analytical_gradients(network, X, Y): print("Calculating analytical gradients...") print("Forward pass:", end=" ") preds = network.predict(X) print("done! Backward pass:", end=" ") delta = network.cost.derivative(pred...
<|file_name|>Page.py<|end_file_name|><|fim▁begin|>from PyQt4 import QtCore, QtGui <|fim▁hole|> super(Page, self).__init__(parent) self.setAcceptDrops(True) self.pihud = pihud # normally, this would simply be the parent() self.widgets = [] self.show() def dragEnterEvent(self...
class Page(QtGui.QWidget): """ A container and dropevent catcher for widgets """ def __init__(self, parent, pihud):
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function () { "use strict"; //angular.module('app', ['angularUtils.directives.dirPagination']); var env = {}; <|fim▁hole|> if (window) { Object.assign(env, window.__env); } var app = angular.module("deviceManagement", ...
<|file_name|>unbuild.js<|end_file_name|><|fim▁begin|>module.exports = unbuild unbuild.usage = "npm unbuild <folder>\n(this is plumbing)" var readJson = require("read-package-json") , rm = require("./utils/gently-rm.js") , gentlyRm = require("./utils/gently-rm.js") , npm = require("./npm.js") , path = require("...
|| process.platform === "win32" || !npm.config.get("global")) {
<|file_name|>os_port.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify<|fim▁hole|># it under the terms of the GNU General Public License as published by # the Free Software Foundation,...
<|file_name|>home.service.js<|end_file_name|><|fim▁begin|><|fim▁hole|> loadSettings: loadSettings, }; return service; function send(msg, data) { console.log(msg, data); //$rootScope.$broadcast(msg, data); } function loadSettings() { return $http({ method: ...
export default function HomeService($rootScope, $window, $http) { var service = { send: send,
<|file_name|>EnumDye.java<|end_file_name|><|fim▁begin|>package com.outlookphone.quaritum.flora; public enum EnumDye { Common(0), CommonArcane(1), Arcane(2); private int data; /** * @return the data value */ public int getData() { return data; }<|fim▁hole|> EnumDye(int data) { this.data = data; } }<|f...
<|file_name|>IItemDestination.java<|end_file_name|><|fim▁begin|>package yuuto.quantumelectronics.transport.routing;<|fim▁hole|> public interface IItemDestination extends IItemRouter{ ItemStack insertItem(ItemStack stack, boolean simulate, boolean supplier); boolean isSupplier(); }<|fim▁end|>
import net.minecraft.item.ItemStack;
<|file_name|>f7888bd46c75_add_hikes.py<|end_file_name|><|fim▁begin|>"""add-hikes Revision ID: f7888bd46c75 Revises: 820bb005f2c5 Create Date: 2017-02-16 07:36:06.108806 """ # revision identifiers, used by Alembic. revision = 'f7888bd46c75' down_revision = 'fc92ba2ffd7f'<|fim▁hole|>import geoalchemy2 def upgrade():...
from alembic import op import sqlalchemy as sa
<|file_name|>Menu.tsx<|end_file_name|><|fim▁begin|>import styled from "@emotion/styled"; import React from "react"; import { MENU_Z_INDEX } from "../shared/constants"; import { headerItems } from "../shared/headerItems"; import { socialLinks } from "../shared/socialLinks";<|fim▁hole|> export const Menu = React.memo<Pro...
interface Props { show: boolean; }
<|file_name|>value.go<|end_file_name|><|fim▁begin|>// Copyright The OpenTelemetry 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-...
INVALID Type = iota // BOOL is a boolean Type Value. BOOL // INT64 is a 64-bit signed integral Type Value.
<|file_name|>test.rs<|end_file_name|><|fim▁begin|>use generate; use grammar::repr::*; use lr1::core::*; use lr1::interpret::interpret; use lr1::lookahead::Token; use lr1::lookahead::Token::EOF; use lr1::lookahead::TokenSet; use lr1::tls::Lr1Tls; use string_cache::DefaultAtom as Atom; use test_util::{compare, expect_deb...
<|file_name|>bitbox02.py<|end_file_name|><|fim▁begin|># # BitBox02 Electrum plugin code. # import hid from typing import TYPE_CHECKING, Dict, Tuple, Optional, List, Any, Callable from electrum_grs import bip32, constants from electrum_grs.i18n import _ from electrum_grs.keystore import Hardware_KeyStore from electrum...
bitbox02.BTCOutputInternal( keypath=change_pubkey_path, value=txout.value, script_config_index=0,
<|file_name|>simple_form_widget.cpp<|end_file_name|><|fim▁begin|>#include "simple_form_widget.h"<|fim▁hole|> QWidget(parent), ui(new Ui::SimpleFormWidget) { ui->setupUi(this); } SimpleFormWidget::~SimpleFormWidget() { delete ui; }<|fim▁end|>
#include "ui_simple_form_widget.h" SimpleFormWidget::SimpleFormWidget(QWidget *parent) :
<|file_name|>TestUdpConnection.java<|end_file_name|><|fim▁begin|>/* $Id$ * * 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 ...
/** */ public FlexBuffer xbuf;
<|file_name|>oscurart_animation.py<|end_file_name|><|fim▁begin|># ##### BEGIN GPL LICENSE BLOCK ##### # # 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 2 # of the License, or ...
a.invert()
<|file_name|>PsiParameterStorageRunnable.java<|end_file_name|><|fim▁begin|>package de.espend.idea.shopware.util.dict; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiFile; import com.intellij.psi.PsiManager; import...
import java.util.Map; import java.util.Set;
<|file_name|>condition_evals_to_constant.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from unknown import Unknown # pylint: disable=import-error def func(_): """Pointless function""" CONSTANT = 100 OTHER = 200 # Simplifies any boolean expression that is coerced into a True/False value bool(CONSTANT or True) #...
"""Test that boolean conditions simplify to a constant value""" # pylint: disable=pointless-statement
<|file_name|>uobjnew.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # uobjnew Summarize object allocations in high-level languages. # For Linux, uses BCC, eBPF. # # USAGE: uobjnew [-h] [-T TOP] [-v] {java,ruby,c} pid [interval] # # Copyright 2016 Sasha Goldsht...
if args.top_count: data = sorted(data.items(), key=lambda (k, v): v.num_allocs)
<|file_name|>harbor_api.go<|end_file_name|><|fim▁begin|>package docker_registry import ( "context" "net/http" neturl "net/url" "path" ) type harborApi struct{} func newHarborApi() harborApi {<|fim▁hole|>func (api *harborApi) DeleteRepository(ctx context.Context, hostname, repository, username, password string) (...
return harborApi{} }
<|file_name|>getchangedsrc.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- """ Created on Mon Oct 3 02:10:23 2011 @author: IxxI @version: v1.0<|fim▁hole|> import sys import logging from optparse import OptionParser from commands import Commands, CLIENT, SERVER from mcp import getchangedsrc_side def main():...
"""
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # 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|># # Unless requi...
# # http://www.apache.org/licenses/LICENSE-2.0
<|file_name|>lemmatizer.py<|end_file_name|><|fim▁begin|># coding: utf8 from __future__ import unicode_literals # Adding a lemmatizer lookup table # Documentation: https://spacy.io/docs/usage/adding-languages#lemmatizer # Entries should be added in the following format: LOOKUP = { "آ": "آنا", "آْباد": "آْباد", ...
"ہفتیں": "ہفت",
<|file_name|>pixels.rs<|end_file_name|><|fim▁begin|>extern crate rand; use num::FromPrimitive; use sys::pixels as ll; use get_error; pub struct Palette { raw: *mut ll::SDL_Palette } impl Palette { #[inline] /// Creates a new, uninitialized palette pub fn new(mut capacity: usize) -> Result<Self, Str...
&Color::RGBA(r, g, b, a) => (r, g, b, a), } }