text stringlengths 2 999k |
|---|
import json
import logging
import os
import pandas
from dataclasses import dataclass
from .const import DATA_PATH
from .const import TPH_CORONAVIRUS_XLSX_FILENAME
def get_cases():
"""
Returns an object with all of the case counts.
e.g. {
"all": 5,
"active": 5,
"recovered": 5,
... |
from abc import ABCMeta, abstractmethod
from collections import deque
from datetime import timedelta
from typing import Callable
from stp_core.common.log import getlogger
from plenum.server.has_action_queue import HasActionQueue
from plenum.server import notifier_plugin_manager
import asyncio
logger = getlogger()
c... |
"""
Code based loosely on implementation:
https://github.com/openai/baselines/blob/master/baselines/ppo2/policies.py
Under MIT license.
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.init as init
import torch.nn.functional as F
import vel.util.network as net_util
from vel.rl.models.backbon... |
for i in range(int(input())):
a,b,c = [int(j) for j in input().split()]
f = 0
if(c%2!=0):
if((a%2!=0 and b%2!=0) or (a>2 and a%2!=0)):
f=1
elif(b>1 and a%2!=0 and b%2==0):
f=1
elif(b%2!=0):
if((b>2 and a%2==0 and c>1) or (a>1 and a%2==0)):
f=1
... |
from theseus.base.datasets import DATASET_REGISTRY, DATALOADER_REGISTRY
from .csv_dataset import *
from .folder_dataset import *
DATASET_REGISTRY.register(CSVDataset)
DATASET_REGISTRY.register(ImageFolderDataset)
from .mixupcutmix_collator import MixupCutmixCollator
DATALOADER_REGISTRY.register(MixupCutmixCollator) |
import _plotly_utils.basevalidators
class YValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="y", parent_name="layout.coloraxis.colorbar", **kwargs
):
super(YValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... |
import json
import urllib
from django.contrib.auth.models import Group, Permission
from django.core.files.uploadedfile import SimpleUploadedFile
from django.template.defaultfilters import filesizeformat
from django.template.loader import render_to_string
from django.test import RequestFactory, TestCase, override_setti... |
from dagster import (
file_relative_path,
lambda_solid,
pipeline,
InputDefinition,
OutputDefinition,
PresetDefinition,
)
import dagster_pandas as dagster_pd
@lambda_solid(
input_defs=[InputDefinition('num', dagster_pd.DataFrame)],
output_def=OutputDefinition(dagster_pd.DataFrame),
)
de... |
import sys
x, y = map(int, sys.stdin.read().split())
def main():
print(max(x, y))
if __name__ == "__main__":
main()
|
import wx
class MyPanel(wx.Panel):
def __init__(self, *args, **kw):
super(MyPanel, self).__init__(*args, **kw)
self.Bind(wx.EVT_BUTTON, self.OnButtonClicked)
def OnButtonClicked(self, e):
print('Evénement est déclanché de la classe Button')
# e.Skip()
class... |
from django.shortcuts import render
from django.views.generic import View
import io
from rest_framework.parsers import JSONParser
from testapp.serializers import EmployeeSerializer
from testapp.models import Employee
from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Create... |
import numpy as np
import pyqtgraph as pg
from scipy import signal
from acconeer.exptool import configs, utils
from acconeer.exptool.clients import SocketClient, SPIClient, UARTClient
from acconeer.exptool.pg_process import PGProccessDiedException, PGProcess
def main():
args = utils.ExampleArgumentParser(num_sen... |
from aleph.tests.util import TestCase
class StreamApiTestCase(TestCase):
def setUp(self):
super(StreamApiTestCase, self).setUp()
def test_entities(self):
self.load_fixtures()
res = self.client.get('/api/2/entities/_stream')
assert res.status_code == 403, res
_, heade... |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 23 06:08:57 2019
@author: Khoi To
"""
class PopulationHandler(object):
def __init__(self, characteristics):
self.characteristics = characteristics
def init(self, number_of_population):
pass
def selection(self):
pass
... |
class Rectangle:
def __init__(self, length, width):
self.length = length
self.width = width
def area(self):
return self.length * self.width
def perimeter(self):
return 2 * self.length + 2 * self.width
class Square(Rectangle):
def __init__(self, length):
super(S... |
import subprocess
import re
class Ping:
def __init__(self, ip):
self.ip = ip
pass
def test_ping(self):
ftp_ret = subprocess.Popen(
'ping %s -n 2' % self.ip, stdin=subprocess.PIPE, stdout=subprocess.PIPE, shell=True)
ret = ftp_ret.stdout.read()
str_ret = r... |
# flake8: noqa
from .main import (
ENS,
)
from .exceptions import (
AddressMismatch,
BidTooLow,
InvalidLabel,
InvalidName,
UnauthorizedError,
UnderfundedBid,
UnownedName,
)
|
#!/usr/bin/python
'''This is a port of gentea.c
Rather than the (extremely) outdated GD module, this now uses Pillow. The config
file has also been updated to be more intuitive.
Built against Python 2.7.4, Pillow 2.0.0, and cx_Oracle 5.1.2
Created on Apr 15, 2013
@author: hsk@RTi
'''
from __future__ i... |
# -*- coding: utf-8 -*-
"""
Connection screen
Texts in this module will be shown to the user at login-time.
Evennia will look at global string variables (variables defined
at the "outermost" scope of this module and use it as the
connection screen. If there are more than one, Evennia will
randomize which one it displ... |
import os
ZULIP_VERSION = "2.2.dev+git"
# Add information on number of commits and commit hash to version, if available
zulip_git_version_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'zulip-git-version')
if os.path.exists(zulip_git_version_file):
with open(zulip_git_version_file) as f:
v... |
# base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova and Daniel Mulford
# Dark Violet scheme by ruler501 (https://github.com/ruler501/base16-darkviolet)
base00 = "#000000"
base01 = "#231a40"
base02 = "#432d59"
base03 = "#593380"
base04 = "#00ff00"
base05 = "#b08ae... |
import chemolab as cl
# Taking the element Calcium as example
e = cl.Element(cl.element_data.CALCIUM)
print(e.get_info()) |
# Copyright (c) 2015
#
# All rights reserved.
#
# This file is distributed under the Clear BSD license.
# The full text can be found in LICENSE in the root directory.
from boardfarm.tests import rootfs_boot
class Uname(rootfs_boot.RootFSBootTest):
"""Checked board system information."""
def runTest(self):
... |
#!/usr/bin/env python
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: mjr
# Description: This module contains the unit tests for
# fill_matching_record_hashes.py ... |
import cv2
import pickle
from preprocess import *
import numpy as np
import cv2
import tensorflow as tf
import tflearn
from tflearn.layers.conv import conv_2d, max_pool_2d
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression |
import math
import random
from datetime import timedelta, datetime
id = 200
start_time = "05:38:00"
def createLines(fromnode,tonode,bt,iterval):
inter = float(interval)
print inter
random_second = random.expovariate(1/inter)
number_of_psg = 10 #random.randrange(100)
#print random_secon... |
"""
Contains function defs for running HVQE.py
"""
class Name: # Simple namespace class that is used for dumping and restarting the program.
pass
import numpy # For the cases where GPU==True and we still want to use numpy.
import qem
import chainer as ch
from datetime import datetime
import argparse
import scipy.o... |
import matplotlib.pyplot as plt
from pylab import mpl
import math
import numpy as np
from mpl_toolkits.axisartist.parasite_axes import HostAxes, ParasiteAxes
import time
import sys
import base64
import json
"""完成拟合曲线参数计算前相应变量的计算"""
def polynomial_fitting(data_x, data_y):
size = len(data_x)
i = 0
sum_x = ... |
import numpy as np
import pandas as pd
import re
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from gensim.models import Word2Vec, Phrases
import nltk
from nltk.corpus import stopwords
nltk.download('stopwords')
nltk.download('wordnet')
from nltk.stem import WordN... |
import torchvision.transforms as transforms
def get_train_transform(size):
train_transform = transforms.Compose(
[
transforms.RandomGrayscale(),
transforms.Resize((256, 256)),
transforms.RandomAffine(5),
transforms.ColorJitter(hue=0.05, saturation=0.05),
... |
#####################################################
# Basic Functions
#####################################################
def identity_transform(x):
return x
#####################################################
# Dataset Operations
#####################################################
def dpipe(dataset=N... |
'''List of GE p-file offsets.
This code is taken from the VESPA project https://scion.duhs.duke.edu/vespa/project.
I therefore include their BSD statement here.
Copyright (c) 2010, Duke University. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are p... |
from flask_sqlalchemy import SQLAlchemy
from pyhive import sqlalchemy_presto
from rating.api import config
import sqlalchemy
from sqlalchemy import create_engine
def setup_database(app):
db.init_app(app)
def presto_engine():
sqlalchemy.dialects.presto = sqlalchemy_presto
presto_database_uri = config.... |
import numpy as np
import vg
import pytest
from .composite import CompositeTransform, convert_44_to_33
def create_cube_verts(origin, size):
# Create a cube. Since CompositeTransform just works on verticies,
# we don't need a full lace.mesh object.
origin = np.asarray(origin)
size = np.repeat(size, 3)
... |
def demoprint():
print('now in the demo file')
|
"""Command: .bigspam <number> DO NOT TRY THIS WITH YOUR ACCOUNT"""
from telethon import events
import time
# telethon.errors.rpcerrorlist.FloodWaitError: A wait of 280 seconds is required
@borg.on(events.NewMessage(pattern=r"\.bigspam (.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""The Dallinger command-line utility."""
from __future__ import print_function
from __future__ import unicode_literals
from collections import Counter
from functools import wraps
import inspect
import os
import shutil
import signal
import sys
import tabulate
import tempfile... |
import shlex, subprocess
cmd = 'echo 200 > /sys/class/gpio/export'
output = subprocess.check_output( '{} | tee /dev/stderr'.format( cmd ), shell = True )
cmd = 'echo out > /sys/class/gpio/gpio200/direction'
output = subprocess.check_output( '{} | tee /dev/stderr'.format( cmd ), shell = True )
cmd = 'echo 1 > /sys/cla... |
#!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
ren1.SetBackground(0,0,0)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.SetSize(300,300)
iren = vtk.vtkRenderWindowInteractor()
i... |
import stest
from random import randint, getrandbits
from time import time
from math import gcd
from collections import deque
from copy import copy
path_to_save = "lab4-bbs-rsa/test_20k_2.txt"
p, q = 11, 23
bits_to_generate = 20000
def decompose(n):
exponentOfTwo = 0
while n % 2 == 0:
n = n//2
... |
import logging
import os
import cv2
import numpy as np
np.random.seed(0)
import torch
torch.manual_seed(0)
from torch.utils.data import Dataset
from utils.train_utils import visualize_images
logger = logging.getLogger(__name__)
class RssraiDataset(Dataset):
def __init__(self,
... |
import asyncio
import json
import logging
import time
from collections import defaultdict
from pathlib import Path
from secrets import token_bytes
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
import aiosqlite
from blspy import G1Element, PrivateKey
from chia.consensus.coinbase import pool_parent... |
"""
This file offers the methods to automatically retrieve the graph Clostridium cochlearium.
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: protein--protei... |
# -*- coding: utf-8 -*-
#
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
from .bot import Trivvy
from .startup import Bot_Configuration, Option_Worker
from .connection import Connection
from .commander import Commander
from .commands import All
|
"""
Create a template app from ODM-formatted OpenClinica study metadata
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from lxml import etree
from django.core.management.base import BaseCommand
from corehq.apps.app_manager.models import (
Application,
Module,
OpenCaseActi... |
# coding: utf-8
# In[1]:
# Deep Learning Classification
import pandas as pd
from sklearn import model_selection
from sklearn.neural_network import MLPClassifier
import numpy as np
from sklearn.metrics import classification_report
from sklearn.model_selection import train_test_split
# Read dataset
data_values = pd... |
import cs50
def main():
print("Welcome to my program!")
age = input("What is your age? ")
print(f"You will be {age + 1} years old on your next birthday!")
age = cs50.get_int("What is your age? ")
print(f"You will be {age + 1} years old on your next birthday!")
if __name__=="__main__":
main(... |
#!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies file copies with a trailing slash in the destination directory.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('cop... |
"""Example 1 (approval profile for running example)
from the survey: "Approval-Based Multi-Winner Voting:
Axioms, Algorithms, and Applications"
by Martin Lackner and Piotr Skowron
"""
from abcvoting.preferences import Profile
from abcvoting import misc
num_cand = 8
a, b, c, d, e, f, g = range(7) # a = 0, b = 1, c =... |
# encoding: utf-8
import torch
import ipdb
import cv2
import numpy as np
from options import opt
# from dataloader import paired_dataset
from mscv.summary import create_summary_writer, write_image
from mscv.image import tensor2im
from dataloader.dataloaders import train_dataloader, val_dataloader
import misc_utils as... |
#!/usr/bin/env python3
# Copyright (c) 2014-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the REST API."""
from decimal import Decimal
from enum import Enum
from io import BytesIO
import ... |
from .base import *
class cyndex2(object):
"""
cytoscape session interface as shown in CyREST's swagger documentation.
:param url: an url of the type 'http://' + host + ':' + str(port) + '/' + version + '/'.
"""
def __init__(self, url):
self.__url = url + 'commands/cyndex2'
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 ... |
from uuid import uuid4
import numpy as np
class Request:
def __init__(self):
"""
Request constructor
:id: unique identifier
:driver: assigned driver
:lifetime: time to cancel the request if not put into progress
:execution_time: how long a ride will take (simple mo... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 8
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_2_1
from i... |
# Copyright 2014 Rackspace
# Copyright 2016 Blue Box, an IBM Company
#
# 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
#
# ... |
# TODO: REMOVE FROM BRANCH BEFORE MERGE TO MASTER
def assemble_query_string(**kwargs):
query_string = list()
for k,v in kwargs.items():
if v is None:
continue
elif type(v) is bool:
v = str(v).lower()
query_string.append(f'{k}={v}')
output_query_string = '&'.j... |
import time
import pyphp
pyphp.shutdown()
start = time.time()
init = start
pyphp.init()
init = time.time() - start
print "Init duration: %s" % init
i = 0;
while i < 1000:
script = time.time()
result = pyphp.runScript('test.php')
script = time.time() - script
#print "Script duration: %s" % script
if result ==... |
# Copyright 2018 VMware, Inc.
# 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 a... |
"""CmdStan method sample tests"""
import contextlib
import io
import logging
import os
import platform
import shutil
import stat
import tempfile
import unittest
from multiprocessing import cpu_count
from test import CustomTestCase
from time import time
import numpy as np
from testfixtures import LogCapture
try:
... |
import time
from adafruit_pyportal import PyPortal
from adafruit_button import Button
SHOW_BUTTONS = False
# the current working directory (where this file is)
cwd = ("/"+__file__).rsplit('/', 1)[0]
# No internet use version of pyportal
pyportal = PyPortal(default_bg=cwd+"/button_background.bmp")
spots = ... |
import re
from urllib.parse import unquote
class URL(object):
def __init__(
self,
drivername,
username=None,
password=None,
host=None,
port=None,
database=None,
query=None
):
self.drivername = drivername
self.username = username
... |
import numpy as np
from sklearn.linear_model import LinearRegression, LassoLarsIC
def sortnregress(X):
""" Take n x d data, order nodes by marginal variance and
regresses each node onto those with lower variance, using
edge coefficients as structure estimates. """
LR = LinearRegression()
LL = Lass... |
#!/usr/bin/python3
########################################################################
############## Check the AIX system fix filesets and lpp! ##############
########################################################################
import os
import re
class FixLppCheck():
# Check the AIX system fix filesets
... |
"""
Generates a robot tree with the help of Revolve.Generate. This is a bit
backwards, but it allows for more configurability. A generator is defined
with a body generator and a neural net generator. First, a body is
generated. The interface of this body is then fed to the neural net
generator resulting in a neural net... |
# -*- coding: utf-8 -*-
# import math
from six.moves import range
import numpy as np
# import scipy.ndimage.filters.gaussian_filter as gaussian_filter
#import logging
#
#log_manager = logging.getLogger('debug_log')
#log_manager.setLevel(logging.DEBUG)
#fh = logging.FileHandler('debug.txt')
#formatter = logging.Formatte... |
#! /usr/bin/env python3
import os
from steves_utils.ORACLE.utils_v2 import (ALL_DISTANCES_FEET, ALL_RUNS,
ALL_SERIAL_NUMBERS,
serial_number_to_id)
from steves_utils.papermill_support import run_trials_with_papermill
################... |
# ------------------------------------------------------------------------------
# Copyright 2018 Frank V. Castellucci
#
# 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.apach... |
# -*- coding: utf-8 -*-
"""
Application navigation bar.
Navbar docs: https://dash-bootstrap-components.opensource.faculty.ai/l/components/navbar
"""
import dash_html_components as html
import dash_bootstrap_components as dbc
content = html.Div(
[
dbc.NavbarSimple(
children=[
db... |
from django.http import HttpResponse
from django.shortcuts import render
def hello(request):
return HttpResponse("Hello, Mindtree team How are you ")
|
# MIT License
#
# Copyright (c) 2017 Tom Oakley
#
# 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 rights
# to use, copy, modify, merge, p... |
"""
We have four main abstractions: Users, Collections, Memberships, and Roles.
Users represent people, like students in a school, teachers for a classroom, or volunteers setting up informal
installations. A ``FacilityUser`` belongs to a particular facility, and has permissions only with respect to other data
that is ... |
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... |
# Copyright 2020, The TensorFlow Federated 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 o... |
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('', views.auth),
] |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.core.validators
import django.db.models.deletion
import wagtail.core.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0001_squashed_0016_change_page_url_p... |
#! /usr/bin/env python
#adam-does# makes autosuppression directory with images that can be used to place stellar halos
# SUPAXXXXXXX.coadd.smoothed.fits: smoothed images
#adam-call_example# call it like: ./adam_make_autosuppression_ims.py ~/my_data/SUBARU/${cluster}/${filter}/SCIENCE/ ${ending} ${config}
#adam-comment... |
# Copyright 2017 The Forseti Security 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 ap... |
import logging
from pmClient.pmClient import PMClient
pm = PMClient(api_key="api_key", api_secret="api_secret")
pm.generate_session("your_request_token")
pm.set_access_token("your_access_token")
try:
res = pm.place_order(
txn_type="S",
exchange="NSE",
segment="E",
product="I",
... |
"""
Helper functions for evaluating a given supervised "Classifier" model
Written for audax by / Copyright 2022, Sarthak Yadav
"""
import json
import functools
import os
import time
from typing import Any
import tqdm
from absl import logging
from clu import metric_writers
from clu import periodic_actions
import flax
f... |
#!/usr/bin/python
# =================================================================
#
# Authors: Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2015 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Softw... |
"""Import Variants and some misconceptions
# module1.py
import math
sys.modules
is math in sys.modules? math <module object> ________
if not, load and insert ref \
... |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#############################################################################
# PyDNSProxy Configuration.
# - Code by Jioh L. Jung (ziozzang@gmail.com)
#############################################################################
#
# Functions: DNS Proxy + SNI/HTTP Proxy + V... |
"""
Base simple visibility operations, placed here to avoid circular dependencies
"""
import os
import copy
import logging
from typing import Union
import numpy
import re
from astropy import constants as constants
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.io import fits
from... |
# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
"""
The tableone package is used for creating "Table 1" summary statistics for
research papers.
"""
import warnings
import numpy as np
from numpy.linalg import LinAlgError
import pandas as pd
from scipy import stats
from statsmodels.stats import multitest
from tabulate import tabulate
from tableone.modality import h... |
# -*- coding: utf-8 -*-
"""
Created on Tues Oct 12 15:00:00 2021
@author: zedutra
"""
# Imports
from selenium import webdriver
import time
import os
# Inputs
user = str(input('Insert instagram user: '))
# Starting webdriver
driver = webdriver.Firefox()
driver.get("https://www.instagram.com/" + user)
# Closing po... |
class Error(Exception):
pass
class PathError(Error, ValueError):
pass
class NotFoundError(Error, IOError):
pass
|
from django.core.cache import cache as default_cache
from django.core.cache import InvalidCacheBackendError, caches
try:
cache = caches['misago']
except InvalidCacheBackendError:
cache = default_cache
|
#Exercício053
frase = str(input('Digite uma frase: ')).strip().replace(' ', '').upper() #Ja tira os espaços e deixa maiusculo
num = len(frase) #Indica quantas letras tem a frase
for c in range(0, num): #indica a repetição de 0 ate o numero de letras da frase
certo = (frase[c:c + 1]) #repete cada letra da frase
for c... |
from fake_useragent import UserAgent
import math
import requests
import time
from tinydb import TinyDB, Query
# This whole script takes roughly a few minutes for a collection with 10k assets. It's a one time
# operation for ultra fast operations on getting assets and their respective image URLs within a collection an... |
from __future__ import print_function
import argparse
def if_use_feat(caption_model):
# Decide if load attention feature according to caption model
if caption_model in ['show_tell', 'all_img', 'fc', 'newfc']:
use_att, use_fc = False, True
elif caption_model == 'language_model':
use_att, us... |
import logging
class Properties:
applicationVersion = '1.1.0' #keep here
##### DevMode ######
developmentMode = False #keep here
##### Logging #####
logLevel = logging.INFO #keep here
dependenciesLogLevel = logging.WARN #keep here
fileEncoding = "utf-8-sig" #keep here
verboseLoggi... |
# Generated by Django 3.1.5 on 2021-08-30 19:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('person', '0011_score_created_at'),
]
operations = [
migrations.AddField(
model_name='person',
name='kp_id',
... |
# Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th... |
"""Weight Boosting.
This module contains weight boosting estimators for both classification and
regression.
The module structure is the following:
- The `BaseWeightBoosting` base class implements a common ``fit`` method
for all the estimators in the module. Regression and classification
only differ from each oth... |
from pandas_profiling.config import config
from pandas_profiling.report.formatters import help
from pandas_profiling.report.presentation.core import (
Container,
FrequencyTable,
FrequencyTableSmall,
Image,
Table,
VariableInfo,
)
from pandas_profiling.report.presentation.frequency_table_utils imp... |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... |
import numpy as np
from skimage.transform import rescale
from torchvision.transforms import Compose
from dataset import TomoDetectionDataset
def transforms(train=True):
if train:
return Compose(
[Crop((TomoDetectionDataset.img_height, TomoDetectionDataset.img_width))]
)
else:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.