content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
from ocr import Ocr
|
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Aerele Technologies Private Limited and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import datetime
from datetime import date, timedelta
from frappe.model.naming import make_autoname
from frappe.mode... |
#!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Utility module for easily reading a sparse matrix.
"""
from __future__ import absolute_import
from __... |
# Generated by Django 3.1.1 on 2020-09-18 16:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='blogpost',
options={'ordering': ['creat... |
import abc
from typing import List, Union
from xid import XID
from .model import Model
class Mapper(metaclass=abc.ABCMeta):
def __init__(self, db):
self._db = db
def insert(self, model: Model) -> Model:
raise NotImplementedError()
def find(self, xid: Union[XID, None]) -> Union[Model, L... |
import torch
# import types
# x = types.SimpleNamespace()
class wavelet():
def __init__(self,tree):
self.tree = tree
self.construct_wavelet()
def construct_wavelet(self):
#Basically, what goes down here is this:
#1. We collect the mu_cache tree when it's done train... |
"""
Benchmark Gradient Boost
"""
from util import *
import numpy as np
import argparse
from time import time
from sklearn import ensemble
import sys
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Benchmark gradient boost.")
parser.add_argument('-ns', default=1000000, type=int,
... |
#
# Copyright (C) 2020 IBM. All Rights Reserved.
#
# See LICENSE.txt file in the root directory
# of this source tree for licensing information.
#
''' z/OS command handler '''
''' imports '''
from clai.server.plugins.nlc2cmd.wa_skills.utils import call_wa_skill, get_own_name
''' globals '''
__self = get_own_name(__f... |
# -*- coding: utf-8 -*-
"""
Usage: preprocess_raw_data.py
Preprocess raw data:
- parse .txt files and their .xml annotations
- write files with original (not plagiarized) text to tn_docs floder
- write files with plagiarized text to tp_docs folder,
together with the sources of plagiarism
"""
try:
import xml.etree.c... |
from floodsystem.stationdata import build_station_list, update_water_levels
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.analysis import polyfit
import numpy as np
import datetime
import matplotlib.dates
def run():
severe = []
high = []
moderate = []
low = []
no_data = ... |
import math
test_input = """F10
N3
F7
R90
F11
"""
#
# N
# W E
# S
#
# start face east
# Action N means to move the waypoint north by the given value.
# Action S means to move the waypoint south by the given value.
# Action E means to move the waypoint east by the given value.
# Action W means to move th... |
from django.utils import six
from djsw_wrapper.router import SwaggerRouter
from djsw_wrapper.errors import SwaggerValidationError, SwaggerGenericError
import flex
import os
import re
class Swagger():
# handle is local filename, file object, string or url
def __init__(self, handle, module):
self.schema... |
#!/usr/bin/env python
from operator import *
class MyObj(object):
def __init__(self,arg):
super(MyObj,self).__init__()
self.arg = arg
def __repr__(self):
return"MyObj(%s)"%self.arg
l = [ MyObj(i) for i in xrange(5) ]
print'objects :',l
#set an attribute getter
g = attrgetter('arg')
vals = [ g(i) for i in l... |
from typing import List
from typing import NamedTuple
from typing import Optional
class CBHGDiscriminatorModelConfig(NamedTuple):
in_channels: int
hidden_channels_list: List[int]
class CBHGModelConfig(NamedTuple):
in_channels: int
conv_bank_out_channels: int
conv_bank_k: int
max_pooling_k: i... |
import inspect
import itertools
from typing import Union, List, Tuple
import numpy as np
from geopandas import GeoDataFrame
from kaizen_mapping.map import refresh_print
from kaizen_mapping.map.grid import PixelGrid, Grid
from kaizen_mapping.map.matcher import Match
from kaizen_mapping.map.road import road_network_fro... |
import unittest
from src.tic_tac_toe import Board, TicTacToe, BOARD_CELLS
from src.utils import PLAYER_ONE, PLAYER_TWO
class TestBoard(unittest.TestCase):
def test_apply_move(self):
board = Board()
board.apply_move(2, PLAYER_ONE)
self.assertEqual(board.empty_cells_count, BOARD_CELLS - 1)
... |
# ICE_Test.py
#
# Created: Feb 2020, M. Clarke
""" setup file for a mission with a Cessna 172 with an internal combustion engine network
"""
# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------
import SUAVE
fr... |
import os
import sys
import subprocess
import urllib
import tarfile
import zipfile
import shutil
import errno
import platform
SOURCE_ROOT = os.path.split(os.path.realpath(__file__))[0]
SOURCE_DOWNLOAD = os.path.abspath(os.path.join(SOURCE_ROOT, '../vendor/download'))
# if dst path exists, use command 'git pull', othe... |
# coding=utf-8
# Author: Rafael Menelau Oliveira e Cruz <rafaelmenelau@gmail.com>
#
# License: BSD 3 clause
import numpy as np
from deslib.dcs.base import BaseDCS
class LCA(BaseDCS):
"""Local Class Accuracy (LCA).
Evaluates the competence level of each individual classifiers and
select the most compet... |
""" All Charizard Errors """
class CharizardError(Exception):
""" The Charizard Base Exception"""
|
from __future__ import annotations
from typing import TYPE_CHECKING, Any, Dict, NamedTuple, Optional, Sequence, Tuple
from pydantic import Field
from pydantic.types import PositiveFloat
from ._base_model import UseqModel
if TYPE_CHECKING:
from ._mda_sequence import MDASequence
ReprArgs = Sequence[Tuple[Opt... |
def is_multi_configuration(generator):
if not generator:
return False
return "Visual" in generator or "Xcode" in generator or "Multi-Config" in generator
|
from accounts.ui.views.content import index_html_links
def test_index_html_links():
assert index_html_links(b'<a href="#internal">') == b'<a href="#internal">'
assert (
index_html_links(b'<a href="external">')
== b'<a href="external" target="_blank" rel="noreferrer noopener">'
)
assert... |
import os
import glob
import json
from click.testing import CliRunner
from lut_maker import cli, generate, compute
from lut_maker.constants import *
class TestIntegration:
def test_single_generation(self, tmpdir):
name = 'test'
runner = CliRunner()
result = runner.invoke(cli.main, ['new', ... |
# coding: utf-8
# ## nlp services
# `
# docker run -p 9000:9000 phiedulxp/lxp:corenlp
# docker run -p 8000:8000 allennlp/allennlp [python -m allennlp.run serve]
# `
example = '''A military helicopter surveying the damage, carrying the Governor of Oaxaca Alejandro Murat Hinojosa and Mexico's Secretary of the Interior A... |
"""
SQL Wrapper
~~~~~~~~~~~
A simple SQLite3 wrapper built for
beginners of SQL.
"""
from .connect import Connection
from collections import namedtuple
import logging
VersionInfo = namedtuple('VersionInfo', 'major minor micro releaselevel serial')
version_info = VersionInfo(major=1, minor=0, micro=2... |
from django.contrib import admin
from .models import *
admin.site.register(Curso)
admin.site.register(Inscripcion)
|
import logging
import matplotlib.pyplot as plt
import numpy as np
import pytest
from shapely.affinity import rotate
from pyroll.core import SquareGroove, Profile
groove = SquareGroove(0, 3, tip_depth=20, tip_angle=91 / 180 * np.pi)
def test_from_groove():
Profile.from_groove(groove, width=45, height=50)
Pr... |
# -*- coding: utf-8 -*-
from netCDF4 import Dataset
from pyloco import GroupTask
class WeatherMultimap(GroupTask):
"""read multiple netcdf data files and generate weather map images in parallel
'weathermultimap' task reads multiple netcdf data files and generates weather map
images in parallel
Example(s)
-----... |
from django.db import models
from django.conf import settings
from django.template.defaultfilters import slugify
# Create your models here.
from django.urls import reverse
class Category(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField(unique=True,editable=False)
def __str_... |
import pyeccodes.accessors as _
def load(h):
h.add(_.Codetable('parameterCategory', 1, "4.1.[discipline:l].table", _.Get('masterDir'), _.Get('localDir')))
h.add(_.Codetable('parameterNumber', 1, "4.2.[discipline:l].[parameterCategory:l].table", _.Get('masterDir'), _.Get('localDir')))
h.add(_.Codetable_un... |
import math
def average(array_of_number):
array_of_number = [x for x in array_of_number if x is not None]
if(len(array_of_number) == 0):
return None
sum = 0
for number in array_of_number:
sum += number
avg = sum/float(len(array_of_number))
return avg
def standard_deviation(arra... |
from scapy.all import * |
empresas10 = [
"EDERSON DE S OLIVEIRA",
"ANTONIO CARLOS SOUZA DA CONCEICAO 05309482733",
"REGINALDO SANTOS DE ALMEIDA 01067239103",
"MARCELO DE ALMEIDA SILVA 02272182720",
"JOSE GONCALVES 93570708772",
"LUCIANO ROBERTO MACENA DE SOUZA 12655535804",
"ALEXANDRE PAIXAO DE LIMA",
"IMPERIAL A... |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... |
from binary import BinaryReader
import sys
import json
from pathlib import Path
path = open(sys.argv[1], "rb")
reader = BinaryReader(path.read())
if(reader.read_uint16()==3451):
f = open(sys.argv[1], encoding='shift_jisx0213') # change it to "open file as text" (rather than initial binary) # might be a bet... |
import random
from Minigames.Minigame import Minigame
from TimerHelper import TimerHelper
class Sabotage2(Minigame):
def __init__(self, parent, sabotagedPlayerUID):
Minigame.__init__(self, parent)
self.parent = parent
self.parent.screen.clear()
self.parent.screen.drawText("SABOTA... |
from accounting import db
from .. data_model import DataModel
class AccountType(db.Model, DataModel):
__tablename__ = "tbl_account_type"
account_type = db.Column(db.String(64), unique=True, nullable=False)
classification = db.Column(db.String(8), nullable=False)
priority = db.Column(db.Integer, nulla... |
import threading
from django.db import transaction
from .models import CrawlTask, TaskStatus
from .PttSpider.ptt_spider import PttArticleListSpider, PttArticleSpider
from .PttSpider.ptt_spider import Push, ArticleInfo
from .PttSpider.ptt_spider import PttUrl, PttUrlType
from .taskpool import TaskPool
TASK_POOL_SIZE... |
from django.urls import reverse, resolve
class TestUrls:
# Início CRUD Gênero
def test_genero_listar(self):
path = reverse('core:genero-listar')
assert resolve(path).view_name == 'core:genero-listar'
def test_genero_novo(self):
path = reverse('core:genero-novo')
assert... |
from lib.models.user import User
import unittest
class TestUser(unittest.TestCase):
def test_constructorParsesDictionary(self):
# Arrange
userId = 'abc123'
role = 'admin'
dictionary = {'userId': userId, 'role': role}
# Act
user = User(dictionary)
#Assert
... |
# -*- coding: utf-8 -*-
"""Top-level package for LazyML."""
__author__ = "Matt von Rohr"
__email__ = "matt.vonrohr@mydata.ch"
|
from characters.Character import Character
class Action():
def __init__(self, method, name, hotkey, **kwargs):
self.method = method
self.hotkey = hotkey
self.name = name
self.kwargs = kwargs
def __str__(self):
return "{}: {}".format(self.hotkey, self.name)
class Move... |
import urllib.parse
import requests
from api import RequestUrls
from exceptions import ExecutionError
from task import Task, dict_to_task, dict_list_to_task_list
from server_mock import ServerMock, MockConstants
class ClientSession:
def __init__(self, host: str, port: int, simulate_failure: bool) -> None:
... |
import click
import logging
from dtoolbioimage import ImageDataSet, zoom_to_match_scales
@click.command()
@click.argument('dataset_uri')
def main(dataset_uri):
logging.basicConfig(level=logging.INFO)
imageds = ImageDataSet(dataset_uri)
print(imageds.all_possible_stack_tuples())
image_name = '20200... |
import datajoint as dj
from element_lab import lab
from element_animal import subject
from element_session import session_with_datetime as session
from element_deeplabcut import train, model
from element_animal.subject import Subject
from element_lab.lab import Source, Lab, Protocol, User, Project
from .paths import ... |
# Parts of this script have been modified from code
# found in Yogesh Khatri's mac_apt project Notes plugin (https://github.com/ydkhatri/mac_apt)
# and used under terms of the MIT License.
from os.path import dirname, join
from PIL import Image
import imghdr
import zlib
import binascii
from scripts.artifact_report ... |
from django.conf import settings
from django import forms
from models import Blog, Entry
from viewpoint.settings import DEFAULT_BLOG
if 'tinymce' in settings.INSTALLED_APPS:
from tinymce.widgets import TinyMCE
class EntryForm(forms.ModelForm):
if 'tinymce' in settings.INSTALLED_APPS:
body = forms.Cha... |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function
import logging
import threading
import webbrowser
from tornado.httputil import url_concat
_logger = logging.getLogger(__name__)
def browse(port, browsername=None, base_url='/', rel_url='', ip='127.0.0.1', **url_args):
try:
... |
# Generated by Django 2.1.7 on 2019-03-24 12:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("flight", "0006_auto_20190320_1152")]
operations = [
migrations.AlterField(
model_name="flight", name="capacity", field=models.IntegerField(de... |
# Copyright 2010 New Relic, 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 writ... |
# -*- coding: utf-8 -*-
"""
Created on Wed Feb 23 20:02:25 2022
@author: dv516
"""
import numpy as np
from typing import List, Tuple
from Functions.test_functions import f_d2, f_d3
def optimizer_dummy(f, N_x: int, bounds: List[Tuple[float]], N: int = 100) -> (float, List[float]):
# '''
# Optimizer aims to optimize ... |
from django.contrib import admin
from ado.apps.buses.models import Bus, Seat
admin.site.register(Bus)
admin.site.register(Seat)
|
# pylint: disable=anomalous-backslash-in-string
"""
A ``Text2SqlTableContext`` represents the SQL context in which an utterance appears
for the any of the text2sql datasets, with the grammar and the valid actions.
"""
from typing import List, Dict
from sqlite3 import Cursor
from allennlp.data.dataset_readers.dataset_... |
# Generated by Django 2.2.4 on 2019-08-19 12:02
from django.db import migrations, models
def migrate_product_attribute_map_to_m2m(apps, schema):
"""Migrate the JSONB attribute map to a M2M relation."""
Product = apps.get_model("product", "Product")
AssignedProductAttribute = apps.get_model("product", "Ass... |
from chat.settings_base import REDIS_PORT, REDIS_HOST, REDIS_DB
__author__ = 'andrew'
import base64
import json
import redis
from django.core.management import BaseCommand
class Command(BaseCommand):
help = 'Print every session fetched from redis backend'
def get_values_from_redis(self):
sync_redis = redis.Str... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# © 2017-2019, ETH Zurich, Institut für Theoretische Physik
# Author: Dominik Gresch <greschd@gmx.ch>
import os
from aiida.common.utils import get_object_from_string
from .contextmanagers import redirect_stdout
def setup_pseudo_family(command_name, folder, group_name,... |
import json
import os
import pytest
import yaml
from json_modify import apply_actions
def test_apply_actions(mocker):
mocker.patch("json_modify.validate_action")
mocker.patch("json_modify.get_section")
mocker.patch("json_modify.apply_action")
mocker.patch("json_modify.get_reader")
assert apply_a... |
class Leg(object):
def __init__(self, provision, provision_url, instrument, instrument_url):
self.provision = provision
self.provision_url = provision_url
self.instrument = instrument
self.instrument_url = instrument_url |
# ----------------------------------------------------------------------
# convert caps
# ----------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC modules
fro... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# Azure I... |
def aaa():
return 5
def bbb():
return aaa()
# a comment
def bbb2():
a = Test()
return aaa()
a = 14
class Test:
def aaa(self):
return 5
def bbb(self):
return self.aaa ()
def ccc(self):
return self.aaa ()
class Parent :
def foo():
return "parent::foo()"
def foo2():
... |
from loaderio.resources.client import Client
class Apps(Client):
"""
"""
def __init__(self, api_key):
Client.__init__(self, api_key)
pass
def list(self):
return self.request('GET', 'apps')
def create(self, app):
payload = { 'app': app }
return self.request('POST', 'apps', payload)
def get(self, app... |
from django import forms
from .models import Stake
class StakeForm(forms.ModelForm):
class Meta:
model = Stake
fields = ('user','marketselection', 'amount',)
|
import setuptools
long_description = "prettierplot is a Python library that makes it easy to create high-quality, polished data visualizations with minimal code."
description = "Quickly create prettier plots"
distname = "prettierplot"
license = "MIT"
maintainer = "Tyler Peterson"
maintainer_email = "petersontylerd@gm... |
#!coding:utf8
#author:yqq
#date:2020/5/14 0014 13:46
#description: 地址生
import json
import logging
import time
from datetime import datetime
from typing import List
import pika
import redis
from pika.adapters.blocking_connection import BlockingChannel
from sqlalchemy import create_engine
from sqlalchemy... |
import discord
from discord.ext import commands
class helpcommands(commands.Cog):
def __init__(self):
pass
@commands.command()
async def help(self,ctx,feature=None):
if feature is None:
help_feature = discord.Embed(title='Help commands help :D',description='*help <**feature... |
from django.urls import path
from . import views
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = [
path('', views.index, name='index'),
path('rest/authors/', views.AuthorsLister.as_view(), name='AuthorsList'),
path('rest/authors/<int:pk>', views.AuthorDetail.as_view(), name='Aut... |
import sys
from subprocess import PIPE, run
import os
GIT_TOP_CMD = [ 'git', 'rev-parse', '--show-toplevel', '--show-superproject-working-tree']
if 'PASH_TOP' in os.environ:
PASH_TOP = os.environ['PASH_TOP']
else:
PASH_TOP = run(GIT_TOP_CMD, stdout=PIPE, stderr=PIPE, universal_newlines=True).stdout.rstrip()
sys... |
import json
from src.dfa import DFA
from src.state import State
def get_state_by_label(label, states):
for state in states:
if state.label == label:
return state
def from_json(filename):
d = DFA()
d.states = set()
d.initial_state = None
with open(filename, 'r') as r_file:
... |
# This code is based on: https://github.com/nutonomy/second.pytorch.git
#
# MIT License
# Copyright (c) 2018
# 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 ... |
FUNC_PROTO = """\
#include "vendor/unity.h"
extern int is_paired(const char *str);
"""
def gen_func_body(prop, inp, expected):
str_list = []
value = inp["value"].replace("\\", "\\\\")
str_list.append(f'const char *str = "{value}";\n\n')
if expected:
str_list.append(f"TEST_ASSERT_TRUE({prop}(st... |
# Copyright (c) 2022 Intel Corporation
#
# 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... |
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _GCP
class _Analytics(_GCP):
_type = "analytics"
_icon_dir = "resources/gcp/analytics"
class Bigquery(_Analytics):
_icon = "bigquery.png"
class Composer(_Analytics):
_icon = "composer.png"
class DataCatalog(_Anal... |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Ragged Tensors.
This package defines ops for manipulating ragged tensors (`tf.RaggedTensor`),
which are tensors with non-uniform shapes. In particular, each `RaggedTensor`
has one or mo... |
import os
import serial
import crcmod
import time
import time as time_
from w1thermsensor import W1ThermSensor
# importing and defining temperature from sensor1 (internal)
sensor1 = W1ThermSensor(W1ThermSensor.THERM_SENSOR_DS18B20, "0000052cc99d")
temp1 = int(round(sensor1.get_temperature()))
# importing and defining... |
import select, socket, ssl, os
import sys, struct, random, hashlib, time, threading
import json
import logging
import threading
import SocketServer
#MAXSYN = 2 ** 15
MAXSYN = 1024
MAXSYNBUFFER = 200
#REMOTE_lines = 4
def filepath(f):
return os.path.join(os.path.split(os.path.realpath(__file__))[0], f)
def send_a... |
import argparse
import os
import sys
import subprocess
from typing import Iterator
from helper import makesurePandoc
import json
def process(inputfile):
pandoc = makesurePandoc()
pandocReadAll = [pandoc, '--filter', 'customfilter.py', inputfile, '-t', 'json']
jsonString = subprocess.run(pandocReadAll, stdout=su... |
import dnaweaver as dw
def generate_supply_network(
parts_sequences,
already_amplified_fragments,
already_ordered_primers,
assembly_method,
):
"""Build the supply network, return the main station.
See the docs for an overview of the supply network.
:param parts_sequences: A dictionary {p... |
from sqlalchemy.orm import Session
from smol import db_models, load
from smol.database import SessionLocalTest, engine_test
db_models.Base.metadata.create_all(bind=engine_test)
db: Session = SessionLocalTest()
test_posting = {
"job_title": "Test",
"company": "Test Inc.",
"location": "Neverland",
"d... |
# pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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.... |
# -*- coding: utf-8 -*- #
# Copyright 2015 Google LLC. 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 requir... |
# pylint: disable=C0103
from os import path
import bpy
from . import registry, xray_ltx
from .details import props as details_props
from .obj.imp import props as obj_imp_props
from .skl import props as skl_props
from .bones import props as bones_props
from .omf import props as omf_props
from .obj.exp import props as ... |
from django.db import models
from rovers.models import Rover
class ImagePost(models.Model):
image = models.ImageField(upload_to="images")
image_id = models.IntegerField(
default=0,
blank=True,
null=True,
help_text="NASA's image ID associated with the photo.",
)
descript... |
# encoding: utf-8
# module Tekla.Structures.Model.ClashChecker calls itself ClashChecker
# from Tekla.Structures.Model,Version=2017.0.0.0,Culture=neutral,PublicKeyToken=2f04dbe497b71114
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class ClashChekerEvent(object):
# no doc
@staticmethod
def Ge... |
from app import app
from app import login_manager
from app.models.user import User
from flask import request, redirect, url_for, render_template, flash
from flask.ext.login import login_user, logout_user
@login_manager.user_loader
def load_user(id):
return User.query.get(int(id))
@app.route('/login', methods=['GE... |
# SPDX-FileCopyrightText: 2021 Jean-Sébastien Dieu <jean-sebastien.dieu@cfm.fr>
#
# SPDX-License-Identifier: MIT
from monitor_api.enums import Field, MetricScope, CONTEXT_ALL_FIELDS, METRIC_ALL_FIELDS, SESSION_ALL_FIELDS
from typing import List, Union, Dict, Optional
import datetime
import hashlib
try:
datetime.... |
from data.dataset_name import DATASET_NAME_TRAIN, DATASET_NAME_TEST, DATASET_NAME_PREDICT
from data.preprocess import preprocess_data
def _main():
print('Preprocess train data.')
preprocess_data(DATASET_NAME_TRAIN)
print('Preprocess test data.')
preprocess_data(DATASET_NAME_TEST)
print('Preprocess... |
import unittest
from utils.urls import reconstruct_url
import requests
from io import BytesIO
from zineb.utils.images import download_image
from zineb.utils.urls import replace_urls_suffix
# response = requests.get('https://www.hawtcelebs.com/wp-content/uploads/2021/01/kimberley-garner-in-a-colorful-bikini-at-a-beach-... |
"""
Advanced Testing
# TASK 1
Can you get the commeted out tests passing?
"""
import unittest
csv_filename = "my_csv_file.csv"
number_files = 3
def my_name_is(name):
print('hello my name is ', name)
class TheWorldIsSaneTestCase(unittest.TestCase):
def test_world_is_sane(self):
self.assertEqual(1... |
from dataclasses import dataclass
from har_models import HeaderElement
from typing import List
from enum import Enum
class Method(Enum):
GET = 'GET'
POST = 'POST'
@dataclass
class AbstractSampler():
name: str
comments: str
class HttpSampler(AbstractSampler):
protocol: str
server_name: st... |
from .builder import build_head
from .att_head import AttHead
from .fc_head import FCHead
from .head import Head
from .transformer_head import TransformerHead
|
import scrapy, time
#from scrapy.crawler import CrawlerProcess #eventually want this to run as a single script
#img pipeline is holding that up
def picture_check(y, records):
pic_frame = records[y].xpath( \
'.//div[@class="col-md-5 col-lg-4 pull-right"]/a').get()
if pic_frame is None:
return T... |
import json
import os
import subprocess
from config import REPAIR_ROOT, DATA_PATH
from core.Benchmark import Benchmark
from core.Bug import Bug
from core.utils import add_benchmark
FNULL = open(os.devnull, 'w')
def abs_to_rel(root, folders):
if root[-1] != '/':
root += "/"
output = []
for folder ... |
"""
.. module: lemur.utils
:platform: Unix
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
import os
import tempfile
from contextlib import contextmanager
from sqlalchemy import types
from ... |
import tensorflow as tf
import os
import numpy as np
import cv2
from args import FLAGS
from database import reader, helper, helper_cityscapes
from model import pspnet_mg
from experiment_manager.utils import sorted_str_dict
def gpu_num():
return len(FLAGS.visible_gpus.split(','))
def infer(image_filename, i_ckp... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 18 09:47:07 2019
@author: student
"""
import numpy as np
import os
np.set_printoptions(precision=3, linewidth=200, suppress=True)
LINE_WIDTH = 60
DATA_FILE_LIPM = 'romeo_walking_traj_long_lipm.npz'
DATA_FILE_TSID = 'romeo_walking_traj_long_tsid.npz'
# robot parameters... |
import json
from src.usermod_funcs.account_class import account
def deleteaccount(safety,jsonpath):
my_account = account(fullpath=jsonpath)
my_account.set_username(my_account.json_data["current_user"])
print(f"Deleting account of user '{my_account.username}'. Not the user you wanted? Login with another user... |
# -*- coding: utf-8 -*-
import hoggorm
from .main_plot import plot
def coefficients(model, comp=[1], figsize=None):
"""
This is a convenience plot function which generates coefficients plots of
hoggorm models.
PARAMETERS
----------
model : nipalsPCR/nipalsPLSR1/nipalsPLSR2 class ob... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.