text stringlengths 2 999k |
|---|
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Interface loader
# ----------------------------------------------------------------------
# Copyright (C) 2007-2017 The NOC Project
# See LICENSE for details
# -------------------------------------------------------------... |
from __future__ import print_function
import sys, os, collections
sys.path.insert(1, os.path.join("..", "..", ".."))
import matplotlib
matplotlib.use("Agg") # remove warning from python2 (missing TKinter)
import h2o
import matplotlib.pyplot
from tests import pyunit_utils
from h2o.automl import H2OAutoML
from h2o.esti... |
# Copyright 2016 Novo Nordisk Foundation Center for Biosustainability, DTU.
# 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 ... |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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 or agreed to... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
#!/usr/bin/env python
#
#The MIT CorrelX Correlator
#
#https://github.com/MITHaystack/CorrelX
#Contact: correlX@haystack.mit.edu
#Project leads: Victor Pankratius, Pedro Elosegui Project developer: A.J. Vazquez Alvarez
#
#Copyright 2017 MIT Haystack Obse... |
"""Prepare read inputs (fastq, gzipped fastq and BAM) for parallel NGS alignment.
"""
import collections
import copy
import glob
import os
import shutil
import subprocess
import six
import toolz as tz
from bcbio import bam, utils
from bcbio.bam import cram, fastq
from bcbio.cwl import cwlutils
from bcbio.log import l... |
# See "Writing benchmarks" in the asv docs for more information.
# https://asv.readthedocs.io/en/latest/writing_benchmarks.html
# or the napari documentation on benchmarking
# https://github.com/napari/napari/blob/master/docs/BENCHMARKS.md
import numpy as np
from qtpy.QtWidgets import QApplication
import napari
clas... |
from dilami_calendar.constants import MINYEAR, MAXYEAR
from dilami_calendar.exceptions import (
InvalidDilamiYearError,
InvalidPanjikError,
InvalidVishakError,
InvalidDilamiMonthError,
InvalidDilamiDayError,
)
from dilami_calendar.algorithms import is_dilami_leap_year
def validate_dilami_year(dy):... |
import os
import pandas as pd
def listdirInMac(path):
os_list = os.listdir(path)
for item in os_list:
if item.startswith('.') and os.path.isfile(os.path.join(path, item)):
os_list.remove(item)
os_list.sort()
return os_list
root='/Users/alex/Documents/data/want/test/'
newfile=pd.Da... |
#!/usr/bin/env python3
# Copyright (c) 2016-2019 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 RPC commands for signing and verifying messages."""
from test_framework.test_framework import Bit... |
""" catjson.py concatenates multiple JSON files together into one file containg an array
Usage:
catjson.py <files>... [--config=<file>] [options]
Options:
<files> input files to operate on
--config=<file> file specifiying configuration options
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
"""
Exercise setting and getting individual vector elements
"""
def test():
# package access
import gsl
# make a vector
v = gsl.vector(shape=100)
# fill with a test pattern
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class GeneralConfig(object):
def __init__(self, logger=None):
"""
Create a general config
"""
object.__setattr__(self, "attrs", {})
object.__setattr__(self, "used_parameters", set())
object.__setattr__(self, "undefined_... |
"""ASCIIDoc Exporter class"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from traitlets import default
from traitlets.config import Config
from .templateexporter import TemplateExporter
class ASCIIDocExporter(TemplateExporter):
"""
Exports to an ASC... |
from django.apps import AppConfig
class DeterminationsConfig(AppConfig):
name = 'hypha.apply.determinations'
|
"""
Background job servicers
"""
import logging
from datetime import timedelta
from sqlalchemy.sql import func, or_
from couchers import config, email, urls
from couchers.db import session_scope
from couchers.email.dev import print_dev_email
from couchers.email.smtp import send_smtp_email
from couchers.models import... |
from mlnotify.mlnotify import plugin_manager
from mlnotify.plugins.base import BasePlugin
start = plugin_manager.run_before
end = plugin_manager.run_after
try:
from mlnotify.jupyter_magic import register_jupyter_magic
register_jupyter_magic()
except:
# Not in jupyter notebook
pass
__all__ = [start,... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
import re
import os
import sys
def get_version(package):
"""
Return package version as listed in `__version__` in `init.py`.
"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.match("__version__ = ['... |
# Copyright 2016 The TensorFlow 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 applica... |
# 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... |
"""Create an initial simulation flow field (block) hdf5 file."""
# type annotations
from __future__ import annotations
# internal libraries
from ...api.create import block
from ...core.configure import get_defaults
from ...core.custom import patched_error, patched_exceptions
from ...core.options import return_options... |
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumTestCase
from django.contrib.auth.models import Permission, User
from django.contrib.contenttypes.models import ContentType
from django.test import Requ... |
import tkinter as tk
from tkinter import ttk
class Scrollable( ttk.Frame ):
'''wrap a frame for scrolling'''
def __init__( self, parent, horizontal=False, vertical=False, **kwargs ):
self.superFrame = ttk.Frame( parent, **kwargs )
self.superFrame.grid_rowconfigure( 0, weight=1 )
self.su... |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
##========================================================
# Copyright Jody M Sankey 2010-2011
#========================================================
# AppliesTo: linux
# RemoveExtension: True
# PublicPermissions: True
#=====================================================... |
from django.contrib.auth.models import AbstractUser
from django.conf import settings
from django.db import models
from django.db.models.deletion import PROTECT
from django.forms.fields import CharField, DateField, EmailField, IntegerField
from datetime import date, datetime, timedelta
def next_weds():
from dateti... |
import time
from datetime import datetime
import config
from helpers.functions import fancy_time, fetch_all
from helpers.handler import port_handler
class stats_handler(port_handler):
"""
Serve server statistics
"""
def handle_data(self):
"""
Calculate some list server statistics, sh... |
# Copyright (C) 2015, Anuj Sharma (anuj.sharma80@gmail.com)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Structural alignme... |
"""
Wrapper around the ``dateutil.rrule`` module.
Provides more consistent behavior with the rfc2445 specification,
notably differing from `dateutil.rrule`` in the handling of the
`dtstart` parameter and the additional handling of a `dtend`
parameter. Also, the `byweekday` parameter in `dateutil.rrule` is
`byday` in t... |
import setuptools
with open("README.org", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="solaredge-influx",
version="0.0.2",
author="Jos van Bakel",
author_email="jos@codeaddict.org",
description="Queries the Solaredge monitoring API and stores the data in InfluxDB",
long... |
# Copyright 2016 Google 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 by applicable law or a... |
"""
WSGI config for Topic_Evaluator project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJAN... |
from dataclasses import dataclass
from typing import Any, Union, List, Dict, Literal, Optional, NamedTuple
from zephyrus_sc2_parser.game import Player, GameObj
# GameState = {
# <player id>: {
# <gamestate key>: <gamestate value>
# }
# }
GameState = Dict[int, Dict[str, Any]]
# SummaryStat = {
# <... |
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./main.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
def _set_response(self):
self.send_response(200)
self.send_header('Content... |
import argparse
import os
import sys
from distutils.util import strtobool
from pathlib import Path
from tqdm import tqdm
from image_transformer import ImageTransformer
from util import save_image
# Usage:
# Change main function with ideal arguments
# then
# python demo.py [name of the image] [degree to r... |
import boto3
import requests
import os
import json
import random
import datetime
#import traceback
import re
import urllib3
from requests import RequestException
from datetime import datetime
# Disable InsecureRequestWarning
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# Environment Variables
S... |
# Copyright 2018 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Custom Dataset."""
import kaldiio
import numpy as np
import os
from numpy.lib.index_tricks import AxisConcatenator
import pandas as pd
from torch.utils.data import Dataset
from neural_sp.datasets.token... |
# Level: Medium
from typing import Dict, Set
# Definition for a Node.
class Node:
def __init__(self, val = 0, neighbors = None):
self.val = val
self.neighbors = neighbors if neighbors is not None else []
copied_map: Dict[int, 'Node'] = dict()
visited: Set[int] = set()
def create_node(node:'... |
import datetime
import pickle
import unittest
from collections import OrderedDict
from operator import attrgetter
from django.core.exceptions import EmptyResultSet, FieldError
from django.db import DEFAULT_DB_ALIAS, connection
from django.db.models import Count, F, Q
from django.db.models.sql.constants import LOUTER
f... |
A, B, C = map(int, input().split())
cnt = 0
tmp = C
while C <= B:
if A <= C <= B:
print(C)
exit()
C += tmp
print(-1) |
import unittest
import vivisect.const as v_const
import vivisect.tools.graphutil as v_t_graph
import vivisect.symboliks.archs.i386 as i386sym
import vivisect.symboliks.analysis as v_s_analysis
from vivisect.symboliks.common import Arg, Var, Const, cnot
from vivisect.symboliks.effects import ConstrainPath, WriteMemo... |
name = "Glenn"
if name in["Glenn", "Rick"]:
print("Your name is is either Glenn or Rick")
|
import imp
import logging
import pkgutil
import sys
import traceback
import requests
from streamlink.logger import StreamlinkLogger, Logger
from streamlink.utils import update_scheme, memoize
from streamlink.utils.l10n import Localization
from . import plugins, __version__
from .compat import is_win32
from .exception... |
from application.settings import get_option
import logging
import requests
import traceback
import requests.exceptions
def send_notifications(entries):
"""
We don't expect any Exceptions from this function - all exceptions inside
this func must be catched and logged.
"""
notify_telegram(entries)... |
#!/usr/bin/env python
"""
Authors: Alexander Moriarty (GH: @moriarty)
Alexander Hagg (GH: @alexander-hagg)
Quick script for recording data x,y points by clicking them in an image.
"""
from __future__ import print_function
import Tkinter
from PIL import Image, ImageTk
from sys import argv
import math
r... |
from ezcode.matrix import init_matrix, MatrixIterator
def test_init_matrix():
class Data:
def __init__(self, data):
self.data = data
def __repr__(self):
return str(self.data)
matrix = init_matrix(2, 3, Data(1))
matrix[0][0].data = 2
assert matrix[0][0].data ==... |
import torch
from torch import nn
from torch.autograd.variable import Variable
import matplotlib.pyplot as plt
import numpy as np
import math
import time
import model
from os import mkdir
from os.path import isdir
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
print(DEVICE)
def imread(img_name)... |
#! /usr/bin/python2.7
# -*- coding: utf-8 -*-
from os import makedirs
from os.path import isfile,isdir,exists
from subprocess import call as spcall # this will write a report in LaTeX, iff you have it installed
def tex_report(plot_paths):
path = plot_paths[0]
report_folder = '/'.join(path.split('/')[:-1])+'... |
from variables import * #Se importa la informacion del archivo variables.py donde esta definido el valor de pasajeros minimos y el numero de paradas
import turtle
from tkinter import PhotoImage
import threading
import time
import random
from random import randint
# !/usr/bin/python
num_paradas = numeroparadas # para i... |
from . import api, brackets, utils
TOURNAMENT_PREFIX = 'tournament/'
EVENT_URL = '/event/'
VALID_PARAMS = ['event', 'phase', 'groups', 'stations']
def show(tournament_name, params=[], filter_response=True):
"""Retrieve a single tournament record by `tournament name`"""
utils._validate_query_params(params=pa... |
from praeteritum.utils.Delegator import Delegator
from match.logic.match_modules.board.UnitsManager import UnitsManager
from typing import Callable
from .utils import make_fields
from .items.Field import Field
from .items.Unit import Unit
class Board(Delegator):
def __init__(self, send_to_sockets: Callable):
... |
#
# coding: utf-8
# Copyright (c) 2018 DATADVANCE
#
# 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,... |
# Copyright 2016 Red Hat, 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 law or agre... |
import logging
import re
import threading
from datetime import datetime
from typing import Optional, Tuple
import uuid
import m3u8
import requests
from locast2dvr.utils import Configuration, LoggingHandler
from requests.exceptions import HTTPError
from timezonefinder import TimezoneFinder
from .fcc import Facilities
... |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.from asyncio import sleep
from asyncio import sleep
from os import environ
from re import sub
from sys import setrecursion... |
#!/usr/bin/env python
from flask_mm import app
app.run(debug = True)
|
import cv2
import face_recognition
import numpy as np
video_capture=cv2.VideoCapture(0)
known_face_encodings=[]
known_face_names=[]
image_g=face_recognition.load_image_file(r'''samples/meeting_11_304.jpg''')
image_g_encoding=face_recognition.face_encodings(image_g)[0]
known_face_encodings=[image_g_encoding, img_g_e... |
import json
from packlib.base import ProxmoxAction
class ClusterFirewallAliasesCreateAliasAction(ProxmoxAction):
"""
Create IP or Network Alias.
"""
def run(self, cidr, name, comment=None, profile_name=None):
super().run(profile_name)
# Only include non None arguments to pass through... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0029_auto_20150811_1924'),
]
operations = [
migrations.AddField(
model_name='articlecategory',
... |
import copy
import mmcv
import numpy as np
import os
import tempfile
import torch
from mmcv.utils import print_log
from os import path as osp
from mmdet.datasets import DATASETS
from ..core import show_result
from ..core.bbox import (Box3DMode, CameraInstance3DBoxes, Coord3DMode,
points_cam2im... |
import os
import torch
import torch.nn as nn
MODEL_DIR = "saved_models"
MODEL_NAME = "facenet.pt"
class ModelTrainer:
def __init__(self, net, optimizer, criterion, train_loader, val_loader):
self.net = net
self.optimizer = optimizer
self.criterion = criterion
self.train_loade... |
# Example 10.1 page 198 in Reinforcement Learning: An Introduction Book
# PhD Student: Nguyen Dang Quang, Computer Science Department, KyungHee University, Korea.
# 1-step Semi Gradient SARSA Implementation for MountainCar-v0 environment
# RBF Feature Vector Generated for Linear Approximation
# Reference from http://sc... |
from datetime import datetime
from ..extensions import db
class List(db.Model):
__tablename__ = 'lists'
id = db.Column(db.Integer, primary_key=True)
created_at = db.Column(db.DateTime, default=datetime.utcnow, nullable=False)
name = db.Column(db.String(50), nullable=False)
todos = db.relationship... |
import sys
#sys.path.append('../')
|
# This is a sample Python script.
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hello, {name}') # Pre... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
'''
SNLI - Entailment
'''
from __future__ import absolute_import, division, unicode_literals
import codecs
import os
import io... |
"""
# Code adapted from:
# https://github.com/facebookresearch/Detectron/blob/master/detectron/core/config.py
Source License
# Copyright (c) 2017-present, Facebook, 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 obta... |
"""
The first name of this package was supposed to be jsontools. But there was another package with that name. So we chose the name jsonpull.
This package is supposed to provide interesting tools for working with JSON.
Currently only has JPrint. JPrint format the output of JSON objects for printing.
We will add better ... |
#! /usr/bin/env python
# Copyright (C) 2014 VA Linux Systems Japan K.K.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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
# ... |
import numpy as np
import pandas as pd
import pytest
import cudf
from cudf.tests.utils import assert_eq
@pytest.mark.parametrize(
"data,index",
[
([], []),
([1, 1, 1, 1], None),
([1, 2, 3, 4], pd.date_range("2001-01-01", "2001-01-04")),
([1, 2, 4, 9, 9, 4], ["a", "b", "c", "d"... |
from scraping import scrap_top_list
import requests
from pprint import pprint as pp
from bs4 import BeautifulSoup
def get_movie_list_details (movie) :
list_of_item = []
for i in movie:
dict_of_item = {}
new_url = i['url_link']
detail = requests.get(new_url)
soup = BeautifulSoup... |
from tensorflow.keras import activations, constraints, initializers, regularizers
import tensorflow as tf
from tensorflow.keras.layers import Layer, InputSpec
import tensorflow.keras.backend as K
class ClusteringLayer(Layer):
def __init__(self, weights=None, alpha=1.0, **kwargs):
if 'input_shape' not in k... |
def tzip():
string_list = ['man', 'cub', 'desk']
num_tuple = (1, 2, 3)
mixed_tuple = (1, True, 3.14)
# zip function
res = zip(string_list, num_tuple, mixed_tuple)
# converting to set object
print(set(res))
print(tzip())
|
# Beowulf - cluster.py
# get/put to the cluster
import json
import instincts
def cluster():
# step into the culster
with open('data.json') as data_file:
data = json.load(data_file)
# walk through it
events = data['beo'][0]['events']
memories = data['beo'][0]['... |
from functools import total_ordering
from collections import namedtuple
@total_ordering
class Interval(object):
__slots__ = ('start', 'stop', 'data')
INTERVAL_PAIR = namedtuple('IntervalPair', ('left', 'right'))
def __init__(self, start, stop, *, data=None):
self.start, self.stop = sorted((star... |
import torch
def convert_to_np(obj, device):
if torch.is_tensor(obj):
data = obj.data
# If running on GPU, we need to call .cpu() to copy the tensor to host memory
# before we can convert it to numpy
if 'cuda' in device.type:
data = data.cpu()
return data.numpy(... |
from .constants import *
import socket
import time
import threading
from .tools import Tools
from .exceptions import *
class socksServer():
"""
Simple multithreaded tcp server
"""
def __init__(self, host:str, port:int, threadclass, connect_timeout:int = 5, bind_timeout:int = 5, print_log:bool =True,... |
#!/usr/bin/env python
"""
::
ipython -i QCtxTest.py
"""
import os, logging, numpy as np
import matplotlib.pyplot as plt
log = logging.getLogger(__name__)
#np.set_printoptions(suppress=False, precision=8)
np.set_printoptions(suppress=True, precision=4)
class QCtxTest(object):
FOLD = "/tmp/QCtxTest"
... |
import argparse
def make_parser(parser):
# Data options
parser.add_argument('-data', required=True,
help='Path to the *-train.pt file from preprocess.py')
parser.add_argument('-data_format', required=True, default='bin',
help='Default data format: r... |
# Copyright 2018 Iguazio
#
# 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 or agreed to in writing, softwa... |
"""
Various utility functions.
-----
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License. See http://scipy.org.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
Author: Pearu Peterson <pearu@cens.ioc.ee>
Created: May 2006
-----
"""
__all__ = ['split_comma'... |
#!/usr/bin/python
def climateDataFormat(input_path):
import os;
import re;
from scipy.interpolate import interp1d;
import subprocess;
assert os.path.exists(input_path), "\n***** ERROR: " + input_path + " does not exist\n"
minyear = "9999";
maxyear = "0";
tod = 6./24.;
day_counts = {};
days =... |
import unittest
from book_store import total
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.4.0
class BookStoreTest(unittest.TestCase):
def test_only_a_single_book(self):
basket = [1]
self.assertEqual(total(basket), 800)
def test_two_of_the_same_book(self):
... |
from django.contrib import admin
# Register your models here.
from import_export.admin import ImportExportModelAdmin
from Apps.address.models import Country, City, Zone, Address
class CityInlineAdmin(admin.StackedInline):
model = City
classes = ('grp-collapse grp-open',)
inline_classes = ('grp-collapse ... |
# coding: utf-8
"""
LUSID API
# Introduction This page documents the [LUSID APIs](https://www.lusid.com/api/swagger), which allows authorised clients to query and update their data within the LUSID platform. SDKs to interact with the LUSID APIs are available in the following languages : * [C#](https://gith... |
import unittest
import indextools
from .templates import templates
class BoolBase:
@staticmethod
def new_space():
return indextools.BoolSpace()
@property
def values(self):
return (False, True)
class BoolSpaceTest(BoolBase, templates.SpaceTest):
def test_nelems(self):
s... |
# Generated by Django 2.0.6 on 2019-03-06 19:38
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('GameCollectionApp', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='collectormodel',
old_name='Passwor... |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/proto/privacy/dlp/v2beta1/storage.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goog... |
# -*- coding: utf-8 -*-
#
# Enteletaor - https://github.com/cr0hn/enteletaor
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
# following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of con... |
"""
Numeric & Array Types
^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Integer and array types which are used by—but not unique to—Ethereum.
"""
# flake8: noqa
from __future__ import annotations
from dataclasses import replace
from typing import ... |
from typing import List, Union, Tuple
import numpy as np
import random
from tqdm import tqdm
class Variable:
def __init__(self, value=None, grad=None):
self.value = value
self.grad = grad
class Polynomial:
def __init__(self, a: List = None):
self.coef = np.array(a)
def __call... |
#!/usr/bin/env python
#
#
# ===============================================================================
#
# Imports
#
# ===============================================================================
import os
import sys
import shutil
import subprocess as sp
codedir = '../dg1d/'
sys.path.insert(0, codedir)
import... |
from typing import List, Dict
from Graph import Subgraph, Vertex
from samplers.Sampler import Sampler
class TrivialSampler(Sampler):
"""
Collects all neighbors of the vertex
"""
def __init__(self, layers_count: int):
super().__init__(layers_count)
self.cache: List[Dict[Vertex, Subgrap... |
# coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.12
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from _... |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
"""Abstract syntax tree node classes (i.e. parse tree)."""
import os
from abc import abstractmethod
from typing import (
Any, TypeVar, List, Tuple, cast, Set, Dict, Union, Optional
)
from mypy.lex import Token
import mypy.strconv
from mypy.visitor import NodeVisitor
from mypy.util import dump_tagged, short_type
... |
# Wap to get a number form user and tell him whether the entered number is even or odd
# also check that if the numbe is a multiple of 4 print a special messgae else nothing
num=input("enter a number")
if num%2==0:
print("the entered number is even")
else:
print("the entered number is odd")
if num%4==0:
print("py... |
import numpy as np
class buffer_reference:
'''
object in case a user want to take a copy of the reader/writer
'''
def __init__(self, data):
self.buffer = data
self.buffer_lambda = buffer_reference.__empty_lambda
@property
def data(self):
return self.buffer_lambda(self.buffer)
@staticmethod
def __empty... |
from conans import ConanFile, tools
from conan.tools.microsoft import is_msvc
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.33.0"
class TomlPlusPlusConan(ConanFile):
name = "tomlplusplus"
description = "Header-only TOML config file parser and serializer for modern... |
"""
resolveurl XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.