text stringlengths 2 999k |
|---|
import os
import sys
import json
import matplotlib.pyplot as plt
import numpy as np
import pint
from pathlib import Path
sys.path.append(os.path.abspath("../../.."))
from pycato import *
two_pi = (2 * np.pi) * ureg("radian")
# Read grid specs from a json file
with open("grid_spec.json", "r") as f:
grid = json.lo... |
import jwt
import datetime
from django.utils.timezone import now
from django.conf import settings
from django.contrib.auth.models import (
AbstractBaseUser, BaseUserManager, PermissionsMixin
)
from django.db import models
class UserManager(BaseUserManager):
"""
Django requires that custom users define th... |
# Copyright (c) 2015-2017 Blizzard Entertainment
#
# 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 rights
# to use, copy, modify, merge, ... |
# -*- coding: utf-8 -*-
# Copyright CERN since 2012
#
# 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 ... |
import connexion
import six
from openapi_server import util
def encounter_condition_list(limit=None, offset=None): # noqa: E501
"""encounter_condition_list
# noqa: E501
:param limit:
:type limit: int
:param offset:
:type offset: int
:rtype: str
"""
return 'do some magic!'
... |
'''import pygame
faça um programa em python que abra e reproduza
o áudio de um arquivo mp3.''' |
from github.content.codeofconduct import *
from github.content.codeofconduct import __all__ as _codeofconduct__all__
__all__ = [
*_codeofconduct__all__,
]
|
# -*- coding: utf-8 -*-
from maya import cmds # noqa
import pyblish.api
from pprint import pformat
class CollectUnrealStaticMesh(pyblish.api.InstancePlugin):
"""Collect Unreal Static Mesh."""
order = pyblish.api.CollectorOrder + 0.2
label = "Collect Unreal Static Meshes"
families = ["staticMesh"]
... |
# -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
|
#dash
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
#import plots
import geo
#import base64
import os
import flask
import pathlib
import helper # local
import random
#import sqlite3
import base64
#from test_scripts import firstRow, secon... |
# Copyright 2020 Makani Technologies 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... |
from __future__ import unicode_literals
import datetime
import re
import ttfw_idf
from tiny_test_fw import Utility
@ttfw_idf.idf_example_test(env_tag='Example_WIFI_Protocols')
def test_examples_sntp(env, extra_data):
dut = env.get_dut('sntp', 'examples/protocols/sntp')
dut.start_app()
dut.expect_all('... |
from __future__ import absolute_import
import os
from .genericValidation import GenericValidation, GenericValidationData
from .geometryComparison import GeometryComparison
from .helperFunctions import boolfromstring, getCommandOutput2, parsecolor, parsestyle
from .monteCarloValidation import MonteCarloValidation
from .... |
"""
Copyright (c) 2021 Mbadiwe Nnaemeka Ronald ron2tele@gmail.com
This software is provided 'as-is', without any express or implied
warranty. In no event will the author be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for an... |
# Monocyte - Search and Destroy unwanted AWS Resources relentlessly.
# Copyright 2015 Immobilien Scout GmbH
#
# 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/licens... |
from work_tracker import *
members = {}#enter details key should be id or name, value should be email address
get_tasks(members)
|
# -*- coding: utf-8 -*-
# @Time : 2020/6/1 10:19
# @Author : 司云中
# @File : payment_api.py
# @Software: PyCharm
import time
from alipay import AliPay
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
from rest_framewo... |
import pytesseract
import cv2
import matplotlib.pyplot as plt
from PIL import Image
from flask import request
from pytesseract import Output
from werkzeug.utils import secure_filename
import base64
import os
import json
import pickle
# from BackgroundRemoval import processImage
import shutil
from TokenManagement import... |
# coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... |
# -*- coding: utf-8 -*-
import warnings
from functools import partial
from typing import cast
from kartothek.core.docs import default_docs
from kartothek.core.factory import _ensure_factory
from kartothek.core.naming import (
DEFAULT_METADATA_STORAGE_FORMAT,
DEFAULT_METADATA_VERSION,
)
from kartothek.core.uui... |
from rest_framework.response import Response
from Lib.api import data_return
from Lib.baseview import BaseView
from Lib.configs import *
from Lib.log import logger
from PostLateral.Handle.credential import Credential
from PostLateral.Handle.portservice import PortService
from PostLateral.Handle.vulnerability import Vu... |
# -*- coding: utf-8 -*-
from .. import models
from .generic import AllMixin, GetByIdMixin, Manager, SyncMixin
class ItemsManager(Manager, AllMixin, GetByIdMixin, SyncMixin):
state_name = "items"
object_type = "item"
def add(self, content, **kwargs):
"""
Creates a local item object.
... |
# Roller coaster company project
# Requirements 1:
# Height to ride roller coaster: 120 cm
# Age and ticker price (Age above 18 $12 | Age below 18 $7)
print("Welcome to the roller coaster\n")
height = int(input("What is your height:\n"))
if height >= 120:
print("You are allowed to ride!!")
age = int(input(... |
"""BurnOut.
Usage:
docs.py [(<name1>|<name2>)] <name3>...
docs.py mov <name1> <name2>
docs.py (--h|--q) [<name1> -l]
docs.py --version
Options:
-h --help Show this screen.
--version Show version.
"""
from docopt import docopt
if __name__ == '__main__':
arguments = docopt(... |
# -*- coding: utf-8 -*-
# Copyright 2022 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... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lognxin.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
"""
Copyright 2021 BlazeMeter 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, software... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import pandas as pd
import numpy as np
from statsmodels.tools import categorical
# https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.ExtraTreesClassifier.html
from sklearn.ensemble import Extr... |
# Joystick ornegidir
# joystick ESP
# GND GND
# 5V 3V
# VRX 34
# VRY 35
# SW 32
# https://docs.micropython.org/en/latest/esp32/quickref.html
# p4 = Pin(4, Pin.IN, Pin.PULL_UP) # enable internal pull-up resistor
JOYSTICK_XPIN = 34
JOYSTICK_YPIN = 35
JOYSTICK_SWPIN =32
BUZZE... |
from __future__ import absolute_import
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import regression_model |
# 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)
from spack import *
class PyCrossmap(PythonPackage, SourceforgePackage):
"""CrossMap is a program for convenient con... |
# MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# 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 rights
# ... |
# Copyright 2016 Google Inc. 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 applicable law or ag... |
import unittest
from asq.queryables import Queryable
__author__ = "Sixty North"
class TestAverage(unittest.TestCase):
def test_average(self):
a = [5, 7, -3, 2, 1, 9, 3, 2, 1, -8, 3]
b = Queryable(a).average()
self.assertEqual(b, 2)
def test_average_selector(self):
a = [5, 7,... |
# ATTENTION: the tests are supposed to be run inside a container!
# all dependencies have to be installed before running the tests by `./entrypoint install -n benchmark_name`
from .abstract_test import BuildAndRun, INPUT_PATH
from .abstract_acceptance_test import Acceptance
import sys
import logging
import unittest
c... |
#!/usr/bin/env python
# coding=utf-8
# aeneas is a Python/C library and a set of tools
# to automagically synchronize audio and text (aka forced alignment)
#
# Copyright (C) 2012-2013, Alberto Pettarin (www.albertopettarin.it)
# Copyright (C) 2013-2015, ReadBeyond Srl (www.readbeyond.it)
# Copyright (C) 2015-2017, A... |
"""
This file contains the different custom test classes used to generalize the unit testing of cornflow.
"""
# Import from libraries
import logging as log
from datetime import datetime, timedelta
from flask import current_app
from flask_testing import TestCase
import json
import jwt
from unittest.mock import patch, M... |
from pathlib import Path
from hunter.config import load_config_from
from hunter.test_config import GraphiteTestConfig, CsvTestConfig
def test_load_graphite_tests():
config = load_config_from(Path("tests/resources/sample_config.yaml"))
tests = config.tests
assert len(tests) == 4
test = tests["remote1"... |
# -*- coding:utf-8 -*-
"""
status: OK (02-19-2018)
"""
from sikuli import * # sikuli features
import specscontext # context -> add src in path
import path_utils, generate # test import from src
import Browser, Chrome # test import from objects
# DO YOUR STUFF
|
# Copyright 2018 Google Inc. 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 applicable law or a... |
# formulae for hot wind computations
#
# Panagia & Felli 1975 / Wright & Barlow 1975:
from agpy.constants import *
from numpy import log10,exp,log
def mdot(snu, nu=10, Te=1e4, vinf=2000, mue=1.3, d=1):
"""
[snu] = mJy
nu = 10 GHz (frequency)
Te = 10^4 K (ionized gas temp)
vinf = 2000 km/s (maximum ... |
def control():
d = {"control": {
"startyear": 2020,
"startmonth": 1,
"duration": 365,
"dt": 86400, # duration of a time step in seconds, here: 1 day
"simhandle": "misoenrichment tutorial file",
}
}
return d
|
__author__ = 'Rens Holmer'
__version__ = '0.0.19'
from .tree import ( # noqa
Tree,
calculate_tree_layout,
treeplot,
)
from .sequence import ( # noqa
Alphabet,
alphabets,
Sequence,
SequenceReader,
AbstractSequenceCollection,
SequenceCollection,
MultipleSequenceAlignment,
Se... |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import logging as log
from openvino.tools.mo.graph.graph import Graph
from openvino.tools.mo.utils.model_analysis import AnalyzeAction
class InputsAnalysis(AnalyzeAction):
"""
The analyser gets information about model inputs a... |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Federico Ficarelli
#
# 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 typing import Any
from typing import Mapping
from amocrm_api_client.make_json_request import MakeJsonRequestFunctionImpl
from .StandardTokenProvider import StandardTokenProvider
from .StandardTokenProviderConfig import StandardTokenProviderConfig
from ..GetTokensByAuthCodeFunction import GetTokensByAuthCodeFunct... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from .recon import request, uparse, isaws
import requests, os, sys
from bs4 import BeautifulSoup
if any(x in sys.platform.lower() for x in ['linux', 'linux2', 'win32']): # hotfix/issue#5
os.system('color')
# Group of Different functions for different styles
cla... |
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from django.contrib.auth import login
from .models import User
class MySocialAccountAdapter(DefaultSocialAccountAdapter):
def pre_social_login(self, request, sociallogin):
user = sociallogin.user
if user.id:
return
... |
# -*- coding: cp1252 -*-
#
# This file is part of Zhockon Platform project.
#
# Copyright (C) 2009 William Oliveira de Lagos <williamx64@gmail.com>
# Copyright (C) 2003 Nilo Menezes <nilo@nilo.pro.br>
#
# Zhockon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Pu... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
from clint.textui import colored
text = 'THIS TEXT IS COLORED %s!'
if __name__ == '__main__':
for color in colored.COLORS:
print(getattr(colored, color)(text % col... |
#!/usr/bin/env python
import os
import subprocess
from config import Config
from flask_migrate import Migrate, MigrateCommand
from flask_script import Manager, Shell
from redis import Redis
from rq import Connection, Queue, Worker
from apscheduler.schedulers.background import BackgroundScheduler
from datetime import d... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#author:小光
#refer:http://www.wooyun.org/bugs/wooyun-2015-0146463
import re
import time
def assign(service, arg):
if service == "strongsoft":
return True, arg
def audit(arg):
payload = 'Disaster/Reporting/ReportingDe... |
from os import path
import random
srcPath = ""
if __name__ == "__main__":
srcPath = "../"
def fileExist(thisPath):
if not path.exists(thisPath):
with open(thisPath, "w") as f:
f.write("")
def isAdmin(idUser) -> bool:
file_path = srcPath+"AdminUsers.txt"
fileExist(file_path)
... |
#coding:utf-8
#
# id: bugs.core_3052
# title: Wrong resultset
# decription: Empty rowset when selecting from table with compound index on PXW_HUNDC-collated fields
# tracker_id: CORE-3052
# min_versions: ['3.0']
# versions: 3.0
# qmid: None
import pytest
from firebird.qa import db_fact... |
"""
Download datasets for testing
"""
# pylint: disable=C0116
import os
import subprocess
# Paths
test_path = os.path.dirname(__file__)
data_path = os.path.join(test_path, "data")
# Download data
tar_path = os.path.join(test_path, "cf-tools-data.tar.gz")
URL = "https://ndownloader.figshare.com/files/27249593"
def p... |
from datetime import timedelta
import pytest
from django.core import mail as djmail
from django.utils.timezone import now
from pretalx.mail.models import QueuedMail
from pretalx.schedule.models import Schedule, TalkSlot
from pretalx.submission.models import Submission
@pytest.mark.django_db
def test_copy_to_schedul... |
#print "Hello world."
# this is a comment
#print "this is Alison"
#Create var with twitter handle
twitter = "@alisonjo2786"
#Output twitter handle to screen
#print twitter
#print len(twitter)
print twitter[0]
print twitter[1:5]
##list_of_lessons = """Lesson\t\tTopic
##1\t\tStrings and Conditionals
##2\t\tLists and ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-11-07 01:22
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... |
import numpy as np
IDENTITY = 0
SUBDOMAIN = 1
POINT = 2
observables_dict = {"identity": IDENTITY, "id": IDENTITY, "subdomain": SUBDOMAIN, "point": POINT}
def observables_factory(obs_name):
if observables_dict[obs_name]==IDENTITY:
return identity
elif observables_dict[obs_name]==SUBDOMAIN:
ret... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... |
"""The tests for the Home Assistant HTTP component."""
from datetime import timedelta
from http import HTTPStatus
from ipaddress import ip_network
import logging
import pathlib
from unittest.mock import Mock, patch
import pytest
import homeassistant.components.http as http
from homeassistant.helpers.network import No... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "geo2.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... |
"""Some miscellaneous utility functions."""
from __future__ import division
import os
import sys
import warnings
from six import string_types
from collections import Iterable
import numbers
import numpy as np
def warn_deprecation(msg):
"""
Raise a warning and prints a deprecation message to stdout.
Pa... |
"""Time Log [Timecard]
Author(s): Jason C. McDonald
Manages access, storage, and file read/write for the time log.
Also contains the class representing a single time log entry.
"""
from datetime import datetime
import functools
import logging
import os
from timecard.data.settings import Settings
def timelog_getter... |
# -*- coding: utf-8 -*-
from __future__ import division
import logging
import collections
import ast
import _ast
import string
import numpy as np
import math
import sys
import six
import copy
import difflib
if hasattr(_ast, 'Num'):
ast_Num = _ast.Num
ast_Str = _ast.Str
else: # Python3.8
ast_Num = _ast.Co... |
# -*- coding: utf-8 -*-
import pytest
from formasaurus.html import (
html_tostring,
html_escape,
remove_by_xpath,
load_html,
html_tostring,
get_forms,
get_cleaned_form_html,
get_field_names,
get_fields_to_annotate,
escaped_with_field_highlighted,
highlight_fields,
add_te... |
"""
The Euclidean algorithm implemented in python!
Author: Alek Frohlich, Date: 10/07/2019.
"""
def gcd(u, v):
return gcd(v, u % v) if v else abs(u)
if __name__ == '__main__':
while True:
u, v = map(int, input().split())
print(" ".join(list(map(str, [u, v, gcd(u,v)]))))
|
__author__ = 'nthmost'
__doc__ = '''metapub.PubMedFetcher -- tools to deal with NCBI's E-utilities interface to PubMed'''
from lxml import etree
import requests
import eutils
import logging
from .eutils_common import get_eutils_client
from .cache_utils import get_cache_path
from .pubmedarticle import PubMedArticle
f... |
#################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... |
"""Tools for plotting spectra."""
import matplotlib.pyplot as plt
import numpy as np
from uncertainties import unumpy
import warnings
class PlottingError(Exception):
"""General exception for plotting.py"""
pass
class SpectrumPlotter:
"""Class for handling spectrum plotting."""
def __init__(self, ... |
# -*- coding: utf-8 -*-
# Modify:Joe-BU
import sys
sys.path.append("/data/buzehao/weather_output20/src/")
from sparnn.iterators import DataIterator
import numpy as np
from utils import *
from mylog import mylog as lg
import theano
from settings import *
class WeatherIterator(DataIterator):
def __init__(self, ite... |
"""Demonstrates Shor's algorithm.
Shor's algorithm [1] is a quantum algorithm for integer factorization. Given
a composite integer n, it finds its non-trivial factor d, i.e. a factor other
than 1 or n.
The algorithm consists of two parts: quantum order-finding subroutine and
classical probabilistic reduction of the f... |
import sys
sys.path.append("../../..")
from Fase1.storage.storageManager import jsonMode
from Fase1.storage import avlMode
from Fase1.analizer.typechecker.Metadata import Struct
from Fase1.analizer.typechecker import Checker
from Fase1.analizer.reports import Nodo
from Fase1.analizer.abstract import instruction
... |
# Copyright (c) 2014-2017 esotericnonsense (Daniel Edgecumbe)
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/licenses/mit-license.php
import datetime
# import math
import curses
import asyncio
# from decimal import Decimal
import view
from util import isofo... |
# 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 ... |
# import key libraries
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from wordcloud import WordCloud, STOPWORDS
import nltk
import re
from nltk.stem import PorterStemmer, WordNetLemmatizer
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize,... |
from django.contrib import auth
from django.shortcuts import redirect
from django.views.generic import FormView
from django.utils.http import is_safe_url
from .forms import WebmailLoginForm
class WebmailLoginView(FormView):
"""
View class which handles User authentication.
It works as follows:
* Ren... |
from tensorflow.keras.models import load_model
from kerasify import export_model
model = load_model('tiny-yolo.h5')
export_model(model, 'output.model')
|
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 3
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from isi_sdk_8_0.models.cloud_acc... |
class AnimationClock(Clock):
""" Maintains the run-time state of an System.Windows.Media.Animation.AnimationTimeline and processes its output values. """
def GetCurrentValue(self,defaultOriginValue,defaultDestinationValue):
"""
GetCurrentValue(self: AnimationClock,defaultOriginValue: object,defaultDestination... |
def f():
a = "def f():\n a = %r\n print(a %% a)\n\n\nif __name__ == '__main__':\n f()"
print(a % a)
if __name__ == '__main__':
f()
|
import random
import json
def index():
return dict(message=T('Welcome to our Crowd Sourcing Platform!'))
#@auth.requires_login()
def get_sentence():
return "bla"
#@auth.requires_login()
def tutorial():
return dict()
def getAnnotation(data):
session.data = data
ret = "<p>"
words = data['sent... |
# 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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
last mod 2/1/19 adding some common functions
+x is up, +y is left
reference is bottom center, unlike prototype which is center center
"""
from math import pi, tan, cos, sin
import numpy as np
import cv2
#from matplotlib.cm import ScalarMappable
#from matplotlib.colors... |
"""
This adds, for every HTTP URL, the HTTPS counterpart,
and vice versa, to config.urls
So it doesn't actually perform tests. It only expands the
URLs to test by other checks.
"""
from checks.abstract_checker import AbstractChecker
class Checker(AbstractChecker):
def __init__(self, config, previous_results=None... |
# -*- coding: utf-8 -*-
# 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,... |
from copy import copy
from django.utils.module_loading import import_by_path
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford to leave
# this to human erro... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** 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... |
# Version 1.0
# Python 3
import json
import sys
import os
import codecs
from tqdm import tqdm
from trecweb_utils import merge_passages
from passage_chunker import SpacyPassageChunker
def get_document(data, dup_dict):
"""Extracts the ID, title, url, and body of each document
Args:
data (dictionary):... |
# =============================================================================
#
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from django.apps import AppConfig
class IgclonedConfig(AppConfig):
name = 'igcloned'
|
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
from pyBN.learning.parameter.bayes import *
from pyBN.learning.parameter.mle import * |
import os
import numpy as np
# because of a bug in healpy, pylab must be imported before healpy is
# or else a segmentation fault can result.
import pylab as pl
from . import get_data_home
from .tools import download_with_progress_bar
DATA_URL = ('http://lambda.gsfc.nasa.gov/data/map/dr4/'
'skymaps/7yr/r... |
def f(x):
if x:
return True
elif 0:
return 1
else:
return f(x)
return f(2)
|
# -*- coding: utf-8 -*-
# Copyright 2012 Mats Ekberg
#
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlite3
from collections import namedtuple
Schedule = namedtuple('Schedule', ['start', 'end', 'type'])
Slot = namedtuple('Slot', ['track', 'room', 'name', 'speakers', 'url', 'language', 'tags'])
SCHEDULE_SQL = '''
select distinct start, end, type
... |
# Copyright 2013-2022 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 tempfile
from spack.package import *
class PyTensorboard(Package):
"""TensorBoard is a suite of web applicat... |
"""The tests for the Owntracks device tracker."""
import json
from asynctest import patch
import pytest
from tests.common import (
async_fire_mqtt_message, mock_coro, mock_component,
async_mock_mqtt_component, MockConfigEntry)
from homeassistant.components import owntracks
from homeassistant.setup import async... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.