text stringlengths 2 999k |
|---|
from setuptools import setup
import lambda_decorators
long_description = open('README.rst').read()
setup(
name='lambda-decorators',
version=lambda_decorators.__version__,
description='A collection of useful decorators for making AWS Lambda handlers',
long_description=long_description,
url='htt... |
from datetime import date, datetime, time
from typing import Any, List, Optional, Union
import dateutil.parser
from django.forms.utils import from_current_timezone
from django.utils import formats
from django.utils.translation import gettext_lazy as _
from ...scalars import ScalarType
date_input_formats = formats.g... |
# -*- coding: utf-8 -*-
import os
import unittest
from hyperopt import fmin, tpe
from buffalo.misc import aux
from buffalo.algo.als import ALS
from buffalo.misc.log import set_log_level
from buffalo.algo.options import ALSOption
from buffalo.algo.optimize import Optimizable
from buffalo.data.mm import MatrixMarketOpt... |
from django.db import models, transaction
from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.db.models import Q, Count, Max
########################################################... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
#-------------------------------------------------------------------------------
#
# Project: ngEO Browse Server <http://ngeo.eox.at>
# Authors: Fabian Schindler <fabian.schindler@eox.at>
# Marko Locher <marko.locher@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
#
#---------------------------------... |
from selenium import webdriver
from fixture.session import SessionHelper
from fixture.group import GroupHelper
from fixture.contact import ContactHelper
class Application:
def __init__(self, browser, base_url):
if browser == "chrome":
self.wd = webdriver.Chrome(executable_path=r"C:\TestFiles... |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
_SCRIPT_DIR = os.path.dirname(__file__)
_OUTPUT_FILE = os.path.join(_SCRIPT_DIR, 'apkanalyzer.output')
def main():
# Without a pr... |
from copy import deepcopy
from qtpy.QtCore import QAbstractTableModel, Qt
from .utils import str2prop
class ListTableModel(QAbstractTableModel):
"""Model for the QTableView widget. The table should be stored as a 2D List
Based on this tutorial:
https://www.learnpyqt.com/tutorials/qtableview-modelviews-... |
class BasePipeline(object):
"""Main end-point to run the pipeline processes"""
def __init__(self, config):
self.config = config
def initialize_data(self):
""" Initialize dataset: loading, preprocess metadata"""
raise NotImplementedError
def extract_feature(self):
raise... |
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Factory method for easily getting imdbs by name."""
__sets... |
import numpy as np
import pickle
import argparse
import os
from pathlib import Path
import StimSet
from SAILnet import SAILmods
import fitlearners
parser = argparse.ArgumentParser()
parser.add_argument('--learner', default='SAILnet', type=str)
parser.add_argument('-g', '--gain', default=2, type=float)
parser.add_argum... |
# Create alias
from nodenet.trainingsessions.batch import *
from nodenet.trainingsessions.online import *
|
# -*- coding: utf-8 -*-
u"""simulation data operations
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkcollections import PKDict
from pykern.pkdebug import pk... |
import datetime
import re
from email.utils import formataddr
from django.conf import settings
from django.template import loader
from django.utils import translation
from email_reply_parser import EmailReplyParser
import waffle
import olympia.core.logger
from olympia import amo
from olympia.access import acl
from ol... |
import numpy as np
import pandas as pd
import random
# Random point generator with x, y bounds as +- specified value from origin
def rand_point(x_bound, y_bound):
random.seed()
x = random.uniform(-x_bound, x_bound)
y = random.uniform(-y_bound, y_bound)
return (x, y)
# Functions for labelling points
de... |
import csv
import argparse
import numpy as np
import GaussianMixtureRegression as gmr
from sklearn.mixture import GaussianMixture as GM
def main():
epilog=""""
"""""
parser=argparse.ArgumentParser(description='',epilog=epilog)
parser.add_argument('-f','--file',
required=Tru... |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import copy
import inspect
import json
import re
import typing
from collections import defaultdict
from dataclasses import dataclass
from enum import En... |
from flask import Flask
from flask_restful import Api, Resource
app = Flask(__name__)
api = Api(app)
class MessagesList(Resource):
def get(self):
return [
{"id": 1, "message": "Hello world!"},
{"id": 2, "message": "Goodbye world!"},
]
def post(self):
return {"... |
#
# 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... |
from __future__ import absolute_import
import time
from dagster_graphql.client.util import pipeline_run_from_execution_params
from dagster_graphql.schema.runs import (
from_compute_log_file,
from_dagster_event_record,
from_event_record,
)
from graphql.execution.base import ResolveInfo
from rx import Obser... |
"""
rest_api.py: a REST API for updating and retrieving assembly information in the asm_store.
"""
import binascii
#third-party modules
from flask import jsonify, abort
from flask.ext.restful import Resource, reqparse, marshal_with, fields
#app specific modules
from assembler import Assembler
from assembler import X8... |
# -*- coding: utf-8 -*-
from torch import nn
from backbone.wsgn import customized_func as L
from backbone.wsgn.resnet import l_resnet50, l_resnet101
def Backbone_WSGNR50_Custumed(in_C):
net = l_resnet50(pretrained=True)
if in_C != 3:
net.conv1 = L.Conv2d(in_C, 64, kernel_size=7, stride=2, padding=3, ... |
import time
from typing import Dict
from .ModelTest import ModelTest
import pandas as pd
from sklearn.neighbors import KNeighborsClassifier
from ..config_helper import ConfigHelper
class KNNModelTest(ModelTest):
def __init__(self, training_df: pd.DataFrame, config, variation: str) -> None:
super().__init_... |
from .Player import Player
from .TurnsQueue import TurnsQueue
from .recorder.ProcessRecorder import ProcessRecorder
class Coordinator:
"""
This class is responsible for handling battle logic.
Stores players and runs their turns.
"""
def __init__(self, attacker: Player, defender: Player) -> None:
... |
#
# PySNMP MIB module A3COM-HUAWEI-RRPP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-RRPP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:06:57 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
load(
"//scala:scala_cross_version.bzl",
_default_scala_version = "default_scala_version",
_extract_major_version = "extract_major_version",
_scala_mvn_artifact = "scala_mvn_artifact",
)
load(
"@io_bazel_rules_scala//scala:scala_maven_import_external.bzl",
_scala_maven_import_external = "scala_m... |
"""
EAP Passpoint BRIDGE Mode
Run wpa2_eap & Run wpa2_only_eap:
pytest -m "OpenRoaming and interop_ios and fiveg and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
pytest -m "OpenRoaming and interop_ios and twog and wpa2_eap and bridge" -s -vvv --testbed interop --skip-upgrade
pytest ... |
# -*- coding: utf-8 -*-
"""
mslib.msui.editor
~~~~~~~~~~~~~~~~~~~~~~
config editor for mss_settings.json.
This file is part of mss.
:copyright: Copyright 2020 Vaibhav Mehra <veb7vmehra@gmail.com>
:copyright: Copyright 2020-2021 by the mss team, see AUTHORS.
:license: APACHE-2.0, see LICE... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
# 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... |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2020 Fetch.AI Limited
#
# 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 ... |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of t... |
# Copyright (c) 2021, salesforce.com, inc.
# All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
# For full license text, see the LICENSE file in the repo root
# or https://opensource.org/licenses/BSD-3-Clause
import json
import os
from datetime import datetime, timedelta
import GPUtil
import numpy as np
fr... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
__al... |
from django.core.management.base import BaseCommand
from djfw.installer.maintaince.backup import do_backup
class Command(BaseCommand):
def handle(self, *args, **options):
category_name = options['category_name']
do_backup(category_name)
|
"""Unit tests for the route injection plugin model."""
import unittest
import bottle
from routes.plugins import AuthenticationPlugin, InjectionPlugin
class RouteInjectionPluginTest(unittest.TestCase):
"""Unit tests for the route injection plugin."""
def tearDown(self):
bottle.app().uninstall(True)... |
import CoreFoundation
from PyObjCTools.TestSupport import TestCase, min_os_level
import objc
class TestCharacterSet(TestCase):
def testTypes(self):
cls = None
try:
cls = objc.lookUpClass("__NSCFCharacterSet")
except objc.error:
cls = objc.lookUpClass("NSCFCharacterS... |
''' '''
'''
ISC License
Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all c... |
import typing
from dataclasses import dataclass
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton, ReplyKeyboardMarkup, KeyboardButton
@dataclass
class ListOfButtons:
text: typing.List
callback: typing.List = None
align: typing.List[int] = None
@property
def inline_keyboard(s... |
from statsmodels.compat import lrange
from statsmodels.iolib import SimpleTable
from .DemeanDataframe import demean_dataframe,demeanonex
from .FormTransfer import form_transfer
from .OLSFixed import OLSFixed
from .RobustErr import robust_err
from .ClusterErr import *
from .CalDf import cal_df
from .CalFullModel import ... |
#!/usr/bin/env python
import csv
import re
import argparse
import os
import subprocess
import logging
import sys
import getpass
import platform
import toml
pcgr_version = 'dev'
db_version = 'PCGR_DB_VERSION = 20181119'
vep_version = '94'
global vep_assembly
def __main__():
parser = argparse.ArgumentParser(des... |
VERSION = '2.13.1' # Update using bump2version
|
frase = str(input('Digite uma frase: ')).strip().upper()
print(f'A letra A aparece {frase.count("A")} vezes.')
print(f'A primeira letra apareceu na posição {frase.find("A")+1}')
print(f'A ultima letra apareceu na posição {frase.rfind("A")+1}') |
# coding=utf-8
# Copyright 2018 The Open AI Team Authors and The HuggingFace Inc. 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
#
# ... |
# -*- coding: utf-8 -*-
'''This module provides a registry for skos providers.
This registry helps us find providers during runtime. We can also apply some
operations to all or several providers at the same time.
'''
from .uri import is_uri
class RegistryException(Exception):
pass
class Registry:
'''
... |
# coding: utf-8
"""
ESPER API REFERENCE
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Li... |
'''
Created on Mar 26, 2015
@author: ronaldjosephdesmarais
'''
import logging,yaml,json,requests
import keystoneclient.v2_0.client as ksclient
class glint_api(object):
def __init__(self,log_name,log_lvl,glint_cfg):
#setup logging for glint api
self.log = logging.getLogger('glint_api')
fh =... |
import hashlib
import os
import smtplib
import time
import zipfile
from wsgiref.util import FileWrapper
from django.http import StreamingHttpResponse
from django.utils import timezone
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import ensure_csrf_cookie, csrf_exempt
from djan... |
#
# BSD 3-Clause License
#
# Copyright (c) 2019, Analog Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, ... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define Numpy Ufuncs as Models.
"""
import numpy as np
from astropy.modeling.core import Model
from astropy.utils.exceptions import AstropyUserWarning
trig_ufuncs = ["sin", "cos", "tan", "arcsin", "arccos", "arctan", "arctan2",
"hypot"... |
"""Hazelcast Core objects and constants."""
import json
from hazelcast import six
from hazelcast.six.moves import range
from hazelcast import util
CLIENT_TYPE = "PYH"
SERIALIZATION_VERSION = 1
class MemberInfo(object):
"""
Represents a member in the cluster with its address, uuid, lite member status, attrib... |
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. 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
#
# Unle... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os, struct
import numpy as np
import zlib
import imageio
import cv2
COMPRESSION_TYPE_COLOR = {-1:'unknown', 0:'raw', 1:'png', 2:'jpe... |
# Copyright (c) Dietmar Wolz.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory.
import time
import os
import math
import random
import ctypes as ct
import numpy as np
from random import Random
import multiprocessing as mp
from multiprocessing import Process
from ... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... |
"""
Copyright 2013 Steven Diamond
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... |
#!/usr/bin/python
#
# aes.py: implements AES - Advanced Encryption Standard
# from the SlowAES project, http://code.google.com/p/slowaes/
#
# Copyright (c) 2008 Josh Davis ( http://www.josh-davis.org ),
# Alex Martelli ( http://www.aleax.it )
#
# Ported from C code written by Laurent Haan ( http://www.prog... |
from collections import Counter
TEST = """NNCB
CH -> B
HH -> N
CB -> H
NH -> C
HB -> C
HC -> B
HN -> C
NN -> C
BH -> H
NC -> B
NB -> B
BN -> B
BB -> N
BC -> B
CC -> N
CN -> C"""
class Polymer:
def __init__(self, input: str) -> None:
template, ruleText = input.split("\n\n")
# When we count elemen... |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
#
# @lc app=leetcode id=274 lang=python3
#
# [274] H-Index
#
# https://leetcode.com/problems/h-index/description/
#
# algorithms
# Medium (34.93%)
# Likes: 450
# Dislikes: 776
# Total Accepted: 132.4K
# Total Submissions: 379.1K
# Testcase Example: '[3,0,6,1,5]'
#
# Given an array of citations (each citation is ... |
def formatter(curr_time, moon_rise, elapse_time):
cur=minute(curr_time)
after=minute(moon_rise)
res=[curr_time]
increment=int(elapse_time)
for i in range(cur+increment, after+increment, increment):
diff=after-i
if diff<0:
res.append('Past Moon Rise!')
elif diff==0... |
from chardif import chardif
def test_basic():
chardif("rabbit", "grabit")
|
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test mempool limiting together/eviction with the wallet
from test_framework.test_framework import Bagh... |
from collections import defaultdict, Counter
from copy import deepcopy
import csv
import itertools
import functools
import os
import sys
import csv
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import walker.pushdown
from walker.pushdown import PushDown
from gensim.models.... |
# importing scrapy module
import scrapy
class StackSpider(scrapy.Spider):
# name of the spider
name = "stackoverflow_spider"
def start_requests(self):
url = "https://stackoverflow.com/questions?tab=Newest"
yield scrapy.Request(url=url, callback=self.parse)
def parse(self, response)... |
#!/usr/bin/env python
import argparse
import os
import getpass
if __name__=="__main__":
print("building docker container . . . ")
user_name = getpass.getuser()
default_image_name = user_name + "-pytorch-dense-correspondence"
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--image", type=str,
... |
from setuptools import setup
setup(
name='emis',
version='0.2.0',
packages=['emis'],
install_requires=[
'beautifulsoup4',
'click',
'requests',
],
entry_points={
'console_scripts': [
'emis=emis.__main__:main',
]
}
) |
# coding: utf-8
"""
Strava API v3
The [Swagger Playground](https://developers.strava.com/playground) is the easiest way to familiarize yourself with the Strava API by submitting HTTP requests and observing the responses before you write any client code. It will show what a response will look like with differe... |
# Copyright 2021 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
from vdk.api.job_input import IJobInput
def run(job_input: IJobInput) -> None:
result = job_input.execute_template(
template_name="scd2",
template_args=job_input.get_arguments(),
)
if result.is_failed() and result.get_exce... |
# Copyright (C) 2016-2018 Alibaba Group Holding Limited
#
# 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... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: reference_desc.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.proto... |
# -*- coding: utf-8 -*-
import re
import logging
import weakref
import collections
import six
if six.PY2:
import functools32 as functools
else:
import functools
import idb.netnode
import idb.analysis
logger = logging.getLogger(__name__)
# via: https://stackoverflow.com/a/33672499/87207
def memoized_metho... |
from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('create/',views.CreateUserView.as_view(),name='create'),
path('token/',views.CreateTokenView.as_view(),name='token'),
path('me/',views.ManageUserView.as_view(), name='me'),
]
|
"""
Created 11 Mar. 2020
Author: Jordan Prechac
"""
from django.db import connection
import gc
import threading
# -----------------------------------------------------------------------------
# def perform_async_request(function, *args, **kwargs):
# """
# Wrapper for performing asyncronous functions
# ... |
/usr/local/Cellar/python3/3.5.2_3/Frameworks/Python.framework/Versions/3.5/lib/python3.5/hashlib.py |
from .package import transform_package
def transform(source):
"""Transform resource
API | Usage
-------- | --------
Public | `from frictionless import transform`
Parameters:
source (any): data source
"""
return transform_package(source)
|
import inspect
from inspect import getdoc
from typing import List, Dict, Generator, Tuple, Union, Set
import boto3
from boto3.docs.utils import is_resource_action
from boto3.resources.base import ServiceResource as Boto3ServiceResource
from boto3.session import Session
from boto3.utils import ServiceContext
from botoc... |
import argparse
from beautifultable import BeautifulTable
from stests.core import cache
from stests.core import factory
from stests.core.utils import args_validator
from stests.core.utils import cli as utils
from stests.core.utils import env
# CLI argument parser.
ARGS = argparse.ArgumentParser("List set of nodes r... |
from django import forms
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from .models import Pilot
class CustomUserCreationForm(UserCreationForm):
class Meta(UserCreationForm):
model = Pilot
fields = ('username', 'email')
class CustomUserChangeForm(UserChangeForm):
cla... |
"""
sentry.quotas.base
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import six
from collections import namedtuple
from functools import partial
from django.conf import settings
f... |
import argparse
import os
# workaround to unpickle olf model files
import sys
import numpy as np
import torch
import time
from envs.envs_util import VecPyTorch, make_vec_envs
from misc.utils import get_render_func, get_vec_normalize
# sys.path.append('a2c_ppo_acktr')
parser = argparse.ArgumentParser(description='RL... |
# https://www.acmicpc.net/problem/10171
print("\ /\\\n ) ( ')\n( / )\n \\(__)|", end='') |
from cStringIO import StringIO
from contextlib import closing
from email.generator import Generator
from flanker.mime.message import errors
import cchardet
import chardet
def python_message_to_string(msg):
"""Converts python message to string in a proper way"""
with closing(StringIO()) as fp:
g = Gene... |
from tensorflow.python.framework import ops
from tensorflow.python.framework import dtypes
from glob import glob
import numpy as np
import os
from architecture import *
from CapsLayer import CapsLayer
from data.DataReader import *
class capsule_em():
def __init__(self, args):
self.graph_path = ar... |
from compas_rhino.geometry import RhinoMesh
from compas_rhino.utilities import clear_layer
from compas.utilities import XFunc
from math import sin
from math import cos
import rhinoscriptsyntax as rs
__author__ = ['Andrew Liew <liew@arch.ethz.ch>']
__copyright__ = 'Copyright 2017, BLOCK Research Gr... |
from rpgpy import utils
from numpy.testing import assert_array_equal
import pytest
def test_rpg_seconds2date():
date = utils.rpg_seconds2date(0)
date_only = utils.rpg_seconds2date(0, date_only=True)
res = ['2001', '01', '01', '00', '00', '00']
assert_array_equal(date, res)
assert_array_equal(date_... |
#####################################################################
# This file is used to generate a setenv.csh script in the installation
# directory that can be used to setup one's environment to use the
# programs and libraries installed there. This takes the place of the
# mk_setenv.csh script in the Hall-D scr... |
from functions.utils.generateKey import generateKey
from functions.utils.bruteForceBarrier import bruteForceBarrier
from encrypt import encrypt
from decrypt import decrypt
from playsound import playsound
def collectInformation(attempt, barrier):
option = ''
while (option!="c" and option!="d"):
option ... |
# 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 ... |
import math
def calculate(factors): # ax² + bx + c = 0
a, b, c = factors.values()
delta = b*b - 4*a*c
if a == 0:
result = [-c/b]
elif delta > 0:
result = [(-b - math.sqrt(delta)) / (2*a), (-b + math.sqrt(delta)) / (2*a)]
elif delta == 0:
result = [-b / (2*a)]
else:
... |
import os
from flask import Flask
app = Flask(__name__)
config_path = os.environ.get("CONFIG_PATH", "blog.config.DevelopmentConfig")
app.config.from_object(config_path)
from . import views
from . import filters
from . import login
|
#
# PySNMP MIB module HP-ICF-SLOT-STATS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-SLOT-STATS-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:22:50 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (def... |
from .token import tokenize
class Scanner:
def __init__(self):
pass
def scan(self, feed):
tokens = []
while len(feed) > 0:
print(feed)
if feed.peek() in (' ', '\n', '\t', '\r'):
feed.pop()
continue
tokens += [tokenize... |
"""my_gallery URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/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... |
from mahjong.constants import HATSU
from mahjong.hand_calculating.yaku import Yaku
from mahjong.utils import is_pon_or_kan
class Hatsu(Yaku):
"""
Pon of green dragons
"""
def __init__(self, yaku_id=None):
super(Hatsu, self).__init__(yaku_id)
def set_attributes(self):
self.tenhou_... |
import pytest
import pandas as pd
from pandas import MultiIndex
import pandas._testing as tm
def check_level_names(index, names):
assert [level.name for level in index.levels] == list(names)
def test_slice_keep_name():
x = MultiIndex.from_tuples([("a", "b"), (1, 2), ("c", "d")], names=["x", "y"])
asser... |
#!/usr/bin/python
import argparse
from argparse import RawTextHelpFormatter
import time
import subprocess
import sys
import os
class Convert:
def __init__(self):
self._args = None
def parseArgs(self):
parser = argparse.ArgumentParser(formatter_class=RawTextHelpFormatter,
... |
import os
import re
import shutil
import pytest
from click.testing import CliRunner
from freezegun import freeze_time
from great_expectations import DataContext
from great_expectations.cli import cli
from great_expectations.data_context.util import file_relative_path
from great_expectations.util import gen_directory_... |
import sys
import socket
from random import randint
from zope.interface import implements
from twisted.internet import defer
from twisted.internet.protocol import Factory, Protocol
from twisted.web.iweb import IBodyProducer
from scapy.config import conf
from ooni.errors import IfaceError
# This is our own connectPr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.