text stringlengths 3 1.05M |
|---|
"""Various general purpose utilities."""
import base64
import hashlib
import json
import os
import functools32
from celery import Celery
from pyproc import settings
def read(fpath):
with open(os.path.join(settings.PROJECT, fpath)) as stream:
return stream.read()
@functools32.lru_cache()
def get_secr... |
from __future__ import unicode_literals
from django.apps import AppConfig
class VenturesConfig(AppConfig):
name = 'ballpark.ventures'
|
import streamlit as st
from PIL import Image
from gluoncv import model_zoo, data, utils
import matplotlib.pyplot as plt
def about():
return ('''
This App implements functionalities of 4 State-of-the-art Object Detection Models.
- Single Shot Detector(SSD) Model.` `
[Paper](https://arxiv.org/abs/1512.02325)... |
# Copyright 2014 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.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class Top10MobilePage(page_module.Pag... |
class basic_math:
def sum(x, y):
return x + y
def subtract(x,y):
return x - y
def multiply(x, y):
return x * y
if __name__ == "__main"":
bm = basic_math()
print(bm.sum(5,5))
|
# -*- coding: utf-8 -*-
"""
Created on Wed Jan 4 23:48:26 2017
@author: pchero
"""
import sqlite3 as db
import ast
class DataHandler(object):
# database
con = None # connection
cur = None # cursor
view_handler = None
def __init__(self):
self.con = db.connect("... |
TRACK_WORDS = ['acupuncture']
TABLE_NAME = "Acupuncture"
TABLE_ATTRIBUTES = "id_str VARCHAR(255), created_at DATETIME, text VARCHAR(255), \
polarity INT, subjectivity INT, user_created_at VARCHAR(255), user_location VARCHAR(255), \
user_description VARCHAR(255), user_followers_count INT, longitu... |
# -*- coding: utf-8 -*-
# Copyright 2017 OpenMarket Ltd
#
# 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 required by applicable l... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2011 Gael Guennebaud <gael.guennebaud@inria.fr>
//
// 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... |
from django.urls import path # NOQA
urlpatterns = []
|
import sys, os
sys.path.append(os.pardir)
import numpy as np
import pickle
from dataset.mnist import load_mnist
from common.functions import sigmoid, softmax
def get_data():
(x_train, t_train), (x_test, t_test) = load_mnist(normalize=True, flatten=True, one_hot_label=False)
return x_test, t_test
def init_ne... |
#include <stdio.h>
#include <string.h>
int main()
{
char s[100001], c[100001];
int i, l, m, j, n, s_c[26], c_c[26], k;
char a[ ] = "abcdefghijklmnopqrstuvwxyz";
scanf("%d", &n);
while(n>0){
for(i=0; i<26; i++){
s_c[i] = 0;
c_c[i] = 0;
}
scanf("%*c%s%*c%s", s, c);
//l = str... |
/*
Author: Naval Sharma
Website: https://sfcure.com
GitHub: https://github.com/sfcure/html-email-status-component
License: BSD 3-Clause License
*/
({
getEmailStatusesAsync : function( component, objectName, recordId ) {
var helper = this;
return helper.enqueueAction( component, 'c.getEmailStatuses', {
... |
/**!
* AngularJS file upload/drop directive and service with progress and abort
* @author Danial <danial.farid@gmail.com>
* @version 4.0.0
*/
(function () {
var key, i;
function patchXHR(fnName, newFn) {
window.XMLHttpRequest.prototype[fnName] = newFn(window.XMLHttpRequest.prototype[fnName]);
}
if (window.X... |
"""
The entry module contains all income/expense entry related stuff.
"""
from ipybudget import DEFAULT_CURRENCY
from typing import List, Union, Optional
from decimal import Decimal
from money import Money
from vdom import helpers as v
class Entry:
"""
A Entry represents a income or expense entry in your bu... |
"""
ASGI config for learn_log project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
from tempfile import mkstemp
from shutil import move
import torch
import numpy as np
import os
from mesh_net.mesh_union import MeshUnion
from mesh_net.mesh_process import fill_mesh
# @torch.jit.script
class Mesh(object):
def __init__(self, file=None, export_folder="", hold_history=False, phase="test"):
se... |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2016 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2016 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2016 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2016 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# This program is free software: you can r... |
/* eslint-disable react/display-name */
import React from 'react';
import loginDialogService from '../login-dialog/service';
import Link from '../link/link';
import AuthResponseParser from './response-parser';
export default class IFrameFlow {
hideDialog = null;
constructor(requestBuilder, storage, translations... |
/**********************************************************************
Audacity: A Digital Audio Editor
Compressor.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_EFFECT_COMPRESSOR__
#define __AUDACITY_EFFECT_COMPRESSOR__
#include "TwoPassSimpleM... |
from effigy.QNodeView import QNodeView
from effigy.QNodeScene import QNodeScene
from effigy.QNodeSceneNode import QNodeSceneNode
from effigy.NodeIO import NodeIO, NodeInput, NodeOutput, NodeIODirection, NodeIOMultiplicity
__all__ = ["QNodeView.QNodeView", "QNodeScene.QNodeScene", "QNodeSceneNode.QNodeSceneNode"]
|
import os
import time
import json
from collections import OrderedDict
import importlib
import logging
import argparse
import numpy as np
import random
import torch
import torch.nn as nn
import torch.optim
import torch.utils.data
import torch.backends.cudnn
import torchvision.utils
import torchvision
try:
from ten... |
def to_molsysmt_Topology(item, selection='all', frame_indices='all', syntaxis='MolSysMT'):
from molsysmt.tools.mdtraj_Trajectory import is_mdtraj_Trajectory
from molsysmt.basic import convert
if not is_mdtraj_Trajectory(item):
raise ValueError
tmp_item = convert(item, to_form='molsysmt.Topolo... |
from setuptools import find_namespace_packages, setup, find_packages
# 读取项目的readme介绍
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name="jcs-sdk",
version="1.7.26",
author="sincerexia", # 项目作者
author_email="zhangjh@act.buaa.edu.cn",
description="This is the official P... |
/**
* @file Debounce.h
* @version 1.0
*
* @section License
* Copyright (C) 2015-2016, Mikael Patel
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the ... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... |
# To create a variable
character_name = "Jin"
character_age = "99"
print(character_name + " is " + character_age + " years old.")
# reassigning the variable
character_name = "mochi"
print(character_name + " is " + character_age + " years old.")
print("jin\nacademy")
print(len(character_name))
# to create a new line ... |
"use strict";
function UCAssetsManager(){
var g_objWrapper, g_activePath, g_startPath, g_pathKey, g_objFileList;
var g_objPanel, g_codeMirror, g_objBrowserMove, g_objErrorFilelist;
var g_options = {
single_item_select:false,
custom_startPath:null,
addon_id:null
};
if(!g_ucAdmin){
var g_ucAdmin = n... |
//
// EIReachability.h
// Fotor
//
// Created by Seven on 8/20/15.
// Copyright (c) 2015 Everimaging. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Reachability.h"
typedef NS_ENUM(int, EICurrentNetworkStatus) {
kEICurrentNetworkStatusUnknown = 0,
kEICurrentNetworkStatus2G_3G_4G,
k... |
import unittest
from linguine.corpus import Corpus
from linguine.ops.remove_quotes import RemoveQuotes
class RemoveQuotesTest(unittest.TestCase):
def setUp(self):
self.op = RemoveQuotes()
def test_run(self):
test_data = [Corpus("0", "", 'I said, "The quick brown fox jumped over the lazy dog... |
from django.conf import settings
from django.db import models
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
from django.template.loader import render_to_string
from django.utils.text import unescape_entities
from django.utils.translation import ugettext_lazy as _
from o... |
# coding: utf-8
from __future__ import absolute_import, print_function, unicode_literals
from ilabs.client.ilabs_api import ILabsApi
api = ILabsApi() # uses indirect authentication
out = api.ping()
print('ping:', out)
bibliography_brs = '''<brs:b xmlns:brs="http://innodatalabs.com/brs">
<brs:r>Lucas Theis, Aäron va... |
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { css, Global } from '@emotion/core';
import styled from '@emotion/styled';
import SplitPane from 'react-split-pane';
import {
colors,
colorsRaw,
components,
transitio... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. 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
#
# Unless required by applicable ... |
// ------------------------------------------------------------------
//
// ------------------------------------------------------------------
/* global $ */
/* global d3 */
/* global times */
/* global is_def */
/* global deep_copy */
window.ButtonPanel = function() {
let com = {
}
this.set = function(o... |
///////////////////////////////////////////////////////////////////////////////
//扩展:自定义高度
//////////////////////////////////////////////////////////////////////////////
var fixheight_prototype = {
doLayout: function () {
if (!this.canLayout()) return;
if (this._noLayout && this._doInputLay... |
import os
import time
import imageio
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.optim.lr_scheduler as lr_scheduler
import torch.utils.data as data
import torchvision.transforms as transforms
import transforms as ext_transforms
from models.enet import ENet, ENetDept... |
from typing import Optional, Tuple
from overrides import overrides
import torch
from torch.nn import Conv1d, Linear
from allennlp.modules.seq2vec_encoders.seq2vec_encoder import Seq2VecEncoder
from allennlp.nn import Activation
from allennlp.nn.util import min_value_of_dtype
@Seq2VecEncoder.register("cnn")
class Cn... |
"""
"""
import numpy as np
import moderngl as mgl
def test_cull_face(standalone_context,
prog_render_depth_pass,
vbo_triangle,
fbo_with_rasterised_triangle,
np_triangle_rasterised):
ctx = standalone_context
size = (16,) * 2
ct... |
import orange, orngRFCons
class HarfLearner(orngRFCons.RandomForestLearner):
def __new__(cls, examples=None, agrLevel = 70, **kwds):
self = orngRFCons.RandomForestLearner.__new__(cls, **kwds)
if examples:
self.__init__(**kwds)
return self.__call__(examples, weight)
... |
from .manager import PasswordManager
|
"""Generates and compiles C++ grpc stubs from proto_library rules."""
load("//bazel:generate_cc.bzl", "generate_cc")
load("//bazel:protobuf.bzl", "well_known_proto_libs")
def cc_grpc_library(
name,
srcs,
deps,
proto_only = False,
well_known_protos = False,
generate_mock... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.... |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
import pygeoj
class GeoJSON(object):
def __init__(self, filepath, **kwargs):
self.filepath = filepath
self.kwargs = kwargs
self.reader = self.load_reader()
self.fieldnames, self.fieldtypes = self.load_fields()
self.meta = self.load_meta()
def __len__(self):
r... |
from torch.nn.utils.prune import BasePruningMethod
class ActivationStructed(BasePruningMethod):
def __init__(self, amount, n, dim=-1):
self.amount = amount
self.n = n
self.dim = dim
def compute_mask(self, t, default_mask):
tensor_size = t.shape[self.dim]
nparams_to_prune = |
'use strict';
const fs = require('fs');
const path = require('path');
const yrno = require('../index.js')({
request: {
timeout: 25000
}
});
// response data will be written to a file called res.xml in the
// same directory as this script
const filepath = path.join(__dirname, 'data', 'weather.xml');
yrno.loca... |
from dolfin import *
import instant
from finmag.energies import Exchange
from scipy.integrate import ode
import finmag.util.helpers as h
import finmag.util.consts as consts
import os
import numpy as np
parameters["linear_algebra_backend"] = "PETSc"
parameters["form_compiler"]["cpp_optimize"] = True
ffc_options = {"opt... |
/*!
* @license
* Copyright 2015-2019 Comcast Cable Communications Management, LLC
*
* 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 limitation the... |
// @flow
import React from "react";
import Svg, { Path, G } from "react-native-svg";
type Props = {
size: number,
color: string,
};
export default function CheckCircle({ size = 37, color, ...props }: Props) {
return (
<Svg {...props} viewBox="0 0 37.084 37.084" width={size} height={size}>
<G transform... |
#!/usr/bin/env node
// A protein-spamming program which demonstrates the `depositor()` function.
// To use outside the source tree, replace require('..') with require('gelatin')
'use strict';
const Protein = require('..').Protein;
const depositor = require('..').depositor;
const util = require('util');
// Write the... |
$(function () {
var date = new Date();
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
$('#calendar-holder').fullCalendar({
header: {
left: 'prev, next',
center: 'title',
right: 'month, basicWeek, basicDay,'
... |
const test = require('ava');
const pb2oas = require('..');
test('path is empty', (t) => {
const error = t.throws(pb2oas.bind(null, ''));
t.is(error.message, 'pb2oas Error: "path" is required.');
});
test('title is empty', (t) => {
const error = t.throws(pb2oas.bind(null, __dirname + '/protos/pet.proto'));
t.i... |
# -*- coding: utf-8 -*-
#
# py-ssz documentation build configuration file, created by
# sphinx-quickstart on Thu Oct 16 20:43:24 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#import "MSGraphEntity.h"
@interface MSGraphTeamworkHostedContent : MSGraphEntity
@property (nullable, nonatomic, setter=setContentBytes:, getter=contentBytes)... |
import csv
import logging
import os
from collections import namedtuple
from pathlib import Path
from typing import Dict, Iterator, List, Optional, Type
from django.db import models
log = logging.getLogger(__name__)
NAICSClassificationRow = namedtuple(
"NAICSClassificationRow",
[
"level",
"st... |
// Copyright (c) 2014 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.
"use strict";
var expect = require("chai").expect;
var document = require("./document.js");
describe("template interpolation", function() {
var module = {
foo: function() {},
bar: function() {}
};
module.... |
#pragma once
#include "il2cpp-config.h"
#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif
#include <stdint.h>
#include "mscorlib_System_Object2689449295.h"
// System.Int32[]
struct Int32U5BU5D_t3030399641;
// System.Collections.Generic.Link[]
struct LinkU5BU5D_t62501539;
// UnityEngine.Netwo... |
"""
## This script is for run only test MSRA dataset
"""
# %matplotlib inline
""
import numpy as np
import torch
""
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.backends.cudnn as cudnn
import argparse
import os
from lib.solver import train_epoch, val_epoch, test_epo... |
import colors from './Colors'
export { colors } |
import React from 'react';
const ProfileItem = props => {
return (
<li className="list-item">
<span>{props.name}</span>
</li>
)
}
export default ProfileItem; |
import {
getGroupsWithItemDimensions,
getOrderedGroupsWithItems
} from 'lib/utility/calendar'
import { groups, items } from '../../../__fixtures__/itemsAndGroups'
import { props, state } from '../../../__fixtures__/stateAndProps'
describe('getGroupsWithItemDimensions', () => {
it('should work as expected', () =>... |
from __future__ import absolute_import, division, print_function
import json
import pytest
import stripe
class TestListObject(object):
@pytest.fixture
def list_object(self):
return stripe.ListObject.construct_from(
{"object": "list", "url": "/my/path", "data": ["foo"]}, "mykey"
... |
const chai = require('chai');
const expect = chai.expect;
const assert = chai.assert;
const should = chai.should;
describe("model", () => {
});
|
/**
* Copyright 2017, Yahoo Holdings Inc.
* Licensed under the terms of the MIT license. See accompanying LICENSE.md file for terms.
*
* Usage:
* {{cell-renderers/dimension
* data=row
* column=column
* request=request
* }}
*/
import Ember from 'ember';
import layout from '../../templates/components/cel... |
from typing import Any
import numpy as np
import pandas as pd
from pandas import DataFrame
from sklearn import clone
from sklearn.base import ClassifierMixin
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
from sklearn.linear_model import Perceptron, SGDClassifier
from sklearn.... |
import datetime
from enum import Enum
from pathlib import Path
import shutil
from typing import Iterable, Tuple
from pymediainfo import MediaInfo
from xml.etree.ElementTree import ParseError
class MediaType(Enum):
# NB: These must match camtasia's codes for media types, i.e. as used in 'sourceBin/sourceTracks/ty... |
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of sou... |
"""Test check_config script."""
import logging
import os # noqa: F401 pylint: disable=unused-import
from unittest.mock import patch
import homeassistant.scripts.check_config as check_config
from homeassistant.config import YAML_CONFIG_FILE
from tests.common import get_test_config_dir, patch_yaml_files
_LOGGER = logg... |
var smash = require("smash"),
d3 = require("d3"),
jsdom = require("jsdom");
module.exports = function() {
var files = [].slice.call(arguments).map(function(d) { return "src/" + d; }),
expression = "mpld3",
sandbox = {console: console, d3: d3};
files.unshift("src/start");
files.push("src/ve... |
from tests import BaseTestCase
from redash.models import AccessPermission
from redash.permissions import ACCESS_TYPE_MODIFY, ACCESS_TYPE_VIEW
class TestAccessPermissionGrant(BaseTestCase):
def test_creates_correct_object(self):
q = self.factory.create_query()
permission = AccessPermission.grant(ob... |
import collections
import pandas as pd
import numpy as np
from autoscalingsim.utils.error_check import ErrorChecker
class ServiceScalingInfo:
DEFAULT_PROVIDER_NAME = 'default'
def __init__(self, service_name : str, service_scaling_info_raw : dict, scaled_aspect_name : str):
self.scaled_aspect_name ... |
# coding: utf-8
"""
Wavefront REST API
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the Wavefront REST ... |
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, instal... |
import { useMoralis } from "react-moralis"
import abis from "../helpers/contracts"
import { useEffect, useState } from "react"
import { getHoldemHeroesAddress } from "../helpers/networks"
export const usePostRevealPrice = (tokenId) => {
const { Moralis, isInitialized, chainId } = useMoralis();
const abi = abis.he... |
# 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 required by applicable law or agreed to in writing, software
# distributed under the... |
/*
* This header is generated by classdump-dyld 1.0
* on Tuesday, November 5, 2019 at 2:50:08 AM Mountain Standard Time
* Operating System: Version 13.0 (Build 17J586)
* Image Source: /System/Library/Frameworks/MapKit.framework/MapKit
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
... |
from email.utils import parseaddr
from tornado.web import MissingArgumentError
from tornado import gen
from rethinkdb import r
from tornado import web
from myslice.web.controllers import BaseController
from myslice.web.controllers.login import check_password
class Index(BaseController):
def get(self):
""... |
num = int(input())
i, factorial = 1, 1
while i <= num:
factorial *= i
i += 1
print(factorial)
|
# -*- coding: utf-8 -*-
from PIL import Image
from pynayzr.cropper import crop
class FTVCropper(crop.CropBase):
def __init__(self, image_path=None, img=None):
super().__init__('ftv')
if not image_path and not img:
raise ValueError
if img and not isinstance(img, Image.Image):
... |
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b)... |
import os
import os.path as osp
import numpy as np
import sys
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
from utils import pose_utils
from utils.loss import GANLoss, PixelWiseBCELoss, PixelSoftmaxLoss, VGGLoss, NNLoss, NewL1Loss, TVLoss
from abc import ABC, abstractmethod
import datetime
fr... |
"""Certbot client crypto utility functions.
.. todo:: Make the transition to use PSS rather than PKCS1_v1_5 when the server
is capable of handling the signatures.
"""
import hashlib
import logging
import os
import OpenSSL
import pyrfc3339
import six
import zope.component
from cryptography.hazmat.backends import ... |
"""
This module defines templates for writers of the same type
"""
import csv
from morion.mongomodel import MongoModel
def standard_experiment_write(
model: MongoModel,
new_file: str,
header_filepath,
defaults = {},
experiment_delim='\t',
header_delim: str = ','
):
... |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from .. import _utilities
import typing
# Make subpackages available:
if typing.TYPE_CHECKING:
import pulumi_kubernetes.flowcontrol.v1alpha1 as v1alpha1
impo... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import os
from textwrap import dedent
HERE = os.path.dirname(__file__)
FILE... |
import React, { Component } from 'react';
import {
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native';
import styles from '../styles/Invite.js'
export default class Invite extends Component {
render() {
const onInvite = this.props.onInvite
const name = this.props.name
return ... |
#ifndef _DEFINED_ASW_RIFLE_GRENADE_H
#define _DEFINED_ASW_RIFLE_GRENADE_H
#pragma once
#include "asw_shareddefs.h"
#ifdef CLIENT_DLL
#define CBaseEntity C_BaseEntity
#endif
class CSprite;
class CSpriteTrail;
class CASW_Rifle_Grenade : public CBaseCombatCharacter
{
public:
DECLARE_CLASS( CASW_Rifle_Grenade, CBaseCo... |
#!/usr/bin/env python
import io
import os
import re
from collections import OrderedDict
from setuptools import find_packages, setup
def get_long_description():
for filename in ('README.rst',):
with io.open(filename, 'r', encoding='utf-8') as f:
yield f.read()
def get_version(package):
... |
n, m = list(map(int, input().split()))
rectangular_matrix = []
biggest_square = [-100000, [], [], []]
for _ in range(n):
rectangular_matrix.append(list(map(int, input().split()[:m])))
for row in range(0, n - 2):
for col in range(0, m - 2):
first_row = [rectangular_matrix[row][col], rectangular_matrix[... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-05-17 13:13
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("shop", "0009_epaycallback_md5valid")]
operations = [
migrations.CreateModel(
name="... |
import geosoft.gxpy.gx as gx
import geosoft.gxpy.map as gxmap
import geosoft.gxpy.view as gxview
import geosoft.gxpy.group as gxgroup
import geosoft.gxpy.agg as gxagg
import geosoft.gxpy.grid as gxgrd
import geosoft.gxpy.viewer as gxviewer
gxc = gx.GXpy()
# create a map from grid coordinate system and extent
with gxg... |
"""Common functions and transformers.
"""
from sklearn.base import TransformerMixin
from functools import partial
from nltk.corpus import stopwords
from sklearn.feature_extraction.stop_words import ENGLISH_STOP_WORDS
import spacy
import string
from sklearn.metrics.classification import accuracy_score
STOPLIST = set(s... |
function createMixins() {
function computerQualityMixin(classToExtend) {
let computerQualityMixin = {
getQuality() {
return (this.processorSpeed + this.ram + this.hardDiskSpace) / 3;
},
isFast() {
return this.processorSpeed > (this.ram / 4);
},
isRoomy() {
ret... |
/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/* lib/crypto/crypto_tests/t_hmac.c */
/*
* Copyright 2001,2002 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United State... |
/*
* Copyright (c) 2014, 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 the PATENTS file in the same directory.
*
*/
#pragma once... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: release-1.15
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class V1bet... |
import os
import subprocess
def rcon_exec(server, password, command) -> str:
args = "node {filename} {server} {password}".format(
filename = os.path.dirname(os.path.realpath(__file__)) + "/" + "con.js",
server = server,
password = password
)
process = subprocess.Popen(args.spli... |
# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
import time
from Tea.exceptions import TeaException, UnretryableException
from Tea.request import TeaRequest
from Tea.core import TeaCore
from antchain_alipay_util.antchain_utils import AntchainUtils
from typing import Dict
from antchain_sd... |
# Copyright The PyTorch Lightning 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
#
# Unless required by applicable law or agreed to i... |