text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-19 18:17
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vmleases', '0001_initial'),
]
operations = [
migrations.AddField(
... |
import pprint
import pickle
import socket
import exceptions
import time
import uuid
import numpy as np
import threading
import os
import sys
import cStringIO
import io
import base64
import traceback
import gc
import json
import obspy
import datetime
from obspy.core import read,UTCDateTime,Stream,Trace
import multiproce... |
import numpy as np
import matplotlib.pyplot as plt
from .kdeplot import kdeplot
from ..stats import bfmi as e_bfmi
from ..utils import get_stats
def energyplot(trace, kind='kde', bfmi=True, figsize=None, legend=True, fill_alpha=(1, .75),
fill_color=('C0', 'C5'), bw=4.5, skip_first=0, fill_kwargs=None, ... |
"""Tests for hyp2f1 for complex values.
Author: Albert Steppi, with credit to Adam Kullberg (FormerPhycisist) for
the implementation of mp_hyp2f1 below, which modifies mpmath's hyp2f1 to
return the same branch as scipy's on the standard branch cut.
"""
import sys
import pytest
import numpy as np
from typing import Na... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_commoner_tatooine_aqualish_female_08.iff"
result.attri... |
#!/usr/bin/env python
import subprocess
def __external_cmd(cmd, code="utf8"):
print(cmd)
process = subprocess.Popen(cmd, shell=True, bufsize=0, stdout=subprocess.PIPE, universal_newlines=True)
while True:
next_line = process.stdout.readline()
print(next_line.strip())
if next_line =... |
from django.contrib import admin
from .models import Distrik, Kampung, Nelayan, Produk, Order, OrderItem
class PageDistrik(admin.ModelAdmin):
list_display = ('id_distrik','nama_distrik')
list_display_links = ('id_distrik','nama_distrik')
search_fields = ('id_distrik','nama_distrik')
list_per_page = 10
... |
# coding: utf-8
"""
Yapily API
To access endpoints that require authentication, use your application key and secret created in the Dashboard (https://dashboard.yapily.com) # noqa: E501
The version of the OpenAPI document: 1.154.0
Generated by: https://openapi-generator.tech
"""
from __future__ imp... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Email: guangmingwu2010@gmail.com
@Copyright: go-hiroaki
@License: MIT
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from .blocks import *
class MCFCN(nn.Module):
def __init__(self,
nb_channel=3,... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
# DEPRECATED from v3.4.0.
from imp import find_module, load_module, new_module, PKG_DIRECTORY
import os
import sys
from pytransform import PytransformError, init_runtime, import_module
_ext = '.py' + os.getenv('PYARMOR_EXTRA_CHAR', 'e')
class PyshieldImporter(object):
'''Import encrypted module or package, packa... |
from helpers.common import JsonFile, dict_keys
from console.logger import info, debug
import os
import json
__name__ = "ConfigModule"
__author__ = "RealistikDash"
__version__ = "v2.0.0"
class ConfigReader:
"""A parent class meant for the easy management, updating
and the creation of a configuration `JSON` fil... |
# Copyright 2020 The mT5 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 required by applicable law or agreed to in writ... |
import uuid
from datetime import datetime, timezone, timedelta
from decimal import Decimal
import pytest
import json
from typing import Dict
from unittest.mock import patch, Mock
from stellar_sdk import Keypair, MuxedAccount
from rest_framework.request import Request
from polaris.tests.conftest import USD_DISTRIBUTI... |
#!/usr/bin/env python3
X_B = {
("B", "s1"): ("X", "R", "s2"),
("B", "s2"): ("B", "L", "s3"),
("X", "s3"): ("B", "R", "s4"),
("B", "s4"): ("B", "L", "s1"),
}
def print_state(tape, head, state):
print(state, ":", "".join(tape))
print(" ", " "*head, "^")
def execute(instructions):
# init ... |
from flask import request, jsonify
from app.apis import api
from app.models.content import Content
@api.route('/getContent', methods=['GET', 'POST'])
def get_content():
this_id = request.json.get("fileId")
result = Content.query.filter_by(id=this_id).first()
# return jsonify({'result': str(result.chief_c... |
#!/usr/bin/env python3
# Copyright (c) 2013-2015, Rethink Robotics
# 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 of source code must retain the above copyright notice,
# ... |
import json
import os
TEAM_RADIANT = 2
TEAM_DIRE = 3
def get_draft_message(draft):
from luafun.game.action import DraftAction
return {
DraftAction.EnableDraft: draft,
DraftAction.SelectHero: None,
DraftAction.BanHero: None,
DraftAction.Lane: None
}
def new_ipc_message(... |
import click
from catacomb.common import constants
from catacomb.utils import catacomb_handler, formatter
@click.command(
constants.CMD_BURY_NAME, help=constants.CMD_BURY_DESC,
short_help=constants.CMD_BURY_DESC)
@click.argument("tomb_name", nargs=1)
@click.option(
"--force", "-f", is_flag=True, default=... |
# -*- coding: utf-8 -*-
# # Not your grandmother’s toolbox– the Robotics Toolbox reinvented for python
# ### Peter Corke and Jesse Haviland
#
# This is the code for the examples in the paper published at ICRA2021.
#
import swift.Swift
import spatialmath.base.symbolic as sym
from roboticstoolbox import ETS as ET
from r... |
# Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
import numpy as np
from zipline.pipeline.data import CNEquityPricing
from zipline.pipeline.factors import CustomFactor
from zipline.pipeline.factors.statistical import vectorized_beta
from zipline.pipeline.fundamentals import Fundamentals
from zipline.utils.math_utils import nanmean
PPY = 244 # 每年交易天数
class BaseE... |
# ----------------------------------------
# Libraries
# ---------------------------------------
import pandas as pd
import numpy as np
from geopy.geocoders import Nominatim
import ipywidgets as widgets
from ipywidgets import fixed
from matplotlib import gridspec
from matplotlib import pyplot as plt
impor... |
"""
Copyright (c) 2018-2022 Intel 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.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
from django.db import models
from cajas.units.models import Unit
from .employee import Employee
class DailySquareUnits(models.Model):
"""
"""
employee = models.OneToOneField(
Employee,
verbose_name='Empleado',
on_delete=models.SET_NULL,
blank=True, null=True
)
un... |
import re
import string
import xml.etree.ElementTree as ET
def visitComponentDeclaration(compDecl):
name = compDecl.tag
name = name[0].upper() + name[1:]
fields = []
for field in compDecl:
fieldName = field.tag
fieldType = field.attrib.get('type')
fieldType = ... |
#! /usr/bin/python
###############################################################################
# GETTING STARTED
###############################################################################
# PSEUDO-CONSTANTS
# should the script be quiet (no standard output, only file out)
def QUIET():
return False
def REF():... |
import abc
import argparse
import errno
import hashlib
import logging
import os
import signal
import subprocess
import threading
import time
from builtins import range
from multiprocessing.pool import ThreadPool
from future.utils import with_metaclass
try:
import resource
except ImportError:
resource = None
... |
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from types import MappingProxyType
from typing import Collection, Mapping, Optional
from .builtins import builtins
from .daml_lf_1 import Block, Expr, Type, ValName
from .protoc... |
# Copyright 2020 by Aaron Baker.
# All rights reserved.
# This file is part of the Nightcap Project,
# and is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
# region Imports
import os
import json
import hashlib
import shutil
from pathlib... |
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from collections import deque
import statistics
import sys
import pandas as pd
import seaborn as sns
import bisect
from sklearn.svm import SVC
from sklearn import decomposition
class Parser(object):
"""
Given filename,... |
from .glm import glm_train
from .glm import glm_predict
from .linear_regression import linear_regression_train
from .linear_regression import linear_regression_predict
from .xgb_regression import xgb_regression_train
from .xgb_regression import xgb_regression_predict
from .decision_tree_regression import decision... |
# Copyright 2019, A10 Networks
#
# 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 a... |
import pytest
from mtsg import GenomeBuild
def test_parse() -> None:
assert GenomeBuild.parse("GRCh37") == GenomeBuild.GRCH37
assert GenomeBuild.parse("GRCh38") == GenomeBuild.GRCH38
assert GenomeBuild.parse("mm9") == GenomeBuild.MM9
assert GenomeBuild.parse("mm10") == GenomeBuild.MM10
assert Gen... |
# Copyright 2018 Datawire. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
from inspect import getargspec
import functools
from fulforddata import constants as c
def prepare_argument(fn, contexts):
"""
Implements dependency injection.
(Passes only the arguments fn expects from contexts dicitonary)
"""
args, varargs, varkwargs, defaults = getargspec(fn)
arguments = ... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 26 18:17:25 2018
@author: Ian
"""
from keras.models import Sequential
from keras.layers.normalization import BatchNormalization
from keras.layers.convolutional import Conv2D
from keras.layers.convolutional import MaxPooling2D
from keras.layers.core import Acti... |
import requests
import shutil
from bs4 import BeautifulSoup
from subprocess import call
newbanner = 'file://~/phishingfortruth/newheader.png'
# assume url starts with http://
fakeurl = 'http://www.breitbart.com/big-journalism/2017/02/04/tancredo-the-disgusting-media-double-standard-between-obama-and-trump/'
shutil.r... |
import asyncio
import traceback
import cogs.utils.context as context
import cogs.utils.permission_checks as permissions
import discord
from discord.ext import commands
class ReactionRoles(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.cached_messages = {}
@commands.guild_only()
... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
from django.shortcuts import render, redirect
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from .forms import UserUpdateForm, ProfileUpdateForm, UserRegisterForm
# Create your views here.
def register(request):
if(request... |
# ============================================================================
# FILE: child.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from collections import defaultdict
from pathlib import Path
from... |
import os
import sacred
from imitation.scripts.config.common import DEFAULT_INIT_RL_KWARGS
from imitation.util import util
expert_demos_ex = sacred.Experiment("expert_demos")
@expert_demos_ex.config
def expert_demos_defaults():
# env_name = "CartPole-v1" # The gym.Env name
# total_timesteps = int(1e6) # Nu... |
import os
from collections import OrderedDict
from datetime import timedelta
import raven
import raven.contrib.celery
from django.utils.translation import gettext_lazy as _
__version__ = '0.0.0'
"""
Django settings for dashboard project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more informa... |
# Copyright (c) 2009-2022 The Regents of the University of Michigan.
# Part of HOOMD-blue, released under the BSD 3-Clause License.
import hoomd
from hoomd import md
from hoomd.conftest import expected_loggable_params
from hoomd.conftest import logging_check, pickling_check
import pytest
import numpy as np
import ite... |
import os
class AppConfig(object):
SECRET_KEY = os.environ.get('APP_SECRET', 'secret-key')
# Paths
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
STATIC_DIR = os.path.abspath(os.path.join(APP_DIR, 'static', 'build'))
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pa... |
"""The tests for the MQTT switch platform."""
import copy
from unittest.mock import patch
import pytest
from homeassistant.components import switch
from homeassistant.components.mqtt.switch import MQTT_SWITCH_ATTRIBUTES_BLOCKED
from homeassistant.const import (
ATTR_ASSUMED_STATE,
ATTR_DEVICE_CLASS,
STATE... |
# 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.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
"""
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import pytest
from gremlin_python.structure.graph import Vertex
from test.integration import IntegrationTest
class TestGremlin(IntegrationTest):
@pytest.mark.gremlin
def test_do_gremlin_query(self):... |
#!/usr/bin/python3
# xlreg_py/setup.py
""" Setuptools project configuration for xlreg_py. """
from os.path import exists
from setuptools import setup
LONG_DESC = None
if exists('README.md'):
with open('README.md', 'r') as file:
LONG_DESC = file.read()
setup(name='xlreg_py',
version='0.1.31',
... |
a = 1
b = 2
c = a + b
print(c == (a + b))
|
import numpy as np
import shutil
import os
import tqdm
import tensorflow as tf
from tensorflow.contrib.eager.python import tfe
from tensorflow.python.keras.models import Model
from tensorflow.python.keras.callbacks import ModelCheckpoint
if not os.path.exists('temp_weights/'):
os.makedirs('temp_weights/')
else:
... |
#!/usr/bin/env python3
#
# __init__.py
"""
Run pyupgrade on all files in a directory, and optionally recursively.
"""
#
# Copyright (c) 2020 Dominic Davis-Foster <dominic@davis-foster.co.uk>
# MIT Licensed
#
# stdlib
import pathlib
from typing import Iterable, List
__author__ = "Dominic Davis-Foster"
__copyright__... |
# Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
import os
from azure.storage.blob import BlobServiceClient, BlobPrefix, BlobProperties
class BlobStorageClient():
"""Azure Blob Storage Client."""
def __init__(self):
connect_str = os.getenv('AZURE_STORAGE_CONNECTION_STRING')
if not connect_str:
msg = 'Please add the connection s... |
# SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class BitShift(Base):
@staticmethod
def exp... |
from flask import Flask
app = Flask(__name__)
@app.route("/")
def index():
return "Hello world!"
if __name__=="__main__":
app.run()
|
try:
import urllib2
except:
print "urllib2 is not installed"
try:
from bs4 import BeautifulSoup as BS
except:
print "BeautifulSoup4 is not installed , try sudo pip install BeautifulSoup4"
import os
import sys
from subprocess import call
com_link="http://www.kissanime.com/Anime/One-Piece"
com_link="... |
class Debugger(object):
"""
Enables communication with a debugger. This class cannot be inherited.
Debugger()
"""
@staticmethod
def Break():
"""
Break()
Signals a breakpoint to an attached debugger.
"""
pass
@staticmethod
def IsLogging():
"""
IsLogging() -> bool
... |
from PyQt5 import QtGui, QtCore, QtWidgets
from PyQt5.QtWidgets import QGraphicsView, QGraphicsScene, QGraphicsLineItem
from PyQt5.QtWidgets import QListWidgetItem, QFileDialog
from PyQt5.QtGui import QPainter, QImage, QPixmap
from PyQt5.QtPrintSupport import QPrinter
from PyQt5.QtCore import QFileInfo
from PyQt5.QtCor... |
# Copyright 2017-2020 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... |
# 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 th... |
#!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = '''
---
module: identity_user
short_description: Manage OpenStack Identity Users
author: OpenStack Ansible SIG
description:
-... |
# Basic Variable Assignment
print('''A student learning Python was trying to make a function.
His code should concatenate a passed string name with string 'Vasudev' and
store it in a variable called result. He needs your help to fix this code. ''')
def name_String():
a = input("Enter First String : ")
b =... |
# -*- coding: utf-8 -*-
import json
text = open('tree.txt', 'rb')
data = {"images": []}
for line in text:
import re
if re.match('├── ', line):
data["images"].append(line.split('├── ')[1].strip())
elif re.match('└── ', line):
data["images"].append(line.split('└── ')[1].strip())
else:
... |
from django.conf import settings
from .. import Error, Tags, register
@register(Tags.compatibility)
def check_csrf_trusted_origins(app_configs, **kwargs):
errors = []
for origin in settings.CSRF_TRUSTED_ORIGINS:
if "://" not in origin:
errors.append(
Error(
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import codecs
from setuptools import setup
def read(fname):
file_path = os.path.join(os.path.dirname(__file__), fname)
return codecs.open(file_path, encoding='utf-8').read()
setup(
name='pytest-param-priority',
version='0.1.0',
author='Vic... |
from helpinghand.analyse.CircuitAnalyser import CircuitAnalyser
from helpinghand.analyse.CircuitAnalytics import CircuitAnalytics
|
r"""
Data objects (:mod: `qiita_db.data`)
====================================
..currentmodule:: qiita_db.data
This module provides functionality for creating, running, and storing results
of jobs in an analysis. It also provides the ability to query what commmands
are available for jobs, as well as the options for t... |
# Copyright 2017 reinforce.io. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
import unittest
import networkx as nx
import numpy
from graspologic.layouts.auto import _get_bounds, layout_umap
class TestAuto(unittest.TestCase):
def test_get_bounds(self):
y = numpy.array([(1, 2), (4, 5), (-1, ... |
# -*- coding: utf-8 -*-
import os
from xltpl.writerx import BookWriter as BookWriterx
def write_test(writer_cls, tpl_fname, result_fname):
pth = os.path.dirname(__file__)
fname = os.path.join(pth, tpl_fname)
writer = writer_cls(fname, debug=True)
rows = [
['1800909831', [
... |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... |
#!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', '..'))
#============================ verify installation =============================
from SmartMe... |
import pathlib
from setuptools import setup
here = pathlib.Path(__file__).parent
readme = (here / "README.md").read_text()
setup(
name = "Malas",
version = "1.0.210930.0001",
description = "Malas (Multi-vendor automation leverage at slouching)",
long_description = readme,
long_descripti... |
# coding: utf-8
"""
metal-api
API to manage and control plane resources like machines, switches, operating system images, machine sizes, networks, IP addresses and more # noqa: E501
OpenAPI spec version: v0.15.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __futur... |
# Copyright 2019-2020 Xanadu Quantum Technologies 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
# Unless required by applicable law or... |
"""
Created by Epic at 12/31/20
"""
from logging import getLogger
from speedcord.ext.typing.context import MessageContext
from speedcord.http import Route
class Cog:
def __init__(self, client):
self.client = client
self.logger = getLogger("speedian.cogs.%s" % self.__module__)
self.commands... |
#!/usr/bin/env python
__author__ = 'Akalanka Galappaththi'
__email__ = 'a.galappaththi@uleth.ca'
__copyright__ = 'Copyright 2020, The Bug Report Summarization Project @ Sybil-Lab'
__license__ = 'MIT'
__maintainer__ = 'Akalanka Galappaththi'
import unittest
from models.BugReport import BugReport
from models.Turn impo... |
# Copyright 2020 Petuum, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
from __future__ import division
import warnings
import cv2
import numpy as np
import data_loader
from utils import get_args
warnings.filterwarnings("ignore")
def rotate(img, alpha):
"""
img.shape must be H,W,C
alpha is in degrees
"""
h, w = img.shape[:-1]
M = cv2.getRotationMatrix2D((h / 2... |
import crab.base
from copy import deepcopy
NAME = __file__.split('/')[-1].replace('.pyc', '')
NAME = NAME.split('/')[-1].replace('.py', '')
CAMPAIGN = __file__.split('/')[-2]
config = deepcopy(crab.base.config)
config.General.requestName = NAME
config.Data.outputDatasetTag = NAME
config.Data.outLFNDirBase += '/' + CAM... |
from office365.runtime.client_value import ClientValue
class KeyCredential(ClientValue):
"""
Contains a key credential associated with an application .
The keyCredentials property of the application entity is a collection of keyCredential.
"""
|
# -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# 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
# rights to use, copy, mo... |
from src.utils.MultiPage import MultiPage
from src.apps import first_app, second_app, third_app
app = MultiPage()
app.add_app('App1',first_app.app)
app.add_app('App2',second_app.app)
app.add_app('App3',third_app.app)
app.run() |
from django.core.files.storage import default_storage
from django.http import JsonResponse
def upload_attachment(request):
if request.method == "POST":
attachment = request.FILES["file"]
key = request.POST["key"]
path = f"prose/{key}"
default_storage.save(path, attachment)
... |
"""
Provide the groupby split-apply-combine paradigm. Define the GroupBy
class providing the base-class of operations.
The SeriesGroupBy and DataFrameGroupBy sub-class
(defined in pandas.core.groupby.generic)
expose these user-facing objects to provide specific functionality.
"""
from __future__ import annotations
fr... |
# 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
"""
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
from datetime import timedelta
from itertools import groupby
import logging
import voluptuous as vol
from homeassistant.loader import bind_h... |
# coding=utf-8
# Copyright 2021 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... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Li... |
# Generated by Django 2.2.4 on 2019-08-20 19:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0049_auto_20190820_0242'),
]
operations = [
migrations.CreateModel(
name='PyProductWebCategory',
fields=[
... |
from weakref import ref
from decimal import Decimal
import re
import datetime
import traceback, sys
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (ObjectProperty, DictProperty, NumericProperty,
... |
"""
Funds API For Digital Portals
Search for mutual funds and ETFs using one single consolidated API, including a criteria-based screener. The API provides also base data, key figures, and holdings. A separate endpoint returns the possible values and value range for the parameters that the endpoint /fund/nota... |
#!/usr/bin/env python3
"""
a cli app that simply generates a random 64 character alphanumeric string.
"""
__version__ = "1.0.1"
import secrets
import string
import click
@click.command()
@click.option(
'--type',
default='alphanumeric',
help='alphanumeric (default), print, letters, lower, upper, hex')
@c... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from setuptools import setup, find_packages
except ImportError:
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
VERSION = __import__('colorbox').__version__
setup(
n... |
import os,re
node_version_h = os.path.join(os.path.dirname(__file__), '..', 'src',
'node_version.h')
f = open(node_version_h)
for line in f:
if re.match('#define NODE_MAJOR_VERSION', line):
major = line.split()[2]
if re.match('#define NODE_MINOR_VERSION', line):
minor = line.split()[2]
if re.match(... |
import mmcv
def wider_face_classes():
return ['face']
def voc_classes():
return [
'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat',
'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', 'person',
'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'
]
... |
from transonic import boost
A = "int[]"
@boost
def add(f: A, g: A):
return f + g
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.