text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# Copyright (c) 2020 - 2022 Ricardo Bartels. All rights reserved.
#
# netbox-sync.py
#
# This work is licensed under the terms of the MIT license.
# For a copy, see file LICENSE.txt included in this
# repository or visit: <https://opensource.org/licenses/MIT>.
import os
from argparse impo... |
# Generated by Django 2.2.5 on 2019-12-26 20:45
from django.db import migrations, models
import django.db.models.deletion
def non_reversible_migration(apps, schema_editor):
"""Operation to "reverse" an unreversible change"""
pass
def remove_non_sadd_disaggregations(apps, schema_editor):
DisaggregationTyp... |
"""Setup script.
Run "python setup.py install" to install the clot package.
"""
from os import path
import re
import sys
from setuptools import find_packages, setup
PACKAGE_NAME = 'clot'
if sys.version_info < (3, 6):
raise RuntimeError(f'{PACKAGE_NAME} requires Python 3.6 or higher')
def get_readme():
... |
from django.conf.urls import url
import list.views
urlpatterns = [
url(r'^tododata/$', list.views.TaskTodo.as_view()),# 1
url(r'^tododata/(\d+)/$', list.views.TaskTodo.as_view())#2
] |
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import math
import pytest
import torch
from pyro.distributions import (
Delta,
NegativeBinomial,
Normal,
Poisson,
ZeroInflatedDistribution,
ZeroInflatedNegativeBinomial,
ZeroInflatedPoisson,
)
from pyr... |
import random
import pprint
from src.knapsack import Knapsack
from src.object import Object
from src.genetic import GeneticAlgorithm
def main():
items = []
n_items = int(input("Enter number of items: "))
for i in range(n_items):
worth, weight = input(f"{i+1}. Enter worth and weight: ").split()
... |
"""setup.py for function_limiter"""
__author__ = "Mohsen Ghorbani"
__email__ = "m.ghorbani2357@gmail.com"
__copyright__ = "Copyright 2021, Mohsen Ghorbani"
from setuptools import setup, find_packages
import os
import versioneer
this_dir = os.path.abspath(os.path.dirname(__file__))
REQUIREMENTS = filter(None, open('... |
import sys, time, os, socket
import struct, binascii, re, csv
from datetime import datetime, timedelta
# Twisted
from twisted.protocols.basic import LineReceiver
from twisted.internet import reactor
from twisted.python import usage, log
from twisted.internet.serialport import SerialPort
from twisted.web.server import ... |
import os
import time
from collections import OrderedDict
from pathlib import Path
from typing import Dict
import numpy as np
import pytest
from jina import Flow, Document, Executor, DocumentArray, requests
from jina.logging.profile import TimeContext
from jina_commons.indexers.dump import (
import_vectors,
im... |
#!/usr/bin/python3
# from strategy_base import strategyBase
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Dataset
input_size = 4
hidden_size = 4 * input_size
num_layers = 1
seq_len = 10
batch_size = 20
class strategyBase(object):
def __init__(self):
pass
def _get_data(s... |
import unittest
import numpy as np
from ikfs_anomaly_detector.intellectual.autoencoder import LSTMAutoencoder
from ikfs_anomaly_detector.intellectual.predictor import LSTMPredictor
from ikfs_anomaly_detector.intellectual.utils import (
z_normalization,
calculate_mean,
find_anomaly_points,
calculate_co... |
# -*- encoding: utf-8 -*-
#
# Copyright © 2012 New Dream Network, LLC (DreamHost)
#
# Author: Julien Danjou <julien@danjou.info>
#
# 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:... |
from random import randint
numeros = (randint(1, 10), randint(1, 10), randint(1, 10),
randint(1, 10), randint(1, 10))
print('Os valores sorteados foram: ', end='')
for n in numeros:
print(f'{n} ', end='')
print(f'\nO maior valor foi {max(numeros)}.')
print(f'O menor valor foi {min(numeros)}.') |
import argparse
FLAGS = None
class Generator():
def __init__(self):
self.first_prior = True
self.anchors = create_ssd_anchors()
self.last = "data"
def header(self, name):
print("name: \"%s\"" % name)
def data_deploy(self):
print(
"""input: "data"
input_shape {
dim: 1
... |
# Author: David Alexander
__all__ = [ "BamReader", "IndexedBamReader" ]
try:
from pysam.calignmentfile import AlignmentFile # pylint: disable=no-name-in-module, import-error, fixme, line-too-long
except ImportError:
from pysam.libcalignmentfile import AlignmentFile # pylint: disable=no-name-in-module, impo... |
import os.path as osp
from math import ceil
import torch
import torch.nn.functional as F
from torch.nn import Linear
from torch_geometric.datasets import TUDataset
from torch_geometric.loader import DataLoader
from torch_geometric.nn import GCNConv, DenseGraphConv, dense_mincut_pool
from torch_geometric.utils import t... |
from .rigid_body import RigidBody, BodyGraph, project_onto_constraints
from .chain_pendulum import ChainPendulum
from .magnet_pendulum import MagnetPendulum
from .spring_pendulum import SpringPendulum
from .friction_pendulum import FrictionChainPendulum, FrictionSpringPendulum
from .rotor import Rotor
from .gyroscope i... |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2019 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this ... |
"""
Simulate the radiative and hydrodynamial evolution of a disk with
a bump around a single star
"""
from time import time, localtime
from amuse.lab import *
from amuse.ext.molecular_cloud import ism_cube
from amuse.community.simplex.interface import SimpleXInterface, SimpleX, \
SimpleXSplitSet
from amuse.... |
from django.urls import path
from . import views
# project url directs to this, which directs to the proper view
urlpatterns=[
path('', views.index, name='index'),
path('getGenres/', views.getGenres, name='genres'),
path('getAlbums/', views.getAlbums, name='albums'),
path('albumDetail/<int:id>', views.... |
#!/usr/bin/env python
#coding=utf-8
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.acs_exception.exceptions import ClientException
from aliyunsdkcore.acs_exception.exceptions import ServerException
from aliyunsdkiot.request.v20180120.ListRuleRequest import ListRuleRequest
client = AcsClient('<accessKey... |
# 4개로 분기하는 조건문
n = int(input('input number: '))
if n == 1:
print('A')
elif n == 2:
print('B')
elif n == 3:
print('C')
else:
pass
|
from .plot import *
peth = peri_event_time_histogram |
import torch.fx as fx
from typing import Type, Dict, Any, Tuple, Iterable
import torch
import copy
from torch.fx import symbolic_trace
import time
def _parent_name(target : str) -> Tuple[str, str]:
"""
Splits a qualname into parent path and last atom.
For example, `foo.bar.baz` -> (`foo.bar`, `baz`)
""... |
"""Unit tests against secretbox.py"""
import os
from typing import Any
from typing import Generator
from unittest.mock import patch
import pytest
from secretbox import SecretBox
from tests.conftest import ENV_FILE_EXPECTED
@pytest.fixture
def secretbox() -> Generator[SecretBox, None, None]:
"""Default instance ... |
"""Tests for SlidesExporter"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from nbformat import v4 as nbformat
from .base import ExportersTestsBase
from ..slides import SlidesExporter, prepare
class TestSlidesExporter(ExportersTestsBase):
"""Tests for Sli... |
import os
import re
from clang_index import Clang_Index
class cgo(object):
def get_inline_source(buffer):
# TODO(zchee): very slow. about 100ms
if 'import "C"' not in buffer:
return (0, '')
pos_import_c = list(buffer).index('import "C"')
c_inline = buffer[:pos_impor... |
from rcn_tool_a import rcn_tool_a
import torch
from config import cfg
class rcn_tool_b(rcn_tool_a):
def roi_pooling_cuda(self, features, proposal, label=None, stride=cfg.feature_stride, pool=None, batch=False):
if batch == True:
batch_output = []
batch_label = []
... |
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0,-1"
import numpy as np
import tensorflow as tf
#from tensorflow.python.client import device_lib
#print(device_lib.list_local_devices())
import shutil, sys
from datetime import datetime
import h5py
from arnn_sleep import ARNN_Sleep
from arnn_sleep_config import Config
... |
import tcod
def initialize_fov(game_map):
fov_map = tcod.map_new(game_map.width, game_map.height)
for y in range(game_map.height):
for x in range(game_map.width):
tcod.map_set_properties(
fov_map,
x,
y,
not game_map.tiles[x][... |
# Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
import component
component.setup()
|
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... |
from turtle import Turtle
import random
class Food(Turtle):
def __init__(self):
super().__init__()
self.shape("circle")
self.penup()
self.shapesize(stretch_len=0.5, stretch_wid=0.5)
self.color("blue")
self.speed("fastest")
self.refresh()
def refresh(se... |
# This file is part of Frhodo. Copyright © 2020, UChicago Argonne, LLC
# and licensed under BSD-3-Clause. See License.txt in the top-level
# directory for license and copyright information.
import os, io, stat, contextlib, pathlib, time
import cantera as ct
from cantera import interrupts, cti2yaml#, ck2yaml, ctml2yam... |
import iyzipay
options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}
request = {
'locale': 'tr',
'conversationId': '123456789',
'subMerchantKey': 'sub merchant key',
'iban': 'TR180006200119000006672315',
'address': 'Nidakule Göztepe, M... |
# Copyright (c) 2022 CRS4
#
# 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, merge, publish, distribute, su... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
__version__ = "1.1.0"
from . import * |
# coding: utf-8
"""
CLOUD API
IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and ... |
import glob
import os
from shutil import copyfile
import random
import itertools
import json
def createPath(curr_subdir):
"""[summary]
Args:
curr_subdir ([type]): [description]
"""
if not os.path.exists(curr_subdir):
os.makedirs(curr_subdir)
print(curr_subdir + " directory was ... |
import uuid
from tornado.websocket import WebSocketHandler, WebSocketClosedError
import logging
import json
logger = logging.getLogger(__name__)
class WideCameraFeedWS(WebSocketHandler):
"""
"""
watchers = set()
def open(self):
self.uid = str(uuid.uuid4())
logger.info("WideCameraFeed we... |
import numpy as np
import pytest
from sklearn.tree._reingold_tilford import buchheim, Tree
simple_tree = Tree("", 0,
Tree("", 1),
Tree("", 2))
bigger_tree = Tree("", 0,
Tree("", 1,
Tree("", 3),
Tree("",... |
from contextlib import closing
import json
import logging
import boto3
from lambda_logs import JSONFormatter, custom_lambda_logs
logger = logging.getLogger()
logger.setLevel(logging.INFO)
logger.handlers[0].setFormatter(JSONFormatter())
class QCFailed(Exception):
def __init__(self, message: str):
self.... |
# Module to import functions from in examples for multiprocessing backend
import numpy as np
def obj_fun(x, noise_level=0.1):
return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) +\
np.random.randn() * noise_level
|
"""
The following test suit serves as a set of examples of how to integrate different classes
into our AST and use them.
"""
# stdlib
from functools import partial
from importlib import reload
import sys
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union as TypeUnion
... |
"""base58 module.
Original source: git://github.com/joric/brutus.git
which was forked from git://github.com/samrushing/caesure.git
Distributed under the MIT/X11 software license, see the accompanying
file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
from binascii import hexlify, unhexlify
from... |
from django.contrib.auth.decorators import login_required
from django.db.models import Count, F, Sum
from django.http import HttpResponseRedirect
from django.shortcuts import render # NOQA
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.timezone import datetime, n... |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
from .representation import Skill, Activation, Sai, RHS, StateMultiView, Explanation, numbalizer |
#!/usr/bin/python
#
# Character_Input.py v1.0 by mariuszha
#
# Exercise: Character Input
# Create a program that asks the user to enter their name and their age.
# Print out a message addressed to them that tells them the year that they will turn 100 years old.
#
import datetime
# User input
name = raw_input('Write ... |
import argparse
import gym
import numpy as np
from itertools import count
from collections import namedtuple
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.distributions import Categorical
# Cart Pole
parser = argparse.ArgumentParser(description='PyTorch act... |
from getpass import getpass
from mysql.connector import connect, Error
from FakeDevices import *
from mfrc522 import SimpleMFRC522
import string
buzzer = 3
door_lock = 1;
pinMode(buzzer, "OUTPUT")
pinMode(door_lock, "OUTPUT")
reader = SimpleMFRC522()
def compact(txt):
return ''.join([c for c in txt i... |
import sys
ips = [line.strip() for line in open("ips.txt", "r")]
n = len(ips)
ins = [line.split("\t")[0] for line in ips]
outs = [line.split("\t")[1] for line in ips]
id = int(sys.argv[1])
port = int(sys.argv[2])
ratios = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
locks = [2, 4, 6]
def get_cmd(n, i):
cmd = "... |
import logging
from datetime import datetime
import os
class Logger():
DEBUG = logging.DEBUG
INFO = logging.INFO
WARNING = logging.WARNING
ERROR = logging.ERROR
def __init__(self, name, path, level=DEBUG):
self._logger = None
self._setLogger(name, path, level)
def _setLogger... |
from typing import Dict, List
import itertools
import warnings
from overrides import overrides
import torch
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import pad_sequence_to_length
from allennlp.data.tokenizers.token import Token
from allennlp.data.token_indexers.token_indexer imp... |
#! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
import os,sys,re,traceback
from waflib import Utils,Logs,Options,Errors
from waflib.TaskGen import after_method,feature
from waflib.Configure import conf
from waflib.Tools import ccroot,c,cxx,ar
g_ms... |
import unittest
from satella.coding.sequences import n_th
from satella.instrumentation.metrics import getMetric
import time
from satella.instrumentation.metrics.structures import MetrifiedThreadPoolExecutor, \
MetrifiedCacheDict, MetrifiedLRUCacheDict, MetrifiedExclusiveWritebackCache
from .test_metrics import ch... |
import json
import os
import platform
import sys
import pkgutil
import pytest
py_major = sys.version_info[0]
py_impl = platform.python_implementation().lower()
print("Python implementation:", py_impl)
specfile = os.path.join(os.environ['PREFIX'], 'share', 'jupyter', 'kernels',
'python{}'.forma... |
""" Some messages! """
from acme.motd.api import Message
messages = [
Message(
author="Bertrand Meyer",
text="You can have quality software, or you can have pointer"
" arithmetic; but you cannot have both at the same time."), Message(
author="Edsger W. Dijkstra",
te... |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'chat_server.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Im... |
# Generated by Django 3.0.3 on 2020-02-25 07:34
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
oper... |
import os
import numpy as np
import tensorflow as tf
import time
from q_learning import QN
class DQN(QN):
"""
Abstract class for Deep Q Learning
"""
def add_placeholders_op(self):
raise NotImplementedError
def get_q_values_op(self, scope, reuse=False):
"""
... |
SECRET_KEY = 'template settings file'
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'estimators',
)
DATABASE_ENGINE = 'sqlite3',
DATABASES = {
'default': {
'NAME': 'db.sqlite3',
'ENGINE': 'django.db.b... |
from disnake.ext import tasks
import topgg
from os import environ
async def update_guilds(client):
dbl_token = environ['topgg']
client.topggpy = topgg.DBLClient(client, dbl_token,autopost = True)
|
#-*- coding: utf-8 -*-
"""
Requests-AEAweb is a custom Requests class to log onto AEAweb.org, the website of the
American Economic Association. Basic usage for returning a Requests session object:
>>> from requests_aeaweb import AEAweb
>>> deets = {'username': 'someuser', 'password': 'XXXX'}
>>> conn ... |
import tensorflow as tf
from keras import models, layers
from keras.utils.generic_utils import register_keras_serializable
from keras.utils.tf_utils import shape_type_conversion
from .decoder import Decoder
from ...backbone import Backbone
from ...common import ConvBnRelu, HeadActivation, HeadProjection, resize_by_samp... |
from model.contact import Contact
import random
import string
import os.path
#import json
import getopt
import sys
import jsonpickle
try:
opts, args = getopt.getopt(sys.argv[1:], "n:f:", ["number of contacts", "file="])
except getopt.GetoptError as err:
print(err)
getopt.usage()
sys.exit(2)
n=3
f= "da... |
# Generated by Django 3.0.6 on 2020-06-16 13:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('photos', '0003_auto_20200616_1321'),
]
operations = [
migrations.AddField(
model_name='usercomment',
name='date',
... |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class MiaoPaiIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?miaopai\.com/show/(?P<id>[-A-Za-z0-9~_]+)"
_TEST = {
"url": "http://www.miaopai.com/show/n~0hO7sfV1nBEw4Y29-Hqg__.htm",
"md5": "095ed3f1c... |
from sympy import (
Abs, acos, Add, asin, atan, Basic, binomial, besselsimp,
cos, cosh, count_ops, csch, diff, E,
Eq, erf, exp, exp_polar, expand, expand_multinomial, factor,
factorial, Float, Function, gamma, GoldenRatio, hyper,
hypersimp, I, Integral, integrate, KroneckerDelta, log, logcombine, Lt... |
# Copyright Amazon.com Inc. or its affiliates. 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. A copy of the
# License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying... |
"""This module includes neural graph embedding models and support functions.
Knowledge graph embedding models are neural architectures that encode concepts from a knowledge graph
(i.e. entities :math:`\mathcal{E}` and relation types :math:`\mathcal{R}`) into low-dimensional, continuous vectors
:math:`\in \mathcal{R}^k... |
import GPUtil
import argparse
import collections
import docker
import os
import sacrebleu
import tempfile
import time
client = docker.from_env()
docker_version = client.version()["Version"]
docker_version_numbers = docker_version.split(".")
docker_major_version = int(docker_version_numbers[0])
docker_minor_version = ... |
# -*- coding: utf8 -*-
from __future__ import unicode_literals
import time
import logging
logger = logging.getLogger(__name__)
from inspectors.base import Base
from algorithms.base import Discretizer
import utils
from consts import ParamsTypes, Hooks, Spaces
def mean(vals):
return float(sum(vals)) / len(vals)
... |
from typing import Tuple
import numpy as np
from . import modulus, inverse
def gcd_poly(poly1: np.poly1d, poly2: np.poly1d, p: int) -> np.poly1d:
"""Seek the gcd of two polynomials over Fp.
Args:
poly1 (np.poly1d): A polynomial.
poly2 (np.poly1d): A polynomial.
p (int): A prime numb... |
import numpy as np
import matplotlib.pyplot as plt
import os.path
#Reading the output
flag = 0
if os.path.exists('../../build/output/simpson_integration/simpson_approximation_errors_v1.txt'):
flag = 1
N, deviation = np.loadtxt('../../build/output/simpson_integration/simpson_approximation_errors_v1.txt', skipro... |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
#!/usr/bin/env python3
from setuptools import setup, Extension
setup(name="rcUAS_insgns",
version="1.3",
description="INS/GNS Toolbox",
author="Curtis L. Olson",
author_email="curtolson@flightgear.org",
url="https://github.com/RiceCreekUAS",
packages = ["rcUAS_insgns"],
ext_m... |
"""
Build a Segment Tree data structure.
"""
import operator
class SegmentTree(object):
"""Build a Segment Tree data structure."""
def __init__(self, capacity, operation, neutral_element):
"""
Build a Segment Tree data structure.
https://en.wikipedia.org/wiki/Segment_tree
Ca... |
"""
Enrich2 libraries idonly module
===============================
Contains the concrete class ``IdOnlySeqLib`` which represents a sequencing
library derived from a counts file.
"""
from .seqlib import SeqLib
__all__ = ["IdOnlySeqLib"]
class IdOnlySeqLib(SeqLib):
"""
Class for counting data with non-var... |
{
"targets": [{
"target_name": "addon",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
"include_dirs" : [
"<!@(node -p \"require('node-addon-api').include\")"
],
"dependencies": [
"<!@(node -p \"require('node... |
from flask_wtf import Form
from wtforms import StringField, BooleanField, TextAreaField
from wtforms.validators import DataRequired, Length
from app.models import User
class LoginForm(Form):
openid = StringField('openid', validators=[DataRequired()])
remember_me = BooleanField('remember_me', default=False)
... |
import _base
import new
moduleCache = {}
def getETreeModule(ElementTreeImplementation, fullTree=False):
name = "_" + ElementTreeImplementation.__name__+"builder"
if name in moduleCache:
return moduleCache[name]
else:
mod = new.module("_" + ElementTreeImplementation.__name__+"builder")
... |
import setuptools
with open("README.md", "r") as file_handle:
long_description = file_handle.read()
setuptools.setup(
name='karstnet',
version='1.2.0',
author="Philippe Renard & Pauline Collon",
description="Statistical characterization of karstic network",
long_description=long_description,
... |
from setuptools import setup
# Note: setuptools are not part of the python installation,
# need to install separately, using pip for example, befor running this setup
def readme():
with open('README.md') as f:
return f.read()
setup(
name='constellations',
version='0.0.3',
author='Panagiotis... |
#! /usr/bin/env python
# -*- coding: latin-1 -*-
import os
import sys
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
def Main():
data = open(sys.argv[1]).read()
# Don't add more than 3 levels to TOC.
data = data.replace('<h5>', '<h5 class="no-toc">')
# TODO(bradnelson/tabatkins): Fix when bikes... |
import json
import requests
tvmaze_api_url = 'http://api.tvmaze.com'
show_single_search_path = '/singlesearch/shows?q='
show_episode_list_path = '/shows/{series_id}/episodes'
def show_single_search(name):
resp = requests.get(tvmaze_api_url + show_single_search_path + name)
json_response = json.loads(json.du... |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
class cobinhood (Exchange):
def... |
#!/usr/local/bin/python2.7
"""
Copyright (c) 2016 Ad Schellevis <ad@opnsense.org>
Copyright (c) 2015 Jos Schellevis <jos@opnsense.org>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:... |
from .NamedBO import NamedBO
class Einzelhaendler(NamedBO):
def __init__(self):
super().__init__()
self._benutzer_id = 0
def set_benutzer_id(self, benutzer_id):
"""Setzen der Benutzer_id"""
self._benutzer_id = benutzer_id
def get_benutzer_id(self):
"""Auslesen der... |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... |
# 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 req... |
# -*- coding: utf-8 -*-
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from typing import Union
import h5py
import os
import traceback
from h5grove.encoders import orjson_encode
from h5grove.models import LinkResolution
from h5grove.utils import NotFoundError
from... |
import os
class Config:
data_dir = os.path.abspath('../data')
train_data_dir = os.path.join(data_dir, 'image_arrays_train')
test_data_dir = os.path.join(data_dir, 'image_arrays_test')
submissions_dir = os.path.join(data_dir, '../' 'submissions')
models_dir = os.path.join(data_dir, '../', 'models')... |
# Basic imports
import numpy as np
import os.path
# Local imports
import ising.utils.calculation_utils as cu
# File utils
from ising.utils.file_utils import load_sparse_csr
from ising.utils.file_utils import projfile, sysfile, eigenfile
import ising.models.ising_type_utils as base
# ================================... |
from build_migrator.helpers import get_minified_target
from build_migrator.modules import Generator
class CMakeModuleCopy(Generator):
priority = 1
@staticmethod
def add_arguments(arg_parser):
pass
def __init__(self, context):
self.context = context
# recursively search for origi... |
import os
import sys
import time
import argparse
from datetime import datetime
import shutil
def copytree(src, dst, symlinks=False, ignore=None):
if not os.path.exists(dst):
shutil.copytree(src, dst)
else:
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst... |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_tatooine_jabba_swooper_leader.iff"
result.attribute_te... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.