filename
stringlengths
13
19
text
stringlengths
134
1.04M
the-stack_106_17860
from __future__ import print_function import sys sys.path.append("/home/ec2-user/anaconda3/lib/python3.5/site-packages/mysql/connector/__init__.py") import mysql.connector import requests import urllib.request import json from pprint import pprint import ssl import time ssl._create_default_https_context = ssl._create_u...
the-stack_106_17861
from model.group_address import Address_data import random import string import os.path import jsonpickle import getopt import sys try: opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of groups", "file"]) except getopt.GetoptError as err: getopt.usage() sys.exit(2) n = 5 f = "data/contacts.json...
the-stack_106_17862
""" This is new module that we intend to GROW from test_events.py. It will contain schemas (aka validators) for Zulip events. Right now it's only intended to be used by test code. """ from typing import Any, Dict, Sequence, Set, Tuple, Union from zerver.lib.topic import ORIG_TOPIC, TOPIC_LINKS, TOPIC_NAME from zerve...
the-stack_106_17863
from distutils.core import setup classes = """ Development Status :: 4 - Beta Intended Audience :: Developers License :: OSI Approved :: MIT License Topic :: System :: Logging Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3.7 Operat...
the-stack_106_17865
"""Initialize the NCBI subpackage, which can contain multiple python modules (files).""" from pkg_resources import get_distribution, DistributionNotFound __project__ = 'PyDkBio' __version__ = None # required for initial installation try: __version__ = get_distribution('PyDkBio').version except DistributionNotFound...
the-stack_106_17867
from queue import Queue from termcolor import colored from com.shbak.effective_python._01_example._55_queue_for_thread.main import ClosableQueue, StoppableWorker from com.shbak.effective_python._01_example._56_when_need_concurrent.main import game_logic, count_neighbors, Grid, \ ALIVE def game_logic_thread(item)...
the-stack_106_17868
import numpy as np import torch from torch import nn import torch.nn.functional as F from transformer import Embedding import re def AMREmbedding(vocab, embedding_dim, pretrained_file=None, amr=False, dump_file=None): # char_vocab-vocabs['concept_char'] # char_dim-concept_char_dim-32 if pretrained_file is...
the-stack_106_17869
# Copyright 2014 Alcatel-Lucent USA 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...
the-stack_106_17870
# Copyright (c) 2016 Uber Technologies, 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 ...
the-stack_106_17871
""" https://leetcode.com/problems/reverse-linked-list/ Difficulty: Easy Given the head of a singly linked list, reverse the list, and return the reversed list. Example 1: Input: head = [1,2,3,4,5] Output: [5,4,3,2,1] Example 2: Input: head = [1,2] Output: [2,1] Example 3: Input: head = [] Output: [] Constraints: ...
the-stack_106_17872
#!/usr/bin/env python2 # Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from...
the-stack_106_17873
# coding: utf-8 """ Seldon Deploy API API to interact and manage the lifecycle of your machine learning models deployed through Seldon Deploy. # noqa: E501 OpenAPI spec version: v1alpha1 Contact: hello@seldon.io Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint...
the-stack_106_17874
# Copyright 2013-2021 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) import os from spack import * class Lbann(CMakePackage, CudaPackage, ROCmPackage): """LBANN: Livermore Big Artificia...
the-stack_106_17875
#!/usr/bin/env python # Part of the psychopy_ext library # Copyright 2010-2016 Jonas Kubilius # The program is distributed under the terms of the GNU General Public License, # either version 3 of the License, or (at your option) any later version. """ A wrapper of matplotlib for producing pretty plots by default. As ...
the-stack_106_17877
# 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 ...
the-stack_106_17879
import uuid # from cms.utils.copy_plugins import copy_plugins_to from django.urls import reverse from django.db import models, transaction from django_extensions.db.fields import RandomCharField from polymorphic.models import PolymorphicModel # from cms.models.fields import PlaceholderField from src.apps.core.man...
the-stack_106_17880
from datetime import datetime import sys from rich.console import Console from rich.progress import Progress from unsilence.Unsilence import Unsilence from unsilence.command_line.ChoiceDialog import choice_dialog from unsilence.command_line.ParseArguments import parse_arguments from unsilence.command_line.PrettyTimeE...
the-stack_106_17882
""" .. module:: runner :platform: Unix, Windows :synopsis: Runner for commands in virtualenv """ from __future__ import print_function import tempfile import shutil import os import subprocess from contextlib import contextmanager from virtualenvrunner.activateenv import ActivateEnv from virtualenvrunner.utils ...
the-stack_106_17883
import platform import stanza from stanza.server import CoreNLPClient print("OS = ", platform.system()) stanza.install_corenlp() client = CoreNLPClient(port=8888) client.start() # Wait for server to start client.ensure_alive() # Get its PID pid = client.server.pid print(f"Process running on: {pid if pid else 'Cant ...
the-stack_106_17885
''' Main Script for FSI with Kratos Mutliphysics This script is intended to be modified. Each solver can be imported and used as "BlackBox" Chair of Structural Analysis, Technical University of Munich All rights reserved ''' ''' This example is based on the dissertation of Daniel Mok "Partitionierte Lösungsansätze in...
the-stack_106_17887
#!/usr/bin/env python3 from core_symbol import CORE_SYMBOL from Cluster import Cluster from Cluster import NamedAccounts from WalletMgr import WalletMgr from Node import Node from TestHelper import TestHelper from testUtils import Utils import testUtils import time import decimal import math import re ##############...
the-stack_106_17888
import io import json import logging from ssl import SSLContext from typing import Any, AsyncGenerator, Dict, Optional, Tuple, Type, Union import aiohttp from aiohttp.client_exceptions import ClientResponseError from aiohttp.client_reqrep import Fingerprint from aiohttp.helpers import BasicAuth from aiohttp.typedefs i...
the-stack_106_17890
# -*- coding: utf-8 -*- """ Created on Thu Mar 28 10:56:25 2019 @author: Manuel Camargo """ import os import subprocess import types import itertools import platform as pl import copy import multiprocessing from multiprocessing import Pool from xml.dom import minidom import time import shutil from lxml import etree im...
the-stack_106_17892
"""Dell PowerConnect Driver.""" from __future__ import unicode_literals from paramiko import SSHClient import time from os import path from netmiko.cisco_base_connection import CiscoBaseConnection class SSHClient_noauth(SSHClient): def _auth(self, username, *args): self._transport.auth_none(username) ...
the-stack_106_17894
# noxfile.py """Configure nox sessions.""" # standard library import shutil import tempfile from pathlib import Path from textwrap import dedent # third pary packages import nox # local packages # define default sessions: nox.options.sessions = ( "pre-commit", "lint", "tests", "xdoctest", "docs_...
the-stack_106_17895
# Copyright (c) 2018 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...
the-stack_106_17897
# not via pip available, therefore stolen # https://github.com/wizeline/sqlalchemy-pagination.git # The MIT License (MIT) # # Copyright (c) 2016 Wizeline # # 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-stack_106_17898
#!/bin/python3 from abc import ABCMeta, abstractmethod class Book(object, metaclass=ABCMeta): def __init__(self, title, author): self.title = title self.author = author @abstractmethod def display(): pass class MyBook(Book): def __init__(self, title, author, price): # sup...
the-stack_106_17902
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings from django.http import HttpResponseRedirect from django.template.response import TemplateResponse from paypal.pro.exceptions import PayPalFailure from paypal.pro.forms import ConfirmForm, PaymentForm from paypal.pr...
the-stack_106_17903
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.Person import Person from alipay.aop.api.domain.Person import Person class Injured(object): def __init__(self): self._cert_name = None self._cert_no = None ...
the-stack_106_17905
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
the-stack_106_17906
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "nub" app_title = "Nub" app_publisher = "Anvil Team" app_description = "Al-Nuran Bank Customization" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "support@anvilerp.com" app_...
the-stack_106_17907
#!/usr/bin/env python3 # Copyright 2019 Mycroft AI 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...
the-stack_106_17909
# coding=utf-8 # # Copyright 2021 Biderman et al. This file is based on code by the authors denoted below and has been modified from its original version. # # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exc...
the-stack_106_17912
from js9 import j from . import (PRIORITY_NORMAL, PRIORITY_RECURRING, PRIORITY_SYSTEM, TASK_STATE_ERROR, TASK_STATE_NEW, TASK_STATE_OK, TASK_STATE_RUNNING) from .task import Task def _instantiate_task(task, service): func = getattr(service, task['action_name']) t = Task(func, ta...
the-stack_106_17914
""" file handling utilities """ import os import shutil import fnmatch import errno def strip_src(file, src): """ remove the src path from a filename """ return file.replace(src, '') def get_dest_file(file, src, dest): """ get the output file, make directories if needed """ f = dest + strip_src(file...
the-stack_106_17915
#!/usr/bin/python ''' Usage: python KEGG-decoder.py <KOALA INPUT> <FUNCTION LIST FORMAT> Designed to parse through a blastKoala or ghostKoala output to determine the completeness of various KEGG pathways Dependencies: Pandas - http://pandas.pydata.org/pandas-docs/stable/install.html Seaborn - http://seaborn.pydata.org...
the-stack_106_17917
"""hknweb URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
the-stack_106_17919
from mud.injector import Injector from mud.event import Event from mud.inject import inject from utils.hash import get_random_hash import gevent import glob import json import logging import os import os.path import settings class CollectionStorage(object): def __init__(self, collection): self.collection...
the-stack_106_17920
import itertools from notifications_utils.recipients import allowed_to_send_to from app.models import ( ServiceGuestList, MOBILE_TYPE, EMAIL_TYPE, KEY_TYPE_TEST, KEY_TYPE_TEAM, KEY_TYPE_NORMAL) from app.dao.services_dao import dao_fetch_service_by_id def get_recipients_from_request(request_json, key, t...
the-stack_106_17921
# coding=utf-8 from __future__ import unicode_literals from django.core.exceptions import ValidationError, ImproperlyConfigured from django.test import TestCase from internationalflavor.vat_number import VATNumberValidator from internationalflavor.vat_number.forms import VATNumberFormField from internationalflavor.vat_...
the-stack_106_17922
# # 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...
the-stack_106_17923
# Copyright 2014 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import json import logging impo...
the-stack_106_17925
"""Remote vehicle services for Subaru integration.""" import logging from subarulink.exceptions import SubaruException from homeassistant.exceptions import HomeAssistantError from .const import SERVICE_UNLOCK, VEHICLE_NAME, VEHICLE_VIN _LOGGER = logging.getLogger(__name__) async def async_call_remote_service(cont...
the-stack_106_17928
"""Module for concatenating netCDF files.""" from typing import Union, Optional import numpy as np import logging import netCDF4 from cloudnetpy import utils def update_nc(old_file: str, new_file: str) -> int: """Appends data to existing netCDF file. Args: old_file: Filename of a existing netCDF file...
the-stack_106_17929
import codecs from functools import wraps import re import textwrap from typing import TYPE_CHECKING, Any, Callable, Dict, List import warnings import numpy as np import pandas._libs.lib as lib import pandas._libs.ops as libops from pandas.util._decorators import Appender, deprecate_kwarg from pandas.core.dtypes.com...
the-stack_106_17930
from django.db import migrations def create_site(apps, schema_editor): Site = apps.get_model("sites", "Site") custom_domain = "purple-surf-29179.botics.co" site_params = { "name": "Purple Surf", } if custom_domain: site_params["domain"] = custom_domain Site.objects.update_or_...
the-stack_106_17932
# -*- coding: utf-8 -*- import re import requests from bs4 import BeautifulSoup import jieba.posseg as pseg import matplotlib.pyplot as plt from wordcloud import WordCloud,ImageColorGenerator from PIL import Image import numpy as np HEADERS = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/5...
the-stack_106_17934
import pyclassifiers.values import config.general import config.helpers project_github_username = "veltzer" project_name = "pyapt" github_repo_name = project_name project_website = f"https://{project_github_username}.github.io/{project_name}" project_website_source = f"https://github.com/{project_github_username}/{pro...
the-stack_106_17935
import heapq import itertools from abc import ABC, abstractmethod from collections import defaultdict from operator import itemgetter from typing import List, Dict, Tuple from typing import Sequence import numpy as np import torch from bert_score import BERTScorer from nltk import PorterStemmer from spacy.tokens impor...
the-stack_106_17936
def extractHomescribbleMybluemixNet(item): ''' Parser for 'homescribble.mybluemix.net' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Great Tang Idyll Translations', 'Great Tang Idyll', ...
the-stack_106_17937
#!/usr/bin/env python # # Electrum - lightweight Futurocoin client # Copyright (C) 2011 Thomas Voegtlin # # 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 with...
the-stack_106_17938
import threading import datetime import PySimpleGUIQt as sg from PySimpleGUIQt.PySimpleGUIQt import ( BUTTON_TYPE_BROWSE_FILE, BUTTON_TYPE_BROWSE_FILES, BUTTON_TYPE_SAVEAS_FILE, BUTTON_TYPE_BROWSE_FOLDER, POPUP_BUTTONS_NO_BUTTONS, WIN_CLOSED, ) from toolbox_creator.globe_icon import globe_icon f...
the-stack_106_17939
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models, _ from odoo.exceptions import AccessError class Digest(models.Model): _inherit = 'digest.digest' kpi_crm_lead_created = fields.Boolean('New Leads/Opportunities') kpi_c...
the-stack_106_17940
# Copyright 2020 The dm_control Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
the-stack_106_17941
import random import numpy as np import math import torch from .video import CenterCropVideo, ToTensorVideo, NormalizeVideo, RandomHorizontalFlipVideo, BinarizeVideo, ColorJitterVideo from .audio import AmplitudeToDB from .landmarks import RandomHorizontalFlipLandmarks class CutMix(object): def __init__(self, p=0...
the-stack_106_17942
import logging import os import numpy as np import rasterio from rasterio.crs import CRS from rasterio.features import rasterize from rasterio.warp import calculate_default_transform from rasterio.windows import bounds from satlomasproc.chips.utils import ( rescale_intensity, sliding_windows, write_chips_g...
the-stack_106_17943
# coding=utf-8 # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. from google.protobuf.json_format import MessageToJson, Parse from dc.generated import dc_pb2 from dc.core.misc import logger from dc.core.State import State from dc.c...
the-stack_106_17944
# 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 appli...
the-stack_106_17946
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import numpy as np import sys import time from typing import Any, Callable, Dict, List def timeit( num_iters: int = -1, warmup_iters: int = 0 ) -> Callable[[], Callable[[], Dict[str, float]]]: """ This is inten...
the-stack_106_17947
# -*- coding: utf-8 -*- # This file is part of hoa-utils. # # hoa-utils is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # hoa-utils i...
the-stack_106_17949
from django.urls import path from .views import groups, not_joined, join_group, detail_group_user, detail_group_wordwall, create_post, list_posts, detail_post, comment_like, user_detail app_name = 'share' urlpatterns = [ path('groups', groups, name='groups'), path('notjoined', not_joined, name='not_joined'), ...
the-stack_106_17950
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 University of Southern California # # 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/...
the-stack_106_17951
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018 Guenter Bartsch # # 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 ...
the-stack_106_17953
from __future__ import print_function import mxnet as mx import logging import os import time def _get_lr_scheduler(args, adv=False): lr = args.adv_lr if adv else args.lr lr_factor = args.adv_lr_factor if adv and args.adv_lr_factor else args.lr_factor lr_step_epochs = args.adv_lr_step_epochs if adv and arg...
the-stack_106_17954
from baseline.utils import exporter from baseline.model import register_decoder, register_arc_policy, create_seq2seq_arc_policy from baseline.tf.embeddings import * from baseline.tf.seq2seq.encoders import TransformerEncoderOutput from functools import partial __all__ = [] export = exporter(__all__) class ArcPolicy...
the-stack_106_17955
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
the-stack_106_17957
# -*- coding: utf-8 -*- # # Copyright (c) 2016 NORDUnet A/S # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # ...
the-stack_106_17958
""" This script focuses cleaning and applying topic modeling (LDA) articles extracted from https://www.uberpeople.net/forums/Complaints/ """ # %% load libraries # --+ basic import os import numpy as np import pandas as pd from pprint import pprint as pp from datetime import datetime # --+ data manipulation import re i...
the-stack_106_17960
import logging import os import uuid import test_infra.utils as infra_utils from distutils import util from pathlib import Path import pytest from test_infra import assisted_service_api, consts, utils qe_env = False def is_qe_env(): return os.environ.get('NODE_ENV') == 'QE_VM' def _get_cluster_name(): clus...
the-stack_106_17961
import os import glob import ntpath import subprocess import re import shlex import argparse from os.path import join parser = argparse.ArgumentParser(description='Log file evaluator.') parser.add_argument('-f', '--folder-path', type=str, default=None, help='The folder with logfiles of models to evaluate.') parser.ad...
the-stack_106_17962
# This code is part of Qiskit. # # (C) Copyright IBM 2020, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
the-stack_106_17963
""" Process raw qstr file and output qstr data with length, hash and data bytes. This script works with Python 2.7, 3.3 and 3.4. For documentation about the format of compressed translated strings, see supervisor/shared/translate.h """ from __future__ import print_function import re import sys import collections i...
the-stack_106_17964
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2014 Alex Forencich 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 without limitation the righ...
the-stack_106_17965
from subprocess import Popen, PIPE import subprocess import os from datetime import datetime import time podpackages = [ 'AWSCore.podspec', 'AWSAPIGateway.podspec', 'AWSAutoScaling.podspec', 'AWSCloudWatch.podspec', 'AWSCognito.podspec', ...
the-stack_106_17966
# Copyright 2018 Owkin, 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,...
the-stack_106_17968
#!/usr/bin/env python # -*- coding: utf-8 -*- # %% 加载基础库 import configparser import os import sys cur_dir = os.path.split(os.path.abspath(sys.argv[0]))[0] #conf_path = os.path.join(cur_dir, 'config.ini') conf_path = os.path.abspath(r'F:\gitee\knowledge\Python\yys_script\src\conf\config.ini') # %% 打开config文件,要以utf-8的...
the-stack_106_17969
import argparse import math import os import subprocess import time import traceback from datetime import datetime import tensorflow as tf from datasets.datafeeder import DataFeeder from hparams import hparams, hparams_debug_string from models import create_model from text import sequence_to_text from util import aud...
the-stack_106_17970
import gomaps, time if __name__ == "__main__": t0 = time.process_time() results = gomaps.maps_search("Tops Diner, NJ") print(results) values = results[0].get_values() for val in values.values(): print(val) assert val != None and val != {}, "Gomaps results missing values!" results = gomap...
the-stack_106_17971
# This program takes an image using L1_camera, applies filters with openCV, and returns # a color target if located in the image. The target parameters are (x,y,radius). # This program requires that opencv2 is installed for python3. """ ************************************************************************...
the-stack_106_17972
from dataclasses import dataclass, field from typing import List from xsdata.models.datatype import XmlPeriod __NAMESPACE__ = "NISTSchema-SV-IV-list-gDay-maxLength-1-NS" @dataclass class NistschemaSvIvListGDayMaxLength1: class Meta: name = "NISTSchema-SV-IV-list-gDay-maxLength-1" namespace = "NIS...
the-stack_106_17973
#!/usr/bin/env python3 # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 __copyright__ = ('Copyright Amazon.com, Inc. or its affiliates. ' 'All Rights Reserved.') __version__ = '2.7.1' __license__ = 'MIT-0' __author__ = 'Akihiro Nakajima' __url__ = 'h...
the-stack_106_17974
from django.db import models from Crypto.Util import number from django.contrib.auth.models import AbstractUser from django.utils import timezone import random # Create your models here. def get_semester(): now = timezone.now() if now.month in (9,10,11,12,1,2): # Fall semester return '{}-{}-1'....
the-stack_106_17977
# SPDX-FileCopyrightText: 2020 The Magma Authors. # SPDX-FileCopyrightText: 2022 Open Networking Foundation <support@opennetworking.org> # # SPDX-License-Identifier: BSD-3-Clause import unittest import unittest.mock import metrics_pb2 from common import metrics_export from orc8r.protos import metricsd_pb2 from promet...
the-stack_106_17978
#!/usr/bin/env python # Copyright 2012-2013 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/ # # o...
the-stack_106_17979
# !/usr/bin/env python3 # -*- config: utf-8 -*- # Ваиант 10. В списке, состоящем из вещественных элементов, вычислить: # 1) номер минимального по модулю элемента списка; # 2) сумму модулей элементов списка, расположенных после первого отрицательного элемента. # Сжать список, удалив из него все элементы, величина котор...
the-stack_106_17980
''' This module implements :class:`AnalogSignal`, an array of analog signals. :class:`AnalogSignal` inherits from :class:`basesignal.BaseSignal` which derives from :class:`BaseNeo`, and from :class:`quantites.Quantity`which in turn inherits from :class:`numpy.array`. Inheritance from :class:`numpy.array` is explained...
the-stack_106_17984
from typing import Callable, Tuple, Union import numpy as np from emukit.core.acquisition import Acquisition from emukit.core.interfaces import IModel, IPriorHyperparameters class IntegratedHyperParameterAcquisition(Acquisition): """ This acquisition class provides functionality for integrating any acquisit...
the-stack_106_17986
import pytest import logging from os import path from logging.config import dictConfig CURRENT_DIR = path.dirname(__file__) def full_path(file: str) -> str: return path.join(CURRENT_DIR, file) @pytest.fixture(scope='session', autouse=True) def set_base_test_logger(): LOGGING = { 'version': 1, ...
the-stack_106_17988
import logging import sentry_sdk from sentry_sdk.integrations.django import DjangoIntegration from sentry_sdk.integrations.logging import LoggingIntegration from .base import * # noqa from .base import env # GENERAL # ------------------------------------------------------------------------------ # https://docs.dja...
the-stack_106_17994
## # @filename : main.cpp # @brief : 2.9inch e-paper display (B) demo # @author : Yehui from Waveshare # # Copyright (C) Waveshare July 24 2017 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documnetation files (the "So...
the-stack_106_17996
# Standard library imports import sys # Third party imports import serial # Adafruit package imports from adafruit_fingerprint import AdafruitFingerprint from adafruit_fingerprint.responses import * def main(): # Attempt to connect to serial port try: port = '/dev/ttyUSB0' # USB TTL converter port ...
the-stack_106_17997
"""Test runner runs a TFJob test.""" import argparse import datetime import httplib import logging import json import os import time import uuid from kubernetes import client as k8s_client from kubernetes.client import rest from google.cloud import storage # pylint: disable=no-name-in-module from py import test_uti...
the-stack_106_17998
import mmcv import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from mmdet.core import bbox2roi, matrix_nms, multi_apply from ..builder import HEADS, build_loss INF = 1e8 from scipy import ndimage def points_nms(heat, ke...
the-stack_106_17999
#!/usr/bin/python # # this script attempts to turn doc comment attributes (#[doc = "..."]) # into sugared-doc-comments (/** ... */ and /// ...) # # it sugarises all .rs/.rc files underneath the working directory # import sys, os, fnmatch, re DOC_PATTERN = '^(?P<indent>[\\t ]*)#\\[(\\s*)doc(\\s*)=' + \ ...
the-stack_106_18000
""" Contains tests to test the Status class, which is responsible for storing a NAGIOS exit status and corresponding message """ import pytest from pynagios.status import Status class TestStatus(object): def test_status_comparison(self): """ Tests __cmp__ operator of Status class """ ...
the-stack_106_18001
# clean_lambda_functions.py # Package Imports import boto3 from botocore.exceptions import ClientError # Module Imports import helpers # Cleaner Settings RESOURCE_NAME = "Lambda Function" WHITELIST_NAME = "lambda_functions" BOTO3_NAME = "lambda" BOTO3_LIST_FUNCTION = "list_functions" def clean_lambda_functions() -...
the-stack_106_18002
import os; import shutil; import datetime as dt; import xlsxwriter as xl; alf = ("D", "E", "F", "G", "H", "I", "J", "K"); nameWorkDir = "./datasets/"; nameDataFile = "./data.xlsx"; if os. path. exists (nameWorkDir) != True: os. mkdir (nameWorkDir, 0o777); def createWorkBook (): dis = { "A1": "date time", ...
the-stack_106_18003
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown Copyright 2017-2019 Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions a...
the-stack_106_18004
""" Copyright 2016-2017 Ellation, 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, sof...