text stringlengths 2 999k |
|---|
import torch
from torch.autograd import Variable
import torch.nn.functional as F
import torchvision.transforms as transforms
import torch.nn as nn
import torch.utils.data
import numpy as np
from opt import opt
from dataloader import VideoLoader, DetectionLoader, DetectionProcessor, DataWriter, Mscoco
from yolo.util i... |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry import decorators
from telemetry.core import util
from telemetry.page.actions import loop
from telemetry.unittest_util import tab_test_case
A... |
from pygments.lexer import RegexLexer, bygroups
from pygments.token import *
import re
__all__ = ['CatalaEnLexer']
class CatalaEnLexer(RegexLexer):
name = 'CatalaEn'
aliases = ['catala_en']
filenames = ['*.catala_en']
flags = re.MULTILINE | re.UNICODE
tokens = {
'root': [
(u... |
from tensorflow.python import pywrap_tensorflow
checkpoint_path = 'checkpoints/VGGnet_fast_rcnn_iter_50000.ckpt'
reader = pywrap_tensorflow.NewCheckpointReader(checkpoint_path)
var_to_shape_map = reader.get_variable_to_shape_map()
for key in var_to_shape_map:
print("tensor_name: ", key)
|
#! /usr/bin/env python
import os
import subprocess
import svgwrite
import math
import shutil
########################################################################################################################
def ensure_requisite_folders(path):
folder = os.path.split(path)[0]
if len(folder) and not os.pat... |
# AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/00_rgbkm.ipynb (unless otherwise specified).
__all__ = ['reflectance']
# Cell
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import cv2
import scipy.optimize as optimize
def reflectance(K, S, D, Rg):
'''Calculates reflectance ... |
#coding=utf-8
#!/bin/env python
import os
import base64
import socket
import numpy
import time
m_serv_ip = '10.230.147.31'
m_serv_port = 9999
def init_socket(serv_ip, serv_port):
""""""
ip_port = (serv_ip, serv_port)
sk = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) # TCP
#sk = socket.socket(... |
"""Implement the SequentialGeometricProgram class"""
from time import time
from collections import OrderedDict
import numpy as np
from ..exceptions import InvalidGPConstraint, Infeasible, UnnecessarySGP
from ..keydict import KeyDict
from ..nomials import Variable
from .gp import GeometricProgram
from ..nomials import P... |
# Copyright (c) 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 ... |
_BASE_WWW_BILIBILI_COM="https://www.bilibili.com"
_BASE_API_BILIBILI_COM="https://api.bilibili.com"
_BASE_API_BILIBILI_COM_X="https://api.bilibili.com/x"
_BASE_API_BILIBILI_COM_X_V2="%s/v2" % _BASE_API_BILIBILI_COM_X
_BASE_WEB_INTERFACE="%s/web-interface" % _BASE_API_BILIBILI_COM_X
_BASE_API_VC_BILIBILI_COM="http://ap... |
# -*- coding: utf-8 -*
from __future__ import print_function
from googleapiclient.discovery import build
from httplib2 import Http
from oauth2client import file, client, tools
import json
import os
from flask import Flask
from flask import jsonify
from flask_cors import CORS
app = Flask(__name__)
#A tester
cors = ... |
import sys
from math import floor
from time import time, localtime
from shutil import get_terminal_size
from platform import system
from typing import Union
from .func import get_stdout
class ProgressBar:
def __init__(self, bar_type: str) -> None:
self.machine = False
self.hide = False
... |
# Copyright 2014 Muchos authors (see 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... |
import ast
import inspect
import keyword
import sys
import traceback
from clikit.api.io import IO
class ExceptionTrace(object):
"""
Renders the trace of an exception.
"""
THEME = {
"comment": "<fg=black;options=bold>",
"keyword": "<fg=yellow>",
"builtin": "<fg=blue>",
... |
"""
WSGI config for lithography 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.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_S... |
# -*- coding: utf-8 -*-
from dotrunner.version import VERSION
from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='dotrunner',
version=VERSION,
description='Links dotfiles',
long_description=rea... |
from cuor.organizations.api import OrganizationRecord
import traceback
def remove_nulls(d):
return {k: v for k, v in d.items() if v is not None}
def _assing_if_exist(data, record, field):
if field in record:
data[field] = record[field]
def insert_in_cuor(data, inst):
# try:
OrganizationReco... |
'''
Encoder functions for all standard FieldTypes.
Encoders are responsible for converting a python object into bytes*
*Not all encoders return bytes objects.
FieldTypes that operate on the bit level cant be expected to return
even byte sized amounts of bits, so they operate differently.
A FieldTypes serializer and e... |
import tensorflow as tf
from networks.network import Network
from ..fast_rcnn.config import cfg
import pdb
n_classes = 21
_feat_stride = [16,]
anchor_scales = [2,4,8,16,32]
class Resnet50_test(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shap... |
#!/usr/bin/python
#
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
import mysql
import pickle
import hashlib
import mysql.connector
from mysql.connector import pooling
import settings
import datetime
from time import sleep
def initDatabase():
global connection_pool
connection_object = connection_pool.get_connection()
cursor = connection_object.cursor()
cu... |
#!/usr/bin/env python
import argparse
from datetime import date
import hashlib
import logging
import sys
import textwrap
from classes.resource import Resource
from classes.dbmanager import ResourceStorage
from classes.reporter import HtmlReport
import helpers
def get_reports_path(path):
today = date.today()
... |
# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debuggi... |
import dash_bootstrap_components as dbc
import dash_html_components as html
from dash.dependencies import Input, Output, State
popover = html.Div(
[
dbc.Button(
"Click to toggle popover", id="popover-target", color="danger"
),
dbc.Popover(
[
dbc.Popov... |
from datetime import datetime
from matplotlib import pylab as plt
from requests_cache import CachedSession
CACHE_EXPIRATION_SECS = 3600*24*356
YEAR_RANGE = range(2018, 2022)
MARKERS = ["o", "s", "d", "+", "*"]
RIRS = {
'AFRINIC': {
'url': 'https://ftp.ripe.net/ripe/rpki/afrinic.tal/',
... |
# -*- coding: utf-8 -*-
"""This module contains an adapter for reading Modbus data and sending it to Procem RTL worker."""
# Copyright (c) TUT Tampere University of Technology 2015-2018.
# This software has been developed in Procem-project funded by Business Finland.
# This code is licensed under the MIT license.
# Se... |
# coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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... |
import os
import re
class ConfigBase(object):
def __init__(self, path):
self.path = path
@classmethod
def squash_int_range(cls, ilist):
"""Takes a list of integers and squashes consecutive values into a
string range. Returned list contains mix of strings and ints.
"""
... |
# -*- 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... |
from .policy import DDPG
from .trainer import DDPGTrainer
from .loss import DDPGLoss
NAME = "DDPG"
LOSS = DDPGLoss
TRAINER = DDPGTrainer
POLICY = DDPG
CONFIG = {
"training": {
"update_interval": 1,
"batch_size": 1024,
"tau": 0.01,
"optimizer": "Adam",
"actor_lr": 1e-2,
... |
import glob
import os
import tarfile
from subprocess import check_call
import modules.config as c
import modules.functions as f
def run_task_build_pdfium():
f.debug("Building PDFium...")
target = "android"
build_dir = os.path.join("build", target)
f.create_dir(build_dir)
target_dir = os.path.jo... |
"""
General networks for pytorch.
Algorithm-specific networks should go else-where.
"""
import torch
from torch import nn as nn
from torch.nn import functional as F
from rlkit.policies.base import Policy
from rlkit.torch import pytorch_util as ptu
from rlkit.torch.core import PyTorchModule
from rlkit.torch.data_manag... |
'''
multilinha
comentario
aqui
'''
a = 10
b = 2
val1 = 123456
val2 = "sopa de ....."
val3 = 123.123
print("\n")
# operadores logicos
print(a == b) # vc ja sabe oq eh
print(a != b) # vc ja sabe oq eh
print(a < b) # vc ja sabe oq eh
print(a >= b) # vc ja sabe oq eh
print(a <= b) # vc ja sabe oq eh
print("\n")
# m... |
from setuptools import setup, find_packages
import sys
with open('requirements.txt') as f:
reqs = f.read()
reqs = reqs.strip().split('\n')
install = [req for req in reqs if not req.startswith("git+git://")]
depends = [req.replace("git+git://", "git+http://") for req in reqs if req.startswith("git+git://")]
setu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from clinicgen.text.sentsplit import LineBreakSplitter, NLTKSentenceSplitter, SpaCySentenceSplitter, StanzaSentenceSplitter
class TestLineBreakSplitter(unittest.TestCase):
def test_split(self):
splitter = LineBreakSplitter()
text = 'He... |
import os
import stat
from pathlib import Path
from shutil import move, rmtree
from typing import Optional, Set, Union
from warnings import warn
from cookiecutter.generate import generate_files
from git import Repo
from .cookiecutter import CookiecutterContext, generate_cookiecutter_context
from .cruft import CruftSt... |
import matplotlib.pyplot as plt
import os
def plot_cost(cost):
fig, ax1 = plt.subplots()
ax1.set_xlabel('Iterations')
ax1.set_ylabel('Cost')
plt.plot(cost)
fig.tight_layout()
plot_filename = os.path.join(os.getcwd(), 'figures', 'cost.png')
plt.savefig(plot_filename)
plt.show()
|
from .settable_generator import *
|
# coding=utf-8
# Copyright 2019 The TensorFlow Datasets 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 appl... |
from enum import Enum
from datetime import datetime, date
from dateutil.relativedelta import relativedelta, MO
import argparse
import holidays
import pandas as pd
class BGEHolidays(holidays.HolidayBase):
def _populate(self, year):
holidays.UnitedStates._populate(self, year)
# Remove Martin Luther... |
from django.contrib import admin
from oppurtunity.models import Opportunity
admin.site.register(Opportunity)
|
import tkinter as tk
from tkinter import *
import cv2
import csv
import os
import numpy as np
from PIL import Image,ImageTk
import pandas as pd
import datetime
import time
##Error screen2
def del_sc2():
sc2.destroy()
def err_screen1():
global sc2
sc2 = tk.Tk()
sc2.geometry('300x100')
sc2.iconbitma... |
# coding=utf-8
# Copyright 2020 TF.Text 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 ag... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import base64
import hashlib
from ccxt.base.errors import ExchangeError
from ccxt.base.errors impor... |
from btc.utils import mod_inverse, int2hex
# Parameters for SECP256k1 elliptic curve (used by Bitcoin)
SECP256K1_A = 0
SECP256K1_B = 7
SECP256K1_GX = 0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798
SECP256K1_GY = 0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8
SECP256K1_P = 2**25... |
# GPLv3 License
#
# Copyright (C) 2020 Ubisoft
#
# 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 2 of the License, or
# (at your option) any later version.
#
# This program is dis... |
import tensorrt as trt
import pycuda.driver as cuda
import numpy as np
import pycuda.autoinit
def allocate_buffers(engine, batch_size, data_type):
"""
This is the function to allocate buffers for input and output in the device
Args:
engine : The path to the TensorRT engine.
batch_size : The bat... |
"""parquet - tool for inspecting parquet files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import sys
def setup_logging(options=None):
"""Configure logging based on options... |
"""
Copyright Government of Canada 2021
Written by: Eric Marinier, National Microbiology Laboratory,
Public Health Agency of Canada
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 at:
htt... |
import heapq
import sys
from itertools import product
def load_data(path):
with open(path) as f:
return {
(i, j): int(value)
for i, line in enumerate(f.readlines())
for j, value in enumerate(line.strip())
}
def get_neighbours(loc, n_rows, n_cols):
neighbou... |
import re
from vsmetaEncoder import vsmetaInfo
from datetime import datetime, date
class VsMetaInfoGenerator(vsmetaInfo.VsMetaInfo):
def __init__(self, feedItem):
super(VsMetaInfoGenerator, self).__init__()
self.feedItem = feedItem
self.download_url = ''
# parse feedItem
... |
# Lint as: python2, python3
# Copyright 2019 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
#
... |
"""empty message
Revision ID: f025f89b250b
Revises: 37eabcbbb8fb
Create Date: 2019-10-19 18:12:48.976655
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f025f89b250b'
down_revision = '37eabcbbb8fb'
branch_labels = None
depends_on = None
def upgrade():
# ... |
import logging
from pyhocon import ConfigTree # noqa: F401
from typing import Any # noqa: F401
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.mode_analytics.mode_dashboard_utils import ModeDashboardUtils
from databuilder.rest_api.mode_analytics.mode_paginated_rest_ap... |
from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Vehicle, ImageSpacec
from darknet_dmg import detect
@receiver(post_save, sender=Vehicle)
def damage_detection(sender, instance, **kwargs):
image = ImageSpace.objects.filter(vehicle=instance.id).last()
path =... |
import dash
import dash_core_components as dcc
import dash_html_components as html
about_layout = [html.Div(children=[
html.Img(src='/assets/logo.png', className='logo-big', style={'marginTop': 'auto', 'marginBottom': 'auto'}),
html.Div(children='Network and Sentiment Anlysis on Amazon Dataset', className="tex... |
"""
WSGI config for athena_dream_stodio_33748 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.setdef... |
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... |
from __future__ import division
# LIBTBX_SET_DISPATCHER_NAME mmtbx.ss_idealization
from mmtbx.secondary_structure import build as ssb
import mmtbx.model
import iotbx.pdb
import os, sys
def run(args):
pdb_inp = iotbx.pdb.input(source_info=None,
file_name=args[0])
model = mmtbx.model.manager(
model_inpu... |
from collections import deque
from typing import Dict, Set, Deque, List, Optional
from sc2.data import Race
from sc2.position import Point2
from sharpy.events import UnitDestroyedEvent
from sharpy.interfaces import IMemoryManager
from sharpy.managers.core import ManagerBase
from sc2.ids.unit_typeid import UnitTypeId
f... |
"""
Tests for salt.states.zpool
:codeauthor: Jorge Schrauwen <sjorge@blackdot.be>
:maintainer: Jorge Schrauwen <sjorge@blackdot.be>
:maturity: new
:depends: salt.utils.zfs, salt.modules.zpool
:platform: illumos,freebsd,linux
"""
import salt.loader
import salt.states.zpool as zpool
import salt.ut... |
from django.conf.urls import patterns, include, url
from django.views.generic import RedirectView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', RedirectView.as_view(url='/xAPI/')),
url(r'^XAPI/', include('lrs.urls')... |
from flask_wtf import FlaskForm
from wtforms import BooleanField, HiddenField, StringField, SubmitField, ValidationError
from wtforms.validators import Length, Required
from .. models import EventFrameTemplateView
class CopyEventFrameTemplateViewForm(FlaskForm):
name = StringField("Name", validators = [Required(), Le... |
import math
import os
import random
import re
import sys
n = int(input(""))
number = int(n)
number= n%2
if n ==1:
print("Weird")
else:
if (number==0) and (n >= 2) or ((number==0) and (n <= 5)):
print("Not Weird")
elif (number ==0) and (n>=6) and ((number==0) and (n<=20)):
print ("Weird")
... |
# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
from gpiozero import LED
from time import sleep
import socket
import serial
#low level IC control pins
led1 = LED(13) #A0 pin
led2 = LED(6) #A1 pin
led3 = LED(5) #A2 pin
led4 = LED(27) #led4+5 = device rest plate
led5 = LED(22)
###setup communication with C# host software
##TCP_IP = '169.254.130.182'
##TCP_PORT = 500... |
# -*- coding: utf-8 -*-
"""
Created on 12/21/2018
@author: BioinfoTongLI
"""
import numpy as np
import read_roi
from imagepy.core.engine import Free
from imagepy import IPy
from skimage.draw import polygon
class Plugin(Free):
"""load_ij_roi: use read_roi and th pass to shapely objects"""
title = 'Import Rois f... |
from functools import partial
from typing import Callable, List, Union
import numpy as np
import pandas as pd
from scipy.stats import friedmanchisquare, rankdata
from sklearn.metrics.pairwise import pairwise_distances
from statsmodels.stats.libqsturng import qsturng
Matrix = List[List[float]]
def friedman_nemenyi(t... |
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
""" utility functionality for ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 TickSmith Corp.
#
# Licensed under the MIT License
#
# 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, ... |
"""
Last edited: January 20 2020
|br| @author: FINE Developer Team (FZJ IEK-3) \n\n
The approaches used are described in
Robinius et. al. (2019) "Robust Optimal Discrete Arc Sizing for Tree-Shaped Potential Networks"
and they are further developed with the help of
Theorem 10 of Labbé et. al. (2019) "Bookings in the Eu... |
# 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 ... |
from array import*
# in array all the value have to be in same type
# array in python , dont have fixed size means they are flexible
vls = array('i',[5,34,54,23,26,32,2]) ## i = unsigned int
# copying array
newArr = array(vls.typecode,(a for a in vls)) # fetch one value form vls and assigned... |
import pickle
import torch
import torch.nn as nn
import torch.nn.functional as F
from os.path import join as pjoin
from memory import ReplayMemory, Transition, State
from model import DRRN
from util import *
import logger
import sentencepiece as spm
device = torch.device("cuda" if torch.cuda.is_available() else "cpu"... |
"""
This module has all the tools necessary for me to handle a knowledge logic problem
""" |
# Copyright 2013-2019 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)
"""Tests for ``llnl/util/filesystem.py``"""
import llnl.util.filesystem as fs
import os
import stat
import pytest
@pyte... |
import abc
import csv
from collections import namedtuple, defaultdict, OrderedDict, Counter
import numpy as np
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
from sklearn.metrics.pairwise import cosine_similarity as sim
from sklearn.pipeline import Pi... |
#!/usr/bin/env python3
from password_manager import User, Credentials
def create_user(fname, lname, uname, email, password):
'''
Function that creates a new user
'''
new_user = User(fname, lname, uname, email, password)
return new_user
def save_users(user):
'''
Function that saves a new user
'''
use... |
import sys
import os
import torch
import pandas as pd
import datetime
from argparse import ArgumentParser
import numpy as np
from torch import nn, optim
import torch.nn.functional as F
from torch.utils.data import DataLoader, random_split
from icecream import ic
import pytorch_lightning as pl
from pytorch_lightning.me... |
"""
Setup authentication from various providers
"""
import json
import os
import subprocess
import shutil
from hubploy.config import get_config
from ruamel.yaml import YAML
yaml = YAML(typ='rt')
def registry_auth(deployment):
"""
Do appropriate registry authentication for given deployment
"""
config... |
import uuid
from fastapi import Depends, FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastapi.security import OAuth2PasswordRequestForm
from pydantic import BaseSettings, BaseModel, UUID4
from fastapi_login import LoginManager
from fastapi_login.exceptions import InvalidCredentialsException
... |
import json
import os
import sys
import shutil
import tempfile
import unittest
import ray
import ray.cloudpickle as cloudpickle
from ray.rllib import _register_all
from ray import tune
from ray.tune.logger import NoopLogger
from ray.tune.utils.trainable import TrainableUtil
from ray.tune.function_runner import with_p... |
# Copyright 2011 Justin Santa Barbara
# 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... |
import os
import random
import subprocess
import numpy as np
import torch
import time
try:
import torch_xla
import torch_xla.core.xla_model as xm
XLA = True
except ModuleNotFoundError:
XLA = False
def freeze_module(module):
for i, param in enumerate(module.parameters()):
param.requires_gra... |
import os
import resources_portal.models # noqa
from flask import Flask
from flask_migrate import Migrate
from flask_restful import Api
from resources_portal.db import db
from resources_portal.views import user
migrate = Migrate()
def initialize_routes(api: Api):
api.add_resource(user.UsersApi, "/users")
a... |
from CommonServerPython import *
reload(sys)
sys.setdefaultencoding('utf-8') # pylint: disable=E1101
requests.packages.urllib3.disable_warnings()
URL = demisto.getParam('server')
if URL[-1] != '/':
URL += '/'
if not demisto.getParam('proxy'):
del os.environ['HTTP_PROXY']
del os.environ['HTTPS_PROXY']
... |
"""
This module contains common reusable functions.
"""
from traceback import print_stack
from configparser import ConfigParser
from SupportLibraries.ui_helpers import UIHelpers
class BaseHelpers(UIHelpers):
"""
This class includes basic reusable base_helpers.
"""
def __init__(self, driver):
... |
#!/usr/bin/env python
import sys, os, pwd, grp, signal, time, base64
from resource_management import *
from resource_management.core.exceptions import Fail
from resource_management.core.logger import Logger
from resource_management.core.resources.system import Execute, Directory, File
from resource_management.core.shel... |
#!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#... |
from .traffic_junction_hard import TrafficJunctionHard
|
"""
This file contains all the settings that defines the development server.
SECURITY WARNING: don't run with debug turned on in production!
"""
import logging
from typing import List
from server.settings.components import config
from server.settings.components.common import INSTALLED_APPS, MIDDLEWARE
# Setting the... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from enum import auto, Enum
from typing import NamedTuple, Optional
class Parameter(NamedTuple):
class Kind(Enum):
ARG = auto(... |
from django.db import models
from django_encrypted_json.fields import EncryptedValueJsonField
# Create your models here.
class TestModel(models.Model):
json = EncryptedValueJsonField(default={})
optional_json = EncryptedValueJsonField(blank=True, null=True)
partial_encrypt = EncryptedValueJsonField(
... |
import asyncio
import json
import logging
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # noqa
from runners.support.agent import DemoAgent, default_genesis_txns
from runners.support.utils import (
log_json,
log_msg,
log_status,
log_timer,
prompt... |
# -*- coding: UTF-8 -*-
import os, sqlite3
from PySide2.QtWidgets import QComboBox
from moduels.component.NormalValue import 常量
# 添加预设对话框
class Combo_EngineList(QComboBox):
def __init__(self):
super().__init__()
self.initElements() # 先初始化各个控件
self.initSlots() # 再将各个控件连接到信号槽
self.... |
"""Example 003: List envelopes in the user's account"""
from flask import render_template, url_for, redirect, session, flash, request
from os import path
import json
from app import app, ds_config, views
from datetime import datetime, timedelta
from docusign_esign import *
from docusign_esign.rest import ApiException
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2018-01-22 12:07
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('prov_vo', '0005_add_activitydescription_entitydescription')... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2016, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
from django.db import models
from account.models import UserAccount
# 行程資料
class Trip(models.Model):
#來源網站
strSource = mo... |
import inspect
import logging
import os
import re
import subprocess
from typing import Dict, Any
from pyhttpd.certs import CertificateSpec
from pyhttpd.conf import HttpdConf
from pyhttpd.env import HttpdTestEnv, HttpdTestSetup
log = logging.getLogger(__name__)
class H2TestSetup(HttpdTestSetup):
def __init__(se... |
from dgl import BatchedDGLGraph
from dgl.nn.pytorch.conv import GINConv
from torch import nn
from models.GNN.GNNModelBase import GNNModelBase
from models.utils import TypeConditionalLinear
class GIN(GNNModelBase):
"""
Graph Isomorphism Network as described in https://arxiv.org/pdf/1810.00826.pdf
"""
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.