content stringlengths 5 1.05M |
|---|
# Batch PDF Template
# batch_pdf_template.py
# Horner and Shifrin
# Authors: Andrew Schreiber, Kip Kritis
# Created: 6/1/2018
# Modified: 11/16/2018
'''
Batch PDF Template
'''
print "importing modules..."
import arcpy, os, sys, traceback, datetime, csv
##############################################################... |
import numpy as np
def random_seeds(G, k, Ep):
nodes = list(G.nodes)
indexs = np.random.randint(0, len(nodes), size=k)
S = [nodes[i] for i in indexs]
return S
|
import mymodule
a = mymodule.A()
a.spam()
b = mymodule.B()
b.bar()
|
""" Synaplexus Base Model API
"""
from __future__ import absolute_import
import os
import sys
import json
import logging
from time import time
from datetime import datetime
from importlib import import_module
from . util import snpx_create_dir, DictToAttrs
class SNPXModel(object):
""" Base model
The base cl... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# @Author : Kyle
# @License : MIT
# @Contact : kairu_madigan@yahoo.co.jp
# @Date : 2018/08/05 12:57
|
def modif_bubble(arr):
for n in range(0, len(arr)):
for j in range(0,len(arr)-n-1):
if arr[j][2] > arr[j+1][2]:
arr[j],arr[j+1]=arr[j+1],arr[j]
return arr
|
#!/usr/bin/env python
import web
#web.config.debug = False
from web import form
import json
from montecarlo import *
from datetime import *
import urllib
import urllib2
import numpy
urls = (
'/', 'projectlist',
'/login', 'login',
'/logout', 'logout',
'/users', 'users',
'/favicon.ico', 'favicon',
'/... |
from . import filesystem
from . import common
from . import gitbook
from . import markdown |
# A simple package for testing with.
print("pkg1.__init__: %s" % (__name__,))
|
#import pymysql.cursors
from fixture.orm import ORMFixture
from model.group import Group
db = ORMFixture(host="127.0.0.1", name='addressbook', user="root", password="")
try:
l = db.get_contacts_not_in_group(Group(id='145'))
for item in l:
print(item)
print(len(l))
finally:
pass
# from fix... |
#!/usr/bin/env python3
import connexion
from swagger_server import encoder
def main():
app = connexion.App(__name__, specification_dir='./swagger/')
app.app.json_encoder = encoder.JSONEncoder
app.add_api('swagger.yaml', arguments={'title': 'RFK API Dokumentacija'}, pythonic_params=True)
app.run(port... |
""" Definition of automated optomechanics interfaces. """
import time
import operator
import struct
import numpy as np
import mqlab.utils as ut
from mqlab.connections import Instrument
try:
import ftd2xx
from ftd2xx.defines import BITS_8, STOP_BITS_1, PARITY_NONE, FLOW_RTS_CTS
except Exception:
... |
from .models import Comment
from rest_framework import serializers
class CommentSerializer(serializers.ModelSerializer):
class Meta:
model = Comment
fields = ['id', 'text', 'date_created', 'meal', 'profile']
class CommentHardSerializer(serializers.Serializer):
text = serializers.CharField(... |
import numpy as np
import torch
class RandomActionNoise:
def __init__(self, action_dim, mu=0, theta=0.1, sigma=1):
self.action_dim = action_dim
self.mu = mu
self.theta = theta
self.sigma = sigma
self.x = np.ones(self.action_dim) * self.mu
def reset(self):
self.... |
from dbnd._core.errors import DatabandConfigError
def local_engine_not_accept_remote_jobs(env, to_cluster):
return DatabandConfigError(
"cluster '{to_cluster}' can't accept remote jobs".format(
to_cluster=to_cluster
),
help_msg="Check your execution configuration at {}".format... |
import contextlib
import difflib
import functools
import math
import operator
import os
import sys
from collections import OrderedDict
from collections.abc import Callable, Collection, Hashable, Iterable, Iterator, Sequence
from decimal import Decimal
from functools import cache
from itertools import combinations, zip_... |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015, 2016, 2017 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
from django.contrib import admin
from .models import Treasure
admin.site.register(Treasure) |
import numpy as np
import numpy.ma as ma
from Xdrop.dropletizem import dropimgood_sel
import time
import pickle
import re
from matplotlib import pyplot as plt
def dropletizedata(data, pars, mask=None, dark=None, savdir="./", savname=None):
# print(dropimgood_sel.__doc__)
dim = data.shape
mshape = dim[-2:]... |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import datetime
from recipe_engine.post_process import StepSuccess, StepFailure, StepException
PYTHON_VERSION_COMPATIBILITY = 'PY2+3'
DEPS = [
... |
import time
import threading
v = threading.local()
def func(arg):
# 内部会为当前线程创建一个空间用于存储:phone=自己的值
v.phone = arg
time.sleep(2)
print(v.phone, arg) # 去当前线程自己空间取值
for i in range(10):
t = threading.Thread(target=func, args=(i,))
t.start()
|
# Copyright 2015 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests for cipd."""
from __future__ import print_function
import json
import hashlib
from chromite.lib import cipd
from chromite.lib import cros_test... |
from PIL import Image
from imageprocessing.segment import Segment
class SourceImage(Segment):
def __init__(self, image: Image):
width, height = image.size
super().__init__(image, (0, 0), (width, height))
|
"""
Base class for equipment that is connected through a serial port.
"""
import time
import serial
from .connection_message_based import ConnectionMessageBased
from .constants import (
Parity,
StopBits,
DataBits,
REGEX_SERIAL,
REGEX_PROLOGIX,
)
class ConnectionSerial(ConnectionMessageBased):
... |
import setuptools
with open('README.md') as f:
README = f.read()
setuptools.setup(
author ="Pradeep T",
author_email ='pradeeprajkvr@gmail.com',
name ='databalancer',
license ... |
import key_secret
import tweepy
import csv
import os
import re
from re import finditer
from nltk.corpus import stopwords
from nltk.corpus import wordnet as wn
from nltk.stem.wordnet import WordNetLemmatizer
from nltk import pos_tag
class TwitterMining:
def __init__(self):
self.__tweets_csv_path = os.getc... |
import os, re, sys
import getopt
debug = True
def usage(progName):
print "usage: %s [--help] [--stdin] [--count] <search> [<replace>]" % progName
print
def treat_file(fname, countOnly, toSearch, toReplace):
content = open(fname, "r").read()
outputContent = ''
count = 0
startAt = 0
w... |
"""
setup file for package description, content etc.
"""
from setuptools import setup, find_packages
from os import path
from sca3300.utils.version import __VERSION__
# read the contents of your README file
current_dir = path.abspath(path.dirname(__file__))
with open(path.join(current_dir, 'README.md'), encoding='utf... |
import os, logging, glob, numpy as np, rpxdock as rp
from rpxdock.xbin import xbin_util as xu
from rpxdock.score import score_functions as sfx
log = logging.getLogger(__name__)
"""
RpxHier holds score information at each level of searching / scoring
Grid search just uses the last/finest scorefunction
"""
class RpxH... |
default_app_config = 'addons.owncloud.apps.OwnCloudAddonAppConfig'
|
from django.contrib import admin
from django.urls import include
from django.urls import path
urlpatterns = [
path("admin/", admin.site.urls, name="admin"),
path("", include("applications.main.urls"), name="index"),
]
|
# -*- coding: utf-8 -*-
from const import EXAMPLES_DIR, OUTPUT_DIR, DEFAULT_TABLE
from text2braille import text2braille
from unicode2png import unicode2png
from processor import process_inputs
from args_parser import parse_args
def run_with_args(args):
print('Doing test run using args "%s"' % args)
parsed_arg... |
# Generated by Django 2.0.2 on 2020-06-30 17:18
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('index', '0002_auto_20200630_1627'),
]
operations = [
migrations.AlterField... |
import sys, time
from pywinauto.application import Application
## Get user input for action to manage game
def get_manage_option(again=False):
if not again:
sys.stdout.write("\nSelect the actions by order if creating a new game\n")
sys.stdout.write("Creating a symbolic link is unnecessary if... |
"""Linear implementation using NNVM."""
import numpy as np
from itertools import count
import nnvm.compiler
import nnvm.symbol as sym
import tvm
from nnvm.compiler import graph_attr
from tvm.contrib import graph_runtime
from .utils import get_outputs
from ..dtype import type_to_np_dtype, ismyiatype, Array
from ..pr... |
#!/usr/bin/env python
# coding: utf-8
# In[26]:
import math, cmath
import numpy as np
def graphgen(coeff):
"""
Generates a graph for any given equation
:param coeff: list of all the coefficients of an equation
:return: Graph object plotted based on the equation
"""
x = np.linspace(-... |
#!usr/bin/python
from __future__ import division
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy as sk
from sklearn.feature_selection import RFE
import matplotlib.patches as mpatches
from sklearn.metrics import confusion_matrix, roc_curve, roc_auc_score
from pandas.tools.plotting imp... |
from django.urls import resolve
from django.test import TestCase
from django.http import HttpRequest
from django.utils.html import escape
from django.template.loader import render_to_string
from lists.models import Item, List
from lists.views import home_page, view_list
class HomePageTest(TestCase):
def test_roo... |
# SPDX-FileCopyrightText: 2020 - Sebastian Ritter <bastie@users.noreply.github.com>
# SPDX-License-Identifier: Apache-2.0
'''
The blood of java.io package.
full implemented:
* none
parts implemented:
* java.io.File
non implemented:
* all other
'''
|
"""Test Case for User API."""
import pytest
from unittest.mock import patch
from f8a_worker.models import (UserDetails)
from bayesian.utility import user_utils
def get_user_function(uuid):
"""User details required in the fixture."""
user_details = UserDetails()
user_details.user_id = uuid
user_detai... |
from unittest.mock import patch
import pytest
from rpdk.core.exceptions import WizardAbortError, WizardValidationError
from rpdk.core.hook.init_hook import (
ValidatePluginChoice,
input_language,
input_typename,
validate_type_name,
)
from tests.test_init import PROMPT
def test_input_typename():
... |
#!/usr/bin/python3
import numpy as np
import pandas as pd
from venus.stock_base import StockEventBase, dataLine
from mars.utils import read_url
from dev_global.env import CONF_FILE
class EventFinanceReport(StockEventBase):
def update_balance(self, stock_code):
# get url
url = read_url("URL_balance... |
import calligra
import calligra.stdlib
import os
import pycparser
import argparse
composite = {
'Struct': calligra.struct,
'Union': calligra.union,
'Enum': calligra.enum,
}
dir_path = os.path.dirname(os.path.realpath(__file__))
class ASTContext:
def __init__(self, ns):
self.namespace = ns
self.def... |
# -*- coding: utf-8 -*-
from os import path
from django.conf import settings
from django.contrib.auth.models import Group
from django.contrib.sites.models import Site
from django.core.files.storage import FileSystemStorage
from django.test import TestCase, override_settings
from django.urls import reverse
from django.... |
# Copyright (c) 2019. Curtis Penner
import unittest
from music.symbol import Gchord
class TestGchord(unittest.TestCase):
def test_00(self):
gch = Gchord()
line = '"This is it", so go.'
new_line = gch.parse_gchord(line)
self.assertEqual(new_line, ', so go.')
self.assertEqu... |
from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... |
"""
A script which extracts the communication information from FurnMove evaluation episodes
(using agents trained with SYNC policies and the CORDIAL loss) and saves this information
into a TSV file. This TSV file can then be further analyzed (as we have done in our paper)
to study _what_ the agents have learned to comm... |
from setuptools import setup
setup(
name='pplugins',
py_modules=['pplugins'],
install_requires=['six>=1.10.0'],
author='John Maguire',
author_email='contact@johnmaguire.me',
description='Process-based plugin framework',
license='MIT',
url='https://github.com/JohnMaguire/pplugins',
... |
#!/usr/bin/env python3
import os
import sys
import os.path
import glob
import optparse
import subprocess
import re
import errno
def find_files_upward(filenames):
# Calculate the current directory depth. This is an obvious overestimate,
# but that's okay.
depth = len(os.path.abspath(".").split("/"))
... |
HTML_FIXTURE_ONE = """<dl>
<dt>First name</dt>
<dd>Dolores</dd>
<dt>Last name</dt>
<dd>Abernathy</dd>
<dt>ID number</dt>
<dd>CH465517080</dd>
<dt>Status</dt>
<dd>Conscious</dd>
<dt>Park</dt>
<dd>Westworld</dd>
<dt>Narrative Role</dt>
<dd>Rancher's daughter<dd>
</dl>"""
H... |
import gordongames as gg
import mathblocks as mb
import numberline as nl
import numpy as np
class Oracle:
def __call__(self, env=None, state=None, *args, **kwargs):
"""
All oracles must implement this function to operate on the
environment.
Args:
env: None or Sequential... |
# Copyright 2019, Futurewei Technologies
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, V... |
from enum import Enum
class RIALAccessModifier(Enum):
PRIVATE = "private"
INTERNAL = "internal"
PUBLIC = "public"
def __repr__(self):
return self.value
def __str__(self):
return self.__repr__()
def __lt__(self, other):
if self == RIALAccessModifier.PRIVATE and (
... |
# -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb
import unittest
import pyxb.binding.datatypes as xsd
import datetime
class Test_time (unittest.TestCase):
def verifyTime (self, tm, with_usec=True, with_adj=(0,0), with_tzinfo... |
def _init():
global global_dict
global_dict={}
#map new syscall type to old
global_dict["sc_n2o"]={
"select":"pselect6",
"pipe":"pipe2",
"access":"faccessat",
"newfstatat":"fstatat",
"lstat":"fstatat",
"open_by_handle_at":"openat",
"stat":"fsta... |
# MIT licensed
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
import pytest
pytestmark = pytest.mark.asyncio
async def test_npm(get_version):
assert await get_version("example", {"npm": None}) == "0.0.0"
|
"""
.. module: lemur.plugins.lemur_kubernetes.plugin
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
The plugin inserts certificates and the private key as Kubernetes secret that
can later be used to secure service endpoin... |
from pymongo import MongoClient
import pymongo
from config import db_info
def get_jobs_table():
client = MongoClient(db_info["client"])
db = client[db_info["database"]]
jobs = db[db_info["table"]]
if jobs == None:
raise ValueError('Issue connecting to database. Make sure db_info is properly s... |
import pytest
from flipy.lp_objective import LpObjective, Minimize, Maximize
@pytest.fixture
def objective(name='', expression=None, constant=0):
return LpObjective(name, expression, constant)
class TestLpExpression(object):
def test_init(self):
obj = LpObjective(name='', expression=None, constant=... |
'''
IffyFishies
- Coding 30 million fish for #TeamSeas
'''
from PIL import Image, ImageTk
from requests.models import HTTPError, ConnectionError
from generate_fish import *
import tkinter as tk
from tkinter import filedialog
from tkinter.colorchooser import askcolor
from pathlib import Path
import random
import requ... |
'''
Created on 1 Sep 2013
@author: Nia Catlin
'''
import os, subprocess, multiprocessing, threading
from lockwatcher import fileconfig
from lockwatcher import hardwareconfig
dbusobj = None
shuttingDown = False
emailAlert = False
#if we found a screenlocker program then exec that
#some environments want it done with... |
from django.db import models
from django.contrib.auth.models import AbstractUser
from hackathons.models import Hackathon, Sponsorship
# Create your models here.
class User(AbstractUser):
phone = models.CharField(max_length=15, blank=True)
current_hackathon = models.ForeignKey(
Hackathon, on_delete=m... |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" Best algorithm dataset module
This module implements :py:class:`BestAlgSet` class which is used as
data structure for the data set of the virtual best algorithm.
Therefore this module will be imported by other modules which need
to access best algorit... |
import re
def claim_to_size(claim):
match = re.search("#\d+\s@\s(\d+),(\d+):\s(\d+)x(\d+)", claim)
x = int(match.group(1))
y = int(match.group(2))
w = int(match.group(3))
h = int(match.group(4))
return x, y, w, h
def claim_overlap(occupied_spaces, x, y, w, h):
for delta_x in range(w):
... |
"""
Sentinel Search & Download API
Authors: Jonas Eberle <jonas.eberle@uni-jena.de>, Felix Cremer <felix.cremer@uni-jena.de>, John Truckenbrodt <john.truckenbrodt@uni-jena.de>
Example usage: Please see the "main" function at the end of this file
TODO:
- Documentation
"""
#############################################... |
from rest_framework import status, exceptions
from rest_framework.generics import (RetrieveAPIView,
RetrieveUpdateAPIView, CreateAPIView,
RetrieveUpdateDestroyAPIView, ListAPIView
)
from rest_framework.permiss... |
from django import forms
class MoviesForm(forms.Form):
# Your run-of-the-mill form here
pass
|
from .localization import get_default_ttf_font_name
|
from django import forms
from .models import User,Profile,Post,Business
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('first_name', 'last_name', 'email')
class ProfileForm(forms.ModelForm):
class Meta:
model =Profile
fields = ('bio', 'neigh_location', 'nei... |
import hashlib
from typing import Callable
import numpy as np
from os import makedirs, listdir
from os.path import exists, join, splitext
def make_dir(folder_name):
"""Create a directory.
If already exists, do nothing
"""
if not exists(folder_name):
makedirs(folder_name)
def get_hash(x: st... |
#!/usr/bin/env python
import settings
import ana_sol
import sys
import math
import commands
import matplotlib.pyplot as plt
import getopt
from scipy.special import erf
from numpy import poly1d
from matplotlib.pyplot import figure, show
from numpy import pi, sin, linspace
from matplotlib.mlab import stineman_interp
... |
# Generated by h2py from /usr/include/fcntl.h
# Included from standards.h
# Included from sys/types.h
# Included from sys/m_types.h
TRUE = 1
FALSE = 0
NBBY = 8
FHSIZE = 32
# Included from sys/select.h
# Included from sys/time.h
ITIMER_REAL = 0
ITIMER_VIRTUAL = 1
ITIMER_PROF = 2
ITIMER_VIRT = 3
TIMEOFDAY = 9
TIMERI... |
from contextlib import AsyncExitStack
from os.path import dirname
from os.path import join
from unittest import IsolatedAsyncioTestCase
from tortoise.transactions import get_connection
import dipdup.context as context
from dipdup.config import DipDupConfig
from dipdup.config import SqliteDatabaseConfig
from dipdup.di... |
import setuptools
requires = [
'numpy >= 1.18.1',
'redis >= 3.4.1',
]
setuptools.setup(
name = 'automator',
version = '1.0',
url = 'https://github.com/UCBerkeleySETI/commensal-automator',
license = 'MIT',
author = 'Daniel Czech',
author_email = 'danielc@berkeley.edu',
descripti... |
from .settings import *
GRAPHQL_AUTH = {
"ALLOW_DELETE_ACCOUNT": True,
"REGISTER_MUTATION_FIELDS": {"email": "String", "username": "String"},
"UPDATE_MUTATION_FIELDS": ["first_name", "last_name"],
"ALLOW_LOGIN_NOT_VERIFIED": False,
}
INSTALLED_APPS += ["tests"]
AUTH_USER_MODEL = "tests.CustomUser"
|
# Generated by Django 2.1.2 on 2018-12-09 22:22
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('gene_parser', '0001_initial'),
]
operations = [
migrations.CreateModel(
... |
import warnings
from django.template import loader
from django.utils.deprecation import RenameMethodsBase
from .. import compat, utils
from . import filters, filterset
# TODO: remove metaclass in 2.1
class RenameAttributes(utils.RenameAttributesBase, RenameMethodsBase):
renamed_attributes = (
('default_... |
#!/usr/bin/env python
import numpy as np
import unittest
from reference_odometry import pose2np,transform_between_poses
from geometry_msgs.msg import Pose
from tf import transformations as trf
class TestOdometry(unittest.TestCase):
def test_transform_translation(self):
pb = Pose() # The pose of the base f... |
import requests
from bs4 import BeautifulSoup
#to run this code, you first need to create a folder where you will
# store the treaties texts. In this example, I created a folder
#called "treaties" on my desktop.
list_treaty = [
#add all treaties IDs in there
]
for treaty in list_treaty:
... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... |
from django.contrib.contenttypes.fields import GenericRelation
from django.db import DEFAULT_DB_ALIAS
class VirtualDatabaseRelation(GenericRelation):
""" Delete related databases if any """
def bulk_related_objects(self, objs, using=DEFAULT_DB_ALIAS):
pks = []
for obj in objs:
db_i... |
# Copyright 2021 QuantRocket 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... |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 bianlifeng.com, Inc, All Rights Reserved
#
"""
@File: citation_generator
@Author: jing.huang02
@Date: 2021/10/6 下午7:29
@Description:
@Changelist:
- 1.0 first edition
"""
def format_authors(authors):
# authors_str = ''
# '" and " seems to be the consistent split ter... |
import base64
with open("C:/Users/Neuhauser_Jonas/Downloads/2x/outline_person_black_36dp.png", "rb") as image:
print(base64.b64encode(image.read()))
# print(base64.b64encode(image.read()).decode("utf-8"))
|
#!/usr/bin/env python3
# Foundations of Python Network Programming, Third Edition
# https://github.com/brandon-rhodes/fopnp/blob/m/py3/chapter16/sftp_get.py
# Fetching files with SFTP
import argparse, functools, paramiko
class AllowAnythingPolicy(paramiko.MissingHostKeyPolicy):
def missing_host_key(self, client, ... |
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
requirements = [
'floris>=3.1',
'feather-format>=0.4.1',
'matplotlib>=3',
'numpy==1.21',
'numba>=0.55.0',
'openoa>=2.0.1',
'pandas>=1.3.0,<=1.4.0',... |
import json
from cto_ai import prompt, sdk, ux
class Db_credentials():
def __init__(self):
self.host = ''
self.username = ''
self.password = ''
self.db = ''
self.port = ''
def get_credentials(self):
"""
Gets the host, username, password, database, an... |
"""Cluster View: show all clusters and groups."""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import pprint
import inspect
from collections import OrderedDict
import pandas as pd
import numpy ... |
# Copyright [2015] Hewlett-Packard Development Company, L.P.
# 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... |
from mikula import __version__
import yaml
import os
import time
DEFAULTS = {
"image_format": "png",
"rescale_thumbnail": "width",
"thumbnail_size": 600,
"rescale_image": "height",
"image_size": 1000,
"region": ""
}
AWS_REGIONS = ("us-east-2", "us-east-1", "us-west-1", "us-west-2",
... |
from .verifycode_manager import VerifyCodeManager
|
# -*- coding: utf-8 -*-
"""Jobs Skills ORM"""
from app.app import db
class JobSkill(db.Model):
__tablename__ = 'jobs_skills'
job_uuid = db.Column(db.String, db.ForeignKey('jobs_master.uuid'), primary_key=True)
skill_uuid = db.Column(db.String, db.ForeignKey('skills_master.uuid'), primary_key=True)
... |
from .prepare import *
|
from django.db import models
from django.contrib.auth.models import AbstractUser
class Candies(models.Model):
id_candy = models.IntegerField(unique=True)
type = models.CharField(max_length=50, verbose_name='Type')
description = models.CharField(max_length=11, verbose_name='Description')
price ... |
"""
read by line
"""
def get_path():
raise NotImplementedError
def get_absolute_path():
raise NotImplementedError
def get_canonical_path():
raise NotImplementedError
def get_cwd_path():
raise NotImplementedError
def is_absolute_path():
raise NotImplementedError
|
"""Abstract Syntax Tree handler"""
# These are imported into our module namespace for the benefit of parser.py.
# pylint: disable=unused-import
import itertools
import sys
# pylint: enable=unused-import
import textwrap
from ast import (
AST,
Add,
And,
AnnAssign,
Assert,
Assign,
AsyncFor,
... |
# \file stock.hpp
#
# \brief
#
# \authors Maarten P. Scholl
# \date 2019-03-21
# \copyright Copyright 2017-2019 The Institute for New Economic Thinking, Oxford Martin School, University of Oxford
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... |
import tensorflow as tf
from tensorflow.keras.layers import Flatten
from tensorflow.keras.losses import binary_crossentropy
def dsc(y_true, y_pred):
smooth = 1.
y_true_f = Flatten()(y_true)
y_pred_f = Flatten()(y_pred)
intersection = tf.reduce_sum(y_true_f * y_pred_f)
score = (2. * interse... |
"""Exercício Python 054: Crie um programa que leia o ano de nascimento de sete pessoas. No final,
mostre quantas pessoas ainda não atingiram a maioridade e quantas já são maiores."""
from datetime import date
cont = 0
cont2 = 0
atual = date.today().year
for c in range(1, 8):
ano = int(input('Ano de nascimento da {... |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/10/11 14:31
# @Author : Tao.Xu
# @Email : tao.xu2008@outlook.com
import sys
import json
import superelasticsearch
from superelasticsearch import SuperElasticsearch
from elasticsearch import serializer, exceptions
from tlib import log
from tlib.retry... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.