content stringlengths 5 1.05M |
|---|
from bs4 import BeautifulSoup
from flask import url_for
from application.utils import generate_token
from application.auth.models import TypeOfUser
from tests.models import UserFactory
def test_confirm_account_rejects_easy_password(app, test_app_client):
rdu_user = UserFactory(user_type=TypeOfUser.RDU_USER, ac... |
# -*- coding: utf-8 -*-
import logging
import warnings
from logging.handlers import QueueHandler
from logging.handlers import QueueListener
from queue import Queue
from typing import Dict, Mapping, Any
from typing import Optional
from typing import Type
from logging_loki import const
from logging_loki import emitter
... |
import dash
from dash import Input, Output, dcc, html
import plotly.graph_objects as go
import dash_bootstrap_components as dbc
import pandas as pd
# Reading the data and filling missing data
df = pd.read_csv(
"https://raw.githubusercontent.com/tolgahancepel/tempdataset/main/hofstede-cultural-dimensions.csv",
... |
import json
import urllib.parse
from pathlib import Path
from unittest.mock import MagicMock
from freezegun import freeze_time
from nefelibata.announcers.medium import MediumAnnouncer
__author__ = "Beto Dealmeida"
__copyright__ = "Beto Dealmeida"
__license__ = "mit"
def test_announcer(mock_post, requests_mock):
... |
# Copyright 2020 The FastEstimator 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 appl... |
"""
Example that uses the pyglet module to display the image as it renders
"""
import numpy as np
from progress.bar import Bar
import pyglet
import os.path
from PIL import Image
import pyglet.window.key as key
# Local Modules
from camera import Camera
from constants import RGB_CHANNELS, MAX_QUALITY
from material impor... |
# Copyright 2019 Huawei Technologies Co., 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 a... |
import typing
class APK:
def __init__(self, apk_id: str, name: str='', scrape_src: str='',
download_src: str=''):
self.apk_id = apk_id
self.name = name
self.scrape_src = scrape_src
self.download_src = download_src
@property
def apk_id(self):
return... |
# from bootstrap_modal_forms.generic import BSModalCreateView
from django.contrib.auth.decorators import login_required
import json
import logging
from django.http import HttpResponseForbidden, JsonResponse
from django.http.response import Http404
from django.shortcuts import *
from django.urls import reverse, reverse_... |
import os
import shutil
import markdown
import frontmatter
import datetime
import json
from jinja2 import Template
from pathlib import Path
class Generator:
def __init__(self, content = "", dest_path = "output.html", config = {}, is_markdown = False):
if not dest_path:
raise ValueError('dest_path must have... |
""" ===========================================================================
CompSci 261P Data Structures Project 1
Tests for hash methods (linear, chained, cuckoo, chained with tabulation)
Author: Qixiang Zhang (David)
Student ID: 70644128
Email: qixianz@uci.edu
===================================================... |
import itertools
with open("data.in") as file:
lines = file.read().strip().split('\n\n')
scanners = []
for line in lines:
coords = []
for ln in line.splitlines()[1:]:
split_coords = ln.split(',')
coord = (int(split_coords[0]), int(split_coords[1]), int(s... |
import argparse
from math import inf
import utils
from utils.sort.iou_matching import iou
from numpy.core.fromnumeric import shape
import torch
import cv2
import os
import time
import numpy as np
import random
import copy
from utils.utils import get_config, do_detect, plot_boxes,plot_boxes_cv2,load_class_names,bbox_iou... |
from .storage import AuthRecordsStorage
from ..records import ProxyRecord
from ..session_types import Proxy
from .serializers import ProxyRecordsSerializer
class ProxyStorage(AuthRecordsStorage):
def __init__(self, save_pth: str):
super().__init__(save_pth, ProxyRecordsSerializer())
def replace_proxy... |
import os
import pathlib
import click
from proto_builder.core.file_utils import create_clean_folder, delete_folder
from proto_builder.core.config import Config
from proto_builder.core.bin_manager import in_wsl
import proto_builder
ROOT_FOLDER = pathlib.Path(proto_builder.__file__).parent
# Temporary folder holding ... |
from .menu import Menu
from .urls import INFO_URL, MENU_URL
from .utils import request_json
class Store(object):
def __init__(self, data={}):
self.id = int(data.get('StoreID', -1))
self.data = data
def get_details(self):
details = request_json(INFO_URL, store_id=self.id)
retur... |
from __future__ import print_function
import logging
import operator
import os
from collections import OrderedDict
import six
from lxml import etree
from zeep.parser import (
absolute_location, is_relative_path, load_external, parse_xml)
from zeep.utils import findall_multiple_ns
from zeep.wsdl import parse
from... |
from django.core import mail
from django.test import TestCase, Client
from util.factories import *
from user_accounts.models import *
SIGNUP_URL = reverse('user_accounts:signup')
class EmailTestCase(TestCase):
"""
Tests emails.
"""
def setUp(self):
self.client = Client()
self.password ... |
import logging
from flask import url_for, jsonify
import urllib
def list_routes(app):
app.logger.info('list_routes')
output = []
for rule in app.url_map.iter_rules():
options = {}
for arg in rule.arguments:
options[arg] = "[{0}]".format(arg)
methods = ','.join(rule.... |
import pytest
import jsonpickle
from urllib.parse import quote_plus
from namex.services.name_request.auto_analyse import AnalysisIssueCodes
from ..common import assert_issues_count_is_gt, assert_correct_conflict, save_words_list_name, \
save_words_list_classification, assert_additional_conflict_parameters
from .... |
from rest_framework import permissions
from rest_framework import viewsets
from .models import SiteConfiguration
from .serializers import SiteConfigurationSerializer
class SiteConfigurationViewSet(viewsets.ModelViewSet):
queryset = SiteConfiguration.objects.all()
serializer_class = SiteConfigurationSerializer... |
from fastapi.testclient import TestClient
from .main import app
client = TestClient(app)
def test_get_root():
response = client.get("/")
assert response.status_code == 200
assert response.json() == {"message": "devnet example api"}
def test_get_inventory():
item = "fake_item"
response = client... |
#!/usr/bin/env python
# coding: utf-8
import matplotlib.cm as cm
import os
import tempfile
import numpy as np
import scipy as sp
from scipy.fft import fft, fftfreq
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import time
from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib ... |
# -*- coding: utf-8 -*-
"""Implementations of losses.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras.backend as K
class MarginLoss(object):
"""Margin loss.
This loss is the margin loss implementation with a specifiable `margin`
... |
#author: VO Thanh Cong
import numpy as np
import os
import matplotlib.pyplot as plt
def get_vector(path):
try:
img = open(path, 'r').readlines()
vector = np.array([float(x.strip()) for x in img])
except IOError: # Message d'erreur si lu un fichier d'erreur.
vector = np.arra... |
__doc__ = """
Plotting functions for data science.
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def plot_distribution(df, col, ax=None, **kwargs):
"""
Plot a histogram of the distribution of a given column.
Parameters
----------
df : pandas.DataFrame
Input da... |
'''tests for saml_configuration API endpoints'''
import responses
RE_BASE = 'https://pytenable.tenable.ad/api'
@responses.activate
def test_saml_configuration_singleton(api):
'''tests the saml_configuration_singleton API response with
actual saml_configuration_singleton response'''
responses.add(response... |
# coding=utf-8
# Copyright 2020 HuggingFace 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 applica... |
# Copyright (C) 2020 The Android Open Source Project
#
# 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 autofilter.google_api as google
import autofilter.create_label as af_labels
import autofilter.create_filter as filters
import autofilter.group_manager as groups
import autofilter.fetch_label_ids as fetch_labels
import json
def main():
''' Loads config data. '''
data = loadData()
try:
for us... |
import asyncio
import time
from datetime import timedelta, datetime
import typing
from decimal import Decimal
from aiokraken.rest import RestClient
from collections.abc import Mapping
from aiokraken.utils.filter import Filter
# Note: Conceptually, a balance over time IS a ledger...
# and vice versa a Ledger state... |
import pandas as pd
import numpy as np
import dateutil
import networkx as nx
ADULT_AGE = 18
def get_hmis_cp():
"""
Pull in relevant CSVs from `../data/`, merge them, clean them, and return a tuple containing the cleaned HMIS data
and the cleaned Connecting Point data.
"""
# get raw dataframes
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from robot_simulator.agent.direction import Direction
from robot_simulator.errors import MissingPlaceError, MoveOutOfBoundsError
from robot_simulator.grid.board import Board
from robot_simulator.grid.positioning import Point
class Robot:
def __init__(self, board: Boa... |
"""Provide a class for yWriter 7 project import and export.
yWriter version-specific file representations inherit from this class.
Copyright (c) 2022 Peter Triesberger
For further information see https://github.com/peter88213/PyWriter
Published under the MIT License (https://opensource.org/licenses/mit-license.... |
# Consider the following:
#
# A string, s, of length n where s=c0c1c2....cn. An integer, k, where is a factor of n.
#
# We can split s into n/k subsegments where each subsegment, t, consists of a contiguous block of k characters in s.
# Then, use each t to create string u such that:
#
# The characters in u are a subse... |
def reverse(string):
string = "".join(reversed(string))
return string
def Pali(s):
# Calling reverse function
revstr = reverse(s)
# Checking if both string are equal or not
if (s == revstr):
return True
return False
s = input("Enter a String:")
ans = Pali(s)
if ans == True:
... |
#!/usr/bin/env python2
"""Dump /arc/ppark.narc.
This is an unmaintained one-shot script, only included in the repo for
reference.
"""
import sys
from struct import pack, unpack
import binascii
import pokedex.db
from pokedex.db.tables import PalPark
types = [
'',
'grass',
'fire',
'water',
'bug... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
from IPython import get_ipython
import math
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.preprocessing import StandardScaler
get_ipython().run_l... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
"""
This script generates the common API declarations that any metadata reader must implement.
In general, this script consumes the metadata record schema defined in Sche... |
def policy(resource):
# Explicit check for True as the value may be None, and we want to return a bool not a NoneType
return resource["LogFileValidationEnabled"] is True
|
import typing
from abaqusConstants import *
from .BoundaryCondition import BoundaryCondition
from ..Region.Region import Region
class ConnVelocityBC(BoundaryCondition):
"""The ConnVelocityBC object stores the data for a connector velocity boundary condition.
The ConnVelocityBC object is derived from the Boun... |
import json
from django.views import View
from django.core.exceptions import SuspiciousOperation, PermissionDenied
from django.http import HttpResponse
from django.conf import settings
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from .utils import timesaf... |
"""
module used to set values into ndb database properties,
this module also has an added function of validating any such values to insure data integrity.
the module will also trigger events when some database properties are being set or reset.
allowing certain actions to be triggered if its necessary t... |
import pyperclip
import unittest
from password import Password
class TestPassword(unittest.TestCase):
'''
Test class that defines test cases for the password class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creating test cases
'''
def setUp(self):
'''
... |
from argparse import Namespace
from project.core import command
from project.core.parser import Parser
from project.core.terminal import Terminal
class Echo(command.Command):
"""Print any given text.
Example: echo Hello, World!
"""
def __init__(self) -> None:
super().__init__(name='echo')
... |
class SelectFile:
@staticmethod
def get_path(message:str) -> str:
"""
Return the path of the selected file
"""
print(message)
return input()
|
import os
import time
import pytest
from threading import Thread
from pympler.tracker import SummaryTracker
from swsscommon import swsscommon
from swsscommon.swsscommon import ConfigDBPipeConnector, DBInterface, SonicV2Connector, SonicDBConfig, ConfigDBConnector, SonicDBConfig, transpose_pops
import json
existing_file... |
from django.http import HttpResponse
from django.shortcuts import render, redirect
from django.views.decorators.http import require_http_methods
from core.models import Lines, Registers
from .div_calc2 import get_multiplier, get_secondary_get_multiplier
import time
debug_mode = False
status = ['OK']
if not debug_m... |
'''
Created on 1.12.2016
@author: Darren
''''''
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.
"
'''
|
import interneting as web
uuid = "j13iof-13f13-13f31"
password = "2383"
#res_json = web.verify_card(uuid, password)
res_json = web.verify_uuid(uuid)
print(res_json['status']) |
# import sys
# sys.path.append('../')
from som import ManifoldModeling as MM
import matplotlib.pyplot as plt
import matplotlib.animation as ani
import numpy as np
import pickle
from sklearn.decomposition import NMF
def update(i, fig_title, Z):
if i != 0:
plt.cla() # 現在描写されているグラフを消去
... |
from config import Config
from flask import Flask
def create_app(config=Config):
app = Flask(__name__)
app.config.from_object(config)
from . models_api import models
app.register_blueprint(models, url_prefix='/style_model')
return app
|
#!/usr/bin/env python
# plot trajectory of earth satellite
import sys
import math
import pygame
import random
from collections import defaultdict
# The window size
WIDTH, HEIGHT = 900, 600
WIDTHD2, HEIGHTD2 = WIDTH/2., HEIGHT/2.
# The number of simulated planets
PLANETS = 30
# The density of the planets - used to c... |
#
# PySNMP MIB module BDCOM-MEMORY-POOL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BDCOM-MEMORY-POOL-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:36:45 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
import json
import csv
from baseline.base_utils import INTENTION_TAGS
from utils import get_project_path
import os
# Complete or incomplete data
complete_data = False
dataset_arr = ['chatbot', 'snips']
dataset_fullname_arr = ['ChatbotCorpus', 'snips']
for tts_stt in ["gtts_witai", "macsay_witai"]:
for dataset_na... |
# -*- coding: utf-8 -*-
#constant values
#Copyright (C) 20XX anonimous <anonimous@sample.com>
#アプリケーション基本情報
APP_FULL_NAME = "JAWS for Windows Logging Tool"#アプリケーションの完全な名前
APP_NAME="JFW_LOG"#アプリケーションの名前
APP_ICON = None
APP_VERSION="1.0.0"
APP_LAST_RELEASE_DATE="20xx-xx-xx"
APP_COPYRIGHT_YEAR="2021"
APP_LICENSE="MIT Li... |
# coding=utf-8
# Copyright 2022 GradMax 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... |
from abc import ABC, abstractmethod
import pickle
import cloudpickle
from stable_baselines import logger
class AlreadySteppingError(Exception):
"""
Raised when an asynchronous step is running while
step_async() is called again.
"""
def __init__(self):
msg = 'already running an async step... |
# CPU: 0.08 s
from collections import deque
for tc in range(1, int(input()) + 1):
stack = deque()
width = int(input().split()[0])
for _ in range(width):
stack.append(input()[::-1])
print("Test", tc)
for _ in range(width):
print(stack.pop())
|
"""
You can generate a CSV dataset by running:
```
cli oxford split-dataset
```
This splits the original dataset into a train and validation split.
With separate datasets, you can apply different transformation pipelines.
"""
import pandas as pd
import pytorch_lightning as pl
import torch
import torchvision
from PIL... |
#!/usr/bin/env python
import csv
import subprocess
import math
import json
import os
import shlex
from optparse import OptionParser
def split_by_manifest(filename, manifest, vcodec="copy", acodec="copy",
extra="", **kwargs):
""" Split video into segments based on the given manifest file.
... |
# Generated by Django 3.2.8 on 2022-01-03 07:03
import datetime
from django.db import migrations, models
import django.db.models.deletion
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('amcm', '0026_auto_20220103_0049'),
]
operations = [
m... |
from abc import ABC, abstractmethod
from base64 import b64decode
import datetime
from clarkproc.fhir.containers import ObservationContainer, MedicationContainer
from clarkproc.fhir.errors import *
class CodeValue:
"""
Data structure for holding key components of FHIR Coding resource.
Reference: http://hl... |
import platform
if platform.system() != "Java":
print("Load this file inside jython, if you need the stand-alone tool run: inql")
exit(-1)
from array import array
from burp import IScanIssue, IScannerCheck
from inql.constants import TECH_CHECKS, CONSOLE_CHECKS, URLS
class _CustomScanIssue(IScanIssue):
... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 28 18:31:41 2018
@author: USUARIO
"""
import warnings
def celcius_a_kelvin(c):
K = c + 273.15
return K
def color_estrellas(k, externo=True):
if 35000 > k >= 20000:
color="azul"
elif 15000 > k >= 20000:
color="blanzo azulad... |
from django import forms
from django.contrib.auth.models import User
from .models import *
from .constants import *
'''
class CategoryTreeWidget(SelectMultiple):
def render_options(self, choices, selected_choices):
selected_choices=set([force_unicode(v) for v in selected_choices])
top_level_cats = ... |
from io import BytesIO
from time import sleep
from typing import Optional, List
from telegram import TelegramError, Chat, Message
from telegram import Update, Bot
from telegram.error import BadRequest
from telegram.ext import MessageHandler, Filters, CommandHandler
from telegram.ext.dispatcher import run_async
from tg_... |
"""The professor game solver."""
import tiles
import copy
class Edge:
"""Class describing one edge of a tile."""
def __init__(self, color, bdyprt):
"""Initialize a edge of a tile. A tile has four edges."""
self.color = color
self.bdyprt = bdyprt
class Tile:
"""Class description ... |
import streamlit as st
from alphapept.gui import history, results, filewatcher, status, experiment, fasta, start
from PIL import Image
from alphapept.__version__ import VERSION_NO
import os
import socket
_this_file = os.path.abspath(__file__)
_this_directory = os.path.dirname(_this_file)
LOGO_PATH = os.path.join(_this... |
from collections import defaultdict, UserDict
from abc import ABC, abstractmethod
from typing import (
cast,
List,
Dict,
Any,
NamedTuple,
Optional,
Callable,
TypedDict,
Generic,
TypeVar,
Iterable,
Sequence,
Tuple,
Union,
)
from lark import Lark, Transformer as La... |
import numpy as np
from torch.utils.data import Dataset
from sentence_transformers.readers import InputExample
class SbertModelDataset(Dataset):
def __init__(self, corpus, disc_ids, n_examples, shuffle=False):
if shuffle:
data = list(zip(corpus, disc_ids))
np.random.shuffle(data)
... |
from __future__ import absolute_import
import os
import tempfile
import pytest
from astropy.io.fits.tests import FitsTestCase
from .. import fileutil as F
from .. import stpyfits
class TestIsFits(FitsTestCase):
def setup(self):
self.data_dir = os.path.join(os.path.dirname(__file__), 'data')
sel... |
import setuptools
import simple_sample
setuptools.setup(
name="simple-sample",
version=simple_sample.__version__,
author=simple_sample.__author__,
author_email="alessandra.bilardi@gmail.com",
description="A simple sample of a Python package prototype",
# long_description=open('README.md').read(... |
"""Added votes
Revision ID: e55388a1dafc
Revises: a63284931f7f
Create Date: 2021-07-09 17:07:04.731611
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'e55388a1dafc'
down_revision = 'a63284931f7f'
branch_labels = None
depends_on = None
def upgrade():
# ##... |
import numpy as np
import pandas as pd
from sklearn.linear_model.base import LinearModel
import pytest
from xsd.pointwise_models.utils import LinearTrendTransformer, QuantileMapper
from xsd.pointwise_models import (
BcsdPrecipitation,
BcsdTemperature,
PureAnalog,
AnalogRegression,
)
def test_linear... |
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
R G B G
B R R
G R
B
def triangle(row):
while len(row) > 1:
new, RGB = '', {'R','G', 'B'}
for i, j in zip(row[:-1], row[1:]):
if i == j:
new += i
else:
new += (RGB.difference({i, j... |
ENTITY_DEFINITION = {
"patterns": [
[["NUM"], ["LETTER"]],
[["NUM"], ["NUM"], ["LETTER"]]
]
}
|
# Copyright 2020 Huawei Technologies Co., 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 agreed to... |
print("Top level in test.py")
def myFun():
print("Function in test.py")
if __name__ == "__main__":
print("test.py is being run directly")
else:
print("test.py is imported")
# Anthing with 0 indent block will be runs first, because there is no main mehtod
# __name__ built in variable gets assigned a str... |
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from client import LIClient
from settings import search_keys
import time
if __name__ == "__main__":
# initialize LinkedIn web client
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome... |
import pygame
import logging
import os
from game import Game
from transition import Transition
from text import Text
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
LIMEGREEN = (50, 205, 50)
YELLOW = (255, 255, 0)
RED = (255, 0, 0)
SLIVER = (192, 192, 192)
FLAGS = pygame.FULLSCREEN | pygame.HWSURFACE | pygame.DOUBLEBUF
cl... |
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------------------------------------------... |
# in Callable object you can actually call an object as a function to change the values
class Book:
def __init__(self, title, price, author):
super().__init__()
self.title = title
self.price = price
self.author = author
def __str__(self):
return f"Book {self.ti... |
import logging
import time
from src.utils.utils import time_delta_now
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
logger = logging.getLogger(__name__)
class Sum(nn.Module):
def __init__(self, in_channels, in_features, out_channels, dropout=0.0):
super(Sum, s... |
from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
def home_view(request, *args, **kwargs): # *args, **kwargs
# return HttpResponse("<h1>Hello World</h1>") # String of Html code
return render(request, 'home.html', {})
def contact_view(request, *args, **kwargs):
re... |
# pytroch
import torch
from torch import nn
from torch.functional import Tensor
class ParamaterDropout(nn.Module):
def __init__(self, p: float):
super().__init__()
self._p = p
def forward(self, input : Tensor) -> Tensor:
"""
Removes, for each sample, unique paramat... |
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from google.appengine.api import users
from google.appengine.ext import db
from ragendja.auth.models import EmailUserTraits
class GoogleUserTraits(EmailUserTraits):
@classmethod
def get_djangouser_for_user(cls, user):
... |
import os
import re
import sys
import hiero
import pyblish.api
import avalon.api as avalon
from avalon.vendor.Qt import (QtWidgets, QtGui)
import pype.api as pype
from pype.api import Logger, Anatomy
log = Logger().get_logger(__name__, "nukestudio")
cached_process = None
self = sys.modules[__name__]
self._has_been_... |
# Generated by Django 3.0.3 on 2020-08-21 13:08
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('rcsystem', '0004_auto_20200821_1605'),
]
operations = [
migrations.AlterField(
model_name='dbbo... |
from output.models.nist_data.atomic.positive_integer.schema_instance.nistschema_sv_iv_atomic_positive_integer_max_inclusive_2_xsd.nistschema_sv_iv_atomic_positive_integer_max_inclusive_2 import NistschemaSvIvAtomicPositiveIntegerMaxInclusive2
__all__ = [
"NistschemaSvIvAtomicPositiveIntegerMaxInclusive2",
]
|
"""
ExportManager:
"""
import getopt
import glob
import logging
import os
import subprocess
import sys
import time
from hashlib import md5
from datetime import datetime
from urlparse import urlparse
from xml.dom import minidom
from boto import connect_ec2
from boto.ec2.regioninfo import RegionInfo
from boto.ec2.ins... |
from decimal import Decimal, getcontext
from random import randint
# Return 3 decimal places
getcontext().prec = 3
# Function "get_input" verifies the input. As "raw_input" does not accept an int
# as input (which is what we need), the function converts the input into a str
# and checks whether the str is a digit. I... |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... |
import logging
from ghas_kenna.metadata import CWE_SCORES, CRITICALITY
class Vulnerability(object):
__IDENTIFIER__ = "{cwe} :: {path}"
def __init__(self, result, rule):
self.result = result
self.rule = rule
@property
def identifier(self):
""" The Unique string for the Vulne... |
# don't create a parent class here. There is nothing to be gained doing that.
from scipy.stats import norm
from math import exp, log, sqrt
class BsmNode:
'''Data container for Black-Scholes-Merton calculations
Given the type of option (Call or Put), the option's underlying asset price,
the contract's... |
"""
The clustering is already part of the center prediction scipt.
The path to the image and segmentation serves just for visualisation,
for the own clustering they are not needed.
Copyright (C) 2017 Jiri Borovec <jiri.borovec@fel.cvut.cz>
"""
import os
import sys
import logging
from functools import partial
import ... |
import os
import simplejson as json
from oauthlib.oauth1.rfc5849 import SIGNATURE_TYPE_QUERY
from presto.utils.models import Model
from presto.utils.exceptions import ValidationError
from presto.utils.fields import (MultipleObjectsField, UrlField, ChoiceField,
DomainField, FormField, CharField)
PRESTO_CONFIG_FIL... |
from accounts.models import Support
from datetime import datetime,date
from django import forms
from django.contrib.auth import models
from django.contrib.auth.forms import UserCreationForm,UserChangeForm
from django.contrib.auth.models import User
from django.db.models.fields import CharField
from django.forms... |
# flake8: noqa
from .aggregation_primitive_base import *
from .aggregation_primitives import *
from .binary_transform import *
from .cum_transform_feature import *
from .direct_feature import *
from .primitive_base import *
from .transform_primitive import *
from .utils import (
apply_dual_op_from_feat,
get_agg... |
"""pattoo ORM Schema for the Chart table."""
# PIP3 imports
import graphene
from graphene_sqlalchemy import SQLAlchemyObjectType
# pattoo imports
from pattoo.db import db
from pattoo.db.models import Chart as ChartModel
from pattoo.db.schema import utils
from pattoo_shared.constants import DATA_INT
class ChartAttri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.