text
stringlengths
2
999k
import socket from _thread import * import pickle from game import Game # creating the server and the port # server's IP address server = "127.0.0.1" port = 5555 # creating the socket(socket type, stream) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Binding our server znd port to the socket try: s.bin...
import os import yaml import sys import influxdb parent_path = os.path.abspath(os.path.join( os.path.abspath(os.path.join( os.path.realpath(__file__),os.pardir)), os.pardir)) config_path = os.path.join(parent_path, 'build_info.yaml') # Read config info config = {} with open(config_path, 'r') as strea...
# -*- coding: utf-8 -*- import pytest @pytest.fixture def solution(): from leetcode.letter_combinations_of_a_phone_number import Solution return Solution() @pytest.mark.parametrize( 'x,expected', [ ('23', ['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']), ('', []), ('2'...
#!/usr/bin/env python3 """Run the addon.""" import asyncio import logging import sys from asyncio.events import AbstractEventLoop from collections import defaultdict from json import loads from math import modf from pathlib import Path from typing import Dict, List, Sequence import yaml from filter import RROBIN, Filt...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutStrings(Koan): def test_double_quoted_strings_are_strings(self): string = "Hello, world." self.assertEqual(True, isinstance(string, str)) def test_single_quoted_strings_are_also_strings(self): string =...
# Generated by Django 2.2.6 on 2019-10-19 09:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('form', '0001_initial'), ] operations = [ migrations.AlterField( model_name='feedbackform', name='Satisfaction', ...
########################################################################## # # Copyright (c) 2015, Image Engine Design 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: # # * Redistrib...
# -*- coding: utf-8 -*- """Cisco DNA Center AddControlPlaneDevice data model. Copyright (c) 2019-2021 Cisco Systems. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including...
from filabel import filabel from click.testing import CliRunner def test_help_command(): run = CliRunner() output = run.invoke(filabel.main, ['--help']) assert output.exit_code == 0 assert 'Usage: main [OPTIONS] [REPOSLUGS]...' in output.output assert 'CLI tool for filename-pattern-based labeling ...
import smtplib from email.mime.text import MIMEText # 设置服务器所需信息 # 163邮箱服务器地址 mail_host = 'smtp.163.com' # 163用户名 mail_user = 'auto_stock' # 密码(部分邮箱为授权码) mail_pass = 'WEMCUXDRAEXVZSIJ' # 邮件发送方邮箱地址 sender = 'auto_stock@163.com' # 邮件接受方邮箱地址,注意需要[]包裹,这意味着你可以写多个邮件地址群发 receiver = 'danielpine@sina.com' def send_plain_mail(t...
# Databricks notebook source # MAGIC %md # MAGIC # MAGIC # Spark Streaming Homework # MAGIC ## Description # MAGIC * Organize incremental copy of hotel/weather data from Azure ADLS gen2 storage into provisioned with terraform Azure ADLS gen2 storage (with a delay, one day per cycle). # MAGIC * Create Databricks Notebo...
import copy from indra.statements import Agent from indra.ontology.bio import bio_ontology from indra.ontology.world import world_ontology from indra.databases import go_client, hgnc_client from indra.ontology.standardize import \ standardize_agent_name, standardize_db_refs, standardize_name_db_refs def test_isa_...
import numpy as np import scipy as sp import statsmodels as sm import matplotlib as mpl import pandas as pd # returns the function definition of: # pdf = lambda * exp(-lambda * x) class Exponential(object): def __init__(self, lambda, loc = 0): self.lambda = lambda self.loc = loc def pdf(x): ...
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import argparse from openvino.tools.mo.graph.graph import Graph from openvino.tools.mo.pipeline.common import get_ir_version from openvino.tools.mo.utils import class_registration def unified_pipeline(argv: argparse.Namespace): gr...
#!/usr//bin/env python # T. Vuillaume, # Modifications by E. Garcia # Code train models from DL1 files onsite (La Palma cluster) import os import shutil import argparse from lstmcpipe.data_management import ( check_and_make_dir, check_and_make_dir_without_verification ) parser = argparse.ArgumentParser(descr...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Comments', fields=[ ('id', models.AutoField( ...
# coding: utf-8 """ Xero Payroll AU This is the Xero Payroll API for orgs in Australia region. # noqa: E501 Contact: api@xero.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 from enum import Enum class PaymentFrequencyType(Enum): """NOTE: This class is auto gene...
import logging from binascii import hexlify from pprint import pformat from lntenna.bitcoin import AuthServiceProxy, SATOSHIS, make_service_url try: from lntenna.server.bitcoind_password import BITCOIND_PW except ModuleNotFoundError: pass from lntenna.database import ( mesh_add_verify_quote, orders_g...
# coding=utf-8 from mxnet.gluon import nn from mxnetseg.nn import FCNHead from .base import SegBaseResNet, SegBaseMobileNet from mxnetseg.utils import MODELS @MODELS.add_component class FCNResNet(SegBaseResNet): """Fully Convolutional Networks based on ResNet""" def __init__(self, nclass, backbo...
from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#secret-key SECRET_KEY = env("DJANGO_SECRET_KEY") # https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts ALLOWED...
# Copyright 2017 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 random import numpy as np import torch def set_random_seed(seed): if seed < 0: return random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) torch.backends.cudnn.deterministic = True torch.backends.cud...
import os from abc import ABC, abstractmethod from collections import OrderedDict import torch.optim as optim import torch from models import net_utils class BaseModel(ABC): def __init__(self, config): self.config = config self.isTrain = config.isTrain self.device = config.device ...
# Copyright 1999-2021 Alibaba Group Holding 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 a...
# Copyright (c) 2012 OpenStack 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
# # Copyright Soramitsu Co., Ltd. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 # import irohalib import commons import primitive_pb2 admin = commons.new_user('admin@first') alice = commons.new_user('alice@second') iroha = irohalib.Iroha(admin['id']) @commons.hex def genesis_tx(): test_permissions ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. '''Tests for image upload API endpoint.''' import json import os.path fro...
import asyncio import datetime import json import logging import random from datetime import datetime, timedelta import discord from core import database from core.checks import is_botAdmin from core.common import Emoji from discord.ext import commands class SkeletonCMD(commands.Cog): def __init__(self, bot): ...
# Abstract Factory Pattern from abc import ABCMeta, abstractmethod import random class AbstractProductX(metaclass=ABCMeta): @abstractmethod def get_description(self) -> None: pass class AbstractProductY(metaclass=ABCMeta): @abstractmethod def get_description(self) -> None: pass cl...
from ast import arg from email import utils from pickletools import optimize from tabnanny import verbose from django.db import models from PIL import Image import os from django.conf import settings from django.utils.text import slugify from utils import utils class Produto(models.Model): nome = models.CharField...
# coding: utf-8 """ Molecule API Documentation The Hydrogen Molecule API # noqa: E501 OpenAPI spec version: 1.3.0 Contact: info@hydrogenplatform.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import molecule_api...
import unittest from ir_datasets.formats import GenericDoc, GenericQuery, TrecQrel, GenericDocPair, GenericScoredDoc from .base import DatasetIntegrationTest class TestMsMarcoPassage(DatasetIntegrationTest): def test_msmarco_passage_docs(self): # Include some situations that were tricky to handle correctl...
# -*- coding: utf-8 -*- import time from unittest.case import SkipTest import mock import pytest from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY from ddtrace.constants import ENV_KEY from ddtrace.constants import SERVICE_VERSION_KEY from ddtrace.constants import SPAN_MEASURED_KEY from ddtrace.constants import...
#!/usr/bin/env python # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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 ...
from django import forms from django.core.exceptions import PermissionDenied from django.db import router from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from django.template.response import TemplateResponse from django.utils.datastructures import SortedDict import sys if s...
from ext.enum import enum from ext.serialization import JsonSerializableObject class SECURITY_PROTECTION_VALUES(enum): SP_ALLOWS_ADMIN_ACCESS = 0 SP_ALLOWS_USER_ACCESS = 1 SP_ALLOWS_OTHER_ACCESS = 2 SP_UNDEFINED = 3 SECURITY_PROTECTION_VALUES_NAMES = { SECURITY_PROTECTION_VALUES.SP_ALLOWS_ADMIN_...
# Copyright 2018 The Cirq Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
from h_api.bulk_api import CommandBuilder from pyramid.httpexceptions import HTTPInternalServerError from lms.services import HAPIError class LTIHService: """ Copy LTI users and courses to h users and groups. This service provides methods for synchronizing LTI users and courses (received by us in LT...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ The base information profile. """ from abc import ABCMeta, abstractmethod from six import with_metaclass import numpy as np profile_docstring = """ {name} Static Attributes ----------------- xlabel : str The label for the x-axis when plotting. ylabel : str ...
"""Module to select which simulation to run.""" import model_and_simulate.utilities.pygame_simple as pygame_simple from base_start_menu import pygame_simulations, matplotlib_simulations, BaseStartScreen def run_pygame_main() -> bool: """Runs the simulation within pygame logic.""" reset = True while reset...
from typing import Tuple import requests import torch from requests.exceptions import ConnectionError from optimizer.hyperparameters import STATE_SHAPE from optimizer.environment.yarn.yarnmodel import * from optimizer.environment.spark.sparkapplicationtimedelaypredictor import SparkApplicationTimeDelayPredictor from ...
from codecs import open # To use a consistent encoding from os import path from setuptools import setup HERE = path.dirname(path.abspath(__file__)) # Get version info ABOUT = {} with open(path.join(HERE, 'datadog_checks', 'puma', '__about__.py')) as f: exec(f.read(), ABOUT) # Get the long description from the ...
import functools import os import shutil import tempfile import pathlib2 as pathlib import contextlib2 as contextlib import temporary.util @contextlib.contextmanager def temp_dir(suffix='', prefix='tmp', parent_dir=None, make_cwd=False): """ Create a temporary directory and optionally change the current ...
#!/usr/bin/env python from heapq import heappush, heappop import math, time import roslib import rospy from std_msgs.msg import Int32 import os from std_msgs.msg import Int32MultiArray xA=0 yA=0 xB=0 yB=0 xO=0 yO=0 class node: xPos = 0 yPos = 0 G = 0 F = 0 def __init__(self, xPos, yPos, G, F): ...
# coding=utf-8 # Copyright 2018 The TensorFlow Datasets 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 appl...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # # Copyright 2014 Telefónica Investigación y Desarrollo, S.A.U # # This file is part of FI-WARE project. # # 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 th...
# Copyright 1999-2020 Alibaba Group Holding 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 a...
import torch.nn as nn import torch import torch.nn.functional as F from torch.distributions import Bernoulli def conv3x3(in_planes, out_planes, stride=1): """3x3 convolution with padding""" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False) clas...
# -*- coding: utf-8 -*- DESC = "ocr-2018-11-19" INFO = { "GeneralBasicOCR": { "params": [ { "name": "ImageBase64", "desc": "Base64-encoded value of image.\nThe image cannot exceed 7 MB in size after being Base64-encoded. A resolution above 600x800 is recommended. PNG, JPG, JPEG, and BMP form...
import pandas as pd import numpy as np # Example usage: x = tex_table(df, textable_file="testlatextable.txt", bold='min') def tex_table(df, textable_file, bold = None, nan_char = " x ", max_digits = 4): """ This function is only intended for fully numerical tables (dataset x frameworks comparison). Datas...
###################################################################################################################### # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # ...
# Copyright 2016 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...
from pipert2.core.base.routines import MiddleRoutine from pipert2.utils.method_data import Method DUMMY_ROUTINE_EVENT = Method("Change") class DummyMiddleRoutine(MiddleRoutine): def __init__(self, counter=0, **kwargs): super().__init__(**kwargs) self.counter = counter self.inc = True ...
# automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite import flatbuffers class EqualOptions(object): __slots__ = ['_tab'] @classmethod def GetRootAsEqualOptions(cls, buf, offset): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = E...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2019 The FATE 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/lic...
import os import pytest from common.constants import ProfileConstants from models.profile import EditRequiredData, EditOptionalData, EditEmailTimeCountry current_dir = os.path.dirname(__file__) user_images_directory = os.path.join(current_dir, "user_images") class TestProfile: def test_valid_change_required_fie...
__all__ = ['GeoNewsUpdater', 'applespider', 'contentparser', 'gmap', 'db'] from models.GeoNewsUpdater import * from models.applespider import * from models.contentparser import * from models.gmap import * from models.db import *
#!/usr/bin/env python # Copyright 2022 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # Creates a new branch that bumps the llvm-project commit. # Typical usage (from...
# copied from https://github.com/jaedb/Iris from setuptools import setup setup()
__author__ = 'saeedamen' # # Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians # # 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 ...
# -*- coding: utf-8 -*- """ Display number of unread messages from IMAP account. Configuration parameters: allow_urgent: display urgency on unread messages (default False) cache_timeout: refresh interval for this module (default 60) criterion: status of emails to check for (default 'UNSEEN') debug: log...
# -*- coding: utf8 -*- import sys import time from six import u import bugsnag from tests.utils import ScaryException, IntegrationTest from tests.fixtures import samples class TestBugsnag(IntegrationTest): def setUp(self): super(TestBugsnag, self).setUp() bugsnag.configure(use_ssl=False, ...
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
# Copyright (c) 2016 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 applic...
#!/usr/bin/env python import subprocess import sys __author__ = 'dmcpherson' def call(cmd): try: print cmd result = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True) print result return result except subprocess.CalledProcessError as e: print e.output ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Oct 20 14:51:07 2020 @author: andreas """ import numpy as np from abc import abstractmethod #import pickle import matplotlib.pyplot as plt import seaborn as sns import scipy.spatial.distance as dist import glob #Geometry base class class Geometry_Bas...
# Copyright 2017 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...
DEFAULTS = { 'file_type': 'pdf', 'limit': 10, 'directory': None, 'parallel': False, 'min_file_size': 0, 'max_file_size': -1, 'no_redirects': False } FILE_EXTENSIONS = { 'Adobe Flash': 'swf', 'Adobe Portable Document Format': 'pdf', 'Adobe PostScript': 'ps', 'Autode...
from unittest import mock import freezegun import freezegun.config def setup_function(): freezegun.config.reset_config() def teardown_function(): freezegun.config.reset_config() def test_default_ignore_list_is_overridden(): freezegun.configure(default_ignore_list=['threading', 'tensorflow']) with...
import _plotly_utils.basevalidators class CategoryarrayValidator(_plotly_utils.basevalidators.DataArrayValidator): def __init__( self, plotly_name="categoryarray", parent_name="carpet.baxis", **kwargs ): super(CategoryarrayValidator, self).__init__( plotly_name=plotly_name, ...
#!/usr/bin/env python from livedoor.model import create_model def main(): create_model() if __name__ == "__main__": main()
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
# Copyright 2016 Intel Corporation # # 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 wri...
import frappe import json, re import bleach, bleach_whitelist.bleach_whitelist as bleach_whitelist from six import string_types from bs4 import BeautifulSoup def clean_html(html): if not isinstance(html, string_types): return html return bleach.clean(clean_script_and_style(html), tags=['div', 'p', 'br', 'ul', '...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class REarth(RPackage): """earth: Multivariate Adaptive Regression Splines. Build regressio...
import torch import torch.nn as nn import torch.nn.functional as F class ResNet(nn.Module): def __init__(self, block, layers, view=4, num_classes=13, img_size = 224): self.inplanes = 64 super(ResNet, self).__init__() c = 1 if view == 4: c = 2 self.conv...
import json from os import listdir from os.path import isfile, join class File: _memes_path = "./Memes/" @staticmethod def loadConfig(): try: return json.load(open("./config.json", "r")) except FileNotFoundError: print("O arquivo config.json não foi encontrado.") ...
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
class Solution: def leastInterval(self, tasks: List[str], n: int) -> int: cnt = [0]*26 for i in tasks: cnt[ord(i)-65] += 1 maxCnt = 0 for i in range(26): maxCnt = max(maxCnt, cnt[i]) e = 0 for i in range(26): ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('pycon', '0014_auto_20190130_1601'), ]...
#!/usr/bin/env python # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
from dictionary import definition from PyQt5 import QtCore, QtWidgets class Dict_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName("Dictionary") Dialog.resize(344, 249) self.widget = QtWidgets.QWidget(Dialog) self.widget.setGeometry(QtCore.QRect(10, 10, 321, 236)) ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities fro...
input = """ c num blocks = 1 c num vars = 150 c minblockids[0] = 1 c maxblockids[0] = 150 p cnf 150 677 138 149 113 0 122 -73 -7 0 108 33 145 0 -21 -138 134 0 80 63 -59 0 -24 98 129 0 57 -135 -148 0 -35 -20 106 0 -127 106 148 0 -28 -29 66 0 -147 57 89 0 -19 3 -47 0 112 43 70 0 138 2 -134 0 -72 122 -119 0 91 76 -79 0 11...
import torch from torchvision.datasets import VisionDataset from torchvision.io import ImageReadMode, read_image from torchvision.transforms import ( # added for image augmentation ToPILImage, RandomCrop, ColorJitter, RandomHorizontalFlip, RandomVerticalFlip, RandomResizedCrop, ToTensor,...
# encoding: utf8 # # spyne - Copyright (C) Spyne contributors. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version...
from flask import request, jsonify from flask_restplus import Resource from ..config import CITYDB_CONNECTION_SERVER, CITYDB_CONNECTION_PORT, POSTGRES_DB_CITY, CITYDB_CONNECTION_USER, CITYDB_CONNECTION_PASSWORD from ..util.dto import CityObjectDto import psycopg2 api = CityObjectDto.api @api.route('/') class CityOb...
"""Whocallid.com search module""" from __future__ import print_function from __future__ import absolute_import import re import logging from plugins.base import PageGrabber from .colors import BodyColors as bc try: import __builtin__ as bi except: import builtins as bi class WhoCallIdGrabber(PageGrabber): # ...
# Copyright 2017 AT&T Intellectual Property. All other 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...
# Copyright 2021 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, ...
#!/usr/bin/env python # # USAGE: test_usdt3.py # # Copyright 2018 Facebook, Inc # Licensed under the Apache License, Version 2.0 (the "License") from __future__ import print_function from bcc import BPF, USDT from unittest import main, TestCase from subprocess import Popen, PIPE import ctypes as ct import inspect, os,...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2016-10-08 # @Author : Anh Hoang (anhhoang.work.mail@gmail.com) # @Project : FSCognitive # @Version : 1.0 from base_active_records import BaseActiveRecords class PersonActiveRecords(BaseActiveRecords): def __init__(self, person): super(PersonAct...
from tkinter import * from datetime import datetime, date class Util: def format_fone_entry_widget(value): # (63)99935-5687 value = value.replace("(", "").replace(")", "").replace("-", "") if len(value) == 10: return "({0}{1}){2}{3}{4}{5}-{6}{7}{8}{9}".format(*value) e...
"""Compressed Block Sparse Row matrix format""" __docformat__ = "restructuredtext en" __all__ = ['bsr_matrix', 'isspmatrix_bsr'] from warnings import warn import numpy as np from .data import _data_matrix, _minmax_mixin from .compressed import _cs_matrix from .base import isspmatrix, _formats, spmatrix from .sputi...
import logging logger = logging.getLogger(__name__) TuneReportCallback = None TuneReportCheckpointCallback = None get_tune_ddp_resources = None try: from ray_lightning.tune import TuneReportCallback, \ TuneReportCheckpointCallback, get_tune_ddp_resources except ImportError: logger.info("ray_lightning...
from typing import Any, Dict, List, Type, TypeVar, Union import attr from ..models.transaction_jobs_transaction_my_job import TransactionJobsTransactionMyJob from ..models.transaction_jobs_transaction_their_job import TransactionJobsTransactionTheirJob from ..types import UNSET, Unset T = TypeVar("T", bound="Transac...
# Copyright 2014 Netflix, 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...
from spry.http import HTTPFileSync, HTTPSession def httpget(url, path, persist=True, parts=4, limit=None, timeout=None, restart=False, **kwargs): session = HTTPFileSync('get', url, path, persist=persist, parts=parts, speed_limit=limit, timeout=timeout, restart=restart, **kwargs) ses...
#!/usr/bin/env python3 import os, cgi, cgitb import secret from http.cookies import SimpleCookie # Python 3.7 versus Python 3.8 try: from cgi import escape #v3.7 except: from html import escape #v3.8 def secret_page(username=None, password=None): """ Returns the HTML for the page visited after the use...