content stringlengths 5 1.05M |
|---|
import numpy as np
from .vice import VICE
from .sac_classifier import SACClassifier
from softlearning.misc.utils import mixup
class VICEGoalConditioned(VICE):
def _timestep_before_hook(self, *args, **kwargs):
# TODO(hartikainen): implement goal setting, something like
# goal = self.pool.get_goal.... |
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# 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/LICEN... |
from pybithumb.core import *
from pandas import DataFrame
import pandas as pd
import datetime
import math
class Bithumb:
@staticmethod
def _convert_unit(unit):
try:
unit = math.floor(unit * 10000) / 10000
return unit
except:
return 0
... |
from django import forms
from django.forms.widgets import RadioSelect, CheckboxSelectMultiple
from django.forms import TypedChoiceField
from django.forms.models import inlineformset_factory
from django.utils.translation import ugettext_lazy as _
from keyform.models import Request, KeyData, Contact, KeyType
cl... |
#!/usr/bin/python
# module_check: supported
# Avi Version: 17.1.1
# Copyright 2021 VMware, Inc. All rights reserved. VMware Confidential
# SPDX-License-Identifier: Apache License 2.0
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'commun... |
from .api import NasapiError, Nasapi #noqa |
import sys
from people_flow import YOLO
from people_flow import detect_video
if __name__ == '__main__':
video_path = 'test1.MP4'
output_path='human_counter-master'
detect_video(YOLO(), video_path, output_path)
print('sun')
|
from .routes import Tesseract_OCR_BLUEPRINT
from .routes import Tesseract_OCR_BLUEPRINT_WF
#from .documentstructure import DOCUMENTSTRUCTURE_BLUEPRINT |
# Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# b... |
import json5
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from django.utils import timezone
from home.models import SiparisKayitlari, Masa
from kullanici.models import Profil
from menu.models import Menu
import datetime
@login_required(login_url="/l... |
from django.shortcuts import render
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import Product,Denomination, Order, OrderItem
from end_users import serializers
# Create your views here.
""" All Product related APIs here"""
class ProductApiView(APIView):
seriali... |
"""
Contains some helper functions and classes.
"""
import os
import shutil
import typing as t
class attrdict(dict):
"""
Sub-class like python dict with support for I/O like attr.
>>> profile = attrdict({
'languages': ['python', 'cpp', 'javascript', 'c'],
'nickname': 'doge gui',
... |
"""
In this module are stored the main Neural Networks Architectures.
"""
from .base_architectures import (BaseDecoder, BaseDiscriminator, BaseEncoder,
BaseMetric)
__all__ = ["BaseDecoder", "BaseEncoder", "BaseMetric", "BaseDiscriminator"]
|
"""kernels tests."""
|
nome = str(input('Digite seu nome completo: ')).strip()
n = nome.split()
print(f"Seu primeiro nome é: {n[0]}")
print(f"Seu último nome é {n[len(n)-1]}")
|
#!/usr/bin/env python3
from matplotlib import pyplot as plt
from nltk.tokenize import word_tokenize
from classify import load_data
from features import FeatureExtractor
import pandas as pd
import numpy as np
def visualize_class_balance(data_path, classes):
class_counts = {c: 0 for c in classes}
for c in clas... |
from lib.userInterface import userInterface
if __name__ == '__main__':
ui = userInterface()
if ui.yesNoQuery("Input from file? [y/n]"):
path = input("Please input path of your file: ")
ui.fileInput(path)
else:
ui.userInput()
ui.quantize().predict()
print ("The predicted pr... |
from django.core.urlresolvers import reverse
from nose.tools import eq_
from mozillians.common.tests import TestCase
from mozillians.groups.tests import GroupFactory
from mozillians.users.tests import UserFactory
class OldGroupRedirectionMiddlewareTests(TestCase):
def setUp(self):
self.user = UserFactor... |
import os
hosturl = os.environ.get('HOSTURL')
from lightserv import create_app
from lightserv.config import DevConfig,ProdConfig
import socket
flask_mode = os.environ['FLASK_MODE']
if flask_mode == 'PROD':
app = create_app(ProdConfig)
elif flask_mode == 'DEV':
app = create_app(DevConfig)
if __name__ == '__main__':
... |
from dataclasses import dataclass
from expungeservice.models.charge import ChargeType
from expungeservice.models.charge import ChargeUtil
from expungeservice.models.expungement_result import TypeEligibility, EligibilityStatus
@dataclass(frozen=True)
class SevereCharge(ChargeType):
type_name: str = "Severe Charge... |
# coding=utf-8
# Copyright 2021 The TensorFlow 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 appl... |
# coding: utf-8
"""
Wavefront REST API Documentation
<p>The Wavefront REST API enables you to interact with Wavefront servers using standard REST API tools. You can use the REST API to automate commonly executed operations such as automatically tagging sources.</p><p>When you make REST API calls outside the W... |
"""
Rewrite spec/functional_specs/email_accounts_spec.rb
Creates account and checks, if the emails informing about the
new service subscription, new application sign-up to service and application
subscription to an app plan have been sent.
"""
import os
import re
import pytest
import yaml
import backoff
from testsuit... |
a, b, x, y = (int(input()) for _ in range(4))
p, q = (x - 1) * a + x, (x + 1) * a + x
e, r = (y - 1) * b + y, (y + 1) * b + y
print(-1 if q < e or r < p else str(max(p, e)) + ' ' + str(min(q, r)))
|
#!/usr/bin/python
"""
This is the most simple example to showcase Containernet.
"""
from containernet.net import Containernet
from containernet.node import DockerSta
from containernet.cli import CLI
from containernet.term import makeTerm
from mininet.log import info, setLogLevel
from mn_wifi.link import wmediumd
from m... |
from ErnosCube.mutation_node import MutationNode
from ErnosCube.cube_mutation import CubeMutation
from pytest import mark
class TestMutationNode:
"""Collection of all tests run on instances of the MutationNode."""
@mark.dependency(name="construction_1")
def test_construction_1(self):
MutationNode... |
import numpy
from SLIX import toolbox, io, visualization
import matplotlib
from matplotlib import pyplot as plt
import pytest
import shutil
import os
matplotlib.use('agg')
class TestVisualization:
def test_visualize_unit_vectors(self):
example = io.imread('tests/files/demo.nii')
peaks = toolbox.s... |
# Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import argparse
import logging
import shutil
import sys
import tempfile
import six
from telemetry import benchmark
fr... |
"""Kata url: https://www.codewars.com/kata/61123a6f2446320021db987d."""
from typing import Optional
def prev_mult_of_three(n: int) -> Optional[int]:
while n % 3:
n //= 10
return n or None
|
import numpy as np, json
import pickle, sys, argparse
from keras.models import Model
from keras import backend as K
from keras import initializers
from keras.optimizers import RMSprop
from keras.utils import to_categorical
from keras.callbacks import EarlyStopping, Callback, ModelCheckpoint
from keras.layers import *
f... |
import mne
import mne_bids
import numpy as np
from config import fname, n_jobs
report = mne.open_report(fname.report)
# Load raw data (tSSS already applied)
raw = mne_bids.read_raw_bids(fname.raw, fname.bids_root)
raw.load_data()
report.add_figs_to_section(raw.plot_psd(), 'PSD of unfiltered raw', 'Raw', replace=True... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import itertools
import time
import datetime
import threading
import traceback
import shutil
import re
import math
import wx
import pygame
from pygame.locals import MOUSEBUTTONDOWN, MOUSEBUTTONUP, KEYDOWN, KEYUP, USEREVENT
import cw
... |
from lib.config.config import cfg, pth
import torch
import torchvision
from torchvision import transforms, datasets
import os
import sys
sys.path.append('..')
sys.path.append('../..')
dataset_save_pth = pth.DATA_DIR
# 画像ファイルを読み込むための準備(channels x H x W)
transform = transforms.Compose([
transforms.ToTensor()
])
... |
from decimal import Decimal
while True:
a = input('Number: ').replace('0.', '')
b = Decimal('0')
for i, c in zip(a, range(-1, -1 - len(a), -1)):
b += Decimal(str(i)) * Decimal('2') ** Decimal(str(c))
print(b) |
class Color:
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
LIGHT_GRAY = (200, 200, 200)
GRAY = (127, 127, 127)
DARK_GRAY = (50, 50, 50)
RED = (0,0, 255)
GREEN = (0, 255, 0)
BLUE = (255, 0, 0)
YELLOW = (0, 255, 255)
CYAN = (255, 255, 0)
MAGENTA = (255, 0, 255)
|
#%%
import os
import pickle
import time
from pathlib import Path
import colorcet as cc
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from sklearn.decomposition import PCA
from sklearn.feature_selection import VarianceThreshold
from sklearn.model_selection import train_tes... |
class Final(type):
def _new_(meta,name,bases,attrs):
if issubclass():
raise TypeError
return super()._new_(meta,name,bases,attrs)
class Sealed(metaclass=Final):pass
class ShouldFail(Sealed):pass
|
"""COUNTER 5 test suite"""
|
# -*- coding: utf-8 -*-
#
# tborg/tborg.py
#
"""
The TunderBorg API
by Carl J. Nobile
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS ... |
# Generated by Django 3.2.3 on 2021-05-24 21:11
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.BigAutoField... |
#-------------------------------------------------------------------------------
# Author: Lukasz Janyst <lukasz@jany.st>
# Date: 26.11.2017
#
# Licensed under the 3-Clause BSD License, see the LICENSE file for details.
#-------------------------------------------------------------------------------
import logging
i... |
from setuptools import setup, find_packages
setup(
name='sixfab-tool',
version='0.0.3',
author='Ensar Karabudak',
author_email='ensarkarabudak@gmail.com',
description='Sixfab Diagnostic Tool',
license='MIT',
url='https://github.com/sixfab/setup-and-diagnostic-tool.git',
dependency_links... |
import json
import numpy
import torch
#intrinsics_dict = None
def load_intrinsics_repository(filename, stream='Depth'):
#global intrinsics_dict
with open(filename, 'r') as json_file:
intrinsics_repository = json.load(json_file)
if (stream == 'Depth'):
intrinsics_dict = dict((i... |
from adjudicator.base import Season, Phase
from adjudicator.decisions import Outcomes
from adjudicator.paradoxes import find_circular_movements
def process(state):
"""
Processes all orders in a turn.
"""
orders = state.orders
pieces = state.pieces
for order in orders:
order.check_legal... |
import petl
import simpleeval
from ..step import Step
from ..field import Field
class field_add(Step):
code = "field-add"
def __init__(
self,
descriptor=None,
*,
name=None,
value=None,
position=None,
incremental=False,
**options,
):
... |
import math
import random
from simulator.constants import BYTES_PER_PACKET
from simulator.trace import Trace
class Link():
def __init__(self, trace: Trace):
self.trace = trace
self.queue_delay = 0.0
self.queue_delay_update_time = 0.0
self.queue_size = self.trace.get_queue_size()
... |
import numpy as np
import torch
def covariance(m, rowvar=False):
'''Estimate a covariance matrix given data.
Covariance indicates the level to which two variables vary together.
If we examine N-dimensional samples, `X = [x_1, x_2, ... x_N]^T`,
then the covariance matrix element `C_{ij}` is the covar... |
import tweepy
import networkx as nx
class Utils():
"""
Utility functions for rundown.
"""
def __init__(self):
"""Constructor. Nothing to see here."""
self.rundown = self.init_rundown()
def init_rundown(self):
"""
Authenticates API, etc.
Parameters
-... |
'''Crie as classes necessárias para um sistema de gerenciamento de uma biblioteca. Os
bibliotecários deverão preencher o sistema com o título do livro, os autores, o ano, a editora, a
edição e o volume. A biblioteca também terá um sistema de pesquisa (outro software), portanto
será necessário conseguir acessar os atrib... |
#!/usr/bin/env python
# coding=utf8
import logging
from logging import NullHandler
logging.getLogger(__name__).addHandler(NullHandler())
|
class Solution:
def minCostClimbingStairs(self, cost: List[int]) -> int:
n = len(cost)
dp = [0 for _ in range(n)]
dp[-1] = cost[-1]
dp[-2] = cost[-2]
for i in range(n - 3, -1, -1):
dp[i] = cost[i] + min(dp[i + 1], dp[i + 2])
return min(dp[0], dp[1])
|
from zipfile import ZipFile
import zipfile
import wget
import os
import subprocess
import pycountry
# define variables
path = '/path/ipvanish/'
url = 'https://www.ipvanish.com/software/configs/configs.zip'
filename = path + '/' + os.path.basename(url)
best_ping = 99999
# get user's choice
def get_choice():
print(... |
from django.contrib import admin
from .models import (
Payment,
PaymentChoice
)
admin.site.register(Payment)
admin.site.register(PaymentChoice)
|
from gym_connect_four.envs.connect_four_env import ConnectFourEnv, ResultType
|
import requests
def coords_to_divisions(lat, lng):
url = f"https://v3.openstates.org/divisions.geo?lat={lat}&lng={lng}"
try:
data = requests.get(url).json()
return [d["id"] for d in data["divisions"]]
except Exception:
# be very resilient
return []
|
# Generated by Django 2.0.7 on 2018-10-25 11:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hivs_cd', '0011_add_field_condomdistribution_purpose'),
]
operations = [
migrations.AlterField(
... |
#!/home/bryanfeeney/anaconda3/bin/python3.6
#
# Simple script that uses the Microsoft Light Gradient-Boosted Machine-Learnign
# toolkit to make predictions *separately* for each value.
#
from datetime import date, timedelta, datetime
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_err... |
__source__ = 'https://leetcode.com/problems/intersection-of-two-linked-lists/'
# https://github.com/kamyu104/LeetCode/blob/master/Python/intersection-of-two-linked-lists.py
# Time: O(m + n)
# Space: O(1)
# LinkedList
#
# Description: Leetcode # 160. Intersection of Two Linked Lists
#
# Write a program to find the node... |
# Generated by Django 2.2.10 on 2020-08-23 11:08
from django.db import migrations, models
import django.db.models.deletion
import event.enums
class Migration(migrations.Migration):
dependencies = [("event", "0016_attachment_type")]
operations = [
migrations.CreateModel(
name="Schedule",... |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Created on Mar 1, 2020
@author: Chengning Zhang
"""
import warnings
warnings.filterwarnings("ignore")
def get_cv(cls,X,Y,M,n_splits=10,cv_type = "StratifiedKFold",verbose = True):
""" Cross validation to get CLL and accuracy and training time and precision and recall... |
#!/usr/bin/env python
#
# Public Domain 2014-2016 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as ... |
from time import sleep
from progress.bar import Bar
with Bar('Processing...') as bar:
for i in range(100):
sleep(0.02)
bar.next()
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (
absolute_import, division, print_function, with_statement,
unicode_literals
)
class DataObj:
def __init__(self, str, *args, **kwargs):
self.docs = None
self.span = None
str = self.preprocess(str)
def prep... |
import pygame
import time
class Clock:
def __init__(self, profile: int, turbo: bool):
self.cycle = 0
self.frame = 0
self.pyclock = pygame.time.Clock()
self.start = time.time()
self.profile = profile
self.turbo = turbo
def tick(self) -> bool:
self.cycle ... |
from cascade_at.core.log import get_loggers
LOG = get_loggers(__name__)
class InputDataError(Exception):
"""These are errors that result from faults in the input data."""
class SettingsError(InputDataError):
def __init__(self, message, form_errors=None, form_data=None):
super().__init__(message)
... |
import logging
from pipelines.plugin.base_plugin import BasePlugin
from pipelines.plugin.exceptions import PluginError
from pipelines.plugin.utils import class_name
log = logging.getLogger('pipelines')
class PluginManager():
def __init__(self):
self.plugins = {}
def get_plugin(self, name):
... |
import json
import os
from typing import List, Optional
from dkron_python.api import Dkron, DkronException
import typer
app = typer.Typer()
get = typer.Typer(help="Fetch information about a resource")
apply = typer.Typer(help="Apply a resource")
delete = typer.Typer(help="Delete a resource")
app.add_typer(get, name="g... |
class ServiceProvider():
wsgi = True
def __init__(self):
self.app = None
def boot(self):
pass
def register(self):
self.app.bind('Request', object)
def load_app(self, app):
self.app = app
return self
|
from dynabuffers.api.ISerializable import ISerializable, ByteBuffer
from dynabuffers.ast.ClassType import ClassType
from dynabuffers.ast.EnumType import EnumType
from dynabuffers.ast.UnionType import UnionType
from dynabuffers.ast.annotation.GreaterEquals import GreaterEquals
from dynabuffers.ast.annotation.GreaterThan... |
# uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\suntan\suntan_ops.py
# Compiled at: 2019-05-09 01:16:48
# Size of source mod 2**32: 1473 bytes
... |
from avatar2 import QemuTarget
from avatar2 import MemoryRange
from avatar2 import Avatar
from avatar2.archs import ARM
from avatar2.targets import Target, TargetStates
from avatar2.message import *
import tempfile
import os
import time
import intervaltree
import logging
from nose.tools import *
QEMU_EXECUTABLE = ... |
"""
This module contains our unit and functional tests for the "think_aloud" application.
"""
# Create your tests here.
|
"""Database objects."""
import sqlalchemy
from collections import Mapping
from sqlalchemy.engine.url import make_url
from sqlalchemy.event import listen
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session
from sqlalchemy.orm.session import sessionmaker
from .exceptions im... |
def find_next_square(sq):
|
#!/usr/bin/python3.7
########################################################################################
# pvt_collector/tedlar.py - Represents an tedlar layer within a PVT panel.
#
# Author: Ben Winchester
# Copyright: Ben Winchester, 2021
##########################################################################... |
import time
import random
from const import *
from util.logger import logger
class Session():
def __init__(self):
# requests.adapters.DEFAULT_RETRIES = 5 # 增加重試次數,避免連線失效
self.has_login = False
self.session = requests.Session()
self.session.headers = {
'User-Agent': make... |
# Requests may need to be installed for this script to work
import requests
import re
import config
# Here we pass our client id and secret token
auth = requests.auth.HTTPBasicAuth(config.client_id, config.secret_token)
# Here we pass our login method (password), username, and password
data = {'grant_type': 'password... |
"""
# =============================================================================
# Simulating the double pendulum using Runge–Kutta method (RK4)
# =============================================================================
Created on Fri Jul 17 2020
@author: Ahmed Alkharusi
"""
import numpy as np
import ... |
from __future__ import annotations
from datetime import date
from typing import (
Literal,
Optional,
Sequence,
)
from pydantic.fields import Field
from pydantic.types import StrictBool
from ..api import (
BodyParams,
EndpointData,
Methods,
WrApiQueryParams,
)
from ..types_.endpoint import... |
import datetime as _datetime
import os
import random
import string
import inflect
import six
from . import mock_random
inflectify = inflect.engine()
def _slugify(string):
"""
This is not as good as a proper slugification function, but the input space is limited
>>> _slugify("beets")... |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.internet import reactor
from twisted.web import proxy, server
site = server.Site(proxy.ReverseProxyResource('www.yahoo.com', 80, ''))
reactor.listenTCP(8080, site)
reactor.run()
|
from torch.optim.lr_scheduler import LambdaLR
def get_linear_schedule_with_warmup(optimizer, num_warmup_steps, num_training_steps, last_epoch=-1):
""" Create a schedule with a learning rate that decreases linearly after
linearly increasing during a warmup period.
"""
def lr_lambda(current_step):
... |
# Copyright (c) 2019-2021, Jonas Eschle, Jim Pivarski, Eduardo Rodrigues, and Henry Schreiner.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
import pytest
import vector
ak = pytest.importorskip("awkward")
numba = pytest.importorsk... |
import socket #for sockets
import sys #for exit
# create dgram udp socket
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
except socket.error:
print('Failed to create socket')
sys.exit()
HOST = '' # Symbolic name meaning all available interfaces
PORT = 6000 # Arbitrary non-privileged por... |
# Copyright (c) 2018 Sony Pictures Imageworks 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... |
#!/usr/bin/env python3
#
# Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center
# Distributed under the terms of the 3-clause BSD License.
import time
import unittest
from ipykernel.tests.utils import execute, wait_for_idle
from sos_notebook.test_utils import flush_channels, sos_kernel, Noteboo... |
"""Base method for all global interpretations. Is
a subclass of base ModelInterpreter"""
from ..model_interpreter import ModelInterpreter
class BaseGlobalInterpretation(ModelInterpreter):
"""Base class for global model interpretations"""
pass
|
import json
import unittest
from pyshared.server.ref import CallCommand
from pyshared.server.ref import DelCommand
from pyshared.server.ref import ListCommand
from pyshared.server.ref import LocalSharedResourcesManager
from pyshared.server.ref import SetCommand
from pyshared.server.ref import default_command_mapper
fr... |
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
class RightBoard:
def __init__(self, driver):
self.driver = driver
self.elements = RightBoardElements(self.driver)
def click(self, elem):
self.driver.execute_script(
"arguments[0].c... |
import threading
import time
import signal
import sys
from callbacks_event_listener import EventListener
from wpwithin_python import WPWithin,\
PricePerUnit,\
Price,\
Service,\
CommonPSPKeys,\
... |
from django.urls import path, include
urlpatterns = [
path('', include('accounts.urls.accounts')),
path('', include('accounts.urls.employers')),
path('', include('accounts.urls.professionals')),
] |
from django.shortcuts import render
from django.http import HttpResponse
from notice.models import Notice, Qna
from main.models import search_word
from django.views.generic import ListView
from django.db.models import Q
from django.utils import timezone
import datetime
def main(request):
# Main_Notice = Notice.ob... |
import json
from django import template
register = template.Library()
@register.filter
def here(page, request):
return request.path.startswith(page.get_absolute_url())
@register.simple_tag
def node_module(path):
return '/node_modules/{}'.format(path)
@register.assignment_tag(takes_context=True)
def navi... |
from django.db import models
from django.contrib.auth.models import User
from pyuploadcare.dj.models import ImageField
# Create your models here.
class Neighborhood(models.Model):
name = models.CharField(max_length=100)
location = models.CharField(max_length=100)
admin = models.ForeignKey("Profile", on_del... |
##
# Copyright © 2020, The Gust Framework Authors. All rights reserved.
#
# The Gust/Elide framework and tools, and all associated source or object computer code, except where otherwise noted,
# are licensed under the Zero Prosperity license, which is enclosed in this repository, in the file LICENSE.txt. Use of
# this ... |
#!/usr/bin/env python3
import sys
from os import path
sys.path.insert(0, path.join(path.dirname(__file__)))
from importers.monzo_debit import Importer as monzo_debit_importer
from beancount.ingest import extract
account_id = "acc_yourMonzoAccountId"
account = "Assets:Monzo:Something"
CONFIG = [
monzo_debit_impo... |
import os
import sys
import tensorflow as tf
from absl import app, logging
from absl.flags import argparse_flags
import _jsonnet
def parse_args(args, parser):
# Parse command line arguments
parser = parser if parser else argparse_flags.ArgumentParser()
parser.add_argument("input", type=str) # Name of T... |
import logging
from typing import Any, List, Optional
from homeassistant.components.select import SelectEntity
from gehomesdk import ErdCodeType
from ...devices import ApplianceApi
from .ge_erd_entity import GeErdEntity
from .options_converter import OptionsConverter
_LOGGER = logging.getLogger(__name__)
class G... |
import webbrowser
def open_page(url: str, new: int = 0, autoraise: bool = True):
webbrowser.open(url, new=new, autoraise=autoraise)
actions = {'open webpage': open_page}
|
def util(node,visited,recstack):
visited[node]=True
recstack[node]=True
for i in graph[node]:
if visited[i]==False:
if util(i,visited,recstack):
return True
elif recstack[i]==True:
return True
recstack[node]=False
return False
de... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.