text stringlengths 1 927k |
|---|
"""Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... |
from ..utils import Object
class SearchSecretMessages(Object):
"""
Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance the number of returned messages is chosen by the library
Attributes:
ID (:obj:`str`): ``SearchSecretMessages``
... |
# Exercício Python 28: Desenvolva um programa que leia seis números inteiros e mostre a soma apenas daqueles que forem pares. Se o valor digitado for ímpar, desconsidere-o.
soma = 0
for i in range(0,6):
num = int(input('Insira um número inteiro: '))
if num % 2 == 0:
soma += num
print(soma) |
# Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# 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 agre... |
# 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... |
"""
@Filename: KNN.py
@Author: Danc1elion
@Author: ffcccc
@Create Date: 2019-04-29
@Update Date: 2019-05-03
@Description: Implement of KNN
"""
import numpy as np
import operator as op
import AClassifier
import preProcess
class KNNClassifier(AClassifier.aClassifier):
def __init__(sel... |
# Copyright 2008-2011 Nokia Networks
# Copyright 2011-2016 Ryan Tomac, Ed Manlove and contributors
# Copyright 2016- Robot Framework Foundation
#
# 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 Licens... |
import math
lado = eval(input("Informe o lado do quadrado em cm: "))
area = math.pow(lado,2)
perim = lado*4
print('A área do quadrado é igual a: ', area, 'cm')
print('O perímetro do quadro é igual a: ', perim, 'cm') |
# -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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... |
class GridSegmentDirection(Enum,IComparable,IFormattable,IConvertible):
"""
Specify one of the four adjacent segments to a
GridNode.
See Autodesk.Revit.DB.DividedSurface.
enum GridSegmentDirection,values: NegativeU (1),NegativeV (3),PositiveU (0),PositiveV (2)
"""
def __eq__(self,*args):
""" x.__eq__(y) ... |
#
# 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... |
from functools import wraps
from typing import Dict
from django import forms
from django.db import transaction
from django.db.models import F
from django.http import HttpResponse
from django.http import JsonResponse
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
from django.v... |
import os
from paste import request
from paste import fileapp
from paste.httpheaders import ETAG
from paste.urlparser import StaticURLParser
class CacheableStaticURLParser( StaticURLParser ):
def __init__( self, directory, cache_seconds=None ):
StaticURLParser.__init__( self, directory )
self.ca... |
# Copyright 2014 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 requ... |
from appinit_backend.lib.imports import *
def call(**kwargs):
modules = {}
manager = Manager()
settings = Settings()
db = manager.db("appinit")
cursor = db.apis.find()
for i in cursor:
if ".call" not in i['module'] and i['type'] == "module":
del i['_id']
modules[i['module']]... |
import hashlib
import signify.fingerprinter
import subprocess
NUM_PCRS = 24
PCR_SIZE = hashlib.sha1().digest_size
def to_hex(buf):
import binascii
return binascii.hexlify(buf).decode()
def hexdump(buf):
for i in range(0, len(buf), 16):
row = buf[i:i+16]
offs = "0x%08x:" % i
hexs =... |
import random
from deepspeed.utils import logger
from .base_tuner import BaseTuner
class RandomTuner(BaseTuner):
"""Explore the search space in random order"""
def __init__(self, exps: list, resource_manager, metric):
super().__init__(exps, resource_manager, metric)
def next_batch(self, sample_... |
import pandas as pd
import us
from can_tools.scrapers.base import CMU
from can_tools.scrapers.official.base import TableauDashboard
class {{ scraper.name }}(TableauDashboard):
has_location = False
source = "{{ scraper.source }}"
source_name = "{{ scraper.source_name }}"
state_fips = int(us.states.loo... |
# Copyright 2021 MosaicML. All Rights Reserved.
import collections.abc
from unittest.mock import MagicMock
import pytest
from composer.callbacks import SpeedMonitorHparams
from composer.trainer import TrainerHparams
@pytest.mark.timeout(60)
@pytest.mark.run_long
def test_speed_monitor(mosaic_trainer_hparams: Train... |
#
# Copyright (c) 2019, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
#
import abc
import http.client
import itertools
import logging
import sys
import django
from django... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/12/23 18:08
# @Author : youqingkui
# @File : aws_rekognition.py
# @Desc :
import asyncio
import json
import logging
import os
import aiohttp
from aiohttp.hdrs import CONTENT_TYPE
import async_timeout
import voluptuous as vol
import homeassistant.h... |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
import re
from lib.command_constants import CommandConstants
from lib.errors import ParseError
class Command(object):
"""This is primarily a data bucket that holds information about
a specific command"""
def __init__(self, line="", free_format=False, tight=False):
super(Command, self).__ini... |
#!/usr/bin/env python
# @Copyright 2007 Kristjan Haule
from scipy import *
def findNbands(Emin,Emax,enefiles,strfile):
Ry2eV = 13.6056923
# Find 'nat' in the structure file
fs = open(strfile,'r')
fs.next()
line = fs.next()
lattic = line[:4]
nat = int(line[4+23:4+23+3])
fs.close()
pr... |
# 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 setuptools
import csgogsi
print("CSGOGSI Installation")
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="csgogsi", # Replace with your own username
version=csgogsi.__version__,
author=csgogsi.__author__,
author_email="python-project@... |
#*
# @file Different utility functions
# Copyright (c) Zhewei Yao, Amir Gholami
# All rights reserved.
# This file is part of PyHessian library.
#
# PyHessian 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, ei... |
#!/usr/bin/env python3
# © 2021 Nokia
#
# Licensed under the BSD 3 Clause license
# SPDX-License-Identifier: BSD-3-Clause
# http://proceedings.mlr.press/v80/yoon18a/yoon18a.pdf
import sys
sys.path.append('../../common/')
from defaults import *
from gain_ import train
from data_mobile import loadData, normD... |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Iframe(Component):
"""An Iframe component.
Iframe is a wrapper for the <iframe> HTML5 element.
For detailed attribute info see:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/... |
import logging
from .suncg_eval import do_suncg_evaluation
def suncg_evaluation(dataset, predictions, iou_thresh_eval, output_folder, box_only, epoch=None, is_train=None, eval_aug_thickness=None, **_):
logger = logging.getLogger("maskrcnn_benchmark.inference")
if box_only:
logger.warning("evaluation ... |
from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@londonappdev.com', password='testpass'):
"""Create a sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTe... |
import os
import cf
import matplotlib.pyplot as plt
import cfplot as cfp
pngs = ['tas.png', 'ggap1.png', 'ggap2.png']
cfp.setvars(file=pngs[0])
f=cf.read('testdata/tas_A1.nc')[0]
cfp.con(f.subspace(time=15))
cfp.setvars(file=pngs[1])
f=cf.read('testdata/ggap.nc')[1]
cfp.mapset(proj='npstere')
cfp.con(f.subspace(pre... |
"""
Django settings for petso project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
from django.core.urlresolvers import reverse_lazy
from os.path import dirname... |
# coding: utf-8
from __future__ import print_function
from __future__ import print_function
from __future__ import print_function
import matplotlib.pyplot as plt
import numpy as np
import pickle
import pprint
import matplotlib.pyplot as plt
import numpy as np
import pymysql
import pickle
from sympy import *
#x1 = np.a... |
from __future__ import print_function
import codecs
import io
import os
from thecut.forms import __version__
from setuptools import setup, find_packages
import sys
here = os.path.abspath(os.path.dirname(__file__))
def read(*filenames, **kwargs):
encoding = kwargs.get('encoding', 'utf-8')
sep = kwargs.get('s... |
import zipapp
from tenso.version import __version__
target_name = "dist/tenso-" + str(__version__) + ".pyz"
print("Building: " + target_name)
zipapp.create_archive(target=target_name, source="tenso") |
r"""
Solves the incompressible Navier Stokes equations using the Lattice-Boltzmann
Method¹. The scenario is the flow around a cylinder in 2D which yields a van
Karman vortex street.
periodic
+-------------------------------------------------------------+
| ... |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from swagger_server.models.base_model_ import Model
from swagger_server import util
class ApiResponse(Model):
"""NOTE: This class is auto generated by the swagger... |
"""Contains all the url endpoints for interacting with Robinhood API."""
from robin_stocks.helper import id_for_chain, id_for_stock
# Login
def login_url():
return('https://api.robinhood.com/oauth2/token/')
def challenge_url(challenge_id):
return('https://api.robinhood.com/challenge/{0}/respond/'.format(ch... |
import tempfile
from nose import with_setup, SkipTest
from nose.plugins.attrib import attr
from numpy.testing.utils import assert_allclose, assert_equal, assert_raises
from brian2 import *
from brian2.devices.device import reinit_devices, set_device, reset_device
@attr('cpp_standalone', 'standalone-only')
@with_setu... |
import os
import sys
sys.path.append("../../../../monk_v1/");
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import tensorflow as tf
if(tf.__version__[0] == '2'):
import ten... |
import boto3
from pyspark.sql import SparkSession
s3 = boto3.resource('s3')
nyc_tlc = s3.Bucket('nyc-tlc')
spark = SparkSession.builder \
.appName('check_tlc_schemas') \
.getOrCreate()
for obj in nyc_tlc.objects.all():
key = obj.key
if key.startswith('trip data/') and key.endswith('.csv'):
p... |
"""A simple Python template renderer, for a nano-subset of Django syntax."""
# Comes from http://aosabook.org/en/500L/a-template-engine.html
# By Ned Batchelder (nedbatchelder.com)
# Hosted on https://github.com/aosabook/500lines/tree/master/template-engine/code
# Coincidentally named the same as http://code.activ... |
from .ak import Arknights # noqa: F401
from .cgi import AkCall # noqa: F401
from .exception import PostException # noqa: F401 |
import pya
def registerMenuItems():
import os
from . import scripts, lumerical, install
import SiEPIC.__init__
global ACTIONS
count = 0
menu = pya.Application.instance().main_window().menu()
path = os.path.join(os.path.dirname(os.path.realpath(__file__)),
"files", ... |
from __future__ import print_function
import torch
import torch.nn as nn
import torch.utils.data
from torch.autograd import Variable
import torch.nn.functional as F
import numpy as np
def convbn(in_planes, out_planes, kernel_size, stride, pad, dilation):
return nn.Sequential(nn.Conv2d(in_planes, out_planes, kerne... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock... |
import addict
from act.scio.aliasregex import normalize
from act.scio.vocabulary import Vocabulary
from act.scio.plugin import BasePlugin, Result
from typing import Text, List
import configparser
import os.path
def normalize_ta(name: Text) -> Text:
return normalize(
name,
capitalize=True,
... |
#
# OeD - Open-ended Dependency Analyser
#
# Copyright (C) 2020 -- 2021 SINTEF Digital
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#
from oed import OeD
from oed.laboratory import Laboratory
from oed.engines.os impor... |
import pytest
from thedarn.rules.java import match, get_new_command
from thedarn.types import Command
@pytest.mark.parametrize('command', [
Command('java foo.java', ''),
Command('java bar.java', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
(... |
REPEAT = 32
SLEEP_REGULAR = 10
SLEEP_ERROR = 60
COMPLETED_STATUS = ['completed', 'saved']
ERROR_OK = 0
ERROR_SERVER_INTERNAL = 1
ERROR_BAD_APP_ID = 2
ERROR_APP_ID_NOT_FOUND = 3
ERROR_BAD_TOKEN = 4
ERROR_TOKEN_NOT_FOUND = 5
ERROR_TARIFF_NOT_PAID = 6
ERROR_MASTER_NOT_FOUND = 7
ERROR_SYSTEM_BUSY = 8
ERROR_BAD_PAYLOAD = 9... |
# Generated by Django 3.2.9 on 2021-11-23 14:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... |
import codecs
import contextlib
import copy
from decimal import Decimal
from django.apps.registry import Apps
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.utils import six
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_delete_table = "DROP TABLE %(table)s"
sql_c... |
# Copyright 2016 James Hensman, alexggmatthews
#
# 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... |
"""
Django settings for innova_aula project.
Generated by 'django-admin startproject' using Django 2.2.19.
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 ... |
# Generated by Django 2.2 on 2021-10-20 11:59
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('authy', '0004_auto_20211020_1442'),
]
operations = [
migrations.RemoveField(
model_name='profile',
name='url',
),
... |
array = [[0 for col in range(11)] for row in range(10)]
print(len(array)) |
"""
MagPy
Input filter for IONOMETER data
Written by Roman Leonhardt December 2015
- contains test and read function, no write function
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from io import open
from magp... |
import itertools
import numpy as np
from .. import layers
from ..utils import colormaps
from ..utils.misc import ensure_iterable, is_iterable
from ..utils import io
class AddLayersMixin:
"""A mixin that adds add_* methods for adding layers to the ViewerModel.
Each method corresponds to adding one or more la... |
import torch
from torch import nn, einsum
from einops import rearrange
# max_pos_size = 160
class RelPosEmb(nn.Module):
def __init__(
self,
max_pos_size,
dim_head
):
super().__init__()
self.rel_height = nn.Embedding(2 * max_pos_size - 1, dim_head)
sel... |
import ast
import csv
import inflect
import os
import plotly as py
import sys
from typing import Any, Dict, List
""" Takes pre-prepared data from the SimulationVisualiserInitiator class and produces a series of violin plots
comparing the satisfaction distributions of the different agent types at the end of a series o... |
# Copyright 2021 The Kubeflow 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 applicabl... |
"""
##################################################################################################
# Copyright Info : Copyright (c) Davar Lab @ Hikvision Research Institute. All rights reserved.
# Filename : builder.py
# Abstract :
# Current Version: 1.0.0
# Date : 2020-05-31
####... |
from .utils import setup_runtime
from .trainer import Trainer
from .model import GAN2Shape |
# pylint: disable=C0302
# 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
# "... |
__title__ = 'saga_requests'
__description__ = 'Saga pattern implementation for sequential HTTP requests.'
__author__ = 'Kutay Aslan'
__author_email__ = 'kutay.aslan97@gmail.com'
__license__ = 'MIT'
__copyright__ = 'Copyright 2021 Kutay Aslan'
from .saga_requests import SagaBuilder, SagaAction, SagaRequest, SagaRequest... |
# Generated by Django 4.0.2 on 2022-02-06 14:36
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
... |
# Generated by Django 3.0.6 on 2020-10-02 12:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auctions', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Listing',
fields=[
('id',... |
import logging
import os
import uuid
import yaml
from marshmallow.schema import SchemaMeta
from typing import Any, List
from base64 import b64encode, b64decode
from app.utility.base_world import BaseWorld
DEFAULT_LOGGER_NAME = 'rest_api_manager'
class BaseApiManager(BaseWorld):
def __init__(self, data_svc, fi... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli... |
#!/usr/bin/python
"""
This code executes a search request for the specified search mood.
It takes in a Youtube API key provided by the developer
It randomizes the top results and returns a random URL based on what mood was
called
"""
import argparse
import logging
import json
import random
from pprint import pprint
... |
import random
# 1. Generate two random single-digit integers
number1 = random.randint(0, 9)
number2 = random.randint(0, 9)
# 2. If number1 < number2, swap number1 with number2
if number1 < number2:
number1, number2 = number2, number1 # Simultaneous assignment
# 4. Prompt the student to answer "what is number1 - ... |
# coding: utf-8
'''Fauzi, fauzi@soovii.com'''
from flask import Blueprint, request
from flask_restful import Api, reqparse
from app.view import Resource
from app.model import db
# from app.main.model import Main
from sqlalchemy.exc import SQLAlchemyError
from log import logger
mainBlueprint = Blueprint('main', __name... |
from typing import NoReturn
import logbook
import qbittorrentapi
import requests
from qbittorrentapi import APINames, login_required, response_text
from .arss import ArrManager
from .config import CONFIG
from .logger import *
logger = logbook.Logger("qBitManager")
# QBitTorrent Config Values
qBit_Host = CONFIG.get(... |
import enum
import json
from target_voice import create_voice, gender_string
import api.stt.util
class Provider(enum.Enum):
GCLOUD = 1
AWS = 2
AWS_DEEPL = 3
class Client:
def __init__(
self,
upload_filename,
stt_provider=Provider.GCLOUD,
translate_provider=Provider.GC... |
"""
"""
import sys
import numpy as np
import pandas as pd
from scipy.signal import argrelextrema
from analysis.frog_click_mean_calculation import calc_click_mean_quantil_based
from utils import dataframe_index, audio_calcs
from utils.data_exporter import Exporter
from utils.data_loader import Loader
import logging
... |
# -*- coding: utf-8 -*-
"""
mslib.msui._tests.test_mscolab_project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is used to test mscolab-project related gui.
This file is part of mss.
:copyright: Copyright 2019 Shivashis Padhi
:copyright: Copyright 2019-2020 by the mss team, see AUTHORS... |
# coding: utf8
from __future__ import print_function, unicode_literals
import plac
import random
import numpy
import time
import re
from collections import Counter
from pathlib import Path
from thinc.v2v import Affine, Maxout
from thinc.misc import LayerNorm as LN
from thinc.neural.util import prefer_gpu
from wasabi i... |
# Copyright 2014 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 accompa... |
# This file is part of the Etsin service
#
# Copyright 2017-2018 Ministry of Education and Culture, Finland
#
# :author: CSC - IT Center for Science Ltd., Espoo Finland <servicedesk@csc.fi>
# :license: MIT
"""Direct authentication related functionalities"""
from urllib.parse import urlparse
from flask import session,... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.cuda import amp
from torchvision.models import resnet50
class Identity(nn.Module):
def __init__(self):
super(Identity, self).__init__()
def forward(self, x):
return x
class Model(nn.Module):
def __init__(self, f... |
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# 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 res... |
#
# Copyright (c) 2008-2016 Citrix Systems, 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 l... |
# -*- coding: utf-8 -*-
"""Packaging logic for Flake8."""
import functools
import io
import os
import sys
import setuptools
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) # noqa
import flake8
# NOTE(sigmavirus24): When updating these requirements, update them in
# setup.cfg as well.
requires =... |
# -*- coding: utf-8 -*-
u"""Twilio module.
Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jan 26 2019
Version: 1.1
"""
from twilio.rest import Client
class Twilio():
"""Initilize the Twilio."""
def __init__(self, cred):
"""Init logger params.
Args:
-----
... |
#!/usr/bin/python
# Browsing History to csv
# by:maTWed
# updated: 4/5/2022
# Created for internal use do to all the browsing history investigation
# Instructions: Copy Chrome & Firefox browsing DB to the directory of this script
# Or use 'get_browsing_history.sh' to collect the history and place them in this script's ... |
n = int(input('Digite um número: '))
n1 = n + 1
n2 = n - 1
print('O antecessor de {} é {} e o sucessor é {}'.format(n, n2, n1)) |
import json
import requests
import datetime
import time
import logging
from .auth_endpoint_constants import auth_endpoint_constants
from requests import Session
from jose import jwt
from ..clients.api_client import APIClient
from ..exceptions.UnauthorizedException import UnauthorizedException
from ..exceptions.MaxRetry... |
from async_asgi_testclient.utils import create_monitored_task
from async_asgi_testclient.utils import flatten_headers
from async_asgi_testclient.utils import make_test_headers_path_and_query_string
from async_asgi_testclient.utils import Message
from async_asgi_testclient.utils import receive
from http.cookies import S... |
import re
from telegram import ParseMode, InlineKeyboardMarkup, InlineKeyboardButton
from telegram.chataction import ChatAction
from telegram.error import BadRequest
from telegram.ext.dispatcher import run_async
from Brain import Utils
from Brain.Modules.strings import logger, HELPER_SCRIPTS, HELP_STRINGS
@run_asyn... |
# -*- coding: utf-8 -*-
import re
import socket
import psutil
import time
from iemlav import logger
from iemlav.lib.firewall import utils
class FirewallMonitor(object):
"""Class for FirewallMonitor."""
module_name = "FirewallMonitor"
def __init__(self, interface=None, debug=False):
"""Initializ... |
import os
from setuptools import setup, find_packages
this_dir = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_dir, "README.md"), "r") as f:
long_description = f.read()
# More information on properties: https://packaging.python.org/distributing
setup(
name="requests_auth",
version... |
#!/usr/bin/python
# Copyright (c) 2016 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author:
# Alberto Solino (@agsolino)
#
# Description:
# This module will try to fin... |
# pylint: disable=missing-function-docstring, missing-module-docstring/
#==============================================================================
def allocatable_to_pointer():
from numpy import array
a = array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
c = a #pylint:disable=unused-variable
def pointer_to_po... |
# Generated by Django 3.0.3 on 2020-04-21 10:08
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posthog', '0048_auto_20200420_1051'),
]
operations = [
migrations.DeleteModel(
name='FunnelStep',
),
] |
"""
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import pytest
from ly_test_tools.o3de.editor_test import EditorSingleTest, EditorSharedTest, EditorParallelTest... |
"""
HelloWorldO0.py
Copyright (c) 2020 by Robert Russell Millward. All rights reserved.
"""
from tkinter import *
class GenResearch(Frame):
def sayHi(self):
print("hi Bob");
def createWidgits(self):
self.QUIT = Button(self);
self.QUIT["text"] = "Quit";
self.QUIT["fg"] = "red"... |
#!/usr/bin/env python3
"""Training and Evaluate the Neural Network
Usage:
train.py [options] <yaml-config>
train.py (-h | --help )
Arguments:
yaml-config Path to the yaml hyper-parameter file
Options:
-h --help Show this screen.
-d --devices <devices> ... |
# Zoom Host Client - Zoom Education Suite - HooHacks2020 - maxtheaxe
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import Act... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.