text stringlengths 2 999k |
|---|
from django.urls import path
from .views import ListaPessoaView
from . import views
app_name = "pessoa"
urlpatterns = [
#path("pessoa/", views.pagepessoa, name="pagepessoa"),
path("pessoa/", views.form_modelform, name="form_modelform"),
]
|
# Copyright (c) Facebook, Inc. and its affiliates.
from pythia.common.registry import Registry
from pythia.datasets.vqa.m4c_textvqa.dataset import M4CTextVQADataset
from pythia.datasets.vqa.textvqa.builder import TextVQABuilder
@Registry.register_builder("m4c_textvqa")
class M4CTextVQABuilder(TextVQABuilder):
def... |
# Exercise 12. Prompting People
age = input("How old are you? ")
height = input("How tall are you? ")
weight = input("How much do you weigh? ")
print(f"So, you're {age} old, {height} tall and {weight} heavy.")
|
import frappe
def get_context(context):
context.no_cache = True
if frappe.session.user == 'Guest':
frappe.local.flags.redirect_location = frappe.utils.get_url('/login')
raise frappe.Redirect
n = False
if frappe.form_dict:
petOwner = frappe.form_dict.petOwner
pet = frap... |
#!/usr/bin/python3
import subprocess as sb
import os
SSH_KEY_GEN = "ssh-keygen -t rsa -b 4096 -C "
# USER_EMAIL = '"test2@example.com"'
def create_key(email_id,password):
global SSH_KEY_GEN
rsa_file_path = os.path.expanduser('~/.ssh/id_rsa')
SSH_KEY_GEN = SSH_KEY_GEN + email_id
command = SSH_KEY_G... |
# simple_author_dedup.py
# the goal here is simply to go
# through a list of author names
# and find close matches
# that ought to be treated
# as the same person
import sys, csv
import pandas as pd
from difflib import SequenceMatcher
args = sys.argv[1:]
authorset = set()
for path in args:
df = pd.read_csv('..... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import inspect
from abc import ABCMeta, abstractmethod
from typing import Any, Callable, List, Optional, TypeVar
import numpy as np
import torch
from .transform_util import to_float_tensor, to_numpy
__all__ = [
"BlendTransform",
"CropT... |
import graphene
from graphene import relay
from graphene_django.filter import DjangoFilterConnectionField
from graphql.error import GraphQLError
from ...product import models
from ...product.templatetags.product_images import get_thumbnail
from ...product.utils import products_with_details
from ...product.utils.availa... |
# Copyright 2016 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 required by applicable law or ag... |
import time
from click import argument, option
from flask.cli import AppGroup
from flask_migrate import stamp
import sqlalchemy
from sqlalchemy.exc import DatabaseError
from sqlalchemy.sql import select
from sqlalchemy_utils.types.encrypted.encrypted_type import FernetEngine
manager = AppGroup(help="Manage the data... |
from social.backends.open_id import OpenIdAuth
class BelgiumEIDOpenId(OpenIdAuth):
"""Belgium e-ID OpenID authentication backend"""
name = 'belgiumeid'
URL = 'https://www.e-contract.be/eid-idp/endpoints/openid/auth'
|
'''
add.py
Takes a list of input ingredient names. Imports each if not already present.
If already present, duplicates and rotates the ingredient.
Thomas Storey
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
def getO... |
#!/usr/bin/python
'''This python script would be invoked by Pig and the data will be streamed through it.
'''
import sys;
print sys.stdin.read().replace('","',',').strip('"')
|
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# This implementation of the immutable decorator is for python 3.6,
# which doesn't have Context Variables. This implementation is somewhat
# costly for classes with slots, as it adds a __dict__ to them.
import inspect
class _Immutable:
... |
""" Wrapper function to suppress and instead only log error. Use with caution """
import sys
import re
import traceback
from functools import wraps
from typing import Callable
from src.logger_handler import LoggerHandler
from src.machine.controller import MACHINE
def logerror(func: Callable):
""" Log... |
from django.apps import AppConfig
class PostsConfig(AppConfig):
name = "posts"
pages_on_list = 10
|
import re
codigos = [
'''
Lorem ipsum dolor sit amet, 42consectetur adipiscing elit.
Maecenas leo erat, varius non laoreet sed, cursus ut tortor.
Morbi maximus pulvinar ante, ut pulvinar ex malesuada blandit.
Maecenas venenatis, sapien vitae sodales viverra, ante urna
tincidunt tellus, a faucib... |
# -*- coding: utf-8 -*-
"""This file contains MRUListEx Windows Registry plugins."""
from __future__ import unicode_literals
import abc
import logging
import construct
from plaso.containers import time_events
from plaso.containers import windows_events
from plaso.lib import definitions
from plaso.lib import binary
... |
from typing import List
from totem.checks.config import CheckConfig, Config
from totem.checks.content import BaseGitContentProviderFactory
from totem.checks.core import CheckFactory
from totem.checks.results import (
ERROR_GENERIC,
STATUS_ERROR,
CheckResult,
CheckSuiteResults,
)
class CheckSuite:
... |
#!/usr/bin/env python
# coding=utf-8
import gammu
from sms4you.gateways.gateway import Gateway
class GatewaySms(Gateway):
def send(self, message):
sm = gammu.StateMachine()
sm.ReadConfig()
sm.Init()
# Decode different encodings from emails
for i in ['utf8', 'latin-1', ... |
# Crie um programa que leia o nome e o preço de vários produtos. O programa deverá perguntar se o usuário
# vai continuar. No final, mostre: a)Qual é o TOTAL GASTO na compra; b)Quantos produtos custam mais de R$1000;
# c)Qual é o NOME do produto mais barato.
print('-'*60)
loja = 'LOJA SUPER BARATÃO'
print(f'{loja:... |
# Create by Packetsss
# Personal use is allowed
# Commercial use is prohibited
from __future__ import division
import math
import torch
import torch.optim as optim
from collections import defaultdict
class SharedRMSprop(optim.Optimizer):
"""Implements RMSprop algorithm with shared states.
"""
def __init... |
# coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... |
"""
The SerialDevice class:
a device that communicates through the serial port.
"""
from device import Device
import serial
import ctypes
from serial.tools import list_ports
__all__ = ['SerialDevice']
class SerialDevice(Device):
'''
A device that communicates through the serial port.
'''
def __init__(... |
from __future__ import print_function, division, absolute_import
import pytest
pytest.importorskip('requests')
from distributed.cli.utils import uri_from_host_port
from distributed.utils import get_ip
external_ip = get_ip()
def test_uri_from_host_port():
f = uri_from_host_port
assert f('', 456, None) == ... |
"""
Funds API For Digital Portals
Search for mutual funds and ETFs using one single consolidated API, including a criteria-based screener. The API provides also base data, key figures, and holdings. A separate endpoint returns the possible values and value range for the parameters that the endpoint /fund/nota... |
# -*- coding: utf-8 -*-
"""
LaunchDarkly REST API
# Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supporte... |
from flask import request, redirect
from core.middleware import Middleware
class AuthMiddleware(Middleware):
def pre_check(self, *args, **kwargs):
return request.headers.get('Authorization') == 'RANDOM API KEY'
def default(self):
return redirect('/')
|
n=int(input('Digite um número:'))
t1=n*1
t2=n*2
t3=n*3
t4=n*4
t5=n*5
t6=n*6
t7=n*7
t8=n*8
t9=n*9
t10=n*10
print('{} x 1 = {}'.format(n,t1))
print('{} x 2 = {}'.format(n,t2))
print('{} x 3 = {}'.format(n,t3))
print('{} x 4 = {}'.format(n,t4))
print('{} x 5 = {}'.format(n,t5))
print('{} x 6 = {}'.format(n,t6))
print('{} ... |
"""
The multigrid module provides a framework for solving elliptic
problems. A multigrid object is just a list of grids, from the finest
mesh down (by factors of two) to a single interior zone (each grid has
the same number of guardcells).
The main multigrid class is setup to solve a constant-coefficient
Helmholtz eq... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
"""
Flavor-specific SQL tools.
"""
from __future__ import annotations
from meerschaum.utils.typing import Optional, Dict, Any, Union
test_queries = {
'default' : 'SELECT 1',
'oracle' : 'SELECT 1 FROM DUAL',
'informix' : 'SELECT COUNT(*) FROM... |
class TrieNode:
def __init__(self):
self.sub = {}
self.suggestion = []
class Solution:
def suggestedProducts(self, products: List[str], searchWord: str) -> List[List[str]]:
root = TrieNode()
for product in sorted(products):
self._insert(product, root)
... |
from flask import Flask, flash, redirect, render_template, request, session, abort
import os
import pymysql
pymysql.install_as_MySQLdb()
import MySQLdb
#from flask_mysqldb import MySQL
#import MySQLdb.cursors
app = Flask(__name__)
app.secret_key = 'some secret key'
db = MySQLdb.connect(host="localhost" ,user="root"... |
""" from https://github.com/keithito/tacotron """
'''
Defines the set of symbols used in text input to the model.
The default is a set of ASCII characters that works well for English or text that has been run through Unidecode. For other data, you can modify _characters. See TRAINING_DATA.md for details. '''
from tex... |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# PyStore: Flat-file datastore for timeseries data
# https://github.com/ranaroussi/pystore
#
# Copyright 2018 Ran Aroussi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... |
# Copyright 2012 Red Hat, Inc
# 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 ... |
import logging
from typing import Dict, Sequence
from talon import Context, Module, actions
from .user_settings import get_list_from_csv
mod = Module()
ctx = Context()
mod.list("vocabulary", desc="additional vocabulary words")
# Default words that will need to be capitalized (particularly under w2l).
# NB. These d... |
import cv2
import sys
import os
import numpy as np
from gibson2.simulator import Simulator
from gibson2.render.mesh_renderer.mesh_renderer_cpu import MeshRenderer
from gibson2.render.mesh_renderer.mesh_renderer_settings import MeshRendererSettings
from gibson2.render.profiler import Profiler
# from gibson2.utils.assets... |
import pyaudio
import numpy as np
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 16000
CHUNK_SIZE = 1000
MAX_INT16 = np.iinfo(np.int16).max
p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
channels=CHANNELS,
rate=RATE,
output=True)
for i in range(0, 18):
print(i)... |
import ACEP_AuroraVision
from requests import post
from datetime import datetime
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--username", help="The username for access to the website")
parser.add_argument("-p", "--password", help="the password to access the website")
args = parser.pa... |
import numpy as np
import matplotlib.pyplot as plt
from dispersion import *
import scipy.stats as sps
import pandas as pd
def test_dispersion():
np.random.seed(42)
N = 10000
x = np.random.uniform(0, 100, N)
y = np.random.randn(N)*x
inds = np.argsort(x)
x, y = x[inds], y[inds]
# Running di... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM7_then_CompleteLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HMM7_then_CompleteLHS
"""
# Flag this instance as compiled now
self.is_compiled = True
sup... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
# __author__ = 'liufushihai'
# __date__ = '2018-04-11'
# __desc__ = '读取多语言xml文件并生成xls文件'
## ------------- 代码流程 ------------------------------
## 1.读取yml配置文件相应信息
## 2.将读到的信息,作为参数传入ET句法解析器中,获取Element实例
## 3.根据Element实例得到xml根标签
## 4.以英文为标准,依次匹配'中-日-法-韩'文,并写入xls文件变量中对应的单元格
... |
from floodsystem.stationdata import build_station_list
from floodsystem.station import MonitoringStation
from floodsystem.geo import rivers_with_station, stations_by_river
from floodsystem.geo import stations_by_distance
from haversine import haversine
from floodsystem.geo import stations_within_radius
from floodsyste... |
from NIENV import *
# API METHODS
# self.main_widget <- access to main widget
# self.update_shape() <- recomputes the whole shape and content positions
# Ports
# self.input(index) <- access to input data
# self.set_output_val(index, val) <- set output data port value
# self.exec_outp... |
# Copyright 2019 Google 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 writing, ... |
"""Demonstrate wave MPI example."""
__copyright__ = "Copyright (C) 2020 University of Illinois Board of Trustees"
__license__ = """
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 restric... |
from operator import mul
numgrid = "\
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 \
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 \
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 \
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 \
22 31 16 71 51 67 63 89 41 92 36 ... |
import random
def getRandom():
return random.random()
|
# (c) Continuum Analytics, Inc. / http://continuum.io
# All Rights Reserved
#
# conda is distributed under the terms of the BSD 3-clause license.
# Consult LICENSE.txt or http://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_import, division, print_function
import argparse
import logging
import... |
import uuid
import pytest
import logging
from cassandra import ConsistencyLevel, WriteFailure, WriteTimeout
from cassandra.query import SimpleStatement
from dtest import Tester
from thrift_bindings.thrift010 import ttypes as thrift_types
from thrift_test import get_thrift_client
from tools.jmxutils import (JolokiaAge... |
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from sklearn import neighbors
n_neighbors = 1
X = np.array([
[2, 4],
[4, 2],
[4, 6],
[6, 4],
[4, 4],
[6, 2]
])
y = np.array([
[0],
[0],
[0],
[0],
[1],
[1]
])
h = .02 # st... |
# -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Oct 1, 2014
████████████████████████████████████████... |
from icon_validator.exceptions import ValidationException
from icon_validator.rules.validator import KomandPluginValidator
import re
import os
class CloudReadyValidator(KomandPluginValidator):
@staticmethod
def validate_enable_cache_in_plugin_spec(plugin_spec: dict):
if plugin_spec.get("enable_cache... |
from flask import Flask, request, url_for, redirect, render_template
app = Flask (__name__)
# HOME
@app.route('/')
def index():
return render_template("home.html")
# BOOKING PAGE
@app.route('/booking', methods=['GET', 'POST'])
def booking():
if request.method == 'POST':
return redirect(url_for('confi... |
import numpy as np
import gmpy2
import queue
# Code partially based on the great solution by *godarderik*
# https://www.reddit.com/r/adventofcode/comments/5i1q0h/2016_day_13_solutions/
def checkEmptySpace(node):
x, y = int(node[0]), int(node[1])
num1Bits = gmpy2.popcount(x*x + 3*x + 2*x*y + y + y*y + magicN... |
# coding: utf-8
from __future__ import absolute_import
from django.conf.urls import patterns
from . import views
from .models import Article
urlpatterns = patterns('',
(r'^special_headers/article/(?P<object_id>\d+)/$', views.xview_xheaders),
(r'^special_headers/xview/func/$', views.xview_dec(views.xview)),
... |
# Generated by Django 4.0.1 on 2022-01-10 07:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('homepage', '0003_post_oc... |
'''
This script transforms our dictionary to JSON formatting.
The current parsing is just for POC purposes and skips many definitions.
'''
import re
import json
def clean(word):
return re.sub('[\[\{\(][\w\.]+[\}\]\)]','',word).strip().lower()
dictionary = file('de-en.txt').read().splitlines()
output = {}
for line ... |
from pymongo import MongoClient
from src.types.messages import MESSAGES_TYPES, Message
from .base import BaseStorage
class MongoDBStorage(BaseStorage):
"""
Message storage with MongoDB as backend.
"""
def __init__(self, host: str, port: int, db: str, collection: str):
self._client = MongoCl... |
# coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... |
"""Plot an energy dispersion using a gaussian parametrisation"""
import matplotlib.pyplot as plt
from gammapy.irf import EDispKernel
from gammapy.maps import MapAxis
energy_axis = MapAxis.from_energy_bounds("1 TeV", "10 TeV", nbin=10)
energy_axis_true = MapAxis.from_energy_bounds(
"0.5 TeV", "30 TeV", nbin=10, per... |
# Copyright 2013 Donald Stufft and individual contributors
#
# 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... |
import random
import time
import numpy as np
from carla.agents.core import ActorCritic
from carla.agents.utils.dummy_vec_env import DummyVecEnv
from carla.agents.utils.pytorch_utils import dict_obs_to_tensor, merge_dict_obs_list, merge_list_of_dicts
from carla.agents.utils.subproc_vec_env import SubprocVecEnv
from ... |
#!/usr/bin/env python3
from requests import post as requests_post
from bs4 import BeautifulSoup as Soup
from re import match as re_match
NoneType = type(None)
class Vies:
# ISO 3166-1 alpha-2 country codes.
EU_COUNTRY_CODES = set([
'AT', # Austria.
'BE', # Belgium.
'BG', # Bulgari... |
import sys
import googleapiclient.discovery
from ultideploy import constants, credentials, resources
def bootstrap(args):
google_credentials = credentials.default_google_credentials()
organization = resources.get_organization(
f"organizations/{args.organization_id}", google_credentials
)
p... |
class Solution:
def fractionToDecimal(self, numerator: int, denominator: int) -> str:
n, remainder = divmod(abs(numerator), abs(denominator))
# if both negative, then * can remove the negative sign
# if still negative, means one of them is negative and cannot be removed
sig... |
###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
import unittest
from io import StringIO
from ...chart import Chart
class TestInitialisation(unittest.Test... |
from Node import *
class Board:
'''
Initializes a row x col board of Nodes
'''
def __init__(self, row, col):
self.row = row
self.col = col
self.board = []
for i in range(row):
self.board.append([Node(i, x) for x in range(col)])
def getNode(sel... |
# Generated by Django 3.1.7 on 2021-02-20 09:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('connectors', '0014_auto_20210201_1748'),
]
operations = [
migrations.AlterField(
model_name='connector',
name='conne... |
import re
_camel_words = re.compile(r"([A-Z][a-z0-9_]+)")
def _camel_to_snake(s):
""" Convert CamelCase to snake_case.
"""
return "_".join(
[
i.lower() for i in _camel_words.split(s)[1::2]
]
)
|
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Optional, Tuple
import numpy as np
from ax.models.numpy_base import NumpyModel
from ax.utils.... |
# Copyright 2014 Google 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 writing, ... |
import os
import pandas as pd # type: ignore
from metaflow import FlowSpec, step
from datasets import Mode, dataset
from datasets.plugins import BatchDataset, BatchOptions
flow_dir = os.path.dirname(os.path.realpath(__file__))
my_dataset_foreach_path = os.path.join(flow_dir, "data/my_dataset_foreach")
class Fore... |
import random
from data import ImageDetectionsField, TextField, RawField
from data import COCO, DataLoader
import evaluation
from evaluation import PTBTokenizer, Cider
from models.transformer import Transformer, MemoryAugmentedEncoder, MeshedDecoder, ScaledDotProductAttentionMemory
import torch
from torch.optim import ... |
#!/usr/bin/env python
from __future__ import print_function
import colorama
import vdc_api_call as vdc
import sys
import time
import multiprocessing
import datetime
import socket
import argparse
import logging
import random
from pprint import pprint
from vdc_api_call.config import Config
from functions import *
# Chec... |
# -*- coding: utf-8 -*-
"""Test helpers"""
import imaplib
import sys
import unittest
from imap_cli import const
from imap_cli import summary
from imap_cli import tests
class FetchTest(unittest.TestCase):
def setUp(self):
imaplib.IMAP4_SSL = tests.ImapConnectionMock()
def test_status_command(self... |
"""Utilities to create and set the config.
The main class exported by this module is :class:`ManimConfig`. This class
contains all configuration options, including frame geometry (e.g. frame
height/width, frame rate), output (e.g. directories, logging), styling
(e.g. background color, transparency), and general behav... |
#!/usr/bin/env python
#
# This script reads in a HTK MLF format label file and converts the
# encoded contents to GBK encoding.
#
import string, codecs
fin=open('vom_utt_wlab.mlf')
fout=codecs.open('vom_utt_wlab.gbk.mlf', encoding='gbk', mode='w')
while True:
sr=fin.readline()
if sr=='':break
sr=sr.strip(... |
from types import *
from robot import utils
from selenium.webdriver.remote.webdriver import WebDriver
from selenium.common.exceptions import NoSuchWindowException
class WindowManager(object):
def __init__(self):
self._strategies = {
'title': self._select_by_title,
'name': self._sel... |
#!/usr/bin/env python
#
# Copyright (c) 2015 University of Cambridge
# Copyright (c) 2015 Neelakandan Manihatty Bojan, Georgina Kalogeridou
# All rights reserved.
#
# This software was developed by Stanford University and the University of Cambridge Computer Laboratory
# under National Science Foundation under Grant ... |
import os
class Config(object):
SECRET_KEY = os.environ.get('SECRET_KEY')
|
r"""web_helper is a module that provides access to functions that helps to build
new protocols and process ParaView data structure into web friendly ones.
"""
import sys
import os
import traceback
# import paraview modules.
import paraview
from paraview import simple, servermanager
from paraview.servermanager import... |
# -*- coding: utf-8 -*-
__author__ = 'sandlbn'
from django import template
from datetime import datetime
from time import mktime
from jsmin import jsmin
def timestamp_to_datetime(timestamp):
"""
Converts string timestamp to datetime
with json fix
"""
if isinstance(timestamp, (str, unicode)):
... |
# -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import os
import sys
from... |
#Boi this legit does nothing get outa here nerddd
|
#py_set_operations.py
the_set = {"monkey", "gorilla", "dog", "cat"}
print("Set: :", the_set)
the_set.add("parrot")
print("Set: :", the_set)
other_set = {"gorilla", "elephant", "pig", "chicken"}
print("Set intersection :", the_set & other_set) # intersection
print("Set union :", the_se... |
from typing import TYPE_CHECKING, Optional
from app.models import TimestampedModel, models
from studying.models import Study
if TYPE_CHECKING:
from chains.models.chain import Chain
class ProgressQuerySet(models.QuerySet):
def get_last_progress(self, chain: 'Chain', study: Study) -> Optional['Progress']:
... |
import os
def pytest_configure(config):
os.environ['CIRQ_TESTING'] = "true"
|
from django.test import RequestFactory
from django.contrib.auth.models import AnonymousUser
from django.test import Client
from test_plus.test import TestCase
from ...upload_handling.tests.factories import WineImageFactory, test_image
from ...users.tests.factories import UserFactory
from ...reviews.models import Rev... |
from website import create_app
app = create_app()
if __name__ == '__main__':
app.run(debug = True) # test case |
state = 'A'
steps = 12134527
# ones = 0
i = 0
head = 0
tape = [0]
ops = {
'A': {
0: (1, 1, 'B'),
1: (0, -1, 'C')
},
'B': {
0: (1, -1, 'A'),
1: (1, 1, 'C')
},
'C': {
0: (1, 1, 'A'),
1: (0, -1, 'D')
},
'D': {
0: (1, -1, 'E'),
1: (1, -1, 'C')
},
'E': {
0: (1, 1, 'F'),
1: (1, 1, 'A')
},
'F'... |
"""Test the date time method"""
from datetime import datetime
from api.utilities.helpers.date_time import date_time
fmt = '%Y-%m-%d %H:%M:%S'
fmt1 = '%Y-%m-%d %H:%M:%S %Z%z'
class TestDateTime:
"""Tests the custom datetime class"""
def test_the_date_time_method_succeeds(self):
"""Tests the date_tim... |
__version__ = "9bb453b"
|
# Copyright 2013 OpenStack Foundation
# 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 requ... |
from output.models.nist_data.list_pkg.normalized_string.schema_instance.nistschema_sv_iv_list_normalized_string_length_5_xsd.nistschema_sv_iv_list_normalized_string_length_5 import NistschemaSvIvListNormalizedStringLength5
__all__ = [
"NistschemaSvIvListNormalizedStringLength5",
]
|
import logging
import sys
logging.basicConfig(level=logging.DEBUG)
from vox import bus
if len(sys.argv) > 1:
host = sys.argv[1]
else:
host = 'localhost'
socket = bus.connect_subscribe(host=host)
while True:
message = socket.recv()
logging.info('message: %s', message.decode('utf8'))
|
# 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.
# -----------------------------------------------------... |
import src.formulators as formulators
import src.stream_receiving as streamr
"""
Хранилище для быстрого доступа к заранее настроенным камерам.
Некоторые конфиги могут нуждаться в детальной индивидуальной настройке, для более оптимальной работы, например
изменения частоты скачивания m3u8 файла и иных.
"""
p... |
import os
import tempfile
from unittest.mock import MagicMock
import cloudpickle
import prefect
from prefect.environments import FargateTaskEnvironment
from prefect.environments.storage import Docker
from prefect.utilities.configuration import set_temporary_config
from botocore.exceptions import ClientError
def te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.