prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>deprecated.go<|end_file_name|><|fim▁begin|>package nova
import (
"fmt"
"net/http"
"gopkg.in/goose.v2/client"
"gopkg.in/goose.v2/errors"
goosehttp "gopkg.in/goose.v2/http"
)
// The following API requests found in this file are officially deprecated by
// the upstream openstack project.
// The API re... | ToPort int `json:"to_port"`
|
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
# Create your models here.
class Tipo_Vehiculo(models.Model):
"""docstring for Tipo_Vehiculo"""
def __init__(self, *args, **kwargs):
super(Tipo_Vehiculo, self).__init__(*args, **kwargs)
tipo_vehiculo = models.CharFiel... | class Meta: |
<|file_name|>parser.rs<|end_file_name|><|fim▁begin|>use lexer::{Keyword, Lexer, Pos, Symbol, Token, TokenKind};
use node::{ASTKind, Bits, AST};
use node;
use types::{Sign, StorageClass, Type};
use std::str;
use std::boxed::Box;
use std::io::{stderr, Write};
use std::collections::{hash_map, HashMap, VecDeque};
// use ... | |
<|file_name|>PostCategory.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import {ManyToMany} from "../../../src/decorator/relations/ManyToMany";
import {AfterRemove} from "../../../src/decorator/listeners/AfterRemove";
import {BeforeRemove} from "../../../src/decorator/listeners/BeforeRemove";
import {AfterUpdate} from ".... | import {PrimaryGeneratedColumn, Column, Entity} from "../../../src/index";
import {Post} from "./Post"; |
<|file_name|>get_test.go<|end_file_name|><|fim▁begin|>package zfs_test
import (
"fmt"<|fim▁hole|>
"github.com/cerana/cerana/acomm"
zfsp "github.com/cerana/cerana/providers/zfs"
)
func (s *zfs) TestGet() {
tests := []struct {
args *zfsp.CommonArgs
err string
}{
{&zfsp.CommonArgs{Name: ""}, "missing arg: na... | "path/filepath" |
<|file_name|>middlewares.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# (c) 2018 Alberto Planas <aplanas@gmail.com>
#
# This file is part of KManga.
#
# KManga 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 ... |
def _valid_redirect(self, status, url_from, url_to):
"""Implement some heuristics to detect valid redirections.""" |
<|file_name|>pasta.ts<|end_file_name|><|fim▁begin|>import { Recipe, RecipeContainer } from '../class/recipe';
import { Items as i } from '../constants/items';
import { Equipment as e } from '../class/equipment';
import { Categories as c } from '../constants/categories';
import { Units as u } from '../constants/units';
... | this.recipeName = 'Spaghetti'
this.variations = [
LentilPenne, LentilSpaghetti, LentilSpaghettiInstantPot, DontUseModernBrandLentilPenne |
<|file_name|>layer_fields.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3<|fim▁hole|>#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# no... | #
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved. |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|>from django.contrib import admin
from .models import Post, Publisher
class PostInline(admin.StackedInline):
model = Post
<|fim▁hole|> inlines = [PostInline,]
admin.site.register(Publisher, PublisherAdmin)
admin.site.register(Post)<|fim▁end|> | class PublisherAdmin(admin.ModelAdmin): |
<|file_name|>FavoritesSharedPrefsUtilsImpl.java<|end_file_name|><|fim▁begin|>package org.septa.android.app.services.apiinterfaces;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import com.goog... | |
<|file_name|>minit.py<|end_file_name|><|fim▁begin|># Copyright 2017 The Meson development 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
# http://www.apache.org/licenses/LICENSE-2.0... | |
<|file_name|>singleOrDefault.ts<|end_file_name|><|fim▁begin|>export default function singleOrDefault<TSource>(this: Iterable<TSource>): TSource | null;
export default function singleOrDefault<TSource>(this: Iterable<TSource>, predicate: (element: TSource) => boolean): TSource | null;
export default function singleOrDef... | hasValue = true;
}
|
<|file_name|>conf.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# envoy documentation build configuration file, created by
# sphinx-quickstart on Sat May 28 10:51:27 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values... | # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large. |
<|file_name|>runonsave.py<|end_file_name|><|fim▁begin|>import sublime, sublime_plugin
class RunOnSave(sublime_plugin.EventListener):
def on_post_save(self, view):
# Check if project has run-on-save enabled.
settings = view.settings()
if settings.get('run_on_save') == 1:
command = settings.get('c... | |
<|file_name|>mockApplications.service.ts<|end_file_name|><|fim▁begin|>import * as _ from 'lodash';
interface IApplicationsService {
getApplications(context: any): Promise<any>;
}
/** Backend service communications. */
export class ApplicationsService implements IApplicationsService {
public static $inject = ['$fi... | }), function(e: any) {
deferred.reject(e); |
<|file_name|>namespace_range.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | after_namespace: A namespace string. |
<|file_name|>types.tsx<|end_file_name|><|fim▁begin|>/*
* The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
* (the "License"). You may not use this work except in compliance with the License, which is
* available at www.apache.org/licenses/LICENSE-2.0
*
* This software is distribu... | |
<|file_name|>LCMRover.py<|end_file_name|><|fim▁begin|>'''
Created on Dec 3, 2014
@author: gearsad
'''
import sys
from roverpylot import rover
from bot_update_t import bot_update_t
from bot_control_command_t import bot_control_command_t
import lcm
# Try to start OpenCV for video
try:
import cv
except:
cv = Non... | |
<|file_name|>cm.py<|end_file_name|><|fim▁begin|>from __future__ import absolute_import, print_function, division
import numpy as np
from matplotlib.colors import LinearSegmentedColormap,ListedColormap
import sys
__author__ = "Juhyeong Kang "
__email__ = "jhkang@astro.snu.ac.kr"
def create_cdict(r, g, b):
i ... |
def cac(r=False): |
<|file_name|>plot.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
"""
This script plots various quantities.
"""
from __future__ import division, print_function
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import argparse
ylabels = {"cl": r"$C_l$", "cd": r"$C_d$", "cl/cd": r"$C_l/C_d$",... | def plot_foil_perf(quantity="cl/cd", foil="0012", Re=2e5): |
<|file_name|>printer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
"""
@author: Manuel F Martinez <manpaz@bashlinux.com>
@organization: Bashlinux
@copyright: Copyright (c) 2012 Bashlinux
@license: GNU GPL v3
"""
import usb.core
import usb.util
import serial
import socket
from .escpos import *
from .constants impo... | self.open() |
<|file_name|>helper.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import wx
import win32clipboard
import win32con
import gui
import treeInterceptorHandler
import textInfos
import globalVars
def getSelectedText():
obj = globalVars.focusObject
if isinstance(obj.treeInterceptor, treeInterceptorHandler.Docume... | win32clipboard.CloseClipboard()
return success
|
<|file_name|>terrain.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Terrain module providing step overlapping data containers
"""
import threading
<|fim▁hole|>world = threading.local() # pylint: disable=invalid-name
def pick(func):
"""
Picks the given function and add it to the world o... | |
<|file_name|>0002_auto__del_unique_cards__del_cards__del_versions__del_unique_versions__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration)... | (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
))
db.send_create_signal(u'card_game', ['versions'])
|
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>"""
Tests for Blocks Views
"""
import json
import ddt
from django.test import RequestFactory, TestCase
from django.core.urlresolvers import reverse
import httpretty
<|fim▁hole|>from third_party_auth.tests.utils import ThirdPartyOAuthTestMixin, ThirdPartyOAuthTes... | from student.tests.factories import UserFactory |
<|file_name|>Posts.js<|end_file_name|><|fim▁begin|>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import * as postsActions from 'redux/modules/posts';
import { asyncConnect } from 'redux-connect';
import { connect } from 'react-redux';<|fim▁hole|>
@asyncConnect([{
promise: ({ store: { ... | import { push } from 'react-router-redux';
import ListPosts from '../Posts/ListPosts'; |
<|file_name|>contact.py<|end_file_name|><|fim▁begin|>import re
from datetime import datetime
from flask import current_app as app
from flask_jwt import current_identity
from flask_restplus import Namespace, Resource, fields, reqparse
from sqlalchemy.exc import IntegrityError
from packr.models import Message
api = Na... | return messages, 201
else:
return {'message': 'Not authorised'}, 401
|
<|file_name|>plugin.py<|end_file_name|><|fim▁begin|>from Components.ActionMap import ActionMap
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.ConfigList import ConfigList
from Components.config import *
from Components.Console import Console
from skin impor... | self.oldbmcService = self.session.nav.getCurrentlyPlayingServiceReference() |
<|file_name|>_nticks.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators
class NticksValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="nticks", parent_name="layout.ternary.baxis", **kwargs
):
super(NticksValidator, self).__init__(<|fim▁h... | plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.pop("edit_type", "plot"),
min=kwargs.pop("min", 1), |
<|file_name|>props.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 dbus::arg::IterAppend;
use dbus_tree::{MTSync, MethodErr, Prop... | where |
<|file_name|>draggableRowTests.js<|end_file_name|><|fim▁begin|>describe("Dragable Row Directive ", function () {
var scope, container, element, html, compiled, compile;
beforeEach(module("app", function ($provide) { $provide.value("authService", {}) }));
beforeEach(inject(function ($compile, $rootScope) {
... | };
element.find('.drop-area').trigger(event);
expect(element.find('.drop-area').css('display')).toEqual('none'); |
<|file_name|>deploy.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os
from watermark.config import config as conf
from watermark import connect
config_name = os.getenv('WM_CONFIG_ENV') or 'default'<|fim▁hole|>conn = connect.get_connection(config)
conn.message.create_queue(name=config.NAME)
print("{nam... | config = conf[config_name]()
|
<|file_name|>pagers.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2022 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/... | return getattr(self._response, name)
|
<|file_name|>gregorian.js<|end_file_name|><|fim▁begin|>define(
//begin v1.x content
{
"dateFormatItem-Ehm": "E h:mm a",
"days-standAlone-short": [
"อา.",
"จ.",
"อ.",
"พ.",
"พฤ.",
"ศ.",
"ส."
],
"months-format-narrow": [
"ม.ค.",
"ก.พ.",
"มี.ค.",
"เม.ย.",
"พ.ค.",
"มิ.ย.",
"ก.ค.",
"ส.ค.",
... | |
<|file_name|>dlccmds.go<|end_file_name|><|fim▁begin|>package main
import (
"encoding/hex"
"fmt"
"strconv"
"strings"
"time"
"github.com/fatih/color"
"github.com/mit-dci/lit/litrpc"
"github.com/mit-dci/lit/lnutil"
"github.com/mit-dci/lit/logging"
)
var dlcCommand = &Command{
Format: fmt.Sprintf("%s%s%s\n", l... | |
<|file_name|>kml_view.py<|end_file_name|><|fim▁begin|>from django.views.generic import ListView
from django.http import HttpResponse
from .models import Job
from geoq.maps.models import FeatureType
from django.shortcuts import get_object_or_404
from datetime import datetime
from pytz import timezone
from webcolors imp... | |
<|file_name|>01-run.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
child.expect("All up, running the shell now")
child.sendline("ifconfig")<|fim▁hole|> child.expect(r"Iface\s+(\d+)\s+HWaddr:")
if __name__ == "__main__":
sys.exit(run(... | |
<|file_name|>facebook.py<|end_file_name|><|fim▁begin|>from flask import Flask, redirect, url_for, session, request
from flask_oauthlib.client import OAuth, OAuthException
FACEBOOK_APP_ID = '188477911223606'
FACEBOOK_APP_SECRET = '621413ddea2bcc5b2e83d42fc40495de'
app = Flask(__name__)
app.debug = True
app.secret_ke... | |
<|file_name|>distance.py<|end_file_name|><|fim▁begin|>class WallsGate(object):
def dfs(self, rooms):
queue = [(i, j, 0) for i, rows in enumerate(rooms) for j, v in enumerate(rows) if not v]
while queue:
i, j, step = queue.pop()
if rooms[i][j] > step:
rooms[i]... | i,j=x/col,x%col
for newi,newj in (i+1,j),(i-1,j),(i,j+1),(i,j-1):
if 0 <= newi < len(rooms) and 0 <= newj < len(rooms[0]) and rooms[newi][newj]==INF:
rooms[newi][newj]=rooms[i][j]+1 |
<|file_name|>invibesBidAdapter_spec.js<|end_file_name|><|fim▁begin|>import { expect } from 'chai';
import { spec, resetInvibes, stubDomainOptions } from 'modules/invibesBidAdapter';
describe('invibesBidAdapter:', function () {
const BIDDER_CODE = 'invibes';
const PLACEMENT_ID = '12345';
const ENDPOINT = '//bid.v... | let emptyResult = spec.interpretResponse({ BidModel: { }, Ads: [{ BidPrice: 1 }] }, { bidRequests });
expect(emptyResult).to.be.empty;
}); |
<|file_name|>activation.js<|end_file_name|><|fim▁begin|>'use strict';
<|fim▁hole|><|fim▁end|> | exports.name = '/activation'; |
<|file_name|>edalize_common.py<|end_file_name|><|fim▁begin|>from collections import OrderedDict
import os.path
import shutil
import pytest
from edalize import get_edatool
tests_dir = os.path.dirname(__file__)
class TestFixture:
"""A fixture that makes an edalize backend with work_root directory
Create th... | |
<|file_name|>AssociationListTest.java<|end_file_name|><|fim▁begin|><|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.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* ... | /*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License"); |
<|file_name|>_cryptic_nodes.py<|end_file_name|><|fim▁begin|>from typing import NamedTuple, List
from data import crossword
class Clue(str):
def __init__(self, value) -> None:
super(Clue, self).__init__(value)<|fim▁hole|> self._tokens = crossword.tokenize_clue(value)
class _Node(object):
_clue: Clue
_o... | |
<|file_name|>webdriver.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
#
# Copyright 2011-2013 Software freedom conservancy
#
# 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://ww... | # desired_capabilities stays as passed in
if desired_capabilities is None: |
<|file_name|>builtin.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-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/li... | "non-method call expr behaving like a method call?")
}; |
<|file_name|>RandomizedQueue.java<|end_file_name|><|fim▁begin|>import java.util.Iterator;
import java.util.NoSuchElementException;
@SuppressWarnings("unchecked")
public class RandomizedQueue<Item> implements Iterable<Item> {
private Item[] _arr;
private int _length = 0;
private void resize(int newLength) ... | public boolean hasNext() {
return _current != _state.length; |
<|file_name|>config_toml_test.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# Copyright 2018 Vote 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/li... | self.assertEqual(config.get('hdfs', 'namenode_port'), 50030)
def test_set(self):
config = get_config('toml') |
<|file_name|>new-age.js<|end_file_name|><|fim▁begin|>(function($) {
"use strict"; // Start of use strict
// jQuery for page scrolling feature - requires jQuery Easing plugin
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
... | })(jQuery); // End of use strict
((window.gitter = {}).chat = {}).options = {
room: 'FMeat/Lobby' |
<|file_name|>set_algorithm.hpp<|end_file_name|><|fim▁begin|>/// \file
// Range v3 library
//
// Copyright Eric Niebler 2013-present
// Copyright Tomislav Ivek 2015-2016
//
// Use, modification and distribution is subject to the
// Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or co... | |
<|file_name|>utils.js<|end_file_name|><|fim▁begin|>export function allDaysDisabledBefore (day, unit, { minDate, includeDates } = {}) {
const dateBefore = day.clone().subtract(1, unit)
return (minDate && dateBefore.isBefore(minDate, unit)) ||
(includeDates && includeDates.every(includeDate => dateBefore.isBefore... | |
<|file_name|>oracle.py<|end_file_name|><|fim▁begin|>import os.path
import sys
import re
import warnings
import cx_Oracle
from django.db import connection, models
from django.db.backends.util import truncate_name
from django.core.management.color import no_style
from django.db.models.fields import NOT_PROVID... | params = {
|
<|file_name|>index.ts<|end_file_name|><|fim▁begin|>// Copyright 2018, 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
//
// U... | 'v1': androidmanagement_v1.Androidmanagement,
};
export function androidmanagement(version: 'v1'): |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
Created on 17 Aug 2012
@author: Éric Piel
Copyright © 2012 Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License version 2 as... | PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>## This file is part of conftron.
##
## Copyright (C) 2011 Matt Peddie <peddie@jobyenergy.com>
##
## 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... | |
<|file_name|>tag_test.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2004-2015 by Jakob Schröter <js@camaya.net>
* This file is part of the gloox library. http://camaya.net/gloox
*
* This software is distributed under a license. The full license
* agreement can be found in the file LICENSE in this distrib... | |
<|file_name|>Fpage.java<|end_file_name|><|fim▁begin|>//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompi... |
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType; |
<|file_name|>query.service.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import {Query} from './model/query';
import {QueryCategory} from './model/query-category';
import {QueryPart} from './model/query-part';
@Injectable()
export class QueryService {
// String to separate category-nam... | public appendQueryPartToQueryString(categories: Array<QueryCategory>, queryString: string, appendPart: QueryPart) {
let lastPart: QueryPart, remainingQueryString: string;
[lastPart, remainingQueryString] = this.popLastQueryPartFromString(categories, queryString); |
<|file_name|>ClickAndSeek.js<|end_file_name|><|fim▁begin|>// ga.addEventBehavior(ga.gameEvents.MouseDown, undefined, undefined, undefined, function (e) {
// var spriteClick = ga.CheckEventPosition(e.offsetX, e.offsetY);
// if (spriteClick != undefined) {
// ... | // seeker.execute(e, sprite, engine);
// }
|
<|file_name|>hitter.py<|end_file_name|><|fim▁begin|>from hashlib import sha256
from .etl import ETL
from kombu.mixins import ConsumerMixin
from kombu import Connection
import traceback
import Queue
import json
import time
import pytz
from datetime import datetime
from tzlocal import get_localzone
import socket
import... | # may not be right |
<|file_name|>length.js<|end_file_name|><|fim▁begin|>// Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.<|fim▁hole|>info: >
The length property of the @@split method is 2.
ES6 Section 17:
[...]
Unless otherwise speci... | /*---
es6id: 21.2.5.11
description: RegExp.prototype[Symbol.split] `length` property |
<|file_name|>node-debug.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:49c54ee863855e8fa7d43bdb5142596122609269a2e98c9a92e10dffcda1376d<|fim▁hole|><|fim▁end|> | size 65177 |
<|file_name|>image.py<|end_file_name|><|fim▁begin|>import logging
import six
import warnings
from ..auth import auth
from ..constants import INSECURE_REGISTRY_DEPRECATION_WARNING
from .. import utils
from .. import errors
log = logging.getLogger(__name__)
class ImageApiMixin(object):
@utils.check_resource
... | image, repository=repository, tag=tag)
else: |
<|file_name|>position.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 specified value of
//! [`position`]... | |
<|file_name|>OrCRIF.java<|end_file_name|><|fim▁begin|>/*
* $RCSfile: OrCRIF.java,v $
*
<|fim▁hole|> *
* $Revision: 1.1 $
* $Date: 2005/02/11 04:56:38 $
* $State: Exp $
*/
package com.sun.media.jai.opimage;
import java.awt.RenderingHints;
import java.awt.geom.Rectangle2D;
import java.awt.image.RenderedIm... | * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
*
* Use is subject to license terms.
|
<|file_name|>server.js<|end_file_name|><|fim▁begin|>var http = require('http');
var fs = require('fs');
var url = require('url');
http.createServer( function (req, res) {
var pathname = url.parse(req.url).pathname;
if (pathname == '/data' && req.method == "POST") {
req.setEncoding('utf8');
... | }
}).listen(80); |
<|file_name|>RepositoryIssueList.js<|end_file_name|><|fim▁begin|>// LICENSE : MIT
"use strict";
import React from "react"
global.React = require('react');
var md2react = require("md2react");
var todoRegexp = /^-\s*\[[x ]\]\s*/;
function isTODO(line) {
return todoRegexp.test(line);
}
function flatten([first, ...res... | //componentDidUpdate() {
// this.markdownContainer = React.findDOMNode(this.refs.markdown); |
<|file_name|>wsgi.py<|end_file_name|><|fim▁begin|>from __future__ import unicode_literals
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import ... | self._post = post
@cached_property
def COOKIES(self): |
<|file_name|>authz_ownership.py<|end_file_name|><|fim▁begin|>"""
Authorization module that allow users listed in
/etc/cobbler/users.conf to be permitted to access resources, with
the further restriction that cobbler objects can be edited to only
allow certain users/groups to access those specific objects.
Copyright 20... | obj = api_handle.find_system(arg1)
elif resource == "remove_repo":
obj = api_handle.find_repo(arg1) |
<|file_name|>organization.js<|end_file_name|><|fim▁begin|>// Load Moongoose
var mongoose = require('mongoose');<|fim▁hole|>
// Automatically create a last modified date attribute that auto-updates
var lastMod = require('./lastMod');
// define the schema for our model
var organizationSchema = mongoose.Schema({
... | |
<|file_name|>path_filter.rs<|end_file_name|><|fim▁begin|>use std::path::{PathBuf, Path, Component};
use ignore::gitignore::GitignoreBuilder;
use errors;
pub(crate) fn new(base_path: &Path, stash_path: &Path) -> errors::Result<PathFilter> {
let base_path = PathBuf::from(base_path).canonicalize()?;
let stash_pat... | "Expecting a path witin {:?} but got {:?} - don't know how to check ignore status",
self.base_path, |
<|file_name|>NumberGreaterThanOrEqualsAdvancedFilter.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/
<|... | package com.microsoft.azure.management.eventgrid.v2020_04_01_preview;
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! The serial support library contains all
//! the functionality to read ports, and send data
//! between threads reading serial port data
//! and threads handling websocket requests
#![recursion_limit = "1024"]
#![allow(dead_code)]
#![allow(unused_variables)]
extern c... | #[macro_use]
extern crate serde_derive;
|
<|file_name|>canvaskit.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>
declare function CanvasKitInit(opts: CanvasKitInitOptions): Promise<CanvasKit>;
export = CanvasKitInit;<|fim▁end|> | import { CanvasKitInitOptions, CanvasKit } from "../index"; |
<|file_name|>delivery_carrier.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from odoo import api, fields, models, _
from odoo.exceptions import UserError, ValidationError
from odoo.tools.safe_eval import safe_eval
_lo... | record.price_rule_ids.unlink() |
<|file_name|>shared.ts<|end_file_name|><|fim▁begin|>import {ListWrapper, StringMapWrapper} from 'angular2/src/core/facade/collection';
import {isBlank, BaseException, looseIdentical} from 'angular2/src/core/facade/lang';
import {ControlContainer} from './control_container';
import {NgControl} from './ng_control';
impo... | function _throwError(dir: NgControl, message: string): void {
var path = ListWrapper.join(dir.path, " -> ");
throw new BaseException(`${message} '${path}'`); |
<|file_name|>test_tree.py<|end_file_name|><|fim▁begin|>from hippiehug import RedisStore, Tree, Leaf, Branch
import pytest
## ============== TESTS ===================
def test_evidence():
t = Tree()
# Test positive case<|fim▁hole|> root, E = t.evidence(b"World")
assert len(E) == 2
store = d... | t.add(b"Hello", b"Hello")
t.add(b"World", b"World")
|
<|file_name|>stats.pb.go<|end_file_name|><|fim▁begin|>// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/appcelerator/amp/api/rpc/stats/stats.proto
/*
Package stats is a generated protocol buffer package.
It is generated from these files:
github.com/appcelerator/amp/api/rpc/stats/stats.proto
It ... | TimeZone string `protobuf:"bytes,19,opt,name=time_zone,json=timeZone" json:"time_zone,omitempty"`
Avg bool `protobuf:"varint,20,opt,name=avg" json:"avg,omitempty"`
AllowsInfra bool `protobuf:"varint,21,opt,name=allows_infra,json=allowsInfra" json:"allows_infra,om... |
<|file_name|>codetest.js<|end_file_name|><|fim▁begin|>new require('styles/dark')
module.exports = class extends require('base/app'){
prototype(){
this.tools = {
Rect:require('shaders/quad'),
Code: require('views/code').extend({
w:'100#',
h:'100%'
})
}
}
constructor(){
super()
//this.code... | }
onDraw(){ |
<|file_name|>test_obj.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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... | resp_headers = {'x-delete-at': None}
head_resp = [200] * self.obj_ring.replicas + \
[404] * self.obj_ring.max_more_nodes |
<|file_name|>line.rs<|end_file_name|><|fim▁begin|>use std::string::ToString;
use std::borrow::Cow;
use time;
#[derive(Debug)]
pub enum Line {
// PMs are logged sometimes trigger alerts (and are sent to client(s))
PrivMsg { src: String, dst: String, text: String, orig: String },
// Metadata is not logged (b... | } |
<|file_name|>bootloader_advanced_gui.py<|end_file_name|><|fim▁begin|>#
# bootloader_advanced.py: gui advanced bootloader configuration dialog
#
# Jeremy Katz <katzj@redhat.com>
#
# Copyright 2001-2002 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# Yo... |
return thebox |
<|file_name|>isSurrogatePair.d.ts<|end_file_name|><|fim▁begin|>import validator from '../';<|fim▁hole|><|fim▁end|> | export default validator.isSurrogatePair; |
<|file_name|>TestReverseStringFilter.java<|end_file_name|><|fim▁begin|>/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to... | */
|
<|file_name|>resources.py<|end_file_name|><|fim▁begin|>from tastypie import fields
from tastypie.bundle import Bundle
from tastypie.resources import ModelResource, ALL, ALL_WITH_RELATIONS
from api.authorization import DateaBaseAuthorization
from api.authentication import ApiKeyPlusWebAuthentication
from api.base_resour... |
def get_comment_resource_class():
return CommentResource |
<|file_name|>oemedical_medicament_category.py<|end_file_name|><|fim▁begin|>from openerp import models,fields
class OeMedicalMedicamentCategory(models.Model):
_name = 'oemedical.medicament.category'
<|fim▁hole|>
childs = fields.One2many('oemedical.medicament.category',
'parent_id'... | |
<|file_name|>heap.rs<|end_file_name|><|fim▁begin|>// Copyright 2014-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/licen... | |
<|file_name|>compress.rs<|end_file_name|><|fim▁begin|>extern crate env_logger;
extern crate handlebars_iron as hbs;
extern crate iron;
extern crate router;
extern crate serde;
extern crate serde_json;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate maplit;
extern crate flate2;
use hbs::handlebars::{C... | name: String,
pts: u16, |
<|file_name|>ADTFPinMessageEncoder.cpp<|end_file_name|><|fim▁begin|>#include "ADTFPinMessageEncoder.h"
using namespace A2O;
ADTFPinMessageEncoder::ADTFPinMessageEncoder(IAction::Ptr action,
ICarMetaModel::ConstPtr carMetaModel)
: _action(action)
{
// Create output pins
const std::vector<IServoDri... | |
<|file_name|>StatsDReporter.java<|end_file_name|><|fim▁begin|>/**
* Copyright (C) 2013 metrics-statsd contributors
*
* 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://... | |
<|file_name|>en-GB.js<|end_file_name|><|fim▁begin|>module.exports = {
site: {
title: 'i18n node example',
description: 'An example for this module on node'
},
bankBalance: 'Hi {1}, your balance is {2}.',
transports: {
yacht: 'Yacht',
bike: 'Bike'<|fim▁hole|><|fim▁end|> | },
modeOfTransport: 'Your preferred mode of transport is by {1}.'
}; |
<|file_name|>example.go<|end_file_name|><|fim▁begin|>package isbn
import (
"errors"
"math"
"strconv"
"unicode"
)
func IsValidISBN(isbn string) bool {
isbn = dropHyphen(isbn)
ary, err := strToSlice(isbn)
if len(ary) != 10 || err != nil {
return false
}
return calcCheckDigit(ary)
}
func dropHyphen(isbn s... | |
<|file_name|>database.js<|end_file_name|><|fim▁begin|>// config/database.js
module.exports = {
'secret': 'puneetvashisht',
'url' : 'mongodb://localhost/userdb' // looks like mongodb://<user>:<pass>@mongo.onmodulus.net:27017/Mikha4ot
<|fim▁hole|><|fim▁end|> | }; |
<|file_name|>ASTStringNode.java<|end_file_name|><|fim▁begin|>/**
Copyright 2010 Christian Kästner
This file is part of CIDE.
CIDE 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, versio... |
public ASTStringNode(String value, IToken token) {
super(new ArrayList<Property>(), token, token);
this.value = value;
|
<|file_name|>IrcMessageListener.java<|end_file_name|><|fim▁begin|>package net.wayward_realms.waywardchat.irc;
import net.wayward_realms.waywardchat.WaywardChat;
import org.pircbotx.Channel;
import org.pircbotx.PircBotX;
import org.pircbotx.User;
import org.pircbotx.hooks.ListenerAdapter;
import org.pircbotx.hooks.even... | |
<|file_name|>add-milestone.js<|end_file_name|><|fim▁begin|>// Get all of our fake login data
//var login = require('../login.json');
exports.view = function(req, res){
<|fim▁hole|> res.render('add-milestone', {'time' : req.cookies.startTime, 'goalname': goalname});
};
exports.timePost = function(req,res){
var start... | var goalname =req.params.goalname; |
<|file_name|>db.go<|end_file_name|><|fim▁begin|>package config<|fim▁hole|>var ()<|fim▁end|> | |
<|file_name|>step21.min.js<|end_file_name|><|fim▁begin|>version https://git-lfs.github.com/spec/v1
oid sha256:bf2580cc3dbb5c69564e5338a736b949ba7f1c7d567f37e58589d9f573c7abbb<|fim▁hole|>size 481<|fim▁end|> | |
<|file_name|>data_types.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from meerkat_abacus.config import config
def data_types(param_config=config):
with open(param_config.config_directory + param_config.country_config["types_file"],
"r", encoding='utf-8',
errors="replace") as f:
... | import csv
|
<|file_name|>random_ext.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
# @file ostap/math/random_ext.py
# The simple extention for the standard python module random
# @author Vanya BELYAEV
# @date 2012-04-28... | # =============================================================================
""" The simple extension for the standard python module random
- bifurcated gaussian
- gaussian using Ostap.Math.ValueWithError as argument |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.