text stringlengths 2 999k |
|---|
import unittest
import solution_one
import solution_two
class MyTestCase(unittest.TestCase):
def test_solution_one(self):
self.assertEqual(solution_one.velocity("input_demo.txt"), 198)
self.assertEqual(solution_one.velocity("input.txt"), 845186)
def test_solution_two(self):
self.asse... |
# ============================================================================
# FILE: gitbranch.py
# AUTHOR: Takahiro Shirasaka <tk.shirasaka@gmail.com>
# License: MIT license
# ============================================================================
# pylint: disable=E0401,C0411
import os
import re
import subproc... |
from utils import flatten
from sys import argv
class PuzzleFrame:
def __init__(self, state):
self.state = state
self.n=len(state[0])
def show(self):
#Muestra el Tablero
sep = "|"
floor = "----"
print(floor * (self.n))
for i in self.state:
counter... |
_all__ = ['aidFunctions', 'dataHandling', 'hscClasses', 'optiSetup',
'plotFunctions', 'hscTotal'] |
# -*- coding: utf-8 -*-
"""
test_doctest
~~~~~~~~~~~~
Test the doctest extension.
:copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
from collections import Counter
import pytest
from packaging.specifiers import InvalidSpecifier
... |
# Copyright (c) 2017 Intel Corporation. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
class AlertCondition(object):
def __init__(self, *args, **kwargs):
self._id = kwargs.pop('id', None)
def id(self):
raise NotImplem... |
from contextlib import contextmanager
import itertools
import numpy as np
import sandbox.rocky.tf.core.layers as L
from rllab.core.serializable import Serializable
from sandbox.rocky.tf.distributions.categorical import Categorical
from sandbox.rocky.tf.policies.base import StochasticPolicy
from rllab.misc import ext
fr... |
from django.contrib import admin
from hq.models import *
from django.contrib.auth.models import Group, User
from reporters.models import Reporter
from locations.models import Location
from resources.models import *
'''
'''
class ResourceAdmin(admin.ModelAdmin):
list_display = ('name', 'code', 'category','domain')
... |
from django.db import models
from fluent_pages.models import Page, HtmlPage
class SimpleTextPage(HtmlPage):
contents = models.TextField("Contents")
class Meta:
verbose_name = "Plain text page"
verbose_name_plural = "Plain text pages"
class PlainTextFile(Page):
content = models.TextField(... |
# Day4 of my 100DaysOfCode Challenge
# Instructions
# You are going to write a program that will select a random name from a list of names. The person selected will have to pay for everybody's food bill.
# Important: You are not allowed to use the choice() function.
# Line 8 splits the string names_string into indiv... |
"""
Unit tests for Random CP optimiser on Cartesian product domains.
-- kandasamy@cs.cmu.edu
"""
# pylint: disable=invalid-name
# pylint: disable=abstract-class-little-used
import os
from . import random_multiobjective_optimiser
from ..exd.cp_domain_utils import get_raw_point_from_processed_point, \
load_co... |
# coding: utf-8
"""
Browse API
<p>The Browse API has the following resources:</p> <ul> <li><b> item_summary: </b> Lets shoppers search for specific items by keyword, GTIN, category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values.</... |
from django.urls import reverse_lazy
from django.views import generic
from django.contrib.auth.forms import UserCreationForm
from .models import User
class MyUserCreationForm(UserCreationForm):
class Meta(UserCreationForm.Meta):
model = User
fields = ['username']
class UserCreate(generic.edit.Create... |
from abc import abstractmethod
from pandas import DataFrame
from os.path import exists
from numpy import argmax
from torch.nn import Module, Conv2d
from torch.nn import functional as F
from torch import load as loadModel
from cnn.MixedFilter import MixedConvBNWithReLU as MixedConvWithReLU
from cnn.uniq_loss import Un... |
# -*- coding: utf-8 -*-#
'''
# Name: BinaryNumberMinus
# Description:
# Author: super
# Date: 2020/6/18
'''
from matplotlib import pyplot as plt
import numpy as np
import math
from MiniFramework.EnumDef_6_0 import *
from MiniFramework.DataReader_2_0 import *
from MiniFramework.ActivationLayer ... |
from __future__ import annotations
from typing import Any, List, Union, Collection, TYPE_CHECKING, Optional
import O365.message as message
import O365.utils.utils as utils
from subtypes import Str, Html
from pathmagic import Dir, PathLike, File
from ..attribute import Attribute, NonFilterableAttribute, EnumerativeA... |
import serial, os, struct, sys, time, json, os.path
from proxy import *
from tgtypes import *
import malloc
def load_registers():
data = json.load(open(os.path.join(os.path.dirname(__file__), "regs.json")))
for reg in data:
yield reg["name"], reg["enc"]
globals().update(dict(load_registers()))
class ... |
"""Benchmark the turnaround time starting a debugger and run to the breakpont with lldb vs. gdb."""
import os, sys
import unittest2
import lldb
from lldbbench import *
class CompileRunToBreakpointBench(BenchBase):
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
BenchBase.setUp(self)
... |
"""implementation of a standard prioritized planning
Author: Keisuke Okumura
Affiliation: TokyoTech & OSX
Ref:
- Silver, D. (2005).
Cooperative Pathfinding.
Aiide, 1, 117-122.
- Erdmann, M., & Lozano-Perez, T. (1987).
On multiple moving objects.
Algorithmica, 2(1), 477-521.
"""
from __future__ import annotat... |
# Copyright 2013-2020 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)
class Sionlib(AutotoolsPackage):
"""Scalable I/O library for parallel access to task-local files"""
homepage = "... |
'''
simple subscript
'''
def main():
a = []int(1,2,3)
index = 0
a[ index ] = 100
print(a[index])
s = "hello world"
print(s)
print(s[0])
print(s[1])
print(s[2])
print(s[3])
if s[0]=='h':
print('ok')
else:
print('error')
|
"""
Django settings for mysite project.
Generated by 'django-admin startproject' using Django 1.8.17.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
from __futur... |
import socket
import typing
from tests.utils.skip import is_linux
from tests.utils.timeout import time_limit
import threading
import time
import unittest
from pyais.util import FixedSizeDict
from pyais.stream import OutOfOrderByteStream, UDPStream
MESSAGES = [
b'!AIVDM,2,1,1,A,538CQ>02A;h?D9QC800pu8@T>0P4l9E8L000... |
# -*- coding: utf-8 -*-
"""Shared filter utilities."""
from collections import OrderedDict # noqa
from dateutil.relativedelta import relativedelta
from django.contrib.gis.db import models as geo_models
from django.db import models
from django.utils.timezone import now
from django.utils.translation import ugettext_laz... |
#
# Copyright (c) 2011, Willow Garage, 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:
# * Redistributions of source code must retain the above copyright
# notice, this list of co... |
import typing
import sys
sys.setrecursionlimit(1 << 20)
def lowlink_undirected(
n: int,
edges: typing.List[typing.Tuple[int, int]],
) -> typing.Tuple[typing.List[int], typing.List[int]]:
graph: typing.List[typing.List[typing.Tuple[int, int]]] = [
[] for _ in range(n)
]
for i, (u, v) in enu... |
import sys, os
try:
import xml.etree.cElementTree as ET
except ImportError:
import cElementTree as ET
import Utils.ElementTreeUtils as ETUtils
extraPath = os.path.dirname(os.path.abspath(__file__))+"/../.."
sys.path.append(extraPath)
from Utils.ProgressCounter import ProgressCounter
import Core.SentenceGraph as... |
from django.apps import AppConfig
class DalmePublicConfig(AppConfig):
name = 'dalme_public'
|
import numpy as np
import os
from tensorflow.keras.models import load_model
from PIL import ImageOps
from tensorflow.keras.preprocessing import image# used for preproccesing
model = load_model('cc.h5')
print("Loaded model from disk")
classs = { 1:"Type-1",
2:"Type-2",
3:"Type-3"
... |
# Actor and Critic DNNs
# Based on code published by Patrick Emami on his blog "Deep
# Deterministic Policy Gradients in TensorFlow":
# https://pemami4911.github.io/blog/2016/08/21/ddpg-rl.html
import tensorflow as tf
class ActorNetwork(object):
"""
Input to the network is the state, output is the act... |
# 7. Write a program that asks the user to enter an angle between −180 and 180
# Using an expression with the modulo operator, convert the angle to its equivalent between 0◦ and 360
angle = eval(input("Enter angle between 180 degrees and -180 degrees: "))
|
#!/usr/bin/env python3
# Copyright (c) 2014-2018 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 the fundrawtransaction RPC."""
from decimal import Decimal
from test_framework.test_framework imp... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re
import sublime
import sublime_plugin
from datetime import datetime
class SublimeTasksBase(sublime_plugin.TextCommand):
def run(self, edit):
self.open_tasks_bullet = self.view.settings().get('open_tasks_bullet')
self.done_tasks_bullet = self.view... |
# 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
import shutil
import subprocess
os.environ["SOURCE_ROOT_DIR"] = "/inside/apex"
os.environ["CONDA_CPUONLY_FEATURE"] = ""
python_ver... |
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import random as rm
def V(dp, L, R, x):
v = (dp * (R * R - x * x)) / (4 * 0.001 * L)
return v
def Re(v, D):
return (1000 * v * D) / 0.001
# Rmax=5[m]
# Lmax=100[m]
# dpmax=3.68*10**-6
# vmax=2.4*10**-4
R = 5 # радиус трубы [м]
dp =... |
# python peripherals
import random
# scipy
import scipy.io
import scipy.stats as ss
# numpy
import numpy
# matplotlib
import matplotlib.pyplot as plt
import matplotlib.collections as mcoll
import matplotlib.ticker as ticker
import matplotlib.lines
# pytorch
import torch
# pandas
import pandas
# ipython
from IPyth... |
# Lint as: python3
"""Request handler classes for the extensions."""
import base64
import json
import re
import tornado.gen as gen
import os
import math
import json
import datetime
from collections import namedtuple
from notebook.base.handlers import APIHandler, app_log
from google.cloud import bigquery
from google.... |
"""Generated class for event_audit.json"""
class Audit:
"""Generated schema class"""
def __init__(self):
self.timestamp = None
self.version = None
@staticmethod
def from_dict(source):
if not source:
return None
result = Audit()
result.timestamp = source.get('timestamp')
result.... |
from collections import OrderedDict
import json
from graphenebase.types import (
Uint8, Int16, Uint16, Uint32, Uint64,
Varint32, Int64, String, Bytes, Void,
Array, PointInTime, Signature, Bool,
Set, Fixed_array, Optional, Static_variant,
Map, Id, VoteId
)
from .objects import GrapheneObject, isArgsT... |
# --------------
import pandas as pd
import numpy as np
from sklearn.cross_validation import train_test_split
# code starts here
df = pd.read_csv(path)
#print(df.head())
X = df.drop('list_price', axis = 1)
y = df['list_price']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, random_state=6)
pr... |
"""
ASGI config for dataserver project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... |
from abc import ABCMeta, abstractmethod
class BaseParser(metaclass=ABCMeta):
@abstractmethod
def parse(self):
pass
|
# dataset settings
dataset_type = 'CityscapesSccqqDataset'
data_root = 'data/cityscapes_sccqq/'
img_norm_cfg = dict(
mean=[47.19,24.697, 40.71], std=[58.395, 57.12, 57.375], to_rgb=True)
crop_size = (512, 1024)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='R... |
import torch
from vision.ssd.vgg_ssd import create_vgg_ssd, create_vgg_ssd_predictor
from vision.ssd.mobilenetv1_ssd import create_mobilenetv1_ssd, create_mobilenetv1_ssd_predictor
from vision.ssd.mobilenetv1_ssd_lite import create_mobilenetv1_ssd_lite, create_mobilenetv1_ssd_lite_predictor
from vision.ssd.mobilenet_v2... |
import cherrypy, os, sys, json
from serial.tools import list_ports
from classes.Dobot import Dobot
from classes.Enums import ConnectState, PTPMode
import devices
import helpers
class Controls(object):
def __init__(self):
cherrypy.engine.subscribe('control-broadcast', self.listen)
ret... |
# Copyright 2018-2021 Xanadu Quantum 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... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import json
import logging
import shlex
import subprocess
from collections import defaultdict
import detectron2.utils.comm as comm
from detectron2.data import MetadataCatalog
from detectron2.structures import BoxMode
from p... |
"""Datasets readers and utilities.
This submodule of AES project consists of automated datasets reader and
utilities. In this pre-release version, only ASAP-AES dataset is supported
to load as train or test set.
"""
# Dataset readers
from essaysense.datasets.asap import load_asap
from essaysense.datasets.glove import... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# author: owefsad@huoxian.cn
# project: dongtai-webapi
from dongtai.models.agent import IastAgent
from dongtai.models.vulnerablity import IastVulnerabilityModel
from dongtai.endpoint import R
from dongtai.endpoint import MixinAuthEndPoint
from django.utils.translation impor... |
import os
import inspect
import pkgutil
class Plugin(object):
"""Base class that each plugin must inherit from. within this class
you must define the methods that all of your plugins must implement"""
def __init__(self, parent=None):
self.description = "UNKNOWN"
self.name = None
... |
from typing import Any
from typing import Mapping
from amocrm_asterisk_ng.infrastructure import ioc
from amocrm_asterisk_ng.infrastructure import SelectorImpl
from amocrm_asterisk_ng.infrastructure import ISelector
from glassio.logger import ILogger
from amocrm_asterisk_ng.infrastructure import SelectedComponentConfig... |
from setuptools import setup, find_packages
setup(
name='FogLAMP',
python_requires='~=3.5',
version='0.1',
description='FogLAMP',
url='http://github.com/foglamp/FogLAMP',
author='OSIsoft, LLC',
author_email='info@dianomic.com',
license='Apache 2.0',
# TODO: list of excludes (tests)
... |
#
# Autogenerated by Sandesh Compiler (1.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from vr_nldump.pysandesh.Thrift import TType, TMessageType, TException
from vr_nldump.pysandesh.transpor... |
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import numpy as np
from .taskdataset import EbbFlowStats
class PlotRTs(EbbFlowStats):
"""Plot RT distributions.
Args
----
stats_obj (EbbFlowStats instance): Data from the model/participant.
palette (str, optional): Color p... |
# -*- coding: utf-8 -*-
# Copyright 2017, 2021 ProjectQ-Framework (www.projectq.ch)
#
# 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.... |
#
# PySNMP MIB module DNOS-ISDP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DNOS-ISDP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:51:38 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 201... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.13.5
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
i... |
"""
ASGI config for shape2map project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SET... |
# Copyright 2016 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.
"""A command to fetch new baselines from try jobs for the current CL."""
import json
import logging
import optparse
from blinkpy.common.net.git_cl import Gi... |
#!/usr/bin/env python
import requests
import json
import sys
class weather:
def __init__(self,city_name):
info = get_info(city_name)
self.name = info['name']
self.country = info['sys']['country']
self.dt = info['dt']
self.temp = info['main']['temp']
self.temp_min = info['main']['temp_min']
self.temp_m... |
"""
The :mod:`sklearn.pls` module implements Partial Least Squares (PLS).
"""
# Author: Edouard Duchesnay <edouard.duchesnay@cea.fr>
# License: BSD 3 clause
from distutils.version import LooseVersion
from sklearn.utils.extmath import svd_flip
from ..base import BaseEstimator, RegressorMixin, TransformerMixin
from ..u... |
import base64
import json
import os
import urllib
import unittest
from datetime import datetime
from urllib.request import Request, urlopen
from algosdk.abi.contract import NetworkInfo
import parse
from behave import (
given,
when,
then,
register_type,
step,
) # pylint: disable=no-name-in-module
... |
from typing import List
import matplotlib as mpl
import numpy as np
from astropy import units as u
from astropy.coordinates import CartesianRepresentation
from matplotlib import pyplot as plt
from poliastro.plotting.util import BODY_COLORS, generate_label
from poliastro.util import norm
from ._base import Trajectory... |
#!/usr/bin/env python
"""
sentry-discord
============
An extension for `Discord <https://www.discordapp.com>`_ which creates Discord alerts.
:copyright: (c) 2015 by Sentry Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more details.
"""
from setuptools import setup, find_packages
install_... |
import random
import string
from itsdangerous import \
(TimedJSONWebSignatureSerializer as Serializer,
BadSignature, SignatureExpired)
from passlib.apps import custom_app_context as pwd_context
from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy import create_engine
from sqlalchemy.ext.de... |
import os
from gym.wrappers.monitoring import video_recorder
from stable_baselines3.common import logger
from stable_baselines3.common.vec_env.base_vec_env import VecEnvWrapper
from stable_baselines3.common.vec_env.dummy_vec_env import DummyVecEnv
from stable_baselines3.common.vec_env.subproc_vec_env import SubprocVe... |
from pyrlprob.tests.py_tests import *
from pyrlprob.tests.test_landing1d import test_train_py, make_cpp_lib, test_train_cpp, test_train_eval_py, test_train_eval_cpp
from pyrlprob.tests.test_multiple_gym import test_multiple_gym_envs as test_gym_envs
try:
from pyrlprob.tests.cpp_tests import *
except ImportError:
... |
import socket
import sys
import time
import random
import string
import os
from argparse import ArgumentParser
#######################################################################
# GLOBALS #
################################################################... |
#!/usr/bin/env python
# -*- coding: utf-8
########################################
#
#
# This file is intentionally monolithic.
# It also intentionally restricts itself
# to standard library modules, with no
# extra dependencies.
#
from __future__ import print_function
__authors__ = "Steven Pigeon"
__copyright__ = ... |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import warnings
import omegaconf
import torch
from mmf.common.dataset_loader import DatasetLoader
from mmf.common.registry import registry
from mmf.modules.metrics import Metrics
from mmf.trainers.base_trainer import BaseTrainer
from mmf.trainers.callba... |
# ----------------------------------------------------------------------------
# Copyright (c) 2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# -----------------------------------------------------... |
import _plotly_utils.basevalidators
class MaxpointsValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name='maxpoints', parent_name='pie.stream', **kwargs
):
super(MaxpointsValidator, self).__init__(
plotly_name=plotly_name,
parent_name... |
# 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 python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2018
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
""" Order.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import FilterNotFound
from ambra_sdk.exceptions.service import InvalidCondition
from ambra_sdk.exceptions.service import InvalidCustomfield
from ambra_sdk.exceptions.service import Invalid... |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 15:51
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cmdb', '0001_initial'),
]
operations = [
migrations.AddField(
m... |
from django.contrib import admin
from geotrek.infrastructure.models import InfrastructureType
class InfrastructureTypeAdmin(admin.ModelAdmin):
list_display = ('label', 'type', 'structure')
search_fields = ('label', 'structure')
list_filter = ('type', 'structure',)
admin.site.register(InfrastructureType,... |
# -*- coding: utf-8 -*-
"""
eve-demo settings
~~~~~~~~~~~~~~~~~
Settings file for our little demo.
PLEASE NOTE: We don't need to create the two collections in MongoDB.
Actually, we don't even need to create the database: GET requests on an
empty/non-existant DB will be served correctly ('200'... |
import os
import csv
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
from os import listdir
from os.path import isfile, join
from optparse import OptionParser
from modules import markdown2
path = os.path.d... |
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.contrib.auth.forms import AuthenticationForm, UserCreationForm
from django.urls import reverse_lazy
class ExtendedAuthenticationForm(AuthenticationForm):
remember_me = forms.BooleanField(label='R... |
import seaborn as sns
from visualisation.geopandas_plot.geopandas_plot import GeoPandasPlot
from preprocessing.functions.data_preprocessor import DataPreprocessor
import os
os.chdir(r"C:\Users\Andy Gubser\OneDrive - Hochschule Luzern\01 Studium\03 MSc Data Science\Master "
r"FS20\Wahlpflichtmodule\W.MSCIDS_DVN... |
import os
import requests
import subprocess
import tarfile
import tempfile
def ensure_helm_binary(f: callable):
def wrapper(helm_client: 'HelmClient', *args, **kwargs):
helm_client._get_helm_binary_stream()
return f(helm_client, *args, **kwargs)
return wrapper
def test_helm_binary(execPath):
... |
from django.db.models import signals
from django.db import transaction, router
from django_postgres_extensions.utils import OrderedSet
from django_postgres_extensions.models.functions import ArrayCat, ArrayRemove, multi_array_remove
from django.utils.functional import cached_property
class MultiReferenceDescriptor(obj... |
#!/usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2017 Johan Kanflo (github.com/kanflo)
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 limitat... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Container.description'
db.add_column(u'containers_container', 'description',
... |
"""
This module contains the TerminalSet structure.
This structure is used to calculate in an easy way the ``first`` and ``follow``
sets of a given grammar.
"""
from __future__ import annotations
from typing import Set
from numlab.compiler.grammar import Terminal
from numlab.compiler.tokenizer import Token
class... |
import logging
import os, glob
import signal
import csv
import time
import shutil
import subprocess
import datetime
import json
import sys
import schedule
import pickle
import threading
import argparse
import random
import string
from collections import defaultdict
def initialize_config_and_execute(valuesDict):
... |
# flake8: noqa
import time
import numpy
from skimage.data import camera
from skimage.metrics import peak_signal_noise_ratio as psnr
from skimage.metrics import structural_similarity as ssim
from aydin.io.datasets import normalise, add_noise
from aydin.it.cnn import ImageTranslatorCNN
def demo(image, max_epochs=4, i... |
# -*- coding: utf-8 -*-
import re
from nltk import RegexpParser
from textblob import TextBlob, Word
from textblob.taggers import PatternTagger
from textblob.sentiments import NaiveBayesAnalyzer
from maicroft.words.utility_text_sets import stopwords
from maicroft.words import utility_text_sets
pattern_tagger = Patte... |
from beet import Context, Function, sandbox
from beet.contrib.render import render
def beet_default(ctx: Context):
ctx.data["demo:foo"] = Function(["say {{ ctx.meta.message }}"])
ctx.require(render_functions)
ctx.data["demo:bar"] = Function(["say {{ ctx.meta.message }}"])
ctx.require(sandbox(add_func... |
#!/usr/bin/env python
import os
import sys
sys.path.insert(0, os.pardir)
sys.path.insert(0, os.path.join(os.pardir, 'openmoc'))
from testing_harness import TestHarness
import openmoc
try:
import openmc.openmoc_compatible
import openmc.mgxs
except:
print("OpenMC could not be imported, it's required for lo... |
# -*- coding: utf-8 -*-
# Copyright 2019 Bruno Toshio Sugano <brunotoshio@gmail.com>
import os
import pytest
from monogatari.dict_handler import DictHandler
@pytest.fixture
def handler():
test_dir = os.path.dirname(__file__)
return DictHandler(f'{test_dir}/testdic.dic')
def test_parse_categories(handler):... |
import requests
import lxml.html
class Ticker:
def yahooFormat(self, tickers: list):
if not isinstance(tickers, list):
tickers = [tickers]
self.dticker = tickers[:]
# check if theres a currency inside the list
for i, tick in enumerate(self.dticker):
if "/" ... |
# https://leetcode.com/problems/combinations
# https://leetcode.com/problems/combinations/
class Solution:
def combine(self, n, k):
output = []
def backtrack(first=1, cur_list=[]):
if len(cur_list) == k:
output.append(cur_list[:])
else:
for i... |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n_azure.provider import resources
from c7n_azure.resources.arm import ArmResourceManager
from c7n_azure.filters import FirewallRulesFilter
from netaddr import IPRange, IPSet
AZURE_SERVICES = IPRange('0.0.0.0', '0.0.0.0')
@resource... |
import mojo
import time
import vanilla
from AppKit import NSNumberFormatter
from defconAppKit.windows.baseWindow import BaseWindowController
from mojo.UI import CurrentFontWindow
# the location of smart sets has moved in RF3:
rf_version = mojo.roboFont.version
if int(rf_version[0]) >= 3:
from mojo.smartSet import ... |
import argparse
import logging
import os
import sys
import pandas as pd
import sqlalchemy as sql
from sqlalchemy import Column, Integer, Float, String
from sqlalchemy.ext.declarative import declarative_base
sys.path.append(os.path.dirname(sys.path[0])) # so that config can be imported from project root
import config
... |
"""Document Transcription Feedback."""
import pandas as pd
from sail_on_client.harness.local_harness import LocalHarness
from sail_on_client.harness.par_harness import ParHarness
from sail_on_client.feedback.feedback import Feedback
from typing import Union, Dict
SUPPORTED_FEEDBACK = ["classification", "score", "tra... |
### #### PUZZLE 3 - 02/12/2021 Binary Diagnostic!
import pandas as pd
def get_panda_from_txt(filepath):
char_list = []
byte_list = []
with open(filepath, "r") as f:
for line in f:
line = line.rstrip()
char_list.append(list(line))
binary = int(line,2)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.