prompt large_stringlengths 70 991k | completion large_stringlengths 0 1.02k |
|---|---|
<|file_name|>na_ontap_cluster_peer.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'meta... | cluster_peer_get_iter = self.cluster_peer_get_iter(cluster)
result, cluster_info = None, dict() |
<|file_name|>PastebinCom.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
############################################################################
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU Affero General Public License as #
# publi... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># Author: echel0n <echel0n@sickrage.ca>
# URL: https://sickrage.ca
#
# This file is part of SickRage.
#
# SickRage 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 Foun... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|>"""
sentry.db.models
~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from copy import copy
import logging
import six
from bitfield.ty... | return None
return self.__data.get(field_name)
|
<|file_name|>salutations.js<|end_file_name|><|fim▁begin|>/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*... |
{ |
<|file_name|>0002_auto__chg_field_message_updated.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, orm):
... | # Changing field 'Message.updated'
db.alter_column(u'mailer_message', 'updated', self.gf('django.db.models.fields.DateTimeField')())
|
<|file_name|>bravo_mailer.py<|end_file_name|><|fim▁begin|>import smtplib
import argparse
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
def main(args):
# Allow HTML-formatted emails (very simplistic atm, should be expanded if used)
msg = MIMEMultipart("alternative")
if args["bo... | |
<|file_name|>load.go<|end_file_name|><|fim▁begin|>package fsmonitor
import (
"context"
"errors"
log "gopkg.in/inconshreveable/log15.v2"
"github.com/lxc/lxd/lxd/fsmonitor/drivers"
"github.com/lxc/lxd/lxd/storage/filesystem"
"github.com/lxc/lxd/shared/logger"
"github.com/lxc/lxd/shared/logging"
)
// New create... | }
if !filesystem.IsMountPoint(path) { |
<|file_name|>ExamConflictStatisticsInfo.java<|end_file_name|><|fim▁begin|>/*
* Licensed to The Apereo Foundation under one or more contributor license
* agreements. See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*
* The Apereo Foundation licenses this fil... | public String toString() {
return iExamName+" "+iPeriodName+" "+iRoomNames;
}
public Vector getRoomNames() { return iRoomNames; } |
<|file_name|>constants.py<|end_file_name|><|fim▁begin|># Bzrflag
# Copyright 2008-2011 Brigham Young University
#
# This file is part of Bzrflag.
#
# Bzrflag 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, eit... | __copyright__ = "Copyright 2008-2011 Brigham Young University"
__license__ = "GNU GPL"
import math |
<|file_name|>previewbrowser.py<|end_file_name|><|fim▁begin|>"""
Preview Browser Widget.
"""
from xml.sax.saxutils import escape
from PyQt4.QtGui import (
QWidget, QLabel, QListView, QAction, QVBoxLayout, QHBoxLayout, QSizePolicy,
QStyleOption, QStylePainter
)
from PyQt4.QtSvg import QSvgWidget
from PyQt4.Q... | """ |
<|file_name|>users.module.js<|end_file_name|><|fim▁begin|><|fim▁hole|> "use strict";
angular
.module('app.users', [
'app.core'
]);
})();<|fim▁end|> | (function() { |
<|file_name|>randombackground.py<|end_file_name|><|fim▁begin|>import os, random
rfilename=random.choice(os.listdir("/storage/pictures"))
rextension=os.path.splitext(rfilename)[1]
picturespath='/storage/pictures/'
<|fim▁hole|> if filename.startswith("random"):
extension=os.path.splitext(filename)[1]
newname=picturesp... | #TODO Probably dont need a forloop can possibly do random*
#TODO What if the directory is empty?
for filename in os.listdir(picturespath): |
<|file_name|>0002_auto__del_positions__add_position.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
import datetime
from south.db import db<|fim▁hole|>
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Positions'
db.delete_table(u'positions_positions')
# ... | from south.v2 import SchemaMigration
from django.db import models
|
<|file_name|>runner.py<|end_file_name|><|fim▁begin|>#
# Copyright 2013 Red Hat, 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
#
# Unles... | logger,
{'method': 'PythonMethodRunner',
'request_id': request_id})
self._path = path |
<|file_name|>player.py<|end_file_name|><|fim▁begin|>import functools
import itertools
import json
import multiprocessing
import os
import shutil
import sys
import time
import cv2
import numpy
import utility.config
import utility.cv
import utility.geometry
import utility.gui
import utility.image
import utility.log
# ... | # Try next action
continue
utility.log.performance("execute action", start) |
<|file_name|>utils.go<|end_file_name|><|fim▁begin|>package schema
import (
"crypto/md5"
"crypto/rand"
"fmt"
"reflect"
"strings"
"time"
)
var (
// Now is a field hook handler that returns the current time, to be used in
// schema with OnInit and OnUpdate
Now = func(value interface{}) interface{} {
return ti... | // Check next level |
<|file_name|>consts.py<|end_file_name|><|fim▁begin|># -*- coding: UTF-8 -*-<|fim▁hole|>CALL = 'C'
PUT = 'P'<|fim▁end|> | """
Package-wide constants.
"""
|
<|file_name|>DOM.js<|end_file_name|><|fim▁begin|>/**
* DOM manipulation methods
*/
Firestorm.DOM = {
/**
* When turning HTML into nodes - it must be inserted into appropriate tags to stay valid
*/
_wrap_map: {
select: [1, "<select multiple='multiple'>", "</select>"],
fieldset: [1, "<fieldset>", "</fieldset... | range.collapse(true);
range.insertNode(range.createContextualFragment(html));
|
<|file_name|>sanity-check-users-and-groups.py<|end_file_name|><|fim▁begin|>####
#### Give a report on the "sanity" of the users and groups YAML
#### metadata files.
####
#### Example usage to analyze the usual suspects:
#### python3 sanity-check-users-and-groups.py --help
#### Get report of current problems:
#### pyt... | violates_both = set(violations["uri"]).intersection(violations["groups"])
just_uri = set(violations["uri"]).difference(violates_both)
just_groups = set(violations["groups"]).difference(violates_both) |
<|file_name|>visualization.js<|end_file_name|><|fim▁begin|>var visualization = function() {
var vizData;
var vizApp = this;
var padding = 40; // padding between groups
var max_group_width = 600;
// TODO: this assumes fixed note width and height, potentially handle for importance of notes
var max_note_width = 24... | }
var rearrangeNotes = function(arrangement) { |
<|file_name|>menu.rs<|end_file_name|><|fim▁begin|>// Copyright 2016, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use ffi;
use glib_ffi;
use glib::object::Cast;
u... | } |
<|file_name|>OpenSsl.java<|end_file_name|><|fim▁begin|>/*
* Copyright 2014 The Netty Project
*
* The Netty Project licenses this file to you 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:
*
* h... | * <a href="http://netty.io/wiki/forked-tomcat-native.html">{@code netty-tcnative}</a> and its OpenSSL support.
*
* @return the cause if unavailable. {@code null} if available.
*/ |
<|file_name|>pagination.constants.js<|end_file_name|><|fim▁begin|>(function() {
'use strict';
angular
.module('siteApp')
.constant('paginationConstants', {
'itemsPerPage': 20
});<|fim▁hole|><|fim▁end|> | })(); |
<|file_name|>ActivePowerLimit.py<|end_file_name|><|fim▁begin|># Copyright (C) 2010-2011 Richard Lincoln
#
# 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 withou... |
@param value: Value of active power limit.
""" |
<|file_name|>test1.js<|end_file_name|><|fim▁begin|><|fim▁hole|><|fim▁end|> | window.test = 1; |
<|file_name|>many_many_relation.py<|end_file_name|><|fim▁begin|>from sqlalchemy import create_engine, Column, Integer, String, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
# demo many to many relationship
# http://docs.sqlalchemy.org/en... | res = session.query(Club).all()
for club in res:
print club.name, [(member.first_name, member.last_name) for member in club.members] |
<|file_name|>StatusCreated.java<|end_file_name|><|fim▁begin|>package co.edu.uniandes.csw.marketplace.providers;
<|fim▁hole|>@NameBinding
@Retention(RetentionPolicy.RUNTIME)
public @interface StatusCreated {}<|fim▁end|> | import javax.ws.rs.NameBinding;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
|
<|file_name|>resource_aws_directory_service_directory_test.go<|end_file_name|><|fim▁begin|>package aws
import (
"fmt"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/directoryservice"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
fun... | },
resource.TestStep{
Config: testAccDirectoryServiceDirectoryConfig_withSso, |
<|file_name|>non-exhaustive-pattern-witness.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT<|fim▁hole|>//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://open... | // file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT. |
<|file_name|>vendor-list.js<|end_file_name|><|fim▁begin|>/*global angular*/
(function () {
angular
.module('simplAdmin.vendors')<|fim▁hole|>
function VendorListCtrl(vendorService, translateService) {
var vm = this;
vm.tableStateRef = {};
vm.vendors = [];
vm.translate = t... | .controller('VendorListCtrl', ['vendorService', 'translateService', VendorListCtrl]); |
<|file_name|>OnPreparedListener.java<|end_file_name|><|fim▁begin|>package com.arges.sepan.argmusicplayer.Callbacks;<|fim▁hole|>import com.arges.sepan.argmusicplayer.Models.ArgAudio;
//Interfaces
public interface OnPreparedListener {
void onPrepared(ArgAudio audio, int duration);
}<|fim▁end|> | |
<|file_name|>day10.rs<|end_file_name|><|fim▁begin|>use itertools::Itertools;
fn day10(input: &str) -> (usize, usize) {<|fim▁hole|> let mut part1 = 0;
let mut part2 = 0;
loop {
// worst case size is double the digits
let mut buf = String::with_capacity(next.len() * 2);
for (number, li... | let mut i = 1;
let mut next = String::from(input); |
<|file_name|>cmath.rs<|end_file_name|><|fim▁begin|>// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/... | use libc::c_float;
extern { |
<|file_name|>filter_library.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import object
import pandas as pd
import os
import yaml
import astropy.io.votable as votable
import astropy.units as u
import urllib.req... | obs = "TwoMASS"
url_response = urllib.request.urlopen(
"http://svo2.cab.inta-csic.es/svo/theory/fps/fps.php?Facility=%s" % obs |
<|file_name|>regress-100199.js<|end_file_name|><|fim▁begin|>/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); yo... |
string = '[ ]'; |
<|file_name|>wid_anim.cpp<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2011-2020 goblinhack@gmail.com
*
* See the LICENSE file for license.
*/
#include "my_main.h"
#include "my_thing_tile.h"
#include "my_time_util.h"
#include "my_wid.h"
void wid_animate (widp w)<|fim▁hole|> }
tpp tp = wid_get_thing_te... | {_
if (!w->animate) {
return; |
<|file_name|>make_loaddata.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
make_loaddata.py
Convert ken_all.csv to loaddata
"""
import argparse
import csv
def merge_separated_line(args):
"""
yields line
yields a line.
if two (or more) lines has same postalcode,
... | if element[:len(buff[idx])] != buff[idx]: |
<|file_name|>draw.component.ts<|end_file_name|><|fim▁begin|>import { Component, OnInit } from '@angular/core';
import { PersonService } from '../../service/person.service';
@Component({<|fim▁hole|> providers: [
PersonService
]
})
export class DrawComponent implements OnInit {
public mrecord;
public itemsPe... | selector: 'app-draw',
templateUrl: './draw.component.html',
styleUrls: ['./draw.component.scss'], |
<|file_name|>router_5_5_4.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions... | |
<|file_name|>tag-align-shape.rs<|end_file_name|><|fim▁begin|>// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apach... | assert_eq!(y, "t_rec { c8: 22, t: a_tag_var(44) }".to_string());
} |
<|file_name|>hash_location_strategy_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {describe, it, iit, ddescribe, expec... |
it('should not include platform search even with hash', () => {
platformLocation.hash = '#hashPath';
platformLocation.search = '?donotinclude'; |
<|file_name|>IntermediateRepository.java<|end_file_name|><|fim▁begin|>package io.quarkus.it.spring.data.jpa;
import java.io.Serializable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;
@NoRepositoryBean
public interface IntermediateRepositor... | } |
<|file_name|>install.js<|end_file_name|><|fim▁begin|>// increment the number below each time you push a new model version
// (forces rebuild on phone)
var current_migration_version = 1;
// create the tables if required<|fim▁hole|><|fim▁end|> | joli.models.migrate(current_migration_version);
joli.models.initialize(); |
<|file_name|>339NestedListWeightSum.py<|end_file_name|><|fim▁begin|># """
# This is the interface that allows for creating nested lists.
# You should not implement it, or speculate about its implementation
# """
#class NestedInteger:
# def __init__(self, value=None):
# """<|fim▁hole|># If value is not ... | |
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>VERSION = (0, 0, 1, 'dev')
# Dynamically calculate the version based on VERSION tuple
if len(VERSION) > 2 and VERSION[2] is not None:
if isinstance(VERSION[2], int):
str_version = "%s.%s.%s" % VERSION[:3]
else:<|fim▁hole|>__version__ = str_version<|... | str_version = "%s.%s_%s" % VERSION[:3]
else:
str_version = "%s.%s" % VERSION[:2]
|
<|file_name|>tips_goroutine.go<|end_file_name|><|fim▁begin|>/*
goroutine
*/
package tips_dir
import (
"fmt"
"github.com/tlorens/go-ibgetkey"
"io/ioutil"
"math"
"os"
"runtime/pprof"
"strconv"
"sync"
"time"
)
//---------------------------------------------------
// goroutineを生成する
//---------------------------... | |
<|file_name|>job_run_controller.test.js<|end_file_name|><|fim▁begin|>const $ = require('jquery');
const { BagItProfile } = require('../../bagit/bagit_profile');
const { Job } = require('../../core/job');
const { JobRunController } = require('./job_run_controller');
const { PackageOperation } = require('../../core/packa... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.utils.translation import ugettext_lazy as _
from cms.models.pluginmodel import CMSPlugin
from djangocms_text_ckeditor.fields import HTMLField
from easy_thumbnails.alias import aliases
from easy_thumbnails.signals import saved_... |
def __unicode__(self):
return unicode(self.person)
|
<|file_name|>cm_placement_group.py<|end_file_name|><|fim▁begin|>###########################################################################
#
# Copyright 2020 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 o... | |
<|file_name|>base.py<|end_file_name|><|fim▁begin|># coding=utf-8
from ..base import BitbucketBase
class BitbucketCloudBase(BitbucketBase):
def __init__(self, url, *args, **kwargs):
"""
Init the rest api wrapper
:param url: string: The base url used for the rest api.
:param *ar... | |
<|file_name|>report_errors_service_client_config.py<|end_file_name|><|fim▁begin|>config = {
"interfaces": {
"google.devtools.clouderrorreporting.v1beta1.ReportErrorsService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": ... | "max_retry_delay_millis": 60000,
"initial_rpc_timeout_millis": 20000, |
<|file_name|>loggedInUser.js<|end_file_name|><|fim▁begin|>exports.definition = {
config: {
adapter: {
type: "properties",<|fim▁hole|> },
extendModel: function(Model) {
_.extend(Model.prototype, {
/**
* Backbone의 경우 idAttribute는 model에 extend를 통해 바로 넣는다.
* Alloy의 경우 adapter에 넣고 adapter가 model에 넣어준다.
... | collection_name: "loggedInUser"
} |
<|file_name|>upload.py<|end_file_name|><|fim▁begin|>import sys
from craystack import cf
if len(sys.argv) < 4:
print "Usage: %s <key> <subkey> <path>" % sys.argv[0]
sys.exit(2)
_, key, subkey, filename = sys.argv
with open(filename) as f:<|fim▁hole|><|fim▁end|> | content = f.read()
cf.insert(key, {subkey: content})
print "Uploaded %s to %s/%s (%s bytes)" % (filename, key, subkey, len(content)) |
<|file_name|>forms.py<|end_file_name|><|fim▁begin|>import copy
from decimal import Decimal
import datetime
from celery_formtask.tasks import processform, PROGRESS_STATE<|fim▁hole|>class FormTaskMixin:
def __init__(self, *args, task=None, ignored_kwargs=[], **kwargs):
self._task = task
self._args_ba... | |
<|file_name|>issue-19190-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/l... | |
<|file_name|>test_registration.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""" Registration tests """
import os
from shutil import copy
import pytest
from tempfile import TemporaryDirectory
from nipype.pipeline import engine as pe
from ..interfaces.reportlets.registration import (
FLIRTRPT,
Spatial... | )
outputs.out_report = os.path.join(runtime.cwd, objekt.inputs.out_report)
return outputs |
<|file_name|>constructors.rs<|end_file_name|><|fim▁begin|>#![doc="Provides functions to create different types of matrices.
"]
// std imports
// external imports
use num::{Num, One, Zero};
// local imports
use algebra::structure::{MagmaBase, CommutativeMonoidAddPartial, FieldPartial};
use matrix::matrix::{Matrix,
... | } |
<|file_name|>os_release.rs<|end_file_name|><|fim▁begin|>use std::fs;
pub enum OsReleaseId {
Amazon,
CentOs,
Debian,
Ubuntu,
}
const OS_RELEASE_PATH: &str = "/etc/os-release";
impl OsReleaseId {
fn from_os_release_str(s: &str) -> Option<Self> {<|fim▁hole|> "centos" => Some(OsReleaseId::... | let id_line = s.lines().find(|l| l.starts_with("ID="))?;
let id = id_line.trim_start_matches("ID=").trim_matches('"');
match id {
"amzn" => Some(OsReleaseId::Amazon), |
<|file_name|>xcode_emulation.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build system... | additional_settings)
return [(key, env[key]) for key in _TopologicallySortedEnvVarKeys(env)] |
<|file_name|>viewhelpers.py<|end_file_name|><|fim▁begin|>from django.core.urlresolvers import reverse
import django.http
import django.utils.simplejson as json
import functools<|fim▁hole|>def make_url(request, reversible):
return request.build_absolute_uri(reverse(reversible))
def json_output(func):
@functoo... | |
<|file_name|>follow.js<|end_file_name|><|fim▁begin|>/* This is the basic linkfollowing script.
* Its pretty stable, and you configure which keys to use for hinting
*
* TODO: Some pages mess around a lot with the zIndex which
* lets some hints in the background.
* TODO: Some positions are not calculated correctly (... | } else {
for (var j = 0; j < elems[0].length; j++) { |
<|file_name|>test_index_handler.py<|end_file_name|><|fim▁begin|># -*- coding:utf-8 -*-
<|fim▁hole|>import sys
sys.path.append('.')
from tornado.testing import AsyncHTTPSTestCase
from application import APP
class TestSomeHandler(AsyncHTTPSTestCase):
'''
Test
'''
def get_app(self):
'''
... | '''
Test
''' |
<|file_name|>Solution4.java<|end_file_name|><|fim▁begin|>package com.hyh.arithmetic.skills;
import android.annotation.SuppressLint;
import java.util.ArrayList;
import java.util.List;
/**
* 规划了一份需求的技能清单 req_skills,并打算从备选人员名单 people 中选出些人组成一个「必要团队」
* ( 编号为 i 的备选人员 people[i] 含有一份该备选人员掌握的技能列表)。
* 所谓「必要团队」,就是在这个团队中,对于... | person_code += Math.pow(2, index);
}
} |
<|file_name|>JBossCliXmlValidationTestCase.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2014, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
... | |
<|file_name|>submit_batch.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
# coding: utf-8
import BRT
from collections import namedtuple
import configparser
import os
import logging
from os.path import expanduser
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--submit', help='Exe... | |
<|file_name|>policy.py<|end_file_name|><|fim▁begin|># Copyright (c) 2012 OpenStack Foundation.
# 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... | @register("rule")
class RuleCheck(Check):
def __call__(self, target, creds, enforcer):
"""Recursively checks credentials based on the defined rules.""" |
<|file_name|>names.py<|end_file_name|><|fim▁begin|>names = [ # NOQA
'Aan',
'Aalia',
'Aaliah',
'Aaliyah',
'Aaron',
'Aaryanna',
'Aavree',
'Abbie',
'Abbott',
'Abbra',
'Abby',
'Abe',
'Abel',
'Abelardo',
'Abeni',
'Abia',
'Abiba',
'Abie',
'Abigail',
'Abner',
'Abraham',
'Abram',
'Abrial',
'Abrianna',
'Abrienda',
'Abril',
'Ab... | 'Elle', |
<|file_name|>MeanAndStandardDeviation.java<|end_file_name|><|fim▁begin|>/* ===========================================================
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2016, by Object Refinery Limit... | * Returns the mean as a double primitive. If the underlying mean is
* {@code null}, this method will return {@code Double.NaN}.
*
* @return The mean.
|
<|file_name|>rbac.py<|end_file_name|><|fim▁begin|>#
# Copyright 2012 New Dream Network, LLC (DreamHost)
# Copyright 2014 Hewlett-Packard Company
#
# 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 a... | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations |
<|file_name|>document.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 core::nonzero::NonZero;
use devtools_traits::ScriptToDev... | }
/// Initiate a new round of checking for elements requesting focus. The last element to call
/// `request_focus` before `commit_focus_transaction` is called will receive focus. |
<|file_name|>ipv6addr.go<|end_file_name|><|fim▁begin|><|fim▁hole|>type IPv6Addr struct {
HostName string `json:",omitempty"` // ホスト名
IPv6Addr string `json:",omitempty"` // IPv6アドレス
Interface *Interface `json:",omitempty"` // インターフェース
IPv6Net *IPv6Net `json:",omitempty"` // IPv6サブネット
}
// GetIPv6NetI... | package sacloud
// IPv6Addr IPアドレス(IPv6) |
<|file_name|>test_github.py<|end_file_name|><|fim▁begin|>import pytest
from github3 import AuthenticationFailed, GitHubError
from github3.github import GitHub
from .helper import UnitHelper, UnitIteratorHelper
def url_for(path=''):
"""Simple function to generate URLs with the base GitHub URL."""
return 'htt... | """Show that one can iterate over an organization's issues."""
i = self.instance.organization_issues('org')
self.get_next(i)
|
<|file_name|>global_settings.py<|end_file_name|><|fim▁begin|>DATASET_DIR = '/tmp'
BRAIN_DIR = '/tmp'
GENRES = [
'blues', 'classical', 'country', 'disco', 'hiphop',
'jazz', 'metal', 'pop', 'reggae', 'rock'
]
NUM_BEATS = 10
KEEP_FRAMES = 0
TRAIN_TEST_RATIO = [7, 3]
MODE = 'nn'
PCA = False
FEATURES = ['mfc... | |
<|file_name|>conversation_read_webhook.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import messagebird
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--accessKey', help='access key for MessageBird API', type=str, required=True)
parser.add_argument('--webhookId', help='webhook that you... | print(webhook)
except messagebird.client.ErrorException as e:
print('An error occured while requesting a Webhook object:') |
<|file_name|>close.rs<|end_file_name|><|fim▁begin|>use futures_core::future::Future;
use futures_core::task::{Context, Poll};
use futures_io::AsyncWrite;
use std::io;<|fim▁hole|>#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Close<'a, W: ?Sized> {
writer: &'a mut W,
}
impl<W: ?Sized... | use std::pin::Pin;
/// Future for the [`close`](super::AsyncWriteExt::close) method.
#[derive(Debug)] |
<|file_name|>syntax.py<|end_file_name|><|fim▁begin|>import re
import keyword
import logging
import builtins
from keypad.api import BufferController, autoconnect
from keypad.core.syntaxlib import SyntaxHighlighter, lazy
_python_kwlist = frozenset(keyword.kwlist) - frozenset('from import None False True'.split())
_pyt... | ESCAPE = dict(lexcat='literal.string.escape')
STRING = dict(lexcat='literal.string')
COMMENT = dict(lexcat='comment') |
<|file_name|>bitstream_converter.cc<|end_file_name|><|fim▁begin|>// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/filters/bitstream_converter.h"
#include "media/filters/ffmpeg_common... | stream_filter_ = av_bitstream_filter_init(filter_name_.c_str());
return stream_filter_ != NULL; |
<|file_name|>task.service.ts<|end_file_name|><|fim▁begin|>import {Task} from './task.model'
import {Injectable} from 'angular2/core'
import {Http, Response, Headers, RequestOptions} from 'angular2/http';
import {Observable} from "rxjs/Observable";
@Injectable()
export class TaskService {
constructor(
priva... | |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from flask_login import LoginManager, UserMixin, login_user, logout_user, current_user, login_required
from werkzeug.security import generate_password_hash, check_password_hash
import ctf
class User(UserMixin, ctf.db.Model):
__tablename__ = 'users'
id = ctf.... | return check_password_hash(self.password_hash, password)
def __repr__(self): |
<|file_name|>ClassicEncryptedMediaDataSource.java<|end_file_name|><|fim▁begin|>package org.thoughtcrime.securesms.video;
import android.media.MediaDataSource;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import org.thoughtcrime.securesms.crypto.AttachmentSecret;
import org.thoughtcrime... | public long getSize() {
return length;
} |
<|file_name|>nfc_lib.py<|end_file_name|><|fim▁begin|>import random
def append_letter_or_number():
alphabet = ['a','b','c','d','e','f']
use_number = 0
use_letter = 1<|fim▁hole|>
letter_or_string = random.randrange(2)
if letter_or_string == use_number:
result = str(random.randrange(0,9))
... | |
<|file_name|>MockAppModule.java<|end_file_name|><|fim▁begin|>package com.fomdeveloper.planket.injection;
import android.app.Application;
import android.content.Context;
import android.net.ConnectivityManager;
import com.fomdeveloper.planket.BuildConfig;
import com.fomdeveloper.planket.NetworkManager;
import com.fomd... | |
<|file_name|>project.ts<|end_file_name|><|fim▁begin|>import * as fs from 'fs';
import { prerelease } from 'semver';
import { packages } from '../../../../lib/packages';
import { getGlobalVariable } from './env';
import { prependToFile, readFile, replaceInFile, writeFile } from './fs';
import { gitCommit } from './git';... | ][
'sourceRoot' |
<|file_name|>stack_overflow.rs<|end_file_name|><|fim▁begin|>// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/... |
pub struct EXCEPTION_POINTERS { |
<|file_name|>ipcClient.go<|end_file_name|><|fim▁begin|>/*******************************************************************
* Copyright(c) 2000-2015 rjcb99
* All rights reserved.
*
* 文件名称: ipcClient.go
* 简要描述: 一个简单的通过ipcServer通讯的DEMO
*
* 创建日期: 2015-11-27
* 作者: ChenBo
* 说明:
*
* 修改日期: 2015-11-28
* 作者... | println("Init_SysLog() False!") |
<|file_name|>bypass-security.component.ts<|end_file_name|><|fim▁begin|>// #docplaster
// #docregion
import { Component } from '@angular/core';
import { DomSanitizer, SafeResourceUrl, SafeUrl } from '@angular/platform-browser';<|fim▁hole|> templateUrl: './bypass-security.component.html',
})
export class BypassSecurityC... |
@Component({
selector: 'app-bypass-security', |
<|file_name|>restyle_damage.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 restyle damage is a hint that tells layout whi... | self & (REPAINT | REPOSITION)
}
(true, false) => {
// Changing the position of an absolutely-positioned block requires us to reflow |
<|file_name|>serializers.py<|end_file_name|><|fim▁begin|>"""
Serializer for user API
"""
from rest_framework import serializers
from rest_framework.reverse import reverse
from django.template import defaultfilters
from courseware.access import has_access
from student.models import CourseEnrollment, User
from certific... | |
<|file_name|>test_pathod.py<|end_file_name|><|fim▁begin|>import sys
import cStringIO
import OpenSSL
from libpathod import pathod, version
from netlib import tcp, http
from netlib.exceptions import HttpException, TlsException
import tutils
class TestPathod(object):
def test_logging(self):
s = cStringIO.S... | r = self.get(r"200:b'\xf0'")
l = self.d.last_log() |
<|file_name|>_serialize.py<|end_file_name|><|fim▁begin|>import logging
from json import JSONEncoder, dumps
from flask import current_app, make_response, request
__all__ = (
"serialize",
"jsonify",
)
log = logging.getLogger(__name__)
def serialize(rv):
log.debug("Serializing output")
if rv is None ... |
if pretty_print is True and request.is_xhr is False:
indent = 2
separators = (", ", ": ") |
<|file_name|>util.py<|end_file_name|><|fim▁begin|><|fim▁hole|>
from django.conf import settings
from mongodbforms.documentoptions import DocumentMetaWrapper, LazyDocumentMetaWrapper
from mongodbforms.fieldgenerator import MongoDefaultFormFieldGenerator
try:
from django.utils.module_loading import import_by_path
e... | from collections import defaultdict |
<|file_name|>question-mark-type-infer.rs<|end_file_name|><|fim▁begin|>#![feature(question_mark, question_mark_carrier)]
// Test that type inference fails where there are multiple possible return types
// for the `?` operator.
fn f(x: &i32) -> Result<i32, ()> {<|fim▁hole|>fn g() -> Result<Vec<i32>, ()> {
let l = [... | Ok(*x)
}
|
<|file_name|>test_functional.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""Functional tests using WebTest.
See: http://webtest.readthedocs.org/
"""
from flask import url_for
from recruit_app.user.models import User
from .factories import UserFactory
class TestLoggingIn:
"""Login."""
def test_c... | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>const electron = require('electron');
const ipcRenderer = electron.ipcRenderer;
window.onload = function() {
ipcRenderer.send('game-preview-loaded');
}
ipcRenderer.on('game-preview-start', function(event, data) {
var app = new Application({
// resize: true,... | // connect script with uuid |
<|file_name|>users.test.js<|end_file_name|><|fim▁begin|>'use strict'; // eslint-disable-line semi<|fim▁hole|>const request = require('supertest');
const {expect} = require('chai');
const db = require('APP/db');
const app = require('./start');
describe('/api/users', () => {
before('Await database sync', () => db.did... | |
<|file_name|>isPlainObject.js<|end_file_name|><|fim▁begin|>( function () { 'use strict';
function isPlainObject(stuff) {
if (
typeof stuff !== 'object' || stuff === null // Не объект
|| stuff === stuff.window // window
|| stuff.nodeType // DOM node
|| !stuff.constructor
|| ... | |
<|file_name|>exprtools.py<|end_file_name|><|fim▁begin|>"""Tools for manipulating of large commutative expressions. """
from __future__ import print_function, division
from sympy.core.add import Add
from sympy.core.compatibility import iterable, is_sequence, SYMPY_INTS
from sympy.core.mul import Mul, _keep_coeff
from ... | |
<|file_name|>package.rs<|end_file_name|><|fim▁begin|>use std::cmp;
use std::fmt::{Show,Formatter};
use std::fmt;
use std::slice;
use semver::Version;
use core::{
Dependency,
Manifest,
PackageId,
Registry,
Target,
Summary
};
use core::dependency::SerializedDependency;
use util::{CargoResult, gra... |
pub fn get_name(&self) -> &str {
self.get_package_id().get_name() |
<|file_name|>physEnt.js<|end_file_name|><|fim▁begin|>//basic physics entity
//This entity extends the joncom base entity and is responsible for
//collision categories
//property inheritance
//default settings/hooks
//It also defines the ObjectWorld and RenderWorld objects "soma" and "animus" (or whatever distinct names... | fixtureDef.filter.maskBits = senseObj.maskBits;
fixtureDef.isSensor = true;
senseObj.fixture = this.body.CreateFixture(fixtureDef);
console.log(senseObj.fixture.GetFilterData()); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.