prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>search.py<|end_file_name|><|fim▁begin|>def lucky_search(index, ranks, keyword):
urls = index.get(keyword)
if urls and ranks:<|fim▁hole|> return None
def ordered_search(index, ranks, keyword):
urls = index.get(keyword)
if urls and ranks:
return sorted(urls, key = lambda x: ranks[x])
else:
return ... | return max(urls, key = lambda x: ranks[x])
else: |
<|file_name|>Perforce.py<|end_file_name|><|fim▁begin|>"""SCons.Tool.Perforce.py
Tool-specific initialization for Perforce Source Code Management system.
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.
"""
# Copy... | |
<|file_name|>search.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Search Architecture:
- Have a list of accounts
- Create an "overseer" thread
- Search Overseer:
- Tracks incoming new location values
- Tracks "paused state"
- During pause or new location will clears current ... | 'active_accounts': 0, |
<|file_name|>ctc_ops.py<|end_file_name|><|fim▁begin|># Copyright 2016 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.apache.or... | See `core/ops/ctc_ops.cc` for more details.
inputs: 3-D `float` `Tensor`. |
<|file_name|>config.go<|end_file_name|><|fim▁begin|>package task_config
import (
"github.com/sonm-io/core/proto"
"github.com/sonm-io/core/util/config"
)
func LoadConfig(path string) (*sonm.TaskSpec, error) {<|fim▁hole|> return nil, err
}
if err := cfg.Validate(); err != nil {
return nil, err
}
return cfg, ... | // Manual renaming from snake_case to lowercase fields here to be able to
// load them directly in the protobuf.
cfg := &sonm.TaskSpec{}
if err := config.LoadWith(cfg, path, config.SnakeToLower); err != nil { |
<|file_name|>4db5dc4bc98_added_a_table_for_timed_commands.py<|end_file_name|><|fim▁begin|>"""Added a table for timed commands
Revision ID: 4db5dc4bc98
Revises: 514f4b9bc74
Create Date: 2015-12-23 00:00:59.156496
"""
# revision identifiers, used by Alembic.
revision = '4db5dc4bc98'
down_revision = '514f4b9bc74'
branc... | from sqlalchemy.dialects import mysql |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>"""scvi-tools."""
# Set default logging handler to avoid logging with logging.lastResort logger.
import logging
from logging import NullHandler
from ._constants import _CONSTANTS
from ._settings import settings
from . import data, model
# https://github.com/pytho... | |
<|file_name|>config.sample.js<|end_file_name|><|fim▁begin|>module.exports = {
client_id: "",
secret: "",
scope: "",
redirectURI: 'http://localhost:8080/callback', //make sure this is the same as the callback URI in github
// This token has to be from a user with permission to add students on Github
ownerPersonal... | // Invitations will be sent to join this group |
<|file_name|>barChart.js<|end_file_name|><|fim▁begin|>// a Bar chart
Bridle.BarChart = function() {
var mode = 'stacked';
var margin = {
top : 50,
bottom : 100,
left : 100,
right : 100
};
var height = 400;
var width = 1000;
var xValue = function(d) {
return d.x;
};
var yValue ... | };
var yScaleMode = function(d) {
if (mode === 'stacked') {
return yScale(d.y0 + d.y); |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>'use strict';<|fim▁hole|>var _ = require('underscore'),
through2 = require('through2'),
fs = require('fs'),
hdiff = require('hdiff'),
spawn = require('child_process').spawn,
which = require('which'),
gutil = requi... | |
<|file_name|>maeFunciones.js<|end_file_name|><|fim▁begin|>/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//var winMae;
var wins;
//function mae2(idLink, maeNombre, winParent) {
//... | // winId="winObra";
// wins.createWindow(winId, 1, 1, 800, 430);
// wins.window(winId).setText("<h4>Obras</h4>"); |
<|file_name|>test_antisym.py<|end_file_name|><|fim▁begin|>import numpy as np
import os
from tensorutils.antisym import get_antisymmetrizer_product as asym
test_dir_path = os.path.dirname(os.path.realpath(__file__))
array_path_template = os.path.join(test_dir_path, "random_arrays", "{:s}.npy")
def test__composition_... | array2 = asym("0/1|2/3") * array1
|
<|file_name|>float32.go<|end_file_name|><|fim▁begin|>package deref
// DO NOT MODIFY. Generated by nullable-generate.
// Float32 returns the value pointed to by np.
// If np is nil, then this function returns 0.<|fim▁hole|> return 0
}
return *np
}<|fim▁end|> | func Float32(np *float32) float32 {
if np == nil { |
<|file_name|>properties_data_mesh.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, o... | |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>extern crate clap;
extern crate num_bigint;
extern crate num_traits;
// Time Start: Tue, 24 Dec 2019 05:49:55 -0500
// Time Finish 1: Tue, 24 Dec 2019 07:29:32 -0500 (1 hour, 39 minutes, 37 seconds)
// Time Finish 2:
// Time Total:
<|fim▁hole|>use std::convert::TryFrom... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2014 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from __future__ import unicode_literals
from setuptools import setup, find_packages
try:
from pip.req import parse_requ... | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Intended Audience :: Developers', |
<|file_name|>test_container_quotas.py<|end_file_name|><|fim▁begin|># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudwatt
# All Rights Reserved.<|fim▁hole|># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may ... | # |
<|file_name|>freq_handler.rs<|end_file_name|><|fim▁begin|>use compression::BlockDecoder;
use common::VInt;
use common::BinarySerializable;
use compression::{CompositeDecoder, VIntDecoder};
use postings::SegmentPostingsOption;
use compression::NUM_DOCS_PER_BLOCK;
/// `FreqHandler` is in charge of decompressing
/// fr... | |
<|file_name|>header.tsx<|end_file_name|><|fim▁begin|>import { FunctionComponent, useState, MouseEvent } from 'react'
import { createStyles, makeStyles, Theme, AppBar, Toolbar, IconButton, Icon, useTheme } from '@material-ui/core'
import { Link, useHistory } from 'react-router-dom'
import Button from './button'
import N... | () => {
const classes = useStyles()
const theme = useTheme()
const [ opened, setOpened ] = useState(false) |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 et:
"""ACE -- Automated Coordinate Extraction.
"""
__all__ = ["config", "database", "datatable", "exporter", "set_logging_level", "scrape", "source... | _setup_logger(logger) |
<|file_name|>syscfg_common_t.hh<|end_file_name|><|fim▁begin|>#ifndef SYSCFG_COMMON_T_HH<|fim▁hole|>#define SYSCFG_COMMON_T_HH
#include "lib/types.hh"
#include "lib/regbit.hh"
namespace hal {
enum struct syscfg_mem_remap_mem_mode_t : lib::u8 {
main_flash = 0,
system_flash = 1,
fsmc_bank1 = ... | |
<|file_name|>settings.py<|end_file_name|><|fim▁begin|>"""
Django settings for gnucash_explorer project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build pat... | 'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
<|file_name|>fsub_ST5_ST1.java<|end_file_name|><|fim▁begin|>/*
JPC: An x86 PC Hardware Emulator for a pure Java Virtual Machine
<|fim▁hole|> Copyright (C) 2012-2013 Ian Preston
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License versi... | |
<|file_name|>numerics.py<|end_file_name|><|fim▁begin|># Copyright 2015 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.apache.o... | |
<|file_name|>fucina.js<|end_file_name|><|fim▁begin|>/*jshint camelcase: false */
(function(window, module, undefined) {
'use strict';
// lifted from Underscore then bastardized
var _flatten = function(input, output) {
for (var i = 0, length = input.length; i < length; i++) {
var value = input[i];
... | |
<|file_name|>checkboxTree.js<|end_file_name|><|fim▁begin|>/**
* Plus : Checkbox Tree
* Author : zhaoyang
*/
(function ($) {
$.fn.treeview = function(settings) {
var chkname = "pri",
dfop = {
method: "POST",
datatype: "json",
url: false,
cbiconpath: contextPath + "/rc/sc/jq/themes/tr... | |
<|file_name|>setup.py<|end_file_name|><|fim▁begin|>from numpy.distutils.core import setup, Extension
#from setuptools import setup, Extension
setup(
name = "Infer", version = "1.0",
description='Python version of MCMC, plus other inference codes under development',
author='Neale Gibson',
author_email='ngibso... |
#and extension package for solving toeplitz matrices...
ext_modules = [
Extension("Infer.LevinsonTrenchZoharSolve",sources=["src/LevinsonTrenchZoharSolve.c"],), |
<|file_name|>filestore.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This software may be used and distributed according to the terms of the
* GNU General Public License version 2.
*/
//! Implementation of a store using file I/O.
use crate::errors::ErrorKind;
use crate... | use crate::filestore::FileStore;
use crate::store::{BlockId, Store, StoreView};
use std::fs;
use std::io::Write; |
<|file_name|>package.py<|end_file_name|><|fim▁begin|>import ckan.controllers.package as package
import ckan.lib.dictization.model_dictize as model_dictize
import ckan.model as model
from ckan.common import c
class MapactionPackageController(package.PackageController):
def groups(self, id):
q = model.Se... |
group_list = model_dictize.group_list_dictize(groups, context)
|
<|file_name|>tokenizer.rs<|end_file_name|><|fim▁begin|>//! A whitespace and comment preserving lexer designed for use in both the compiler frontend
//! and IDEs.
//!
//! The output of the tokenizer is lightweight, and only contains information about the
//! type of a [Token] and where it occurred in the source.
use st... | |
<|file_name|>debug.go<|end_file_name|><|fim▁begin|>// Copyright (C) 2015 The Syncthing Authors.
//
// 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/.
package sync
imp... | l = logger.DefaultLogger.NewFacility("sync", "Mutexes") |
<|file_name|>facet-typeahead-list.component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { Facet } from '@ux-aspects/ux-aspects';
import 'chance';
import { Observable, Observer } from 'rxjs';
import { BaseDocumentationSection } from '../../../../../components/base-documentation-sect... | }, |
<|file_name|>logger.rs<|end_file_name|><|fim▁begin|>/* Copyright (C) 2020 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the ... | {
jb.set_uint("nonce_payload_length", server_nonce_length / 2)?;
} |
<|file_name|>test_tfidf.py<|end_file_name|><|fim▁begin|>import unittest
from datetime import datetime
import tempfile
import os
from due.agent import Agent
from due.episode import Episode
from due.event import Event
from due.persistence import serialize, deserialize
from due.models.tfidf import TfIdfAgent
from due.mod... | result.append(e)
|
<|file_name|>hrtb-parse.rs<|end_file_name|><|fim▁begin|>// run-pass
// Test that we can parse all the various places that a `for` keyword
// can appear representing universal quantification.
// pretty-expanded FIXME #23616
#![allow(unused_variables)]
#![allow(dead_code)]
trait Get<A,R> {
fn get(&self, arg: A) ->... | { |
<|file_name|>RmFormatStateStoreCmdWork.java<|end_file_name|><|fim▁begin|>package com.cloudera.cmf.service.yarn;
import com.cloudera.cmf.command.flow.CmdWorkCtx;
import com.cloudera.cmf.command.flow.WorkOutput;
import com.cloudera.cmf.command.flow.work.OneOffRoleProcCmdWork;
import com.cloudera.cmf.model.DbProcess... |
public MessageWithArgs getDescription(CmdWorkCtx ctx)
{
return MessageWithArgs.of("message.command.rmFormatStateStoreCmdWork.desc", new String[0]);
|
<|file_name|>main.js<|end_file_name|><|fim▁begin|>var angular = require('angular');
// import the hello UI component
require('./hello/main');
// compose the app and the routes
module.exports = angular
.module('myApp', [
'ngRoute',
'hello'
])
.config([
'$routeProvider', function ($routeProvider) {
$routePr... | |
<|file_name|>tone.py<|end_file_name|><|fim▁begin|>import math
from pyb import DAC, micros, elapsed_micros
def tone1(freq):<|fim▁hole|> t0 = micros()
dac = DAC(1)
while True:
theta = 2*math.pi*float(elapsed_micros(t0))*freq/1e6
fv = math.sin(theta)
v = int(126.0 * fv) + 127
#p... | |
<|file_name|>test_truediv.py<|end_file_name|><|fim▁begin|>from __future__ import division
from pyvx import *
from array import array<|fim▁hole|>
class TestDiv(object):
def test_div(self):
g = Graph()
with g:
img = Image(3, 4, DF_IMAGE_U8, array('B', range(12)))
sa1 = img / 2
... | |
<|file_name|>0036_auto__add_userfeeds__add_usersubscriptions.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):
def forwards(self, or... |
# Adding M2M table for field blogs on 'UserSubscriptions'
m2m_table_name = db.shorten_name(u'core_usersubscriptions_blogs') |
<|file_name|>siteswap_tests.py<|end_file_name|><|fim▁begin|>import unittest
from juggling.notation import siteswap
class SiteswapUtilsTests(unittest.TestCase):
def test_siteswap_char_to_int(self):
self.assertEqual(siteswap.siteswap_char_to_int('0'), 0)
self.assertEqual(siteswap.siteswap_char_to_i... | '[64]020',
'[33](3,3)123',
'(4,2)(2x,[44x])',
] |
<|file_name|>DropperTest.cpp<|end_file_name|><|fim▁begin|>/*******************************************************************************
* This file is part of openWNS (open Wireless Network Simulator)
* _____________________________________________________________________________
*
* Copyright (C) 2004-2007
* C... | CPPUNIT_ASSERT(dropper->req == 1);
CPPUNIT_ASSERT(dropper->drop == 0);
} // testDownlink
|
<|file_name|>nd.py<|end_file_name|><|fim▁begin|>from openstatesapi.jurisdiction import make_jurisdiction
J = make_jurisdiction('nd')<|fim▁hole|><|fim▁end|> | J.url = 'http://nd.gov' |
<|file_name|>word_preference.py<|end_file_name|><|fim▁begin|>from . import BaseWordChoice
class WordPreference(BaseWordChoice):
def pick_w(self,m,voc,mem,context=[]):
if m in voc.get_known_meanings():
if m in list(mem['prefered words'].keys()):
w = mem['prefered words'][m]
if w not in voc.get_known_word... | WordPreference.__init__(self,memory_policies=[{'mem_type':'wordpreference_last'}],*args,**kwargs)
class PlayFirst(WordPreference): |
<|file_name|>test_nmount.rs<|end_file_name|><|fim▁begin|>use crate::*;
use nix::{
errno::Errno,
mount::{MntFlags, Nmount, unmount}
};
use std::{
ffi::CString,
fs::File,
path::Path
};
use tempfile::tempdir;
#[test]
fn ok() {
require_mount!("nullfs");
let mountpoint = tempdir().unwrap();
... | } |
<|file_name|>hdr-strong.d.ts<|end_file_name|><|fim▁begin|>import * as React from 'react';<|fim▁hole|>export default class MdHdrStrong extends React.Component<IconBaseProps> { }<|fim▁end|> | import { IconBaseProps } from 'react-icon-base'; |
<|file_name|>5-emoji.js<|end_file_name|><|fim▁begin|>/* eslint-env mocha */
/* eslint-disable func-names, prefer-arrow-callback */
import mainContent from '../pageobjects/main-content.page';
import sideNav from '../pageobjects/side-nav.page';
describe.skip('emoji', ()=> {
it('opens general', ()=> {
sideNav.openCha... | });
|
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################<|fim▁hole|>from . i... | from . import website |
<|file_name|>admin.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
pythoner.net
Copyright (C) 2013 PYTHONER.ORG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of... | |
<|file_name|>click-counter.js<|end_file_name|><|fim▁begin|><|fim▁hole|>System.register([], function (_export, _context) {
"use strict";
var ClickCounter;
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function")... | "use strict";
|
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>// This file is part of the chessground library.
// Copyright (C) 2017 Niklas Fiekas <niklas.fiekas@backscattering.de>
//
// 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
// th... | extern crate gtk;
extern crate gdk;
extern crate cairo;
extern crate rsvg; |
<|file_name|>socket.rs<|end_file_name|><|fim▁begin|>//! One-way socket wrapper data structures.
use nanomsg::{Endpoint, Socket, Protocol, Error};
use std;
use std::convert::AsRef;
use std::io::{Read, Write};
use std::time::Duration;
/// A send-only socket.
pub struct SendSocket {
socket: Socket,
endpoint: Endpoin... |
ReceiveSocket {
socket: socket, |
<|file_name|>device.ts<|end_file_name|><|fim▁begin|>import Device from '@/interfaces/Device';
import mongoose from 'mongoose';
const device: Device = {
platform: 'testplatform',
userId: mongoose.Types.ObjectId('4ede40c86362e0fb12000003'),
tokens: ['nyht4ca81bGam26a'],
service: 'firebase',
};<|fim▁hole|>
export def... | |
<|file_name|>setup.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
#
# Unless re... | |
<|file_name|>Position.js<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in t... |
module.exports = Position; |
<|file_name|>0013_auto_20170605_1359.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-05 13:59
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | field=models.CharField(max_length=255, unique=True, validators=[django.core.validators.RegexValidator('^[a-z]*$', 'Only lowercase letters are allowed.')]),
), |
<|file_name|>strings.js<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
*
* 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 re... | |
<|file_name|>api-prefix.interceptor.ts<|end_file_name|><|fim▁begin|>import { Injectable } from '@angular/core';
import {
HttpEvent,
HttpInterceptor,
HttpHandler,
HttpRequest
} from '@angular/common/http';
import { Observable } from 'rxjs';
import { environment } from '@env/environment';
/**
* Prefixes all re... | intercept(
request: HttpRequest<any>,
next: HttpHandler |
<|file_name|>app-routing.module.ts<|end_file_name|><|fim▁begin|>import { NgModule } from '@angular/core';<|fim▁hole|>import { RouterModule, Routes, PreloadAllModules } from '@angular/router';
import { HomeComponent } from './home/home.component';
import { I18nComponent } from './i18n/i18n.component';
import { Validati... | |
<|file_name|>recipes.py<|end_file_name|><|fim▁begin|>from collections import defaultdict, namedtuple
from minecraft_data.v1_8 import recipes as raw_recipes
RecipeItem = namedtuple('RecipeItem', 'id meta amount')
class Recipe(object):
def __init__(self, raw):
self.result = reformat_item(raw['result'], N... | dict: In the form { (item_id, metadata) -> amount } |
<|file_name|>cluster.go<|end_file_name|><|fim▁begin|>/*
Copyright 2019 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
Unless... | }
|
<|file_name|>transfer_encoding.rs<|end_file_name|><|fim▁begin|>use header::Encoding;
header! {
#[doc="`Transfer-Encoding` header, defined in"]
#[doc="[RFC7230](http://tools.ietf.org/html/rfc7230#section-3.3.1)"]
#[doc=""]
#[doc="The `Transfer-Encoding` header field lists the transfer coding names"]
... | } |
<|file_name|>models.py<|end_file_name|><|fim▁begin|># PAPAS Access Point Administration System
# Copyright (c) 2010 Revolution Linux inc. <info@revolutionlinux.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by th... | |
<|file_name|>volumemetadata.py<|end_file_name|><|fim▁begin|>#
# Copyright 2016 Red Hat, Inc.
#
# 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
# (at your opti... | line = line.decode("utf-8")
except UnicodeDecodeError as e:
errors.append("Invalid line '{}': {}".format(line, e)) |
<|file_name|>gcloud_iam_sa.py<|end_file_name|><|fim▁begin|># pylint: skip-file
# vim: expandtab:tabstop=4:shiftwidth=4
#pylint: disable=too-many-branches<|fim▁hole|> ''' ansible module for gcloud iam servicetaccount'''
module = AnsibleModule(
argument_spec=dict(
# credentials
sta... | def main(): |
<|file_name|>IwxxmWebServiceImpl.java<|end_file_name|><|fim▁begin|>/***********************************************************************************************
*
* Copyright (C) 2016, IBL Software Engineering spol. s r. o.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this ... | Log.INSTANCE.debug("IwxxmWebService.validate request started");
checkRequestVersion(request.getRequestVersion());
|
<|file_name|>app.js<|end_file_name|><|fim▁begin|>(function () {
'use strict';
var dccModul = angular.module('workinghours', ['dcc.controller', 'dcc.factories', 'dcc.filter', 'ngCookies', 'ngRoute']);<|fim▁hole|> dccModul.config(['$routeProvider', '$httpProvider', function ($routeProvider, $httpProvider) {
... | |
<|file_name|>gen_notifier.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import json
import time
import parcon
import operator
import pprint
import os
import sys
import getopt
import re
import optparse
import string
import hashlib
import parse_objc as parser
import sign
#### tool version:
VERSION = parser.VERSION
... | # build a declaration, invocation and a selector for this method: |
<|file_name|>scraping.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from bs4 import BeautifulSoup
def parse_html(html):
def strip_elem(e):
return str(e).strip()
def non_empty_children(elem):
if hasattr(elem, "children"):
return list(filter(strip_e... | movimento = movimento.next_sibling
mov_tuples = filter(None, map(parse_tr, items_do_movimento(movimento))) |
<|file_name|>main.py<|end_file_name|><|fim▁begin|>from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.helpers.variable import mergeDicts, randomString
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
from couchpotato.... |
if result and result.get('imdb'):
return mergeDicts(result, self.getLibraryTags(result['imdb'])) |
<|file_name|>bootstrap-notify.js<|end_file_name|><|fim▁begin|>define(function(require, exports, module) {
var showMessage = function(type, message, duration) {
var $exist = $('.bootstrap-notify-bar');
if ($exist.length > 0) {
$exist.remove();
}
<|fim▁hole|> html += '<butt... | var html = '<div class="alert alert-' + type + ' bootstrap-notify-bar" style="display:none;">' |
<|file_name|>messageReactionAdd.js<|end_file_name|><|fim▁begin|>module.exports = (client, reaction, user) => {<|fim▁hole|><|fim▁end|> | client.log('Log', `${user.tag} reagiu à mensagem de id ${reaction.message.id} com a reação: ${reaction.emoji}`);
}; |
<|file_name|>ItemChannelLinkResource.java<|end_file_name|><|fim▁begin|>/**
* Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distri... |
import org.eclipse.smarthome.core.thing.ChannelUID; |
<|file_name|>TestNativeExpm1.rs<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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... | |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | pub mod base; |
<|file_name|>context.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/. */
//! The context within which style is calculated.
#![deny(mis... | debug_assert!(thread_state::get() == thread_state::LAYOUT);
match self {
SetSelectorFlags(el, flags) => {
unsafe { el.set_selector_flags(flags) }; |
<|file_name|>display-on-last-day-before-participants-must-check-in.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import participantCollection
participantCollection = participantCollection.ParticipantCollection()
numberStillIn = participantCollection.sizeOfParticipantsWhoAreStillIn()
initialNumber = participantCol... | print "These participants have checked in at least once in the last 15 days:"
print ""
for participant in participantCollection.participantsWhoAreStillInAndHaveCheckedIn():
print "/u/" + participant.name |
<|file_name|>test.js<|end_file_name|><|fim▁begin|>var todolist = require("./lib");
var assert = require("assert");
describe('findMarks', function() {
it('Find TODOs, NOTES, and FIXMEs', function() {
var result = todolist.findMarks("// TODO: This is a TODO\n// NOTE: This is a Note\n// FIXME: This is a fixme.\n");... | assert.deepEqual(result,
[{
content: 'TODO: This is a TODO',
line: 0, |
<|file_name|>moments.cpp<|end_file_name|><|fim▁begin|>/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you... |
if( type == CV_32SC2 || type == CV_32FC2 )
{ |
<|file_name|>player.rs<|end_file_name|><|fim▁begin|>use rand::Rng;
use super::{Gun, PowerupKind};
use geometry::{Advance, Collide, Point, Position, Size, Vector};
use geometry_derive::{Advance, Position};<|fim▁hole|>
/// The `Player` is the rocket controlled by the user
#[derive(Default, Advance, Position)]
pub struct... | |
<|file_name|>0003_auto_20150326_1435.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
from __future__ import unicode_literals
<|fim▁hole|>
dependencies = [
('api', '0002_auto_20150326_1433'),
]
operations = [
migrations.RemoveField(
model_name='problem',
name=... | from django.db import models, migrations
class Migration(migrations.Migration): |
<|file_name|>youtube.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Roberto Alsina y otros.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without lim... | #
# The above copyright notice and this permission notice
# shall be included in all copies or substantial portions of |
<|file_name|>builder.go<|end_file_name|><|fim▁begin|>// Copyright 2016-2021 The Libsacloud Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.<|fim▁hole|>// Unless required by applicable law or agreed to in writing, software
/... | // You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
// |
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>// rust-xmpp
// Copyright (c) 2014 Florian Zeitz
//
// This project is MIT licensed.
// Please see the COPYING file for more information.
pub use self::plain::PlainAuth;
pub use self::scram::ScramAuth;
pub use self::anon::AnonAuth;
pub mod plain;
pub mod scram;
pub mod... | fn continuation(&mut self, _data: &[u8]) -> Result<Vec<u8>, &'static str> { |
<|file_name|>windowCount-spec.js<|end_file_name|><|fim▁begin|>/* globals describe, it, expect, hot, cold, expectObservable, expectSubscriptions */
var Rx = require('../../dist/cjs/Rx.KitchenSink');
var Observable = Rx.Observable;
describe('Observable.prototype.windowCount', function () {
it('should emit windows with... |
var window;
var result = source.windowCount(10, 10) |
<|file_name|>models.go<|end_file_name|><|fim▁begin|>// +build go1.9
// Copyright 2018 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.or... | func PossibleJobStateValues() []JobState {
return original.PossibleJobStateValues()
} |
<|file_name|>SettingsActivity.java<|end_file_name|><|fim▁begin|>package net.pinemz.hm.gui;
import net.pinemz.hm.R;
import net.pinemz.hm.api.HmApi;
import net.pinemz.hm.api.Prefecture;
import net.pinemz.hm.api.PrefectureCollection;
import net.pinemz.hm.storage.CommonSettings;
import android.os.Bundle;
import an... | |
<|file_name|>exercise1_11.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a
procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterativ... | def f_recursive(n):
if lt(n, 3):
return n
r1 = f_recursive(sub(n, 1)) |
<|file_name|>configuration_window.py<|end_file_name|><|fim▁begin|>import os
from pathlib import Path
import gi
import logging
from gi.repository import Gtk
import json_config
from .login_window import LoginWindow<|fim▁hole|>TOP_DIR = os.path.dirname(os.path.abspath(__file__))
config = json_config.connect('config.json... | |
<|file_name|>Graph2d.js<|end_file_name|><|fim▁begin|>var Emitter = require('emitter-component');
var Hammer = require('../module/hammer');
var moment = require('../module/moment');
var util = require('../util');
var DataSet = require('../DataSet');
var DataView = require('../DataView');
var Range = require('./Range');
... | if (options) {
this.setOptions(options);
} |
<|file_name|>filetransfer.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# papyon - a python client library for Msn
#
# Copyright (C) 2010 Collabora Ltd.
#
# 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 ... | self._has_preview = False
self._preview = None
# data to be send if sending
self._data = None |
<|file_name|>grocery-list.service.js<|end_file_name|><|fim▁begin|>"use strict";
var core_1 = require("@angular/core");
var http_1 = require("@angular/http");
var Rx_1 = require("rxjs/Rx");
require("rxjs/add/operator/map");
var config_1 = require("../config");
var grocery_1 = require("./grocery");
/* This is a simple se... | and RxJS’s map() function is used to format the data into an array of Grocery objects. */
var GroceryListService = (function () { |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>/*!
* commander
* Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var EventEmitter = require('events').EventEmitter
, spawn = require('child_process').spawn
, keypress = require('keypress')
, fs = requ... | |
<|file_name|>body.rs<|end_file_name|><|fim▁begin|>use std::io::Read;
use std::fs::File;
use std::fmt;
/// Body type for a request.
#[derive(Debug)]
pub struct Body {
reader: Kind,
}
impl Body {
/// Instantiate a `Body` from a reader.
///
/// # Note
///
/// While allowing for many types to be u... | }
}
/* |
<|file_name|>grid.js<|end_file_name|><|fim▁begin|>// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
frappe.ui.form.Grid = Class.extend({
init: function(opts) {
$.extend(this, opts);
this.fieldinfo = {};
this.doctype = this.df.options;
this.template = null... | });
frappe.ui.form.GridRow = Class.extend({ |
<|file_name|>hooks.py<|end_file_name|><|fim▁begin|># ../gungame/core/messages/hooks.py
"""Provides a way to hook GunGame messages."""
# =============================================================================
# >> IMPORTS
# =============================================================================
# Source.Py... | |
<|file_name|>test_views.py<|end_file_name|><|fim▁begin|>"""
Logistration API View Tests
"""
from unittest.mock import patch
from urllib.parse import urlencode
import socket
import ddt
from django.conf import settings
from django.urls import reverse
from rest_framework.test import APITestCase
from common.djangoapps.stu... | response = self.client.get(self.url, self.query_params)
assert response.status_code == 200 |
<|file_name|>index.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | export { default } from './src/layout-container.vue'; |
<|file_name|>dist.rs<|end_file_name|><|fim▁begin|>// Copyright 2016 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... | t!(fs::create_dir_all(image.join("bin")));
builder.cp_r(&src.join("bin"), &image.join("bin"));
builder.install(&builder.rustdoc(compiler.host), &image.join("bin"), 0o755); |
<|file_name|>test_console.py<|end_file_name|><|fim▁begin|>from .. import console, fields
from ..exceptions import ConsoleError
from . import mock
import pytest
console.raw_input=mock.raw_input
def test_prompt():
field=fields.Field("test_field", "test field", fields.Field.TYPE_TEXT_ONELINE, "this is a test field")... | with pytest.raises(ConsoleError): |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.