text stringlengths 2 999k |
|---|
# mypy: allow-untyped-defs
from typing import Dict
from urllib import parse as urlparse
from . import error
from . import protocol
from . import transport
from .bidi.client import BidiSession
def command(func):
def inner(self, *args, **kwargs):
if hasattr(self, "session"):
session = self.ses... |
# Copyright 2018 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... |
from app.app import create_app
import sqlalchemy
app = create_app(environment='production')
@app.route('/', methods=['GET'], strict_slashes=False)
def lin_slogan():
return """<h1>OPENVPN<h1>"""
if __name__ == '__main__':
# app.run(debug=True, host="0.0.0.0")
app.run(host="0.0.0.0")
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import tkinter as tk
from application import Application
def main():
root = tk.Tk()
root.columnconfigure(0, weight=1)
root.rowconfigure(0, weight=1)
app = Application(parent=root)
app.mainloop()
if __name__ == "__main__":
main()
|
"""VOC Dataset Classes
Original author: Francisco Massa
https://github.com/fmassa/vision/blob/voc_dataset/torchvision/datasets/voc.py
Updated by: Ellis Brown, Max deGroot
"""
from .config import HOME
import os.path as osp
import sys
import torch
import torch.utils.data as data
import cv2
import numpy as np
if sys.ver... |
#!/usr/bin/env python2
import os
from os.path import abspath, dirname, join
import subprocess
from setuptools import setup, find_packages, Command
# Note: We follow PEP-0440 versioning:
# http://legacy.python.org/dev/peps/pep-0440/
VERSION = '0.1.dev0'
# Note: The dependency versions are chosen to match ooni-backe... |
"""Initial Migration
Revision ID: c950921cfdc6
Revises:
Create Date: 2019-10-25 18:17:12.455875
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'c950921cfdc6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto ... |
import abc
import asyncio
import logging
import os
from collections import deque
from typing import ( # flake8: noqa
Any,
Awaitable,
Callable,
Deque,
List,
Optional,
Tuple,
Type,
)
import aiohttp
import thriftpy2
from aiohttp import hdrs
from aiohttp.client_exceptions import ClientErro... |
def p_a():
n = int(input())
if n == 1:
print("Hello World")
else:
a = int(input())
b = int(input())
print(a + b)
def p_b():
N, T = map(int, input().split())
ans = 10 ** 9
for _ in range(N):
c, t = map(int, input().split())
if t <= T:
... |
# -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""Vispy configuration functions
"""
import os
from os import path as op
import json
import sys
import platform
import getopt
import traceback
import tempfile
import atexit
f... |
from __future__ import annotations
import logging
import re
import p4transfer
def test_edit_delete_readd(source, target, default_transfer_config):
"""Test an edit followed by a delete followed by a re-add."""
inside_file1 = source.local_path("inside/inside_file1")
inside_file1.write_bytes(b"Test content... |
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you ma... |
# Foremast - Pipeline Tooling
#
# Copyright 2018 Gogo, 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... |
from esphomeyaml.const import CONF_INVERTED, CONF_MODE, CONF_NUMBER, CONF_PCF8574, \
CONF_SETUP_PRIORITY
from esphomeyaml.core import CORE, EsphomeyamlError
from esphomeyaml.cpp_generator import IntLiteral, RawExpression
from esphomeyaml.cpp_types import GPIOInputPin, GPIOOutputPin
def generic_gpio_pin_expression... |
import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 7, transform = "Anscombe", sigma = 0.0, exog_count = 20, ar_order = 12); |
from psutil import process_iter, virtual_memory, cpu_percent, Process # NOT STDLIB
import source.pyprompt_common_func as pyprompt_common_func
def _append_(All, pID, CTime, UsedCPU, UsedMem, UsedMemPer, i):
A_, p_, ct_, uC_, uM_, uMP_ = 0, 0, 0, 0, 0, 0
if i.pid != 0:
All.append(i.name())
A_ = pyprompt_common... |
"""
Manage Chocolatey package installs
.. versionadded:: 2016.3.0
.. note::
Chocolatey pulls data from the Chocolatey internet database to determine
current versions, find available versions, etc. This is normally a slow
operation and may be optimized by specifying a local, smaller chocolatey
repo.
"""... |
# Algorithm 1, polynomial regression for Q_l + explicit formula + truncation
import numpy as np
from scipy.misc import comb
from scipy.special import hermitenorm
from tqdm import tqdm
from joblib import Parallel, delayed
from itertools import product
from sklearn.preprocessing import PolynomialFeatures
import math
de... |
"""
ParallelCluster
ParallelCluster API # noqa: E501
The version of the OpenAPI document: 3.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from pcluster_client.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNo... |
# 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 spack import *
class Umap(CMakePackage):
"""Umap is a library that provides an mmap()-like interface to a
s... |
"""
Django settings for covid19_site project.
Generated by 'django-admin startproject' using Django 3.0.4.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import ... |
"""
random synonym insertation Transformation
============================================
"""
import random
from nltk.corpus import wordnet
from textattack.transformations import Transformation
class RandomSynonymInsertion(Transformation):
"""Transformation that inserts synonyms of words that are already in th... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python
# coding: utf-8
import numpy as np
from PIL import Image
from tensorflow.keras.utils import Sequence
from ..utils.image_processing import preprocess, center_crop
from ..utils.generic_utils import labels2indexes
class DMLGenerator(Sequence):
""" Keras Sequence for Deep Metric Learning with r... |
class Something:
@snapshot(lambda lst: lst.copy(), "lst")
@ensure(lambda lst, OLD: lst == OLD.lst)
def do_something(self, lst: List[int]) -> None:
pass
__book_url__ = "dummy"
__book_version__ = "dummy"
|
from abc import ABC, abstractmethod
class Display():
@abstractmethod
def __init__(self):
pass
@abstractmethod
def show(self):
pass
@abstractmethod
def start(self):
pass
@abstractmethod
def finish(self):
pass
|
# pylint: disable=C0111,R0903
"""Test module
"""
import core.widget
import core.module
class Module(core.module.Module):
def __init__(self, config, theme):
super().__init__(config=config, theme=theme, widgets=core.widget.Widget("test"))
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
from django.contrib import admin
from things.admin import ThingAdmin, PrivateListFilter
from .models import Page
class PageAdmin(ThingAdmin):
list_filter = [PrivateListFilter]
admin.site.register(Page, PageAdmin)
|
import unittest
from pyalink.alink import *
import numpy as np
import pandas as pd
class TestVectorInteractionBatchOp(unittest.TestCase):
def test_vectorinteractionbatchop(self):
df = pd.DataFrame([
["$8$1:3,2:4,4:7", "$8$1:3,2:4,4:7"],
["$8$0:3,5:5", "$8$1:2,2:4,4:7"],
... |
"""Offer reusable conditions."""
from __future__ import annotations
import asyncio
from collections import deque
from collections.abc import Container, Generator
from contextlib import contextmanager
from datetime import datetime, timedelta
import functools as ft
import logging
import re
import sys
from typing import ... |
import sys
sys.path.append('../tytus/parser/team27/G-27/execution/abstract')
sys.path.append('../tytus/storage')
from querie import *
from storageManager import jsonMode as admin
from prettytable import PrettyTable
class drop_database(Querie):
'''
row = numero de fila(int)
column = numero de columna(int... |
import sys
from setuptools import setup
args = ' '.join(sys.argv).strip()
if not any(args.endswith(suffix) for suffix in ['setup.py check -r -s', 'setup.py sdist']):
raise ImportError('This is a unique description. Locked by pypi-parker at example-url.co.net.',)
setup(
author='pypi-parker',
author_email='... |
from flask import request, jsonify
from flask_restful import Resource
from klap4.services.song_services import change_single_fcc, change_album_fcc
class SongAPI(Resource):
def put(self, ref, typ):
json_data = request.get_json(force=True)
try:
fcc = json_data['fcc']
if typ =... |
from GlobalObjs.Graph import SpaceTimeNode
from Benchmark import Warehouse
import numpy as np
import os
from queue import PriorityQueue
from Visualisations.Vis import Vis
# Based off psuedo code taken from
# https://www.geeksforgeeks.org/a-search-algorithm/
class AStarNode(SpaceTimeNode):
def __init__(self, pare... |
from collections import deque
regex = input()[1:-1]
farthest = 0
stack = deque([((0, 0), 0)])
visited = set()
for t in regex:
(x, y), d = stack.pop()
if (x, y) not in visited and d >= 1000:
farthest += 1
visited |= {(x, y)}
if t == 'S':
stack.append(((x, y-1), d+1))
elif t == 'N':
... |
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
from functools import reduce
from operator import attrgetter, add
import sys
import pytest
from ..util.arithmeticdict import ArithmeticDict
from ..util.testing import requires
from ..util.parsing import parsing_library
from ..... |
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils.translation import gettext_lazy as _
from oscar.apps.offer import custom
from oscar.test.factories import create_product
class CustomRange(object):
name = "Custom range"
def contains_product(self... |
# flake8: noqa
# disable flake check on this file because some constructs are strange
# or redundant on purpose and can't be disable on a line-by-line basis
import ast
import inspect
import sys
from types import CodeType
from typing import Any
from typing import Dict
from typing import Optional
import py
import _pyte... |
from collections import namedtuple
Context = namedtuple('Context', ['query', 'json', 'headers', 'cookies'])
class BasePlugin:
"""
Base plugin for SpecTree plugin classes.
:param spectree: :class:`spectree.SpecTree` instance
"""
def __init__(self, spectree):
self.spectree = spectree
... |
# -*- coding: utf-8 -*-
# pylint: disable=wildcard-import,redefined-builtin,unused-wildcard-import
from __future__ import absolute_import, division, print_function
from builtins import *
# pylint: enable=wildcard-import,redefined-builtin,unused-wildcard-import
import pytest
import pandas as pd
# pylint: disable=E04... |
import smart_imports
smart_imports.all()
class UseAbilityTasksTests(utils_testcase.TestCase):
def setUp(self):
super(UseAbilityTasksTests, self).setUp()
game_logic.create_test_map()
self.account = self.accounts_factory.create_account()
self.storage = game_logic_storage.LogicSt... |
"""ACME protocol messages."""
import json
import josepy as jose
import six
from acme import challenges
from acme import errors
from acme import fields
from acme import jws
from acme import util
from acme.mixins import ResourceMixin
try:
from collections.abc import Hashable
except ImportError: # pragma: no cover... |
#!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, 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 applicab... |
#!/usr/bin/python3.3
# -*- coding: utf-8 -*-
"""dllfinder
"""
from . import _wapi
import collections
from importlib.machinery import EXTENSION_SUFFIXES
import os
import sys
from . mf3 import ModuleFinder
from . import hooks
################################
# XXX Move these into _wapi???
_buf = _wapi.create_unicode_bu... |
import boshC3
#import boshExcel
import docSql
import os
import json
import sys
def psql_run(d_host, d_port, d_user, d_pass, d_db):
import getpass
import os
host = raw_input(">>> host [" + d_host + "] : " )
if host != "":
d_host = host
port = raw_input(">>> port [" + str(d_port) + "] : " )
... |
import math
from typing import Mapping, List, Optional, Union, Callable, Text
import tensorflow as tf
from ... import InfoNode
from ....utils import keys
from ....utils import types as ts
class LocNode(InfoNode):
"""Manages a location in rectangular space encoded in binary
as a [D, ceil(lg2(L))]-shaped tenso... |
from mayan.apps.testing.tests.base import (
BaseTestCase, BaseTransactionTestCase, GenericViewTestCase,
GenericTransactionViewTestCase
)
from .mixins.document_mixins import DocumentTestMixin
class GenericDocumentTestCase(DocumentTestMixin, BaseTestCase):
"""Base test case when testing models or classes""... |
#############################################################################
# Copyright (c) 2018, Johan Mabille, Sylvain Corlay and Loic Gouarin #
# #
# Distributed under the terms of the BSD 3-Clause License. #
# ... |
#!/usr/bin/env python
from twisted.web import http
from twisted.internet import protocol
from twisted.internet import reactor, threads
from ConfigParser import ConfigParser
from nx_parser import signature_parser
import urllib
import pprint
import socket
import MySQLConnector
import MySQLdb
import getopt
import sys
imp... |
#!/usr/bin/env python3
# Invoked by: Cloudformation custom actions
# Returns: Error or status message
#
# deletes the resources assocated with lambda like eni
import boto3
import http.client
import urllib
import json
import uuid
import threading
from time import sleep
def handler(event, context):
print(event)
... |
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
#!/usr/bin/env python3
import argparse
def parse_file(filename):
return open(filename, "rb")
def wc(fp):
"""Returns newline, word, and byte counts for the file.
Args:
fp: file object opened in "rb" mode.
"""
lines, words, read_bytes = 0, 0, 0
is_word = False
block = fp.read1(40... |
from pyitab.results.simulations import get_results, purge_dataframe, \
calculate_metrics, find_best_k, calculate_centroids, state_errors, \
dynamics_errors
from pyitab.results.base import filter_dataframe
from pyitab.results.dataframe import apply_function
from pyitab.utils import make_dict_product
import panda... |
def quickSort(li):
arr = []
low = 0
high = len(li) - 1
if low < high:
mid = partition(li, low, high)
if low < mid - 1:
arr.append(low)
arr.append(mid - 1)
if mid + 1 < high:
arr.append(mid + 1)
arr.append(high)
w... |
#!/usr/bin/python
# Copyright 2010 by BBN Technologies Corp.
# All Rights Reserved.
USAGE="""\
Usage: %%prog [RELEASE_DIR] PIPELINE_DIR [options...]
PIPELINE_DIR: The directory created by this script. This directory
will contain the files necessary to run SERIF.
RELEASE_DIR: The SERIF release ... |
from utils import *
from pprint import pprint as pp
import requests, json, sys, decimal, pytz
from datetime import datetime, timedelta
timezone = pytz.timezone('Europe/Oslo')
if (len(sys.argv) != 13 and len(sys.argv) != 6) \
or (len(sys.argv) == 6 and sys.argv[4] != '-'):
sys.stderr.write('Usage: %s <offset> <d... |
# -*- coding: utf-8 -*-
import requests
from base import Base
from constants import API_BASE_URL
from image import Image
from line import Line
class Step(Base):
'''One step in a guide.
:var int guideid: The id of the :class:`pyfixit.guide.Guide` owning this
step. Ex: ``5``.
:var int ... |
pragma solidity =0.7.3;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transfer(address recipient, uint256 a... |
from __future__ import print_function
import torch
import torch.optim as optim
from torch.autograd import Variable
<<<<<<< HEAD
torch.backends.cudnn.bencmark = True
import os,sys,datetime
import math
import argparse
import numpy as np
import net_sphere
from data_loader import get_train_loader
from data_loader import... |
## Issue related to time resolution/smoothness
# http://bulletphysics.org/mediawiki-1.5.8/index.php/Stepping_The_World
from gibson.core.physics.scene_building import SinglePlayerBuildingScene
from gibson.core.physics.scene_stadium import SinglePlayerStadiumScene
import pybullet as p
import time
import random
import z... |
#!/usr/bin/python
import os
import math
import yaml
import sys
STATS_LOG = "/usr/local/var/log/suricata/stats.log"
def get_seconds(tm):
hms = tm.split(":")
return (int(hms[0]) * 3600) + (int(hms[1]) * 60) + int(hms[2])
def get_difference(values):
return [x - values[i - 1] for i, x in enumerate(values)][... |
# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# 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... |
# -*- coding: utf-8 -*-
"""
Quantarhei job launcher
This script is ment to launch Quantarhei jobs on remote machines
The script transfers simulation inputs to the remote machine, launches
the simulation, monitors it, and transfers the results back to the machine
from which the job was laun... |
#!/usr/bin/python
import py_ball
from nba_api.stats.endpoints import teamgamelog, playerdashboardbygeneralsplits, boxscoreadvancedv2, playerdashboardbylastngames, playerdashboardbyclutch, playerdashboardbyopponent, boxscoresummaryv2, teamplayeronoffsummary, commonallplayers, commonplayerinfo
import csv
import time
impo... |
# coding: utf-8
"""
SendinBlue API
SendinBlue provide a RESTFul API that can be used with any languages. With this API, you will be able to : - Manage your campaigns and get the statistics - Manage your contacts - Send transactional Emails and SMS - and much more... You can download our wrappers at h... |
productions = {
(52, 1): [1, 25, 47, 53, 49],
(53, 2): [54, 57, 59, 62, 64],
(53, 3): [54, 57, 59, 62, 64],
(53, 4): [54, 57, 59, 62, 64],
(53, 5): [54, 57, 59, 62, 64],
(53, 6): [54, 57, 59, 62, 64],
(54, 2): [2, 55, 47],
(54, 3): [0],
(54, 4): [0],
(54, 5): [0],
(54, 6): [0... |
from ThesisAnalysis import get_data, ThesisHDF5Writer
import numpy as np
import pandas as pd
from CHECLabPy.core.io import DL1Reader
def main():
input_file = "/Volumes/gct-jason/thesis_data/checs/mc/dynrange/2_no_noise/Run43489_dl1.h5"
reader = DL1Reader(input_file)
mapping = reader.mapping
pixel, tr... |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from modeling.sync_batchnorm.batchnorm import SynchronizedBatchNorm2d
from modeling.deformable_conv.deform_conv_v3 import *
from torch.nn import BatchNorm2d as bn
class _DenseAsppBlock(nn.Module):
""" ConvNet block for building DenseA... |
"""
ml/misc/grid.py
"""
import copy
class Grid:
'''
Grid is an N x M grid of "alive" or "dead" grid cells.
A transformation on the input grid using the following rules:
- An "alive" cell remains alive if 2 or 3 neighbors are "alive";
otherwise, it becomes "dead."
- A "dead" cell becomes ali... |
# -*- coding: utf-8 -*-
"""
Created on Fri Oct 9 08:51:55 2015
@author: ksansom
"""
#!/usr/bin/env python
# A simple script to demonstrate the vtkCutter function
import vtk
#Create a cube
cube=vtk.vtkCubeSource()
cube.SetXLength(40)
cube.SetYLength(30)
cube.SetZLength(20)
cubeMapper=vtk.vtkPolyDataMapper()
cubeM... |
'''
CLUBB standard variables
zhunguo : guozhun@lasg.iap.ac.cn ; guozhun@uwm.edu
'''
import Ngl
from netCDF4 import Dataset
import matplotlib.pyplot as plt
import numpy as np
import scipy as sp
import pylab
import os
import Common_functions
from subprocess import call
def clubb_std_prf (ptype,cseason, ncase... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, 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 cop... |
#!/usr/bin/env python
#
# (C) Copyright 2018, Xilinx, Inc.
#
"""MIT License from https://github.com/ysh329/darknet-to-caffe-model-convertor/
Copyright (c) 2015 Preferred Infrastructure, Inc.
Copyright (c) 2015 Preferred Networks, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this... |
# Copyright 2009-2017 Wander Lairson Costa
# Copyright 2009-2021 PyUSB contributors
#
# 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, this ... |
import os
import shutil
import subprocess
from dataclasses import dataclass
from pathlib import Path
import pytest
from tests.utils import CI, Compose
def _add_version_var(name: str, env_path: Path):
value = os.getenv(name)
if not value:
return
if value == "develop":
os.environ[name] =... |
def items_equal(xs, ys):
'''Compare two structures but ignore item order
Arguments:
xs {[type]} -- First structure
ys {[type]} -- Second structure
Returns:
bool -- True if the two structures are equal when ignoring item order
'''
if isinstance(xs, dict) and isinstance(ys, d... |
#! /usr/bin/python
"""
Zero Matrix: Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0.
"""
from typing import List
# 1 2 0
# 3 4 5
# 0 0 0
# 3 4 0
def zero_matrix(matrix: List[List[int]]):
if not matrix or not matrix[0]:
return matrix
row_has_ze... |
# Copyright 2013, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
from datasets import load_dataset, load_metric
import pandas as pd
import numpy as np
import hazm
from num2fawords import words, ordinal_words
from tqdm import tqd
from sklearn.model_selection import train_test_split
import os
import string
import six
import re
import glob
from dataPrepration import prepareData, trainT... |
"""
WSGI config for trek_30009 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/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... |
# Generated by Django 2.2.16 on 2021-12-09 17:10
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('monitor', '0001_initial'),
migrations.swappable_dependency(set... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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 _utilitie... |
class Queue(list):
def __init__(self, *args, **kwargs):
super(Queue, self).__init__(*args, **kwargs)
def reposition(self, original_position, new_position):
temp = self[original_position]
del self[original_position]
try:
self.insert(new_position, temp)
except ... |
import asyncio
import socket
from urllib.parse import urlparse
from .exceptions import * # pylint: disable=wildcard-import
from .protocol import AmqpProtocol
from .version import __version__
from .version import __packagename__
async def connect(host='localhost', port=None, login='guest', password='guest',
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .ioc_finder import find_iocs
__author__ = """Floyd Hightower"""
__version__ = '1.2.17'
|
from util.table import table
from util.region import *
from util.Daegu import Daegu
from util.Seoul import Seoul
#from util.Gangwon import Gangwon
from util.KST import kst_time
from util.collector import collector
regions = [Seoul().collect,
Daegu().collect,
busan,
... |
v = int(input('Digite um valor: '))
validador = 0
contador = 1
while contador < v:
if v % contador == 0:
validador += 1
contador +=1
if validador > 1:
print(f'Esse número NÃO é primo, pois é divisível por {validador+1} números diferentes ')
else:
print('Esse número é primo') |
# pylint: disable=C0301,C0103,R0913,R0914,R0904,C0111,R0201,R0902
import warnings
from itertools import count
from struct import pack
from typing import Tuple, List, Any
import numpy as np
from numpy import zeros, where, searchsorted
from numpy.linalg import eigh # type: ignore
from pyNastran.utils.numpy_utils impor... |
import json
from datetime import timedelta as td
from django.utils.timezone import now
from hc.api.models import Check
from hc.test import BaseTestCase
class ListChecksTestCase(BaseTestCase):
def setUp(self):
super(ListChecksTestCase, self).setUp()
self.now = now().replace(microsecond=0)
... |
#!/usr/bin/env python3
# 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 time
import torch
from torch.utils.data import DataLoader
from habitat import logger
from habitat_bas... |
#!/usr/bin/env python3
import re
# [^\W\d_] - will match any lower or upper case alpha character. No digits or underscore.
months_de = {
"Januar": 1,
"Februar": 2,
"März": 3,
"April": 4,
"Mai": 5,
"Juni": 6,
"Juli": 7,
"August": 8,
"September": 9,
"Oktober": 10,
"November... |
import pandas as pd
import numpy as np
from os import path
from .table_check import table_check
def load_dataCSV(DataSheet, PeakSheet):
"""Loads and validates the DataFile and PeakFile from csv files.
Parameters
----------
DataSheet : string
The name of the csv file (.csv file) that contains... |
# Import of the relevant tools
import time
import numpy as np
import theano
import theano.tensor as T
from theano import pp, config
from plotly.tools import FigureFactory as FF
import plotly.graph_objs as go
from ..io.read_vtk import ReadVTK
from ..data_attachment.measures import Measures
from ..data_attachment.v... |
from django import forms
from goggles.warehouse.models import ImportJob, Profile
from goggles.warehouse.tasks import schedule_import_conversation
class ProfileForm(forms.ModelForm):
password = forms.CharField(label='Password', max_length=255)
update_session_info = forms.BooleanField(
label='Update lo... |
# 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 ... |
# Copyright (C) 2013 by Aivars Kalvans <aivars.kalvans@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
# in the Software without restriction, including without limitation the rights
# to use, cop... |
r"""
Interface to Mathematica
The Mathematica interface will only work if Mathematica is installed on your
computer with a command line interface that runs when you give the ``math``
command. The interface lets you send certain Sage objects to Mathematica,
run Mathematica functions, import certain Mathematica expressi... |
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _OnPrem
class _Certificates(_OnPrem):
_type = "certificates"
_icon_dir = "resources/onprem/certificates"
class CertManager(_Certificates):
_icon = "cert-manager.png"
class LetsEncrypt(_Certificates):
_icon = "lets-... |
from bst import BSTNode, BST
class AVLNode(BSTNode):
"""Implementation of AVL Node"""
def __init__(self, key):
BSTNode.__init__(self, key)
self.height = 0
def update_subtree_info(self):
self.height = self._uncached_height()
def _uncached_height(self):
return 1 + max((self.left and self.left.height) o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.