content stringlengths 5 1.05M |
|---|
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import shutil
import sys
import tempfile
import pandas as pd
from six.moves import urllib
import tensorflow as tf
from data_utils import read_data
from data_utils import read_data_with_sampling... |
# Query Jupyter server for the info about a dataframe
import json as _VSCODE_json
import pandas as _VSCODE_pd
# _VSCode_sub_supportsDataExplorer will contain our list of data explorer supported types
_VSCode_supportsDataExplorer = "['list', 'Series', 'dict', 'ndarray', 'DataFrame']"
# In IJupyterVariables.getV... |
# EMACS settings: -*- tab-width: 2; indent-tabs-mode: t; python-indent-offset: 2 -*-
# vim: tabstop=2:shiftwidth=2:noexpandtab
# kate: tab-width 2; replace-tabs off; indent-width 2;
#
# ==============================================================================
# Authors: Patrick Lehmann
# ... |
from abc import ABCMeta, abstractmethod
from pyopenproject.business.abstract_service import AbstractService
class PreviewingService(AbstractService):
"""
Class PreviewingService,
service for previewing endpoint
"""
__metaclass__ = ABCMeta
def __init__(self, connection):
super().__ini... |
#!/usr/bin/python2
"""
Reverse Connect TCP PTY Shell - v1.0
infodox - insecurety.net (2013)
Gives a reverse connect PTY over TCP.
For an excellent listener use the following socat command:
socat file:`tty`,echo=0,raw tcp4-listen:PORT
Or use the included tcp_pty_shell_handler.py
"""
import os
import pty
import sys
im... |
#!/usr/bin/env python
# Copyright (c) 2016 The UUV Simulator 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... |
import functools
import torch.nn as nn
from csrank.discrete_choice_losses import CategoricalHingeLossMax
from csrank.discretechoice.discrete_choice import SkorchDiscreteChoiceFunction
from csrank.modules.object_mapping import DenseNeuralNetwork
from csrank.modules.scoring import FATEScoring
class FATEDiscreteChoice... |
#!/usr/bin/env python
__author__ = 'sreynolds'
## if this is set to 1 there will be a TON of debug output ...
debugFlag = 0
import argparse
import commands
import json
import math
import random
import sys
import time
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
#-#-#-#-#-#-#-#-#-#... |
# -*- coding:utf-8 -*-
import distutils.version
import os
import subprocess
import sys
import tempfile
import textwrap
import unittest
try:
from test.test_support import EnvironmentVarGuard, captured_stdout
except ImportError:
from test.support import EnvironmentVarGuard, captured_stdout
try:
from unittest... |
# -*- coding: utf-8 -*-
import sys
import time
import logging
import os
from socketIO_client import SocketIO, BaseNamespace
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from websk.conf import SOCKET_HOST, SOCKET_PORT
logging.getLogger('socketIO-client').setLevel(logging.DEBUG)
logg... |
from flask import Flask, render_template, request, redirect, url_for, flash
from sqlalchemy import create_engine, asc
from sqlalchemy.orm import sessionmaker
from flask import session as login_session
import random
import string
from models.base import Base
from models.user import User
from models.store import Store
f... |
import re
def minion_game(string):
vowels = re.compile('^[AEIOU]')
p_v = 0
p_c = 0
for x_i in range(len(string)):
if vowels.match(string[x_i]):
p_v += (len(string)-x_i)
else:
p_c += (len(string)-x_i)
if p_c > p_v:
print(f'Stuart {p_c}')
elif ... |
import os
import subprocess
import string
builddir = "_build/"
toolchain = "arm-none-eabi-"
def get_data_addrs():
head, tail = os.path.split(os.getcwd())
disasm = builddir + tail + ".asm"
data_addr = []
# minAddr = -1
with open(disasm, "rb") as f:
for line in f:
item_list = line... |
from __future__ import annotations
from typing import Generator, NoReturn
class StdReader:
def __init__(
self,
) -> NoReturn:
import sys
self.buf = sys.stdin.buffer
self.lines = (
self.async_readlines()
)
self.chunks: Generator
def async_readlines(
self,
) -> Generator:
... |
list1=[12, -7, 5, 64, -14]
for i in list1:
if i < 0 :
continue
print(i)
list2=[12, 14, -95, 3]
for i in list2:
if i < 0:
continue
print(i)
|
import os
import json
from app.data import constants, stats, equations, tags, weapons, factions, terrain, mcost, \
minimap, items, klass, units, parties, ai, difficulty_modes, translations, skills, levels, \
lore, supports, overworld, overworld_node
from app.events import event_prefab
import logging
class Da... |
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .Graph import Graph
import glm
class PointLight:
def __init__(self, graph: Graph, pos: glm.vec3,
ambient: glm.vec3, diffuse: glm.vec3, specular: glm.vec3,
k: glm.vec3):
self.... |
"""
Main function for running transBG jobs.
Examples:
--------
* If you define an "input.json" with desired job parameters in job_dir/:
(transBG) ~/transBG$ python main.py --job_dir path/to/job_dir/
* If you instead want to run your job using the submission scripts:
(transBG) ~/transBG$ python submit-fine-tunin... |
import json, requests, datetime, ast
from .profiler_test import profile
from administer import context_processors,helper
from django.contrib import messages
from django.db import IntegrityError
from django.shortcuts import render
from administer.models import Services, Nodes,Service_cluster_reference
from administer.he... |
from .post_translation import PostTranslationService
from .interface import (
PostTranslationConfig,
PostTranslationRequest,
PostTranslationResponse,
)
|
# Generated by Django 3.2.8 on 2022-01-05 20:22
import cloudinary.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('thehood', '0005_auto_20220105_1750'),
]
operations = [
migrations.CreateModel(
... |
from . import BlobDetector
|
import os
import sys
from terrasnek.api import TFC
def queue_destroy_run(api, workspace_name):
workspace = api.workspaces.show(workspace_name)
if workspace == None:
print('Error: unable to find a workspace named ' + workspace_name)
exit(1)
workspace_id = workspace["data"]["id"]
payload ... |
from pypy.conftest import gettestobjspace
from pypy.interpreter import gateway
class AppTest_Thunk:
def setup_class(cls):
cls.space = gettestobjspace('thunk')
def test_simple(self):
from __pypy__ import thunk, become
computed = []
def f():
computed.append(True)
... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# NLP
# Import the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Import dataset
dataset = pd.read_csv('Restaurant_Reviews.tsv', delimiter = '\t', quoting = 3)
# Clean up review text
import re
from nltk.corpus import stopwords
from n... |
# external
import pytest
# project
from flake8_codes._codes import extract
from flake8_codes._codes._default import extract_default
from flake8_codes._codes._registry import registry
# app
from ._constants import KNOWN_PLUGINS
@pytest.mark.parametrize('plugin_name', KNOWN_PLUGINS)
def test_smoke_extract(plugin_name... |
#!/usr/bin/env python
import struct
SIGNATURE_AREA_SIZE = 512 - 8
def main():
fw = open("fw.bin", "rb").read()
if fw[:4] == b'SHWF':
print("Firmware already prepared")
exit(1)
header = b'SHWF'
header += struct.pack('<I', len(fw))
header += b'\x00' * SIGNATURE_AREA_SIZE
... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import logging
import numpy as np
from mobile_cv.torch.utils_caffe2.ws_utils import ScopedWS
logger = logging.getLogger(__name__)
# NOTE: specific export_to_db for (data, im_info) dual inputs.
# modified from mobile-vis... |
import sys, os, ujson
import pandas as pd
'''
extracts a specific workflow with id workflow_id and version number workflow_version
from a dataframe workflow_df that's read from a workflows file, with accompanying
workflow_cont_df that's read from a workflow contents file.
The needed workflow files are exportable fro... |
# Write a procedure, input a list with sublist elements, and output a list with no sublists.
# 写一个函数,输入一个含有列表的列表,输出一个不含有列表的列表。
# input /输入:[1, [2, 0], [3, 0, [4, 7, 5]]]
# output /输出: x = [1, 2, 0, 3, 0, 4, 7, 5]
def get_final_list(a_list):
final_list = []
to_check = a_list
#print to_check
while to_ch... |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Mc(AutotoolsPackage):
"""The GNU Midnight Commander is a visual file manager."""
home... |
# System imports
import sys
import os
# 3rd party imports
import numpy as np
import torch
from torch.nn import Linear
import torch.nn.functional as F
from torch.utils.data import random_split
from torch.utils.data import Dataset
from torch_geometric.data import DataLoader
from torch_cluster import radius... |
from torch import optim, nn
from pytti.Notebook import tqdm
from pytti import *
import pandas as pd
import math
from labellines import labelLines
def unpack_dict(D, n = 2):
ds = [{k:V[i] for k,V in D.items()} for i in range(n)]
return tuple(ds)
import pandas as pd
from scipy.signal import savgol_filter
def smoo... |
""" BasicTextAnalyzer Information """
__author__ = "James Morris"
__maintainer__ = "James Morris"
__email__ = "morrisjamesharry@gmail.com"
__license__ = "MIT"
__version__ = "0.0.1"
__credits__ = ["Tyler Barrus and Peter Norvig (for pyspellchecker"]
__url__ = "https://github.com/morrisjh/Basic-Text-Analyzer"
|
import datetime
from captcha.fields import CaptchaField
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from haystack.forms import SearchForm
from .models impor... |
#!/usr/bin/env python3
#
# Copyright (c) 2021 Iliass Alami Qammouri
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
import os
import sys
import socket
import string
import requests
#import argparse
from art import *
from termcolor import colored
from modules.dirsearch... |
import numpy
import cv2
import requests
import sys
import os.path
import socket
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
class exi... |
from django.contrib import admin
from .models import (IP)
# Register your models here.
admin.site.register(IP)
|
from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SubmitField, BooleanField
from wtforms.validators import DataRequired, Length, Email, EqualTo, ValidationError
class formURL(FlaskForm):
site = StringField('Site URL', validators=[DataRequired()])
keyword = StringField('Label Keywo... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
# 用户
class Users(models.Model):
id = models.AutoField(primary_key=True)
username = models.CharField(max_length=50)
password = models.CharField(max_length=50)
# 全部主机
class Servers(mod... |
#! c:/Python27/python.exe
#This is the script for GO term search
import cgi, MySQLdb, subprocess, os, random
os.environ['HOME']='c:\Apache\htdocs'
os.environ['MPLCONFIGDIR']='c:\Apache\htdocs'
import matplotlib
matplotlib.use('Agg')
import numpy
import matplotlib.pyplot as plt
import matplotlib.figure
import pylab
de... |
# -*- coding: utf-8 -*-
import math
from typing import Callable, Tuple
import numpy
import scipy.optimize # type: ignore
from optimizer._internals.common import typing
from optimizer._internals.common.linneq import constraint_check
from optimizer._internals.common.norm import norm_l2, safe_normalize
from optimizer... |
# Copyright (c) 2017-present, Facebook, 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... |
import sys
import logging as log
from Bio import Entrez
from urllib.error import HTTPError
from .data_models import Taxon
def fetch_taxonomic_info(user_email: str, taxon: Taxon, retries: int) -> None:
"""Receives a Taxon object and tries to fetch its full taxonomic classification information
Parameters:
... |
from django.urls import path
from apps.profesores.views import add_profesores, edit_profesores, delete_profesores, lista_profesores, ProfesoresList, DetalleProfesor, DeleteProfesor
urlpatterns = [
path('profesor/crear/', add_profesores, name='add_profesores'),
path('profesor/<int:pk>/editar/', edit_profesores... |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Tx Scram Rand
# Generated: Thu May 25 18:27:40 2017
##################################################
if __name__ == '__main__':
import ctypes
import sys
if sys.platform... |
nihaoya
heihie
num =10000000
mun = 200
mun = 500
|
# Generated by Django 3.2.4 on 2021-06-28 10:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('spaces', '0003_auto_20210628_1133'),
]
operations = [
migrations.AlterField(
model_name='spaces',
name='available',
... |
from time import sleep
def contador(inicio, fim, passo):
print('-=' * 25)
if passo == 0:
passo = 1
passo = abs(passo)
print(f'Contagem de {inicio} até {fim} de {abs(passo)} em {abs(passo)}:')
if inicio < fim:
for i in range(inicio, fim + 1, passo):
print(i, end=' ')
... |
import os
import re
import json
import base64
import numpy as np
from collections import defaultdict
import db_connection as db_con
def parse_groups(group_filename, vectors_encoded=True):
f = open(group_filename)
groups = json.load(f)
for key in groups:
for group in groups[key]:
for k... |
"""Test configuration."""
import asyncio
import functools
import pathlib
from typing import Any
from typing import AsyncGenerator
from typing import Generator
import pytest
import pytz
from _pytest.monkeypatch import MonkeyPatch
from aiohttp.client import ClientSession
from aioresponses import aioresponses
from click.... |
# Copyright 2015 PerfKitBenchmarker 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 appli... |
# Some pygame helper functions for simple image display
# and sound effect playback
# Rob Miles July 2017
# Version 1.0
import pygame
surface = None
def setup(width=800, height=600, title=''):
'''
Sets up the pygame environment
'''
global window_size
global back_color
global text_color
g... |
#~ # coding: utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import with_statement
import os
import sys
import logging
from six.moves import configparser
import threading
import codecs
logger = logging.getLogger('Config')
class Config:
def __init__(self, worki... |
"""
Copyright 2017 Arm Ltd.
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, software
distribut... |
#
# Copyright 2019 The FATE 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 appli... |
# MACROPAD Hotkeys: Universal Numpad
from adafruit_hid.keycode import Keycode
from adafruit_hid.consumer_control_code import ConsumerControlCode
app = {
'name' : 'Audacity',
'order': 4, # Application order on the keyboard
'macros' : [
# COLOR LABEL KEY SEQUENCE
# 1st row ---------... |
"""
============================
Grid Search Example
============================
An example of how to use Metaheuristics and GridSearch
"""
from feature_selection import HarmonicSearch
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import GridSearchCV
from sklearn.svm import SVC
from skl... |
"""
This problem was asked by Google.
In a directed graph, each node is assigned an uppercase letter. We define a path's value as the number of most frequently-occurring letter along that path. For example, if a path in the graph goes through "ABACA", the value of the path is 3, since there are 3 occurrences of 'A' on... |
# Preencha as informações pessoais nas variáveis abaixo
name = "Gabriel Batista Albino Silva"
school_id = "16/0028361"
email = "160028361@aluno.unb.br"
|
import random
from django.core.management.base import BaseCommand
from imagefactory import create_image
from gamestore.tests.create_content import create_user, \
create_game, create_score, create_game_sale, create_category, GAME_TITLES, \
CATEGORY_TITLES
def create_users(amount):
for _ in range(amount):... |
#!/pyenv/2.6/bin
import imp
import cProfile
import os
import config
from wsgi import webapp, locale
from util import instance_id_from_config
serverConfPath = config.path
webapp.configPath = serverConfPath
vodkaPath = os.path.abspath(os.path.join(os.path.dirname(__file__)))
import weakref
from pprint import pformat
f... |
# Copyright 2022 Northern.tech AS
#
# 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 abc
class ProviderInterfaceV0(object):
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def sensor_products(product_id):
"""Returns list of all available products for a given scene id"""
return
@abc.abstractmethod
def available_products(self, product_id, username):
"... |
from csv import DictReader
#reading file with specific delimiter
with open('fighters_with_pipe.csv') as file:
csv_dict_reader = DictReader(file,delimiter='|')
for row in csv_dict_reader:
print(row) |
import numpy as np
import random
import os
import sys
from audio import read_mfcc
from batcher import sample_from_mfcc
from constants import SAMPLE_RATE, NUM_FRAMES
from conv_models import DeepSpeakerModel
from test import batch_cosine_similarity
import time
from milvus import Milvus, IndexType, MetricType, Status
from... |
import json
#import requests
from django.http import HttpResponse, JsonResponse
from django.views.decorators.csrf import csrf_exempt
from django.db import connection
from django.contrib.gis.geos import Point
from public.models import User, Address, City, CenterOfInterest, InterestFor, District
from public import modi... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipaySecurityRiskCustomerriskSendModel(object):
def __init__(self):
self._bank_card_no = None
self._business_license_no = None
self._cert_no = None
self._email_ad... |
from GLOBAL_VAR import *
group = 0
pair_Fn = '%s/%s_outlierPairs_group%d.txt' % (pairdir, LMfn, group)
N0 = len(pd.read_csv(pair_Fn, header= None, sep='\t', usecols=[0]))
pairs_N = []
for group in range(1, 23):
pair_Fn = '%s/%s_outlierPairs_group%d.txt' % (pairdir, LMfn, group)
N = len(pd.read_csv(pair_Fn, h... |
from weldx.asdf.types import WeldxType
from weldx.measurement import Source
__all__ = ["Source", "SourceType"]
class SourceType(WeldxType):
"""Serialization class for measurement sources."""
name = "measurement/source"
version = "1.0.0"
types = [Source]
requires = ["weldx"]
handle_dynamic_su... |
'''defines the Blackjack class'''
from .player import Player
from .deck import Deck
from .input_handling import match_yes, next_player, press_return
class Blackjack():
'''the class that keeps track of gameplay
kw args:
num_players -- the number of players, an integer between 2 and 4
names -- an array of playe... |
import unittest
from PIL import Image
import mock
from spriter.image import URLImage
from tests import Openned
class TestImage(unittest.TestCase):
def test_simple_url_get_base(self):
with mock.patch("urllib.urlopen") as mck:
mck.return_value = Openned("http://pitomba.org/happy.png")
... |
# 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 ... |
# -*- coding: utf-8 -*-
#: Regular python imports
from __future__ import division
from __future__ import print_function
from pyomo.environ import *
__author__ = 'David Thierry' #: May 2018
#: Problem number 71 from the Hock-Schittkowsky test suite
#: https://www.coin-or.org/Ipopt/documentation/node20.html
#: The mo... |
# import json
#
# with open("color.json", "r", encoding='utf-8') as file:
# color = json.load(file)
#
# print(type(file))
import sys
print(sys.argv) |
import numpy as np
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import transforms
import dataset
import models
import cmd_args
import open3d as o3d
from utils_dataset import lines
from torch.utils.tensorboard import SummaryWriter
from loss_fn im... |
from dbconn import Departments, Employees, Session
#######################################
# 创建到数据库连接的会话
session = Session()
#######################################
# 增加记录就是创建类的实例
# hr = Departments(dep_id=1, dep_name='人事部')
# ops = Departments(dep_id=2, dep_name='运维部')
# dev = Departments(dep_id=3, dep_name='开发部')
# ... |
import sys
from clikit.args import StringArgs
from ..command import Command
class DebugInfoCommand(Command):
name = "info"
description = "Shows debug information."
def handle(self):
poetry_python_version = ".".join(str(s) for s in sys.version_info[:3])
self.line("")
self.line(... |
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
class EmailProperties(ClientValue):
def __init__(self, body, subject, to, from_address=None, cc=None, bcc=None, additional_headers=None):
"""
:param str body:
... |
# Copyright (C) 2019 by eHealth Africa : http://www.eHealthAfrica.org
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with
# the License. Y... |
# MIT 6.034 Lab 2: Search
from tester import make_test, get_tests
from lab2 import (generic_dfs, generic_bfs, generic_hill_climbing,
generic_best_first, generic_beam, generic_branch_and_bound,
generic_branch_and_bound_with_heuristic,
generic_branch_and_bound_with_... |
# os for file management
import selenium
from selenium import webdriver
driver = webdriver.Chrome(r"C:/Program Files (x86)/webdrivers/chromedriver.exe")
driver.get('https://canvas.case.edu')
# Select the id box
id_box = driver.find_element_by_name('username')
# Equivalent Outcome!
id_box = driver.find_element_by_... |
import argparse
import os
from os.path import isdir, isfile
BASE_DIR = './tempcontent/pages/'
BASE_FSP = "https://www.fullstackpython.com/"
links = {
"(/table-of-contents.html)":
"(#table-of-contents)",
# chapter 1
"(/introduction.html)":
"(#introduction)",
"(/l... |
"""pypyr step that writes payload out to a file."""
import logging
from pathlib import Path
from pypyr.config import config
from pypyr.utils.asserts import assert_key_exists, assert_key_is_truthy
logger = logging.getLogger(__name__)
def run_step(context):
"""Write payload to file.
For list of available enc... |
from flask import Flask
def create_app():
app = Flask(__name__, template_folder='../templates', static_folder='../static')
with app.app_context():
from src.dashboard.dashboard import dashboard_bp
app.register_blueprint(dashboard_bp)
return app
|
"""
An action to clear text from an input. An actor must possess the ability
to BrowseTheWeb to perform this action. An actor performs this action like
so:
the_actor.attempts_to(Clear.the_text_from_the(NAME_INPUT))
"""
from selenium.common.exceptions import WebDriverException
from ..actor import Actor
from ..ex... |
import pymongo
import validate
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../'))
import config
import helpers
import datetime
from validate import validate_data
mongo_cursor = pymongo.MongoClient(config.MONGO_URL)
collection = mongo_cursor[config.MONGO_DB_NAME]
def is_visited(link: str):
re... |
#-*- coding: latin1 -*-
import os
import time
class Conta(object):
def __init__(self, numero, saldo):
self.numero = numero
self.saldo = saldo
def getNumero(self):
return self.numero
def getSaldo(self):
return self.saldo
def setNumero(self, numero):
self.numero = numero
def setSaldo(self, ... |
# $Filename$
# $Authors$
# Last Changed: $Date$ $Committer$ $Revision-Id$
#
# Copyright (c) 2003-2011, German Aerospace Center (DLR)
# All rights reserved.
#
#
#Redistribution and use in source and binary forms, with or without
#modification, are permitted provided that the following conditions are
#met:
#
... |
import argparse
from eurlex2lexparency.celex_manager.eurlex import PreLegalContentXmlDataBase
parser = argparse.ArgumentParser(
description="Queries the Eurlex database for document IDs and stores metadata to a preliminary database"
)
parser.add_argument('--consyear', help='Focus on consolidated versions publish... |
# Wallbox EV module __init__.py
from wallbox.wallbox import Wallbox
from wallbox.statuses import Statuses
|
from django.conf import settings
from django.db import models
from django.db.models import DO_NOTHING
class AuthorizedAgent(models.Model):
authorized = models.BooleanField(default=True)
user = models.OneToOneField(
settings.AUTH_USER_MODEL,
default=None,
blank=True,
null=True,
... |
#! /usr/bin/env python
"""Prepares plots for FPE VOLTAGE tab
Module prepares plots for mnemonics below. Combines plots in a grid and
returns tab object.
Plot 1:
IMIR_HK_FW_POS_RATIO_FND
IMIR_HK_FW_POS_RATIO_OPAQUE
IMIR_HK_FW_POS_RATIO_F1000W
IMIR_HK_FW_POS_RATIO_F1130W
IMIR_HK_FW_POS_R... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forward(apps, schema_editor):
Sponsor = apps.get_model('sponsorship', 'Sponsor')
db_alias = schema_editor.connection.alias
for sponsor in Sponsor.objects.using(db_alias):
# Get web description an... |
from __future__ import print_function # Use a function definition from future version (say 3.x from 2.7 interpreter)
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
import keras
import math
from keras.metrics import categorical_accuracy
from matplotlib.animation import FuncAnimation
from astr... |
import typing
from pathlib import Path
from copy import deepcopy
from itertools import chain
from .header import Header
from .schema import Schema
from .system import system
from .file import File
from .row import Row
from . import exceptions
from . import errors
from . import helpers
from . import config
class Table... |
import datetime
from abc import ABCMeta
class IExpirable(metaclass=ABCMeta):
def __init__(self):
self.time_stamp = None
self.retrieved_time_stamp = None
def set_retrieved_time_stamp(self, time_stamp):
self.retrieved_time_stamp = time_stamp
def set_time_stamp(self, time_stamp):
... |
# -*- coding: utf-8 -*-
"""
For pytest
initialise a test database and profile
"""
import os
import pytest
from aiida_ddec.calculations import DENSITY_DIR_EXTRA, DENSITY_DIR_SYMLINK
from tests import DATA_DIR
from examples import DATA_DIR as EXAMPLES_DATA_DIR
pytest_plugins = ['aiida.manage.tests.pytest_fixtures', 'ai... |
import ast
import os
from lcc.entities.exceptions import InvalidFilesPath
import numpy as np
from lcc.utils.helpers import sub_dict_in_dict
from lcc.utils.helpers import check_depth
class StatusResolver(object):
'''
This class is responsible for status files generated thru systematic searches
into databa... |
import getpass
import pickle
import sys
from domain import exceptions
from domain.config import Config, CredentialsConfig
from domain.sprint import Sprint
from export.exporter_factory import create_exporter
from communication.jira_agent import JiraAgent
from shell.argument_parser import ArgumentParser
from shell.confi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.