text stringlengths 1 927k |
|---|
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from schema import Schema, And, Optional, Regex, Or
from .constants import SCHEMA_TYPE_ERROR, SCHEMA_RANGE_ERROR, SCHEMA_PATH_ERROR
def setType(key, valueType):
'''check key type'''
return And(valueType, error=SCHEMA_TYPE_ERRO... |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import uuid
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='Ca... |
#!/usr/bin/env python
# coding: utf-8
"""
The Clear BSD License
Copyright (c) – 2016, NetApp, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met... |
from ravager.services.google.helpers import uploader
from ravager.database.helpers.structs import OpsDataStruct
from ravager.database.tasks import Tasks
from ravager.celery_tasks.tasks import app
from ravager.services.aria.download import Download
from telegram.ext import CallbackQueryHandler
import logging
logger = l... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... |
#!/usr/bin/python
import sys
def helpexit():
print './splitpstack.py <filename>'
exit(1)
if __name__=='__main__':
if len(sys.argv) != 2:
helpexit()
else:
try:
currentDate = None
f = open(sys.argv[1], 'r')
currentFile = None
for line... |
# Copyright 2021, 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 detect import (detect_logos, detect_text)
import pandas as pd
import re
import os
#from __future__ import print_function
from google.cloud import vision
images_path = "C:\\Users\\heinz\\Yagora GmbH\\Ievgen Kyrda - Crawler\\images\\foodnewsgermany_images/"
file_names = os.listdir(os.path.dirname(images_path))
fi... |
# Time: O(n)
# Space: O(26)
# combinatorics
class Solution(object):
def appealSum(self, s):
"""
:type s: str
:rtype: int
"""
result = curr = 0
lookup = [-1]*26
for i, c in enumerate(s):
result += (i-lookup[ord(c)-ord('a')])*(len(s)-i)
... |
# coding: utf-8
import pprint
import re
import six
class BatchTagActionRequestBody:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and th... |
from abc import ABC, abstractmethod
from typing import Any, Callable, List, Optional, SupportsAbs, Tuple, TypeVar
import libvirt
from assisted_test_infra.test_infra import BaseEntityConfig
from assisted_test_infra.test_infra.controllers.node_controllers.disk import Disk
from assisted_test_infra.test_infra.controllers... |
from typing import List
from django.apps.config import AppConfig
from django.core.checks import CheckMessage, Critical, Tags, register
@register(Tags.compatibility)
def check_USPS_api_auth(app_configs: AppConfig = None, **kwargs) -> List[CheckMessage]:
"""
check_USPS_api_auth:
Checks if the user has ... |
"""
This class is used to cache return value of functions on disk for a specified
number of days. This is used by lakshmi.assets module to cache name/ asset
value (i.e the slow functions). For examples on how to use this class, please
see the tests (tests/test_cache.py file).
Currently, this module can only be used on... |
import os
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from multiprocessing import Process
def startTensorboard(logdir):
# Start tensorboard with system call
os.system("tensorboard --logdir {}".format(logdir))
def fitModel():
# Create your m... |
# -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
# Copyright (c) 2016 SUSE Linux LLC
# All Rights Reserved.
#
# Author: Bo Maryniuk <bo@suse.de>
import hashlib
import os
from yum import config
from yum.plugins import TYPE_CORE
CK_PATH = "/var/cache/salt/minion/rpmdb.cookie"
RPM_PATH = "/var/lib/rpm/Packages"
requires_api_version = "2.5"
plugin_type = TYPE_CORE
... |
# 0 is for perpendicular mode
# 1 is for flat mode
# 0 is for X-Axis config
# 1 is for Y-Axis mode
from copy import deepcopy
class Block:
def __init__(self, givenboard, mode, config, positionfirstbox, positionsecondbox):
# Copy Board
self.board = givenboard
# Fill the Board with Block
... |
# coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="bookmark_data.py">
# Copyright (c) 2020 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of thi... |
from __future__ import absolute_import, division, print_function, unicode_literals
import torch
import torch.nn.functional as F
from tests.utils import jitVsGlow
import unittest
class TestAdaptiveAvgPool2d(unittest.TestCase):
def test_adaptive_avg_pool2d_basic(self):
"""Basic test of PyTorch adaptive_av... |
#!/usr/bin/env python3
def ret_string(name: str) -> str:
print(type(name))
return f"Hi {name}"
for n in ["Karel", "Pepa", 18, "Lucie"]:
try:
print(type(n))
print(ret_string(n))
except TypeError as err:
print(n)
print(err) |
#!/usr/bin/env python
NAME = 'KS-WAF (KnownSec)'
def is_waf(self):
for attack in self.attacks:
r = attack(self)
if r is None:
return
_, page = r
if b'/ks-waf-error.png' in page:
return True
return False |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import csv
import difflib
import shutil
from collections import defaultdict
from statistics import mean
from pytablewriter import MarkdownTableWriter
from tqdm import tqdm
from utils.config import CORRECT_PATCHES, INPUT, REPAIR_OUTPUT, REPAIR_RESULT
class Result:
def __init__(self, buggy_file_line_dir, comparis... |
# Generated by Django 2.2.2 on 2019-06-13 17:37
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Description',
fields=[
... |
# Standard Library
import os
import pytest
# Websauna
from websauna.system import Initializer
from websauna.system.core.route import add_template_only_view
from websauna.tests.fixtures import get_app
from websauna.tests.webserver import customized_web_server
HERE = os.path.abspath(os.path.dirname(__file__))
def e... |
"""Helper definitions to glob .aar and .jar targets"""
def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
... |
from .prm import main |
"""Arrow plots for mechanism."""
import os
from src.plot_utils import ps_defaults
from src.constants import FIGURE_PATH
from typing import Optional
import matplotlib.pyplot as plt
def plot_arrow_plot(save_path: Optional[str] = None, show_plots: bool = False) -> None:
"""
Plot the arrow plot to show that I hav... |
# -*- coding: UTF8
'''
Created on 13.07.2015
@author: mEDI
'''
from elite.system import system as elitesystem
#from elite.rares import rares as eliterares
# from elite.route import route as eliteroute
class route(object):
'''
classdocs
'''
#__slots__ = ["bla"]
#bla =1
maxHops = None
... |
import logging
import time
import numpy as np
import pytest
from ophyd.sim import fake_device_cache, make_fake_device
from .. import ccm
from ..sim import FastMotor
logger = logging.getLogger(__name__)
SAMPLE_ALIO = 4.575 # Current value as of writing this file
SAMPLE_THETA = 1.2 # Modest angle
SAMPLE_WAVELENGTH... |
import re
from enum import Enum
from typing import Any, Dict, Sequence
from pydantic import BaseModel, Field, root_validator, validator
# OpenAPI names validation regexp
OpenAPI_NAME_RE = re.compile(r"^[A-Za-z0-9-._]+")
class ExternalDocs(BaseModel):
description: str = ""
url: str
class Tag(BaseModel):
... |
from .e212_names import operators, countries
from .errors import InvalidNetwork, InvalidCountry
def network(mcc, mnc):
'''
Returns a tuple (country, network_name), with country specified as
ISO-3166-1 alpha-2 code.
'''
mcc = int(mcc)
mnc = int(mnc)
try:
return operators[mcc][mnc]
... |
from polidoro_terminal.size import size, columns, rows
from polidoro_terminal.manipulation import erase_lines, up_lines, clear_to_end_of_line
from polidoro_terminal import cursor
from polidoro_terminal.color import Color
from polidoro_terminal.format import Format
from polidoro_terminal.question import question
NAME =... |
#simple example of how a plugin should look like
#this plugin simply makes the bot responde with a simple string to every message received.
import time
import threading
import simplejson
import urllib2
def set_interval(func, sec):
def func_wrapper():
set_interval(func, sec)
func()
t = threadin... |
# coding: utf-8
"""
Deals
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubspot... |
from __future__ import division
import numpy as np
from scipy.constants import mu_0, pi, epsilon_0
from scipy.special import erf
from SimPEG import utils
import warnings
def hzAnalyticDipoleF(r, freq, sigma, secondary=True, mu=mu_0):
"""
The analytical expression is given in Equation 4.56 in Ward and Hohmann,... |
#!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_fra... |
# -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class UniversalItem(scrapy.Item):
# define the fields for your item here like:
# name = scrapy.Field()
pass |
import cv2
import numpy as np
from Sim3DR import RenderPipeline
from .pose_operations import plot_3d_landmark
def _to_ctype(arr):
if not arr.flags.c_contiguous:
return arr.copy(order="C")
return arr
def get_colors(img, ver):
h, w, _ = img.shape
ver[0, :] = np.minimum(np.maximum(ver[0, :], 0... |
import sqlite3
import sys
import os
import inspect
from time import gmtime, strftime
from config.server import APP_DB_PATH, SERVER_DB_PATH, WHO_AM_I
sys.path.append('..')
# conectando...
conn = sqlite3.connect(
os.path.dirname(
os.path.abspath(
inspect.getfile(
inspect.currentf... |
#!/usr/bin/python
name = input()
num_agents = int(input())
drivers = input().split()
drivers.append(name)
drivers.sort()
index = drivers.index(name) + 1
if num_agents > index:
num_agents = index
rem = index % num_agents
div = index // num_agents
time = (rem + div) * 20
print(time) |
"""server URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based ... |
#!/usr/bin/python
# (c) 2016, NetApp, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
#!/usr/bin/env python
__author__ = 'Minglong Li'
#import sys
#sys.path.append("~/catkin_ws/src/multi_robot_patrol/scripts/basic_support")
from robot_patrol_area_0 import RobotPatrolArea0
from robot_patrol_area_1 import RobotPatrolArea1
from robot_patrol_area_2 import RobotPatrolArea2
from motivational_behavior impor... |
#!/usr/bin/env python
"""self-organizing behaviour: smp / inverse model learning for sphero, 1-dimensional"""
import rospy
import signal
import time, sys, argparse, os
from std_msgs.msg import Float32, Float32MultiArray, ColorRGBA
from sensor_msgs.msg import Imu
from nav_msgs.msg import Odometry
from geometry_msgs.ms... |
""" ADT, CMS """
import sys, argparse, subprocess, os, tempfile, glob
def align():
parser = argparse.ArgumentParser(description='flair-align parse options', \
usage='python flair.py align -g genome.fa -r <reads.fq>|<reads.fa> [options]')
parser.add_argument('align')
required = parser.add_argument_group('required... |
import ROOT, sys, uuid
from PlotStyle import *
from SharedData import *
# plot histograms ----------------------------------------------------------------------------------
def Plot(data, mcs, drawP, tag):
canvas = ROOT.TCanvas(str(uuid.uuid4()), '', 440, 100, GetW(), GetH())
SetCanvas(canvas)
if 'x' in dr... |
from data_collection.management.commands import BaseShpStationsShpDistrictsImporter
class Command(BaseShpStationsShpDistrictsImporter):
council_id = 'E07000098'
srid = 27700
districts_srid = 27700
districts_name = 'PollingDistricts'
stations_name = 'PollingStations.shp'
elections = [
'l... |
# 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
# "License"); you may not u... |
#!/usr/bin/env python3
# Copyright (c) 2015-2017 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 p2p mempool message.
Test that nodes are disconnected if they send mempool messages when bloom
fi... |
"""Helper functions for dealing with repeated fields.
It comes up in a few places that we need to flatten or unflatten repeated
columns when using them in conjunction with other repeated or scalar fields.
These functions allow us to flatten into non-repeated columns to apply various
operations and then unflatten back ... |
import pandas as pd
import numpy as np
from sklearn import linear_model
import logging
def linear_regression(
data=None, dependent=None, predictors=None, regressions='available',
noise=False, inplace=False):
"""Performs simple or multiple linear regression imputation on the data.
First, the re... |
"""A configurable Python package backed by Pyodide's micropip"""
from .piplite import install
__version__ = "0.1.0a23"
__all__ = ["install"] |
import inspect
import logging
import asyncio
from urllib import error
from functools import partial
from .const import DOMAIN, JLR_DATA
from .util import convert_temp_value
_LOGGER = logging.getLogger(__name__)
class JLRService:
def __init__(self, hass, config_entry, vin):
self.hass = hass
self.... |
import dash
import dash_table
app = dash.Dash(__name__)
app.layout = dash_table.DataTable(
fill_width=False,
columns=[
{"name": "number", "id": "number"},
{"name": "region", "id": "area"},
{"name": "tsuyu-iri", "id": "tsuyu-iri"},
],
data=[
{"number": 0, "area": "okinaw... |
# 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 (t... |
import urllib.parse
from urllib.parse import parse_qs
from dotenv import load_dotenv, find_dotenv
import requests
import base64
import os
load_dotenv(find_dotenv())
CLIENT_ID = os.environ.get("CLIENT_ID")
CLIENT_SECRET = os.environ.get("CLIENT_SECRET")
REDIRECT_URI = os.environ.get("REDIRECT_URI")
OAUTH_AUTHORIZE_URL... |
#!/usr/bin/env python2
"""
Add BitTorrent download task
"""
import argparse
import abt.cli as cli
import abt.rpc_client as client
import base64
import os
import tempfile
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog=cli.progname, description=__doc__.strip())
parser.add_argument('torrent', ... |
from collections import OrderedDict
import importlib
from peewee import SqliteDatabase
from .settings import Settings
DATABASE = SqliteDatabase("gouda.db")
class Gouda(object):
def __init__(self):
self.settings = Settings("config/config.json")
self.name = self.settings.core['nick']
# use... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 12 16:07:58 2018
@author: nmei
in exp2 (e2) there were 3 possible awareness ratings ( (e.g. 1- no experience, 2 brief glimpse 3 almost clear or clear perception)
BUT if can make a binary classification by focussing on 1 and 2 which are the majority... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# -*- coding: utf-8 -*-
"""
# @Time : 2019/5/27
# @Author : Jiaqi&Zecheng
# @File : sem_utils.py
# @Software: PyCharm
"""
import os
import json
import re as regex
import spacy
from nltk.stem import WordNetLemmatizer
wordnet_lemmatizer =... |
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32c3
@pytest.mark.esp32s3
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'iram_saf... |
#!/usr/bin/env python3
# user's retroarch configuration file
retroconfig = '/opt/retropie/configs/all/retroarch.cfg'
# current buildbot url
retrourl = 'https://buildbot.libretro.com'
import argparse
import configparser
import os
import os.path as pth
import platform
import shutil
import sys
import tempfile
import ti... |
"""Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
__version__ = "0.6"
__all__ = ["SimpleHTTPRequestHandler"]
import os
import posixpath
import BaseHTTPServer
import urllib
import cgi
import shutil
import mimetypes... |
import matplotlib.pyplot as plt
from reduction.algol_h_alpha_line_model import AlgolHAlphaModel
if __name__ == '__main__':
AlgolHAlphaModel().plot(plt.axes())
plt.show() |
import sys
sys.path.insert(1, "../../../")
import h2o
def link_correct_default(ip,port):
# Connect to h2o
h2o.init(ip,port)
print("Reading in original prostate data.")
h2o_data = h2o.upload_file(path=h2o.locate("smalldata/prostate/prostate.csv.zip"))
print("Compare models with link unspecified and canonical lin... |
from sigbox.signal_decorator import SignalDecorator
from sigbox.signal_box import SignalBox, SignalBoxClass
from sigbox.sigbox import SigBox
__all__ = [SignalBox, SignalDecorator, SignalBoxClass, SigBox] |
# 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
# "License"); you may not u... |
"""446. Arithmetic Slices II - Subsequence"""
class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
dp = [collections.defaultdict(int) for _ in range(len(A))]
total = 0
for i in range(len(A)):
for j ... |
# 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, ... |
# -*- coding: utf-8 -*-
# @Author: yulidong
# @Date: 2018-07-17 10:44:43
# @Last Modified by: yulidong
# @Last Modified time: 2019-03-01 14:12:35
# -*- coding: utf-8 -*-
# @Author: lidong
# @Date: 2018-03-20 18:01:52
# @Last Modified by: yulidong
# @Last Modified time: 2018-07-16 22:16:14
import time
import tor... |
import torch
import kornia
from kornia.augmentation.base import TensorWithTransformMat, _AugmentationBase
from kornia.augmentation.utils import _transform_input3d, _validate_input_dtype
class AugmentationBase3D(_AugmentationBase):
r"""AugmentationBase3D base class for customized augmentation implementations.
... |
{
"targets": [{
"target_name": "krb5",
"sources": [
"./src/module.cc",
"./src/krb5_bind.cc",
"./src/gss_bind.cc",
"./src/base64.cc"
],
'cflags!': ['-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions'],
'include_dirs': ["... |
from jdxapi.routes.health import *
from jdxapi.routes.upload_job_description_file import *
from jdxapi.routes.upload_job_description_context import *
from jdxapi.routes.framework_recommendations import *
from jdxapi.routes.framework_selections import *
from jdxapi.routes.generate_job_schema_plus import *
from jdxapi.ro... |
#!/usr/bin/env python
'''module containing various functions for working with trees and nodes'''
from node_parser import NodeParser
import unittest
def depth(node):
'''compute the depth of the given tree'''
if node is None:
return 0
elif node.is_leaf():
return 1
else:
return 1... |
from typing import List
class Solution:
"""
74.搜索二维矩阵 | 难度:中等 | 标签:数组、二分查找
编写一个高效的算法来判断 m x n 矩阵中,是否存在一个目标值。该矩阵具有如下特性:
<p>
每行中的整数从左到右按升序排列。
每行的第一个整数大于前一行的最后一个整数。
<p>
示例 1:
输入:matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3
输出:true
<p>
示例 2:
输入:matrix = ... |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
import time
import numpy as np
from testbed._rust import sliding_window
x = np.random.randn(5000, 5)
s = time.time()
rustout = sliding_window(x, 100, 1)
print("=" * 50)
print("Rust Speed: ", time.time() - s)
print(rustout.shape)
def sw(array, ws, over):
sl = len(array)
return [array[i:i+ws] for i in ran... |
def gcd(m, n):
if n == 0:
return m
return gcd(n, m%n)
ans = 0
H, V = map(int, input().split())
for x in range(H):
for y in range(1, V):
mx, my = y//gcd(x, y), x//gcd(x, y)
xx, yy = mx+x, my+y
while xx <= H and yy <= V:
ans += (H-xx) * (V-yy)
xx +=... |
from urllib.request import FancyURLopener
from bs4 import BeautifulSoup
from random import choice
import csv
from time import sleep
from urllib.parse import quote,unquote
import json
user_agents = [
'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
'Opera/9.25 (Windows NT 5.... |
import pontuacao_categorias
import pandas as pd
nomes = []
nomes_presenteados = []
enderecos_emails = []
for p in range(len(pontuacao_categorias.tabela.index)):
nomes.append(pontuacao_categorias.tabela['3'][p])
nomes_presenteados.append(pontuacao_categorias.tabela['4'][p])
enderecos_emails.append(pontuaca... |
# coding: utf-8
import wx
from enum import IntEnum
from bookworm import speech
from bookworm.gui.settings import SettingsPanel
from bookworm.structured_text import TextRange
from bookworm.logger import logger
from .annotator import Bookmarker, NoteTaker, Quoter
from .annotation_dialogs import (
BookmarksViewer,
... |
from django.apps import apps
from django.db import models
from django.conf import settings
from django.utils.crypto import get_random_string
from django.utils.translation import ugettext_lazy as _
from exchange.models import format_printable_price, MultiCurrencyPrice
from delivery.models import DeliveryMethodField
fr... |
"""
The :mod:`sklearn.linear_model` module implements a variety of linear models.
"""
# See http://scikit-learn.sourceforge.net/modules/sgd.html and
# http://scikit-learn.sourceforge.net/modules/linear_model.html for
# complete documentation.
from ._base import LinearRegression
from ._bayes import BayesianRidge, ARDR... |
from infobip.clients import get_received_messages
from __init__ import configuration
get_delivery_reports_client = get_received_messages(configuration)
response = get_delivery_reports_client.execute({"limit": 1})
print(unicode(response)) |
import pytest
import mal_tier_list_bbcode_gen.exceptions as exceptions
from mal_tier_list_bbcode_gen.image import Image
def test_source_direct_url():
image_url = 'example.com/test.png'
image = Image('direct URL', image_url)
assert image.image_url == image_url
def test_source_google_drive_file_id():
... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_0.models.group_mem... |
"""
Expression for matching.
"""
import re
from abc import ABC
from typing import Callable, Text, Tuple
from slrp.combos import Combinable
class RegExpr(Combinable):
"""
Regular expression matcher.
"""
def __init__(self, pattern):
self.pattern = pattern
def match(self, expr):
_m... |
#!/usr/bin/python3
import tensorflow as tf
import tfgraph
def main():
with tf.Session() as sess:
g: tfgraph.Graph = tfgraph.GraphConstructor.unweighted_random(sess, "G", 10, 85)
g_sparse: tfgraph.Graph = tfgraph.GraphConstructor.as_sparsifier(sess, g, 0.75)
print(g)
print(g.m)
print(g_sparse)... |
import vtk
from shanapy.models.sreps import Initializer, Interpolater
import pyvista as pv
## Read the input surface mesh (produced by SPHARM-PDM)
reader = vtk.vtkPolyDataReader()
reader.SetFileName('data/example_hippocampus.vtk')
reader.Update()
input_mesh = reader.GetOutput()
## Initialize an s-rep for the input me... |
"""Provides a scanner that will group files together under a common prefix"""
import copy
from .abstract_scanner import AbstractScanner
class SlurpScanner(AbstractScanner):
"""SlurpScanner groups files together by a common prefix.
This works by looking at the first slash (or if there is no slash, the first ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2021 The Beans Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the di... |
#!/usr/bin/env python
# coding: utf-8
# In[3]:
"""Script runs pdf copy paste tool through command prompt.
Automatically monitors and updates clipboard contents.
"""
# Allows importing functions from functions.py in my_module folder
import sys
sys.path.append('../')
# Imports functions from my_module folder
from ... |
# -*- coding: utf-8 -*-
"""
@author: Sushant
"""
import numpy as np
import scipy
######################################## Least Square Linear Regression ####################################
def LinearRegression(data,labels):
numdata = int( np.size(data,0) )
b1 = np.hstack(( data,np.ones((numdata,1)) ) )
... |
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2019 Scipp contributors (https://github.com/scipp)
# @author Dimitar Tasev
import os
import hashlib
import sys
import subprocess as sp
def download_file(source, destination):
command = "wget -O {} {}".format(destination, source)
status = sp.run(comma... |
# -*- coding: utf-8 -*-
"""
Setup file for cforest.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 3.2.3.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
import sys
from pkg_resources import Ver... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#! /usr/bin/env python3
import matplotlib
matplotlib.use('agg')
import argparse
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import logging
default_title = "Metagene profile Bayes' factors"
default_xlabel = "Offset, relative to translation \ninitiation site"
default_ylabel = "Bayes' factor"... |
# -------------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2018 pxlc@github
#
# 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 re... |
# -*- coding: utf-8 -*-
#
# Ibis documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 10 11:06:29 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.