text stringlengths 2 999k |
|---|
import sys
import os
import io
from hashlib import md5
from contextlib import contextmanager
from random import Random
import pathlib
import unittest
import unittest.mock
import tarfile
from test import support
from test.support import script_helper
# Check for our compression modules.
try:
import gzip
except Im... |
"""
ASGI config for newspaper_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJ... |
# Generated by Django 3.2.4 on 2021-10-07 08:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('user', '0004_alter_user_avatar'),
]
operations = [
migrations.AlterField(
model_name='user',
name='avatar',
... |
# -*- coding: utf-8 -*-
"""
learn-list
"""
import math
class StatsList(list):
""" lazy eval """
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
@property
def mean(self):
return sum(self) / len(self)
@property
def stdev(self):
n = len(self)
r... |
"""
A modern, Python3-compatible, well-documented library for communicating
with a MineCraft server.
"""
from collections import OrderedDict, namedtuple
import re
# The version number of the most recent pyCraft release.
__version__ = "0.7.0"
# This bit occurs in the protocol numbers of pre-release versions after 1.1... |
"""
Main entry point for crypy
This should interface the command line with async functions
"""
# Running a pair in one process from command line
# Note the process interface is more complex to use, but more reliable.
# Goal is to provide a process interface (supporting death and rebirth)
# and internally using a usual ... |
from Jumpscale import j
def create_wallet(bot):
explorerurl = j.clients.explorer.default.url
wallettype = "STD"
if "testnet" in explorerurl or "devnet" in explorerurl:
wallettype = "TEST"
name = bot.string_ask("Please provide your wallet name")
while j.clients.stellar.exists(name):
... |
"""Metadata objects in support of submissions."""
from typing import Optional, List
from arxiv.taxonomy import Category
from dataclasses import dataclass, asdict, field
@dataclass
class Classification:
"""A classification for a :class:`.domain.submission.Submission`."""
category: Category
@dataclass
class... |
from test_plus.test import TestCase
from nrlm.league.models import *
class PlayerModelTest(TestCase):
def test_string_representation(self):
player = Player(name='Test User')
self.assertEqual(str(player), player.name)
class EventModelTest(TestCase):
def test_string_representation(self):
... |
# 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 ... |
#Zachary Weeden
#@zweed4u displays others whom have a similar schedule as you on RIT MyCourses
#Tested on Python 2.6.6
import mechanize
import urllib
import cookielib
from bs4 import BeautifulSoup
import html2text
import re
import sys
import StringIO
import getpass
from easygui import passwordbox
impo... |
import random
from common.helpers import drain_player_hunger_and_thirst, get_hunger_and_thirst_warnings
from common.world import get_tile_from
from models.item import Item
from models.player import Player
from models.player_inventory import PlayerInventory
def run_command(message, session):
player = session.quer... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import random
from collections import Counter
from typing import Callable, Dict, Iterator, Optional, TypeVar
from torch.utils.data i... |
# Copyright 2016 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... |
import psycopg2
import collections
import json
import sys
def consulta(query):
cursor.execute(query)
return cursor.fetchall()
def constroi_consulta_lista(lista_tabelas):
tabelas = ""
for tabela in lista_tabelas:
tabelas = tabelas + "'" + tabela + "',"
query = "SELECT distinct cl2.relname AS ref_table FROM ... |
import heffte
import numpy as np
from numba import cuda as gpu
import mpi4py
def make_reference(num_entries, dtype, scale):
reference = np.zeros((num_entries,), dtype)
reference[0] = -512.0
if scale == heffte.scale.symmetric:
reference /= np.sqrt(float(2 * num_entries))
elif scale == heffte.sc... |
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
"feature",
"flag_group",
"flag_set",
"tool_path",
"with_feature_set",
)
def _impl(ctx):
tool_paths = [
tool_path(
name = "gcc",
... |
#
# https://github.com/richardkiss/pycoinnet/
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Richard Kiss
#
# 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 wi... |
version = '0.0.7'
author = 'XESS Corp.'
email = 'info@xess.com'
|
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
from datadog_api_client.v1.model_uti... |
import telebot
import os
bot = telebot.TeleBot(
os.environ['TELEGRAM_BOT_TOKEN'],
parse_mode='HTML'
)
|
import numpy as np
import physics
import storage
import learning
import visualization
import multiprocessing
from itertools import repeat
import uuid
# The dimensions of storage in this project are as follows:
# Example: velocity
# Dimension 0: storage. [v_x, v_y, vz]
# Dimension 1: body nr ... |
# Various utility functions
from __future__ import print_function
from distutils.version import LooseVersion
import contextlib
import os
import random
import sys
import vim # pylint: disable=F0401
import tasklib
from taskwiki.errors import TaskWikiException
from taskwiki import regexp
# Detect if command AnsiEsc i... |
from test import support
from test.support import bigmemtest, _1G, _2G, _4G, precisionbigmemtest
import unittest
import operator
import sys
import functools
# Bigmem testing houserules:
#
# - Try not to allocate too many large objects. It's okay to rely on
# refcounting semantics, but don't forget that 's = creat... |
# -*- coding: utf-8 -*-
import asyncio
import logging
import os
import random
import re
import shutil
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from urllib.parse import quote
import discord
from ...core.app import App
from ...sources import crawler_list
from ...utils.uploader imp... |
import tensorflow as tf
class MLPTopic(object):
def __init__(
self, review_num_u, review_num_i, review_len_u, review_len_i, user_num, item_num, num_classes,
user_vocab_size, item_vocab_size, n_latent, embedding_id, attention_size,
embedding_size, filter_sizes, num_filters, l2_r... |
from tqdm import tqdm
import torch
from torch.optim import Adam, SGD
from torch.cuda.amp import autocast, GradScaler
from runtime.distributed_utils import get_rank, reduce_tensor, get_world_size
from runtime.inference import evaluate
from runtime.logging import mllog_event, mllog_start, mllog_end, CONSTANTS
def get... |
# -*- coding: utf-8 -*-
# @Author: Zengjq
# @Date: 2019-02-20 17:07:27
# @Last Modified by: Zengjq
# @Last Modified time: 2019-02-20 17:19:05
# 99%
class Solution:
def isPalindrome(self, x: 'int') -> 'bool':
if x < 0:
return False
return str(x) == str(x)[::-1]
test_cases = (121,... |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... |
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.cluster import hierarchy
from idpflex import cnextend as cnx
from idpflex.properties import ScalarProperty
class TestClusterNodeX(object):
def test_property(self):
n = cnx.ClusterNodeX(0)
n.property_group['p... |
###############################################################################
# Copyright (c) 2018, Lawrence Livermore National Security, LLC.
#
# Produced at the Lawrence Livermore National Laboratory
#
# Written by K. Humbird (humbird1@llnl.gov), L. Peterson (peterson76@llnl.gov).
#
# LLNL-CODE-754815
#
# All righ... |
# Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend/point_head/point_head.py # noqa
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule
from mmcv.ops import point_sample, rel_roi_point_to_rel_img_point
from mmcv.runner import BaseModule
from mmdet.models.build... |
# Note: The first part of this file can be modified in place, but the latter
# part is autogenerated by the boilerplate.py script.
"""
`matplotlib.pyplot` is a state-based interface to matplotlib. It provides
a MATLAB-like way of plotting.
pyplot is mainly intended for interactive plots and simple cases of
programmat... |
import json
from unittest.mock import mock_open, patch
import pytest
from satosa.exception import SATOSAConfigurationError
from satosa.exception import SATOSAConfigurationError
from satosa.satosa_config import SATOSAConfig
class TestSATOSAConfig:
@pytest.fixture
def non_sensitive_config_dict(self):
... |
from setuptools import setup, find_packages
from codecs import open
from os import path
__version__ = '0.0.1'
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# get the dependen... |
# -*- coding: utf-8 -*-
#############################################################################
#
# syntax.py
#
# description: examples of syntax
#
#
# Authors:
# Cody Roux
#
#
#
##############################################################################
import boole.core.expr as expr
from boole import *
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilitie... |
import random, sys
print('ROCK, PAPER, SCISSORS')
#This variables keep track of the number of wins, losses, and ties.
wins = 0
losses = 0
ties = 0
while True: # The main game loop
print('%s Wins, %s Losses, %s Ties' % (wins, losses, ties))
while True: # The player input loop.
print('Enter your move: ... |
# coding=utf-8
from data_packer import err
class BaseConverter(object):
def convert(self, src_name, dst_name, value):
"""
按需转换该字段的值
:param src_name: 字段在传入容器中的名称
:type src_name: object
:param dst_name: 字段再传出容器中的名称
:type dst_name: object
:param value: 从传入容器中取出... |
from matplotlib import pyplot
from shapely.geometry import LineString
from figures import BLUE, GRAY, YELLOW, GREEN, SIZE, set_limits, plot_coords
fig = pyplot.figure(1, figsize=SIZE, dpi=90) #1, figsize=(10, 4), dpi=180)
a = LineString([(0, 0), (1, 1), (1,2), (2,2)])
b = LineString([(0, 0), (1, 1), (2,1), (2,2)])
#... |
from __future__ import annotations
import abc
import datetime
from io import BytesIO
import os
from textwrap import fill
from typing import (
IO,
Any,
Callable,
Hashable,
Iterable,
List,
Literal,
Mapping,
Sequence,
Union,
cast,
overload,
)
import warnings
import zipfile
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import os
import subprocess
import sys
import pytest
def test_adding_deps(tmpdir):
assert 'COB_NO_REENTRY' not in os.environ
with pytest.raises(ImportError):
import pact
projdir = tmpdir.join('proj')
yaml = projdir.join('.cob-project.yml')
python = str(projdir.join('.cob/env/bin/python')... |
# Copyright 2020, OpenTelemetry 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 i... |
import pygame
pygame.init()
screen = pygame.display.set_mode(800, 600)
while True:
pass |
import scrython
query = input("What editions of a card are you looking for? ")
data = scrython.cards.Search(q="++{}".format(query))
for card in data.data():
print(card['set'].upper(), ":", card['set_name'])
|
from dataclasses import dataclass
from typing import List, Optional, Tuple
from scam.consensus.coinbase import pool_parent_id, farmer_parent_id
from scam.types.blockchain_format.coin import Coin
from scam.types.blockchain_format.sized_bytes import bytes32
from scam.types.mempool_inclusion_status import MempoolInclusio... |
# Copyright 2016 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... |
import lasagne
import theano
import theano.tensor as T
import numpy as np
class ThinSplineTransformerLayer(lasagne.layers.MergeLayer):
"""
Thin plate spline spatial transformer layer
The layer applies an thin plate spline transformation [2] on the input.
The transform is determined based on the moveme... |
"""
Preservando Metadata com Warps
Metadados -> São dados intrisecos em arquivos.
Wraps -> São funções que envolvem elementos com diversas finalidades.
# Problema
def ver_log(funcao):
def logar(*args, **kwargs):
Eu sou uma função (logar) dentro de outra
print(f'Você está chamando {funcao.__name... |
import sys
import subprocess
import re
import os
import warnings
from tempfile import mkdtemp
from shutil import rmtree
from six import string_types
import oddt
from oddt.utils import (is_openbabel_molecule,
is_molecule,
check_molecule)
from oddt.spatial import rmsd
c... |
import cv2
import numpy as np
import pyautogui
import time
while True:
img = np.array(pyautogui.screenshot(region = (380, 300, 320, 220)))
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
frame = img
hsv_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
# Yellow color
low_yellow = np.ar... |
# -*- coding:utf-8 -*-
"""
"""
from hypernets.tabular import get_tool_box
from hypernets.tabular.datasets import dsutils
from . import if_cuml_ready, is_cuml_installed
if is_cuml_installed:
import cudf
from hypernets.tabular.cuml_ex import CumlToolBox
@if_cuml_ready
class TestCumlTransformer:
@classme... |
import numpy as np
import pandas as pd
import datetime
from okokyst_metadata import surveys_lookup_table
import os
import re
import glob
import gsw
from okokyst_tools import pressure_to_depth
encoding = "ISO-8859-1"
__author__ = 'Elizaveta Protsenko'
__email__ = 'Elizaveta.Protsenko@niva.no'
__created__ = datet... |
import pathlib
from setuptools import find_packages, setup
HERE = pathlib.Path(__file__).parent
VERSION = '0.0.4'
PACKAGE_NAME = 'PyEzEmail'
AUTHOR = 'Pedro Lamarca'
AUTHOR_EMAIL = 'pedro.lamarca.1997@gmail.com'
URL = 'https://github.com/shinraxor'
LICENSE = 'MIT'
DESCRIPTION = 'Libreria para facilitar el envio de ma... |
# -*- coding: utf-8 -*-
import unittest
import datetime
from pyboleto.bank.santander import BoletoSantander
from .testutils import BoletoTestCase
class TestBancoSantander(BoletoTestCase):
def setUp(self):
self.dados = []
for i in range(3):
d = BoletoSantander()
... |
"""
Demos the tricks on the bebop. Make sure you have enough room to perform them!
Author: Amy McGovern
"""
from pyparrot.Bebop import Bebop
bebop = Bebop()
print("connecting")
success = bebop.connect(10)
print(success)
print("sleeping")
bebop.smart_sleep(5)
bebop.ask_for_state_update()
bebop.safe_takeoff(10)
p... |
# Copyright (c) 2018 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 app... |
from functools import partial
import numpy as np
import torch
import torch.nn as nn
from typing import Callable, Union
from alibi_detect.utils.prediction import tokenize_transformer
def predict_batch(x: Union[list, np.ndarray, torch.Tensor], model: Union[Callable, nn.Module, nn.Sequential],
device: ... |
# coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... |
"""Main configuration file"""
# Define the application directory
from os import getenv, path
from environs import Env
BASE_DIR = path.abspath(path.dirname(__file__))
env = Env()
current_env = getenv('BLOG_ENV') or 'local'
if not path.exists("{}.env".format(current_env)):
raise EnvironmentError("BLOG_ENV not set ... |
"""
pdwBuilder
Author: Morgan Allison, Keysight RF/uW Application Engineer
Pulse Descriptor Word building functions for Analog and Vector UXGs.
"""
import math
import struct
import numpy as np
from pyarbtools import error
def convert_to_floating_point(inputVal, exponentOffset, mantissaBits, exponentBits):
"""
... |
from abc import ABCMeta, abstractmethod
class Animal(metaclass=ABCMeta):
@abstractmethod
def som_animal(self):
return 'som de algum outro animal'
pass
class Cachorro(Animal):
def som_animal(self):
s = super(Cachorro, self).som_animal()
return '%s - %s' % (s, 'AUAU')
c = Cachorro()
print(c.som_animal()) |
import pytest
import datetime
import random
from OfficeActions import OfficeActions
from models import OfficeModel
from config import *
class TestOfficeActions():
default_usa_state = "MA"
default_office_code = default_usa_state + "-18"
default_usa_state2 = "NH"
default_office_code2 = default_usa_stat... |
# Copyright 2010 Jacob Kaplan-Moss
# Copyright 2011 OpenStack Foundation
# Copyright 2013 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
... |
"""Solution for Advent of Code day 20."""
from pathlib import Path
import doctest
import click
def read_input(filename: Path) -> tuple[str, set[int, int]]:
"""read the input from the scanners.
Args:
filename (Path): filename
Returns:
str : rules
set[int,int]: input image
"""
... |
# -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
from EventStudy.price_fetcher import PriceFetcher
from EventStudy.return_calculator import ReturnCalculator
|
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
import requests
import time
import logging
import datetime
logger = logging.getLogger()
# 设置此logger的最低日志级别,之后添加的Handler级别如果低于这个设置,则以这个设置为最低限制
logger.setLevel(logging.INFO)
# 创建一个FileHandler,将日志输出到文件
log_file = 'log/sys_%s.log' % datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d')
file_han... |
#!/usr/env/bin python3
import pygame
from Game.Classes.image import image
class environment(object):
def __init__(self, name, ecran, posX = 0, posY = 0):
self.ecran = ecran
self.posX = posX
self.posY = posY
self.name = name
self.image = None
def getImage(self):
... |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requir... |
"""
Cog containing EVE Online commands which can be used by anyone
"""
import logging
from datetime import datetime
import discord.ext.commands as commands
from utils.log import get_logger
def setup(bot):
"Adds the cog to the provided discord bot"
bot.add_cog(Eve(bot))
class Eve:
def __init__(self, bo... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... |
import csv
import os
import tarfile
from io import StringIO
from .const import MAX_YEAR, MIN_YEAR
from .exceptions import UnknownExtensionException
def get_loxfiles(path):
for y_root, y_dirs, y_files in os.walk(path):
for f_elem in y_files:
if f_elem.lower().endswith(".lox"):
... |
from typing import (
Any,
Dict,
List,
Optional,
Set,
TYPE_CHECKING,
Tuple,
Type,
Union,
cast,
)
import databases
import pydantic
import sqlalchemy
from sqlalchemy.sql.schema import ColumnCollectionConstraint
import ormar # noqa I100
from ormar import ForeignKey, Integer, Model... |
# Copyright 2016 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... |
import subprocess
import sys
from pygame import mixer
import os
import time
from Brain.brain import Brain
from MySqlite import mysqlite as sq
from Voice import speakmodule
from actions import check_audio
sq.create_table()
def main():
mode=[]
try:
mode = sys.argv
if mode[1][1:]=="text":
msg="Initializing Te... |
"""Instruction for coffee machine
1. make and serve me, you and Gibbs a cup of coffee(add coffee, and hot water, stir)
2. change how the mix is stirred
3. A better way to make cofee with less repetition
4. Make you coffe with milk and suger (add suger, and milk)
5. Make Gibbs coffe with milk, sugar... |
import autofit as af
def test_constructor():
prior_model = af.PriorModel(af.m.MockOverload)
assert prior_model.prior_count == 1
instance = prior_model.instance_from_prior_medians()
assert instance.one == 1.0
assert instance.two == 2
def test_alternative():
prior_model = af.Pr... |
import logging
import click
LOG = logging.getLogger(__name__)
@click.command('index', short_help='Display all indexes')
@click.option('-n', '--collection-name')
@click.pass_context
def index(context, collection_name):
"""Show all indexes in the database"""
LOG.info("Running scout view index")
adapter = c... |
from .utils import *
class BlockType:
Info = 0
Spawns = 1
Textures = 2
Tiles = 3
Economy = 4
class ZoneType:
Grass = 0
Mountain = 1
MountainVillage = 2
BoatVillage = 3
Login = 4
MountainGorge = 5
Beach = 6
JunonDungeon = 7
LunaSnow = 8
Birth = 9
JunonFie... |
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from Crypto.Random import random
g_backend = default_backend()
g_iv1 = b"1234567812345678"
g_iv2 = bytes("1234567812345678", "utf8")
def p_example1_hard_coded1(key, data):
cipher ... |
#!/usr/bin/env python3
import os
import subprocess as sp
import numpy as np
from configobj import ConfigObj
import flannel.io as fio
from .image_routines import load_image
class ResultObject:
"""
Small object to hold registration result info
"""
def __init__(self, registered_path, map_path, log_... |
"""
Feature Infection
Control release of changes to groups of users
This module provides the entities for the feature infection
module. Infections are tags that can be applied to entities
while respecting clustering relationships between users.
Exports:
Infector: class that represents a named feature
Infect... |
name = input ('ola seu nome e?')
print (name)
|
# Copyright 2022 The T5X 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 writ... |
import graphene
from django.contrib.auth import get_user_model
from graphene import ObjectType, Float, InputObjectType, Field, Mutation, List
from graphene_django import DjangoObjectType
from graphql_jwt.decorators import login_required
from rescape_python_helpers import ramda as R
from rescape_python_helpers.geospatia... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2017-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... |
#!/usr/bin/env python3
from flask import Flask
from flask import request
from flask.json import jsonify
from flask_cors import CORS, cross_origin
import subprocess
import os
app = Flask(__name__)
CORS(app)
@app.route("/test")
def test():
return "Hello World"
@app.route("/model", methods=['GET'])
def r_sub():
... |
# Copyright 2014 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
"""
This file offers the methods to automatically retrieve the graph Vavraia culicis subsp. floridensis.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: prot... |
'''
Support for APT (Advanced Packaging Tool)
'''
# Import python libs
import os
import re
import logging
# Import salt libs
import salt.utils
log = logging.getLogger(__name__)
def __virtual__():
'''
Confirm this module is on a Debian based system
'''
return 'pkg' if __grains__['os_family'] == 'Deb... |
#Stack using python list
import random
class Stack(object):
def __init__(self):
self._stack = []
def push(self, value):
print("PUSHING {} ON THE STACK".format(value))
self._stack.append(value)
def pop(self):
print("POPPING NUMBER FROM STACK")
if self._stack:
... |
# -*- coding: utf-8 -*-
# Copyright 2018 The Blueoil 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
#
# Unles... |
#!/usr/bin/env python3
from kubernetes.shell_utils import simple_run as run
for genome_version, vcf_path in [
("37", "gs://seqr-reference-data/GRCh37/MPC/fordist_constraint_official_mpc_values.vcf.gz"),
("38", "gs://seqr-reference-data/GRCh38/MPC/fordist_constraint_official_mpc_values.liftover.GRCh38.vcf.gz")... |
# -*- coding: utf-8 -*-
"""
Plant Classification webpage
Author: Ignacio Heredia
Date: December 2016
Descrition:
This script launches a basic webpage interface to return results on the plant classification.
To launch the webpage, enter in Ubuntu terminal:
export FLASK_APP=serve.py
python -m flask run
Tip:
To... |
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import abc
from typing import (
Any, Dict, Iterator, List, Optional, Union,
)
from pyhocon import ConfigTree
from databuilder.extractor.base_extractor import Extractor
from databuilder.models.table_metadata import ColumnMetada... |
from pathlib import Path
from DenoiseSum.utils import JSONIterator
def build_dataset(input_file:Path, output_path:Path, review_key:str):
for object in JSONIterator(input_file):
content = object[review_key]
sum(not c.isalnum() for c in content)
|
from datetime import datetime
from django.test.testcases import TestCase
from casexml.apps.stock.models import StockReport
from corehq.apps.commtrack.models import StockState
from corehq.apps.products.models import Product
from corehq.apps.sms.mixin import VerifiedNumber
from corehq.apps.sms.models import SMS
from cust... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.