content stringlengths 5 1.05M |
|---|
# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
import os.path as osp
import platform
import shutil
import sys
import tempfile
import warnings
from importlib import import_module
from mmcv.utils import Config, ConfigDict
from mmcv.utils.config import BASE_KEY, DEPRECATION_KEY
from mmcv.... |
import os
import zipfile
import shutil
import requests
import pytest
from mdai.preprocess import Project
FIXTURES_BASE_URL = "https://storage.googleapis.com/mdai-app-data/test-fixtures/mdai-client-py/"
IMG_FILE = "mdai_staging_project_bwRnkNW2_images_2018-08-25-192424.zip"
ANNO_FILE = "mdai_staging_project_bwRnkNW2_a... |
#!/bin/python3
from LynxDataFetcher import LynxDataFetcher
def main():
lynx_data_fetcher = LynxDataFetcher()
lynx_data_fetcher.run()
if __name__ == '__main__':
main() |
import numpy as np
# Number of inputs
n = 10
# Threshold activation function
def f(v):
return 1*(v>0)
# Weight vector 'w' {-1,1}^n, and at least one element is '1'
w = 2 * np.concatenate((np.array([1]), np.random.randint(2,size=(n-1,)))) - 1
print("Weight vector 'w' :\t" + str(w))
# Perfect input vect... |
from __future__ import print_function
import argparse, sys
from lxml.etree import iterparse
def main(argv=None):
parser = argparse.ArgumentParser()
parser.add_argument('filenames', nargs='*', help='filenames to check')
parser.add_argument(
'--forbidden-attributes',
type=lambda s: s.split('... |
#Função Main
'''
def main():
print("Olá mundo!")
if __name__ == "__main__":
main()
'''
|
##############################################
# The MIT License (MIT)
# Copyright (c) 2014 Kevin Walchko
# see LICENSE for full details
##############################################
# -*- coding: utf-8 -*
import cv2
from opencv_camera.color_space import bgr2gray, gray2bgr
import numpy as np
from ..apriltag.apriltag_m... |
"""
Very simple test of the sentence slicing by <PAD> tags
TODO: could add a bunch more simple tests for the tokenization utils
"""
import pytest
import stanza
from kalmfl.multistanza.tests import *
from kalmfl.multistanza.models.tokenization import utils
pytestmark = [pytest.mark.travis, pytest.mark.pipeline]
def... |
from collections import OrderedDict
from .states import DefaultState
from lewis.devices import StateMachineDevice
class SimulatedDh2000(StateMachineDevice):
def _initialize_data(self):
"""
Initialize all of the device's attributes.
"""
self._shutter_is_open = False
self._... |
from functools import wraps
from flask import (Flask, flash, redirect, render_template, request,
session, url_for)
import globus_sdk
import requests
app = Flask(__name__)
app.config.from_pyfile("moc.conf")
API_URL = ""
def authenticated(fn):
"""decorator for requiring authentication."""
... |
# -*- coding: utf-8 -*-
# Copyright 2015-2022 CERN
#
# 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 a... |
from .orbitalmechanics import *
from .shortpathfinding import * |
import os
import glob
import torch
import numpy as np
from models.resnet_50 import resnet50_use
from load_data import transfer_BFM09, BFM, load_img, Preprocess, save_obj
from reconstruction_mesh import reconstruction, render_img, transform_face_shape, estimate_intrinsic
def recon():
# input and output folder
... |
"""
This is the script that is used for evaluating phases for physical or simulation forward model
This code and data is released under the Creative Commons Attribution-NonCommercial 4.0 International license (CC BY-NC.) In a nutshell:
# The license is only for non-commercial use (commercial licenses can be ob... |
#
# @lc app=leetcode id=39 lang=python3
#
# [39] Combination Sum
#
# https://leetcode.com/problems/combination-sum/description/
#
# algorithms
# Medium (58.89%)
# Likes: 5551
# Dislikes: 144
# Total Accepted: 696.6K
# Total Submissions: 1.2M
# Testcase Example: '[2,3,6,7]\n7'
#
# Given an array of distinct integ... |
from itertools import product
alpha = ['A', 'T', 'C', 'G']
motifs = [a+b+c+d+e+f+g for a,b,c,d,e,f,g in product(alpha, repeat=7)]
with open('motifs7.txt', 'w') as f:
for item in motifs:
f.write("%s\n" % item)
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/3/13 14:46
# @Author : yaoh
# @email : hyao666@foxmail.com
# @File : result_present.py
# @Software: PyCharm Community Edition
import tensorflow as tf
import random
import matplotlib.pyplot as plt
from api_of_data_prepare import *
plt.rcPar... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Standard module
import sys
import os
import threading
import ssl
import json
from base64 import b64encode
import argparse
import time
import copy
from io import StringIO
import threading
from pprint import pprint
import lzma
import time
import urllib
from urllib.request... |
import tweepy
import logging
from config import create_api
import json
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger()
class FavRetweetListener(tweepy.StreamListener):
def __init__(self, api):
self.api = api
self.me = api.me()
def on_status(self, tweet):
logger.in... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: fenc=utf-8:et:ts=4:sts=4:sw=4:fdm=marker
from setuptools import setup
setup(
name='term-grid',
version='0.1.0',
description='Grid that can be displayed using the minimum number of lines possible.',
url='https://github.com/ArniDagur/python-term-grid',... |
import django_filters
from rest_framework import viewsets
from api_v1.serializers.wydawnictwo_zwarte import (
Wydawnictwo_Zwarte_AutorSerializer,
Wydawnictwo_ZwarteSerializer,
)
from api_v1.viewsets.common import UkryjStatusyKorektyMixin
from bpp.models import Wydawnictwo_Zwarte, Wydawnictwo_Zwarte_Autor
cla... |
from agenda.model import User, Event, Venue, Tag
from flask import abort, send_file
from agenda import app
import io
ENTITY_TYPES = {'user': User,
'venue': Venue,
'event': Event,
'tag': Tag}
@app.route('/thumb/<entity_type>/<entity_id>.<ext>', defaults={'thumb': True})
... |
# 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 ... |
import os
import sys
import git
from azul import config
"""
Ensure that the currently checked out branch matches the selected deployemnt
"""
def check_branch(branch, stage):
"""
>>> check_branch('dev', 'develop')
>>> check_branch('feature/foo', 'prod')
Traceback (most recent call last):
...
... |
"""
Contains the trainable sub-network of an audio classifier based on the L3
pre-trained feature extractor. Handles calling the training and evaluation.
"""
from matplotlib.pyplot import show
import torch
import torch.nn as nn
import torch.optim as optim
from utility.network_functions import train_nn, test_nn
from de... |
from .utils import Atom, Residue, ActiveSite
import matplotlib.pyplot as plt
import numpy as np
from .helpers import *
from Bio import pairwise2
import rmsd
from sklearn.decomposition import PCA
import networkx as nx
from networkx.drawing.nx_agraph import graphviz_layout
def compute_similarity(site_a, site_b):
"""... |
# -*- coding: utf-8 -*-
'''
Manage RSA encryption via pycrypto
The keydata consists of the following:
pub: PEM encoded public key
priv: PEM encoded private key
'''
SEC_BACKEND = 'pycrypto_aes'
# Import pycrypto libs
import Crypto.Cipher
import Crypto.PublicKey
import Crypto.Signature # pylint: disable=E061... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from .models import Mptt, Treebeardmp, Treebeardal, Treebeardns, Example
from mptt.admin import DraggableMPTTAdmin
from treebeard.admin import TreeAdmin
from treebeard.forms import movenodeform_factory
class MpttAdmin(Dr... |
goal = 64
time = 11
result = goal * time
print("Через 11 годин в нього буде", result, "блоки")
for n in range(1, 12):
print(n * goal)
|
'''
@Author: Shuai Wang
@Github: https://github.com/wsustcid
@Version: 1.0.0
@Date: 2020-05-28 22:19:51
@LastEditTime: 2020-09-15 23:32:47
'''
import os
import sys
import numpy as np
import tensorflow as tf
base_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(base_dir, '..'))
from utils ... |
"""Module for testing seqrepo access class"""
import pytest
from uta_tools.data_sources import SeqRepoAccess
@pytest.fixture(scope="module")
def test_seqrepo_access():
"""Create SeqRepoAccess test fixture"""
return SeqRepoAccess()
def test_get_reference_sequence(test_seqrepo_access):
"""Test that get_r... |
# Author: Jochen Gast <jochen.gast@visinf.tu-darmstadt.de>
import numpy as np
import torch
from matplotlib import cm
from torch import nn
# ----------------------------------------------------------------------------------------
# See https://matplotlib.org/examples/color/colormaps_reference.html
#
# Typical choices ... |
import cv2
import numpy as np
state = [ 0,0,0, # current sticker colors
0,0,0,
0,0,0 ]
facePos = 0
current_stickers = [[150, 200], [180, 200], [210, 200],
[150, 230], [180, 230], [210, 230],
[150, 260], [180, 260], [210, 260]]
ds... |
import copy
import warnings
from Constants import TARGET_REGISTER, RAND_VALUE, FOCUS_REGISTER, ADDRESS, OPERAND_TYPE, OPERANDS, ISSUE_SLOT
from util.Processor import Processor
class Instruction:
def __init__(self, assembly: str, mutable=True):
# set default enabled features
self.isRandValueRando... |
from oslo.config import cfg
import addons
src = cfg.OptGroup(name='src',
title='Credentials and general config for source cloud')
src_opts = [
cfg.StrOpt('type', default='os',
help='os - OpenStack Cloud'),
cfg.StrOpt('auth_url', default='-',
help='Keystone servi... |
# Copyright 2018 Lukas Jendele and Ondrej Skopek.
#
# 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 a... |
import numpy as np
def convert_locations_to_boxes(locations, priors, center_variance, size_variance):
"""Convert regressional location results of SSD into boxes in the form of (center_x, center_y, h, w).
The conversion:
$$predicted\_center * center_variance = \frac {real\_center - prior\_center} {pri... |
class Animation:
def __init__(self, sheet_width, sheet_height, width, height, delay=1000, loop_start=0, loop_end=0):
self.sheet_width = sheet_width
self.sheet_height = sheet_height
self.width = width
self.height = height
self.delay = delay
if int(sheet_width % width)... |
import argparse
import os
import sys
import tomlkit
from . import exceptions
from . import sync
try:
import importlib_metadata
except ImportError:
# Use third party library on Python < 3.8
import importlib.metadata as importlib_metadata
# Special error codes
# according to http://tldp.org/LDP/abs/html... |
"""
Biological assembly of a structure
==================================
Often the biological assembly (or biological unit) reveals the complete
picture of a protein function, may it be a viral capsid or a
microfilament.
However, the usual records in an *PDB*/*mmCIF*/*MMTF* file usually
describe only the asymmetric u... |
"""
This code was copied from https://realpython.com/python-code-quality/
code_with_lint.py
Example Code with lots of lint!
"""
import io
from math import *
from time import time
some_global_var = 'GLOBAL VAR NAMES SHOULD BE IN ALL_CAPS_WITH_UNDERSCOES'
def multiply(x, y):
"""
This returns the result of a ... |
"""Adding city to matching rules.
Revision ID: 254ab76b2903
Revises: 4d9808122745
Create Date: 2020-03-08 16:03:20.197617
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '254ab76b2903'
down_revision = '4d9808122745'
branch_labels = None
depends_on = None
def ... |
import os
import logging
import random
import numpy as np
class CycleGanDatasetSmall:
def __init__(self, dataset_one, dataset_two, sample_size, transform=None):
"""Dataset implementation for MNIST to SVHN GAN
dataset_one, dataset_two (sequence): datasets with source and target images.
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('readings', '0009_auto_20150920_1402'),
... |
import numpy as np
import itertools as it
class SymbolicArray(np.ndarray):
def __new__(cls, arr, symbolic=None, **kwargs):
if isinstance(arr, cls):
return arr
arr = np.array(arr, copy=False, **kwargs)
obj = arr.view(cls)
obj.symbolic = str(symbolic or np.array2string(ar... |
#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import js2c
import os
import re
import sys
FILENAME = "src/runtime/runtime.h"
LISTHEAD = re.compile(r"#define\s+(\w+LIST\w*)\((\w+)\... |
from django.shortcuts import render, redirect
from django.http import HttpResponseRedirect, Http404
from django.contrib import messages
from django.core.exceptions import SuspiciousOperation
from . import installer, settings, auth, smtp
from .functions import get_option, set_option, get_navigation_links, \
get_... |
from django.contrib import admin
from .models import Agent, AgentCustomField, AgentHistory, Note
admin.site.register(Agent)
admin.site.register(Note)
admin.site.register(AgentCustomField)
admin.site.register(AgentHistory)
|
from collections import namedtuple
from itertools import chain
import torch
import torch.nn as nn
from torch.utils.checkpoint import checkpoint
from .optimizers import IngraphGradientDescent
from .utils import copy_and_replace, do_not_copy, disable_batchnorm_stats, nested_flatten, nested_pack
class NaiveMAML(nn.Modu... |
import sys,os
sys.path.append('../')
import pandas as pd
from Segment.HMM.Vertebi import Vertebi
from Segment.DataProcess.data import WORD_COL,TAG_COL
from tqdm import tqdm
PRED_RES_PATH_ROOT ='./preds'
def predict_main(data_path,pred_name,matrix_path,mode='load'):
hmm_vertebi = Vertebi(mode=mode,model_path=matr... |
class HourNotationStrategy:
def calculate_minutes(self, hour_notation_string):
change_sign = False
if hour_notation_string.startswith('-'):
hour_notation_string = hour_notation_string[1:]
change_sign = True
time_list = hour_notation_string.split(':')
hours = ... |
"""使用go mod初始化golang的执行环境."""
import pkgutil
import warnings
from pathlib import Path
from typing import Optional, List
from pmfp.utils.tools_info_utils import get_golang_version
from pmfp.utils.template_utils import template_2_content
go_mod_template = ""
template_io = pkgutil.get_data('pmfp.entrypoint.env_.new.sourc... |
'''
Please note that this file is an example, not an official Lotame-supported
tool. The Support team at Lotame does not provide support for this script,
as it's only meant to serve as a guide to help you use the Services API.
Filename: delete_or_pause_pixels.py
Author: Brett Coker
Python Versi... |
import re
import urllib2
from bs4 import BeautifulSoup
def find_media():
global url_type
media_type = raw_input('Are you asking about a movie or tv show? ')
if (media_type.upper() == 'MOVIE'):
url_type = '/m/'
elif (media_type.upper() == 'TV SHOW' or media_type.upper() == 'TV'):
url_type = '/tv/'
... |
from gpio_utils import *
from Constants import *
import rNTPTime
import socket
import time
import csv
import subprocess
import sys
# gets sensor values from the temperature sensor and the microphone, writes the data to a file and sends the data over a socket
def soundSense(startDateTime, hostIP, BASE_PORT, streaming ... |
#!/usr/bin/python3
# api.py
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import git
import json
import shutil
from uuid import uuid4
from config import FLASK_IP, FLASK_PORT, FLASK_SECRET_KEY, DEBUG_TOKEN
from flask import Flask, jsonify, redirect, session, request, ... |
import psycopg2
import argparse
import logging
import os
import pandas as pd
import logging
import time
import pickle
import sys
from psycopg2.extras import NamedTupleCursor
# logger = logging.getLogger(__name__)
parser = argparse.ArgumentParser()
# parser.add_argument("--verbose", dest='verbosity', help="increase out... |
import math
r = float(input('Enter circle radius => r = '))
area = math.pi * math.pow(r, 2)
perimeter = 2 * math.pi * r
print('Area = {0}'.format(area))
print('Perimeter = {0}'.format(perimeter))
|
#!/usr/bin/env python
import errno
import io
import platform
import os
import re
import sys
import sysconfig
import subprocess
from distutils.version import LooseVersion
from setuptools import setup, Extension, find_packages, Command
from setuptools.command.build_ext import build_ext
from setuptools.command.test impor... |
from gym_unity.envs import UnityEnv
from rl_main.conf.names import EnvironmentName, OSName
from rl_main.environments.environment import Environment
class Chaser_v1(Environment):
unity_env_worker_id = 0
def __init__(self, platform):
if platform == OSName.MAC:
env_filename = EnvironmentNam... |
import numpy as onp
from torch.utils import data
def numpy_collate(batch):
if isinstance(batch[0], onp.ndarray):
return onp.stack(batch)
elif isinstance(batch[0], (tuple, list)):
transposed = zip(*batch)
return [numpy_collate(samples) for samples in transposed]
else:
return... |
from functools import reduce
from typing import Callable, Optional
import torch
import torch.nn as nn
from torch import Tensor
from transformers import (
AutoModel,
AutoModelForCausalLM,
AutoModelForMaskedLM,
AutoModelForQuestionAnswering,
AutoModelForSequenceClassification,
AutoModelForTokenCl... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://stepik.org/lesson/349848/step/1?unit=333703
import random
import string
from typing import Union, List
DIGITS = string.digits
LOWERCASE_LETTERS = string.ascii_lowercase
UPPERCASE_LETTERS = string.ascii_uppercase
PUNCTUATION ... |
from cStringIO import StringIO
class Response(object):
def marshal(self):
"""
:rtype: str
"""
class LoginResponse(Response):
def __init__(self):
self.components = []
self.buf = StringIO()
def add_component(self, component):
self... |
#! /usr/bin/python3
from sys import argv
from copy import deepcopy
import time
import os
DIM = 9
class Cell:
__slots__ = ('value', 'possible')
def __init__(self, initial):
"""
Constructor
"""
self.value = initial
self.possible = [] # [0,0,0,0,0,0,0,0,0]
def __st... |
from models import ImageFolder
from rest_framework import viewsets, status
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from .serializers import ImageFolderSerializer, ImageFolderCreateSerializer
class ImageFolderViewSet(viewsets.ModelViewSet):
serializer_cl... |
# Source code modified from scipy.stats._multivariate.py
#
# Copyright (c) 2001, 2002 Enthought, Inc.
# All rights reserved.
#
# Copyright (c) 2003-2019 SciPy Developers.
# All rights reserved.
from jax import lax, random
from jax.nn import softmax
import jax.numpy as np
from jax.numpy.lax_numpy import _promote_dtypes... |
import torch
import torch.nn as nn
class MaskConv(nn.Module):
"""
Masking Convolutional Neural Network
Adds padding to the output of the module based on the given lengths.
This is to ensure that the results of the model do not change when batch sizes change during inference.
Input needs to be in ... |
import torch
from cogdl.data import Data
from cogdl.datasets import BaseDataset, register_dataset, build_dataset, build_dataset_from_name
from cogdl.utils import build_args_from_dict
@register_dataset("mydataset")
class MyNodeClassificationDataset(BaseDataset):
def __init__(self):
super(MyNodeClassificati... |
# Problem Lab04-2
import sys
def process_file(fileName):
input_file = open(fileName, "r")
for line in input_file:
line = line.rstrip('\n')
print(line)
input_file.close()
if __name__ == "__main__":
# process_file(sys.argv[1])
process_file('list.txt') |
from django.db import models
from django.contrib.auth.models import User
class Subject(models.Model):
subject = models.CharField("Предмет", max_length=100)
profile_types = models.TextChoices('profile_types', 'Профильная_дисциплина Базовая_дисциплина')
profile = models.CharField("Тип предмета", blan... |
import unittest
import itertools
from ttt.board import board
from ttt.player import player
import game
class GameTests(unittest.TestCase):
@staticmethod
def create_board(o_squares, x_squares):
b = board.Board(9)
[b.place(i, "O") for i in o_squares]
[b.place(i, "X") for i in x_squares... |
# pylint: disable=no-name-in-module
import sys
from os.path import dirname, join
import numpy as np
import pandas as pd
from scipy.special import hyp2f1
from statsmodels.genmod.generalized_linear_model import GLM
from statsmodels.tools.sm_exceptions import PerfectSeparationError
from bambi.families.univariate impor... |
# -*- coding: utf-8 -*-
'''
ADC, Add with Carry Test
This is an arithmetic instruction of the 6502.
'''
import unittest
from nesasm.tests import MetaInstructionCase
from six import add_metaclass
@add_metaclass(MetaInstructionCase)
class AdcImmTest(unittest.TestCase):
'''
Test the arithmetic operation ADC be... |
# -*- coding: utf-8 -*-
"""
@author: Andrés Cámara
"""
#Programa que realiza varias operaciones matemáticas,
#te pide que metas una ocpión y que introduzcas los valores
#de una forma más eficiente
#Importamos la librería math
import math
#Funcion para introducir tu nombre
def introduceNombre ():
nombre = input("I... |
import os
import errno
import itertools
directory = 'C:/Users/Jan/Dropbox/Bachelorarbeit/Programm/Testdaten/Raw DataSet/'
# listdir = [file for file in os.listdir(directory) if file not in ['capa.txt', 'capb.txt', 'capc.txt']]
# for d in listdir:
# print('Opening dir: ', directory+'/'+d)
# with open(directory... |
class Pessoa:
ano_atual = 2020
def __init__(self, nome, idade):
self.nome = nome
self.idade = idade
def get_ano_nascimento(self):
print(self.ano_atual - self.idade)
@classmethod
def por_ano_nascimento(cls, nome, ano_nascimento):
idade = cls.ano_atual - ano_nascimento
... |
# This sample tests that generic type variables
# with no bound type properly generate errors. It tests
# both class-defined and function-defined type variables.
from typing import Generic, TypeVar
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
class ClassA(Generic[_T1]):
async def func1(self, a: _T1):
# Th... |
"""For backward compatibility only."""
# pylint: skip-file
from neurom.check.morphology_checks import * # pragma: no cover
from neurom.utils import deprecated_module # pragma: no cover
deprecated_module('Module `neurom.check.neuron_checks` is deprecated. Use'
'`neurom.check.morphology_checks` inst... |
#!/usr/bin/python3
# Generate DNS RR type constants for resolv header files.
# Copyright (C) 2016-2020 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
# The GNU C Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as... |
import numpy as np
import matplotlib.pyplot as plt
from keras.models import Sequential, Model
from keras.layers import Dense, Activation, Input, Dropout, Flatten
from keras.datasets import mnist
from keras.callbacks import EarlyStopping
from keras.utils import to_categorical, plot_model
from keras.optimizers import Ada... |
# nums = [2,7,9,11]
# target = 9
class TwoSum:
def __init__(self, nums, target):
self.nums = nums
self.target = target
def two_sum_optimize(self):
container = dict()
for index, value in enumerate(self.nums):
if self.target - value in container:
ret... |
# this file was automatically generated
major = 0
minor = 6
release = 20210127043551
version = '%d.%d.%d' % (major, minor, release)
|
from django.contrib import admin
from .models import Profile, Area, Posts, Business
admin.site.register(Profile)
admin.site.register(Area)
admin.site.register(Business)
admin.site.register(Posts)
|
droplet = '💧'
dashing_away = '💨'
barometer = '🧭'
weather_conditions = {
'ясно': '☀',
'малооблачно': '🌤',
'облачно с прояснениями': '⛅',
'небольшой дождь': '🌧',
'дождь': '🌧',
'пасмурно': '☁',
'ураган': '🌪',
'туман': '🌫',
'небольшой снег': '🌨',
'снег': '🌨',... |
#
# PySNMP MIB module CISCO-NBAR-PROTOCOL-DISCOVERY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-NBAR-PROTOCOL-DISCOVERY-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:51:22 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using P... |
"""
drapion.parsers
~~~~~~~~~~~~~~~
This module implements Drapion core parsers
:copyright: (c) 2018 Giancarlo Rocha
:license: Apache 2.0, see LICENSE for more details.
"""
import json
from json import JSONDecodeError
from typing import Dict, List, Union
from drapion import objects
class BaseParser:
@classmet... |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
class CommonForm(FlaskForm):
input = StringField('Input')
postcode = StringField('Postcode')
uprn = StringField('UPRN')
classificationfilter = StringField('Classification Filter')
limit = StringField('Limi... |
"""Basic CLI Dork.
"""
import argparse
import os
import re
from io import StringIO
import cursor
import dork
import dork.saveload as sl
__all__ = ["main"]
__EXTENSION__ = ".yml"
def is_filename_compliant(filename):
"""checks if filename follows win and unix naming guidelines
https://docs.microsoft.com/... |
# import the necessary packages
from pyimagesearch.centroidtracker import CentroidTracker
import os
import sys
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torchvision
from torchvision import transforms as T
from torchvision.models.detection.faster_rcnn import FastRCNNPredictor
from ... |
import logging; logger = logging.getLogger("morse." + __name__)
from morse.core.actuator import Actuator
from morse.helpers.components import add_data, add_property
from morse.core import mathutils
from morse.core.services import service, async_service
from morse.core import status
from morse.core import blenderapi
... |
OP_CODES = {
'upload': 0,
'download': 1
}
|
def get_all_combinations(source, size):
if size > len(source):
raise ValueError('size is greater than source')
if size <= 1 or len(source) <= 2:
return source
if not isinstance(source, list):
source = list(source)
def build_combinations(source, size):
if size == len(sou... |
from sqlalchemy import Column, Integer, String
from .app import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
username = Column(String(30), nullable=False)
first_name = Column(String(30), nullable=True)
last_name = Column(String(30), nullable=True)
emai... |
try:
import tkinter as tk
from tkinter import ttk
except ImportError:
import Tkinter as tk
import ttk
from tkcalendar import Calendar, DateEntry
def example1():
def print_sel():
print(cal.selection_get())
top = tk.Toplevel(root)
cal = Calendar(top,
... |
#
# PySNMP MIB module IP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IP-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:17:56 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
... |
#!/usr/bin/env python
# coding: utf-8
# In[12]:
# import libraries
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pandas as pd
import os
import random
import ast
import tensorflow as tf
import tensorflow.keras
from tensorflow.keras.models import Sequential, load_model, Mod... |
# deltaTime.py
#
# Parser to convert a conversational time reference such as "in a minute" or
# "noon tomorrow" and convert it to a Python datetime. The returned
# ParseResults object contains the results name "timeOffset" containing
# the timedelta, and "calculatedTime" containing the computed time relative
... |
from .app_database import AppDatabase
from .associations_database import AssociationsDatabase
from .desktop_entry import DesktopEntry
from .mime_database import MimeDatabase
from .mime_type import MimeType
from . import os_env
from . import xdg_mime_wrapper
__all__ = ['AppDatabase',
'AssociationsDatabase',
... |
import logging
from django.core.management.base import BaseCommand, CommandError
from casexml.apps.case.cleanup import rebuild_case_from_forms
from corehq.apps.hqcase.dbaccessors import get_case_ids_in_domain
class Command(BaseCommand):
args = '<domain>'
help = ('Reprocesses all cases in a domain.')
def ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.