content stringlengths 5 1.05M |
|---|
# -*- coding: utf-8 -*-
"""Test ApiGW"""
from ddd_api_gateway.api import Api
def test_create_api():
api_test = Api("name", "path", "specs")
assert api_test.name is "name"
assert api_test.path is "path"
assert api_test.specs is "specs"
assert api_test.id is not None
def test_api_clone():
api... |
from __future__ import annotations
from textwrap import dedent
from typing import TYPE_CHECKING
import geopandas as gpd
import pandas as pd
from pandas.util._decorators import doc
from dtoolkit.geoaccessor.geoseries import count_coordinates as s_count_coordinates
from dtoolkit.geoaccessor.geoseries import geobuffer ... |
"""Contains a parallel runner implementation, with support
for various backends
"""
from microscopes.common import validator
from microscopes.common.rng import rng
import warnings
import logging
import time
import tempfile
import pickle
import hashlib
import multiprocessing as mp
_logger = logging.getLogger(__name__... |
# python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... |
import numpy as np
def X(theta):
'''X-rotation'''
return np.array([[np.cos(theta/2),-1j*np.sin(theta/2)],[-1j*np.sin(theta/2),np.cos(theta/2)]])
def Y(theta):
'''Y-rotation'''
return np.array([[np.cos(theta/2),-np.sin(theta/2)],[np.sin(theta/2),np.cos(theta/2)]])
def angles_of_3_Euler_pulses(U):
'... |
#!/usr/bin/env python
#============================================================================
# Copyright (C) Microsoft Corporation, All rights reserved.
#============================================================================
import os
import sys
import subprocess
import imp
import re
# class MSFT_nxOMSKe... |
#!/usr/bin/env python
import os
import sys
import string
data = input('Enter the string to test it: ')
words = data.split()
for word in words:
for chars in word:
print([chars])
print(data.find('e'))
print(word.find('e'))
print(data[3]) ## Buffer
## Need to optimised & m... |
from nflsite import app
from waitress import serve
if __name__ == '__main__':
#app.run(host='localhost', port=80, debug=True)
serve(app, host='0.0.0.0', port=8080, url_scheme='http', threads=20) |
#!/usr/bin/env python3
import re
import csv
import urllib.request
import urllib.parse
import http.cookiejar
from lxml.html import fragment_fromstring
from collections import OrderedDict
from decimal import Decimal
from datetime import date
def scrap_page(*args, **kwargs):
url = 'http://www.fundamentus.com.br/res... |
""" This file defines easy to use class that filter USOS database to your own liking """
import re
import requests
import datetime
from datetime import time
import logging
from bs4 import BeautifulSoup
from rich import print
logging.basicConfig(filename='exceptions.log')
"""
This class filters groups from USOS data... |
N_K = input().split()
K = int(N_K[0])
N = int(N_K[1])
rankings = []
for x in range(K):
input_line = input().split()
# for y in range(0, len(input_line)):
# input_line[y] = int(input_line[y])
rankings.append(input_line)
consistent_pairs = 0
for first_cow in range(0, N-1): #cow number
... |
# coding: utf-8
"""
Marketing API v.1.0
IMPORTANT: This swagger links to Criteo production environment. Any test applied here will thus impact real campaigns. # noqa: E501
The version of the OpenAPI document: v.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F... |
from scripts.deploy import update_front_end
def main():
update_front_end()
if __name__ == "__main__":
main()
|
'''
WX 4 Phoenix application
'''
from .basic import * |
import numpy as np
from viz.viz_utils import draw_lidar_simple, draw_gt_boxes3d
from wavedata.tools.obj_detection.obj_utils import compute_box_corners_3d
def draw_lidar_and_boxes(lidar, gt_boxes, calib, fig, color=(1,1,1)):
lidar_draw = lidar.T
fig = draw_lidar_simple(lidar_draw, fig=fig)
length = len(gt_b... |
# Main imports.
from .problem import Problem
from .problem_factory import ProblemFactory
# Imports from the different domains.
# image_text_to_class
from .image_text_to_class.clevr import CLEVR
from .image_text_to_class.image_text_to_class_problem import ObjectRepresentation, ImageTextToClassProblem
from .image_text_t... |
import pandas as pd
from pathlib import Path
path = Path('../data-truth/COVID-19/deconvoluted/')
files = [f.name for f in path.glob('**/*')]
dfs = []
for f in files:
temp = pd.read_csv(path/f)
temp = temp.groupby(['location', 'age_group'], as_index = False).value.sum()
temp ['date'] = pd.to_datetime(f[:10... |
# -*- coding: utf-8 -*-
import numpy as np
def travelling_fire(
fire_load_density_MJm2,
heat_release_rate_density_MWm2,
length_compartment_m,
width_compartment_m,
fire_spread_rate_ms,
height_fuel_to_element_m,
length_element_to_fire_origin_m,
time_start_s... |
#########################################################################
#
# global variables
#
# import config as cfg in all related modules, and use a global variable
# x defined here in the other modules as cfg.x
# Arthur Fangzhou Jiang 2017 Hebrew University
# Sheridan Beckwith Green 2020 Yale University
# Arthur... |
# %% [804. Unique Morse Code Words](https://leetcode.com/problems/unique-morse-code-words/)
# 問題:wordsの各単語からモールス信号を作成し、その種類数を返せ
# 解法:ordを用いる
class Solution:
def uniqueMorseRepresentations(self, words: List[str]) -> int:
mc = (
".- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- "
"... |
import pathlib
from typing import List, Union
from pydantic import AnyHttpUrl, BaseSettings, Field, validator
BASE_DIR = pathlib.Path(__file__).absolute().parent.parent
class APISettings(BaseSettings):
CORS_ORIGINS: Union[str, List[AnyHttpUrl]] = Field(
["http://localhost:3000"], env="CORS_ORIGINS"
... |
from matplotlib import pyplot as plt
from matplotlib import style
from pykka import ThreadingActor
PRICE_RANGE = 0.3
class GraphingActor(ThreadingActor):
subplots = None
graphs = {}
def __int__(self, *args, **kwargs):
super(GraphingActor, self).__init__()
self.init_graph()
def init_... |
from app import app
from app import views
# execution for whole project
app.run(debug=True)
|
import pytest
from depccg.cat import Category
from depccg.grammar import ja
observed_binary_rules = [
tuple(Category.parse(category) for category in text.strip().split(' '))
for text in open('tests/grammar/rules.ja.txt')
]
@pytest.mark.parametrize("expect, x, y", observed_binary_rules)
def test_binary_rule(... |
from .user_management import (
UserLoginSerializer,
UserModelSerializer,
UserSignupSerializer,
UserVerifySerializer
)
from .profiles import ProfileModelSerializer
|
from . import sampling
from . import graph_store
from .dis_kvstore import KVClient, KVServer
from .dis_kvstore import read_ip_config
|
def distribute_tasks(tasks, rank, size, residue_in_last=True):
num_tasks = len(tasks)
num_tasks_per_job = num_tasks//size
tasks_ids = list(range(rank*num_tasks_per_job,(rank+1)*num_tasks_per_job))
if residue_in_last:
if rank == size - 1:
task_ids += list(range(size*num_tasks_per_job,... |
import sys
assert sys.version_info[0] == 3, "LyricsGenius requires Python 3"
from versescraper.verse_scraper import VerseScraper
"""A library that allows for individual song verses to be fetched for artists."""
__author__ = "Robert Firstman"
__license__ = "MIT" |
# -*- coding: utf-8 -*-
from apps.accounts.models.pending_action import PendingAction
from django.contrib import admin
@admin.register(PendingAction)
class PendingActiondmin(admin.ModelAdmin):
"""Defines the pending action admin behaviour."""
list_display = (
'token',
'user',
'categ... |
"""
tests.scripts.test_yml
~~~~~~~~~~~~~~~~~~~~~~
Tests for .yml scripts manipulation
:copyright: Copyright 2017 by Nicolas Maurice, see AUTHORS.rst for more details.
:license: BSD, see :ref:`license` for more details.
"""
import os
from create_python_project.scripts import YmlScript
def test_y... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
def create_cmdexecutor(cmdlist):
def func(cmd):
logging.debug('Executing ... %s' % cmd)
cmdlist.append(cmd)
return 0
return func
# EOF
|
from pyravendb.raven_operations.counters_operations import *
from typing import List, Optional
class _CommandData(object):
def __init__(self, key, command_type, change_vector=None, metadata=None):
self.key = key
self._type = command_type
self.metadata = metadata
self.change_vector ... |
import re
from datetime import datetime
from typing import Optional
import flask
import pytz
from voluptuous import Invalid
from core import APIException
from core.users.models import Invite, User
app = flask.current_app
USERNAME_REGEX = r'^[A-Za-z0-9][A-Za-z0-9_\-\.]*$'
PASSWORD_REGEX = r'^(?=.*[A-Za-z])(?=.*\d)(?... |
import random
import numpy.random
import sys
from amuse.test import amusetest
from amuse.units import units
from amuse.units import constants
from amuse.units import nbody_system
from amuse.support.interface import ConvertArgumentsException
from amuse.ic.plummer import new_plummer_sphere
from amuse.ic.salpeter import... |
#!/usr/bin/python3
from sklearn.datasets import load_iris
from sklearn import tree
import numpy as np
x=[0,50,100]
# loading iris datasets
iris=load_iris()
#features and labels collection or training data collection
# features
train_data=np.delete(iris.data,x,axis=0)
#labeles
train_target=np.delete(iris.target,x)
# t... |
from transfermarkt import *
for league in tier1 + otherEurope:
file = "data/tables/"+league+".csv"
if os.path.isfile(file):
print str(datetime.datetime.now()), "skipping", league
else:
print str(datetime.datetime.now()), "processing", league
try:
result=pd.concat([getTab... |
'''
Created on Jun 22, 2012
@author: Alex Ip (alex.ip@ga.gov.au)
'''
import re, os, logging
from . import Metadata
logger = logging.getLogger('root.' + __name__)
class ReportMetadata(Metadata):
"""Subclass of Metadata to manage Report data
"""
# Class variable holding metadata type string
_metadata_... |
import sys, os; sys.path.insert(0, os.path.abspath('..'))
# Read the Docs needs this bit to import Hyrule.
html_title = 'The Hyrule manual'
extensions = [
'sphinx.ext.napoleon',
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinxcontrib.hydomain']
exclude_patterns = ['_build']
smartquotes = Fa... |
# Copyright (C) Fabio Ciani, 2021
# Written by Fabio Ciani <fabio1.ciani@mail.polimi.it>, October-November 2021
# Thanks to Ben Dodson <https://github.com/bendodson> and u/severedxties <https://www.reddit.com/user/severedxties/> for the research on the artwork URLs' structure and their open-source projects.
# Shou... |
#(c)www.stani.be (read __doc__ for more information)
__version__ = """v1.1 (20/6/2005)"""
__author__ = "www.stani.be"
__license__ = "GPL"
__url__ = "http://www.stani.be/python/sdxf"
__doc__ = \
"""SDXF - Stani's DXF
Python library to generate dxf drawings
Copyright %s
Version %s
L... |
# Copyright (c) 2013, Ashish and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
def execute(filters=None):
columns, data = get_columns(), get_data(filters)
return columns, data
def get_data(filters):
data = []
query_data = frappe.db.sql("""S... |
import pytest
from rig.bitfield import BitField
from nengo_spinnaker.utils import keyspaces
def test_get_derived_keyspaces():
"""Test creation of derived keyspaces."""
ks = BitField()
ks.add_field("index")
ks.add_field("spam")
# General usage
kss = keyspaces.get_derived_keyspaces(ks, (slice(5... |
# flake8: noqa
# wrap each of these in try blocks, because I want tools to work with just
# plain python
try:
from pandashells.lib.outlier_lib import sigma_edit_dataframe
except ImportError: # pragma no cover
pass
try:
from pandashells.lib.lomb_scargle_lib import lomb_scargle
except ImportError: # pragm... |
"""
widgetselecter Module
this contains the class which allows the ViewConfig to select the appropriate widget for the given field
Classes:
Name Description
MingWidgetSelecter Aid for the selection of a widget to correspond to a Ming Document field
Exceptions:
None
Funct... |
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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... |
# Generated by Django 3.1.7 on 2021-05-06 08:23
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('gyoithon', '0006_auto_20210506_1422'),
]
operations = [
migrations.AddField(
... |
import socket
from multiprocessing import Process
import time
import os
class xsdb_tcl_server:
def __init__(self):
self.HOST = "localhost"
self.PORT = 8953
self.socket = None
self.xsdb = Process(target=self.xsdb_start)
self.xsdb.start()
time.sleep(1)
self.ope... |
from os import listdir, makedirs
from os.path import isdir, join
from tornado.web import authenticated
from base import BaseHandler
class NotebookHandler(BaseHandler):
@authenticated
def get(self, notebook_name):
notebook_name = self._encode_notename(notebook_name)
if not isdir(join(self.set... |
from oletools.olevba import VBA_Parser, TYPE_OLE, TYPE_OpenXML, TYPE_Word2003_XML, TYPE_MHTML
class Macros(object):
def detect(self, filename):
return_list = []
vbaparser = VBA_Parser(filename)
if vbaparser.detect_vba_macros():
for (filename, stream_path, vba_filename, vba_code... |
from rest_framework import serializers
from drf_sideloading.serializers import SideLoadableSerializer
from tests.models import Supplier, Category, Product, Partner
class SupplierSerializer(serializers.ModelSerializer):
class Meta:
model = Supplier
fields = ["name"]
class PartnerSerializer(seria... |
from sitemapgen import cli
cli.run() |
#!/usr/bin/env python
#
# Pure python p7zr implementation
# Copyright (C) 2019-2021 Hiroshi Miura
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 ... |
from abc import (
ABC,
abstractmethod,
)
from collections import (
UserDict,
)
from typing import (
Type,
TYPE_CHECKING,
)
from eth_keys.datatypes import (
PrivateKey,
PublicKey,
NonRecoverableSignature,
)
from eth_keys.exceptions import (
BadSignature,
)
from eth_utils import (
... |
# Generated by Django 3.0.8 on 2020-08-29 19:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('donations', '0005_auto_20200821_1151'),
]
operations = [
migrations.AlterField(
model_name='donationform',
name='fix... |
from keras.callbacks import EarlyStopping, ModelCheckpoint, TensorBoard, LearningRateScheduler
from keras.layers import Reshape, Dense, Convolution1D, Dropout, Input, Activation, Flatten,MaxPool1D,add, AveragePooling1D, Bidirectional,GRU,LSTM,Multiply, MaxPooling1D,TimeDistributed,AvgPool1D
from keras.layers.merge impo... |
def solve(n):
oddnums = []
i = 1
while len(oddnums) != n:
oddnums.append(i)
i += 2
return sum(oddnums)
|
import json
import logging
import argparse
import numpy as np
import logging.config
import emission.pipeline.scheduler as eps
if __name__ == '__main__':
try:
intake_log_config = json.load(open("conf/log/intake.conf", "r"))
except:
intake_log_config = json.load(open("conf/log/intake.conf.sample... |
import random
import numpy as np
from copy import deepcopy
from contextlib import contextmanager
class RandomShuffler(object):
"""Use random functions while keeping track of the random state to make it
reproducible and deterministic."""
def __init__(self, seed=1):
random.seed(seed)
def __call_... |
from __future__ import annotations
import functools
import json
import os
from poetry.core.spdx.license import License
def license_by_id(identifier: str) -> License:
if not identifier:
raise ValueError("A license identifier is required")
licenses = _load_licenses()
return licenses.get(
... |
import os
from interface import Interface
from scapy.all import *
class DNSSpoof:
def __init__(self, interface, domain_file):
self.service = 'dnsmasq'
self.active = False
self.interface = Interface(interface, True)
self.interface.enable_sniff()
self.domain_file = domain_file
self.domains = list()
self.... |
# Copyright (c) 2022 RWTH Aachen - Werkzeugmaschinenlabor (WZL)
# Contact: Simon Cramer, s.cramer@wzl-mq.rwth-aachen.de
from absl import logging,flags,app
from feature_scaling import inverse_scale,scale
from s3_smart_open.filehandler import get_filenames, read_pckl, to_pckl, to_pd_fth, read_pd_fth
import os
FLAGS = f... |
import ctypes
import json
import sys
import threading
import time
from threading import Thread
from time import sleep
class ForceCloseableThread(threading.Thread):
def __init__(self, func, *args):
threading.Thread.__init__(self)
self.func = func
self.args = args
self._thread_id ... |
"""Implementation of some of the ITU-R P.2040 formulas
ITU-R Recommendation P.2040-1 (07/2015) Effects of Building Materials and
Structures on Radiowave Propagation Above About 100 MHz contains a lot of
data and formulas on EM properties of materials, building entry loss, and
EM propagation within hallways.
Currently... |
import os
import sys
import multiprocessing
import random
import copy
import numpy as np
from tempfile import NamedTemporaryFile
from deap import base, creator, tools
from utils.functions import format_coords, summary
from modules.fitness import calc_satisfaction
from modules.geometry import Geometry
import logging
ga... |
"""
Routing Genie Ops Object Outputs for IOSXR.
"""
class RoutingOutput(object):
""" show route ops output """
showRouteIpv4 ={
"vrf": {
"default": {
"address_family": {
"ipv4": {
"routes": {
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ========================================================
# Module : logger
# Author : Null
# Create Date : 11/11/2018
# Amended by : Null
# Amend History : 11/11/2018
# ========================================================
import os
import... |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
fro... |
from app import db, ma
import datetime
# Test class/model
class Test(db.Model):
test_id = db.Column(db.Integer, primary_key=True, autoincrement=True)
name = db.Column(db.String(50), nullable=False)
description = db.Column(db.String(100), nullable=False)
teacher = db.Column(db.String(50), nullable=False... |
#NumberTh functions with SymPy package
#-------------------------------------
from sympy import ntheory
from sympy import sieve
from sympy import generate
sieve._reset() # An infinite list of prime numbers, implemented as a dynamically growing sieve of Eratosthenes.#When a lookup is
# requested involving an ... |
import requests
from bs4 import BeautifulSoup
from limited_dict import LimitedDict
class SteamSalesObserver:
__slots__ = {"session", "old_sales"}
url = "https://steamdb.info/sales/"
headers = {
"authrity": "steamdb.info",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebK... |
import torch
import torch.distributions as dist
class Normal(dist.Normal):
def __init__(self, loc, scale):
if scale > 20.:
self.optim_scale = scale.clone().detach().float().requires_grad_()
else:
self.optim_scale = torch.log(torch.exp(scale.float()) - 1).clone().detach()... |
import numpy as np
from gym.spaces import Box
from metaworld.envs import reward_utils
from metaworld.envs.asset_path_utils import full_v2_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerHammerEnvV2(SawyerXYZEnv):
HAMMER_HANDLE_LENGTH = 0.14
... |
from numbers import Number
import numpy as np
import random
class Quaternion(object):
""" Hamiltonian quaternion denoted as q = [x y z w].T.
Can be instantiated by:
>>> q = Quaternion(x, y, z, w)
>>> q = Quaternion(q=[x, y, z, w])
>>> q = Quaternion(q=np.array([x, y, z, w]))
"""
q = np.array([0.0, 0.0... |
import time
import sys
import shutil
import os
if (sys.version_info >= (2,7)):
import unittest
else:
import unittest2 as unittest
from resource_suite import ResourceBase
from pydevtest_common import assertiCmd, assertiCmdFail, interruptiCmd, getiCmdOutput, get_irods_top_level_dir, get_irods_config_dir
import py... |
import psycopg2
import json
import re
try:
connection = psycopg2.connect(user="postgres",
password="postgres",
host="localhost",
port="5432",
database="kaster")
cursor = conne... |
class Dreptunghi:
def __init__(self, x, y, w, h):
self.x = x
self.y = y
self.w = w
self.h = h
def gen_puncte(self, margine):
for x in range(self.x + margine, self.x + self.w - margine):
for y in range(self.y + margine, self.y + self.h - margine):
... |
import unittest
import torch
import torch.nn as nn
import sys
sys.path.append('../')
from FrEIA.modules import *
from FrEIA.framework import *
batch_size = 5
n_components = 4
n_dims = 12
x_size = (n_dims,)
w_size = (n_components,)
mu_size = (n_components, n_dims)
U_size = (n_components, n_dims * (n_dims + 1) // 2)... |
mapa= [
["X" , "I" , "X" , "X" , "X" , "X" , "X"],
["X" , " " , "X" , "X" , "T1" , " " , "X"],
["X" , " " , "T2" , "X" , " " , " " , "X"],
["X" , " " , " " , "X" , "B" , " " , "X"],
["X" , " " , " " , "X" , "T2" , " " , "X"],
["X" , "T1" , "B" , "X" , "X" , " " , "X"],
["X" , "X" , "X" , "X"... |
# coding=utf-8
import sys
import time
import pyExcelerator
from docx import Document
from modules.share_module.get_path import *
reload(sys)
sys.setdefaultencoding("utf-8")
class ExportExcel(object):
def __int__(self, sheetname, head_title_list, field_name_list, data_obj_list, filename):
"""在指定的位置上生成一个excel 文件,... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import sys
filename = sys.argv[1]
array = np.genfromtxt(filename, delimiter=' ', autostrip=True)
# print(len(array))
if array.ndim == 1:
plt.plot(array)
else:
map = seaborn.heatmap(array)
#plt.colorbar()
plt.show()
|
# Enter your Reddit bot details
username = ""
password = ""
client_id = ""
client_secret = ""
|
from PIL import Image
import numpy as np
from typing import final
import os
LVL_10_GS: final = "@%#*+=-:. "
LVL_70_GS: final = """$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,"^`'. """
def average_pooling(img: np.array, factor: tuple) -> np.array:
"""
Averages a pool in a matrix based on a... |
from gemd.util.impl import recursive_flatmap
from gemd.entity.object import (
ProcessSpec,
ProcessRun,
MaterialSpec,
MeasurementSpec,
MeasurementRun,
)
from citrine.resources.data_concepts import DataConcepts
from gemd.entity.value.base_value import BaseValue
from typing import Mapping, List
from ge... |
from torch.optim import (
SGD, Adam
)
|
# -*- coding: utf-8 -*-
from tools import RomReader
from tools import BytesReader
__all__ = ['RomReader', 'BytesReader']
|
def save_list(input_list, file_name='temp.txt'):
"""A list (input_list) is saved to a file (file_name)"""
with open(file_name, 'w') as fh:
print(*input_list, sep='\n', file=fh)
return None
|
#!/usr/bin/env python
# ___INFO__MARK_BEGIN__
#######################################################################################
# Copyright 2008-2021 Univa Corporation (acquired and owned by Altair Engineering Inc.)
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file exce... |
from .interop import Interop
__all__ = ['Interop']
|
#bilmemkacv2/OPP(object-oriented-programing)
class Account:
def init (self,isim,numara,bakiye):
self.isim = isim
self.numara = numara
self.bakiye = bakiye
def hesapBilgileri(self):
print('İsim: ',self.isim)
print('Numara: ',self.numara)
print('Bakiye: ',self.bakiy... |
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... |
import os
from argparse import ArgumentParser
from dodo_commands import CommandError, ConfigArg, Dodo
def _args():
parser = ArgumentParser(description="Run typescript compiler")
parser.add_argument("src_dir_name")
parser.add_argument("--watch", action="store_true")
# Parse the arguments.
args = ... |
'''
Created on Mar 9, 2012
@author: chris
'''
import json
from google.appengine.ext.webapp import template
import webapp2
import logging
import os
#==============================================================================
class BaseHandler(webapp2.RequestHandler):
#-------------------------------------... |
""""""
# Standard library modules.
import unittest
import logging
import os
# Third party modules.
# Local modules.
from fsaecostreport.reader import SystemFileReader, MetadataReader
import fsaecostreport.graph as graph
# Globals and constants variables.
class Test(unittest.TestCase):
def setUp(self):
... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from .layout import representation_type
lltype = representation_type
from .annotations import annotate
from .overloading import overload, overloadable
from .callingconv import is_flypy_cc |
import os
import torch
from torch import nn
__all__ = ["ResNet", 'resnet18', 'resnet34', 'resnet50', 'resnet101', 'resnet152']
norm_layer = nn.BatchNorm2d
model_urls = {
"resnet50": "https://hangzh.s3.amazonaws.com/encoding/models/resnet50-25c4b509.zip",
"resnet101": "https://hangzh.s3.amazonaws.com/encodin... |
# from . import libs
# __all__ = [MyModule1, MyModule2, MyModule3] |
#!/usr/bin/env python3
from distutils.core import setup
setup(
name="parlex",
version="0.2",
description="Parlex Data Extraction Tools",
author="Paul Philion",
author_email="philion@acmerocket.com",
url="https://github.com/acmerocket/parlex/",
packages=["parlex"],
)
|
import unittest
from zebra_puzzle import solution
class ZebraPuzzleTest(unittest.TestCase):
def test_solution(self):
self.assertEqual(solution(),
("It is the Norwegian who drinks the water.\n"
"The Japanese keeps the zebra."))
if __name__ == '__main__'... |
from novaclient.client import Client as NovaClient
from connections.connection import Connection
class NovaConnection(Connection):
"""
NeutronConnection module that contain a NovaClient connection
"""
def __init__(self, **kwargs):
"""
:param kwargs: *version = version of NovaClient
... |
"""
Common data, functions and classes shared between at least two
modules.
"""
__author__ = 'prussell'
##### STDLIB
from random import randint
##### 3RD PARTY
##### PROJECT
##### INIT AND DECLARATIONS
##### CLASSES AND FUNCTIONS
def swap(array, i, j):
# x = x ^ y, y = y ^ x, x = x ^ y doesn't work for poi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.