text stringlengths 3.07k 12.6k |
|---|
import math
import random
from string import ascii_lowercase as ascii_l, ascii_uppercase as ascii_u
from graph_tool.all import *
from ortools.constraint_solver import pywrapcp, routing_enums_pb2
from treelib import Node, Tree
NUM_LAYERS = 5
BRANCHING_FACTOR = 2
# NUM_VERTICES = 20
def main():
g = initialize_grap... |
from pygletUtil import *
from util import *
import pyglet
from gameTypes import *
import random
class Player(HasSprite):
isMove = False
yMin = 0
yMax = 0
top = 0
bottom = 0
left = 0
right = 0
#Stats: Статы
speed = 20
STR = 1
Health = 20
maxHealth = 22
Exp = 0
Lv ... |
"""
Class to hold objects that read data from files.
"""
import pandas as pd
import config as cfg
import pickle
import os
import numpy as np
class User:
"""
Class to hold user data
"""
def __init__(self, id_user, description, ratings):
"""
Constructor of user class.
:param id... |
import argparse
import commons_pb2_grpc
import commons_pb2
import grpc
import random
import base64
import array
import pytz
from datetime import datetime, timedelta
from Crypto.Cipher import AES
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.hkdf import HKDF
from cryptography... |
import threading
import random
import time
numeroTeles = 2 #Indica el numero de televisores en la casa
numeroIntegrantes = 4 #Indica el numero de integrantes de la familia que desean ver la television
tiempo = 0 #Este contador se utiliza para indicar la hora actual
pasillo = threading.Semaphore(numeroTeles) #Este sema... |
from __future__ import print_function
import argparse
import matlab
from matlab.engine import start_matlab
from PIL import Image
import numpy as np
import os
import torch
import torchvision.transforms.functional as t_func
import torchvision.models as models
import torch.optim as optim
from model import get_style_mode... |
# importing the necessary packages
import socket
import random
import py7zr
import os
import sys
from Crypto.Util import number
# signup function that lets a user signup
def signup():
def get_primes(): # function that gets two primes
p = number.getPrime(50) # geting a p... |
import argparse
import itertools
import json
import os
import pickle as pkl
from collections import defaultdict
from subprocess import call
import numpy as np
class Graph(object):
def __init__(self, graph_path, node_info_path):
self.init_nbs(graph_path, node_info_path) # read graph.
self.num_no... |
"""
$1 $2 $3 $4
<test.csv path> <prediction file path> <movies.csv path> <users.csv path>
"""
import sys
import csv
import numpy as np
import pandas as pd
from keras.models import load_model
from keras.layers import *
def load_train(train_path):
train_data=pd.read_csv(train_path,sep=',')
return train_data
def load_... |
import functools
from typing import Callable
from flask import request, current_app, g
from flask_jwt_extended import verify_jwt_in_request, current_user
from flask_jwt_extended.config import config
from flask_jwt_extended.exceptions import JWTExtendedException
from jwt.exceptions import PyJWTError
from notifications_... |
import cv2
import math
from glob import glob
import numpy as np
from trianglesolver import solve, degree
import torch
import random
from load import *
left = 0
bottom = 1
right = 2
top = 3
idx_to_num = {left:'left',bottom:'bottom',right:'right',top:'top'}
def getBorders(img,gap,n=None):
if n != None:
bor... |
from typing import List, Set
from connect_four.evaluation.victor.rules import Rule, connection
from connect_four.game import Square
from connect_four.evaluation.board import Board
from connect_four.problem import Group
import warnings
class Baseinverse(Rule):
def __init__(self, playable1: Square, playable2: Squ... |
import os
import subprocess
# Input smiles string
# Adds smiles string depending on if theres a BBA or BBD or both in the string
# Depending on whether there is a BBA or BBD place the file in the directory
name = input('What is name of chemdraw stucture without the Kr and Ar: ')
smile = input('What is the smile stri... |
from .vgg import *
from .resnet import *
from .resnet112 import resnet18x112
from .resnet50_scratch_dims_2048 import resnet50_pretrained_vgg
from .centerloss_resnet import resnet18_centerloss
from .resatt import *
from .alexnet import *
from .densenet import *
from .googlenet import *
from .inception import *
from .inc... |
# Builtin modules
from __future__ import annotations
import re, hmac
from hashlib import sha256
from time import time
from typing import Optional, Any, Union, List, Dict, Tuple
# Third party modules
from fsRPCClient import Client as _Client
from fsRPCClient.exceptions import InitializationError, ResponseError
from fsRP... |
import math
import torch
import torch.nn as nn
import numpy as np
Tensor = torch.Tensor
class PositionalEncoding(nn.Module):
"""
Wrapper for the positional-encoding layer, which provides the model with information
regarding the position of inputs in the input sequence.
Type of encoding: absolute and ... |
# --------------------------------------------------------
# Written by <NAME> at 3:08 PM 2/25/2021
# --------------------------------------------------------
from __future__ import absolute_import
import os
import matplotlib
from tqdm import tqdm
from utils.config import opt
from data.dataset import NewDataset, Tes... |
from .polynomial_uni import UnivariatePolynomialElement
from .polynomial_uni import UnivariatePolynomialRing
from .Ring import Ring, RingElement
from six.moves import map, xrange, zip_longest
from ecpy.utils import memoize
from copy import deepcopy
import itertools
class BivariatePolynomialRing(Ring):
'''
Bivariat... |
"""
The web application module of filabel. Used to deploy on a public website and automatically label the PRs using GitHub webhooks.
"""
from flask import Flask
from flask import render_template
from flask import request
import json
import hashlib
import hmac
import requests
from filabel.github import *
import os
imp... |
# -*- coding: utf-8 -*-
'''
Author: <NAME>
Email: <EMAIL>
Python Version: 3.7.10
Description: metrics.py includes the proposed metrics for both
pixel-level semantic segmentation and multi-label
classification tasks.
'''
from sklearn.metrics import f1_score, precision_score, recall_sc... |
"""Tests for `sqlalchemy_csv_normalise` package."""
import pytest
from sqlalchemy import (
create_engine,
Column, ForeignKey,
Integer, String, Boolean,
)
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy_csv_normalise import (
denormalise_p... |
import os
import sys
import inspect
import argparse
import yaml
import numpy as np
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parent_dir = os.path.dirname(current_dir)
sys.path.insert(0, parent_dir)
import torch
import torch.optim as optim
import torch.nn as... |
import numpy as np
# this file to replace the current "DataStructures.py"
############# tools to catch type erros in ndarray structures #########
# type "vec3" is restrictively defined to be an ndarray of 3 doubles
def isVec3( a : np.ndarray ) -> bool:
if not isinstance(a,np.ndarray) : return False
... |
"""
Defining and configuring the logger
"""
import logging
from sys import stderr, stdout
from threading import current_thread, main_thread
from typing import Any
from .ansi import ansi_format
from .constants import NAME
Level = int
class LevelFilter(logging.Filter):
def __init__(self, low: Level, high: Level)... |
# Copyright 2021 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 in writing, s... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 Ricequant, Inc
#
# * Commercial Usage: please contact <EMAIL>
# * Non-Commercial Usage:
# 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
#
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Send email to maintainers about the current status of the recipes.
#
# Copyright (C) 2015, 2018 Intel Corporation
# Author: <NAME> <<EMAIL>>
#
# Licensed under the MIT license, see COPYING.MIT for details
#
# SPDX-License-Identifier: MIT
import sys
import os.path
impor... |
from typing import List, Optional, Tuple, Union, Dict
from chia.consensus.constants import ConsensusConstants
from chia.protocols.wallet_protocol import (
RequestAdditions,
RespondAdditions,
RejectAdditionsRequest,
RejectRemovalsRequest,
RespondRemovals,
RequestRemovals,
)
from chia.types.block... |
#
# Copyright 2015-2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
# Copyright 2018 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 in writing, ... |
import json
import re
import uuid
from allure_commons import plugin_manager
from allure_commons.lifecycle import AllureLifecycle
from allure_commons.logger import AllureFileLogger
from allure_commons.model2 import (
Label,
Link,
Status,
StatusDetails,
)
from allure_commons.types import AttachmentType, ... |
import re
import inspect
import pyproj
#############################################
## ##
# Get potential coordinates from file #
## ##
#############################################
"""
Algorithm: Getting potential coordinates from content by grading method
Return-value: array contains poten... |
import numpy as np
import matplotlib.pyplot as plt
def condition_points(points):
""" Conditioning: Normalization of coordinates for numeric stability
by substracting the mean and dividing by half of the component-wise
maximum absolute value.
Args:
points: (l, 3) numpy array containing unnorm... |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
import os
from types import SimpleNamespace
from typing import Dict, TypeVar, Optional, Callable
from .decorators import store_init_kwargs, wrap_func
from .metas import get_default_metas
from .. import __default_endpoint__
from ..helper import typename
from ..jaml import JAMLCompatible, JAML, subvar_regex, internal_va... |
import os
import shutil
import subprocess
import tempfile
from tempfile import mkdtemp
from textwrap import dedent
from typing import Any, Optional, Tuple, Union
from redun.file import File, Staging
from redun.task import Task, task
from redun.utils import iter_nested_value, map_nested_value
NULL = object()
# By defa... |
import torch
from torch import nn
from virtex.modules.embedding import WordAndPositionalEmbedding
from virtex.modules.transformer import PreNormTransformerDecoderLayer
class TextualHead(nn.Module):
r"""
Base class for all textual heads. All child classes can simply inherit
from :class:`~torch.n... |
# Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
# Copyright The PyTorch Lightning 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 law or agreed to i... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from collections import OrderedDict
import logging
import math
import torch
def resize_pos_embed_1d(posemb, shape_new):
# Rescale the grid of position embeddings when loading from state_dict.
ntok_old = posemb.shape[1]
if ntok_old > 1... |
#!/usr/bin/env python3
import os
import argparse
import numpy as np
import torch
import torch.nn as nn
from models.forward_tacotron import ForwardTacotron
from utils import hparams as hp
from utils.text.symbols import symbols
from utils.paths import Paths
from utils.text import text_to_sequence
####################... |
from redbot.core import commands, checks, Config
import aiohttp
from typing import List, Dict, Tuple
from redbot.core.utils.chat_formatting import pagify
from discord.ext.commands.converter import Converter
from discord.ext.commands.errors import BadArgument
import re
import logging
SEARCH_URL = "https://api.imgflip.c... |
from __future__ import print_function
import argparse
import torch
import torch.utils.data
import horovod.torch as hvd
import time
from torch import nn, optim
from torch.nn import functional as F
from torchvision import datasets, transforms
from torchvision.utils import save_image
parser = argparse.ArgumentParser(des... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# ... |
class OpTypes(object):
UNARY = "unary"
BINARY = "binary"
OTHER = "other"
class NodeTypes(object):
INPUT = "input"
MIDDLE = "middle"
OUTPUT = "output"
class Operators(object):
# Arithmetic
LINEAR = "linear"
ADDITION = "addition"
SUBTRACTION = "subtraction"
MULTIPLICATION =... |
#
# Copyright (c) 2018-2020 by <NAME> <<EMAIL>>.
#
# This software is available under the terms of the MIT license. Parts are licensed under
# different terms if stated. The legal terms are attached to the LICENSE file and are
# made available on:
#
# https://opensource.org/licenses/MIT
#
# SPDX-License-Identifier:... |
from django.conf import settings
from django.core.management import call_command, get_commands, load_command_class
from django.core.management.base import BaseCommand, CommandError
from django.db import connection
from django_tenants.utils import get_tenant_model, get_public_schema_name
class BaseTenantCommand(Base... |
'''
This module provides all the methods needed to train and validation test a deep neural network. Training includes:
1. Data Extraction or Loading already extracted data
2. Preprocessing:
a. Mean subtraction + pixel scaling + storing of dataset mean for use in deployment.
b. Support for large datasets via HDF... |
# Copyright 2019 The Kubeflow 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 to in... |
#!/usr/bin/python
# sys tools
import os
import pathlib
from PIL import Image
# tf tools
import tensorflow as tf
# image processsing
from tensorflow.keras.preprocessing.image import (load_img,
img_to_array,
ImageDataGe... |
from __future__ import absolute_import
from PIL import Image, ImageFile
from torch.utils.data import Dataset
import sys
from PIL import Image
import numpy as np
import pdb
import cv2
import random
import lmdb
import six
import re
import torch
from torch.utils import data
from torch.utils.data import sampler
from torchv... |
"""
file_crud.py
===========
"""
import hashlib
import io
import os
from botocore.client import BaseClient
from fastapi import HTTPException, status
from fastapi.encoders import jsonable_encoder
from sqlalchemy.orm import Session
from literature.config import config
from literature.models import FileModel, Reference... |
import pandas as pd
import plotly.express as px
url = 'https://health-infobase.canada.ca/src/data/covidLive/covid19-epiSummary-voc.csv'
prov_dict = {
"AB" : "Alberta",
"BC" : "British Columbia",
"CA" : "Canada",
"MB" : "Manitoba",
"NB" : "New Brunswick",
"NL" : "Newfoundland and Labrador",
"NS" : "Nova Scot... |
import classad
import re
import utilities
class RCEntry(object):
"""Contains the data in a ResourceCatalog entry
:var name: name of the resource
:var cpus: number of cores per node
:var memory: megabytes of memory per node
:var allowed_vos: a list or string containing the names of all the VOs that... |
import findspark
findspark.init()
from pyspark import SparkConf,SparkContext
from pyspark.streaming import StreamingContext
from pyspark.sql import Row,SQLContext
import sys
import requests
def aggregate_tweets_count(new_values, total_sum):
return sum(new_values) + (total_sum or 0)
def get_sql_context_instance(spar... |
import numpy as np
from PIL import Image
def DepthNorm(x, maxDepth):
return maxDepth / x
def predict(model, images, minDepth=10, maxDepth=1000, batch_size=2):
# Support multiple RGBs, one RGB image, even grayscale
if len(images.shape) < 3: images = np.stack((images,images,images), axis=2)
if len(imag... |
import argparse
import os
import tempfile
import ModelCompiler
from Colour import Colour
from Vector import Vector3
WorkingDir = None
def ParseFace(face, face_data):
def ComponentGenerator(components):
for component in components:
yield component
for vertex in face_data.split(" ")[1:]:
... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
# Copyright 2016, 2017 IBM Corp.
#
# 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 writin... |
# Copyright 2021 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 common import *
from datasets import data_celeba, data_mnist
from models.celeba_models import *
from models.mnist_models import *
from eval_funcs import *
def log(x):
return tf.log(x + 1e-8)
def train_modegan(data, g_net, d_enc, d_net, name='MODEGAN',
dim_z=128, n_iters=1e5, lr=1e-4, batch_... |
import tensorflow as tf
import tensorflow.contrib.slim as slim
def encoder(images):
"""
It is based on classical VGG-19 architecture.
It implemented in a way that works with
the official tensorflow pretrained checkpoint
(https://github.com/tensorflow/models/tree/master/research/slim#pre-trained-m... |
"""Platform for climate integration."""
import asyncio
import logging
import aiohttp
from whirlpool.aircon import Aircon, FanSpeed as AirconFanSpeed, Mode as AirconMode
from whirlpool.auth import Auth
from homeassistant.components.climate import ClimateEntity
from homeassistant.components.climate.const import (
F... |
#!/usr/bin/env python
"""
Project-wide application configuration.
DO NOT STORE SECRETS, PASSWORDS, ETC. IN THIS FILE.
They will be exposed to users. Use environment variables instead.
See get_secrets() below for a fast way to access them.
"""
import logging
import os
from authomatic.providers import oauth2
from aut... |
# Developed by <NAME>
# Last Modified 25/04/19 23:11.
# Copyright (c) 2019 <NAME> and <NAME>
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import redirect_to_login
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from dja... |
from django import forms
from django.forms import MultiWidget, TextInput
from django.contrib.auth.models import User
from django.contrib.auth import authenticate
from socialnetwork.models import *
from socialnetwork.models import Profile
MAX_UPLOAD_SIZE = 2500000
class SignupForm(forms.Form):
first_name = forms.... |
"""Tests for the integration of a twinly device."""
from typing import Tuple
from unittest.mock import patch
from homeassistant.components.twinkly.const import (
CONF_ENTRY_HOST,
CONF_ENTRY_ID,
CONF_ENTRY_MODEL,
CONF_ENTRY_NAME,
DOMAIN as TWINKLY_DOMAIN,
)
from homeassistant.components.twinkly.ligh... |
import random
from itertools import count
import matplotlib.pyplot as plt
import gym_super_mario_bros
from gym_super_mario_bros.actions import SIMPLE_MOVEMENT, RIGHT_ONLY, COMPLEX_MOVEMENT
from nes_py.wrappers import JoypadSpace
import numpy as np
from DoubleDQN.DeepQ_Network import DQNetwork
from DoubleDQN.replay_f... |
"""
Play Store Scraper utility classes
"""
import json
class WebsiteMappings:
"""
Mappings for the different website elements to allow easier updates
"""
app_details = {
'pricing': 'ds:4', # ds:3
'info': 'ds:6', # ds:5
'version': 'ds:3', # ds:8
'pegi': 'ds:11', # ds:11
'rating': 'ds:7', # ds:14
... |
# Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
# coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... |
import random
import time
import os
import atexit
from datetime import datetime
from random import choice
from random import shuffle
from flask import Flask, current_app, jsonify
from flask_assistant import Assistant, ask, tell, event, context_manager, request
from flask_assistant import ApiAi
app = Flask(__name__)
... |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
class Tests:
surface_entity_created = (
"Successfully created Surface entity",
"Failed to ... |
"""
modules.py - This file stores the rathering boring network blocks.
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from torchvision import models
from model.propagation import mod_resnet
from model.propagation import cbam
class ResBlock(nn.Module):
def __init__(self, indim, outdim=Non... |
#! /usr/bin/env python
# plot for R2 for OTU abundance of two samples
# by gjr; 04/07/14
"""
Plot for R2 for OTU abundance of two samples using OTU table (.shared file)
% python plot-otu-corr-r2.py \
OTUabunCutoff \
<file.shared> \
<outfile> \
"KW1,K... |
################################################################################
# Copyright (C) 2016 Advanced Micro Devices, Inc. All rights reserved.
#
# 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 th... |
import re
import pytest
from sqlalchemy import Table, MetaData, Column, select
from geoalchemy2.types import Geometry
def eq_sql(a, b):
a = re.sub(r'[\n\t]', '', str(a))
assert a == b
@pytest.fixture
def geometry_table():
table = Table('table', MetaData(), Column('geom', Geometry))
return table
c... |
from caffe2.python import core
from hypothesis import given, settings
import caffe2.python.hypothesis_test_util as hu
import caffe2.python.serialized_test.serialized_test_util as serial
import hypothesis.strategies as st
import numpy as np
# The reference implementation is susceptible to numerical... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, erpnext
from frappe.utils import cint
from frappe import throw, _
from frappe.utils.nestedset import NestedSet
from erpnext.stock import ... |
# code modified from: https://github.com/awbirdsall/pyvap
from __future__ import division
import numpy as np
from scipy.constants import pi, R, N_A
# from src.d00_utils.processing_utils import normalize
def calculate_molarity_from_weight_fraction(analyte, compounds, solution_comp):
""" Converts the (initial) so... |
# -*- coding: utf-8 -*-
"""
eve.methods.delete
~~~~~~~~~~~~~~~~~~
This module imlements the DELETE method.
:copyright: (c) 2016 by <NAME>.
:license: BSD, see LICENSE for more details.
"""
from flask import current_app as app, abort
from eve.utils import config, ParsedRequest
from eve.auth import... |
import requests
import time
from requests.adapters import HTTPAdapter
from requests.exceptions import ConnectionError
import pandas as pd
from pgs_harmonizer.harmonize import reversecomplement
class VariationResult:
"""Class to parse the 'mapping 'information from ENSEMBL Variation"""
def __init__(self, id, j... |
import json
import traceback
from typing import Dict, cast
import ansible_runner
import demistomock as demisto # noqa: F401
import ssh_agent_setup
from CommonServerPython import * # noqa: F401
# Dict to Markdown Converter adapted from https://github.com/PolBaladas/torsimany/
def dict2md(json_block, depth=0):
m... |
#
# -*- coding: utf-8 -*-
"""
apikey util.
"""
import getpass
import os
import stat
import sys
import textwrap
from urllib.parse import urlparse
import requests
import wandb
from wandb.apis import InternalApi
from wandb.errors import term
from wandb.util import _is_databricks, isatty, prompt_choices
LOGIN_CHOICE_AN... |
# This module adds the Telegraf metrics agent to an app container.
# The agent collects StatsD events from Java agents injected into the runtime (if Datadog is not enabled).
# Additionally, if enabled, PostgreSQL metrics are collected.
# Metrics will be forwarded to either the host defined in APPMETRICS_TARGET environm... |
"""Arguments parser."""
import argparse
import datetime
import getpass
import json
import os
import random
import subprocess
import torch
def get_arguments():
parser = argparse.ArgumentParser()
# Dataset
parser.add_argument('--dataset', default='celebsmall')
parser.add_argument('--imageSize', type=i... |
import json
from itertools import chain
from django.conf import settings
from django.contrib.postgres.fields import ArrayField
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy
from django_celery_beat.models import PeriodicTask
from taggit.managers import ... |
import cv2
import numpy as np
from operator import itemgetter
def have_space(img):
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
filter = np.ones((5, 5), np.float32) / 25
i = cv2.filter2D(gray, -1, filter)
i = cv2.adaptiveThreshold(i,
1,
cv2.A... |
#!/usr/bin/python
copyright = 'Copyright (c) 2012-2013 <NAME>'
import sys, os, argparse
top_srcdir = os.getenv('COAN_PKGDIR')
if not top_srcdir:
top_srcdir = os.path.abspath(os.pardir)
sys.path.append(os.path.join(top_srcdir,'python'))
import coanlib
from coanlib import *
parser = argparse.ArgumentParser(
prog... |
"""Utility, creates projects and nodes. Deletes existing nodes of input type by default."""
import uuid
import os
import json
from datetime import datetime
import click
from importer.ioutils import reader
from importer.gen3 import generate_edge_tablename, get_class_tablename_from_id
PROJECT_ID = None
PROGRAM_ID = N... |
#
# Copyright (c) 2021, 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 at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
# -*- coding: utf-8 -*-
"""Raw transforms between coordinate frames, as NumPy matrices."""
from numpy import array
from .constants import ANGVEL, ASEC2RAD, DAY_S, tau
from .data.spice import inertial_frames as _inertial_frames
from .functions import mxm, rot_x, rot_z
def build_matrix():
# 'xi0', 'eta0', and 'da0'... |
# -*- coding: utf-8 -*-
from pycocotools.coco import COCO
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
import argparse
from mmcv.image import imread, imwrite
def parse_args():
parser = argparse.Argu... |
import math
GOAL_WIDTH = 1900
FIELD_LENGTH = 10280
FIELD_WIDTH = 8240
boosts = [
[3584, 0,0],
[-3584, 0,0],
[3072, 4096,0],
[3072, 4096,0]
]
class Vector3:
def __init__(self, data):
self.data = data
def __add__(self,value):
return Vector3([self.data[0]+value.data[0],self.d... |
import dash
from dash_table.Format import Format, Scheme
from elasticsearch import Elasticsearch
from itertools import islice
from dateutil.parser import parse
def fetch_input(inputs, sliders, i, attr):
"""Method for returning input value with corresponding weights for the submission query."""
name = inputs[0]... |
from astropy.constants.iau2015 import R_sun, M_sun
from tqdm import tqdm
import scipy.constants as sciconst
import matplotlib.pyplot as plt
import numpy as np
import math
# Define constants used in the file namespace with the `_f` prefix
# Namespace pollution causes pandemics
_f_m_e = sciconst.electron_... |
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from dataclasses import dataclass
import numpy as np
import pytest
from pytest_lazyfixture import lazy_fixture
from utils import check_grad
from emukit.quadrature.measures import BoxDomain, GaussianMeasure... |
#!/usr/bin/python
# -*- coding: utf8 -*-
import json
from enum import Enum
import requests
__author__ = "enginebai"
URL_BASE = "https://graph.facebook.com/v2.9/me/"
# send message fields
RECIPIENT_FIELD = "recipient"
MESSAGE_FIELD = "message"
ATTACHMENT_FIELD = "attachment"
TYPE_FIELD = "type"
TEMPLATE_TYPE_FIELD =... |
import enum
from typing import List, Tuple
from crawler.core.types import ListType as ListTypeOneSide
from to_python.core.types import FunctionData, FunctionGeneric, \
FunctionArgument, CompoundFunctionData, CompoundOOPData
from to_typescript.core.filter import FilterAbstract
class FilterDumpProcessPostError(Run... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.