text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Akram Mutaher and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestMonitorType(unittest.TestCase):
pass
|
from .api import delete, get, head, options, patch, post, put, request
from .client import AsyncClient, Client
from .concurrency import AsyncioBackend
from .config import (
CertTypes,
PoolLimits,
SSLConfig,
TimeoutConfig,
TimeoutTypes,
VerifyTypes,
)
from .dispatch.connection import HTTPConnecti... |
# -*- coding: utf-8 -*-
# Copyright Tom SF Haines
#
# 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 ag... |
import json
class Config:
def __init__(self):
config, store_items, profile_config = open("../config.json", "r"), \
open("../store_items.json", "r"), \
open("../profile_config.json", "r")
self.config = {
... |
#
# Copyright (c) 2017-2018, Helge Mathee. All rights reserved.
#
import os
import sys
import time
import serial
class grbl(object):
__port = None
__baud = None
__conn = None
__gcount = None
__cline = None
def __init__(self, port, baud=115200):
super(grbl, self).__init__()
self.__port = port
... |
from .base import AbilityBase
class Feel(AbilityBase):
def description(self):
return "Returns a Space for the given direction (forward by default)"
def perform(self, direction='forward'):
if direction is None:
direction = 'forward'
self.verify_direction(direction)
... |
#!/usr/bin/python3
'''3dObject.py'''
''' Create a 3D space with a Tetrahedron inside and rotate the
view around using the mouse.
'''
from math import sin, cos, radians
import pi3d
DISPLAY = pi3d.Display.create(x=50, y=50)
#capture mouse and key presses
INPUTS = pi3d.InputEvents()
def main():
CAMERA = pi3d.Cam... |
r"""
Echelle Spectrum
----------------
An abstract base class for a high resolution spectrum, for some echelle order :math:`m \in ` out of :math:`M` total orders, each with vectors for wavelength, flux, and uncertainty, e.g. :math:`F_m(\lambda)`. This class is a subclass of specutils' Spectrum1D and is intended to ha... |
import os
import re
import shutil
from datetime import datetime
from os import path
from PySide.QtGui import QDesktopServices
from qtlayoutbuilder.lib.multiline_string_utils import MultilineString
class OriginalFileReWriter(object):
"""
This class is able to overwrite the original input file provided to
... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from numpy.testing import assert_array_almost_equal
# Loss functions
def loss_coteaching(y_1, y_2, t, forget_rate, ind, noise_or_not):
loss_1 = F.cross_en... |
# @Time : 2020/11/17
# @Author : Xiaoxuan Hu
# @Email : huxiaoxuan@ruc.edu.cn
r"""
MaliGAN
################################################
Reference:
Che et al. "Maximum-Likelihood Augmented Discrete Generative Adversarial Networks".
"""
import torch
import torch.nn as nn
import torch.nn.function... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
utility functions.
modules here should not import anything from ``skymap_etl`` library.
"""
|
import fnmatch
import json
import os
import shutil
import stat
import tempfile
import time
import logging
import datetime
from django.conf import settings
import ansible_runner
import awx
from awx.main.utils import get_system_task_capacity
logger = logging.getLogger('awx.isolated.manager')
playbook_logger = logging.... |
#!/usr/bin/env python3
# encoding: utf-8
"""Implements a container for parsed snippets."""
class SnippetDictionary:
"""See module docstring."""
def __init__(self):
self._snippets = []
self._cleared = {}
self._clear_priority = float("-inf")
def add_snippet(self, snippet):
... |
# coding: utf-8
"""
Emby Server API
Explore the Emby Server API # noqa: E501
OpenAPI spec version: 4.1.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility library
import ... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import un... |
import unittest
from openlostcat.operators.filter_operators import FilterREF, FilterConst
from openlostcat.operators.quantifier_operators import ANY, ALL
from tests.filteroperators import test_tag_bundle_set
class TestRef(unittest.TestCase):
def test_simply_ref(self):
self.assertEqual(FilterREF("#false_r... |
# Copyright 2019 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... |
# coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from ppr... |
# -*- coding: utf-8 -*-
# @version : ??
# @Time : 2017/3/29 17:31
# @Author : Aries
# @Site :
# @File : shutil_0329.py
# @Software: PyCharm
import zipfile
"""
压缩 解压 .zip包
"""
# 压缩
z = zipfile.ZipFile('laxi.zip', 'w')
z.write('test.txt')
z.write('test2.xml')
z.close()
# 解压
z = zipfile.ZipFile('laxi.zip', 'r... |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
import configparser
import importlib
import pkgutil
import sys
import time
import traceback
from os import path, getenv
from pychatops.slack.common import auth_ops
from pychatops.slack.common import log_ops
from pychatops.slack.common import slack_ops
from slackclient import SlackClient
# PREVIOUSLY SETUP THE OPERATI... |
# #!/usr/bin/env python
# -*- coding: utf-8 -*-
# <HTTPretty - HTTP client mock for Python>
# Copyright (C) <2011-2018> Gabriel Falcao <gabriel@nacaolivre.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to d... |
import argparse
from collections import Counter, defaultdict
from identityholder import IdentityHolder
import liuwangcycles
from minimumtopologies import ispositive, ismutualinhibition
import networkx as nx
import pandas as pd
# PyPy virtual environment recommended for performance
def countmotifs(network, max_cycle_l... |
import time
import gc
from adafruit_espatcontrol.adafruit_espatcontrol import ESP_ATcontrol
try:
from typing import Tuple, Dict
except ImportError:
pass
ENCRYPTION_OPEN = 0
ENCRYPTION_WPA_PSK = 1
ENCRYPTION_WPA2_PSK = 2
ENCRYPTION_WPA_WPA2_PSK = 3
class AccessPoint:
MIN_CONN_LIMIT = 1
MAX_CONN_LIMI... |
import base64
# USER
post_user_data_200 = {
"username": "sbandera1",
"firstname": "Stepan",
"lastname": "Bandera",
"email": "stepanko@liamg.com",
"phone": "123",
"password": "supersecret"
}
post_user_alt_data_200 = {
"username": "ivanbahryanyi",
"firstname": "Ivan",
"lastname": "Bahryanyi",... |
from rest_framework import serializers
from posts.models import Post, Comment
class PostSerializer(serializers.ModelSerializer):
class Meta:
model = Post
fields = "__all__"
class CommentSerializer(serializers.ModelSerializer):
class Meta:
model = Comment
fields = "__all__"
|
"""A simple three-species chemical kinetics system known as "Robertson's
example", as presented in:
H. H. Robertson, The solution of a set of reaction rate equations, in Numerical
Analysis: An Introduction, J. Walsh, ed., Academic Press, 1966, pp. 178-182.
"""
# exported from PySB model 'robertson'
import numpy
impo... |
import json
import pytest
from riberry import testing
@pytest.fixture(scope='module', autouse=True)
def start_basic_app(start_celery_worker):
start_celery_worker(
cmd=['celery', 'worker', '-A', 'basic', '-l', 'debug'],
riberry_instance='test.celery.instance',
)
class TestBasicCeleryApp(tes... |
'''
data2histogram.py - histogram data in a table
=============================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
This script computes histograms over one or more
columns of a table.
Usage
-----
Example::
python data2histogram.py --help
Type::
... |
'''
Created on Jan 5, 2013
@author: Brad
'''
import numpy
import timeit
print "=== SudokuSolver ==="
numpy.set_printoptions(linewidth=20)
setup = """\
from default_matrices import *
from solver import Solver
from answered_solver import AnsweredSolver
from singleton_solver import SingletonSolver
from naked_solver impo... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
import asyncio
import copy
import math
from datetime import datetime, timedelta
from enum import Enum
from typing import List, Optional, Dict, Union
import knxdclient
from apscheduler.job import Job
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from astral import LocationInfo
from astral.sun import sun, ... |
"""Runway module utilities."""
from __future__ import annotations
import logging
import os
import platform
import subprocess
import sys
from pathlib import Path
from typing import TYPE_CHECKING, Dict, List, Optional, Union, cast
from ..utils import which
if TYPE_CHECKING:
from .._logging import RunwayLogger
LOG... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Author : richardchien
@Date : 2020-04-14 22:10:53
@LastEditors: yanyongyu
@LastEditTime: 2020-04-14 22:21:30
@Description : None
@GitHub : https://github.com/richardchien
"""
__author__ = "richardchien"
import re
import math
from datetime... |
import concurrent.futures
import argparse
import socket
import time
common_ports = {
"21": "FTP",
"22": "SSH",
"23": "TELNET",
"25": "SMTP",
"53": "DNS",
"69": "TFTP",
"80": "HTTP",
"109": "POP2",
"110": "POP3",
"123": "NTP",
"137": "NETBIOS-NS",
"138": "NETBIOS-DGM",
... |
#K8Cscan for python 2.0
#Author: K8gege
#Date: 20190530
#Platform: (Windows & Linux)
#Windows need to .net framework >= 4.0
#Linux not support load 'netscan40.dll' (Maybe Mono is support)
#Usage:
#python K8Cscan.py 192.11.22.40
#python K8Cscan.py 192.11.22.40/24
#python K8Cscan.py 192.11.22.40/24 -t ms17010
... |
"""Render namespace."""
from flask_restx import Namespace, Resource, fields, reqparse # type: ignore
from configmodel.logic.config import get_config
from configmodel.logic.service import get_service
from configmodel.templates.render import render
api = Namespace("render", description="Render operations")
render_pa... |
from rq import Queue
from erica.domain.BackgroundJobs.BackgroundJobInterface import BackgroundJobInterface
from erica.infrastructure.rq.queue import dongle_queue
class BackgroundJobRq(BackgroundJobInterface):
__queue: Queue
def __init__(self, queue: Queue = dongle_queue):
self.__queue = queue
d... |
# -*- coding: utf-8 -*-
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
from collections import OrderedDict
# Import Salt Testing libs
from tests.support.unit import TestCase
# Import Salt Libs
import salt.pillar.pepa as pepa
class PepaPillarTestCase(TestCase):
def... |
import logging
import subprocess
import sys
import ffmpeg
import numpy as np
from sklearn.base import TransformerMixin
import tqdm
import webrtcvad
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def _make_webrtcvad_detector(sample_rate, frame_rate):
vad = webrtcvad.Vad()
vad.se... |
from typing import Any
from typing import Dict
from typing import List
class Attachments:
media_keys: List[Any]
poll_id: List[Any]
@classmethod
def build_obj(cls, obj: Dict[str, Any]) -> "Attachments":
"""Build object"""
new = cls()
new.media_keys = [key for key in obj.get("me... |
from lxml import etree
def patch_xml(xml_file, xslt_template, out_filename):
"""Transform an XML file using and XSLT definition and output as a new XML file"""
with open(xslt_template) as data:
xslt_content = data.read()
xslt_root = etree.XML(xslt_content)
dom = etree.parse(xml... |
from calm.dsl.builtins import ref, basic_cred, CalmVariable, CalmTask, action, parallel
from calm.dsl.builtins import Service, Package, Substrate
from calm.dsl.builtins import Deployment, Profile, Blueprint
from calm.dsl.builtins import read_local_file, vm_disk_package
from calm.dsl.builtins import AhvVmDisk, AhvVmNic,... |
import time
from robot_control_class import RobotControl #importa uma classe
robotcontrol = RobotControl() #criando um objeto
class Robo:
def __init__(self):
print("initialising...")
self.laser1 = robotcontrol.get_laser(360)
self.robotmove_speed = 5
self.robotmove_time = 1
... |
import re
from fastapi import APIRouter, Depends
from pydantic import BaseModel
from sqlalchemy.orm import Session
from config import EMAIL_PATTERN
from config.errcode import UnauthorizedException, BadRequestException
from config.logger import module_logger
from models.db import get_db
from models.user import User
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import PIL
import Tkinter
import collections
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from Tkinter import *
from textwrap import fill
from time import gmtime, strftime
from PIL import ImageTk, Image
from utils import PATH
from matplotlib.backend... |
#verificar se uma expressão matematica é válida a partir dos parenteses
exp = str(input("Digite a expressão: "))
pilha = []
for simbolo in exp:
if simbolo == "(":
pilha.append("(")
elif simbolo == ")":
if len(pilha) > 0:
pilha.pop()
else:
pilha.append(")")
... |
"""
SC101 Baby Names Project
Adapted from Nick Parlante's Baby Names assignment by
Jerry Liao.
YOUR DESCRIPTION HERE
"""
import sys
def add_data_for_name(name_data, year, rank, name):
"""
Adds the given year and rank to the associated name in the name_data dict.
Input:
name_data (dict): dict ho... |
# Fix for older setuptools
import re
import os
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
def fpath(name):
return os.path.join(os.path.dirname(__file__), name)
def read(fname):
return open(fpath(fname)).read()
def desc():
... |
"""
Django settings for sfjf project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# Bu... |
#! /usr/bin/env python2
# Example application for GtkTome
import random
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
import gi
gi.require_version ('Gtk', '3.0')
from gi.repository import Gtk
win = Gtk.Window ()
win.connect ("delete-event", Gtk.main_quit)
from __init__ import Tome
windowbox = Gtk.VBo... |
#!/usr/bin/env python
import logging
from p4p.client.thread import Context
_log = logging.getLogger(__name__)
def getargs():
from argparse import ArgumentParser
P = ArgumentParser()
P.add_argument('pvname', help='SIGS pvname (eg. RX:SIG')
P.add_argument('filename', help='list of BSA/signal PV names.... |
from getpass import getpass
import click
import logging
from .network.threads import UDPSendThread, UDPRecvThread, wait
from .network.udp import UdpSocket
from .util.coder import encode
from .util.model import MeasurementRequest, RelayStateRequest, SysInfoRequest
from .util.output import measurement_output_parser
from... |
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 9
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_2
from i... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2015, Alcatel-Lucent Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# no... |
import argparse
import gc
import os
from pathlib import Path
import numpy as np
import pandas as pd
import features
import metrics
import preprocess
import utils
from dataset import DSB2019Dataset
from optimizedrounder import HistBaseRounder
from weightoptimzer import WeightOptimzer
from runner import Runner
parser ... |
# coding: utf-8
""" Leapfrog integration. """
from __future__ import division, print_function
# Third-party
import numpy as np
# Project
from ..core import Integrator
from ..timespec import parse_time_specification
__all__ = ["LeapfrogIntegrator"]
class LeapfrogIntegrator(Integrator):
r"""
A symplectic, L... |
import sys
import json
from json_settings import Settings
from json_settings import StringSetSetting
from json_settings import SettingErrorMessage
class MainSettings(Settings):
@Settings.assign
def __init__(self, values):
self.vehicle_type = VehicleTypeSetting
class VehicleTypeSetting(StringSetSe... |
from torch import nn
from mmdet.core import (bbox2result, bbox_mapping)
from mmdet.core import (bbox2roi, merge_aug_masks, merge_aug_bboxes, multiclass_nms, merge_aug_proposals)
from mmdet.models.detectors import BaseDetector
class EnsembleHTC(BaseDetector):
def __init__(self, models):
super().__init__()
... |
from random import choice
from string import ascii_letters
from django.db.models import CharField, ForeignKey, CASCADE
from treebeard.mp_tree import MP_Node
from treebeard.ns_tree import NS_Node
from treebeard.al_tree import AL_Node
from tree.fields import PathField
from tree.models import TreeModel
from mptt.models i... |
flags = {
'21444ab76fc804c311d99a7e9ffcbc85': 'LKL{bo0Om_MSU}',
'45bc45d74c18e4f0428374f50af99e2e': 'LKL{bo0Om_H6M}',
'e6204c309cfdf07bafa10fbded85f77b': 'LKL{bo0Om_FEs}',
'198f868e7a4c272ac600a4e0cb2a0c6a': 'LKL{bo0Om_MYN}',
'56882d25734c49a8acd8117e833a6df2': 'LKL{bo0Om_UlR}',
'aa1834490208a4a... |
'''
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2018 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
------------------------------------... |
import asyncio
import dataclasses
import logging
import multiprocessing
from concurrent.futures.process import ProcessPoolExecutor
from decimal import Decimal
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from blspy import G1Element
from ecostake.consensus.block_header_valid... |
# =============================================================================
# Standard imports
# =============================================================================
import os
import logging
#import datetime
#import gc
#import zipfile
# =====================================================================... |
# Databricks notebook source
# MAGIC %md
# MAGIC # Silver to Gold - Building Aggregate Data Marts for End Users
# MAGIC
# MAGIC We will now perform some aggregations on the data, as requested by one of our end users who wants to be able to quickly see summary statistics, aggregated by device id, in a dashboard in thei... |
from helpers.time_utils import days
import brownie
import pytest
from brownie import *
from helpers.constants import *
from helpers.registry import registry
from tests.conftest import yearnSettTestConfig, badger_single_sett
from collections import namedtuple
@pytest.fixture(scope="module", autouse=True)
def setup(Moc... |
import datetime
class rippleSAMPLE:
def __init__(self, loc, date, ACC_RAD, depth, collector, polLIST =[], mode =False):
"""DEFINITION: rippleSAMPLE.__init__() creates a rippleSAMPLE() object storing the data of a sample taken. The object stores the location, date, name data, accuracy, collector of the data sam... |
import logging
from firebase_admin import db
from button.constants import HAVE_MAIL_PATH
logger = logging.getLogger('rpi-button dbupdate')
def update_have_mail(mail: bool) -> None:
ref = db.reference(HAVE_MAIL_PATH)
logger.debug('Setting have mail to value: %s', mail)
ref.set(mail)
logger.debug('Se... |
# Copyright (c) 2018 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `tools` module."""
from __future__ import division
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_almost_equal
import pandas as pd
impor... |
#!/usr/bin/python
#
# sslsniff Captures data on read/recv or write/send functions of OpenSSL,
# GnuTLS and NSS
# For Linux, uses BCC, eBPF.
#
# USAGE: sslsniff.py [-h] [-p PID] [-c COMM] [-o] [-g] [-d]
#
# Licensed under the Apache License, Version 2.0 (the "License")
#
# 12-Aug-2016 Adrian Lope... |
from starlette.applications import Starlette
from starlette.authentication import requires
from starlette.responses import JSONResponse, \
PlainTextResponse, \
RedirectResponse, \
StreamingResponse, \
FileResponse, \
HTMLResponse
from models import *
app = Starlette()
"""
All endpoints after this... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
metrics = {
'Accuracy': ['acc', 'accuracy'],
'BLEU': ['bleu'],
'BLEU score': ['bleu'],
'Character Error Rate': ['cer', 'cers'],
'Error': ['error', 'err', 'error rate'],
'Exact Match Ratio': ['exact match'],
'F1': ['f1',... |
from django.conf.urls import url
from .views import display_documents, add_documents, user_documents, delete_document, get_document
urlpatterns = [
url(r'^$', display_documents, name='view'),
url(r'^my-documents/$', user_documents, name='user_doc'),
url(r'^add/$', add_documents, name='add'),
url(r'^d... |
# Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying... |
#! python3
# -*- coding: UTF-8 -*-
'''
type.py
Basics of variable type in python.
'''
import sys
# intとfloat、Decimal、Fractionなどをサポート。ビルトインでは複素数や虚数も扱える。j or Jで虚部を示す。
# int型代入
num = 30
print("num(int) " + str(num))
# float型代入
num = 30.6
print("num(float)" + str(num))
# int型代入
num = 22
print("num(int)" + str(num)... |
import abc
from typing import Any, Dict
import equinox as eqx
import jax
import jax.lax as lax
import jax.numpy as jnp
from .misc import nondifferentiable_output, ω
from .saveat import SaveAt
from .term import AbstractTerm, AdjointTerm
class AbstractAdjoint(eqx.Module):
"""Abstract base class for all adjoint me... |
# -*- coding: utf-8 -*-
"""Processor for Bgee."""
import os
import pickle
from pathlib import Path
from typing import Union
import pyobo
from indra_cogex.representation import Node, Relation
from indra_cogex.sources.processor import Processor
class BgeeProcessor(Processor):
"""Processor for Bgee."""
name... |
import os
import csv
months = 0
balance = 0
profitlist = []
changelist = []
monthlist = []
csvpath = os.path.join("../Resources","budget_data.csv")
with open(csvpath, newline='', encoding="utf8") as datafile:
csvreader = csv.reader(datafile, delimiter=',')
csvheader = next(csvreader)
for row in csvr... |
search_results = search_results.sort_values(by="mean_score", ascending=False)
search_results
|
"""
WSGI config for AlarmeDeAcoes project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO... |
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpResponse
from django.shortcuts import get_ob... |
import os
import re
import time
import yaml
import requests
import shutil
from .templates import expand_template, get_template_path
from github import Github, GithubException
GITHUB_TOKEN_PATTERN = re.compile('https://([^@]*)@?github.com/([^/]+)/.*git')
GITLAB_TOKEN_PATTERN = re.compile('http://gitlab-ci-token:([^@]+)... |
#
# helpers
#
import codecs
import functools
import json
import multiprocessing
import os
import re
import subprocess
import sys
import uuid
import time
try:
from urllib.request import urlopen, urlretrieve, Request
except ImportError:
from urllib import urlretrieve
from urllib2 import urlopen, Request
d... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Netius System
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Netius System.
#
# Hive Netius System is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apache
# Foun... |
import forumsweats.discordbot as discordbot
from forumsweats import numberparser
import discord
name = 'debugnumber'
args = '[number]'
async def run(message, number: str):
await message.channel.send(embed=discord.Embed(
description=str(numberparser.solve_expression(number))
))
|
"""
shift_out_in_between_dots.py
Copyright 2008 Jose Ramon Palanco
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distribute... |
# -*- coding: utf-8 -*-
'''
Simple progress bar for console
'''
import sys
from console_progressbar.progressbar import ProgressBar
__author__ = 'Carlos Alexandre S. da Fonseca'
__version__ = '1.1.2'
__date__ = '2019-08-08' # YYYY-MM-DD
_DEBUG_MODE = False
if _DEBUG_MODE: # pragma: no cover
print("Python " + ".... |
# 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 may ... |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetCompetitivePricingForASIN
# Returns the current competitive pricing of products, based on ASIN values and the MarketplaceId that you specify.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.... |
def run():
a, b, c = map(float, input().split())
pi = 3.14159
triangulo = a * c / 2.0
circulo = c * c * pi
trapezio = (a + b) * c / 2.0
quadrado = b * b
retangulo = a * b
print('TRIANGULO: %.3f' % triangulo)
print('CIRCULO: %.3f' % circulo)
print('TRAPEZIO: %.3f' % trapezio)
... |
"""anomaly_detection
**********************
MLPerf Tiny anomaly detection reference model
- Source code: `anomaly_detection.py <https://github.com/siliconlabs/mltk/blob/master/mltk/models/tinyml/anomaly_detection.py>`_
- Pre-trained model: `anomaly_detection.mltk.zip <https://github.com/siliconlabs/mltk/blob/master/m... |
from typing import Any, Dict, Union
import attr
from ..types import UNSET, Unset
@attr.s(auto_attribs=True)
class TestInlineObjectsResponse_200:
""" """
a_property: Union[Unset, str] = UNSET
def to_dict(self) -> Dict[str, Any]:
a_property = self.a_property
field_dict: Dict[str, Any] ... |
"""
Run a Function n times every x seconds
--------------------------------------
"""
import bpy
counter = 0
def run_10_times():
global counter
counter += 1
print(counter)
if counter == 10:
return None
return 0.1
bpy.app.timers.register(run_10_times)
|
import time, cv2, pyautogui, mediapipe as mp
import UDPDataSender, GeneralAttribute, time, threading
def start_webcam():
#thread_sender = threading.Thread(target=HandPositionSender.SendPosition)
#thread_sender.start()
widthScreen, heightScreen= pyautogui.size()
winName = 'NumberPedia-HandTracking'
... |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import os
import sys
import sphinx_rtd_theme
# import pkg_resources
# -*- coding: utf-8 -*-
#
# Pyro documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 15 17:16:14 2017.
#
# This file is execfile(... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-08 17:32
from __future__ import unicode_literals
import re
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tags', '0002_auto_20170908_1651'),
]
opera... |
# Copyright 2017 Google 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 or agreed to in writing, ... |
# 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... |
import dash
from utils import get_props
from dash_table import DataTable
from selenium.webdriver.common.keys import Keys
def get_app(props=dict()):
app = dash.Dash(__name__)
baseProps = get_props()
for i in range(len(baseProps["data"])):
datum = baseProps["data"][i]
if datum["eee"] % ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.