text stringlengths 2 999k |
|---|
import json
import os
import shlex
import shutil
import subprocess
import tempfile
import time
import GPUtil
from celery.utils.log import get_task_logger
from django.db.models.fields.files import FieldFile
import docker
from girder_utils.files import field_file_to_local_path
import magic
from ..models import Algorith... |
load("//tools/jest:jest.bzl", _jest_test = "jest_test")
load("//tools/go:go.bzl", _test_go_fmt = "test_go_fmt")
load("@io_bazel_rules_go//go:def.bzl", _go_binary = "go_binary", _go_library = "go_library", _go_test = "go_test")
load("@npm//@bazel/typescript:index.bzl", _ts_config = "ts_config", _ts_project = "ts_project... |
# coding: utf-8
# # Object Detection Demo
# Welcome to the object detection inference walkthrough! This notebook will walk you step by step through the process of using a pre-trained model to detect objects in an image. Make sure to follow the [installation instructions](https://github.com/tensorflow/models/blob/mas... |
import copy
import pickle
import random
import logging
import argparse
from typing import Tuple, Dict
from pathlib import Path
import numpy as np
import torch
from mergedeep import Strategy, merge
from typeguard import typechecked
import model as module_arch
import model.metric as module_metric
import utils.visualize... |
import networkx as nx
from networkx import is_strongly_regular
class TestDistanceRegular:
def test_is_distance_regular(self):
assert nx.is_distance_regular(nx.icosahedral_graph())
assert nx.is_distance_regular(nx.petersen_graph())
assert nx.is_distance_regular(nx.cubical_graph())
... |
"""This module can be used for finding similar code"""
import re
import rope.refactor.wildcards
from rope.base import libutils
from rope.base import codeanalyze, exceptions, ast, builtins
from rope.refactor import (patchedast, wildcards)
from rope.refactor.patchedast import MismatchedTokenError
class BadNameInCheck... |
from django.contrib import admin
from django.contrib.auth import admin as auth_admin
from django.contrib.auth import get_user_model
from jamstargram.users.forms import UserChangeForm, UserCreationForm
User = get_user_model()
@admin.register(User)
class UserAdmin(auth_admin.UserAdmin):
form = UserChangeForm
... |
from __future__ import absolute_import
from constants import *
from animation.animation import Animation
from mobject.numbers import DecimalNumber
from utils.bezier import interpolate
from utils.config_ops import digest_config
class ChangingDecimal(Animation):
CONFIG = {
"num_decimal_points": None,
... |
# tests grabbed from:
# https://github.com/tidyverse/dplyr/blob/master/tests/testthat/test-select.r
import pytest
from datar.all import *
from datar.core.exceptions import ColumnNotExistingError
from datar.datasets import mtcars
from datar.stats.verbs import set_names
from pandas.core.frame import DataFrame
from pipda ... |
import unittest
import sys
import os
from os.path import basename
# These Tests check the main functionality of uniqueTokenCount.
#a function that takes two individual files and compares them and returns a list of the cor file's covered tokens (1's and 0's)
def findSeq(cor, tar, length):
corpusFileList = cor
tar... |
from collections import defaultdict
from common.numpy_fast import interp
from opendbc.can.can_define import CANDefine
from opendbc.can.parser import CANParser
from selfdrive.config import Conversions as CV
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.honda.values import CAR, DBC, STEER_THRESHOLD... |
"""RAK811v2 library
Setup file for the project
Copyright 2021 Tim Brennan
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 applic... |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^payment/(?P<order_id>\d+)/$', views.PaymentView.as_view()), # 订单支付
url(r'^payment/status/$', views.PaymentStatusView.as_view()), # 订单支付成功页面
] |
from __future__ import print_function
import os
import subprocess
import time
import socket
import argparse
import random
import uuid
import base64
import hashlib
import urllib
import tornado.web
import tornado.websocket
import tornado.ioloop
import tornado.options
import tornado.httpserver
import tornado.gen
import ... |
import typing
def main() -> typing.NoReturn:
l, r = map(int, input().split())
K = 2019
if r // K * K >= l:
print(0)
return
mn = K - 1
for i in range(l, r):
for j in range(i + 1, r + 1):
mn = min(mn, i * j % K)
print(mn)
main() |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tiler module to create files as Tile Map service
Uses package from https://github.com/vss-devel/tilers-tools
to create tiles images for input tif.
"""
import os
import json
import subprocess
from . import exceptions
from . import contrast_stretch
from . import image_... |
from config import *
printn(guarantee_cost, 'guarantee_cost')
printn('average guarantee')
x = guarantee_cost.groupby('guarantee')['fee'].mean()
printn(x)
printn('guarantees stat')
stat = guarantee_cost.groupby('guarantee')['fee'].aggregate(dict(
fee = [
'min', 'max', 'mean', 'std', 'size',
lambda x: np.percenti... |
# -*- test-case-name: twisted.conch.test.test_helper -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Partial in-memory terminal emulator
@author: Jp Calderone
"""
import re, string
from zope.interface import implements
from twisted.internet import defer, protocol, reactor
... |
#
# Copyright (c) 2021 Seagate Technology LLC and/or its Affiliates
#
# 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 ap... |
import json
import logging
from builtins import str
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.sites.shortcuts import get_current_site
from django.core.cache import cache
from django.core.exceptions import ObjectDoesNotExist
from django.core.exception... |
#!/usr/bin/python3
#coding=utf-8
#author: cody
from ManifestEditor.BaseChunk import BaseChunk
from ManifestEditor.TypedValue import TypedValue
from ManifestEditor.Util import *
class XmlContentChunk(BaseChunk):
START_NAMESPACE = "0x00100100"
END_NAMESPACE = "0x00100101"
START_TAG = "0x00100102"
END_TA... |
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
import stream_pb2 as stream__pb2
class SoccerStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A grpc.Channel.
"""
sel... |
from collections import Counter
lista = [1, 2, 3, 3, 4, 5, 6, 7, 8, 5, 6, 9, 6, 9, 4, 5, 0, 6, 7, 8, 8]
Counter(lista).most_common(3)
|
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from markup.models import *
class InlineProfile(admin.StackedInline):
model = Profile
verbose_name = 'Profile'
verbose_name_plural = 'Profiles'
can_delete = False
class InlineFolders(admin.StackedInline):
model = Al... |
# Generated by Django 2.2.5 on 2019-11-01 10:03
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comment', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='comment',
name='status',
fi... |
class LookUpError(Exception): # Needs to go into a separate errors file
pass
class MissingValueError(Exception):
pass
|
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmseg.models import FPN
def test_fpn():
in_channels = [256, 512, 1024, 2048]
inputs = [
torch.randn(1, c, 56 // 2**i, 56 // 2**i)
for i, c in enumerate(in_channels)
]
fpn = FPN(in_channels, 256, len(in_channels))
o... |
from typing import Callable, List, Tuple
import numpy as np
from random import random
U = lambda : random()
Exp = lambda lmbda: -1.0*np.log(U())/lmbda
class metalog():
def __init__(self,b: int,quantiles: List[Tuple], n_terms: int = 15,bounds:Tuple[float,float] = (-np.inf,np.inf)):
# Properties of a meta-... |
"""
author: @nimrobotics
description: calculates the effective connectivity between regions and plots them
"""
import numpy as np
import scipy.io
import glob
import sys
sys.path.append('../utils')
from plots import plotData
dir = "./process3/" #directory of the data
outdir = 'process3/' #directory to save the plots
r... |
import os
import ijson
import functools
import tensorflow as tf
tf.flags.DEFINE_integer(
"min_word_frequency", 1, "Minimum frequency of words in the vocabulary")
tf.flags.DEFINE_integer("max_sentence_len", 160, "Maximum Sentence Length")
tf.flags.DEFINE_string("train_in", None, "Path to input data file")
tf.fl... |
"""django_todo URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-b... |
from PyInquirer import prompt
import utils.elgamal
from utils.terminal import print_title
import utils.zero_knowledge_proof
import random
from servers import serverA
from servers import serverE
from servers import serverS
from servers import ca
from dotenv import load_dotenv
load_dotenv()
# TODO ameillorer l'UX (clea... |
#!/usr/bin/env python
"""Test function to read corpus"""
from typing import List
import litcorpt
datapath = litcorpt.utils.get_corpus_datapath()
booksdir = datapath / 'litcorpt_data-main/data/'
books: List[litcorpt.model.Book] = []
for bookdir in booksdir.iterdir():
books.append(litcorpt.book_read(bookdir))
... |
"""
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... |
#!/usr/bin/env python3
"""
Copyright (c) 2020, Vitaly Chipounov
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, ... |
import threading
class MultiThreadCounter(object):
def __init__(self):
self.value = 0
self._lock = threading.Lock()
def increment(self):
with self._lock:
self.value += 1
|
"""This is where useful internal functions are stored.
"""
# Python 2/3 compatibility
from __future__ import absolute_import, division, print_function
from collections import Iterable
# Pandas
import pandas as pd
# Numpy
import numpy as np
# Warnings
import warnings
def is_dict_like(value):
return hasattr(value, '__... |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... |
from mongoengine import connect
from config import mongo_config
connect(**mongo_config())
from .models import *
|
import re
from g2p_en import G2p
from functional import pad_batch
class TextProcessor:
# only available for English - output from g2p
phonemes = ["<pad>", "<unk>"] \
+ [
'AA0', 'AA1', 'AA2', 'AE0', 'AE1', 'AE2', 'AH0', 'AH1', 'AH2', 'AO0',
'AO1', 'AO2', '... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import keras
from keras import backend
import tensorflow as tf
from tensorflow.python.platform import app
from tensorflow.python.platform import flags
from cleverhans.u... |
import data_manager
import os
import pandas as pd
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
if __name__ == '__main__':
interval_list = ['day', 'hour12', 'hour6', 'hour']
for interval in interval_list:
print(interval)
df = data_manager.get_price(interval)
pred_file = f'./data/{interval... |
from thread_handler.thread_handler import ThreadHandler
def run_centre(l):
import centre
def run_check_net(l):
import check_net
handle = ThreadHandler()
handle.spawn_thread(run_centre, [None])
handle.spawn_thread(run_check_net, [None]) |
# Copyright 2004-present, Facebook. All Rights Reserved.
from django import forms
from .models.carrier_code_choices import CarrierCode
class FulfillOrderForm(forms.Form):
carrier = forms.ChoiceField(
label="Carrier Code",
choices=CarrierCode.choices, initial=CarrierCode.USPS, required = True,
... |
import csv
import io
import json
import xml.etree.ElementTree as ET
import gzip
from typing import Dict, List, Union, Optional, cast
from datetime import datetime
import requests
# Custom types
Region = Dict[str, Union[str, List[str]]]
RegionList = List[Region]
Row = Dict[str, str]
Data = List[Row]
class Reporter:
... |
primeiro_numero = int(input('Primeiro número inteiro: '))
segundo_numero = int(input('Segundo número inteiro: '))
if primeiro_numero > segundo_numero:
print('O \033[1;31mprimeiro valor\033[m é \033[1;34mMAIOR\033[m')
elif primeiro_numero < segundo_numero:
print('O \033[1;31msegundo valor\033[m é \033[1;34mMAIO... |
# Generated by Django 3.1.8 on 2021-04-28 12:44
from django.db import migrations
import gnosis.eth.django.models
class Migration(migrations.Migration):
dependencies = [
('history', '0037_fix_failed_module_transactions'),
]
operations = [
migrations.AddField(
model_name='saf... |
import os
import time
import fasteners
from conans.util.files import load, save
from conans.util.log import logger
class NoLock(object):
def __enter__(self):
pass
def __exit__(self, exc_type, exc_val, exc_tb): # @UnusedVariable
pass
class SimpleLock(object):
def __init__(self, file... |
import sys
import csv
#from PyPDF2 import PdfFileWriter, PdfFileReader
import tabula
import os
import math
def extract(input, output, pages, area):
print("Reading {} page {} with area {}".format(input, pages, area))
df = tabula.read_pdf(input, pages=pages, stream=True, guess=False, encoding='utf-8', area=area)... |
from gatekeeping.db import get_db
from flask import abort
def get_exchange_rates():
return get_db().execute(
'SELECT * FROM exchange_rate'
).fetchall()
def get_exchange_rate(id):
exchange_rate = get_db().execute(
'SELECT *'
' FROM exchange_rate '
' WHERE id = ?',
... |
"""
Classes and functions that allow creating a PDDL-like
problem and domain definition for planning
"""
from itertools import product
import operator as ops
NUM_OPS = {
'>' : ops.gt,
'<' : ops.lt,
'=' : ops.eq,
'>=': ops.ge,
'<=': ops.le
}
class Domain(object):
def __init__(self, actions=())... |
import json
from rest_framework.renderers import JSONRenderer
from rest_framework.utils.serializer_helpers import ReturnList
class CommentJSONRenderer(JSONRenderer):
charset = 'utf-8'
def render(self, data, media_type=None, renderer_context=None):
try:
data['errors']
except:
... |
'''
Reference: https://github.com/adsodemelk/PRST
'''
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import copy
__all__ = ["rldecode", "rlencode", "units", "mcolon", "recursive_diff", "gridtools"]
import plot.velocity_src.gridtools
import numpy as np
import scipy.sparse
from scipy.sparse im... |
ITERABLE_API_BASE_URL = 'https://api.iterable.com/api'
ITERABLE_API_RESOURCES = {
##
# email
'email_target' : '/email/target',
##
# events
'event_track' : '/events/track',
##
# users
'update_email' : '/users/updateEmail',
'user_delete' : '/users/%(email)s',
##
# workflow... |
#!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test node handling
#
from test_framework.test_framework import FatbitTestFramework
from test_framewo... |
#!/usr/bin/env python3
# vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python camera library for the Rasperry-Pi camera module
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following con... |
"""
This file offers the methods to automatically retrieve the graph Agrobacterium arsenijevicii.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--pr... |
#
# ------------------------------------------------------------
# Copyright (c) All rights reserved
# SiLab, Institute of Physics, University of Bonn
# ------------------------------------------------------------
#
import unittest
import os
from basil.dut import Dut
from basil.utils.sim.utils import cocotb_compile_a... |
# Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
from jinja2 import Environment
from .sendmessage import *
from .splunkutils import *
from .timeutils import *
import ... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from functools import lru_cache
from time import time
from typing import Tuple
import nevergrad as ng
from llvm_autotuning.optimization_target... |
import pytest
import itertools
import os
from datetime import datetime
from yahooquery import Ticker
TICKERS = [
Ticker('aapl', username=os.getenv('YFF_USERNAME'),
password=os.getenv('YFF_PASSWORD')),
Ticker('aapl ^GSPC btcusd=x brk-b logo.is l&tfh.ns', asynchronous=True),
Ticker(['aapl', 'aaa... |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load(
"@io_bazel_rules_scala//scala:scala_cross_version.bzl",
_default_maven_server_urls = "default_maven_server_urls",
)
load("//third_party/repositories:repositories.bzl", "repositories")
def rules_scala_setup():
if not native.existing_... |
from rest_framework import status
from rest_framework.exceptions import (APIException, PermissionDenied,
ValidationError)
class FileParseException(APIException):
status_code = status.HTTP_400_BAD_REQUEST
default_detail = 'Invalid file format, line {}: {}'
default_cod... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0001_squashed_0016_change_page_url_path_to_text_field'),
('people', '0001_initial'),
]
operations = [
... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AppRenameTableConfig(AppConfig):
name = "tests.test_project.app_rename_table"
|
from .Adafruit_BME280 import BME280
from ._spidev import Device |
produtos = ('Monitor RazerX75', 1200,
'Mouse RGB', 150,
'Teclado Monster RGB', 320,
'Caixa de Som', 50.99,
'IphoneX', 2500,
'Carregador', 20.90,
'CPU-LAD', 450.99,
'LAD-Xt80 1m', 15.50,
'X-box360', 950.99,
'Playstaion 4'... |
""" Example for using TVM generated function """
import sys
sys.path.append('../') # Add MobulaOP path
import mobula
import tvm
import topi
from tvm.contrib.mxnet import to_mxnet_func
from tvm.contrib.dlpack import to_pytorch_func
def get_tvm_add():
# define compute
n = tvm.var('n')
A = tvm.placeholder(... |
# Copyright 2016 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... |
import sys
from datatypes import EmitDefinition, EmitTypeDeclaration
import content
import network
def create_enum_table(names, num):
lines = []
lines += ["enum", "{"]
lines += ["\t%s=0,"%names[0]]
for name in names[1:]:
lines += ["\t%s,"%name]
lines += ["\t%s" % num, "};"]
return lines
def create_flags_table... |
"""Classes for the components of the model, including the generator, the
discriminator and the refiner.
"""
from collections import OrderedDict
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from musegan.utils.neuralnet import NeuralNet
class Component(object):
"""Base class for components."""
def ... |
# Copyright (c) 2016, Ethan White
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and... |
"""followers
Revision ID: 67a6906a0356
Revises: ae03466d7ace
Create Date: 2021-10-31 21:38:21.299029
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '67a6906a0356'
down_revision = 'ae03466d7ace'
branch_labels = None
depends_on = None
def upgrade():
# ### ... |
"""This module implements an abstract base class (ABC) 'BaseDataset' for datasets.
It also includes common transformation functions (e.g., get_transform, __scale_width), which can be later used in subclasses.
"""
import random
import numpy as np
import torch.utils.data as data
import torch
from PIL import Image
import... |
#
# Copyright (c) 2008-2015 Citrix Systems, 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 l... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-10-19 09:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('blog', '0004_comment_post'),
]
operations = [
... |
from base64 import b64decode, b64encode
from flask import request as req, json
from pymongo import MongoClient, ReturnDocument
from flask_jwt_extended import (
JWTManager,
jwt_required,
create_access_token,
get_raw_jwt,
)
from datetime import timedelta
from logzero import logger # console logger
from ... |
# implements a factory to create codec instances for a given java charset
import codecs
from array import array
from functools import partial
from java.lang import StringBuilder
from java.nio import ByteBuffer, CharBuffer
from java.nio.charset import Charset, IllegalCharsetNameException
from StringIO import StringIO
... |
from tensorflow.python.framework.test_util import TensorFlowTestCase
from tensorflow.keras.models import Sequential
import tensorflow.keras.layers as layers
import os
import unittest
from common import common_test_basis
class DepthwiseConv2dTests(TensorFlowTestCase):
@staticmethod
def testSmallNative():
... |
import torch
from torch.distributions import Categorical, Normal
from torch.distributions import kl_divergence as kl
from ._base import DecoderSCVI, Encoder
from .classifier import Classifier
from .utils import broadcast_labels
from .vae import VAE
class VAEC(VAE):
r"""
A semi-supervised Variational auto-enc... |
# coding: utf-8
from sqlalchemy import Column, Date, Float, ForeignKey, Index, Integer, SmallInteger, String, Table, Text, Time, text
from sqlalchemy.sql.sqltypes import NullType
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
metadata = Base.m... |
#!/usr/bin/python3
import sqlite3
import sys
if len(sys.argv) > 1:
dbname = sys.argv[1];
db = sqlite3.connect( dbname )
cur = db.cursor();
for row in cur.execute( 'SELECT network,password FROM networks ORDER BY network;'):
print( 'network={')
print( f' ssid="{row[0]}"' )
prin... |
#!/usr/bin/env python
import numpy as np
from nav_msgs.msg import OccupancyGrid
from scipy.optimize import differential_evolution
from skimage.measure import ransac
from skimage.transform import AffineTransform, SimilarityTransform
from sklearn.neighbors import NearestNeighbors
import cv2
def send_map_ros_msg(landmar... |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("One FM Purchasing"),
"icon": "fa fa-star",
"items": [
{
"type": "doctype",
"name": "Request for Material",
"onboard": 1,
},
{
"type": "doctype",
"name": "Request for Purc... |
from django.db import models
class OsebaManager(models.Manager):
def create_oseba(self, priimek=None, ime=None, status=None, kvalifikacije=None, podjetje=None):
if not podjetje:
raise ValueError("Izbrati moraš podjetje")
oseba = self.model(
priimek=priimek,
ime=... |
# -*- coding: utf-8 -*-
"""
======================================================================================================
杭州HUB仿真项目
项目启动日期:2017年7月6日
项目启动标识:AIRPORT OF EZHOU'S PROJECT ... |
"""
This file contains helper functions for building the model and for loading model parameters.
These helper functions are built to mirror those in the official TensorFlow implementation.
"""
import re
import math
import collections
from functools import partial
import torch
from torch import nn
from torch.nn import ... |
import datasets
import os
_CITATION = """\
"""
_DESCRIPTION = """\
"""
_HOMEPAGE = ""
_LICENSE = "[More Information needed]"
_URL = "https://raw.githubusercontent.com/cardiffnlp/xlm-t/main/data/sentiment/english/"
class UMSABConfig(datasets.BuilderConfig):
def __init__(self,
... |
# coding:utf8
from fastweb.accesspoint import ioloop
from fastweb.component.rpc.tft import AsynTftRpc, SyncTftRpc
sync_setting = {'host': 'localhost', 'port': 7777, 'thrift_module': 'fastweb.test.fastweb_thrift_sync.HelloService.HelloService'}
asyn_setting = {'host': 'localhost', 'port': 7777, 'thrift_module': 'fastw... |
import os
import unittest
from . import fake
from watcher.watcher import OpenStackWatcherMiddleware
WORKDIR = os.path.dirname(os.path.realpath(__file__))
NOVA_CONFIG_PATH = WORKDIR + '/fixtures/nova-complex.yaml'
class TestNova(unittest.TestCase):
is_setup = False
def setUp(self):
if self.is_setup:... |
"""
zsumuj ciąg arytmetyczny o różnicy -5 i a1=0 dla n wyrazow
"""
def f(n):
an = 0 + (n-1)*-5
return ((0 + an)/2)*n
print(f(2))
|
from __future__ import absolute_import
import curses.ascii
from datetime import (
datetime,
timedelta,
)
from decimal import Decimal
import os
import struct
from unittest import TestCase
from weatherlink.models import (
convert_datetime_to_timestamp,
convert_timestamp_to_datetime,
BarometricTrend,
LoopRecord,
... |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# 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 ... |
class Solution:
# @param {integer} k
# @param {integer} n
# @return {integer[][]}
def combinationSum3(self, k, n):
return [arr for arr in ([j+1 for j in xrange(10) if i & (1 << j)]
for i in xrange(1, 512) if bin(i).count('1') == k)
if sum(arr) == ... |
# -*- coding: utf-8 -*-
"""
install mythril and deploy source-dist and wheel to pypi.python.org
deps (requires up2date version):
*) pip install --upgrade pip wheel setuptools twine
publish to pypi w/o having to convert Readme.md to RST:
1) #> python setup.py sdist bdist_wheel
2) #> twine upload dist/* #<... |
import base64
import fnmatch
import hashlib
import json
import os
import shutil
import stat
import sys
import tempfile
import zipfile
query = json.load(sys.stdin)
empty_dirs = json.loads(query["search"])
search = json.loads(query["search"])
source_dir = query["source_dir"]
output_path = query["output_path"]
source_fi... |
"""
Created by adam on 6/27/18
"""
__author__ = 'adam'
make_hashtags_table = """
CREATE TABLE hashtags (
tagID INTEGER PRIMARY KEY AUTOINCREMENT,
hashtag TEXT unique)
"""
make_tweets_table = """
CREATE TABLE `tweets` (
`tweetID` INTEGER PRIMARY KEY,
`userID` TEXT,
... |
"""
LOAD DATA from file.
"""
# pylint: disable=C0301,E1101,W0622,C0103,R0902,R0915
##
import os
import torch
import numpy as np
import torchvision.datasets as datasets
from torchvision.datasets import MNIST
from torchvision.datasets import CIFAR10
from torchvision.datasets import ImageFolder
import torchvision.transf... |
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import itertools
import re
from copy import copy
from powerline.lib.unicode import unicode
from powerline.lint.markedjson.error import echoerr, DelayedEchoErr, NON_PRINTABLE_STR
from powerline.lint.self... |
existing_text = 'There is existing text in this file.'
known_good_ascii = """My Checklist
A. First section
* A.1 A1sum: First A line
* A.2 A2sum: Second A line
B. Second section
* B.1 B1sum: First B line
* B.2 B2sum: Second B line
Data Science Ethics Checklist generated with deon (http://deon.drivendata.org)."""
k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.