text stringlengths 1 927k |
|---|
# Generated by Django 2.1.15 on 2020-03-25 20:14
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_m... |
import os
import traceback
import unittest
from tornado.escape import utf8, native_str, to_unicode
from tornado.template import Template, DictLoader, ParseError, Loader
from tornado.util import ObjectDict
import typing # noqa: F401
class TemplateTest(unittest.TestCase):
def test_simple(self):
template ... |
# -*- coding: utf-8 -*-
import dask
import dask.array as da
from numpy.testing import assert_array_equal
import pyrap.tables as pt
import pytest
from daskms.table_proxy import TableProxy
from daskms.ordering import (ordering_taql,
row_ordering,
group_ordering_... |
# Copyright 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
from typing import List
from ...driver.billing_manager import ProductVersions
from ...instance_config import InstanceConfig
from .resource_utils import family_worker_type_cores_to_gcp_machine_type, gcp_machine_type_to_parts
from .resources import (
GCPComputeResource,
GCPDynamicSizedDiskResource,
GCPIPFeeR... |
# -*-coding:utf-8-*-
from bson import ObjectId
from flask import request
from flask_babel import gettext
from flask_login import current_user
from apps.core.utils.get_config import get_config
from apps.modules.message.process.user_message import insert_user_msg
from apps.utils.format.obj_format import json_to_pyseq
fro... |
import json
import requests
import os
from dotenv import load_dotenv
import datetime
load_dotenv()
batch_size = 130
def get_raw_weather(ids, start_date, end_date):
request_ids = '&stationid='.join(id for id in ids)
return requests.get('https://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=GHCND&stationid=... |
import logging
from .base import * # noqa
from .base import env
# GENERAL
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = env('DJANGO_SECRET_KEY')
# https://docs.djangoproject.com/en/dev/ref/settings/#allow... |
import argparse
import os
from .vscode_extensions import *
from .extensions_json import *
from .vscode_cli import code_open
from .utils import extension_base_name, get_work_dir
parser = argparse.ArgumentParser(add_help=False)
parser.add_argument("path", nargs='?', default=os.getcwd())
group = parser.add_mutually_exclu... |
import logging
import uuid
from django.conf import settings
from django.core.validators import RegexValidator
from django.contrib.gis.db import models
from django.contrib.gis.geos import Polygon
from django.contrib.auth import get_user_model
from django.contrib.postgres.search import SearchVectorField
from django.contr... |
from collections import defaultdict
from tests.data_handler.data_handler_tests_utils import DataHandlerTestsUtils
from covid19_il.data_handler.data_handlers.cities import Cities
from covid19_il.data_handler.enums.resource_id import ResourceId
class TestCities(DataHandlerTestsUtils):
""" Tests for Cities Data Han... |
# Copyright 2016 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.
DEPS = [
'depot_tools/bot_update',
'depot_tools/gclient',
'file',
'depot_tools/gsutil',
'recipe_engine/context',
'recipe_engine/path',
'recipe_... |
#!/usr/bin/env python
from distutils.core import setup
setup(name='btce-bot',
version='0.3',
description='A framework for building trading bots for BTC-e.com.',
author='Alan McIntyre',
author_email='alan.mcintyre@gmail.com',
url='https://github.com/alanmcintyre/btce-bot',
packages=... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import pickle
import socket
import struct
import subprocess
import warnings
import torch
import torch.distributed as dist
def is... |
# Copyright 2020 NREL
# 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
# distri... |
# -*- coding: utf-8 -*-
# ======================================================================================================================
# Copyright (©) 2015-2021 LCS - Laboratoire Catalyse et Spectrochimie, Caen, France. =
# CeCILL-B FREE SOFTWARE LICENSE AGREEMENT - See ful... |
# -*- coding: utf-8 -*-
"""
The cp module is used to execute the logic used by the salt-cp command
line application, salt-cp is NOT intended to broadcast large files, it is
intended to handle text files.
Salt-cp can be used to distribute configuration files
"""
# Import python libs
from __future__ import absolute_impo... |
# Copyright (C) 2012 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
#
# Unless required by applicable law ... |
# encoding: UTF-8
'''
Arducam programable zoom-lens controller.
Copyright (c) 2019-4 Arducam <http://www.arducam.com>.
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 ... |
from collections import OrderedDict
from typing import List, Set
from typing_extensions import TypedDict
KeyBinding = TypedDict('KeyBinding', {
'keys': Set[str],
'help_text': str,
'excluded_from_random_tips': bool,
'key_category': str,
}, total=False)
KEY_BINDINGS = OrderedDict([
('HELP', {
... |
import random
from typing import List
from ._framework import ApiTestCase
class DisplayApplicationsApiTestCase(ApiTestCase):
def test_index(self):
response = self._get("display_applications")
self._assert_status_code_is(response, 200)
as_list = response.json()
assert isinstance(a... |
import pytest
distributed = pytest.importorskip("distributed")
import asyncio
import os
from functools import partial
from operator import add
from distributed.utils_test import client as c # noqa F401
from distributed.utils_test import cluster_fixture # noqa F401
from distributed.utils_test import loop # noqa F4... |
"""
---------
loader.py
---------
A minimal code to store data in MongoDB
"""
import csv
import json
from datetime import datetime
from pymongo import MongoClient
def load_orders():
"""Load orders sample data"""
client = MongoClient('localhost', 27017)
orders = client["orders"]
# insert customers da... |
# (C) Datadog, Inc. 2010-2017
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from itertools import product
import os
import shutil
import tempfile
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
@attr(requires="directory")
clas... |
from flask import Flask, render_template
from flask import request
from random import randint
app = Flask("Cluster Maker")
@app.route("/")
def home():
print("cluster ")
#return "Cluster Maker"
return render_template("index.html")
@app.route("/setdefault")
def setdefaults():
return render_template("... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# ##### BEGIN MIT LICENSE BLOCK #####
#
# Copyright (c) 2015 - 2017 Pixar
#
# 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 u... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... |
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class Regex:
att: Optional[str] = field(
default=None,
metadata={
"type": "Attribute",
"pattern": r"[^\s]{3}",
}
)
@dataclass
class Doc:
class Meta:
name = "doc"
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 19 22:02:53 2021
@author: gbatz97
"""
import torch.nn as nn
import torch
from caflow.models.modules.blocks.FlowBlock import FlowBlock
from caflow.models.modules.blocks.Dequantisation import Dequantisation, VariationalDequantizat... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2020 ASMlover. 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 source code must retain the above copyright... |
from torch import nn
from Models.CRF import CRF
from Models.Transformer import Transformer
from Models.TransformerCtx import TransformerCtx
from Models.SequenceEncoder import SequenceEncoder
from Models.Attention import Attention
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
cl... |
"""The entry point."""
import Scripts |
# Copyright 2014 Facebook, Inc.
# You are hereby granted a non-exclusive, worldwide, royalty-free license to
# use, copy, modify, and distribute this software in source code or binary
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Fa... |
# Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Thomas Beermann, <t... |
import os
import time
import shutil
import argparse
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models.vgg as vgg
import torchvision.datasets as datasets
import torchvision.transforms as transforms
from plain_cnn_cifar import ConvNetMaker, plane_cifar100_boo... |
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
from datetime import datetime
from api_request import Weather
builder = Gtk.Builder()
builder.add_from_file('./glade/main.glade')
class Handler:
def __init__(self, *args, **kwargs):
super(Handler, self).__init__(*args, **kwargs... |
# -*- coding: utf-8 -*-
"""
Created on Wed May 12 16:33:11 2021
@author: Rafael Queiroz
"""
import ordenaarquivo
c1 = ordenaarquivo.OrdenaColunaStd('dados.txt', 2) # variável criada com base no OrdenaColunaStd
c2 = ordenaarquivo.OrdenaColunaMySort('dados.txt', 2) # variável criada com base no OrdenaColunaMySort
pr... |
#!/usr/bin/env python3
import argparse
from Library.usblib import *
def main():
info='MassStorageBackdoor (c) B.Kerler 2019.'
parser = argparse.ArgumentParser(description=info)
print("\n"+info+"\n\n")
parser.add_argument('-vid',metavar="<vid>",help='[Option] Specify vid, default=0x2e04)', default="0x2e... |
from skbuild import setup
setup(
name="hello",
version="1.2.3",
description="a minimal example package",
author='The scikit-build team',
license="MIT",
packages=['hello'],
test_suite='hello_tests'
) |
from functools import lru_cache
from typing import Dict, List, Optional, Set, Tuple, Union
from tartiflette.execution.nodes.variable_definition import (
variable_definition_node_to_executable,
)
from tartiflette.language.ast import (
FieldNode,
FragmentSpreadNode,
InlineFragmentNode,
)
from tartiflette... |
# Copyright The IETF Trust 2015, All Rights Reserved
from django.db import models
class DumpInfo(models.Model):
date = models.DateTimeField()
host = models.CharField(max_length=128) |
# 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 ... |
#!/usr/bin/env python3
#
# 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 of source code must retain the above copyright
# ... |
import numpy as np
import pandas as pd
import pytest
import woodwork as ww
from pandas.testing import assert_frame_equal, assert_series_equal
from evalml.automl import get_default_primary_search_objective
from evalml.data_checks import DefaultDataChecks, OutliersDataCheck
from evalml.data_checks.invalid_target_data_ch... |
from pyopenjtalk.legacy import openjtalk
from nose.plugins.attrib import attr
@attr("local_only")
def test_legacy():
prons, labels, params = openjtalk("こんにちは")
for l in labels:
print(l)
assert "".join(prons) == "コンニチワ" |
import argparse
from collections import defaultdict
from typing import Dict, List
from sacrerouge import build_argument_parser
from sacrerouge.data import Metrics, MetricsDict
from sacrerouge.data.types import ReferenceType, SummaryType
from sacrerouge.io import JsonlReader
def load_summaries(file_path: str) -> List... |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
from django.db import models
from markdown import markdown
# Create your models here.
# Reference: http://www.yaconiello.com/blog/part-1-creating-blog-system-using-django-markdown/
class Category(models.Model):
"""Category Model"""
title = models.CharField(
verbose_name = (u'Title'),
help_text... |
# -*- coding: utf-8 -*-
# This file tests Python 3.4 style unicode strings
# Tests should be skipped on Python < 3.4
from __future__ import print_function
import sys
from itertools import permutations
from numba import njit
import numba.unittest_support as unittest
from .support import (TestCase, no_pyobj_flags, Me... |
NUMBER_TO_LETTER = {
'2': ['a', 'b', 'c'],
'3': ['d', 'e', 'f'],
'4': ['g', 'h', 'i'],
'5': ['j', 'k', 'l'],
'6': ['m', 'n', 'o'],
'7': ['p', 'q', 'r', 's'],
'8': ['t', 'u', 'v'],
'9': ['w', 'x', 'y', 'z'],
}
class Solution:
def letterCombinations(self, digits: str):
if len... |
from setuptools import setup
version = '0.5.1'
setup(
name='coinexpy',
packages=['coinexpy'],
version=version,
license='MIT',
description='Python wrapper for Coinex APIs',
long_description_content_type='text/markdown',
long_description=open('README.md', 'rt').read(),
author='Iman Mousa... |
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import int_or_none
class BeatportIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|pro\.)?beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://beatport.com/track/synesthesia-ori... |
# coding: utf-8
# Copyright 2015 The Oppia 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 requir... |
from datetime import datetime
from demoapp.sign_classifier import Sign
from demoapp.sign_db import SignDB
from demoapp.sign_validator import SignValidator
from django.http import HttpRequest
from django.shortcuts import render
from .forms import *
def index(request):
assert isinstance(request, HttpRequest)
... |
import json
import importlib.util
import inspect
import os
LINE_HEADER = '<func:'
TEMPLATES_PATH = 'tutorials_templates'
TUTORIALS_PATH = 'tutorials'
NOTEBOOK_TEMPLATE = {"cells": [],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
... |
#
# Copyright(c) 2019-2020 Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
import os
import sys
from ctypes import (
c_uint64,
c_uint32,
c_uint16,
c_int
)
from tests.utils.random import RandomStringGenerator, RandomGenerator, DefaultRanges, Range
from pyocf.types.cache import CacheMo... |
# flake8: noqa
# -*- coding: utf-8 -*-
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = "1.0"
import sys
import os
import inspect
import importlib
import sphinx_compas_theme
from sphinx.ext.napoleon.docstring import NumpyDocstring
sys.path.insert(0, os.path.join(os.path.dirn... |
from __future__ import print_function, absolute_import, division # makes KratosMultiphysics backward compatible with python 2.6 and 2.7
# Importing the Kratos Library
import KratosMultiphysics
import KratosMultiphysics.FluidDynamicsApplication as KratosFluid
## Import base class file
from KratosMultiphysics.FluidDyna... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-08-17 19:35
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0024_auto_20170814_1542'),
]
operations = [
migrations.RenameField(
... |
from django.contrib import admin
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.contenttypes.models import ContentType
# Register your models here.
from .models.person import Person
from .models.user import User
from .models.hierarchy_type import Hier... |
import re
import math
from collections import defaultdict
def parse(content):
return list(map(parse_line, content.strip().split("\n")))
def parse_line(row):
matches = re.findall(r"\s?(\d+) ([A-Z]+),? ", row.strip())
inputs = [(int(item[0]), item[1]) for item in matches]
output = re.match(r".+ => (\... |
from docx import Document
from ramile.project_info import ProjectInfo
from ramile.project_processor import ProjectProcessor
from ramile.processors import FileProcessor
import os
class Project(object):
info = None
output = True
files = []
lines = []
def __init__(self, project_root, lines_to_extrac... |
import argparse
import datetime
import numpy as np
import pandas as pd
import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
plt.style.use("./Styles/Scientific.mplstyle")
from typing import Dict, List
import data
import filters
import utilities
import utm
def filter_dvl(data_config: data.DataConf... |
import io
import os
import sys
from shutil import rmtree
from setuptools import find_packages, setup, Command
# Package meta-data.
NAME = 'replicable'
DESCRIPTION = 'Reproducible storage of gridded and stochastically generated simulated datasets'
URL = 'https://github.com/philastrophist/replicable'
EMAIL = 'shaun.c.r... |
#!/usr/bin/env python
# $Id$
# $Revision$
#
# libsnmp - a Python SNMP library
# Copyright (C) 2003 Unicity Pty Ltd <libsnmp@unicity.com.au>
#
# 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 Sof... |
def mostrar(alunos):
print('='*25)
for cont in range(3):
print(f' {cont+1} aluno {alunos["nomes"][cont]}')
print(f' notas {alunos["1nota"][cont]:4.2f}, {alunos["2nota"][cont]:4.2f}, {alunos["3nota"][cont]:4.2f}')
print('='*25) |
"""
给定不同面额的硬币 coins 和一个总金额 amount。编写一个函数来计算可以凑成总金额所需的最少的硬币个数。如果没有任何一种硬币组合能组成总金额,返回 -1。
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/coin-change
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
"""
# 用备忘录解决了重叠子问题
# 是一种剪枝
class Solution:
def coinChange(self,coins, amount: int):
# 备忘录
memo = dict()
... |
import logging
from prvsnlib.utils.run import Run
def hostname(name, secure=False):
logging.header('Hostname ' + name)
Run(['hostnamectl', 'set-hostname', name]).run() |
"""Unit tests for reviewboard.reviews.models.base_comment.StatusUpdate."""
from __future__ import unicode_literals
from django.contrib.auth.models import AnonymousUser, Permission, User
from djblets.testing.decorators import add_fixtures
from reviewboard.accounts.models import LocalSiteProfile
from reviewboard.testi... |
import grama as gr
import pandas as pd
import matplotlib.pyplot as plt
from grama.models import make_cantilever_beam
md_beam = make_cantilever_beam()
md_beam >> \
gr.ev_sinews(n_density=50, n_sweeps=10, df_det="nom", skip=True) >> \
gr.pt_auto()
plt.savefig("../images/ex_beam_sinews_doe.png")
md_beam >> \
... |
from copy import copy
from typing import Tuple
from hypothesis import given
from dendroid.hints import Item
from tests.utils import (Map,
is_left_subtree_less_than_right_subtree,
to_height,
to_max_binary_tree_height,
t... |
import numpy as np
from scipy.stats import norm, truncnorm
from numpy.random import default_rng
### fix the number of different populations
n_pop = 4
def pick_random_hyper(all_hyper, sample_size=None):
rng = default_rng()
size = sample_size or all_hyper.shape[0]
return rng.choice(all_hyper, size=sample_size, repl... |
"""
A ball object to throw.
"""
import numpy as np
from throwable import ThrowableObject
from ..plot import plot_sphere
class Ball(ThrowableObject):
def __init__(self, position, radius, target=False):
"""Ball object that can move, have a velocity, and hit objects
:param position: The position (x... |
#!/usr/bin/env python3
"""Setup script."""
from setuptools import setup
setup(
name="CulinaryApp",
version="0.0.0",
author="Dmitry Karpov, Andrej Lapushkin, Vyacheslav Trifonov",
author_email="dimakarp1996@yandex.ru",
url="https://github.com/dimakarp1996/CulinaryApp",
license="MIT",
packa... |
"""
This file offers the methods to automatically retrieve the graph Thermosipho sp. 1063.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein a... |
'''
Code taken from https://github.com/WilhelmT/ClassMix
Slightly modified
'''
import kornia
import torch
import random
import torch.nn as nn
def normalize_rgb(data, dataset):
"""
Args:
data: data to normalize BxCxWxH
dataset: name of the dataset to normalize
Returns:
normalized... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_miranda
----------------------------------
Tests for `miranda` module.
"""
import pytest
from contextlib import contextmanager
from click.testing import CliRunner
from miranda import miranda
from miranda import cli
@pytest.fixture
def response():
"""Samp... |
# -*- coding: utf-8 -*-
# $Id: config.py 69111 2017-10-17 14:26:02Z vboxsync $
"""
Test Manager Configuration.
"""
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you c... |
import sys
import json
import os
from lxml import html
from datetime import datetime
import requests
from to_json import to_dict
class Crawler:
'''
The crawler class used for retrieving information from sodexo's menu page
Note:
Blitman Commons is not yet included in sodexo's page. The class sho... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... |
'''
文件目录帮助类
'''
import os
import shutil
from utils.commonUtil import CommonUtil
class FileUtil:
'''
处理文件路径
'''
@staticmethod
def cleanPath(path):
path=path.strip('\\');
return path
'''
判断路径是否存在
'''
@staticmethod
def isExists(path):
return os.path.ex... |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""
Jsonschema validation of cloud custodian config.
We start with a walkthrough of the various class registries
of resource types and assemble and generate the schema.
We do some specialization to reduce overall schema size
via reference ... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from django.conf.urls import patterns
from django.conf.urls import url
from networkapi.usuario.resource.AuthenticateResource import AuthenticateResource
authenticate_resource = AuthenticateResource()
urlpatterns = patterns(
'',
url(r'^$', authen... |
from django.urls import path
from smallbusiness.users.views import (
user_detail_view,
user_redirect_view,
user_update_view,
)
app_name = "users"
urlpatterns = [
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~update/", view=user_update_view, name="update"),
path("<str:use... |
###############################################################################
# Version: 1.1
# Last modified on: 3 April, 2016
# Developers: Michael G. Epitropakis
# email: m_(DOT)_epitropakis_(AT)_lancaster_(DOT)_ac_(DOT)_uk
###############################################################################
from ... |
"""
Tests for 2D compatibility.
"""
import numpy as np
import pytest
from pandas._libs.missing import is_matching_na
import pandas as pd
from pandas.core.arrays.integer import INT_STR_TO_DTYPE
from pandas.tests.extension.base.base import BaseExtensionTests
class Dim2CompatTests(BaseExtensionTests):
def test_tra... |
# python join code
# Copyright Andrew Tridgell 2010
# Copyright Andrew Bartlett 2010
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any ... |
#! /usr/bin/env python
from spider import *
sys.path.append("..")
from utils import Utils
class EthzSpider(Spider):
def __init__(self):
Spider.__init__(self)
self.school = "ethz"
self.semkezDict = {}
self.deptDict = {}
self.utils = Utils()
def processData(self, semkez,... |
"""Component to interface with various media players."""
from __future__ import annotations
import asyncio
import base64
import collections
from collections.abc import Callable
from contextlib import suppress
from dataclasses import dataclass
import datetime as dt
import functools as ft
import hashlib
from http import... |
"""Support for interface with an Aquos TV."""
import logging
import sharp_aquos_rc
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
SUPPORT_PLAY,
SU... |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019-2020 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... |
from addon_core import Addon
from helloworld_core.helloworld_base import Helloworld
from helloworld_core._version import __version__ |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# written by Shotaro Fujimoto
# 2016-12-07
import matplotlib.pyplot as plt
# from mpl_toolkits.mplot3d.axes3d import Axes3D
import matplotlib.cm as cm
import numpy as np
from scipy.optimize import curve_fit
from scipy.stats import gamma
import set_data_path
def load_dat... |
import pandas as pd
from datetime import datetime
from emoji import UNICODE_EMOJI
from tqdm import tqdm
import logging
from collections import Counter
from wordcloud import WordCloud, STOPWORDS
import matplotlib as plt
import nltk
import seaborn as sns
import string
from functools import reduce
import networkx as nx
fr... |
import pytest
from cx_core.controller import TypeController
class FakeTypeController(TypeController):
def get_domain(self):
return "domain"
@pytest.fixture
def sut(hass_mock):
c = FakeTypeController()
c.args = {}
return c
# All entities from '{entity}' must be from {domain} domain (e.g. {... |
import ops, ops.menu, ops.data, ops.cmd
import dsz, dsz.ui, dsz.version, dsz.windows
import os.path
from random import randint
stVersion = '1.14'
def getimplantID():
id = int(randint(0, 4294967295L))
return id
def regadd(regaddcommand):
value = None
if ('value' in regaddcommand.optdict):
value... |
import json
from urllib.parse import urlparse, urlunparse
from oauthlib import oauth2
from oauthlib.common import quote, urlencode, urlencoded
from .exceptions import FatalClientError, OAuthToolkitError
from .settings import oauth2_settings
class OAuthLibCore(object):
"""
TODO: add docs
"""
def __in... |
import setuptools
with open('README.md', 'r') as f:
long_description = f.read()
setuptools.setup(
name='jtbl',
version='1.1.7',
author='Kelly Brazil',
author_email='kellyjonbrazil@gmail.com',
description='A simple cli tool to print JSON and JSON Lines data as a table in the terminal.',
ins... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.