content stringlengths 5 1.05M |
|---|
#!/usr/bin/env python3
# encoding: utf-8
import sys
import os
import time
import cfs_test_common as cfs_tc
import cfsmt_expr_read as me_read
def bench_mkdir(log_dir,
num_app_proc=1,
is_fsp=True,
num_op=1000,
listdir_option=None,
is_crea... |
'''
Microsoft Notepad (XP)
@author: Peter Parente <parente@cs.unc.edu>
@copyright: Copyright (c) 2008 Peter Parente
@license: BSD License
All rights reserved. This program and the accompanying materials are made
available under the terms of The BSD License which accompanies this
distribution, and is available at
U{ht... |
# analyze.py
# This file performs analyses on the results of optimization algorithms.
# Author: Kristina Yancey Spencer
# Date: June 10, 2016
import os
from glob import glob
from math import sqrt, ceil, floor
import items as itemmaker
import numpy as np
import pandas
import seaborn
from matplotlib import pyplot
... |
"""
Implement atoi which converts a string to an integer.
The function first discards as many whitespace characters as necessary until the first non-whitespace character is found. Then, starting from this character, takes an optional initial plus or minus sign followed by as many numerical digits as possible, and inte... |
from zipfile import ZipFile
from django import forms
from django.conf import settings
from django.template.defaultfilters import filesizeformat
from db_file_storage.form_widgets import DBClearableFileInput
# Projectroles dependency
from projectroles.app_settings import AppSettingAPI
from projectroles.models import P... |
# -*- coding: utf-8 -*-
"""chess
A library which is used for chess game GIF generation.
:copyright: @ 2019 by dantin.
:liencse: BSD
"""
import os
__version__ = '1.0.0.dev0'
# chesspieces
KING, QUEEN, BISHOP, KNIGHT, ROCK, PAWN = 'k', 'q', 'b', 'n', 'r', 'p'
# COLORS
BLACK, WHITE = 'b', 'w'
# COLORS stands for `... |
"""
pykube.config unittests
"""
import os
from pykube import config, exceptions
from . import TestCase
GOOD_CONFIG_FILE_PATH = os.path.sep.join(["test", "test_config.yaml"])
class TestConfig(TestCase):
def setUp(self):
self.cfg = config.KubeConfig.from_file(GOOD_CONFIG_FILE_PATH)
def tearDown(s... |
__version__ = '0.4.3'
import logging
import pandas
import json
import seaborn as sns
import matplotlib.pyplot as plt
from numpy import nan
from numpy import reshape
from pathlib import Path
from sketchy.utils import run_cmd, is_fastq, PoreLogger
from collections import OrderedDict
from colorama import ... |
from logging import getLogger
from typing import Any, Iterator, Tuple
import git
from git.objects import Commit
from git.util import IterableList
from git_svn_monitor.core.config import GIT_LOCAL_REPOSITORY
from git_svn_monitor.core.settings import Setting
from git_svn_monitor.model.git_client import GitClient
from g... |
import sys
import datetime
import os
import glob
import tables
import json
import numpy as np
# project imports
sys.path.insert(0, os.path.dirname(os.path.abspath('')))
from core.data import open_data_file
from core.model import isensee2017_model
from core.generator import data_generator, get_number_of_steps, get_numb... |
from abc import abstractmethod
from typing import Protocol
from ._color import Color
from ._position import Position
from ._size import Size
from ._sprite import Sprite
class IPrinter(Protocol):
@abstractmethod
def print_square(self, color: Color, size: Size, position: Position) -> None:
""""""
... |
#------------------------------------------------------------------------------
from arpeggio import RegExMatch as _
ALL = [ 'command' ]
#------------------------------------------------------------------------------
def command():
"""Something neiher an option nor operand. In "naval_fate move <n>",
'mo... |
import pandas as pd
xls = pd.read_excel("C:\\Users\\pc11\\Desktop\\data.xlsx")
for n in xls[1:100]:
print(n) |
'''
Copyright (C) 2019-2021, Mo Zhou <cdluminate@gmail.com>
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 t... |
import objects
import tetris_blocks
class Playground:
def __init__(self, hight, width):
self.height = hight
self.width = width
self.list_pixel = []
for h in range(self.height):
line = []
self.list_pixel.append(line)
for w in range(self.width):
... |
# Generated by Django 2.1.7 on 2019-05-29 03:02
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('login', '0002_item'),
]
operations = [
migrations.DeleteModel(
name='Item',
),
]
|
from calculators.base_calculator import BaseCalculator
from constants.amounts import TWELVE_MILLION_HUF, THREE_MILLION_HUF
class Kata(BaseCalculator):
def __init__(self, revenue: int, cost_of_goods: int = 0, cost_of_kata: int = 50000 * 12, ipa: int = 25000,
is_domestic: bool = False, is_connecte... |
import wpilib
from magicbot import will_reset_to
class Winch:
"""
Operate robot winch.
"""
winch_motors: wpilib.SpeedControllerGroup
_climb_speed = will_reset_to(0)
def run(self, speed: float = 1):
"""
Set the motor speed of each climbing motor.
:param speed: The req... |
# Generated by Django 3.1 on 2020-12-23 12:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='InactiveIngredient',
fields=... |
"""
Upload samples into database
"""
import os
import sys
import psycopg2
from pathlib import Path
import constants
def main():
password = os.environ['PG_PASSWD']
conn = psycopg2.connect(host="dc.idn.local", dbname="eu23enerwatch", user="eu23enerwatch", password=password)
logdir = Path(sys.argv[1])
... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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 base64
# TODO: These tests should be merged with python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep-py3/test_string.py
base64.a85decode(payload) # $ decodeInput=payload decodeOutput=base64.a85decode(..) decodeFormat=Ascii85
base64.b85decode(payload) # $ decodeInput=payload decodeOut... |
import PyPDF2
f=open('Working_Business_Proposal.pdf','rb')
pdf_reader=PyPDF2.PdfFileReader(f)
print(pdf_reader.numPages) #to count number of pages in pdf file
#Exctract single page text
page_one=pdf_reader.getPage(0)
page_one_text=page_one.extractText()
#print(page_one_text)
f.close()
#adding new file to pdf
f=o... |
# Run this app with `python app.py` and
# visit http://127.0.0.1:8050/ in your web browser.
# This Python file uses the following encoding: utf-8
import dash
import dash_core_components as dcc
import dash_html_components as html
import dash_bootstrap_components as dbc
from dash.exceptions import PreventUpdate
import... |
"""Trains LIO agents on SSD."""
import json
import os
import random
import time
import numpy as np
import tensorflow as tf
import lio.alg.config_ssd_lio as config_ssd_lio
import lio.alg.evaluate as evaluate
import lio.env.ssd as ssd
def train_function(config):
seed = config.main.seed
np.ra... |
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from models import build_model
from datagen import load_dataset, genbbox, genbbox_com
from datetime import datetime
np.set_printoptions(threshold=np.inf, linewidth=np.inf)
mode = 'test'
anno_file_path ... |
# coding=utf-8
# Copyright 2021 The Google Research 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 applicab... |
from veca.gym.babyrun.environment import Environment
|
import torch
import torch.nn as nn
class NeuralNet(nn.Module):
''' A simple fully-connected deep neural network '''
def __init__(self, input_dim):
super(NeuralNet, self).__init__()
# Define your neural network here
# TODO: How to modify this model to achieve better performance?
... |
from GraphDraw import *
from Graph import *
from Implicit import *
from impExamples import *
import os
import errno
flags = os.O_CREAT | os.O_EXCL | os.O_WRONLY
# For trying stuff
# Currently just displays the alternating domain on 9 outcomes
n = 9
impG = impAlternatingDomain(n)
G = impG.explicit()
d = G.d
G.comp... |
name = input("What's your name? ")
print(f"hello, {name}")
age = int( input("How old are you? ") )
print(f"Next year you'll be {age + 1}")
|
import logging
import os
import re
import select
import sys
import zipfile
import warnings
# Setup Logging
logger = logging.getLogger(__name__)
if '--debug run' in ' '.join(sys.argv):
logger.setLevel(logging.DEBUG)
else:
# Ignore warnings from cryptography module
warnings.filterwarnings("ignore", category... |
from django.urls import path
from .views import (
CommentDetailsAPIView, CommentsAPIView, ReplyAPIView, ReplyDetailsAPIView,
CommentLikeView
)
urlpatterns = [
path('<slug>/comments/', CommentsAPIView.as_view(), name='comments'),
path('<slug>/comments/<comment_pk>',
CommentDetailsAPIView.as_vi... |
# 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 in writing, ... |
from __future__ import print_function
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn.utils.rnn import PackedSequence, pack_padded_sequence, pad_packed_sequence
#from torchtext import vocab
class Vocabulary(object):... |
# -*- coding: utf-8 -*-
import warnings
import zope.deferredimport
warnings.simplefilter("default")
zope.deferredimport.initialize()
zope.deferredimport.deprecated(
"Import from openprocurement_client.resources.sync instead.",
ResourceFeeder='openprocurement_client.resources.sync:ResourceFeeder',
get_res... |
def select_all(table_name):
select_all = f"select * from {table_name}"
return select_all
def select_top(n, table_name):
select_n = f"select top({n}) * from {table_name}"
return select_n
def get_last_synctime():
last_synctime = f"select top 1 DateTime from UUTResults order by Da... |
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from .models import ToDo
from .serializers import ToDoSerializer
class ToDoViewSet(viewsets.ModelViewSet):
serializer_class = ToDoSerializer
def get_queryset(self):
if self.... |
#
# Copyright 2021- IBM Inc. All rights reserved
# SPDX-License-Identifier: Apache2.0
#
from scipy.sparse import issparse
from hkmeans.c_package.c_hkmeans_optimizer import CHKMeansOptimizer as CHKMeansOptimizerExtension
class CHKMeansOptimizer:
def __init__(self, n_clusters, n_features, n_samples, x, x_squared_... |
###### IMPORTS ######
# General
import os
import sys
import cv2
import glob
import json
import shutil
import pickle
import argparse
import pandas as pd
import numpy as np
from datetime import datetime
# Plotting
import seaborn as sns
import matplotlib.pyplot as plt
sns.set(style="ticks")
plt.rcParams["font.family"] = ... |
# -*- coding: utf-8 -*-
import numpy as np
from pyfr.plugins.base import BasePlugin
class NaNCheckPlugin(BasePlugin):
name = 'nancheck'
systems = ['*']
formulations = ['dual', 'std']
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.nsteps = self.cfg.getin... |
# Copyright 2016-2020 The Van Valen Lab at the California Institute of
# Technology (Caltech), with support from the Paul Allen Family Foundation,
# Google, & National Institutes of Health (NIH) under Grant U24CA224309-01.
# All rights reserved.
#
# Licensed under a modified Apache License, Version 2.0 (the "License");... |
from objet.robot import *
from objet.obstacle import *
from objet.arene import *
import math
rob = Robot("Rob",0,0,0,1)
rob2 = Robot("Rob2",-1,-1,225,2)
rob.printRobot()
rob.accelerate(2,1)
rob.printRobot()
rob.turn(55)
rob.printRobot()
rob.move(1)
rob.printRobot()
obst1 = Obstacle(6,6.1,2,8)
obst2 = Obstacle(... |
"""
@author: Nabeel Raza
"""
class Solution:
def __init__(self, expression):
"""
Constructor
"""
self.expression = expression
self.value_stack = []
self.op_stack = []
self._allowed_operators = ["+", "-", "/", "*", "^"]
self.processed = self.preprocess... |
#!/usr/bin/env python3
# -*- codeing: utf-8 -*-
"""
Created on `(format-time-string "%B %d %y")`
Author github/twitter @iwahbe
"""
$0
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# main.py
# It handles a Google Cloud Function that sends information about a Cloud Pub/Sub event that depends on the input to the function log.
def pubsub_event(event, context):
"""Triggered from a message on a Cloud Pub/Sub topic.
Args:
event (dict): ... |
from blinkytape import BlinkyTape
class BaseMode(object):
fps = 10
led_count = 60
no_sleep = False
def __init__(self, fps=None, led_count=None, no_sleep=None, *args, **kwargs):
self.colors = list()
for i in range(self.led_count):
self.colors.append((0, 0, 0))
if fp... |
# Standard library imports
import sys
# Local imports
from ..qt import QtWidgets, QtCore
def ui_handler(handler, *args, **kw):
""" Handles UI notification handler requests that occur on a thread other
than the UI thread.
"""
invoke_later(handler, *args, **kw)
def set_trait_later(obj, trait_name, va... |
# -*- coding: utf-8 -*-
""" MarkerArray to see object in RViz, to calculate TF and angle errors """
__author__ = "Jordan Prince Tremblay, Ismael Balafrej, Felix Labelle, Felix Martel-Denis, Eric Matte, Adam Letourneau, Julien Chouinard-Beaupre, Antoine Mercier-Nicol"
__copyright__ = "Copyright 2018, DEVINE Project"
__c... |
from gutter.client.arguments import Container
class User(Container):
def name(self):
return 'Jeff'
def age(self):
return 28
class Request(Container):
def ip(self):
return '192.168.0.1'
|
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
from django.views.generic.base import TemplateView
from homepage.views import HomePageView
from profiles.views import ProfileRedirectView
admin.autodiscover()
handler404 = 'homepage.views.error_404_v... |
#!/home/hine/.pyenv/versions/gicken/bin/python
"""ギッケン(を含む汎用)ロボットコントロールUI用
[実行環境]
Python 3.7.x
"""
__author__ = "Daisuke IMAI <hine.gdw@gmail.com>"
__status__ = "develop"
__version__ = "0.0.1"
__date__ = "2019/05/15"
import os
import sys
import time
import json
import tornado.ioloop
import tornado.websocket
class ... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: musicxml/helpers.py
# Purpose: Helper routines for musicxml export
#
# Authors: Michael Scott Cuthbert
# Jacob Tyler Walls
#
# Copyright: Copyright © 2013-2020 Michael Scot... |
#!/usr/bin/python
from socket import *
import socket
from termcolor import colored
from threading import *
print(colored("[*] Enter Host IP Address or Website Name:","green"))
host = input()
print(colored("[*] Enter number of ports to scan:","green"))
num = int(input())
def PScanner(port):
# AF_INT means w... |
# -*- coding: utf-8 -*-
"""Unit tests for the :module:`extract <extract>` module."""
import pytest
from pytube.exceptions import RegexMatchError
from pytube import extract
def test_extract_video_id():
url = "https://www.youtube.com/watch?v=9bZkp7q19f0"
video_id = extract.video_id(url)
assert video_id ==... |
from django.db.models.signals import post_save,m2m_changed
from django.contrib.auth.models import User
from django.dispatch import receiver
from .models import Profile
from posts.models import Following
@receiver(post_save,sender=User)
def create_profile(sender,instance,created, **kwargs):
if created:
Pro... |
from utilidadesCeV import moeda
preco = float(input('Digite o preço: R$'))
porcentagem = float(input('Digite a aliquota:'))
print(f'A metade de R${preco:.2f} é R${moeda.metade(preco):.2f}')
print(f'O dobro de R${preco:.2f} é R${moeda.dobro(preco):.2f}')
print(f'Aumentando R${preco:.2f} em {porcentagem}% temos R${moeda... |
# -*- coding: utf-8 -*-
#pylint: disable=W1202
from __future__ import division
import functools
import logging
import operator
from collections import OrderedDict, namedtuple
import cards
from inputs import input_for_choice, input_for_confirmation
from player import Player
# dodac named tuple na (player, val), bedzi... |
import numpy as np
def load_data(path):
""" load txt data
Parameters
---------------
path : str
data path
Returns
--------
X : numpy.ndarray, shape(N, D)
Y : numpy.ndarray, shape(N)
Example
----------
>>> path = "./data/ref_data.txt"
# ref_data.txt
0.3 1.
... |
import logging
from typing import List
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from tortoise.contrib.fastapi import register_tortoise
from app.api import home_page, token
from app.api.v2.routers import api_router_v2
from app.config import get_settings
settings = get_settings()
... |
class Solution:
def countNegatives(self, grid: List[List[int]]) -> int:
count = 0
for row in grid:
for index in range(len(row)-1, -1, -1):
if row[index] < 0:
count += 1
else:
break
return count |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# common tool settings and functions for OpenROAD tools
#
# See LICENSE for licence details.
from decimal import Decimal
from functools import reduce
import os
import re
import shutil
from subprocess import Popen, PIPE
from textwrap import dedent as dd
from typing impo... |
import requests
import json
from dataclasses import dataclass
API_URL = ""
#API_URL = "http://localhost:5000"
def make_iso_format_date(value):
for form in DATE_FORMATS:
try:
date = time.strptime(value, form)
value = time.strftime(ISO_DATE, date)
break
except Val... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import print_function
import sys
import time
import os
import io
import csv
import sqlite3
import codecs
import stardict
import vim
try:
import json
except:
import simplejson as json
def getRange():
buf = vim.current.buffer
if buf is None... |
XXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXX XXXXXXXX XXX
XXXXXXXXXXXXXXXXXXXXXX
XX XXXXXXXXXXXXXXXXXX
XXXXXXX XXXXXXXX
XXXXXXXXXXXXXXXX
XX XXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXX XXXXXXXXXXX XXXXXXX XXXXXXXX XXXXXXXXX
XXXXXXXXX XXXXXXXXX XXXXXXXX XXX XXXXXXXXX XXXXXXX XXXXXXXX XXXXXXXXX
X XXXXXXXXXXXXXXXXXXXXX... |
import yfinance as yf
import streamlit as st
import pandas as pd
st.write("""
## Simple Stock Price App
Shown are the stock closing price and volume of Google!
""")
tickerSymbol = "GOOGL"
tickerData = yf.Ticker(tickerSymbol)
tickerDf = tickerData.history(period='id', start='2010-5-31', end='2020-5-31')
st.l... |
## Exercício 04 do livro Python 3 - Conceitos e Aplicações - Uma Abordagem Didática
""" Reproduza em um programa todos os casos de operações aritméticas do Quadro 2.1, para A = 14 e
B = 5, e compare os valores obtidos por você com os valores esperados constantes do quadro."""
A = 14
B = 5
print("A = 14 e B = 5")
prin... |
# Copyright (c) 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
#
# Licensed under the LICENSE.
# Copyright 2017, Sony Mobile Communications Inc.
#
'''
Generation of bi-directional graph on the warehouse nodes generated in the previous steps.
Bi-directional means that there are no travel conventions for aisles in the warehouse.
'''
import numpy as np
import matplotlib
import matp... |
from . import special_versions
from .packge_info import PackageInfo
from .requester import Requester
from .requirement import Requirement
from .venv_options import VenvOptions
|
from top.api.base import RestApi
class TbkActivityInfoGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
# mm_xxx_xxx_xxx的第三位
self.adzone_id = None
# mm_xxx_xxx_xxx 仅三方分成场景使用
self.sub_pid = None
# 代理id
... |
# Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from sis_provisioner.events import SISProvisionerProcessor
from sis_provisioner.models.user import User
from sis_provisioner.models.events import PersonLog
from uw_sws.models import Person as PersonModel
log_prefix = 'PERSON:'
QUEU... |
"""
.. module:: test underscore
:synopsis: Unit tests for underscore module
"""
from __future__ import division
from nutsflow.underscore import _wrap, _
def test_wrap():
def f(first, second):
return first + second
assert f('1', '2') == '12'
assert _wrap(f, '1')('2') == '21'
def test_unders... |
from ipykernel.kernelapp import IPKernelApp
from . import CCKernel
IPKernelApp.launch_instance(kernel_class=CCKernel)
|
# Copyright (c) 2019 ZettaDB inc. All rights reserved.
# This source code is licensed under Apache 2.0 License,
# combined with Common Clause Condition 1.0, as detailed in the NOTICE file.
import psycopg2
import mysql.connector
import argparse
import json
import time
import common
from distutils.util import strtobool
... |
# -*- coding: utf-8 -*-
# This file is a part of DDT (https://github.com/datadriventests/ddt)
# Copyright 2012-2015 Carles Barrobés and DDT contributors
# For the exact contribution history, see the git revision log.
# DDT is licensed under the MIT License, included in
# https://github.com/datadriventests/ddt/blob/mast... |
# 정확한 순위 플루이드
import sys
sys.stdin = open('../input.txt', 'r')
si = sys.stdin.readline
INF = 987654321
n, m = map(int, si().split())
dp = [[INF for _ in range(n + 1)] for _ in range(n + 1)]
for i in range(n + 1):
dp[i][i] = 0
for _ in range(m):
a, b = map(int, si().split())
dp[a][b] = 1
for k in range(1... |
from django.contrib.auth.models import AbstractUser
from django.db import models
class CustomUser(AbstractUser):
middle_name = models.CharField('Отчество', max_length=75, blank=True)
birth_date = models.DateField(null=True, blank=True,
verbose_name='Дата рождения')
bio = ... |
class GroundTruth:
"""
Base class for ground truths. A ground truth is an object that can be computed and from which we can get training
examples (to fit a Model, for example). Ground truths may come from vibly: when necessary, the from_vibly_file
method may be redefined.
"""
def __init__(self):... |
#!/usr/bin/env python
import os
import string
import sys
from argparse import ArgumentParser, FileType, Namespace
from difflib import ndiff, unified_diff
from os import fdopen, remove
from shutil import copy, which
from subprocess import DEVNULL, PIPE, CalledProcessError, run
from tempfile import mkstemp
from typing i... |
#!/usr/bin/env python2
import os
import re
import xml.etree.ElementTree as ET
import gltypes
import sys
import collections
script_dir = os.path.dirname(os.path.realpath(__file__))
tree = ET.parse(os.path.join(script_dir, '../../../thirdparty/opengl-registry/xml/gl.xml'))
root = tree.getroot()
commands = collections.... |
import argparse
import collections
import hashlib
import logging
import math
import numpy as np
import os
from psims.mzml import MzMLWriter
import re
import sqlite3
import sys
import time
import ctypes
from timsconvert.constants import *
from tdf2mzml.timsdata import *
from tdf2mzml.tdf2mzml import *
|
# Specialization: Google IT Automation with Python
# Course 01: Crash Course with Python
# Week 4 Module Part 1 Exercise 03
# Student: Shawn Solomon
# Learning Platform: Coursera.org
# Try using the index method yourself now!
# Using the index method, find out the position of "x" in "supercalifragilisticexpial... |
import inspect
import json
import logging
import os
import random
import tarfile
import tempfile
import uuid
import requests
from tqdm import tqdm
from abc import ABC, abstractmethod
from inspect import signature
from pathlib import Path
from io import StringIO
from typing import Optional, Dict, List, Union, Any, Itera... |
import torch
from ._common import (
_register_sharded_op_on_local_shards,
)
_register_sharded_op_on_local_shards(torch.nn.functional.gelu)
_register_sharded_op_on_local_shards(torch.nn.functional.relu)
_register_sharded_op_on_local_shards(torch.nn.functional.dropout)
_register_sharded_op_on_local_shards(torch.Ten... |
"""Flask extension leveraging Blueprints for creating application webhooks.
https://github.com/Bogdan-Alexandrescu/Flask-Webhook
https://pypi.python.org/pypi/Flask-Webhook
"""
import sys
from flask import Blueprint, jsonify, make_response, request
__author__ = '@balex'
__license__ = 'MIT'
__version__ = '0.1.0'
cl... |
import pickle
import os
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
credentials = None
__G_DRIVE_TOKEN_FILE = "token.pickle"
__OAUTH_SCOPE = ["https://www.googleapis.com/auth/drive"]
if os.path.exists(__G_DRIVE_TOKEN_FILE):
with open(__G_DRIVE_TOKEN_FIL... |
import yaml
import os
from ai_playground.utils.logger import get_logger
logger = get_logger()
def load_cfg(yaml_filepath):
with open(yaml_filepath, 'r') as stream:
loader = yaml.Loader
cfg = yaml.load(stream, Loader=loader)
cfg = make_paths_absolute(os.path.dirname(yaml_filepath), cfg)
... |
# -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
from __future__ import print_function
import logging
import sqlite3
from unittest import TestCase
from unittest.mock import MagicMock
from time import time, sleep
from p2p0mq.constants import SYNC_DB_INTERVAL
from p2p0mq.peer_store import PeerSto... |
"""The aim of this script is to read the face databases used for experiments """
__author__ = "Mihaela Rosca"
__contact__ = "mihaela.c.rosca@gmail.com"
import scipy.io
import numpy as np
import matplotlib.pyplot as plt
import glob
import cPickle as pickle
import os
import cv2
import facedetection
import fnmatch
impor... |
from finq import Identity, Consumer, IdentityTrue, IdentityFalse, Sum, Multiply, Square, PairSum, TupleSum, First, \
Second, FINQ, PairWith, Compose
def test_identity():
a = 125123621
assert Identity(a) == a
def test_consumer():
a = 125123621
assert Consumer(a) is None
def test_identity_true()... |
galera = []
dados = []
menorpeso = maiorpeso = 0
while True:
dados.append(input('Nome: '))
dados.append(float(input('Peso: ')))
if len(galera) == 0:
maiorpeso = menorpeso = dados[1]
else:
if dados[1] > maiorpeso:
maiorpeso = dados[1]
if dados[1] < menorpeso:
... |
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 os
from .. import config
from . import mnist, dataset
_FASHION_MNIST_BASE_URL = \
'http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/'
_H5_FILENAME = 'fashion-mnist.h5'
_SHA256_TRAIN_IMAGES = \
'3aede38d61863908ad78613f6a32ed271626dd12800ba2636569512369268a84'
_SHA256_TRAIN_LABELS = \
'a0... |
from os.path import dirname, basename, isdir, join
import glob
import importlib
import logging
import pkg_resources
from bulq.core.plugin_base import (
BulqRunnerPlugin,
BulqInputPlugin,
BulqOutputPlugin,
BulqDecoderPlugin,
BulqParserPlugin,
BulqTransformPlugin,
)
import bulq.plugins
logger =... |
import asyncio
from unittest import mock
import pytest
from aiohttp import client, web
async def test_simple_server(aiohttp_raw_server, aiohttp_client) -> None:
async def handler(request):
return web.Response(text=str(request.rel_url))
server = await aiohttp_raw_server(handler)
cli = await aioh... |
import argparse
from jarvis_cd.enumerations import OperationType, LogLevel
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.... |
from typing import *
import asyncio
import math
from asyncio.futures import TimeoutError
from datetime import datetime
from redis import StrictRedis
from uuid import uuid4
from redis_gt.exceptions import WaitingTimeoutError, RunningTimeoutError
from redis_gt.throttle import Throttle
class AsyncThrottle(Throttle):
... |
ancho= 1100
alto=600
rojo= (1,0,0)
morado = (0.8, 0.1, 0.4)
celeste=(0.7,1,1) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.