text stringlengths 2 999k |
|---|
from src.structures import Method
class Class:
GLOBAL_INT_TOP = 10_000
GLOBAL_REAL_TOP = 11_000
GLOBAL_BOOLEAN_TOP = 12_000
GLOBAL_TEXT_TOP = 13_000
GLOBAL_OBJECT_TOP = 50_000
GLOBAL_INT_BOTTOM = 10_999
GLOBAL_REAL_BOTTOM = 11_999
GLOBAL_BOOLEAN_BOTTOM = 12_999
GLOBAL_TEXT_BOTTOM ... |
import generaluser_ui
from admin_ui import Ui_Window_admin
import course_inquiry_ui
from login_ui import Ui_Window_login
import sys
from PyQt5 import QtWidgets
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
login_window = Ui_Window_login()
# admin_window = Ui_Window_admin()
MainWin... |
#!/usr/bin/env python
sum = 0
for i in [0, 1, 2, 3, 4]:
sum += i
print sum
sum = 0
n = [1, 2, 3, 4, 5]
cnt = 0
while cnt < 5:
sum += n[cnt]
cnt += 1
print sum
|
"""
Copyright (c) 2018 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 __future__ import absolute_import
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'NIHR_Assimilator.settings')
app = Celery('NIHR_Assimilator')
# Using a string here means the worker will not have to
# pickle the object when using Windows.
app.config_from_object('django.con... |
"""
(c) Copyright 2016 Hewlett-Packard Enterprise Development Company, L.P.
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 applic... |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""This module contains a class for handling request queries."""
class BadQueryException(Exception):
pass
|
from fastapi import APIRouter, Depends, status, HTTPException, Response
from fastapi.security.oauth2 import OAuth2PasswordRequestForm
from sqlalchemy.orm import Session
from .. import database, schemas, models, utils, oauth2
router = APIRouter(tags=["Authentication"])
@router.post("/login", response_model=schemas.T... |
import numpy as np
import matplotlib.pyplot as plt
import networkx as nx
import genetic_partition_test as gp
def load_graph (edgelist):
G = nx.read_edgelist (edgelist, nodetype = str, create_using=nx.DiGraph())
return G
def community_layout(g, partition):
"""
Compute the layout for a modular graph.
... |
import unittest
import mock
import logging
import esgfpid
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
class LoggerMock(object):
def __init__(self):
self.info_messages = []
self.debug_messages = []
self.error_messages = []
self.warn_messages = []
... |
import functools
import logging
import os
import pathlib
import sys
import sysconfig
from typing import List, Optional
from pip._internal.models.scheme import SCHEME_KEYS, Scheme
from . import _distutils, _sysconfig
from .base import (
USER_CACHE_DIR,
get_major_minor_version,
get_src_prefix,
is_osx_fr... |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from scipy.interpolate import UnivariateSpline, splrep, splev
from scipy.optimize import leastsq
import abel
from abel import _deprecated, _deprecate
####################################... |
# 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 ... |
# -*- coding: utf-8 -*-
# Example for using WebDriver object: driver = get_driver() e.g driver.current_url
from QAutoLibrary.extension import TESTDATA
from selenium.webdriver.common.by import By
from QAutoLibrary.QAutoSelenium import *
from time import sleep
class Cs_sec_servers_details_del_confirm(CommonUtils):
"... |
from unittest.case import TestCase
from Section04_Prototype.Practice.Line import Line
from Section04_Prototype.Practice.Point import Point
class Evaluate(TestCase):
def test_exercise(self):
line1: Line = Line(
Point(3, 3),
Point(10, 10)
)
line2: Line = line1.deep_c... |
import pytest
from typing import List, Union
import numpy as np
from dae.utils.variant_utils import get_locus_ploidy, reverse_complement, \
gt2str, str2gt
from dae.variants.attributes import Sex
chroms: List[Union[int, str]] = list(range(1, 23))
chroms.append("Y")
test_data = [
(str(chrom), 123123, sex, 2... |
from discord.ext import commands, tasks
import os
import logging
import discordlists
import topgg
class DSLCount(commands.Cog):
"Speacil Manager for publishing guild count and user count."
def __init__(self, bot):
self.bot = bot
self.token = os.environ["topgg_key"]
self.api = discord... |
from qtpy.QtCore import Qt
from qtpy.QtWidgets import QMainWindow, QToolBar
from gui.windows.shared.window_actions import WindowActions
from gui.windows.ui.ui_main import Ui_MainWindow
class MainWindow(QMainWindow, Ui_MainWindow):
def __init__(self, app_manager, *args, **kwargs):
# class init
sup... |
import logging
from vrpc.fsb_queue import FsbQueue
def test_producer(caplog):
caplog.set_level(logging.INFO)
x = FsbQueue.create_producer("", "")
logging.info(x) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author: Yuki Furuta <furushchev@jsk.imi.i.u-tokyo.ac.jp>
from epic_kitchen_object_detection_dataset import EpicKitchenObjectDetectionDataset
from epic_kitchen_object_detection_dataset import epic_kitchen_object_detection_label_names
#
from epic_kitchen_action_dataset imp... |
#! /usr/bin/env python
# encoding: utf-8
"""
this tool supports the export_symbols_regex to export the symbols in a shared library.
by default, all symbols are exported by gcc, and nothing by msvc.
to use the tool, do something like:
def build(ctx):
ctx(features='c cshlib syms', source='a.c b.c', export_symbols_rege... |
# -*- coding: utf-8 -*-
import sqlite3
from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash
DATABASE = 'sqldb.db'
DEBUG = True
SECRET_KEY = 'development key'
USERNAME = 'admin'
PASSWORD = 'default'
app = Flask(__name__)
app.config.from_object(__name__)
app.config.from_en... |
#!/usr/bin/env python
#
# Downloads datasets for sample projects.
#
from os import path
import urllib
import zipfile
def download(url, target_file):
"""Download a file from the url to the given target filename."""
def report(blocks, block_size, total_size):
percent = (100 * blocks * block_size) / total_size
l... |
i = 0
numbers = []
while i < 6 :
print (f"At the top i is {i}")
numbers.append(i)
i += 1
print ("Numbers now :",numbers)
print (f"At the bottom i is {i}")
print ("The numbers:")
for num in numbers:
print (num) |
import asyncio
import functools
from typing import Callable, Coroutine
from tortoise import Tortoise
from {{cookiecutter.package_name}}.config import settings
def _coro_wrapper(f: Callable[..., Coroutine]):
@functools.wraps(f)
def wrapper(*args, **kwargs):
try:
loop = asyncio.get_running... |
import face_recognition as fr
import os
import cv2
import face_recognition
import numpy as np
from time import sleep
import os
def get_encoded_faces():
"""
looks through the faces folder and encodes all
the faces
:return: dict of (name, image encoded)
"""
encoded = {}
for... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayOpenAppServiceBizabilitydataSetResponse(AlipayResponse):
def __init__(self):
super(AlipayOpenAppServiceBizabilitydataSetResponse, self).__init__()
d... |
import uuid
import random
import pandas as pd
from datetime import datetime, timedelta
from randomtimestamp import randomtimestamp
from src.crypto_accountant.utils import check_type
from src.crypto_accountant.position import Position
from src.crypto_accountant.transactions.buy import Buy
from src.crypto_accountant.tran... |
import argparse
import subprocess
import time
import os
from datetime import datetime
from benchmark_result import BenchmarkResult
from benchmark_main import create_block_size_list
from java.lang import System
##############################
##############################
DEFAULT_NUM_BLOCKS = 32 # GTX 960, 8 SM
DEFAU... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
#Part 1: Terminology (15 points)
#1 1pt) What is the symbol "=" used for?
# It is a assignment operator, used to put a value into a variable
#
#
#2 3pts) Write a technical definition for 'function'
# A function is a named sequence of statements or formulas that will perform a computation
#
#
#3 1pt) What does the key... |
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... |
import numpy as np
import pickle
with open("heart_disease_data.pkl", 'rb') as input:
X = pickle.load(input)
Y = pickle.load(input) |
# Copyright (c) 2021 PaddlePaddle 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 appli... |
from typing import Dict, Generator
from CO2Meter import CO2Meter
from prometheus_client.core import GaugeMetricFamily
_METRICS = {
"co2": "CO2 in ppm",
"temperature": "Temperature in degrees Celsius",
"humidity": "Relative humidity %",
}
class CustomCollector:
def __init__(self, meter: CO2Meter) ->... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-05-27 21:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('das', '0018_auto_20180527_2... |
# Python Substrate Interface Library
#
# Copyright 2018-2020 Stichting Polkascan (Polkascan Foundation).
#
# 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/LIC... |
# Copyright 2021 Sony Group 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 ... |
from __future__ import absolute_import
import sys
import abc
import numpy as np
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tf_pose.common import to_str
from tf_pose import common
DEFAULT_PADDING = 'SAME'
_init_xavier = tf.contrib.layers.xavier_initializer()
_init_norm = tf.truncated_nor... |
from __future__ import absolute_import
from django.contrib import admin
from django import forms
from .models import *
site = admin.AdminSite(name="admin")
class BookInline(admin.TabularInline):
model = Author.books.through
class AuthorAdmin(admin.ModelAdmin):
inlines = [BookInline]
class InnerInline(a... |
import numpy
import scipy.special
class neuralNetwork:
'''
Simple neural network
'''
def __init__(self, inputnodes, hiddennodes, outputnodes, learningrate):
self.inodes = inputnodes
self.hnodes = hiddennodes
self.onodes = outputnodes
self.lr = learningrate
self.a... |
#!/usr/local/bin/python
from __future__ import print_function
import sys
cal_units = [
'test_calc',
'test_cnt',
'test_ev',
'test_histo',
'test_lam',
'test_neat',
'test_rcalc',
'test_tabfunc',
'test_total',
]
cv_units = [
'test_3ds2mgf',
'test_arch2rad',
'test_ies2rad',
'test_lampcolor',
'test_mgf2inv',... |
#This is the start of my Uber 365 major project, lets hope it goes well!
#11/03/18
#Ayrton Foster
import math
import random
import sys
#Start uber!
from collections import namedtuple
from random import randint
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from tqdm import tqdm
############... |
# Copyright 2015-2016 Carnegie Mellon University
#
# 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 ag... |
import re
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.checkpoint as cp
from collections import OrderedDict
from torch import Tensor
from torch.jit.annotations import List
#added
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from load_utils... |
from sklearn.linear_model.passive_aggressive import PassiveAggressiveRegressor as SKLModel
import lale.helpers
import lale.operators
import lale.docstrings
from numpy import nan, inf
class PassiveAggressiveRegressorImpl():
def __init__(self, C=1.0, fit_intercept=True, max_iter=None, tol=None, early_stopping=Fals... |
from __future__ import print_function, division
import os
import numpy as np
import numpy.random
import datetime
import torch
import torch.optim as optim
from torch.nn.functional import relu
from lib.dataloader import DataLoader # modified dataloader
from lib.model_train.model_pixelCT_both_normalized import ImMatchNet
... |
from enum import Enum, IntEnum, IntFlag
from abc import ABC, abstractmethod
from typing import List, Dict, Pattern, Union
from datetime import datetime, timedelta
import calendar
from datedelta import datedelta
import regex
from recognizers_text.extractor import ExtractResult
from recognizers_text.utilities import Reg... |
# Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... |
import sys
sys.path.append('../../vendor/github.com/elastic/beats/libbeat/tests/system')
from beat.beat import TestCase
class BaseTest(TestCase):
@classmethod
def setUpClass(self):
self.beat_name = "tuxbeat"
self.build_path = "../../build/system-tests/"
self.beat_path = "../../tuxbeat... |
import unittest
import pytest
from strings import (add_prefix_un,
make_word_groups,
remove_suffix_ness,
adjective_to_verb)
class LittleSistersVocabTest(unittest.TestCase):
@pytest.mark.task(taskno=1)
def test_add_prefix_un(self):
input_da... |
#!C:\Python27\python.exe
import MySQLdb
print "Content-Type:text/html\n\n"
print"""
<html>
<head>
<title>Admin Activity</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bo... |
import os
import pickle
import select
class Process:
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
self.target = target
self.args = args
self.kwargs = kwargs
self.pid = 0
self.r = self.w = None
def start(self):
self.pid = os.fork()... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1.10.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... |
import os
import random
import string
import sys
from robohash import Robohash
# get robot image from robohash
def GetRobot(hash=None, set='set1', background=None):
# if no hash is passed in
if hash == None:
length = 20
letters = string.ascii_lowercase
hash = ''.join(random.choice(let... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for getting information about the server. """
from asyncio import create_subprocess_shell as asyncr... |
from django.db import models
# Create your models here.
#class molclass(models.Model):
# nameOfType = models.CharField(max_length=20)
# def __unicode__(self):
# return self.nameOfType
class Molecule(models.Model):
"""
Molecule models
Only name needed, date is added automatically
"""
n... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 4 22:13:43 2021
@author: oriol
"""
# std libraries
import webbrowser
# non-std libraries
from kivy.properties import StringProperty
from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.menu import MDDropdownMenu
from kivymd... |
import logging
import datetime
import json
import re
logger = logging.getLogger(__name__)
from stix_shifter.stix_translation.src.patterns.pattern_objects import ObservationExpression, ComparisonExpression, \
ComparisonExpressionOperators, ComparisonComparators, Pattern, StartStopQualifier, \
CombinedCompariso... |
# -*- coding:utf-8 -*-
import glob
import os
import SimpleITK as sitk
import numpy as np
import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
from keras.preprocessing.image import img_to_array, load_img
from matplotlib import pyplot as plt
# 指定第一块GPU可用
os.environ["CUDA_VISIBLE_DEVICES"] =... |
"""Drivers for TKB zwave devices."""
from appengine.devices import zwave
@zwave.register(manufacturer_id='0118', product_type='0202', product_id='0611')
class TKBMultilevelPowerSwitch(zwave.Driver):
"""Driver for TKB Multilevel power switch."""
# Device seems to only support 0-100, so scale our 0-255 range
de... |
from tests.utils import verify
@verify
class TestDictLiteralCreation:
"""Compare different methods of creating a dict literal"""
def test_literal(self, benchmark):
"""Create a dict using a literal"""
def run():
return {"a": 1, "b": 2, "c": 3}
benchmark(run)
def test... |
import logging
from pykagapi import _config
log = logging.getLogger(__name__)
API_URL = "https://api.kag2d.com/v1/game/thd/kag/server/"
get_dictionary = _config.get_dictionary
get_content = _config.get_content
def status(ip, port):
'''Receives ip and port, returns dictionary with server's info'''
log.debug(f... |
#!/usr/bin/env python
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Bootstrap script to clone and forward to the recipe engine tool.
******************************************************... |
#!/usr/bin/env python
# Copyright (c) 2016-2019 The UUV Simulator 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/LICENS... |
"""Data collators for self-supervised pretext tasks in language."""
import torch
import numpy as np
from torch.nn.utils.rnn import pad_sequence
class DataCollator(object):
def __init__(self):
pass
def __call__(self, examples):
pass
def _preprocess_batch(self, examples):
"""
... |
# 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, overload
from ... import _utilities
fro... |
"""empty message
Revision ID: f6b75c436869
Revises: f56215d47480
Create Date: 2020-04-21 20:58:50.757503
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f6b75c436869'
down_revision = 'f56215d47480'
branch_labels = None
depends_on = None
def upgrade():
# ... |
''' Copyright 2012 Smartling, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this work except in compliance with the License.
* You may obtain a copy of the License in the LICENSE file, or at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by appli... |
# 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.
# pyre-strict
from typing import Callable, Optional
import libcst as cst
from libcst import parse_statement
from libcst._nodes.tests.base imp... |
# -*- coding: utf-8 -*-
# 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import unicode_literals
import fcntl
import os
import struct
import sys
import termios
import textwrap
im... |
"""Creates the Example and GPT classes for a user to interface with the OpenAI
API."""
import openai
import uuid
class Example:
"""Stores an input, output pair and formats it to prime the model."""
def __init__(self, inp, out):
self.input = inp
self.output = out
self.id = uuid.uuid4()... |
import dataclasses
import json
from datetime import datetime, timedelta
from functools import partial
from http import HTTPStatus
from typing import Any, Optional, Callable, Mapping, List
from tornado.httputil import HTTPHeaders
from tornado.web import Application, RequestHandler
from pyctuator.httptrace im... |
# -*- coding: utf-8 -*-
"""
jinja2.exceptions
~~~~~~~~~~~~~~~~~
Jinja exceptions.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
from ._compat import imap, text_type, PY2, implements_to_string
class TemplateError(Exception):
"""Baseclass for all temp... |
#
from resolve import resolve
####################################
####################################
# 以下にプラグインの内容をペーストする
#
import sys
from io import StringIO
import unittest
class TestClass(unittest.TestCase):
def assertIO(self, input, output):
stdout, stdin = sys.stdout, sys.stdin
sys.stdou... |
# -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
# -*- coding: utf-8 -*-
"""
@brief test log(time=803s)
notebook test
"""
import unittest
from pyquickhelper.loghelper import fLOG, noLOG
from pyquickhelper.pycode import get_temp_folder, add_missing_development_version
import ensae_teaching_cs
class TestNotebookRunnerExposeLong3(unittest.TestCase):
def set... |
from selenium.webdriver.common.keys import Keys
from time import sleep
from final_project.actions.driver import set_driver_firefox
from selenium.common.exceptions import NoSuchElementException
driver = set_driver_firefox()
def login(username: str, password: str):
# Launch Instagram Page
driver.get("https://... |
"""Communicate via SPI with an ESP8266 module.
The Micropython board is the SPI master and the ESP8266 the slave. The HSPI
port of the ESP822 is used, which is implemented in hardware and controlled
by an Arduino-for-ESP8266 sketch, which uses the SPISlave library.
https://github.com/esp8266/Arduino/tree/master/libra... |
"""
WSGI config for hue7jip8 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... |
"""Custom build macros for IntelliJ plugin handling.
"""
load(
":intellij_plugin.bzl",
_intellij_plugin = "intellij_plugin",
_intellij_plugin_library = "intellij_plugin_library",
_optional_plugin_xml = "optional_plugin_xml",
)
# Re-export these symbols
intellij_plugin = _intellij_plugin
intellij_plugi... |
import rbs_oracle_common
import click
import logging
import sys
import os
import platform
from datetime import datetime
import configparser
@click.command()
@click.option('--source_host_db', '-s', type=str, required=True, help='The source <host or RAC cluster>:<database>')
@click.option('--mount_path', '-m', type=s... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import MinMaxScaler
from tensorflow.p... |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# Copyright (C) 2016 <Jamie McGowan> <jamiemcgowan.dev@gmail.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
# ... |
#!/usr/bin/env python
# Copyright (c) 2013 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tool for manipulating naclports packages in python.
This tool can be used to for working with naclports packages.
It can al... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Epidemico Inc.
#
# Licensed under the Apache License, Version 2.0 ( the "License" );
# you may not use this file except in compliance with the License.
# You ma... |
# 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 ... |
import base64
import io
import json
import os
import urllib
import datetime
import warnings
import cv2
import requests
from PIL import Image
from roboflow.config import *
from roboflow.core.version import Version
#version class that should return
class Project():
"""Object that stores all information and operation... |
# Generated by Django 2.2.9 on 2020-04-02 17:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='userprofile',
name='about',
... |
from celery_tasks.main import celery_app
from celery_tasks.yuntongxun.ccp_sms import CCP
@celery_app.task(name='send_sms_code_func')
def send_sms_code_func(mobile, sms_code):
'''发送短信'''
result = CCP().send_template_sms(mobile, [sms_code, 5], 1)
print(result)
return result # 0: 成功 -1:失败 |
import time
import requests
import math
import random
from sense_emu import SenseHat
sense = SenseHat()
TOKEN = "YjO0h3qbrIvaPc16" # Put your TOKEN here
VARIABLE_LABEL_1 = "temp" # Put your first variable label here
VARIABLE_LABEL_2 = "hum" # Put your second variable label here
def build_payload(variable_1, varia... |
import json
import os
import getpass
import subprocess
import sys
from sqlalchemy.engine.url import make_url, URL
from pathlib import Path
import pandas as pd
import pyomnisci
def lookup_url_for_name(name):
home = os.environ["HOME"]
for fname in [
home + "/omnisci/omnisci-urls.csv",
home + "/.... |
YUNTONGXUN_EXPIRES = 5 # 云通讯短信过期时长
YUNTONGXUN_TEMPLATE = 1 # 云通讯短信模板
|
"""
PyTurbSim turbulence 'phase models' API.
Available phase models
----------------------
randPhase
A uniform-distribution random-phase model.
"""
from .main import randPhase
|
import datetime
import botocore
import botocore.exceptions
import dateutil.tz
from . import DbTerminator, Terminator, get_tag_dict_from_tag_list, get_account_id
class Ec2KeyPair(DbTerminator):
@staticmethod
def create(credentials):
return Terminator._create(credentials, Ec2KeyPair, 'ec2', lambda cli... |
import base64
import collections
import errno
import io
import json
import logging
import multiprocessing
import os
from pathlib import Path
import mmap
import random
import shutil
import signal
import socket
import subprocess
import sys
import time
from typing import Optional
# Ray modules
import ray
import ray.ray_c... |
# Copyright 2019, The TensorFlow Federated 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 o... |
import numpy as np
import os
import sys
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=FutureWarning)
# To deactivate warnings: https://github.com/tensorflow/tensorflow/issues/7778
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
# import keras.backend.tensorflow_backend as ktf... |
import pandas as pd
import time
from bs4 import BeautifulSoup
import requests
import sys
import random
def get_headers():
"""
Genera un diccionario con los datos del header. Incluye una lista de diferentes user agent de la cual elige uno
de manera aleatoria.
"""
uastrings = [
"Mozilla/5.0 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.