text stringlengths 2 999k |
|---|
import unittest
import torch
import lightly
class TestFromImports(unittest.TestCase):
def test_from_imports(self):
# active learning (commented out don't work)
from lightly.active_learning.config.sampler_config import SamplerConfig
from lightly.active_learning.agents.agent import ActiveL... |
def part1():
horizontal = 0
depth = 0
with open("./long.txt", "r") as f:
for line in f:
cmd, amount = line.split()
if (cmd == 'forward'):
horizontal = horizontal + int(amount)
elif (cmd == 'up'):
depth = depth - int(amount)
... |
import tweepy
# Authenticate to Twitter
auth = tweepy.OAuthHandler("key", "key")
auth.set_access_token("token", "token")
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True)
searches='covid19'
no_of_tweets=10
for tweet in tweepy.Cursor(api.search,searches).items(no_of_tweets):
try:
twe... |
"""
Sprite Simple Bouncing
Simple program to show how to bounce items.
This only works for straight vertical and horizontal angles.
Artwork from http://kenney.nl
If Python and Arcade are installed, this example can be run from the command line with:
python -m arcade.examples.sprite_bouncing_coins
"""
import arcade
... |
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... |
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
from os import path
# io.open is needed for projects that support Python 2.7
# It ensures ope... |
"""
Profile ../profile-datasets-py/div52_zen10deg/052.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div52_zen10deg/052.py"
self["Q"] = numpy.array([ 1.60776800e+00, 3.86312400e+00, 5.89943600e+00,
8.08148800e+00, 7.46053900e+00, 5.55339800e+0... |
# Licensed to my_happy_modin Development Team under one or more contributor license agreements.
# See the NOTICE file distributed with this work for additional information regarding
# copyright ownership. The my_happy_modin Development Team licenses this file to you under the
# Apache License, Version 2.0 (the "Licens... |
# This function intends to encrypt plaintext using playfair encryption method
def PlayfairEncrypt():
plainText = input("Plaintext: ")
key = input("Key: ")
cipher = ""
# table config
table = []
key = key.replace('J', 'I')
key = key.upper()
for character in key:
if character not... |
#
# PySNMP MIB module CISCO-IETF-IP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-IETF-IP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:00:21 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... |
"""
Read in the cmsis/devinc/stm32f405xx.h header, extract relevant constants,
and create modstmconst.c.
This is not part of the automatic build process because stm32f405xx.h isn't
expected to change. After generating the file, some manual intervention is
needed to copy the new qstr definitions to qstrdefsport.h.
"""... |
"""Utilities for reading real time clocks and keeping soft real time constraints."""
import gc
import os
import time
from collections import deque
from typing import Optional, List, Union
from setproctitle import getproctitle # pylint: disable=no-name-in-module
from common.clock import sec_since_boot # pylint: disa... |
"""
__version__.py
~~~~~~~~~~~~~~
Information about the current version of the hhpy package.
"""
__title__ = 'hhpy'
__description__ = 'hhpy - convenient data science'
__version__ = '0.3.0' # 2020-10-21
__author__ = 'Henrik Hanssen'
__author_email__ = 'henrik.hanssen@gmail.com'
__license__ = 'Apache 2.0'
__url__ = 'h... |
import os
from flask import Flask
from flask import render_template
import pandas as pd
import fasttext
from pathlib import Path
def create_app(test_config=None):
# create and configure the app
app = Flask(__name__, instance_relative_config=True)
if test_config is None:
# load the instance co... |
import warnings
from typing import List, Union, Dict, Any, Tuple
from itertools import chain
import numpy as np
from .base import (
BoolElement,
ElementBase,
FloatElement,
Pose,
StringElement,
vector3,
should_warn_unsupported,
)
from .sensor import Sensor
from .frame import Frame
from .orig... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.20.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unitte... |
__author__ = 'pavelkosicin'
def test_search_query(app):
app.search.enter_query(query="g-eazy")
app.navigation.choose_songs_tab()
app.search.check_response_title(expected_result_title="No Limit", error_message='Nothing found on request')
app.search.check_response_person(expected_result_person="G-Eazy, ... |
import json
from twisted.trial import unittest
from hashlib import sha256
from nacl.public import PrivateKey, PublicKey, Box
from .common import TwoNodeMixin
from ..mailbox import channel
from ..mailbox.server import parseMsgA, parseMsgB
class msgC(TwoNodeMixin, unittest.TestCase):
def test_create_and_parse(self):... |
import os
import sys
import platform
import setuptools
SCRIPT_DIR=os.path.dirname(os.path.abspath(__file__))
def main():
os.chdir(SCRIPT_DIR)
package_name = 'opencv'
package_version = os.environ.get('OPENCV_VERSION', '4.5.4') # TODO
long_description = 'Open Source Computer Vision Library Python bin... |
"""
A series of tests that test by calling the code directly.
It is meant to look only at the abstract_file_db parts
This should make for easier debugging
"""
import os
from pathlib import Path
import unittest
from odarchive.abstract_file_db import AbstractFileDatabase
class TestAbstractFileDB(unittest.TestCase):
... |
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "charts.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
|
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
#!/usr/bin/env python3
import collections
import json
import sys
from jsonschema import validate
from config import SCHEMA_FILE
class Annotation:
def __init__(self, *args, **kwargs):
self.sources = set()
self.sinks = set()
self.initial_eq = set()
self.initial_eq_mod = collections.... |
import sly
# read about sly
# here https://github.com/dabeaz/sly
# and here https://sly.readthedocs.io/en/latest/
class ExampleLexer(sly.Lexer):
# a set of tokes we spit out
tokens = { NUMBER }
# these are also tokens, but they don't have state and take up exactly one
# symbol, so it's more convinie... |
"""Функции для получения данных об исторических дневных котировках."""
from typing import Iterable, Optional
import aiohttp
from aiomoex import client, request_helpers
from aiomoex.request_helpers import DEFAULT_BOARD, DEFAULT_ENGINE, DEFAULT_MARKET, SECURITIES
async def get_board_dates(
session: aiohttp.Client... |
import os
import sys
import time
import webbrowser
import json # to store tracing and recived data
import requests # for IP trcae r
import urllib # urllib to parse url
import twint # twint for twitter scraping
import tabulate # tabulate for format
import colorama # color
import phonenumbers # phone num tracin... |
# 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 ... |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
# rest framework testing helpers
from rest_framework.test import APIClient
from rest_framework import status
from core.models import Tag, Recipe
from ..serializers import TagSerializer
TAGS_URL = reverse(... |
#!/usr/bin/env python
"""
A simple utility to redo the failed/errored tests.
You need to specify the session directory in order for this script to locate the
tests which need to be re-run.
See also dotest.py, the test driver running the test suite.
Type:
./dotest.py -h
for help.
"""
from __future__ import print_... |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.segmentation.specialized import EMSegmentCommandLine
def test_EMSegmentCommandLine_inputs():
input_map = dict(args=dict(argstr='%s',
),
atlasVolumeFileNames=dict(argstr='--atlasVolume... |
# ######################################################################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
from frappe.core.doctype.doctype.doctype import UniqueFieldnameError, IllegalMandatoryError, DoctypeLinkError, WrongOptionsDoctypeLinkErro... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: system_monitor.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.protobuf import reflection as... |
"""Async PRAW exception classes.
Includes two main exceptions: :class:`.RedditAPIException` for when something goes wrong
on the server side, and :class:`.ClientException` when something goes wrong on the
client side. Both of these classes extend :class:`.AsyncPRAWException`.
All other exceptions are subclassed from ... |
"""
Copyright (c) 2011 Tencent Inc.
All rights reserved.
Author: Michaelpeng <michaelpeng@tencent.com>
Date: October 20, 2011
This is the Namespace module which provides Namespace utility.
"""
__all__ = ("Namespace", "as_namespace")
from collections import Mapping, Sequence
class _Dummy(object):
de... |
#! /usr/bin/env python2
import argparse
import os
import os.path
import subprocess
import sys
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
def run_program(*argv):
print "$ %s" % " ".join(argv)
p = subprocess.Popen(
argv,
stdout=subprocess.PIPE,
stderr=sub... |
import math
angulo = float(input('Qual o valor do ângulo? '))
print(f'\nSeno: {math.sin(math.radians(angulo)):.2f}')
print(f'Cosseno: {math.cos(math.radians(angulo)):.2f}')
print(f'Tangente: {math.tan(math.radians(angulo)):.2f}') |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
------------------------------------------------... |
##########################################################################
#
# Copyright (c) 2012, John Haddon. All rights reserved.
# Copyright (c) 2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
# Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
#conda install pillow matplotlib
from py3d import *
import matplotlib.pyplot as plt
if __name__ == "__main__":
print("Read TUM dataset")
color_raw = read_image("../../TestData/RGBD/other_formats/TUM_color.png")
... |
# each day at 4am for previous day
import json
from pandas import json_normalize
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python import PythonOperator
default_args = {
'start_date': datetime(2021,7,1),
'email': ['airflow@example.com'],
'email_on_failure': Fal... |
# -*- coding: utf-8 -*-
#
# Copyright 2018-2021 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... |
from django.db import models
from django.utils import timezone
from django.core.validators import MaxValueValidator, MinValueValidator
# Create your models here.
from inventario.models import Producto, DetallesProducto, Categoria, SubCategoria
from usuarios.models import Cliente
#DescuentoProducto
class DescuentoProdu... |
# dataset settings
dataset_type = 'SROIDataset_1class'
data_root = '/home/p/Documents/data/SonarROI/'
img_norm_cfg = dict(mean=[0.2, 0.2, 0.2], std=[0.2, 0.2, 0.2], to_rgb=True)
# img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[1, 1, 1], to_rgb=True)
# train_pipeline = [
# dict(type='LoadImageFromFile'),
#... |
""" Test utilities
:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2018-02-26
:Copyright: 2018-2020, Karr Lab
:License: MIT
"""
from abc import ABCMeta, abstractmethod
from capturer import CaptureOutput
from logging2 import Logger, LogLevel, StdOutHandler
import sys
import unittest
from de_sim.utilities i... |
import json
import requests
from cognoml.analysis import classify
if __name__ == '__main__':
# Create a classifier using mock input. Print output to stdout.
url = 'https://github.com/cognoma/machine-learning/raw/876b8131bab46878cb49ae7243e459ec0acd2b47/data/api/hippo-input.json'
response = requests.get(u... |
# -*- coding: utf-8 -*-
"""
Manage LXD profiles.
.. versionadded:: 2019.2.0
.. note:
- `pylxd`_ version 2 is required to let this work,
currently only available via pip.
To install on Ubuntu:
$ apt-get install libssl-dev python-pip
$ pip install -U pylxd
- you need lxd instal... |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="sinner",
version="0.0.3dev001",
author="Friar Hob",
author_email="github@friarhob.33mail.com",
description="SINNER - Simplest Implementation of Neural Networks for Effortless Runs",
lo... |
#
# PySNMP MIB module DOCS-TEST-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-TEST-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:39:02 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... |
from setuptools import find_packages
import subprocess
from glob import glob
from distutils.core import setup, Extension
# read the contents of your README file
from pathlib import Path
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
def pkgconfig(package, kw):
... |
import csv
from django.core.management.base import BaseCommand
from pytz import timezone
from dojo.models import Finding
from dojo.utils import get_system_setting
locale = timezone(get_system_setting('time_zone'))
"""
Author: Aaron Weaver
This script will extract all verified and active findings
"""
class Command... |
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,
Index,
Series,
)
import pandas._testing as tm
class TestReindex:
def test_reindex_dtype(self):
c = CategoricalIndex(["a", "b", "c", "a"])
res, indexer = c.reindex(["a", "c"])
... |
"""Configuration parsing module.
"""
import argparse
import logging
import os
import yaml
from .valid_options import CONFIG_TYPES
from ..tools.tools import split_url
log_levels = {'critical': logging.CRITICAL, 'error': logging.ERROR,
'warning': logging.WARNING, 'info': logging.INFO,
'debu... |
import logging
import time
from xml.etree.ElementTree import fromstring
import declxml as xml
import requests
from requests_cache import CachedSession
logger = logging.getLogger(__name__)
class BGGClient:
BASE_URL = "https://www.boardgamegeek.com/xmlapi2"
def __init__(self, cache=None, debug=False):
... |
import torch
import numpy as np
import random
from transformers import T5Tokenizer, T5ForConditionalGeneration
#Set all seeds to make output deterministic
torch.manual_seed(0)
np.random.seed(0)
random.seed(0)
#Paragraphs for which we want to generate queries
paragraphs = [
"Python is an interpreted, high-level and g... |
#!/usr/bin/env python
# CMPUT 410 Lab3
# Dylan Stankievech
# Jan 28, 2015
#
import cgi
form = cgi.FieldStorage()
birthdate = form.getvalue('birthdate')
hobby = form.getvalue('hobby')
gender = form.getvalue('gender')
card = form.getvalue('credit')
print "Content-type: text/html"
print
print "<html><head><title>P... |
a = int(input())
b = int(input())
print(a//b)
print(a%b)
print(divmod(a,b))
|
# coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... |
# Leo colorizer control file for pascal mode.
# This file is in the public domain.
# Properties for pascal mode.
properties = {
"commentEnd": "}",
"commentStart": "{",
"lineComment": "//",
}
# Attributes dict for pascal_main ruleset.
pascal_main_attributes_dict = {
"default": "null",
... |
#!/usr/bin/env python
"""
File: triangle_area_solution-garid.py
Find area and perimeter of rectangle
"""
__author__ = "Ochirgarid Chinzorig (Ochirgarid)"
__version__ = "1.0"
# Open file on read mode
inp = open("../test/test1.txt", "r")
# read input lines one by one
# and convert them to integer
a = int(inp.... |
from nixui.options.option_definition import OptionDefinition, Undefined
def test_expr_string_from_obj():
d = OptionDefinition.from_object(True)
assert d.expression_string.strip() == "true"
def test_obj_from_expr_string():
d = OptionDefinition.from_expression_string('if true then "bla" else "foo"')
a... |
from rest_framework import generics, mixins
from rest_framework.permissions import IsAuthenticated
from api.serializers import CategorySerializer2, ProductSerializer
from core.models import Category, Product
class CategoryListAPIView(generics.ListCreateAPIView):
def get_queryset(self):
return Category.o... |
import numpy as np
import theano
import theano.tensor as T
floatX = theano.config.floatX
device = theano.config.device
class Optimization:
def __init__(self, clip=None):
"""
Initialization
"""
self.clip = clip
def get_gradients(self, cost, params):
"""
Comput... |
# -*- coding: utf-8 -*-
import logging
# Default logger
fallbackLogger = logging.getLogger('large_image')
fallbackLogHandler = logging.StreamHandler()
fallbackLogHandler.setLevel(logging.INFO)
fallbackLogger.addHandler(fallbackLogHandler)
ConfigValues = {
'logger': fallbackLogger,
'logprint': fallbackLogger,... |
from flask_login import UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from app import db, login_manager
class Employee(db.Model,UserMixin):
#create the table name
#should be in plural form of the model
__tablename__='employees'
id=db.Column(db.Integer,primary_key... |
from django.contrib import admin
from django.urls import path
from . import views
urlpatterns = [
path('',views.home,name='home'),
path('add',views.add,name='add'),
] |
from config import ui
if 'CZ' == ui.language:
from .lang_cz import *
else:
from .lang_en import * |
# coding=utf-8
# Copyright 2020 HuggingFace Datasets 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 applica... |
from myapp.bp_general import bp_general
from myapp.bp_book.model_book import Book
from flask import render_template, url_for, redirect, request
@bp_general.route('/', methods=['GET', 'POST'])
@bp_general.route('/index', methods=['GET', 'POST'])
def do_home():
"""
Display all books, using pagination.
When ... |
"""
Cron tasks
==========
This module provides tools to manage periodic tasks using cron.
"""
def add_task(name, timespec, user, command, environment=None):
"""
Add a cron task.
The *command* will be run as *user* periodically.
You can use any valid `crontab(5)`_ *timespec*, including the
``@h... |
from typing import List
from pypadre.core.events.events import connect
from pypadre.core.model.execution import Execution
from pypadre.pod.repository.i_repository import IExecutionRepository
from pypadre.pod.service.base_service import ModelServiceMixin
from pypadre.core.events.events import CommonSignals
class Execu... |
"""
Quantiphyse - Compatibility link to refactored class
"""
from .viewer.pickers import *
|
##script for creating a histogram
## Load necessary modules
import pylab as plt
import numpy as np
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
f=open(os.path.join(BASE_DIR,'cox_regression','LUSC','coeffs_normalized_pvalues_adjusted.txt'))
data=[i.s... |
def func():
try:
import sedre
result = True
except NameError:
result = False
return result
def test_answer():
assert func() == True |
from __future__ import absolute_import
import importlib
from pwnlib.version import __version__
version = __version__
__all__ = [
'args',
'asm',
'atexception',
'atexit',
'crypto',
'commandline',
'constants',
'context',
'data',
'dynelf',
'encoders',
'elf',
'exceptio... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import plotting # pylint: disable=wrong-import-position, wrong-import-order
from unittest.mock import patch
from ... |
import datetime as dt
import logging
from rest_framework import status
from rest_framework.response import Response
from rest_framework.decorators import api_view
from prices.serializers import PricesSerializer
from prices.models import IdDB
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger... |
from django.contrib import admin
from .models import Cheese
@admin.register(Cheese)
class CheeseAdmin(admin.ModelAdmin):
pass
|
from .denseblock import DenseLayer, DenseBlock, ResidualDenseBlock
from .autoregressive import *
|
# -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
impo... |
from __future__ import annotations
from typing import Union, List, Optional, Dict, TYPE_CHECKING, Set
from pathlib import PurePosixPath
from collections import defaultdict
from abc import ABC
from .state import State, NodeStatus
from .parameter import Parameter
from .event import Event
from .meter import Meter
from .... |
from django.db.models import Case, Max, When
from datahub.core.query_utils import (
get_aggregate_subquery,
get_choices_as_case_expression,
get_front_end_url_expression,
get_full_name_expression,
get_string_agg_subquery,
)
from datahub.feature_flag.utils import is_feature_flag_active
from datahub.i... |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""MobileNet v1 models for Keras.
"""
from __future__ import print_function as _print_function
from tensorflow.python.keras.applications import MobileNet
from tensorflow.python.keras.appl... |
import sys
import numpy as np
import itertools
import deeptrack as dt
import pytest
import itertools
import cupy as cp
u = dt.units
def create_pipeline(elements=1024):
value = dt.Value(np.zeros((elements,)))
value = value + 14
value = value * (np.ones((elements,)) * 2)
value = value / 1.5
value =... |
from abc import ABCMeta, abstractmethod
from typing import Dict, Optional, Union
from fastapi.responses import Response, JSONResponse, PlainTextResponse
from rdflib import Graph, Namespace, URIRef, Literal, BNode
from rdflib.namespace import RDF, RDFS, PROF, DCTERMS, XSD
from connegp import Connegp, Profile, RDF_MEDIA... |
##Find depression area=name
##dem=raster
##polygonsofdepression=output vector
outputs_SAGAFILLSINKS_1=processing.runalg('saga:fillsinks', dem,0.01,None)
outputs_GDALOGRRASTERCALCULATOR_1=processing.runalg('gdalogr:rastercalculator', dem,'1',outputs_SAGAFILLSINKS_1['RESULT'],'1',None,'1',None,'1',None,'1',None,'1','A-B'... |
_base_ = [
'../../_base_/models/slowonly_r50.py',
'../../_base_/schedules/sgd_150e_warmup.py',
'../../_base_/default_runtime.py'
]
# model settings
model = dict(cls_head=dict(num_classes=51))
# dataset settings
split = 1
dataset_type = 'RawframeDataset'
data_root = 'data/hmdb51/rawframes'
data_root_val = ... |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import... |
# -*- coding: utf-8 -*-
import warnings
import plugin.builtin.barcode.mixins as mixin
import plugin.integration
hash_barcode = mixin.hash_barcode
class BarcodePlugin(mixin.BarcodeMixin, plugin.integration.IntegrationPluginBase):
"""
Legacy barcode plugin definition - will be replaced
Please use the new... |
from atom.ext.crispy_forms.forms import SingleButtonMixin
from braces.forms import UserKwargModelFormMixin
from dal import autocomplete
from django import forms
from .models import Case
class CaseForm(SingleButtonMixin, UserKwargModelFormMixin, forms.ModelForm):
def __init__(self, *args, **kwargs):
self.... |
# Copyright 2018 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 applicable ... |
from django.db import models
from django.contrib.auth.models import AbstractUser
class Person(AbstractUser):
ROLES = (
('admin', 'Administrator'),
('user', 'User'),
)
role = models.CharField(max_length=7, choices=ROLES, default='user')
category = models.ForeignKey('person.Category', on... |
import os, sys
# to read dependencies from ./lib direcroty
script_dir = os.path.dirname( os.path.realpath(__file__) )
sys.path.insert(0, script_dir + os.sep + "lib")
import logging, boto3, json, random
# setup log level to DEBUG
log = logging.getLogger()
log.setLevel(logging.DEBUG)
# initialize DynamoDB client
dynamo... |
# Made by @dyphen12
from flask import Flask, request
from flask_cors import CORS
from flask_restful import reqparse, abort, Api, Resource
import json
import os
from vibra.api.core import api_version
from vibra.api.users import handler as uhd
app = Flask(__name__)
api = Api(app)
CORS(app)
class Hello(Resource):
... |
import setuptools
setuptools.setup(
name='theo-database',
version='2.0.0',
install_requires=['theo-framework', 'pymongo'],
url='https://github.com/TheodoreWon/python-theo-database',
license='MIT',
author='Theodore Won',
author_email='taehee.won@gmail.com',
description='theo-database',
... |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import * # NOQA
from future import standard_library
standard_library.install_aliases() # NOQA
import chainer
from chainer import functions as F
from chai... |
from . import console
if __name__ in ["__main__", "__mp_main__"]:
ws = console.argexec() |
import time
import json
import logging
log = logging.getLogger(__name__)
import torch
#from memory_profiler import profile
import config as cfg
def store_checkpoint(checkpoint_file, state, optimizer, current_epoch, current_loss,\
verbosity=0):
r"""
:param checkpoint_file: target file
:param state: ipep... |
# -*- coding: utf-8 -*-
from .mlresponseproc import MLResponseProcessor
__author__ = 'Imdat Solak'
__email__ = 'imdat@solak.de'
__version__ = '0.1.1'
|
n, l = map(int, input().split())
amida = [input() for _ in range(l)]
goal = input()
i = l-1
pos = goal.find('o')
while i >= 0:
if pos > 0:
if amida[i][pos - 1] == '-':
i -= 1
pos -= 2
continue
if pos < 2 * n - 2:
if amida[i][pos + 1] == '-':
i -=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.