content stringlengths 5 1.05M |
|---|
from src.utils.initialize import *
with open('data/interim/poster_movies.pckl','rb') as f:
poster_movies=pickle.load(f)
from keras.applications.vgg16 import VGG16
from keras.preprocessing import image
from keras.applications.vgg16 import preprocess_input
import numpy as np
import pickle
model = VGG16(weights='im... |
from flask import Flask, render_template, request, jsonify
from pymongo import MongoClient
from bson import json_util
from bson.objectid import ObjectId
import json
app = Flask(__name__)
client = MongoClient('mongodb://admin:admin@52.79.234.95:27017')
db = client.jungle
@app.route('/', methods=['GET'])
def hello():
... |
import pytest
from eth.beacon.types.attestation_records import (
AttestationRecord,
)
@pytest.mark.parametrize(
'param,default_value',
[
('oblique_parent_hashes', ()),
('aggregate_sig', (0, 0)),
]
)
def test_defaults(param, default_value, sample_attestation_record_params):
del sam... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\SendList.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectNam... |
import time
import toga
from colosseum import CSS
def build(app):
def on_change(widget):
print(widget.value)
def on_submit(widget):
print(widget.value)
textinput = toga.TextInput(on_change=on_change, on_submit=on_submit)
def callback(widget):
print(textinput.value)
t... |
"""
25.30%
参考了一下答案
学会了,遍历树
(可以一边循环,一边在数组后面添加元素)
"""
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root... |
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.
import re
from typing import List, Union
from nebula2.common.ttypes import DataSet, Edge, NullType, Path, Value, Vertex
Pattern = type(re.compile(r'\d+'))
class DataSetPrinter:
def __init__(self, d... |
import factory
from django.db import IntegrityError
from django.test import TestCase, Client
from django.urls import reverse
from .serializers import CalculationSerializer
from .models import Calculation
class CalculationFactory(factory.DjangoModelFactory):
class Meta:
model = Calculation
class TestC... |
"""Customer operations."""
from .types import RecordType
def get_customer(client, internal_id):
"""Get a customer record using its unique internal identifier.
Args:
client: Netsuite API client
internal_id: Customer unique internal identifier
Returns:
Customer instance if found o... |
import csv
import random
# Load data from external file
filename = "birthdays.csv"
birthdays = {}
reader = csv.reader(open(filename,'r'))
for line in reader:
birthdays[line[0]]=line[1]
responses = [" was born on", " has a birthday on", "'s birthday falls on", " arrived in this world on"] #we can randomly choose ... |
import re
import discord
import os
from discord.ext import commands, tasks
from dotenv import load_dotenv
from Util import Math
from context.MongoPosts import UserPost
from context.UserContext import UserContext
class GeneralCommands(commands.Cog):
def __init__(self, bot_obj):
load_dotenv()
sel... |
from sqlalchemy import Column, Integer, String
from .database import Base
class Movie(Base):
__tablename__ = "movies"
id = Column(Integer, primary_key=True, index=True)
name = Column(String)
|
import json
import pandas as pd
# retrieve my home directory
local_file = '../home_directory/home_dir.txt'
with open(local_file, 'r') as file:
my_home = file.read().rstrip('\r\n')
# set repository folder path
repo_path = my_home + '/github/article_recommender'
# set unfiltered author JSON file path
full_authors_path... |
from django.contrib import admin
class MyAdminSite(admin.AdminSite):
# 重写登录页面
login_template = 'admin/login.html'
|
from base import Core
import config
import util
from oslo_config.cfg import CONF
import models
from drivers.bridge import BridgeDriver
from drivers.ovs import OVSDriver
DRIVERS = {
"bridge": BridgeDriver,
"ovs": OVSDriver
}
class Network(Core):
def __init__(self):
super(Network, self).__init__... |
from .ml_kpca import KernelPCA
from .ml_pca import PCA
from .sparse_kpca import SPARSE_KPCA
from .dim_reducer import Dimension_Reducers
|
from django.contrib.auth.mixins import LoginRequiredMixin
from django.views.generic import DetailView, ListView
from dfirtrack_main.logger.default_logger import debug_logger
from dfirtrack_main.models import Casestatus
class CasestatusList(LoginRequiredMixin, ListView):
login_url = '/login'
model = Casestatu... |
from HarryPotter.py import grabs, gives
#New Settings used for this scene
class Settings:
def __init__(self, wizard_names,moggle_names):
self.wizard_names= ['Harry_Potter']
self.moggle_names= ['Vernon_Dursley','Dudley_Dursley','Petunia_Dursley']
self.equipment= ['admission_letter']
self.pet= ['owl']
def ge... |
valores = []
for c in range(0, 5):
valores.append(int(input(f'Digite um número para a posição {c}: ')))
menor = min(valores)
maior = max(valores)
primeiro = 0
print('=-' * 25)
print(f'Os valores foram: {valores}')
print(f'O menor valor é {menor}, e está nas posições: ', end='')
for c in range(0, valores.... |
from tkinter import *
def resize(ev=None):
label.config(font='Helvica -%d bold'%\
scale.get())
top=Tk()
top.geometry('250x150')
label = Label(top,text= 'Hello world!',
font ='Helvetica -12 bold')
label.pack(fill=Y,expand=1)
scale = Scale(top, from_=10, to = 40,
orient = HORIZONTAL, comm... |
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE.md file in the project root
# for full license information.
# ==============================================================================
"""
Check OS requirements before running CNTK for Python.
"""
import sys
import os
im... |
def main():
file_name = "/home/emre/arastirma/data/ontology/msigdb/c2.all.v4.0.entrez.gmt"
pathway_to_geneids, geneid_to_pathways = get_msigdb_info(file_name, prefix=None)
print pathway_to_geneids["biocarta_alk_pathway"]
return
def get_msigdb_info(pathway_file, prefix=None, inner_delim=None):
pat... |
#!/usr/bin/env python
#
# scene3dcanvas.py - The Scene3DCanvas class.
#
# Author: Paul McCarthy <pauldmccarthy@gmail.com>
#
"""This module provides the :class:`.Scene3DCanvas` class, which is used by
FSLeyes for its 3D view.
"""
import logging
import numpy as np
import OpenGL.GL as gl
import fsl.data.mesh ... |
from typing import Text, Any, Dict, List, Union, Optional
from sagas.nlu.intf import Entity
import logging
logger = logging.getLogger(__name__)
def get_entity_mapping(doc, provider_name) -> Dict[int, Entity]:
from sagas.nlu.rasa_procs import get_entities
sents, doc=doc.sents, doc.doc
ents: List[Entity]=g... |
from manimlib.scene.scene import Scene
class ThreeDScene(Scene):
CONFIG = {
"camera_config": {
"samples": 4,
"anti_alias_width": 0,
}
}
def begin_ambient_camera_rotation(self, rate=0.02):
pass # TODO
def stop_ambient_camera_rotation(self):
pas... |
from collections import OrderedDict
import numpy as np
from astropy.table import Table, vstack, Column
Zsun = 0.0152 # this value from CMD website
Zmin = 0.0001
Zmax = 0.07
logtmax = 10.13
logtmin = 1.
class Isochrone(Table):
""" This class accepts astropy.table.Table objects with 4 columns:
_lgmi... |
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016
"""The data base wrapper class"""
import os
import random
import shutil
from PIL import Image, ImageFont, ImageDraw
import cv2
import numpy as np
from utils.util import iou, batch_iou, drift_dist, recolor, scale_trans, rand_flip
class imdb(object):
"""Image dat... |
"""
Pygame base template for opening a window, done with functions
Sample Python/Pygame Programs
Simpson College Computer Science
http://programarcadegames.com/
http://simpson.edu/computer-science/
"""
import pygame
# The use of the main function is described in Chapter 9.
# Define some colors as global consta... |
from locust import HttpUser, between
from locustfiles.load_testing_microservice import LoadTest
class PrimaryUser(HttpUser):
tasks = [LoadTest]
wait_time = between(1, 3)
|
import bson
import jwt
import datetime
from decouple import config
def check_valid_id(id:str):
return bson.objectid.ObjectId.is_valid(id)
class JWT:
@staticmethod
def generate_jwt(data):
payload = data
payload["exp"] = datetime.datetime.utcnow()+datetime.timedelta(minutes=60)
tok... |
# Copyright (c) 2013 Mortar Data
#
# 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 base64
import datetime
import pdb
import smtplib
from email.mime.base import MIMEBase
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from smtplib import SMTPException
import cx_Oracle
import pandas as pd
def open_database_connection():
connection_string = '' + "/" + '' ... |
import operator
from .. import models
from ..utils import statuses
from ..utils.filtering import ConstFilter, FilterConfig, in_, notin_
_STATUS_FILTERS = {
'unsuccessful': (notin_, (statuses.SUCCESS, statuses.SKIPPED, statuses.RUNNING)),
'successful': (in_, (statuses.SUCCESS, statuses.SKIPPED)),
... |
students = [
{"sno": 101, "sname": "小张", "sgrade": 88},
{"sno": 102, "sname": "小王", "sgrade": 99},
{"sno": 103, "sname": "小李", "sgrade": 77},
{"sno": 104, "sname": "小赵", "sgrade": 66},
]
students_sort = sorted(students,
key=lambda x: x["sgrade"],
reverse=Tr... |
import numpy as np
import cv2
def Sobel(img, thres):
if len(img.shape) == 3:
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
im_x = cv2.Sobel(img, cv2.CV_64F, 1, 0, ksize=3)
im_x = cv2.convertScaleAbs(im_x)
im_y = cv2.Sobel(img, cv2.CV_64F, 0, 1, ksize=3)
im_y = cv2.convertScaleAbs(im_y)
... |
""" Asked by: Microsoft [Medium].
Given a string and a pattern, find the starting indices of all occurrences of the pattern in the string.
For example, given the string "abracadabra" and the pattern "abr", you should return [0, 7].
"""
|
while True:
name = input("What's your name? (type <quit> to quit)")
if name == '<quit>':
break
print('Hello ' + name + '!') |
# Copyright 2016 Intel. 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 applicab... |
#!/usr/bin/env python
#The MIT License (MIT)
#Copyright (c) 2016 Massimiliano Patacchiola
#
#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 ... |
class Solution:
# my ugly solution
def checkIfExist(self, arr: List[int]) -> bool:
neg = sorted([x for x in arr if x < 0], reverse=True)
pos = sorted([x for x in arr if x >= 0])
new = neg + pos
for i, num in enumerate(new):
j = i + 1
if j < len(ne... |
import numpy as np
import torch
import os
from collections import OrderedDict
from torch.autograd import Variable
import itertools
import util.util as util
from util.util import weights_init, get_model_list, vgg_preprocess, load_vgg16, get_scheduler
from util.image_pool import ImagePool
from .base_model import BaseMode... |
def dct_to_fasta(d, fn):
import re, sys, traceback, os
fileName, fileExtension = os.path.splitext(fn)
try:
assert fileExtension.lower() in [".fasta", ".fa", ".fas", ".fna", ".ffn", ".faa", ".frn"]
except AssertionError:
_, _, tb = sys.exc_info()
traceback.print_tb(tb) # Fixed for... |
import torch
from torch import nn
class RCSenseModel3(nn.Module):
def __init__(self, isz, osz, hsz, ssz):
super(RCSenseModel3, self).__init__()
self.hidden_size = hsz
self.gru = nn.GRU(input_size=isz, hidden_size=hsz, num_layers=ssz, batch_first=True)
self.flayers = nn.Sequential(
nn.Linear(... |
#------------------------------------------------------------------------------#
# Funkcje pomocnicze do odczytu zawartości plikó konfiguracyjnych
#
# author: Adam Kurowski
# mail: akkurowski@gmail.com
# date: 29.01.2021
#------------------------------------------------------------------------------#
from configob... |
WORDS = ["fat", "ugly", "dumb"] # no offenses in my group!
|
from django.http import Http404
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.urls import reverse
from registry.decorators import require_setup_completed
from registry.models import Announcement
def home(request):
""" Renders either the home p... |
import os
from scrapy.exporters import JsonItemExporter
class HtmlItemExporter(JsonItemExporter):
TEMPLATE = 'base.html'
def __init__(self, file_, **kwargs):
super(HtmlItemExporter, self).__init__(file_, **kwargs)
self.file.seek(os.SEEK_SET)
self.file.truncate()
with open(os... |
"""
DPN, implemented in PyTorch.
Original paper: 'Dual Path Networks,' https://arxiv.org/abs/1707.01629.
"""
__all__ = ['DPN', 'dpn68', 'dpn68b', 'dpn98', 'dpn107', 'dpn131']
import os
import torch
import torch.nn as nn
import torch.nn.init as init
from .common import conv1x1, DualPathSequential
class Globa... |
"""Python 2 and 3 compatibility."""
import sys
def isnumeric(s):
try:
# Python 2
if isinstance(s, unicode):
u = s
else:
u = unicode(s, "utf-8")
except NameError:
# Python 3
if isinstance(s, str):
u = s
else:
u = s... |
""" Hexadecimal table generator for C/C++ projects """
import sys
class HexTable:
"""
Class to assist with generating arrays of hexadecimal data for C/C++ code.
This ONLY formats values and ends the array. The array declaration itself
MUST first be output by the parent code. This is on purpose and by ... |
from django.urls import path
from . import views
from django.core import serializers
urlpatterns = [
path("", views.index, name="index"),
path("registration/", views.registration, name="registration"),
path("login/", views.user_login, name="login"),
path("logout/", views.user_logout, name="us... |
import os
# for test on CPU
#os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" #for Tensorflow cpu usage
#os.environ["CUDA_VISIBLE_DEVICES"] = ""
import sys
from keras.models import Model
from keras.layers import Input, LSTM, Bidirectional
from keras.layers import Embedding, BatchNormalization
from keras.layers import... |
"""
Tests and demonstration of Point, Pointset, and their label classes
"""
from numpy import (
array,
float64,
)
from PyDSTool import (
comparePointCoords,
Point,
Pointset,
pointsToPointset,
)
import pytest
def test_one():
x = Point({
'coorddict': {'x0': [1.123456789], 'x1': [-0.... |
import unittest
import sys
sys.path.insert(1, "..")
from aws_api_mock.Factory_Simple import Factory_Simple
class test_Factory_Simple(unittest.TestCase):
def setUp(self) -> None:
self.factory_simple = Factory_Simple()
def test_set_possibles_fluent_interface(self):
factory_resulted = self.facto... |
from datetime import datetime
from unittest import TestCase, main
from unittest.mock import patch
from os import path
import arrow
from dateutil.tz import tzutc
from text_analysis_helpers.exceptions import ContentExtractionFailed
from text_analysis_helpers.html import HtmlAnalyser
from text_analysis_helpers.models im... |
from torchvision import datasets, transforms
def _permutate_image_pixels(image, permutation):
if permutation is None:
return image
c, h, w = image.size()
image = image.view(-1, c)
image = image[permutation, :]
image.view(c, h, w)
return image
def get_dataset(name, train=True, downlo... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'main_window.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
Main... |
# Natural Language Toolkit: Tagger Interface
#
# Copyright (C) 2001-2021 NLTK Project
# Author: Edward Loper <edloper@gmail.com>
# Steven Bird <stevenbird1@gmail.com> (minor additions)
# Tom Aarsen <>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
"""
Interface for tagging ea... |
# coding: utf-8
"""
SimScale API
The version of the OpenAPI document: 0.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from simscale_sdk.configuration import Configuration
class TwoResistorNetwork(object):
"""NOTE: This class is auto generat... |
from django.apps import AppConfig
class TextparserConfig(AppConfig):
name = 'applications.textparser'
|
# Copyright (c) 2021, Serum Studio
# 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 restriction, including without limitation the rights
# to use, copy, modify, merg... |
"""
Write a Python program to map two lists into a dictionary
"""
keys = ['red', 'green', 'blue']
values = ['#FF0000','#008000', '#0000FF']
color_dictionary = dict(zip(keys, values))
print(color_dictionary) |
import dash_bootstrap_components as dbc
from dash import html
badges = html.Div(
[
html.H1(["Example heading", dbc.Badge("New", className="ms-1")]),
html.H2(["Example heading", dbc.Badge("New", className="ms-1")]),
html.H3(["Example heading", dbc.Badge("New", className="ms-1")]),
ht... |
"""Bootstrapping - for calculating the confidence interval for a ROC curve."""
import multiprocessing as mp
from typing import List, Optional, Tuple
import numpy as np
from pyroc import ROC
def bootstrap_roc_(args: Tuple[ROC, int]) -> ROC:
"""Helper method which applies bootstrapping on a given ROC curve.
... |
import gpt_2_simple as gpt2
sess = gpt2.start_tf_sess()
gpt2.load_gpt2(sess, run_name="montagmodel")
gpt2.generate_to_file(sess, destination_path='montagarticlernn-temp0-5-100samples.txt', nsamples=100, temperature=0.5, run_name="montagmodel")
|
import json
import random
class Player:
VERSION = "trymajom"
own_cards=[]
def get_own_cards(self, game_state):
for player in game_state['players']:
if player['name']=="pokerSmokers":
return player['hole_cards']
def get_player_bets(self, game_state):
bets = [... |
# -*- coding: utf-8 -*-
from collections import Mapping
def shorten(s, width=80):
"""
>>> shorten('a very very very very long sentence', 20)
'a very very ..(23)..'
"""
if not isinstance(s, str):
s = str(s)
length = len(s)
if length < width:
return s
cut_length = lengt... |
#!/usr/bin/env python2.7
#-*- coding: utf-8 -*-
import subprocess
import os
import argparse
import json
import sys
sys.path.append('../py-utils/')
#sys.path.append('../global--env/')
import utils
#from envconfig import *
cs_inst = None
addr_dict = {}
contract_addr = ''
def dry_run() :
cmds = [
'wrp-qtum... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from src.ScaleUp import ScaleUp
def scaling_factor(sequence_threshold):
return np.log2((sequence_threshold ** 2) - sequence_threshold)
class MultiHeadAttentionLayer(nn.Module):
def __init__(self, d_model, n_heads, sequence_... |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
# import warnings
from pyiron_base import JobTypeChoice, Project as ProjectCore
fr... |
"""Common errors used by the SKEO Syncer."""
class Error(Exception):
pass
class CommunicationError(Error):
"""Indicates that a communication failure with a system happened."""
class NotFoundError(Error):
"""Indicates that the product model is not found in a system."""
class MultipleRe... |
from math import pi, ceil, log
from time import sleep
def area(width: int, height: int):
return width * height
def n_terms_approx_pi(epsilon: float):
n = 1
approx = 1.
while abs(approx * 4 - pi) > epsilon:
n = n + 1
approx = approx - (-1)**n / (2 * n - 1)
# print("DEBUG: n = {n:6}, error = {err:.8f}".forma... |
# -*- coding: utf-8 -*-
import os
import re
import json
import sys
import shutil
try:
import requests
except ImportError:
print("ERROR: not install package: \"requests\"")
"""
获取协议包最大版本+1,并自动写入到build.gradle.kts中,可拷贝至客户端协议文件夹
"""
CONST_URL = "http://192.168.189.16:16000/service/extdirect"
header = {
'Us... |
import json
from airone.lib.test import AironeViewTest
from job.models import Job, JobOperation
from entry import tasks
from entry.models import Entry
from entity.models import Entity
from django.urls import reverse
from unittest.mock import patch
from unittest.mock import Mock
from job.settings import CONFIG
# co... |
import itertools
import json
from typing import List
from deap import creator
from core.folders import folders
from core.member import Member
from core.misc import delete_folder_recursively
from core.problem import Problem
from core.seed_pool_access_strategy import SeedPoolAccessStrategy
from core.seed_pool_impl impo... |
from __future__ import annotations
from typing import List
UNIT_INDENT = ' ' * 4
class LineBuffer:
_lines: List[str]
_indent_level: int
_prefix: str
def __init__(self, indent: int, *lines):
self._lines = list(lines)
self._indent_level = indent
self._prefix = self.get_indent_... |
import configparser
import os
import sys
import tempfile
import numpy as np
import pystac
import stac2dcache
from concurrent.futures import ProcessPoolExecutor, as_completed
from stac2dcache.utils import get_asset, copy_asset
from eratosthenes.preprocessing.handler_multispec import get_shadow_bands
from eratosthene... |
from enum import Enum
class Triggers(Enum):
STARTUP = 0;
SHUTDOWN = 1;
USER = 2; |
import pymongo
client = pymongo.MongoClient("mongodb://localhost:27017/")
db = client['restaurants_db']
collection_restaurant = db['restaurant']
print("1. Parašykite užklausą atvaizduojančią visus dokumentus iš restoranų rinkinio")
for x in collection_restaurant.find():
print(x)
print("2. Parašykite užklausą, ku... |
def contador(i, f, p):
#Quando abre-se 3 aspas duplas, temos uma Docstring, a partir daí o comando help(parâmetro) passa a funcionar com o que eu escrever
"""
Realiza uma contagem, onde i == início da contagem, f == final da contagem e p == passo da contagem!
"""
c = i
while c <= f:
prin... |
"""
General Functional Cell
"""
from __future__ import absolute_import, division, print_function
import re
import math
import numbers
import numpy as np
import tensorflow as tf
from tensorflow.contrib.rnn import RNNCell
from tensorflow.python.framework import ops
import tnn.spatial_transformer
import tfutils.model
tr... |
"""PyTorch implementations of Special Euclidean and Special Orthogonal Lie groups."""
from .so2 import SO2Matrix as SO2
from .se2 import SE2Matrix as SE2
from .so3 import SO3Matrix as SO3
from .se3 import SE3Matrix as SE3
__author__ = "Lee Clement"
__email__ = "lee.clement@robotics.utias.utoronto.ca"
|
import string
import sys
import openpyxl
def get_file(filename):
if filename:
return open_workbook(filename)
else:
return open_workbook('default.xlsx')
def open_workbook(name):
try:
print('Opened file in location: ' + str(name))
return openpyxl.load_workbook(name)
exc... |
import os
import pytest
import re
import subprocess
import yaml
from cekit.generator.base import Generator
from cekit.descriptor import Module, Repository
from cekit.version import version as cekit_version
basic_config = {'release': 1,
'version': 1,
'from': 'scratch',
'... |
#!/usr/bin/env python3
# encoding: utf-8
import argparse
import os
import sqlite3
import json
"""import_to_sql.py: Imports the Horoscope database into a SQLite"""
__author__ = "Project Zodiacy"
__copyright__ = "Copyright 2015, Project Zodiacy"
parser = argparse.ArgumentParser(description="Awesome SQLite importer")... |
from dynamicserialize.dstypes.com.raytheon.uf.common.dataquery.requests import RequestConstraint
import unittest
#
# Unit tests for Python implementation of RequestConstraint
#
# SOFTWARE HISTORY
#
# Date Ticket# Engineer Description
# ------------ ---------- ----------- ----... |
"""Define tidy_headers version."""
import os
here = os.path.abspath(os.path.dirname(__file__))
__all__ = ["__version__"]
# read from VERSION file
with open(os.path.join(here, "VERSION")) as f:
__version__ = f.read().strip()
|
from django.http import HttpResponse
from django.template.loader import get_template
from rest_framework import viewsets, permissions, status, generics
from rest_framework.decorators import action
from rest_framework.response import Response
from weasyprint import HTML
from .serializers import *
class AdminUserViewS... |
import os
import sys
sys.path.append(
os.path.normpath(
os.path.join(os.path.abspath(__file__), "..", "..", "..", "common")
)
)
from env_indigo import *
indigo = Indigo()
bingo = Bingo.createDatabaseFile(indigo, "get_indigo_object_bug", "molecule")
for item in ("C1=CC=CC=C1", "C1=CN=CC=C1"):
bingo... |
import torch
__all__ = ['SparseTensor']
class SparseTensor:
def __init__(self, feats, coords, cur_tensor_stride=1):
self.F = feats
self.C = coords
self.s = cur_tensor_stride
self.coord_maps = {}
self.kernel_maps = {}
def check(self):
if self.s not in self.coor... |
import pymysql.cursors
import json
import sys
import time
import warnings
class Database:
# postan singleton
singleton = None
# mysql connection
mysqlConnection = None
# mysql cursor
mysqlCursor = None
# connection start time
connection_start = None
@staticmethod
def init(... |
##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2021 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
# -*- coding: utf-8 -*-
"""
glashammer.utils.events
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2007-2009-2008 by Armin Ronacher
:license: MIT
"""
# Events
from collections import deque
from glashammer.utils.local import local
from glashammer.utils.log import debug
def emit_event(event, *args, **kwargs):
... |
# -*-coding:utf-8-*-
import os
import sys
import json
import time
import glob
from dbr import *
reader = BarcodeReader()
Barcode_Format_Dict = {
'1': (EnumBarcodeFormat.BF_ALL, EnumBarcodeFormat_2.BF2_POSTALCODE | EnumBarcodeFormat_2.BF2_DOTCODE),
'2': (EnumBarcodeFormat.BF_ONED, EnumBarcodeFormat_2.BF2_NULL... |
import time
import socket, ssl, select
from besspin.base.utils.misc import *
def test_259 (target,binTest):
testNum = 259
if (binTest != "test_{0}.riscv".format(testNum)):
target.terminateAndExit(f"Calling <test_{testNum}> for binary <{binTest}>.",exitCode=EXIT.Dev_Bug)
outLog = "\n" + '*'*30 + "... |
from django.contrib import admin
# Register your models here.
from .models import *
admin.site.register(profile),
admin.site.register(parent),
admin.site.register(configuration),
admin.site.register(influx),
admin.site.register(toogle) |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from inspect import getmembers
from functools import partial
from astropy.utils.xml import iterparser
from astropy.io.votable.exceptions import warn_or_raise
from pyvo.utils.xml.exceptions import UnknownElementWarning
__all__ = [
"xmlattribute", "xm... |
'''
This module implements the Cuppa5 type coercion system through a set
of tables. These tables implement the type hierarchy
INTEGER_TYPE < FLOAT_TYPE < STRING_TYPE
ARRAY_TYPE
VOID_TYPE
'''
# types that are supported in arithmetic/local operations
supported_types = [
'STRING_TYPE',
... |
from source.settings import VALUES_OF_BOARD_FIELDS
class InitialValuesOfField:
value = VALUES_OF_BOARD_FIELDS["INITIAL_VALUE_OF_THE_FIELD"]
revealed = False
flagged = False
nearby_mines = 0
|
from src.sim.model.parts.progress_signal import *
from src.sim.model.parts.adoption import *
partial_state_update_block = [
{
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# PUBLIC MILESTONE SIGNAL
'policies': {
'milestone_rate': p_milestone... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.