content stringlengths 5 1.05M |
|---|
# -*- coding: utf_8 -*-
import sqlite3 as sq
from optparse import OptionParser
import numpy as np
import concurrent.futures as ccf
# from numba import jit
def opt():
parser = OptionParser()
parser.add_option("-d", "--database", action="store", dest="database", type="string",
default=":m... |
import re
from Event import EventHandler
from Note import Note
from User import User
from Message import Message
from Privilege import privs as privList
types = {
'sprintMembership': ("Added to a sprint", "You were added to %s"),
'taskAssigned': ("Assigned a task", "You were assigned the task %s"),
'noteMention': ... |
from gensim.models import KeyedVectors
from fastapi import FastAPI
from pathlib import Path
from typing import Optional
app = FastAPI()
items = {}
def get_models_dirs(base_dir = "models"):
path = Path(base_dir)
return [x for x in path.iterdir() if x.is_dir()]
def get_model_by_name(model_name: str) -> Opti... |
import cv2
import math
import numpy as np
from scipy.ndimage.filters import gaussian_filter, maximum_filter
from scipy.ndimage.morphology import generate_binary_structure
# Color code used to plot different joints and limbs (eg: joint_type=3 and
# limb_type=3 will use colors[3])
colors = [
[255, 0, 0], [255, 85, 0... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect, get_object_or_404
from django.conf import settings
from django.core.urlresolvers import reverse
from django.views.generic import CreateView, FormView, UpdateView, DetailView, ListView, DeleteView, Templ... |
from django import forms
from portfolio.categories.models import Category
class CategoryForm(forms.ModelForm):
class Meta:
model = Category
fields = "__all__"
|
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from gaiatest import GaiaTestCase
from gaiatest.apps.contacts.app import Contacts
from gaiatest.mocks.mock_contact impor... |
from django.contrib import admin
from .models import TimerUser
admin.site.register(TimerUser)
|
import random
import sys
population = bytes([i for i in range(256)])
if sys.argv[1] == 'reflector':
popset = set(population)
buffer = [None for i in range(256)]
for i in range(128):
x, y = random.sample(popset, 2)
popset.remove(x)
popset.remove(y)
buffer[x] = y
buff... |
# Generated by Django 3.1.2 on 2020-10-10 22:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0004_auto_20201010_2148'),
]
operations = [
migrations.AddConstraint(
model_name='processeddocument',
c... |
"""Flpixmapview module."""
# -*- coding: utf-8 -*-
from PyQt6 import QtCore, QtWidgets, QtGui # type: ignore
from typing import cast
class FLPixmapView(QtWidgets.QScrollArea):
"""FLPixmapView class."""
# frame_ = None
# scrollView = None
_auto_scaled: bool
_path: str
_pixmap: QtGui.QPixmap
... |
import json
import pandas as pd
import os
import argparse
import sys
CURR_FP = os.path.dirname(os.path.abspath(__file__))
sys.path.append(CURR_FP)
from util import read_geojson, group_json_by_location, group_json_by_field
BASE_DIR = os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.a... |
# Iskandar Sobirov, 50% (rest TLE)
# give the given code to a brainf*ck interpreter
# hope for the best
from collections import defaultdict
def main():
line = input()
index = 0
data = defaultdict(int)
index += 1
for _ in range(1):
data[index] = ord(line[0])
index += 1
... |
import os
from twisted.internet import stdio as twistedStdio
from twisted.protocols.basic import LineReceiver
from src.shared.logconfig import newLogger
log = newLogger(__name__)
def setupStdio(backend):
twistedStdio.StandardIO(StdioHandler(backend))
class StdioHandler(LineReceiver):
# The default delimi... |
def datacleaner_students():
import pandas as pd
import re
df = pd.read_csv("~/store_files_airflow/raw_student_data.csv")
def clean_student_id(st_id):
matches = re.findall(r'\d+', st_id)
if matches:
return matches[0]
return st_id
# df['STUDENT_ID'] = df['STUDENT... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import json
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from remote_control.requests import handle_request
@csrf_exempt
def receive_request(request):
signed_request = json.loads(request.body).get('requ... |
from django.shortcuts import render
from .models import Newsletter
from .forms import NewsletterSignUpForm
# Create your views here.
def home(request):
return render(request, 'home.html')
def newsletter_signup(request):
if request.method == 'POST':
form = NewsletterSignUpForm(request.POST or None)
... |
from .conventions import EulerAngleConvention, EMEulerAngleConvention
from .conversions import euler2matrix, matrix2euler, euler2euler
from .rotations import RotX, RotY, RotZ
from .version import __version__
|
from genome import Genome
class Species():
"""The number of excess and disjoint genes between a pair of genomes is a natural
measure of their compatibility distance. The more disjoint two genomes are, the less
evolutionary history they share, and thus the less compatible they are. Therefore, we
can mea... |
import pyodbc
server = 'localhost'
database = 'SoftUni'
username = 'SA'
password = 'docker21@'
connection = pyodbc.connect('DRIVER={ODBC Driver 17 for SQL Server}; SERVER='+server+';DATABASE='+database+';UID='+username+';PWD='+password)
cursor = connection.cursor()
print ('Reading data from table:')
print()
tsql = "S... |
"""
Given a 2-dimensional grid of integers, each value in the grid represents the color of the grid square at that location.
Two squares belong to the same connected component if and only if they have the same color and are next to each other
in any of the 4 directions.
The border of a connected component is all the ... |
if True:
pass
elif True:
pass
|
# coding=utf-8
# Copyright 2021 TF-Transformers 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 r... |
"""Module containing utility functions and constants."""
def remove_quotes(text: str) -> str:
"""Return the `text` with any surrounding quotes removed."""
return text[1:-1] if text[0] + text[-1] in {"''", '""'} else text
|
# Copyright (c) 2017-2019, Stefan Grönke
# Copyright (c) 2014-2018, iocage
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted providing that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# ... |
import glob
import fitz # 导入本模块需安装pymupdf库
import os
# 将文件夹中所有jpg图片全部转换为一个指定名称的pdf文件,并保存至指定文件夹
def pic2pdf_1(img_path, pdf_path, pdf_name):
doc = fitz.open()
for img in sorted(glob.glob(img_path + "\*.jpg")):
imgdoc = fitz.open(img)
pdfbytes = imgdoc.convertToPDF()
imgpdf = fitz.open("... |
"""1-init
Revision ID: 43a8acfdd2ee
Revises:
Create Date: 2017-03-14 21:14:23.290347
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '43a8acfdd2ee'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
op.execute('''
CREATE TABLE... |
from passlib.hash import sha512_crypt
import sys
print (sha512_crypt.hash(sys.argv[1]))
|
NOISE_PIXELS_THRESHOLD = 2
MEAN_HISTOGRAM_CUTOFF = 0.95
CAP_HEIGHT = 0.5
BASELINE_HEIGHT = 0.5
WORD_SPACE_DISTANCE_HEIGHT_RATIO = 1.0 / 4.0
|
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Igor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later v... |
# Generated by Django 3.0.8 on 2020-08-27 14:22
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('post', '0004_merge_20200827_2030'),
('post', '0002_post_shared_mode'),
]
operations = [
]
|
# -*- coding: utf-8 -*-
from numpy import array, linspace, pi
import numpy as np
from scipy.optimize import curve_fit, root_scalar
def get_BH(self):
"""
Return the B(H) curve of the material (by default do nothing).
Parameters
----------
self : ModelBH
a ModelBH object
Returns
--... |
from mnemonic import Mnemonic
import bip32utils
import requests
import sys
import random
import re
mnemo = Mnemonic("english")
target=[
['xxxx'], # word on plate is "like" ???
['muscle'], # word on plate is "love" ???
['xxxx'], # word is "king"
['shaft'], # word is "place"
['task'], # word on plate is "closet" ?... |
import pandas as pd
import pymongo
import re
import matplotlib.pyplot as plt
from pyecharts import Bar
def parse_wandoujia():
client = pymongo.MongoClient(host='localhost',port=27017)
db = client['wandoujia5']
collection = db['WandoujiaItem']
data = pd.DataFrame(list(collection.find()))... |
from __future__ import unicode_literals
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as _
class ModerationConfig(AppConfig):
name = "djangocms_moderation"
verbose_name = _("django CMS Moderation")
def ready(self):
import djangocms_moderation.handlers # no... |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import rapidsms
from models import *
from reporters.models import Reporter
from i18n.utils import get_translation as _
from i18n.utils import get_language_code
class App(rapidsms.app.App):
registered_functions = {}
session_listeners = {}
def st... |
# Author: Isabel Restrepo
import random, os, sys, time;
from boxm2_scene_adaptor import *;
from boxm2_filtering_adaptor import *;
from glob import glob
from optparse import OptionParser
#######################################################
# handle inputs #
###############... |
import sqlite3
con = sqlite3.connect(":memory:")
con.execute("create table lang (id integer primary key, name varchar unique)")
# Successful, con.commit() is called automatically afterwards
with con:
con.execute("insert into lang(name) values (?)", ("Python",))
# con.rollback() is called after the with block fin... |
"""Connection manager Oppo UDP-20x integration."""
import asyncio
import async_timeout
import logging
from typing import Optional
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_PORT
from homeassistant.core import HomeAssistant, callback
from homeassistant.config_entries import ConfigEntry
from homeassistan... |
from dataviva import app
from flask.ext.script import Manager
app.debug = True
manager = Manager(app)
manager.run()
|
__author__ = 'svs3jm'
def greeting(msg):
print (msg)
|
from hydrolib.core.io.xyz import parser
from tests.utils import test_data_dir
def test_xyz_parser():
fn = test_data_dir / "input" / "test.xyz"
data = parser.XYZParser.parse(fn)
assert "points" in data
assert len(data.get("points", [])) == 7
|
import json
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import MinMaxScaler
from sklearn.neighbors import KNeighbors... |
from random import choice, shuffle
import itertools as it
from copy import deepcopy
from pprint import pprint
import os, time
welcome = '''
Welcome to Uno Màs
-------------------------------------------
----------
|1. Cooler |
----------
Cooler does not see shapes, only colors.
He can put (for exam... |
# Time: O(n)
# Space: O(n)
class Solution(object):
def nextGreaterElements(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
result, stk = [0] * len(nums), []
for i in reversed(range(2*len(nums))):
while stk and stk[-1] <= nums[i % len(nums)]:... |
import threading
import datetime
class ThreadClass(threading.Thread):
def run(self):
now = datetime.datetime.now()
print ("{0} says Hello World at time: {1}".format(
self.getName(), now))
for i in range(50):
t = ThreadClass()
t.start() |
ads1={'platform':['google','facebook'],'month':['july','april','march']}
for ad in ads1.items():
print(ad)
|
from .base_rating import (ModelRecommendation as Model,
LearnerRecommendation as Learner)
|
# Generated by Django 2.2.6 on 2019-10-31 08:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0003_auto_20191031_0828'),
]
operations = [
migrations.AddField(
model_name='car_model',
name='car_model_ima... |
import freetype
fonts = [
"testdata/ToyFeat.ttf",
"testdata/ToySbix.ttf",
"testdata/ToyCBLC1.ttf",
"testdata/ToyCBLC2.ttf",
"testdata/NotoColorEmoji.ttf",
"testdata/mry_KacstQurn.ttf",
"testdata/IBM3161-bitmap.otb",
"testdata/Gacha_9.dfont",
]
print("var expectedSizes = [][]Size{")
for... |
import argparse
import os
from itertools import izip
import cv2
from skimage import io
from data_collection.collect_data import render_equation, mk_template
from postprocessing.augmentation_utils import select_random_augmentation
from utils import run_command
def parse_args():
parser = argparse.ArgumentParser()... |
#py_animal_class.py
class Animal:
#class variable (does not begin with self., in class namespace)
tricks = ["jumping", "playing dead",
"rolling over", "walking backwards"]
def __init__(self, name, species, age, fav_food):
"sets instance variables (begin with self.)"
... |
# program state import/export
from re import match
from typing import List
from colorama import Fore, Style # type: ignore
from _prompt import _error, press_any_key, prompt_file
from _util import Item
# export current program state to CSV file (or stdout)
def export_state(menu: List[Item], file=False) -> None:
... |
from typing import List
import copy
import app.utils.db.basic as db_utils
import app.utils.db.advanced as db_utils_advanced
import app.db_schemas as db_schemas
import tldextract
from loguru import logger
def add_targets(hostnames: List[str], user_id, data):
ids = set()
for hostname in hostnames:
i... |
"""This is not a Django app. This is just a Python module to house Crispy forms
equivalents for Django's built-in auth package.""" |
import glob
import os
import shutil
from pathlib import Path
import numpy as np
from PIL import ExifTags
from tqdm import tqdm
# Parameters
img_formats = ['bmp', 'jpg', 'jpeg', 'png', 'tif', 'tiff', 'dng'] # acceptable image suffixes
vid_formats = ['mov', 'avi', 'mp4', 'mpg', 'mpeg', 'm4v', 'wmv', 'mkv'] # acceptab... |
import requests
import datetime
import pytz
# TODO: proper error-checking for get_historical_rates()
# TODO: implement logging for error messages generated by the API. replace print statement
# TODO: code input checking for get_historical_rates. ensure that input is valid date format.
################################... |
""" SPC Product Colors """
class Outlooks(object):
categorical = {
"HIGH": {"ec": "#CC00CC", "fc": "#EE99EE", "label": "High", },
"MDT": {"ec": "#CC0000", "fc": "#E06666", "label": "Moderate", },
"ENH": {"ec": "#FF6600", "fc": "#FFA366", "label": "Enhanced", },
"SLGT": {"ec": "#DDA... |
import unittest
from symbol_table import (
SubroutineType,
PrimitiveType,
Declaration
)
from . import *
class TestFunctionDeclaration(unittest.TestCase):
def test_generate_identifier_for_empty(self) -> None:
resolver = DependencyResolver()
used_names: Dict[str, int] = dict()
ex... |
import googlemaps
import os
from datetime import datetime
import pprint
#get the google api key from the environemnt variable
API_KEY = os.environ.get("DIRECTION_API_KEY")
print("Using key: " + API_KEY)
gmaps = googlemaps.Client(key=API_KEY)
# Request directions via public transit
def transit(start, end):
now = ... |
from __future__ import absolute_import
from kodi_six import xbmc
from . import kodigui
from lib import util
from lib import metadata
from lib.util import T
import plexnet
class VideoSettingsDialog(kodigui.BaseDialog, util.CronReceiver):
xmlFile = 'script-plex-video_settings_dialog.xml'
path = util.ADDON.get... |
import torch
class BaseModel(torch.nn.Module):
def __init__(self, input_shape, num_actions):
"""Cosntructor for the base model"""
#Call the superclass constructor
super(BaseModel, self).__init__()
#Store variables used for training
self.input_shape = input_shape
... |
# _*_ coding:utf-8 _*_
import web
import web.db
import sae.const
db = web.database(
dbn='mysql',
host=sae.const.MYSQL_HOST,
port=int(sae.const.MYSQL_PORT),
user=sae.const.MYSQL_USER,
passwd=sae.const.MYSQL_PASS,
db=sae.const.MYSQL_DB
)
def addfk(username, fktime, fkcontent):
return db... |
import logging
from flare import html5
from flare.forms import boneSelector, InvalidBoneValueException
from flare.network import NetworkService
from flare.button import Button
from flare.event import EventDispatcher
from flare.observable import StateHandler
@html5.tag("flare-form")
class viurForm(html5.Form):
"""... |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def isValidBSTUtil(self, node, minlim, maxlim):
if not node:
return True
if node.val < minlim or node.val > m... |
import re
from .reader import BraceReader, replace_parens
class JavaReader(BraceReader):
"""An implementation of a Reader for Java code."""
# CONSTANTS
# two or more of these because attrs are always followed by some whitespace
ALL_ATTRS = "(abstract|static|final|strictfp|private|protected|public|class... |
from django.contrib import admin
from .models import Schedule
# Register your models here.
admin.site.register(Schedule)
|
"""
consensys_utils.config
~~~~~~~~~~~~~~~~~~~~~~
Resources used for configuration loading
Most of the resources in this package rely on Cfg-Loader package
(c.f. https://github.com/nmvalera/cfg-loader)
:copyright: Copyright 2017 by ConsenSys France.
:license: BSD, see :ref:`license` for m... |
# -*- coding: utf-8 -*-
import re
from corpus import *
from utils import *
def parse_conll_document(document_path):
sentences = []
words = []
odrl_action = 0
with open(document_path, "r") as input_file:
for line in input_file.readlines():
if re.match(r'^\s*$', line.strip()):
... |
from django.conf.urls import patterns, include, url
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'shadrus.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^1/', 'article.views.basic_one'),
url(r'^2/', 'article.views.template_two'),
url(r'^3/', 'article.views.temp... |
import numpy as np
import matplotlib.pyplot as plt
def HepHist(data,nbins=20,xlims=[0,0],xtrim=False,xLog=False,yLog=False,poissErrors=True,offsetErrors=False,norm=False,manualNorm=1,offset=False,color='C0',label='',fill=True,alpha=0.1,zorder=1,lw=2):
ls = '-'
plt.rcParams['hatch.color'] = color
# Take car... |
from .YOLOP import get_net
|
#!/usr/bin/python
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
from scipy.optimize import curve_fit
import pdb
from matplotlib import rcParams
rcParams['axes.labelsize'] = 24
rcParams['xtick.labelsize'] = 24
rcParams['ytick.labelsize'] = 24
rcParams['legend.fontsize'] = 16
... |
# This file is part of ZS
# Copyright (C) 2013-2014 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
from contextlib import contextmanager
import math
from six import BytesIO
from nose.tools import assert_raises
from zs import ZS, ZSWriter, ZSError
from zs.common import write_length_pr... |
import discord #type: ignore
from discord.ext import commands, tasks #type: ignore
from clashstat import PlayerStats
import os
Client = commands.Bot(command_prefix='@')
ID = os.environ.get('ID')
PW = os.environ.get('PW')
ChannelID = os.environ.get('Channel')
ChannelID2 = os.environ.get('Channel2')
Token ... |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... |
# Copyright 2013-2020 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 RFactominer(RPackage):
"""FactoMineR: Multivariate Exploratory Data Analysis and Data Mini... |
# Generated by Django 3.1.1 on 2020-09-20 07:44
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Account',
fields=[
... |
import math
import cv2
import numpy as np
import torch
import torchvision.transforms.functional as F
from plasticorigins.detection.centernet.models import (
create_model as create_base,
)
class ResizeForCenterNet:
def __init__(self, fix_res=False):
self.fix_res = fix_res
def __call__(self, imag... |
import torch
import numpy as np
import torch.nn as nn
from .layers import AbstractInvertibleLayer
from .neural_net import NeuralNet
class AugmentedLagrangian(nn.Module):
def __init__(self, rho, lam, beta=2, thr=1):
super().__init__()
self.register_buffer('rho', torch.ones(1, dtype=torch.fl... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from . import openrefine
OpenRefine = openrefine.OpenRefine
__all__ = ['openrefine']
|
from django.contrib import admin
# Register your models here.
from cart.models import Cart, CartItem
class CartItemInline(admin.TabularInline):
model = CartItem
@admin.register(Cart)
class CartAdmin(admin.ModelAdmin):
list_display = ('cart_id', 'date_added')
inlines = [CartItemInline]
@admin.register... |
#!/usr/bin/env python
# Policy gradient algorithm and agent with neural network policy
# Chapter 2, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import g... |
from text_cleaner import get_all_dir_path, get_all_articles_in_dir
from text_cleaner.helper_functions import get_recommended_length
from text_cleaner.tokenizer import tokenize_data
from headline_generator_lstm.headlinesmodel import HeadlinesModel
import warnings
warnings.filterwarnings("ignore")
def print_training_s... |
#!/usr/bin/env python
##############################################################################
# Written by: Neville Gao <nevillegao@gmail.com>
# Date: 2009/10/20
# Description: Test accessibility of listbox widget
# Use the listboxframe.py wrapper script
# Test the Moonlight L... |
import difflib
import doctest
import os
import re
import sys
SEASONS = [1, 2, 3, 4, 5, 6, 7, 8]
TYPE_2_INT = {
"N/A": 0,
"Qualifying": 2,
"Finals": 4,
"Stage 1": 6,
"Stage 2": 8,
"Stage 3": 10,
"Stage 4": 12
}
INT_2_TYPE = {v: k for k, v in TYPE_2_INT.items()}
FINISH_2_NAME = {
2.0: "Qu... |
import requests
import settings
API_KEY = settings.GOVINFO_KEY
print(API_KEY) |
# Copyright 2018-2019 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by Sinodun IT (sinodun.com)
... |
from fastapi import APIRouter, Header, HTTPException
from pydantic import BaseModel
from typing import List
from ..services import util, users
router = APIRouter()
class LoginToken(BaseModel):
value: str
@router.get("/oauth-urls")
def oauth_urls():
return users.oauth_urls()
@router.post("/github")
def login... |
from hostel.common.models import Phone, Call
from hostel.clients.models import Client
from django.shortcuts import get_object_or_404
from django.http import JsonResponse, HttpResponseNotAllowed, Http404
from django.views.decorators.csrf import csrf_exempt
import datetime
@csrf_exempt
def bot_message_phone(request, bo... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 21:13:42 2020
This program is use to read AIPS-CC table from fits file,
and output a model file to be read by difmap.
Installation:
1. copy file
chmod a+x cc2mod.py
cp cc2mod.py ~/myapp
2. set envioment parameters
Add the following line to ~... |
# -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class MailComposeMessage(osv.TransientModel):
"""Add concept of mass mailing campaign to the mail.compose.message wizard
"""
_inherit = 'mail.compose.message'
_columns = {
'mass_mailing_campaign_id': fields.many2one(
'ma... |
"""
@file
@brief Shortcuts to *onnxrt.optim*.
"""
from .onnx_helper import onnx_statistics
from .onnx_optimisation_identity import onnx_remove_node_identity
from .onnx_optimisation_redundant import onnx_remove_node_redundant
from .onnx_optimisation import onnx_remove_node
from ._main_onnx_optim import onnx_optimisation... |
# -*- coding: utf-8 -*-
"""
This is the tokeniser or scanner portion for the Wolfram Language.
As such, it also contains a full set of translation between Wolfram Language
named characters, their Unicode/ASCII equivalents and code-points.
"""
from mathics_scanner.version import __version__
from mathics_scanner.chara... |
from zope.index.topic.index import TopicIndex
|
# -*- coding: utf-8 -*-
#
# Copyright (c) 2020, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test the DDEC6 in cclib"""
import os
import unittest
import numpy
from cclib.method import DDEC6, volume
from cclib.... |
"""
IDE: PyCharm
Project: semantic-match-classifier
Author: Robin
Filename: server.py
Date: 22.03.2020
Serves the
"""
import os
from typing import List, Dict
import torch
import uvicorn
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
# init webapp
from data import BertPreprocessor
from mod... |
from ruamel.yaml import YAML
import sys
if __name__ == '__main__':
yaml = YAML(typ='safe')
env_file = sys.argv[1]
with open(env_file, 'r') as f:
conf = yaml.load(f)
print(conf['name']) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Segment pixel-wise street/not street for a single image with a model."""
import logging
import sys
import time
import os
import scipy
import numpy as np
import PIL
# sst modules
from . import utils
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s',
... |
from PyQt5.QtWidgets import *
from PyQt5.QtCore import QSize
from Model.TableViewModel import ProxyModel, FilterProxyModel
from Model.TableViewModel import SleepTableModel, RecordGroupTableModel
from Model.TableViewModel import SleepDurationTableModel, RecordDurationTableModel
from Ui.SleepWindow import SleepAdderWind... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.