text
stringlengths
1
927k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import tempfile import os import unittest from slack_backup import config CONF = """\ [common] channels=["one","two", "three"] database=dbfname.sqlite quiet=1 verbose=2 [generate] output=logs format=text theme=plain [fetch] user=someuser@address.com p...
from django.core.mail import send_mail import requests import simplejson class APIError: def __init__(self, code, msg): self.code = code self.msg = msg def wx_log_error(APIError): send_mail('movecar err', 'wechat api error: [%s], %s' % (APIError.code, APIError.msg)) class WechatBaseApi: ...
from functools import partial import threading from PyQt5.Qt import Qt from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton from PyQt5.Qt import QVBoxLayout, QLabel from electrum_xsh_gui.qt.util import * from electrum_xsh.i18n import _ from electrum_xsh.plugins import hook, DeviceMgr from electrum_xsh.util imp...
from __future__ import print_function # Authors: Denis Engemann <denis.engemann@gmail.com> # # License: BSD (3-clause) import os import os.path as op from functools import reduce, partial import warnings import numpy as np from numpy.testing import (assert_array_almost_equal, assert_array_equal, ...
import weaviate import cv2 import os,sys import pandas as pd from student_test import getFaces, testImage, testit def markAttendance(faces,own=False): ''' This function takes in a list of image paths (paths of face images) and then uses weaviate's image2vec-neural module to classify each image dependin...
from openpyxl import load_workbook import numpy as np import matplotlib.pyplot as plt # book = load_workbook('results_teste.xlsx') book = load_workbook('results_pleno_completo.xlsx') sheet = book.active from trabalho_final.kohonen import kohonen i = 2 end = False jobs_dict = dict() while not end: if not sheet['...
#!/usr/bin/env python3 # # Copyright 2015 WebAssembly Community Group participants # # 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 # # Unles...
# -*- coding: utf-8 -*- import argparse from supar import BiaffineSemanticDependencyParser from supar.cmds.cmd import parse def main(): parser = argparse.ArgumentParser(description='Create Biaffine Semantic Dependency Parser.') parser.set_defaults(Parser=BiaffineSemanticDependencyParser) subparsers = pa...
""" THis should be modified to be a python "logging" logger. """ import os import urllib import json import pkgutil import pystache from math import ceil class SubmitLogger(object): """ This class does double duty as both a storage container for environment, and a logging/notification system. Perhaps this isn't ...
#!/usr/bin/env python3 import sys from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right # type: ignore from collections import Counter, defaultdict, deque # type: ignore from fractions import gcd # type: ignore from heapq import heapify, heappop, heappush, heappushpop, heapreplace, ...
# 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 # # https://aws.amazon.com/apache2.0/ # # or in the "license" file accomp...
""" NLP Sandbox API NLP Sandbox REST API # noqa: E501 The version of the OpenAPI document: 1.2.0 Contact: team@nlpsandbox.io Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from nlpsandbox.model_utils import ( # noqa: F401 ApiTypeError, ...
''' Drinks ''' n = int(input()) arrays = list(map(int, input().split(' '))) result = sum(arrays) print('{:.12f}'.format(result/n))
""" ASGI config for teste5 project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTIN...
"""Unit tests for flusurv.py.""" # standard library import unittest from unittest.mock import MagicMock from unittest.mock import sentinel from delphi.epidata.acquisition.flusurv.flusurv import fetch_json # py3tester coverage target __test_target__ = 'delphi.epidata.acquisition.flusurv.flusurv' class FunctionTests...
#!/usr/bin/env python #-*- coding: ISO-8859-1 -*- """ Profiler for Cherrpy web framework. Each api call will trigger a new profile stats dump """ import os import cProfile import cherrypy class CachegrindHandler(cherrypy.dispatch.LateParamPageHandler): """Callable which profiles the subsequent handlers and outpu...
def pre_save_test(instance, *args, **kwargs): instance.pre_save_runned = True def post_save_test(instance, created, *args, **kwargs): instance.post_save_runned = True
# Copyright (c) 2018 TU Dresden # 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 # notice, this list of conditions and the following...
from lib.ml_lib import is_selected from config.proposal import PROPOSAL BOX_TYPES = {"type": "TYPE", "office_use": "OFFICE_USE", "personal_inf": "PERSONAL_INF", "employment_inf": "EMPLOYMENT_INF", "business_inf": "BUSINESS_INF", "causes_of_insolvency": "CAUSES_OF_INSOLVENCY", "transfer_assets": "TRANSFER_ASSETS", "asse...
# coding: utf-8 """ @author: csy @license: (C) Copyright 2017-2018 @contact: wyzycao@gmail.com @time: 2018/11/26 @desc: """ class BaseRequest(object): """ base request class """ def __init__(self, request): self.request = request self._parsed_request() def _parsed_request(self):...
#!/usr/bin/env python #coding=utf8 import sys import os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/..") import time from .sample_common import MNSSampleCommon from toralimns.account import Account from toralimns.topic import * #从sample.cfg中读取基本配置信息 ## WARNING: Please do not hard code your acce...
import helpers import pytest import sys @helpers.filtered_test @pytest.mark.skipif(sys.platform.startswith("win"), reason="Not needed on Windows") def test_style(): modified_files = helpers.run_subprocess( ['git', 'status', '-s'] ) if (modified_files != ""): print(modified_files) a...
#!/usr/bin/python3 -B #coded By :VIGITMHS #iam not Hacker import marshal as m exec (data)
import vk_api # import requests import os import io from PIL import Image class VKSessionClass: def __init__(self, login, password): try: # session = requests.Session() vk_session = vk_api.VkApi(login, password, captcha_handler=captcha_handler) try: # O...
import glob from os.path import join import numpy as n import astropy.io.fits as fits import lib_functions_1pt as lib import os import sys #Quantity studied version = 'v4' qty = "mvir" # one point function lists fileC = n.array(glob.glob( join(os.environ['MD_DIR'], "MD_*Gpc*", version, qty,"out_*_Central_JKresampli...
from torch.nn import functional as F HTRPOconfig = { 'cg_damping': 1e-3, 'reward_decay': 0.98, 'GAE_lambda': 0., 'max_kl_divergence': 2e-5, 'entropy_weight': 0, 'per_decision': True, 'weighted_is': True, 'using_active_goals' : True, 'hidden_layers': [256, 256, 256], 'hidden_laye...
# ----------------------Attribution Started--------------------------- # Code created by hbokmann # Uploaded from Pacman Repository: http://hbokmann.github.com/Pacman/ # # Minor changes made to images used # -----------------------Attribution Closed-------------------------- #Pacman in Python with PyGame #https://git...
#!/usr/bin/env python3 import argparse import hashlib import sys import threading from http.server import BaseHTTPRequestHandler, socketserver, HTTPServer from os.path import basename, dirname, abspath, join from urllib.parse import urlparse import markdown STATIC_CACHE = {} def load_from_cache(path): global S...
import operator import requests_mock import simplejson as json from ichnaea.api.exceptions import ( DailyLimitExceeded, InvalidAPIKey, LocationNotFound, ParseError, ) from ichnaea.api.locate.constants import ( BLUE_MIN_ACCURACY, BLUE_MAX_ACCURACY, CELL_MIN_ACCURACY, CELL_MAX_ACCURACY, ...
"""exploracao_espacial URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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')...
def deferRun(fn, delayFrames=0): run('args[0]()', fn, fromOP=me, delayFrames=delayFrames) class Async: def __init__(self, name): self.name = name def sayHello(self): print('Hello ' + self.name) deferRun(self.sayGoodbye, delayFrames=me.time.rate * 1) def sayGoodbye(self): ...
# # Loop # for i in range(1,11): print(i) input('Press any key to continue . . .')
""" Week 6 - Paddle Class --------- AUTHOR: Edward Camp """ from cs1lib import * class Paddle: def __init__(self, x, y, width, height, r, g, b, paddleName, game): self.game = game self.x = x self.y = y self.width = width self.height = height self.r = r self...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import os import sys import datetime import logging import subprocess import MySQLdb.cursors from twisted.enterprise import adba...
import pytest from pbpstats.client import Client from pbpstats.data_loader.stats_nba.boxscore.file import StatsNbaBoxscoreFileLoader from pbpstats.data_loader.stats_nba.boxscore.loader import StatsNbaBoxscoreLoader from pbpstats.resources.boxscore.boxscore import Boxscore def test_client_sets_object_attrs(): set...
""" WSGI config for altuntas 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.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETT...
import asyncio from mitmproxy.tools import main shutdown_script = "mitmproxy/data/addonscripts/shutdown.py" def test_mitmweb(event_loop, tdata): asyncio.set_event_loop(event_loop) main.mitmweb([ "--no-web-open-browser", "-s", tdata.path(shutdown_script), "-q", "-p", "0", ]) de...
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/alessiohu/Desktop/progetto-labiagi/catkin_ws/src/srrg2_solver/srrg2_solver_calib_addons/src".split(';') if "/home/alessiohu/Desktop/progetto-labiagi/catkin_ws/src/srrg2_solver/srrg2_solver_calib_...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################## # The MIT License (MIT) # Copyright (c) 2018 Kevin Walchko # see LICENSE for full details ############################################## from pygecko.multiprocessing import geckopy from pygecko.multiprocessing import GeckoSim...
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymysql import logging from zp58.settings import * class AbroadwebsitePipeline(object): def __init__(self): ...
import contextlib import enum import getpass import os import secrets import threading import urllib.parse from pathlib import Path, PurePosixPath import appdirs import httpx import msgpack from ..utils import DictView from .cache import Revalidate from .utils import ( ASYNC_EVENT_HOOKS, DEFAULT_ACCEPTED_ENCO...
pr
x= 93 y= input("Please enter your age") age= int(y) if age > 3 and age < 12: print("You are a child") elif age >= 12 and age < 21: print("You are a teenager") else: print("You are very old") x="cheater be like" y= " other piece" print("hello", x+y)
import unittest from ann_benchmarks.plotting.metrics import knn, queries_per_second,\ index_size, build_time, candidates, epsilon, rel class TestMetrics(unittest.TestCase): def setUp(self): pass def test_recall(self): exact_queries = [[0.1, 0.25]] run1 = [[]] run2 = [[...
"""OData service implementation Details regarding batch requests and changesets: http://www.odata.org/documentation/odata-version-2-0/batch-processing/ """ # pylint: disable=too-many-lines import logging from functools import partial import json import random from email.parser import Parser from http.client im...
# format is a function for represenatation of your strings only # using format option in a simple string print("{} How are you".format("Hello")) # using format option for a value stored in a variable str = "This code is written in {}" print(str.format("Python")) # formatting a string using a numeric const...
from .elements import PostProcessorElement from cosmosis.runtime.config import Inifile import os import tempfile import sys from collections import defaultdict def ini_from_header(header_text): """ Parse a cosmosis-format set of header comments that encode the parameters and values used in a run. These lines use ...
# Copyright 2018 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 applicab...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf import tensorlayer as tl from tensorlayer.layers import * from tensorlayer.models import * from tests.utils import CustomTestCase class Layer_Convolution_1D_Test(CustomTestCase)...
:import urllib.request, json import time def download_image_info (gid, output): cover_url = 'https://coverartarchive.org/release-group/%s?fmt=json' % gid print (gid, cover_url) try: with urllib.request.urlopen(cover_url) as url: try: data = json.loads(url.read().decode()) ...
#!/usr/bin/env python3 from zencad import * from globals import * from room import Room from rotplate import RotationPlate #zencad.lazy.fastdo=True class Fork(zencad.assemble.unit): def __init__(self): super().__init__() def fork(self): h = 15 hear_x = 95/2 hear_z = 44 hear_R = 28/2 hear_h = 15 yk...
import pathlib from datetime import datetime fname = pathlib.Path('thenewFile.txt') if fname.exists(): mtime = datetime.fromtimestamp(fname.stat().st_mtime) mtimeString = datetime.strftime(mtime,'%Y-%m-%d') nowtimeString = datetime.strftime(datetime.now(),'%Y-%m-%d') if mtimeString != nowtimeString:...
import pygame import os import random TELA_LARGURA = 500 TELA_ALTURA = 800 IMAGEM_CANO = pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'pipe.png'))) IMAGEM_CHAO = pygame.transform.scale2x(pygame.image.load(os.path.join('imgs', 'base.png'))) IMAGEM_BACKGROUND = pygame.transform.scale2x(pygame.image.l...
# Copyright 2017 The Forseti Security 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 ap...
import re try: from setuptools import setup except ImportError: from distutils.core import setup version = '' with open('schematec/__init__.py', 'r') as fd: regex = re.compile(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]') for line in fd: m = regex.match(line) if m: version = m....
""" Utilities for the SmartSearch class. """ # Author: Sebastien Dubois # for ALFA Group, CSAIL, MIT # The MIT License (MIT) # Copyright (c) 2015 Sebastien Dubois # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"),...
from dataclasses import dataclass, field, asdict from django.core.management.base import BaseCommand, CommandError from django.conf import settings @dataclass class ComposeFile: version: str = "3.9" services: dict[str, dict] = field(default_factory=dict) volumes: dict[str, None] = field(default_factory=d...
from proteus import * from proteus.default_p import * from sharp_crested_weir import * from proteus.mprans import RANS2P LevelModelType = RANS2P.LevelModel if useOnlyVF: LS_model = None else: LS_model = 2 if useRANS >= 1: Closure_0_model = 5; Closure_1_model=6 if useOnlyVF: Closure_0_model=2; C...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import os import StringIO import unittest from telemetry import benchmark from telemetry import story from telemetry.internal.results import cha...
import os import csv import torchvision import torchvision.transforms as transforms import torch import torch.nn as nn from PIL import Image from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True import pickle import numpy as np data_folder = '/media/user/DATA/ArtImages' net = torchvision.models.resnet50(p...
#! /usr/bin/env python # Script to launch AllenNLP Beaker jobs. import argparse import os import random import subprocess import sys from typing import List # This has to happen before we import spacy (even indirectly), because for some crazy reason spacy # thought it was a good idea to set the random seed on import...
######################################################################### # Copyright 2022 (c), Uri Mann. All rights reserved. # # mailto:abba.mann@gmail.com # # # # This program is free s...
# # Copyright (c) 2021 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...
from JumpScale import j import JumpScale.baselib.remote.fabric j.system.platform.ubuntu.check() import cuisine from fabric.api import * class OurCuisine(): def __init__(self): self.api = cuisine self.fabric = j.remote.fabric.api j.remote.fabric.setHost() def connect(self,addr,port,...
"""Setup.py file for Atemon.SMS package.""" from distutils.core import setup setup( name='Atemon-SMSAPI', version='0.1.1.4', packages=['atemon', 'atemon.SMS', 'atemon.SMS.GAG'], long_description="Connect to SMS API with Python", author="Varghese Chacko", author_email="varghese@atemon.com", ...
# qubit number=5 # total number=69 import cirq import qiskit from qiskit import IBMQ from qiskit.providers.ibmq import least_busy from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister from qiskit import BasicAer, execute, transpile from pprint import pprint from qiskit.test.mock import FakeVigo from ma...
import numpy as np import matplotlib.pyplot as plt class RBF(object): """Implementation of a Radial Basis Function Network""" def __init__(self, hidden_neurons=2, learning_rate=0.01, max_ephochs=100, min_error = 0.01): self.hidden_neurons = hidden_neurons self.learning_rate = learning_rate ...
""" Django settings for django_channels_jsonrpc project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings...
"""A module consisting of various meshing functions.""" # *********************************************************************** # # FILE mesh.py # # AUTHOR Dr. Vishal Sharma # # VERSION 1.0.0-alpha4 # # WEBSITE https://github.com/vxsharma-14/project-NAnPack # # NAnPack Learner's Ed...
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import inspect import types from typing import Callable, List, Mapping, Optional from .parameter import Parameter def extract_qua...
# Copyright (c) Facebook, Inc. and its affiliates. import unittest import torcharrow.dtypes as dt from torcharrow import INumericalColumn from torcharrow import Scope from .test_numerical_column import TestNumericalColumn class TestNumericalColumnCpu(TestNumericalColumn): def setUp(self): self.device = ...
import pandas as pd import pytest @pytest.mark.parametrize( "X_y_with_freq, freq", [ ("series_with_freq_D", "D"), ("series_with_freq_M", "M"), ("series_with_freq_Q", "Q-DEC"), ("series_with_freq_Y", "A-DEC"), ], indirect=["X_y_with_freq"], ) @pytest.mark.parametrize( ...
"""Support for Tuya number.""" from __future__ import annotations from typing import cast from tuya_iot import TuyaDevice, TuyaDeviceManager from tuya_iot.device import TuyaDeviceStatusRange from homeassistant.components.number import NumberEntity, NumberEntityDescription from homeassistant.config_entries import Con...
import json import argparse import pdb import glob from nq_utils import load_examples def convert_tokens_to_answer(paragraph_tokens, answer_tokens): answer_token_indexes = [] for answer_token in answer_tokens: answer_token_index = paragraph_tokens.index(answer_token) answer_token_indexes.append...
""" A small templating language This implements a small templating language. This language implements if/elif/else, for/continue/break, expressions, and blocks of Python code. The syntax is:: {{any expression (function calls etc)}} {{any expression | filter}} {{for x in y}}...{{endfor}} {{if x}}x{{elif y}}y...
import json import logging import os import shutil import warnings import flattentool import flattentool.exceptions from django.conf import settings from django.utils.translation import ugettext_lazy as _ from flattentool.json_input import BadlyFormedJSONError from cove.lib.exceptions import CoveInputDataError, cove_...
""" Helper script for checking status of sysfs. This script contains re-usable functions for checking status of hw-management related sysfs. """ import logging from tests.common.utilities import wait_until def check_sysfs(dut): """ @summary: Check various hw-management related sysfs under /var/run/hw-managem...
#!/usr/bin/env python """ refguide_check.py [OPTIONS] [-- ARGS] Check for a Scipy submodule whether the objects in its __all__ dict correspond to the objects included in the reference guide. Example of usage:: $ python refguide_check.py optimize Note that this is a helper script to be able to check if things ar...
# -*- coding: utf-8 -*- # File: base.py import tensorflow as tf import weakref import time from six.moves import range import six import copy from ..callbacks import ( Callback, Callbacks, Monitors, TrainingMonitor) from ..utils import logger from ..utils.utils import humanize_time_delta from ..utils.argtools imp...
# Generated by Django 2.2 on 2021-05-18 21:17 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('user', '0059_auto_20210326_0027'), ('researchhub_case', '0001_initial'), ] op...
#!/usr/bin/env /home/john1990/MGLTools-1.5.6/bin/pythonsh # # # # $Header: /opt/cvs/python/packages/share1.5/AutoDockTools/Utilities24/prepare_receptor4.py,v 1.13 2010/01/25 23:37:14 rhuey Exp $ # import os from MolKit import Read import MolKit.molecule import MolKit.protein from AutoDockTools.MoleculePreparation im...
from typing import List, Optional, Union from pydantic import BaseModel, Field, ValidationError, root_validator # # napari provides these # class Menu(BaseModel): # key: str # id: int # description: str # supports_submenus: bool = True # deprecation_message: Optional[str] # napari_menus = [ # ...
# Generated by Django 3.1.8 on 2021-05-28 13:03 from django.db import migrations, models import django.utils.timezone import uuid class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='TeamMember', field...
import torch import torch.nn as nn from torch.nn import init from .submodules import conv, deconv, i_conv, predict_flow class FlowNetSD(nn.Module): def __init__(self, batchNorm=True): super(FlowNetSD, self).__init__() self.batchNorm = batchNorm self.conv0 = conv(self.batchNorm, 6, 64) ...
'''Bitwise operators act on operands as if they were string of binary digits. It operates bit by bit, hence the name. For example, 2 is 10 in binary and 7 is 111. In the table below: Let x = 10 (0000 1010 in binary) and y = 4 (0000 0100 in binary)''' & Bitwise AND x& y = 0 (0000 0000) | Bitwise OR x | y = 14 (0000 ...
from rest_framework import permissions class UpdateOwnProfile(permissions.BasePermission): """Allow user to edit their own profile""" def has_object_permission(self, request, view, obj): """Check user is trying to edit their own profile""" if request.method in permissions.SAFE_METHODS: ...
""" .. _tut-artifact-sss: ======================================= Artifact correction with Maxwell filter ======================================= This tutorial shows how to clean MEG data with Maxwell filtering. Maxwell filtering in MNE can be used to suppress sources of external interference and compensate for subj...
from .utils import ( buildMenuOptions, getPrompt, removeTrailSlash, createNewSessionId, cloneStrategyRepository, cleanWorkspace, replaceAll, prepareWorkspace, isBinAvailableInPath, ) from os import path def test_prepareWorkspace(): sessionUuid = createNewSessionId() prepar...
# orm/session.py # Copyright (C) 2005-2021 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php """Provides the Session class and related utilities.""" import contextlib import ite...
""" Global and local Scopes Scopes and Namespaces When an object is assigned to a variable a = 10 """
# # Copyright (c) 2017, Massachusetts Institute of Technology 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 notice, this # list ...
# -*- coding: utf-8 -*- name = 'ilmbase' version = '2.2.0' variants = [['platform-windows', 'arch==AMD64']] # This is important, otherwise the build scripts fail # on == in the build folder names. hashed_variants = True build_command = "python {root}/rezbuild.py {install}" build_requires = ['python', ...
from django.shortcuts import get_object_or_404 from rest_framework import viewsets from rest_framework.decorators import action from rest_framework.response import Response from events.models import Event from events.serializers import EventSerializer from tickets.serializers import TicketAvailabilitySerializer clas...
# --coding=utf-8-- _base_ = '../retinanet/retinanet_r50_fpn_1x_coco.py' model = dict( bbox_head=dict( num_classes=5, anchor_generator=dict(ratios=[0.2, 0.5, 1.0, 2.0, 5.0]) ) ) load_from = 'work_dirs2/lr0.01_custom_bigimgscale2/epoch_20.pth' optimizer = dict(t...
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: v1.10.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 from aio...
import sys from unittest import mock from aiozipkin import utils @mock.patch('aiozipkin.utils.binascii.hexlify', autospec=True) def test_generate_random_64bit_string(rand): rand.return_value = b'17133d482ba4f605' random_string = utils.generate_random_64bit_string() assert random_string == '17133d482ba4f6...
""" XML-RPC Client with asyncio. This module adapt the ``xmlrpc.client`` module of the standard library to work with asyncio. """ import asyncio import logging from xmlrpc import client as xmlrpc import aiohttp __ALL__ = ['ServerProxy', 'Fault', 'ProtocolError'] # you don't have to import xmlrpc.client from your...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script to resolve double redirects, and to delete broken redirects. Requires access to MediaWiki's maintenance pages or to a XML dump file. Delete function requires adminship. Syntax: python pwb.py redirect action [-arguments ...] where action can be one of these: ...
#print 'in .../lclslib/algos/diffraction/__init__.py' #__all__ = ['algos',]
# Extraer bounding boxes from pytesseract import Output import pytesseract # import imutils # import argparse import os import glob import random import darknet # import time import cv2 import numpy as np import darknet # import matplotlib.pyplot as plt # def parser(): # parser = argparse.ArgumentParser(descriptio...