text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
import networkx
from raiden.utils import isaddress
def make_graph(edge_list):
""" Return a graph that represents the connections among the netting
contracts.
Args:
edge_list (List[(address1, address2)]): All the channels that compose
the graph.
Returns:
... |
import fbrp
fbrp.process(
name="proc",
runtime=fbrp.Conda(
channels=[
"conda-forge",
"robostack",
],
dependencies=[
"python>=3.7",
"ros-common-msgs",
],
run_command=["python", "proc.py"],
),
)
fbrp.main()
|
# -*- coding: UTF-8 -*-
from __future__ import unicode_literals
import json
import re
from . import _util
from ._exception import FBchatException
# Shameless copy from https://stackoverflow.com/a/8730674
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
WHITESPACE = re.compile(r"[ \t\n\r]*", FLAGS)
class C... |
import re
import dash_html_components as html
import dash_core_components as dcc
import dash_cytoscape as cyto
def component_doc(component):
trimmed_docs = re.sub(
r'- setProps.*\n',
'',
re.sub(
r'Available events: .*',
'',
component.__doc__.split('Keywo... |
import argparse
import os
import pickle
import zipfile
import pandas as pd
import numpy as np
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
from utils import remove_linebreak,remove_mafft_train,fasta_to_numpy,read_embedding_matrix
parser = arg... |
# coding=utf-8
# Copyright 2017-2019 The THUMT Authors
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import tensorflow as tf
import thumt.interface as interface
import thumt.layers as layers
import thumt.utils.getter as getter
def _layer_p... |
# coding: utf-8
"""
IriusRisk API
Products API # noqa: E501
OpenAPI spec version: 1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class CategoryComponent(object):
"""NOTE: This class is auto generated by the swagge... |
#! /usr/bin/env python
# Copyright 2017 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.
from devil import base_error
from devil import devil_env
from devil.android import apk_helper
from devil.utils import mock_calls
with... |
# -*- coding: utf-8 -*-
from errors import RuntimeException
from attributes import Attribute
from nebbtypes import Type
class Variable:
def __init__(self, name, value, attributes):
self.name = name
self.value = value
self.attributes = attributes
self.assigned = False if value is N... |
"""
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... |
import os
import numpy as np
import torch as T
import torch.nn as nn
import torch.optim as optim
from torch.distributions.categorical import Categorical
class PPOMemory:
def __init__(self, batch_size):
self.states = []
self.probs = []
self.vals = []
self.actions = []
self.r... |
import requests
import socket
import threading
requests.packages.urllib3.disable_warnings() # noqa
class ScanPort:
def __init__(self, target, start_port=None, end_port=None):
self.target = target
self.from_port = start_port
self.to_port = end_port
self.ports = []
... |
from django.apps import AppConfig
class SearchConfig(AppConfig):
name = 'search'
def ready(self):
import search.signals # noqa: F401
|
import os, re
import pickle
import tensorflow as tf
import numpy as np
#import cv2
from os.path import join
import tensorflow.contrib.layers as layers
from tensorflow.contrib.framework import arg_scope
#import skimage as ski
#import skimage.io
import libs.cylib as cylib
import train_helper
import losses
import eval_h... |
from sqlalchemy.orm.attributes import flag_modified
from sqlalchemy_utils.models import generic_repr
from redash.settings.organization import settings as org_settings
from .base import db, Column, primary_key
from .mixins import TimestampMixin
from .types import MutableDict, PseudoJSON
from .users import User, Group
... |
"""
MySQL database backend for Django.
Requires MySQLdb: http://sourceforge.net/projects/mysql-python
"""
from __future__ import unicode_literals
import datetime
import re
import sys
import warnings
try:
import MySQLdb as Database
except ImportError as e:
from django.core.exceptions import ImproperlyConfigur... |
from __future__ import division
import argparse
from os import listdir
from os.path import isfile, join, dirname, realpath, basename
import sys, json
import numpy as np
import math
class norm():
def __init__(self, basefile, samplefile, ntype, output = ''):
base = []
result = []
base = self... |
# -*- 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
def commoncharacters(s1: str, s2: str) -> int:
"""
Number of occurrences of the exactly same characters in exactly same position.
"""
return sum(c1 == c2 for c1, c2 in zip(s1, s2))
def leftcommonsubstring(s1: str, s2: str) -> int:
"""Size of the common start of two strings. "foo", "bar" => 0, "b... |
import pytest
import os
from unittest import mock
from tfx.components.base.base_component import BaseComponent
from fluent_tfx import PipelineDef, \
ExampleInputs, SchemaInputs, HyperParameterInputs
from fluent_tfx.pipeline_def import build_step
from tfx.components.base import executor_spec
from tfx.extensions.g... |
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'main_window.ui'
##
## Created by: Qt User Interface Compiler version 6.0.3
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
###############... |
""" Program for tree-search
Jhonatan da Silva
27/01/2017 """
def main():
treeSearch('California', 'Washington')
def treeSearch(initState,goalState):
path = []
frontier = search(initState, goalState)
while not frontier.isEmpty():
""" checks if state is equal to goal """
if ... |
"""
Copyright 2020 The OneFlow 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 applicable law or agr... |
#!/usr/bin/env python
# coding: utf-8
"""
Created on Wed Oct 27 09:44:29 2021
@author: Jospin Amisi
"""
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
#Gathering data and plotting Total World Cases
get_ipython().run_line_magic('matplotlib', 'inline')
plt.style.use('fivethirtye... |
"""empty message
Revision ID: 275b21a69463
Revises:
Create Date: 2019-08-21 08:19:09.908339
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '275b21a69463'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto gene... |
#!/usr/bin/env python3
import argparse
import sys
import yaml
def gen_network(net, subnet):
return {
net: {
"ipam": {
"driver": "default",
"config": [
{
"subnet": subnet
},
],
... |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "zuessite.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
# -*- coding: utf-8 -*-
# 2, 10, 13, 14, 16, 17, 18, 19, 21, 23, 26, 31, 32, 35
# extra - 27: https://pdfs.semanticscholar.org/3973/ff27eb173412ce532c8684b950f4cd9b0dc8.pdf
##################
# 14 - Write a function novel10(text) that prints any word that appeared in the last 10% of a text that had not been
# encounte... |
"""
Exception Classes for the xdg package
"""
debug = False
class Error(Exception):
def __init__(self, msg):
self.msg = msg
Exception.__init__(self, msg)
def __str__(self):
return self.msg
class ValidationError(Error):
def __init__(self, msg, file):
self.msg = msg
... |
# -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import tensorflow as tf
import argparse
from model.unet import UNet
parser = argparse.ArgumentParser(description='Export generator weights from the checkpoint file')
parser.add_argument('--model_dir', dest='model_dir'... |
import logging
import multiprocessing
import os
from collections import defaultdict
from datetime import datetime
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
from sklearn.model_selection import KFold, StratifiedKFold, RepeatedKFold, RepeatedStratifiedKFold, train_test_split
from .const... |
# This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
"""
File object test module.
Tests all aspe... |
import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass
from typing import Dict, List, Optional, Sequence, Tuple, Union, Callable
from ethgreen.consensus.block_header_validation import validate_finished_header_block
from ethgreen.conse... |
import os
import pytest
from silvera.run import compile
from silvera.utils import get_root_path
@pytest.fixture
def example_path():
example_path = os.path.join(get_root_path(), "tests", "examples",
"schematic")
return example_path
def test_schematic(example_path):
compile... |
import logging
from pylons import config
from pylons.i18n import _
from paste.deploy.converters import asbool
import ckan.new_authz as new_authz
import ckan.lib.plugins as lib_plugins
import ckan.logic as logic
import ckan.rating as ratings
import ckan.plugins as plugins
import ckan.lib.dictization
import ckan.logic.a... |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from tapiriik.settings import DIAG_AUTH_LOGIN_SECRET, DIAG_AUTH_PASSWORD, SITE_VER
from tapiriik.database import *
from tapiriik.sync import Sync
from tapiriik.auth import TOTP, DiagnosticsUser, User
from tapiriik.services.service ... |
"Convenience for testing that an output matches a file"
load("@build_bazel_rules_nodejs//:defs.bzl", "nodejs_binary", "nodejs_test")
def golden_file_test(name, golden, actual, **kwargs):
"""Tests an actual output against a golden output.
Use `golden_debug` if the actual output changes when DEBUG is set.
"""
... |
BBBB BBBBBBBBBBBBBBBBBBBB
BBBB BBBB
XXXX XXXXXXXXXXXXXXX XBB BBBBBBBBBB FFFFBBBBBX
BBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBB BBBBBB BB BBBBBBBBBBBBBBBBBBB
BB BBB BBBBBBBBBBBBXXXX XXXXXXXXXXXXXXBBBBB
XXXXXX XXXXXXXXXX XXXXXXXBB BBBBBBBBBBBBXXXXXXBBBBBXX
XXXXXX XXXXXXXXXX... |
from six.moves import http_client
import re
import requests
try:
from urllib.parse import quote, quote_plus
except ImportError:
from urllib import quote, quote_plus
from pywebhdfs import errors, operations
class PyWebHdfsClient(object):
"""
PyWebHdfsClient is a Python wrapper for the Hadoop WebHDFS ... |
#!/usr/bin/env python
# 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
#
# Authors:
# - Paul Nilsson, paul.nilsson@cern.ch, 2020
import os
# from .... |
# (c) 2005 Ian Bicking and contributors; written for Paste
# (http://pythonpaste.org) Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
#
# Code taken also from QP: http://www.mems-exch... |
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def brojProstihBrojeva(od, do):
""" Vraca broj prostih brojeva izmedju dva zadana broja.
Vraca kod -1 ako je vrijednsot 'od' veca od vrijednsoti 'do'
"""... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'preferences_dialog.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fro... |
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from .serializers import SalaSerializer
from .models import Sala
class CreateView(ListCreateAPIView):
queryset = Sala.objects.all()
serializer_class = SalaSerializer
def perform_create(self, serializer):
"""Salv... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: duration.py
# Purpose: music21 classes for representing durations
#
# Authors: Michael Scott Cuthbert
# Christopher Ariza
#
# Copyright: Copyright © 2008-2019 Michael Scott... |
# -*- coding: utf-8 -*-
import glob
import csv
import tkinter as tk
import pymysql.cursors
def fsync():
root = tk.Tk()
root.geometry("300x100")
entry = tk.Entry()
entry.place(x=20, y=30)
button = tk.Button(text="OK")
button.place(x=150, y=26)
word = ""
def click():
global word
word = e... |
"""HRNet48 with a simple convolution head."""
_base_ = [
"../_base_/models/fcn_hr18.py",
"../_base_/datasets/bdd100k_512x1024.py",
"../_base_/default_runtime.py",
"../_base_/schedules/schedule_40k.py",
]
model = dict(
pretrained="open-mmlab://msra/hrnetv2_w48",
backbone=dict(
extra=dict... |
from flask.cli import cli
import pytest
from flaskr.db import get_db
def test_index(client, auth):
response = client.get('/')
assert b'Log In' in response.data
assert b'Register' in response.data
auth.login()
response = client.get('/')
assert b'Log Out' in response.data
assert b'test titl... |
import socket
import ssl
import sys
import threading
from http.server import HTTPServer
from socketserver import ThreadingMixIn
from . import utils
from .modifier import RequestModifier
from .storage import RequestStorage
class BoundedThreadingMixin(ThreadingMixIn):
"""Mix-in class that allows for a maximum numb... |
class Solution:
# @param {integer[]} nums
# @return {integer}
def maxSubArray(self, nums):
cumnums = [0] + nums
n = len(cumnums)
for i in range(1, n):
cumnums[i] += cumnums[i - 1]
minnum = 0
res = cumnums[1]
for i in range(2, n):
if cu... |
# Module for reading and parsing Scintilla.iface file
import string
def sanitiseLine(line):
if line[-1:] == '\n': line = line[:-1]
if string.find(line, "##") != -1:
line = line[:string.find(line, "##")]
line = string.strip(line)
return line
def decodeFunction(featureVal):
retType, rest = string.split(featureVa... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 21 23:10:35 2020
@author: vik748
"""
from cmtpy.histogram_warping_ace import HistogramWarpingACE
from cmtpy import contrast_measurement as cm
import cv2
import numpy as np
import sys, os
from matplotlib import pyplot as plt
def calculate_best_scree... |
'''
Copyright 2020 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Sun Aug 16 2020
File : registration.py
'''
import sys
import os
import stat
import logging
import argparse
import json
import CodeInsight_RESTAPIs.reports.get_reports
import CodeI... |
#!/usr/bin/env python3
# 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 o... |
from blackbot.core.utils import get_path_in_package
from blackbot.core.wss.atomic import Atomic
from terminaltables import SingleTable
import os
import json
class Atomic(Atomic):
def __init__(self):
self.name = 'Privesc/T1055-2'
self.controller_type = ''
self.external_id = 'T1055'
s... |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
"""
This module contains common code shared by utils/rule_dir_stats.py and
utils/rule_dir_diff.py. This code includes functions for walking the output
of the utils/rule_dir_json.py script, and filtering functions used in both
scripts.
"""
from __future__ import absolute_import
from __future__ import print_function
im... |
from graphql_relay import from_global_id
def global_id_to_model_id(object_id):
if object_id is None:
return None
resolved = from_global_id(object_id)
return resolved[1]
|
import json
import os
from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel, validator
def which(program: str) -> Optional[str]:
"""
Test if program is a file or an executable.
"""
def is_exe(fpath):
return os.path.isfile(
fpath
) # and os.ac... |
#
# Copyright 2015-2020 Andrey Galkin <andrey@futoin.org>
#
# 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 ... |
import structlog
import logging
import argparse
import json
from os import walk
# use ff_utils to find inserts and write data
from dcicutils.ff_utils import search_metadata, expand_es_metadata, dump_results_to_json
# use this function to read inserts
from .run_upgrader_on_inserts import get_inserts
logger = structlog.... |
from functools import update_wrapper
from weakref import WeakSet
from django.apps import apps
from django.contrib.admin import ModelAdmin, actions
from django.contrib.auth import REDIRECT_FIELD_NAME
from django.core.exceptions import ImproperlyConfigured
from django.db.models.base import ModelBase
from django.http imp... |
#!/usr/bin/env python3
# Copyright (c) 2016-2017 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test various net timeouts.
- Create three fujicoind nodes:
no_verack_node - we never send a vera... |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2011 Nathanael C. Fritz, Lance J.T. Stout
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.stanza import Error
from sleekxmpp.xmlstream import register_stanza_plugin
from sleekxmpp.plugins impo... |
from __future__ import absolute_import
import os
from celery import Celery
from django.apps import apps, AppConfig
from django.conf import settings
if not settings.configured:
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'config.settings.l... |
#!/usr/bin/env python
import platform
import sys
NODE_VERSION = 'v0.11.10'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '765ec5dcf192845fed4aec0b117f1e53050911d6'
ARCH = {
'cygwin': '32bit',
'darwin': '64bit',
'linux2': platform.architecture()[... |
from selenium import webdriver
# checking to see if using Selenium can get past JSTOR blocking. It can't
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
options.add_argument('--incognito')
options.add_argument('--headless')
path_to_driver = '/Users/hschilli/anaconda/envs/petal_... |
# Copyright The PyTorch Lightning team.
#
# 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... |
#!/usr/bin/python
# Copyright (c) 2018, Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for detail... |
from __future__ import unicode_literals
import collections
import itertools
import json
import logging
from tornado import gen, ioloop
from .data_watcher import DataWatcher
from .party import Party
from .lock import Lock
from .recipe import Recipe
log = logging.getLogger(__name__)
class Allocator(Recipe):
s... |
#
# Copyright 2021 Splunk 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, so... |
import numpy as np
import unittest
import pytest
import tempfile
pytest.importorskip("stl")
import pysph.tools.geometry_stl as G
from pysph.base.utils import get_particle_array
cube_stl = """solid cube
facet normal 0 0 0
outer loop
vertex 0 0 0
vertex 0 1 0
vertex 1 1 0
endloop
endfacet... |
# -*- coding: utf-8 -*-
"""Internal DSL functions for edges."""
import warnings
from typing import Dict, Optional, Union
from ..constants import (
ACTIVITY,
CELL_SURFACE,
DEGRADATION,
EFFECT,
EXTRACELLULAR,
FROM_LOC,
INTRACELLULAR,
LOCATION,
MODIFIER,
NAME,
NAMESPACE,
... |
# 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 u... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
'''
Author @ Nikesh Bajaj
first created : Date: 22 Oct 2017
Updated on : 29 Apr 2021
: fixed bugs (1) not counting first outbit correctly (2) Exception in info method
: added test properties (1) Balance (2) Runlength... |
import warnings
warnings.filterwarnings('ignore',category=FutureWarning)
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import sys
sys.path.insert(1, 'model/')
from model.FINDER_API import FINDER_API
from py_utils.FINDER_test_utils import *
import argparse
import wandb
def test(api, model_path, test_sets, test_se... |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import numpy as np
from sklearn.utils.validation import check_array
from .._cate_estimator import BaseCateEstimator, LinearCateEstimator
class EnsembleCateEstimator:
""" A CATE estimator that represents a weigh... |
# Generated by Django 2.2.8 on 2019-12-12 15:42
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("interactions", "0003_auto_20190322_1221"),
]
operations = [
migrations.AlterField(
model_name="... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-10-15 14:26
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):
initial = True
dependencies = [
migrations.... |
"""Test Runway config classes."""
# pylint: disable=no-self-use
import logging
import os
from copy import deepcopy
from tempfile import NamedTemporaryFile
import pytest
import yaml
from runway.cfngin.exceptions import UnresolvedVariable
from runway.config import (DeploymentDefinition, FutureDefinition,
... |
#
# The MIT License (MIT)
#
# This file is part of RLScore
#
# Copyright (c) 2014 - 2016 Tapio Pahikkala, Antti Airola
#
# 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, ... |
"""
Tests for dns api
"""
from __future__ import absolute_import, division, unicode_literals
from twisted.trial.unittest import SynchronousTestCase
from mimic.test.helpers import json_request
from mimic.rest.dns_api import DNSApi
from mimic.test.fixtures import APIMockHelper
class DNSTests(SynchronousTestCase):
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
from django.views.generic import TemplateView
urlpatterns = [
url(r'^$', Templ... |
# Copyright 2021 Jared Hendrickson
#
# 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... |
from django import template
register = template.Library()
@register.inclusion_tag('questions/question_card.html')
def question_card(question):
return {
'question': question,
}
|
import numpy as np
from sklearn.base import BaseEstimator
class MinMaxScaleCapper(object):
"""Min max scaler of a one dimensional array
This class min-max normalizes the scores returned from
Anomaly Detection algorithms. Please note sklearn's
MinMaxScaler does not wotk on 1D arrays
"""
def __... |
# Generated by Django 2.1 on 2018-08-06 18:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mpcontroller', '0003_auto_20180806_1748'),
]
operations = [
migrations.RemoveField(
model_name='rasp_device',
name='id... |
from kivy.metrics import sp
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import Screen, ScreenManager
from kivy.uix.scrollview import ScrollView
from fivecalls.config import KivyConfig
from fivecalls.data import Issue
from fivecalls.views.call_view import CallView
from fivecalls.views.controls ... |
import os
class Var(object):
APP_ID = int(os.environ.get("APP_ID", 6))
API_HASH = os.environ.get("API_HASH", "eb06d4abfb49dc3eeb1aeb98ae0f581e")
STRING_SESSION = os.environ.get("STRING_SESSION", None)
DB_URI = os.environ.get("DATABASE_URL", None)
TEMP_DOWNLOAD_DIRECTORY = os.environ.get("TEMP_DOWN... |
#def countdown(start, stop):
# if start < stop:
# print start
# print"done"
# else:
# print start
# countdown(start-1, stop)
#def main():
# start = int(raw_input("start: "))
# stop = int(raw_input("stop: "))
# countdown(start, stop)
#main()
def adder(running_total = 0):
print "The running total is {}".format(run... |
import os
from jina.proto import jina_pb2
from jina.drivers import BaseRecursiveDriver
cur_dir = os.path.dirname(os.path.abspath(__file__))
DOCUMENTS_PER_LEVEL = 1
class AppendOneChunkTwoMatchesCrafter(BaseRecursiveDriver):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... |
#!/usr/bin/env python
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
import json
import time
import docker
import pytest
import connections
import environment
from edgehub_control import (
connect_edgehub,
... |
#!/usr/bin/python
import rospy
from std_srvs.srv import SetBool, SetBoolResponse
import subprocess
import os
import signal
'''
This is the main script for running Tensorflow inference. It a hacky
solution to the problem that tensorflow leaves loaded graphs inside the GPU,
even on 'session.close()'... And only clears it... |
#!/usr/bin/env vpython3
# *-* coding: utf-8 *-*
import binascii
from cryptography.hazmat import backends
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding
from cryptography.hazmat.primitives.serialization import pkcs12
from asn1crypto import x... |
from django.core.files import temp as tempfile
from pipeline.conf import settings
from pipeline.compressors import SubProcessCompressor
class CSSTidyCompressor(SubProcessCompressor):
def compress_css(self, css):
output_file = tempfile.NamedTemporaryFile(suffix='.pipeline')
command = (
... |
import os
import subprocess
import copy
from snsql.sql.privacy import Privacy
import pytest
import numpy as np
import pandas as pd
from pandasql import sqldf
import math
from snsql.metadata import Metadata
from snsql.sql import PrivateReader
from snsql.sql.reader.pandas import PandasReader
git_root_dir = subprocess.... |
# 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 ... |
#############################################################################
#
# 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 -*-
"""
Spyder Editor
This is a temporary script file.
"""
from __future__ import unicode_literals, print_function, division
from io import open
import glob
import os
import torch
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn import tree
from sklearn.metrics... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.