text stringlengths 2 999k |
|---|
from annotypes import Anno, deserialize_object, Array
from scanpointgenerator.compat import np
from scanpointgenerator.core import Generator, AAlternate
with Anno("The array containing points"):
AGenerator = Array[Generator]
@Generator.register_subclass(
"scanpointgenerator:generator/ConcatGenerator:1.0")
cl... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2014-2015 eNovance
#
# 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... |
"""Takeoff task."""
import numpy as np
from gym import spaces
from geometry_msgs.msg import Vector3, Point, Quaternion, Pose, Twist, Wrench
from quad_controller_rl.tasks.base_task import BaseTask
class All(BaseTask):
"""Simple task where the goal is to lift off the ground and reach a target height."""
def __... |
from difflib import SequenceMatcher
from .Helpers import get_numbers_from_string, date_time_string_to_seconds
from .YtSettings import YtSettings
TITLE = {
'OFFICIALS': ['(Official Video)', '(Official Music Video)'],
'DUMP_STAMPS': ['Official Video', 'Official Music Video', 'HQ', 'HD'],
}
CHANNEL = {
'OFFI... |
"""
Unit and regression test for the qubekit_gui package.
"""
# Import package, test suite, and other packages as needed
import qubekit_gui
import pytest
import sys
def test_qubekit_gui_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "qubekit_gui" in sys.modules
|
import os
import torch
from torch.utils.data import DataLoader, Dataset
meta = torch.load("./data/meta_info_v2.pth")
# DICT = meta["dict"] # {'A': 0, 'C': 1, 'G': 2, 'T': 3}
char_dict = meta["dict"] # {'A': 0, 'C': 1, 'G': 2, 'T': 3}
MAX_LEN = meta["max_len"] # max length of a strand; typically 120; add a const fo... |
'''
Crie um programa que moste na tela todos os número pares que estão no intervalor de entre 1 e 50.
'''
for controle in range(2, 51, 2):
print('{}'.format(controle), end=' ')
print('acabou!')
|
"""
Generate a random hash to change password
"""
import hashlib
import string
import random
def random_key(size=5):
chars = string.ascii_lowercase + string.digits
return ''.join(random.choice(chars) for x in range(size))
def generate_hash_key(salt, random_str_size=5):
random_str = random_key(random_st... |
global_memory_name = "HBM"
def generate_attributes(num_replications, num_global_memory_banks=32):
"""
Generates the kernel attributes for the global memory. They specify in which
global memory the buffer is located. The buffers will be placed using a
round robin scheme using the available global mem... |
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... |
# coding: utf-8
"""
Pure Storage FlashBlade REST 1.5 Python SDK
Pure Storage FlashBlade REST 1.5 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.5
Contact: i... |
#!/usr/bin/env python
"""
Start this file as "./simple_deployment run"
Then you can for instance do this:
> cd examples
> say_hello
> --connect
> exit
"""
from deployer.host import LocalHost
from deployer.node import Node
class example_settings(Node):
# Run everything on the local machine
cl... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.new_plot, name='new_plot'),
] |
import sys, csv, re
import json
# import io
from bson import json_util, ObjectId
from pymongo import MongoClient
if __name__ == "__main__":
# open db connection
dbauth = csv.reader(open('dbauth.txt', 'r')).next()
dbauth[0] = dbauth[0].strip()
dbauth[1] = dbauth[1].strip()
dburl = 'mongodb://' + \... |
from dataclasses import dataclass, field
from typing import List
from xsdata.models.datatype import XmlPeriod
__NAMESPACE__ = "NISTSchema-SV-IV-list-gMonth-length-1-NS"
@dataclass
class NistschemaSvIvListGMonthLength1:
class Meta:
name = "NISTSchema-SV-IV-list-gMonth-length-1"
namespace = "NISTSc... |
"""
User utilities.
"""
from __future__ import absolute_import, print_function
from distutils.util import get_platform
from numpy.distutils import misc_util
from .errors import *
from .common import *
from .parseUtils import joinStrs
from PyDSTool.core.context_managers import RedirectStdout
# !! Replace use of t... |
import unittest
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_my_view(self):
from theblog.views import my_view
request = testing.DummyRequest()
info =... |
from __future__ import absolute_import, division, print_function
import argparse
import csv
import logging
import os
import sys
from collections import defaultdict
import pandas as pd
import numpy as np
import torch
from torch.utils.data import (DataLoader, SequentialSampler,
TensorDatas... |
import keras
from keras.models import Sequential
from keras.models import Model
from keras.layers import Input, Dense, Activation, Lambda
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import MaxPooling2D
from keras.layers.normalization import BatchNormalization
from keras.layers.merge import C... |
from generallibrary import match, replace, deco_cache
from urllib.parse import quote
class Path_Strings:
""" String operations for Path. """
def __getitem__(self, item):
""" Get character from path string.
:param generalfile.Path self: """
return self.Path(self.path.__getitem__(... |
from google_trans_new import google_translator
from pyrogram import filters
from inspect import getfullargspec
from pyrogram.types import Message
from _pyrogram import app
from config import PREFIX
trl = google_translator()
async def edrep(msg: Message, **kwargs):
func = msg.edit_text if msg.from_user.is_self els... |
#!/usr/bin/env python
"""Training on a single process."""
import os
import torch
from onmt.inputters.inputter import build_dataset_iter, \
load_old_vocab, old_style_vocab, build_dataset_iter_multiple
from onmt.model_builder import build_model
from onmt.utils.optimizers import Optimizer
from onmt.utils.misc import... |
import os
import sys
from datetime import datetime
"""Parser of command args"""
import argparse
parse = argparse.ArgumentParser()
parse.add_argument("--type", type=str,choices=['origin', 'grist',], help="run initial file or grist file")
flags, unparsed = parse.parse_known_args(sys.argv[1:])
case_dict = {
"GH_IPS1... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from azure... |
from pathlib import Path
from datetime import datetime, timedelta
import numpy as np
from astropy import units as u
from astropy import stats
from astropy.time import Time
from astropy.nddata import CCDData
import ccdproc
from keckdrpframework.primitives.base_primitive import BasePrimitive
from .utils import pre_co... |
# encoding: utf-8
from __future__ import unicode_literals
import re
from lxml import etree, html
import misaka
from .compat import unicode
from .defang import defang
from .legacy import login_name
try:
from html.parser import locatestarttagend
except ImportError:
try:
from html.parser import locates... |
#
# djangocms-page-meta documentation build configuration file, created by
# sphinx-quickstart on Sun Jun 5 23:27:04 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configura... |
#!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... |
import matplotlib.pyplot as plt
import batman
import numpy as np
from TelApy.tools.studyMASC_UQ import MascaretStudy
from batman.space import (Space, dists_to_ot)
from batman.uq import UQ
from batman.visualization import Kiviat3D, HdrBoxplot, response_surface, Tree
from batman.surrogate import SurrogateModel
from batma... |
# coding: utf-8
"""
Container Security APIs
All features of the Container Security are available through REST APIs.<br/>Access support information at www.qualys.com/support/<br/><br/><b>Permissions:</b><br/>User must have the Container module enabled<br/>User must have API ACCESS permission # noqa: E501
... |
# -- Project information -----------------------------------------------------
import os
project = "Sphinx Book Theme"
copyright = "2020"
author = "the Executable Book Project"
master_doc = "index"
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names... |
"""Test Main methods."""
from unittest import TestCase
from unittest.mock import MagicMock, PropertyMock, create_autospec, patch
from pyof.foundation.network_types import Ethernet
from pyof.v0x01.controller2switch.common import StatsType
from pyof.v0x04.controller2switch.common import MultipartType
from kytos.core.co... |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..preprocess import ECM
def test_ECM_inputs():
input_map = dict(
args=dict(
argstr="%s",
),
autoclip=dict(
argstr="-autoclip",
),
automask=dict(
argstr="-automask",
),
... |
#!/usr/bin/python
from math import pi, cos, sin, sqrt, acos
from sys import exit
def tensprod(T1, T2):
# M3 = tensprod(M1, M2)
#
#Tensor product
#M1, M2 = [[x_ss.. ],[ y_ps..],[z_ts..]]
#
#Othe seccond input can have multiple columns??
#
c = len( T1)
v = len( T1[0])
Tx = ... |
# qubit number=4
# total number=13
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(1) # number=2
pr... |
from rest_framework import serializers
from .models import Client, CreditCard, Employee, Account, Insurance, PreapprovalRequest, Promotion, Report
class ClientSerializer(serializers.ModelSerializer):
class Meta:
model = Client
fields = "__all__"
class AccountSerializer(serializers.ModelSerialize... |
l = []
for i in range(9):
l.append([int(input()), i+1])
l.sort()
print(l[-1][0])
print(l[-1][1])
|
import RPi.GPIO as GPIO
import time
from config import THRESHOLD
GPIO_TRIGGER = 14
GPIO_ECHO = 15
def getDistance():
GPIO.setmode(GPIO.BCM)
GPIO.setup(GPIO_TRIGGER, GPIO.OUT)
GPIO.setup(GPIO_ECHO, GPIO.IN)
GPIO.output(GPIO_TRIGGER, True)
time.sleep(0.00001)
GPIO.output(GPIO_TRIGGER, False)
StartTime = time.t... |
from banklite.dtypes import (
BaseAccount,
ReserveAccount,
CheckingAccount,
SavingsAccount,
)
def test_base_account():
acct = BaseAccount("aaaa", "bbbb")
assert acct.account_id == "aaaa"
assert acct.customer_id == "bbbb"
def test_reserve_account():
acct = ReserveAccount()
asser... |
from typing import Callable, Dict, List, Tuple, Union
import mlrun
from mlrun.artifacts import Artifact
from mlrun.frameworks._common.loggers import MLRunLogger, TrackableType
from mlrun.frameworks.pytorch.callbacks.logging_callback import LoggingCallback
from mlrun.frameworks.pytorch.model_handler import PyTorchModel... |
# M2Crypto is not supported on python3
from jumpscale import j
JSBASE = j.application.jsbase_get_class()
class Empty(JSBASE):
def __init__(self):
JSBASE.__init__(self)
# from jumpscale import j
#
# # from OpenSSL import crypto
# import os
# import M2Crypto as m2c
#
# # PASSWD="apasswd_now2easy"
#
#
# d... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from ..builder import LOSSES
from .ohem_hinge_loss import OHEMHingeLoss
@LOSSES.register_module()
class SSNLoss(nn.Module):
@staticmethod
def activity_loss(activity_score, labels, activity_indexer):
"""Activity Loss.
It will... |
"""
Sage Intacct SDK Exceptions
"""
class SageIntacctSDKError(Exception):
"""The base exception class for SageIntacctSDK.
Parameters:
msg (str): Short description of the error.
response: Error response from the API call.
"""
def __init__(self, msg, response=None):
super(SageI... |
"""
Selection Sort
Approach: Loop
Complexity: O(n2)
"""
def selection_sort(input_arr):
print("""""""""""""""""""""""""")
print("input " + str(input_arr))
print("""""""""""""""""""""""""")
i = 0
ln = len(input_arr)
while i < ln: # n times
m = i
j = i + 1
while j < ln:... |
# -*- test-case-name: twisted.trial.test.test_runner -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A miscellany of code used to run Trial tests.
Maintainer: Jonathan Lange
"""
__all__ = [
"TestSuite",
"DestructiveTestSuite",
"ErrorHolder",
"LoggedSuite",
"TestHo... |
import json
import re
from django.conf import settings
from share.util.graph import MutableGraph
from share.util.names import get_related_agent_name
from share.util import IDObfuscator
from .base import MetadataFormatter
def format_type(type_name):
# convert from PascalCase to lower case with spaces between wo... |
#!/usr/bin/python
import sys
import pprint
import re
import traceback
import copy
from collections import OrderedDict
import numpy as np
import collections
def process(input):
try:
return int(input)
except:
try:
return float(input)
except:
return input
def load... |
from gym.spaces import Box
from ray.rllib.models.modelv2 import ModelV2
from ray.rllib.models.tf.tf_modelv2 import TFModelV2
from ray.rllib.models.tf.fcnet import FullyConnectedNetwork
from ray.rllib.models.torch.misc import SlimFC
from ray.rllib.models.torch.torch_modelv2 import TorchModelV2
from ray.rllib.models.tor... |
#!/usr/bin/env python3.9
import cx_Freeze
executables = [cx_Freeze.Executable("main.py")]
cx_Freeze.setup(
name="Escape Room",
options={"build_exe": {"packages":["pygame", "games"],
"include_files":["./assets"],
"optimize": 2}
},
executab... |
import numpy as np
from flask import Flask
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import io
import base64
from flask import render_template
import sys
from flask import make_response
import math
app = Flask(__name__)
plt.switch_backend('agg') # solve main loop
class Sort():
def inse... |
from django.db import models
from django.contrib.auth import get_user_model
User = get_user_model()
class Group(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
description = models.TextField()
def __str__(self):
return self.title
class Post(mode... |
#!flask/bin/python
from flask import Blueprint, request, abort, redirect
import patreon
from my_site import config
from my_site.app.views.html_renderer import render_page
from my_site.app.views.LogIn.log_in import LogIn
from my_site.app.views.LandingPage.landing_page import LandingPage
from my_site.models.managers imp... |
from dataclasses import dataclass, field
@dataclass
class Schedule:
user: str
repository: str
url: str
schedule_id: str = field(default_factory=str)
def __post_init__(self):
if len(self.user) < 1:
raise ValueError('Invalid user')
if len(self.repository) < 1:
... |
import pathutils
import cmdlineutils
import termutils
import graphutils
|
import re
from pyrogram import Client, filters
from pyrogram.types import Message, InlineKeyboardMarkup
from config import prefix
from localization import use_chat_lang
from utils import require_admin, split_quotes, button_parser
from dbh import dbc, db
def add_filter(chat_id, trigger, raw_data, file_id, filter_type... |
# -*- coding: utf-8 -*-
"""
We return the values based in the base currency.
For example, for 1 USD the return is a number like 0.000634 for Gold (XAU).
To get the gold rate in USD: 1/0.000634= 1577.28 USD
"""
import os
import math
import boto3
import redis
import requests
import pandas as pd
from datetime import da... |
# -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
from pygments.formatter import Formatter
from pygments.util... |
from __future__ import division, print_function
import abc
import os
import unittest
import nose.tools as ntools
from smqtk.utils.plugin import Pluggable, get_plugins, OS_ENV_PATH_SEP
__author__ = 'paul.tunison@kitware.com'
class DummyInterface (Pluggable):
@abc.abstractmethod
def inst_method(self, val):... |
"""empty message
Revision ID: 7b4eec5bf6a2
Revises:
Create Date: 2018-07-07 17:49:12.635921
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7b4eec5bf6a2'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @copyright © 2010 - 2021, Fraunhofer-Gesellschaft zur Foerderung der
# angewandten Forschung e.V. All rights reserved.
#
# BSD 3-Clause License
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
import tensorflow as tf
from tensorflow.keras import layers, activations
class Shuffle(layers.Layer):
def __init__(self, **kwargs):
super(Shuffle, self).__init__(**kwargs)
def call(self, x):
c_idx = tf.range(0, tf.shape(x)[-1])
c_idx = tf.random.shuffle(c_idx)
x = tf.gather(x,... |
# 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 ... |
# 测试case
DATA = [
('测试两数相加', 10, 20, 30),
('测试两数相加', 10.0, 20, 'x type is not int')
]
DATA2 = [
('测试两数相减的绝对值', 10, 20, 15),
('测试两数相减的绝对值', 10, '2', 'y type is not int')
]
DATA3 = [
('测试替换掉字符串中的某些字符', '--hell -world++', ['-', '+'], 't', 'tthellotttworldtt')
] |
# Thank For CatUserBot
# Ported By @VckyouuBitch
# FROM Geez - Projects <https://github.com/Vckyou/GeezProjects>
from telethon.tl.functions.contacts import BlockRequest, UnblockRequest
from telethon.tl.types import (
MessageEntityMentionName,
)
from userbot import bot, BOTLOG, BOTLOG_CHATID, CMD_HELP
from userbo... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-08 21:30
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 = [
migrations.swappable_depende... |
from template import kernel_gpu
kernel_meta = kernel_gpu.kernel_meta
kernel_initializer = kernel_gpu.kernel_initializer
kernel_query = '''\
static vsi_status _query_kernel
(
vsi_nn_kernel_t * kernel,
vsi_nn_tensor_t * const * const inputs,
vsi_nn_tensor_t * const * const outputs
/* Add extra param... |
# -*- coding: utf-8 -*-
"""
Copyright (c) 2020 Masahiko Hashimoto <hashimom@geeko.jp>
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 righ... |
arr=[1, 4, 20, 3, 10, 5]
n=len(arr)
#Max triplet sum in array
def func1(arr,n):
first,second,third=-99999999,-99999999,-99999999
for i in range(n):
if arr[i]>third:
first=second
second=third
third=arr[i]
elif arr[i]>second:
first=sec... |
import turtle
wn = turtle.Screen()
tarta = turtle.Turtle()
tarta.pensize(3)
arquivo = open(r"C:\Users\CASSIO\Documents\Python\Turtle\desenho.txt")
for linha in arquivo:
item = linha.split()
if item[0] == 'UP':
tarta.up()
elif item[0] == 'DOWN':
tarta.down()
else:
tarta.goto... |
import random
import pytest
from fastapi import FastAPI, testclient
from fastapi_crudrouter import MemoryCRUDRouter
from tests import Potato
URL = "/potato"
def get_client(**kwargs):
app = FastAPI()
app.include_router(MemoryCRUDRouter(schema=Potato, prefix=URL, **kwargs))
return testclient.TestClient(... |
# -*- coding: utf-8 -*-
'''
Encapsulate the different transports available to Salt.
'''
from __future__ import absolute_import
# for backwards compatibility
class Channel(object):
@staticmethod
def factory(opts, **kwargs):
# Default to ZeroMQ for now
ttype = 'zeromq'
# determine the t... |
import pygame
import random
WHITE = 255, 255, 255
class Asteroid:
minimum_size = 20
def __init__(self, x, y, size=200):
self.x = x
self.y = y
self.size = size
self.vx = random.random() * 10 - 5
self.vy = random.random() * 10 - 5
def draw(self, screen):
... |
""" Dictionary learning.
"""
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
import warnings
from math import ceil
import numpy as np
from scipy import linalg
from joblib import Parallel, effective_n_jobs
from ..base import BaseEstimator, Tr... |
#!/usr/bin/env python
from os import environ
from sys import argv
def main():
environ.setdefault('DJANGO_SETTINGS_MODULE', 'web.settings')
try:
from django.core.management import execute_from_command_line
except ImportError:
raise ImportError(
"Couldn't import Django. Are you s... |
spam=input()
|
# -*- coding: utf-8 -*
import os
import random
import re
import six
import argparse
import io
import math
import sys
if six.PY2:
reload(sys)
sys.setdefaultencoding('utf-8')
prog = re.compile("[^a-z ]", flags=0)
def parse_args():
parser = argparse.ArgumentParser(
description="Paddle Fluid word2 vec... |
from Sailor import Sailor
from SensorsForTesting import Sensors
from Bearing import Bearing
'''Test1
Erwartungshaltung: Schiff soll nichts ändern!
'''
sens = Sensors()
sailor = Sailor(sens)
print ("\nTest1: Erwartungshaltung: Schiff soll nichts ändern!")
desiredBearing = Bearing(90)
sens.setWindDirection(0)
sens.setC... |
# coding=utf-8
# Copyright 2018 The OpenAI Team Authors and 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 copy of the License... |
#!/usr/bin/env python
"""utils.py: get utility functions."""
__author__ = "Chakraborty, S."
__copyright__ = "Copyright 2020, SuperDARN@VT"
__credits__ = []
__license__ = "MIT"
__version__ = "1.0"
__maintainer__ = "Chakraborty, S."
__email__ = "shibaji7@vt.edu"
__status__ = "Research"
import numpy as np
import sys
sy... |
"""
I/O for the STL format, cf.
<https://en.wikipedia.org/wiki/STL_(file_format)>.
"""
import logging
import os
import numpy
from ._exceptions import ReadError, WriteError
from ._files import open_file
from ._mesh import Mesh
def read(filename):
with open_file(filename, "rb") as f:
# Checking if the fil... |
# 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 agreed to ... |
# Standard Library
import builtins
import json
import copy
import numpy as np
# Import from third library
from up.utils.general.log_helper import default_logger as logger
from up.utils.general.registry_factory import EVALUATOR_REGISTRY
from up.data.metrics.base_evaluator import Evaluator
from up.utils.general.petrel_h... |
from unittest import TestCase
from unittest.mock import MagicMock
import re
import bq_utils
import common
import resources
from retraction import retract_data_bq as rbq
class RetractDataBqTest(TestCase):
@classmethod
def setUpClass(cls):
print('*******************************************************... |
"""
Module for executing all of the GDAL tests. None
of these tests require the use of the database.
"""
from unittest import TestSuite, TextTestRunner
# Importing the GDAL test modules.
from django.contrib.gis.tests import \
test_gdal_driver, test_gdal_ds, test_gdal_envelope, \
test_gdal_geom, test_gdal_sr... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 6
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_1_1
from i... |
# AVL Mode Package
# Released under MIT License
# Copyright (c) 2020 TytusDb Team
# Developers: SG#16
from DataAccessLayer.handler import Handler
from Models.avl_tree import AVLTree
class TupleModule:
def __init__(self):
self.handler = Handler()
self.dbs = None
def insert(self, database: s... |
"""
ML Engine
By: Mansour Ahmadi (mansourweb@gmail.com)
Yaohui Chen (yaohway@gmail.com)
Created Date: 3 Jun 2019
Last Modified Date: 16 June 2019
"""
from sklearn.ensemble import RandomForestRegressor
from sklearn.linear_model import SGDRegressor
from sklearn.svm import SVR
import sklearn
import os
import tempf... |
from collections import OrderedDict
from functools import partial
import sympy
import numpy as np
from psutil import virtual_memory
from devito.cgen_utils import INT, cast_mapper
from devito.data import Data, default_allocator, first_touch
from devito.dimension import Dimension, DefaultDimension
from devito.equation ... |
"""
Django settings for devhub project.
Generated by 'django-admin startproject' using Django 2.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# ... |
from typing import Optional, Union, List, Callable
import logging
import torch
from torch.distributions import Poisson, Gamma, Bernoulli, Normal
from torch.utils.data import DataLoader
import numpy as np
import pandas as pd
from scipy.stats import spearmanr
from scvi.inference import Posterior
from . import Unsupervis... |
#!/usr/bin/env python
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
readme = open('README.rst').read()
doclink = """
Documentation
-------------
The full... |
# 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.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'ipc_fuzzer_replay',
'type': 'executable',
'dependencie... |
# Copyright 2017 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... |
# -*- coding: utf-8 -*-
'''
# Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
#
# This file was generated and any changes will be overwritten.
'''
from __future__ import unicode_literals
from ..one_drive_object_bas... |
from rpython.jit.backend.llsupport.descr import get_size_descr,\
get_field_descr, get_array_descr, ArrayDescr, FieldDescr,\
SizeDescrWithVTable, get_interiorfield_descr
from rpython.jit.backend.llsupport.gc import GcLLDescr_boehm,\
GcLLDescr_framework
from rpython.jit.backend.llsupport import jitframe
fr... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: atomix/leader/latch.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import AsyncGenerator, List, Optional
import betterproto
from atomix.proto import headers
class EventResponseType(betterproto.Enum):
CHANGED ... |
from __future__ import absolute_import, annotations
import json
import logging
import math
import os
from collections import OrderedDict
from typing import Dict, List, Set, Tuple
from ..libs.ndcg import ndcg
from ..models.graph import Graph
from ..models.result import Result
from ..services import utils
logger = log... |
# -*- coding: utf-8 -*-
import re
def path_sub(url):
if re.search(r'(\/\d+?\/)', url):
url = re.sub(r'(\/\d+?\/)', '/modify/', url)
return url
pure_digits_regex = lambda s: re.compile('^\d+$').match(s)
pure_english_regex = lambda s: re.compile('^[\.\_\-A-Za-z0-9_]+$').match(s)
pure_english_regex2 = l... |
"""
A simple Configuration file for training and/or predicting algae cells.
"""
import torch
import os
""" base path of the dataset """
ROOT = '/content/drive/MyDrive/algae-dataset'
""" define the path to the tiles and annotations dataset """
IMAGE_DATASET_PATH = os.path.join(ROOT, "tiles")
MASK_DATASET_PATH = os.pa... |
import firebase_admin
from firebase_admin import credentials, db
import math
cred = credentials.Certificate("test-ddf2c-firebase-adminsdk-5tva7-6b546e57b4.json")
firebase_admin.initialize_app(cred, {
'databaseURL' : 'https://test-ddf2c.firebaseio.com/'
})
root = db.reference()
lat = float(input("Enter Lat: "))
l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.