text stringlengths 1 927k |
|---|
#-----------------------------------------------------
# Mimas: conference submission and review system
# (c) Allan Kelly 2016-2020 http://www.allankelly.net
# Licensed under MIT License, see LICENSE file
# -----------------------------------------------------
import unittest
from google.appengine.ext import testbed
... |
"""
Django settings for beyond_tutorial project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
from... |
"""
Expressions for building excel formulas without having to use concrete positions.
"""
import operator
import re
class Expression(object):
"""
Base class for all worksheet expressions.
Expressions are used to build formulas referencing ranges in the
worksheet by labels which are resolved to cell r... |
# qubit number=4
# total number=36
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... |
# This program rearranges raw Egderyders data and builds two lists of dicts, userlist and ciommentslist, containing
# of the data needed to buildm graphs. These objects are then saved into files.
import os, sys
import json
import csv
from datetime import datetime
import time
import logging
import re
from edgesense.ut... |
"""
discord-styled-text
---
A small library to style text for Discord without having to remember any syntax
Copyright 2021 classabbyamp, 0x5c
Released under the terms of the BSD 3-Clause license.
"""
from .__info__ import __version__
from .styler import StyledText, Italic, Bold, Underline, Strikethrough, InlineCode,... |
# pacman.py
# ---------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to http://ai.berkeley.edu.
#
# At... |
import os
from pyroms import _iso
import numpy as np
from mpl_toolkits.basemap import Basemap, shiftgrid
from scipy.interpolate import griddata
import matplotlib.colors as colors
from scipy.signal import medfilt2d
import netCDF4
import pyroms
from bathy_smoother import *
# Grid dimension
Lm = 140
Mm = 120
lon0=117.5... |
import os
import pytest
from thundra.config.config_provider import ConfigProvider
@pytest.fixture()
def config_options():
return {
'config': {
'my': {
'key': 'my-value'
},
'lambda': {
'my': {
'key2': 'my-value2'
... |
# -*- coding: utf-8 -*-
import os
import pytest
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.cluster import KMeans, MeanShift
from gap_statistic import OptimalK
def test_bad_init_config():
"""
Cannot define own clustering function and try to use Rust backend
"""
with pytes... |
"""
OpenAPI Extension with dynamic servers
This specification shows how to use dynamic servers. # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from dynamic_servers.api_client import ApiClient... |
#!/usr/bin/env python
"""
Updates dataset.size column.
Remember to backup your database before running.
"""
import sys, os, ConfigParser
import galaxy.app
assert sys.version_info[:2] >= ( 2, 4 )
def usage(prog) :
print "usage: %s galaxy.ini" % prog
print """
Updates the dataset.size column. Users are advised... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Extracts native methods from a Java file and generates the JNI bindings.
If you change this, please run and update the tests."""... |
import phyper
from typing import List
from pprint import pprint
import pandas as pd
class NonKeys:
n_epochs = 11
batch_size = 10
resume_training = False
another_non_key = True
class MyParser(phyper.Parser, NonKeys):
my_testa: str = 1
ehi = None
bbbbb = 32
c = 'ehi'
hashed_resources... |
# %%
from motion_primitives_py import *
import numpy as np
import time
from pycallgraph import PyCallGraph, Config
from pycallgraph.output import GraphvizOutput
"""
Animate the evolution of the min. dispersion algorithm
"""
tiling = True
plot = False
animate = True
check_backwards_dispersion = False
mp_subclass_specif... |
#!/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... |
# This is a conglomeration of modules removed from https://github.com/mathandy/svgpathtools
# in order to support a modified 'svg2paths' method called 'string2paths' which takes an
# svg string as an argument instead of a filename.
from svgpathtools import Line, QuadraticBezier, CubicBezier, Path, Arc
from xml.dom.mi... |
from Instrucciones.TablaSimbolos.Instruccion import Instruccion
from Instrucciones.Excepcion import Excepcion
import collections
from storageManager.jsonMode import *
from Optimizador.C3D import *
from Instrucciones.TablaSimbolos import Instruccion3D as c3d
class AlterTableAddColumn(Instruccion):
def __init__(self... |
def my_cap_curve(model, X, y, figsize = (10, 5),legend_font_size = 10,loc = 'best',
linewidth = 2,label_font_size = 10, poly_features = False, extra_name = None):
import matplotlib.pyplot as plt
import numpy as np
import my_global_variables
from sklearn.metrics import roc_curve, auc
class_nam... |
# -*- coding: utf-8 -*-
from boltons.setutils import IndexedSet, _MISSING
def test_indexed_set_basic():
zero2nine = IndexedSet(range(10))
five2nine = zero2nine & IndexedSet(range(5, 15))
x = IndexedSet(five2nine)
x |= set([10])
assert list(zero2nine) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
assert ... |
import itertools
import numbers
import numpy as np
import toolz
from .. import base, core, sharedict, utils
from ..compatibility import apply, Mapping
from ..delayed import to_task_dask
from ..optimization import SubgraphCallable
def subs(task, substitution):
""" Create a new task with the values substituted
... |
from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..models.http_service_metadata_operations import HttpServiceMetadataOperations
from ..types import UNSET, Unset
T = TypeVar("T", bound="HttpServiceMetadata")
@attr.s(auto_attribs=True)
class HttpServiceMetadata:
""" """
api: str
compa... |
import ivy
import inspect
import importlib
import numpy as np
from types import ModuleType
wrapped_modules_n_classes = []
NON_WRAPPED_METHODS = ['current_framework', 'current_framework_str', 'set_framework', 'get_framework',
'unset_framework', 'set_debug_mode', 'set_breakpoint_debug_mode', 'set... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import json
import logging
import os
import signal
from typing import List
from idb.common.constants import IDB_PID_PATH
def save_pid(pid: int) -> None:
pids = _get_pids()
pids.append(pid)
_write_pids(pids=pid... |
import asyncio
import logging
import socket
import warnings
from collections import defaultdict
from typing import Dict, Optional
import aiohttp
import discord
from async_rediscache import RedisSession
from discord.ext import commands
from sentry_sdk import push_scope
from bot import api, constants
from bot.async_sta... |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from typing import Optional
import numpy as np
from jina.executors.decorators import batching, as_ndarray
from jina.executors.encoders import BaseAudioEncoder
from jina.executors.encoders.frameworks import... |
# Scrapy settings for cp_spider project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middlewa... |
#######################################################################
# Copyright (C) #
# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# 2016 Kenta Shimada(hyperkentakun@gmail.com) #
# Permission given to modify the... |
num1 = int(input('digite o primeiro valor: '))
num2 = int(input('digite o segundo valor: '))
if num1 > num2:
print('o primeiro numero e maior')
elif num2 > num1:
print('o segundo numero e maior')
else:
print('os numeros são iguais') |
# Copyright 2013-2021 The Salish Sea MEOPAR contributors
# and The University of British Columbia
#
# 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
#
# https://www.apache.org/licenses/... |
"""
Happy Numbers - A happy number is defined by the
following process. Starting with any positive integer,
replace the number by the sum of the squares of its
digits, and repeat the process until the number equals
1 (where it will stay), or it loops endlessly in a
cycle which does not include 1. Those numbers for whic... |
import os
import argparse
def file_merge(folder, out_file, ext):
files = [os.path.join(folder, file) for file in os.listdir(folder) if file.endswith(ext)]
with open(out_file, 'w') as f:
for file in files:
with open(file, 'r') as rf:
print('File {} readed.'.format(file))
... |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from pylab import *
import netCDF4
# <codecell>
tidx = 0 # just get the final frame, for now.
scale = 0.03
isub = 3
url = 'http://comt.sura.org/thredds/dodsC/comt_2_full/testing/ucsc2.nc'
# <codecell>
def shrink(a,b):
"""Return array shrunk ... |
# 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 2.3.33.0
# ... |
"""
Installation of packages using OS package managers such as yum or apt-get
=========================================================================
.. note::
On minions running systemd>=205, as of version 2015.8.12, 2016.3.3, and
2016.11.0, `systemd-run(1)`_ is now used to isolate commands which modify
... |
from __future__ import division
import os
import warnings
import numpy
import six
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer.training import extension
from chainer.training import trigger as trigger_module
from chainer.utils import argument
_available = None
def _try... |
import datetime
from dateutil.relativedelta import relativedelta
import pytest
from ploomber.util import ParamGrid, Interval
def compare(a, b):
for element in a:
if element not in b:
return False
return len(a) == len(b)
def test_interval():
interval = Interval(datetime.date(year=2... |
class StatsExtensions: pass |
from channels import route
from .consumers import ws_connect, ws_receive, ws_disconnect, chat_join, chat_leave, chat_send
websocket_routing = [
route("websocket.connect", ws_connect),
route("websocket.receive", ws_receive),
route("websocket.disconnect", ws_disconnect),
]
custom_routing = [
route("ch... |
__copyright__ = "Copyright (c) 2021 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import os
from pathlib import Path
from typing import Any, Optional, List, Iterable
from jina import Executor, requests, DocumentArray
from jina.logging.logger import JinaLogger
import requests as _requests
import te... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenPublicSinglearticleDataBatchqueryModel(object):
def __init__(self):
self._begin_date = None
self._end_date = None
@property
def begin_date(self):
... |
#!/usr/bin/env python
# http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
# http://www.travisswicegood.com/2010/01/17/django-virtualenv-pip-and-fabric/
# http://code.djangoproject.com/svn/django/trunk/tests/runtests.py
# https://github.com/tomchristie/django-rest-framework/blob/master/rest... |
# function to generate list of factors
def get_factorList(n):
# Insert 1 & n in list, if is n == 1 then only add 1
l = list(set([1,n]))
# Iterate to sq.rt. of n to get all factors
for i in range(2, int(n**0.5)+1):
if n%i == 0:
# If i & n/i aree same, then append only one
if i == n//i:
l.append(i)
# ... |
import numpy as np
import matplotlib.pyplot as plt
def gen_channel(parameters, fc=5E9, fs=2E9, dynamic_range=30):
# Calculate samples/nanosec ratio
nanosec_to_samples = int(1E-9 * fs)
#####################################
# Unpack parameters and convert units
cluster_rate = parameters['cluster_r... |
import traceback
import typing
from tottle.exception_factory.error_handler.abc import ABCErrorHandler, ExceptionHandler
from tottle.modules import logger
class ErrorHandler(ABCErrorHandler):
def __init__(self, redirect_arguments: bool = False):
self.error_handlers: typing.Dict[str, ExceptionHandler] = {}... |
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... |
"""
space : O(n)
time : O(n)
"""
class RecentCounter:
def __init__(self):
self.history = []
def ping(self, t: int) -> int:
self.history.append(t)
s = t - 3000
while self.history[0] < s:
self.history.pop(0)
return len(self.history) |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
@ Author : pengj
@ date : 2018/11/26 19:28
@ IDE : PyCharm
@ GitHub : https://github.com/JackyPJB
@ Contact : pengjianbiao@hotmail.com
---------------... |
#!/usr/bin/env python3
"""Learning Rate Decay Upgraded"""
import tensorflow as tf
def learning_rate_decay(alpha, decay_rate, global_step, decay_step):
"""learning_rate_decay: creates a learning rate decay operation in
tensorflow using inverse time decay:
Args:
alpha: is th... |
from gensim import corpora, models, similarities
import json
import numpy
import random
import csv
import itertools
import gensim, copy
from collections import defaultdict
import glob, os
target_words = {}
attribute_words= {}
weats_name = []
# 1 WEAT Immigrants
target_words["1_a"] = ["immigrant", "migrant"]
target_wo... |
from datetime import datetime
def validate_dt(date):
""" Validate datetime string
:param date: The datetime string
:type date: str
:returns: True if the date is correct datetime string,
False otherwise
:rtype: bool
"""
pattern = '000101000000'
# letters in date
if... |
from dataclasses import dataclass, field
from typing import List
from mitre_attack import INTRUSION_SET
from mitre_attack.data.types.object import Object
@dataclass(frozen=True)
class Group(Object):
type: str = field(default=INTRUSION_SET, init=False)
name: str
aliases: List[str] = field(default_factory=l... |
import asyncio
from typing import TYPE_CHECKING, Optional, Union
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.uix.popup import Popup
from .fee_dialog import FeeDialog
from electrum.util import bh2u
from electrum.logging import Logger
from electrum.lnutil import LOCAL, REMOTE, format_short_... |
# Copyright 2021 NREL
# 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, software
# distri... |
# Note: testcases generated via `python -m cxxheaderparser.gentest`
from cxxheaderparser.types import (
AnonymousName,
Array,
BaseClass,
ClassDecl,
EnumDecl,
Enumerator,
Field,
ForwardDecl,
Function,
FundamentalSpecifier,
Method,
MoveReference,
NameSpecifier,
Ope... |
import json
import os
import click
import pytest
import requests_mock
from click.testing import CliRunner
from git import GitCommandError
from demisto_sdk.__main__ import main
from demisto_sdk.commands.common import tools
from demisto_sdk.commands.common.constants import (PACK_METADATA_DESC,
... |
import webapp2
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
class CountHandler(webapp2.RequestHandler):
def get(self):
for i in range(1, 21):
self.response.write('Hello %d <br>' % i)
app = webapp2.WSGIApplication([
('/', MainHan... |
from importlib.resources import read_text
import pytest
from lark import Token, Tree
from strace_parser.json_transformer import to_json
from strace_parser.parser import get_parser
from . import data
def assert_fully_serialized(obj):
def _assert_fully_serialized(obj):
assert not isinstance(obj, Tree), o... |
import datetime
import threading
import time
try:
from loops.version import __version__
except ImportError:
__version__ = None
class IterThread(threading.Thread):
"""Helper class used in loops."""
def __init__(self, iterator):
super().__init__()
self.daemon = True
self.iterator... |
import irc3
from irc3.plugins.command import command
@irc3.plugin
class Plugin:
def __init__(self, bot):
self.bot = bot
print("yt loaded")
@irc3.event('^(@(?P<tags>\S+) )?:(?P<nick>\S+)(?P<mask>!\S+@\S+) PRIVMSG (?P<channel>\S+) :\.yt\s+(?P<target>.*?)$')
def yt(self, nick=None, mask=None, channel=None,... |
import sys
sys.path.append("C:\\Users\\ysoky\\Documents\\Mesh_Voxel_Color\\_module_\\Mesh_Contour")
import math
import cupy as cp
import random
from PIL import Image, ImageDraw, ImageOps, ImageEnhance
from mesh_contour import stl_parser
sp = stl_parser.StlParser()
from .import util
ut = util.Util()
class ColorP... |
# -*- encoding: utf-8 -*-
# Date: 27/Apr/2020
# Author: Steven Huang, Auckland, NZ
# License: MIT License
"""
Description: Update json file
"""
import json
import datetime
def write_file(file, content):
with open(file, 'w', newline='\n', encoding='utf-8') as f:
f.write(content)
def get_datetime():
... |
from decisionengine_modules.glideinwms.tests.fixtures import ( # noqa: F401
gwms_module_config,
gwms_module_invalid_config,
gwms_src_dir,
)
from decisionengine_modules.glideinwms.UniversalFrontendParams import UniversalFrontendParams
def test_instantiation(gwms_src_dir, gwms_module_config): # noqa: F811... |
import json
import plotly
import pandas as pd
import nltk
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk import pos_tag, word_tokenize
from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize
from flask import Flask
from flask import rend... |
# Copyright 2015 Jared Rodriguez (jared.rodriguez@rackspace.com)
# 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/LICENS... |
import asyncio
import spotify
client = spotify.Client('someid', 'somesecret')
async def main():
# You can use a user with a http presence
user = await client.user_from_token('sometoken')
# Or you can get a generic user
user = await client.get_user(user_id)
# returns a list of spotify.Playlist ob... |
"""
This script makes a dataset of 32x32 approximately whitened CIFAR-10 images.
"""
from pylearn2.utils import serial
from pylearn2.datasets import preprocessing
from pylearn2.utils import string_utils
import numpy as np
from pylearn2.datasets.cifar10 import CIFAR10
data_dir = string_utils.preprocess('${PYLEARN2_DA... |
# 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 ... |
import re
from django import template
from django.template.defaultfilters import stringfilter
from django.utils.encoding import force_text
from ordered_set import OrderedSet
register = template.Library()
@register.filter
def required(field):
"""
Return 'required' as a string if the BoundField's underlying f... |
array_to_analyze = [11,7,3,4,2,5,1,0]
def largestRange(array_to_analyze):
# create a dictionary / hash table to keep track if we've seen the number already
elements = {x:0 for x in array_to_analyze} # set them all to "0"
#how many places have we moved to the left and right
left = 0
right = 0... |
import time
from datetime import datetime
from math import radians, cos, sin, asin, sqrt
import requests
url = "https://www.vaccinespotter.org/api/v0/states/IL.json"
minutes = 1
center = {'lat': 0.0, 'lon': 0.0}
max_distance = 50
found = []
def haversine(lon1, lat1, lon2, lat2):
"""
Calculate the great circ... |
import numpy as np
import pytest
from just_bin_it.histograms.histogram2d import Histogram2d
IRRELEVANT_TOPIC = "some-topic"
class TestHistogram2dFunctionality:
@pytest.fixture(autouse=True)
def prepare(self):
self.pulse_time = 1234
self.num_bins = (5, 10)
self.tof_range = (0, 10)
... |
"""Stuff to parse WAVE files.
Usage.
Reading WAVE files:
f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not necessary.
This ... |
from database.queries.insert_queries import INSERT_MOVIE
from database.queries.update_queries import UPDATE_MOVIE
from database.queries.delete_queries import DELETE_MOVIE
from database.queries.select_queries import SELECT_MOVIES_ORDERED_BY_RATING,\
SELECT_PROJECTION_FOR_MOVIE... |
#!/usr/bin/env python
# cardinal_pythonlib/cmdline.py
"""
===============================================================================
Original code copyright (C) 2009-2021 Rudolf Cardinal (rudolf@pobox.com).
This file is part of cardinal_pythonlib.
Licensed under the Apache License, Version 2.0 (the... |
import re
import pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.cm as mpl_color_map
from tqdm import tqdm
from pathlib import Path
from prettytable import PrettyTable
from scipy.ndimage import gaussian_filter
from sklearn.metrics import roc_curve, precision_recall_curve... |
# Copyright 2020 Google LLC
#
# 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, ... |
import resource
import sys
import time
from threading import Thread
from memory_profiler import memory_usage
import GPUtil
import torch
# _cudart = ctypes.CDLL('libcudart.so')
#
#
# def start_cuda_profile():
# # As shown at http://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__PROFILER.html,
# # the re... |
'''
Created on Nov 7, 2017
@author: Salim
'''
CONF_PARAM_NAME_SERVER_URL = "CONF.NAMESERVER.URL"
CONF_PARAM_NAME_SERVER_PORT = "CONF.NAMESERVER.PORT"
RPC_PROTOCOL = "http://"
LESS_RPC_REQUEST_PING = "/ping"
LESS_RPC_REQUEST_EXECUTE = "/execute"
LESS_RPC_REQUEST_SERVICE = "/service"
LESS_RPC_REQUEST_INFO = "/info"
... |
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under the terms of the GNU Less... |
import argparse
import os
import shutil
import time
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.nn.functional as F
from models import L0WideResNet, TDWideResNet
from dataloaders import cifar10, cifar100
from utils import save_checkpoint, AverageMeter, accuracy
from torch.opti... |
#!/usr/bin/python
#
# Copyright 2018-2022 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 ... |
# IBCarbonscan.py
import sys
from bgenlocations import TOOLBOXDIR, BGENDIR
sys.path.append(BGENDIR)
from scantools import Scanner_OSX
def main():
print "---Scanning IBCarbonRuntime.h---"
input = ["IBCarbonRuntime.h"]
output = "IBCarbongen.py"
defsoutput = TOOLBOXDIR + "IBCarbonRuntime.py"
scanne... |
# -*- coding: utf-8 -*-
"""
fysql.containers
~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by Gasquez Florian
:license: MIT, see LICENSE for more details.
"""
from __future__ import unicode_literals
from functools import wraps
import copy
import hashlib
from .entities import SQLEntity, SQLJoin, SQLCondition, SQLColumn
fro... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... |
"""
@author: mkowalska
"""
import os
from os.path import expanduser
import numpy as np
import matplotlib.pyplot as plt
import datetime
import time
from kcsd import ValidateKCSD, ValidateKCSD1D, SpectralStructure, KCSD1D
__abs_file__ = os.path.abspath(__file__)
home = expanduser('~')
DAY = datetime.datetime.now()
DAY ... |
# PyTorch StudioGAN: https://github.com/POSTECH-CVLab/PyTorch-StudioGAN
# The MIT License (MIT)
# See license file or visit https://github.com/POSTECH-CVLab/PyTorch-StudioGAN for details
# train_eval.py
import numpy as np
import sys
import glob
from scipy import ndimage
from os.path import join
from PIL import Image... |
import argparse
import torch
import torch.nn.functional as F
from torch.nn import Sequential as Seq, Linear as Lin, ReLU, LeakyReLU
from torch_geometric.nn import DynamicEdgeConv, global_max_pool
from datasets import get_dataset
from train_eval import run
parser = argparse.ArgumentParser()
parser.add_argument('--epoc... |
from torch2trt.torch2trt import *
from torch2trt.plugins import *
@tensorrt_converter('torch.nn.functional.grid_sample')
def convert_grid_sample(ctx):
input = ctx.method_args[0]
grid = get_arg(ctx, 'grid', pos=1, default=None)
mode = get_arg(ctx, 'mode', pos=2, default='bilinear')
padding_mode = get_a... |
pkgname = "lynx"
pkgver = "2.9.0_pre10"
_uver = "2.9.0dev.10"
pkgrel = 0
build_style = "gnu_configure"
configure_args = [
"--enable-widec", "--enable-ipv6", "--with-zlib", "--with-bzlib",
"--with-ssl"
]
hostmakedepends = ["pkgconf"]
makedepends = [
"zlib-devel", "libbz2-devel", "ncurses-devel", "openssl-dev... |
# -*- coding: utf-8 -*-
#
# Dynamo documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 5 10:40:30 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... |
# Generated by Django 3.0.7 on 2020-07-18 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('scanEngine', '0005_auto_20200718_0407'),
]
operations = [
migrations.AlterField(
model_name='wordlist',
name='path',... |
#!/usr/bin/python
import sys
import subprocess
printers = []
def getPrinters():
global printers
if not sys.platform == "linux2":
return ['default']
if len(printers) > 0: return printers
try:
process = subprocess.Popen(["lpstat", "-a"], stdout=subprocess.PIPE)
result = process.communicate()[0].strip()
# KO... |
import aiohttp
import rapidjson as json
import socket
from config import Config
from typing import List, Tuple
class RPCClient(object):
_instance = None
def __init__(self):
raise RuntimeError('Call instance() instead')
@classmethod
def instance(cls) -> 'RPCClient':
if cls._instance is... |
# Copyright (C) 2017 Nippon Telegraph and Telephone Corporation.
#
# 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 pytest
from my_python_algorithms.data_structures.linked_list import LinkedList, Node
def test_node():
n = Node(1)
assert 1 == n.value
assert None is n.next
def test_empty_ll():
ll = LinkedList()
assert None is ll.head
def test_ll_with_head():
ll = LinkedList(1)
assert 1 == ll.he... |
"""Tracking for bluetooth devices."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import track_point_in_utc_time
from homeassistant.components.device_tracker import (
YAML_DEVICES, CONF_TRACK_NEW, CONF_SCAN_INTERVAL, DEFAULT_SCAN_IN... |
"""
python-social-auth application, allows OpenId or OAuth user
registration/authentication just adding a few configurations.
"""
version = (0, 1, 13)
extra = ''
__version__ = '.'.join(map(str, version)) + extra |
n, m, l = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
b = [list(map(int, input().split())) for i in range(m)]
C = [[0]*l for _ in range(n)]
for i in range(n):
for j in range(l):
for k in range(m):
C[i][j] += a[i][k] * b[k][j]
for line in C:
print(*li... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.