text stringlengths 2 999k |
|---|
"""Support for binary sensors through the SmartThings cloud API."""
from __future__ import annotations
from collections.abc import Sequence
from pysmartthings import Attribute, Capability
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_MOISTURE,
DEVICE_CLASS_MOTION,
DEVICE_CLASS_MOVING,... |
import asyncio
import logging
import traceback
from asyncio import Task
from collections import defaultdict
from time import time
from typing import Dict, List, Tuple, Optional
from pydantic import ValidationError
from tracardi.domain.event import Event, INVALID
from tracardi.service.wf.domain.debug_info import DebugI... |
import os
import operator
from time import time
from MapReduce import MapReduce
from MultiprocessHelper import file_to_words, count_words
def main():
print("Reading files...")
input_files = os.listdir('Data')
START_TIME = time()
mapper = MapReduce(file_to_words, count_words)
word_counts, MAPP... |
#!/usr/bin/env python
# Info module template
#############################################
# WARNING #
#############################################
#
# This file is auto generated by
# https://github.com/jgroom33/vmware_rest_code_generator
#
# Do not edit this file manually.
#
# Ch... |
import logging
from dataclasses import dataclass
from pathlib import Path
from typing import List
from blspy import G1Element
from cactus.types.blockchain_format.sized_bytes import bytes32
from cactus.util.byte_types import hexstr_to_bytes
from cactus.util.config import load_config, save_config
from cactus.util.strea... |
# -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""
Tests for editor.py
"""
# Standard library imports
import os
from sys import platform
try:
from unittest.mock import Mock, MagicMock
except ImportError:
from mock import Mock, MagicMock # P... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
import os
import numpy as np
base = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'C', 512, 512, 512, 'M', 512, 512, 512]
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The net... |
from math import exp
from random import random
from sklearn.model_selection import train_test_split
from sklearn import metrics
import numpy as np
import librosa
import tensorflow as tf
import torch
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
##
# Part of `SmartNodeMonitorBot`
#
# Copyright 2018 dustinface
#
# 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,... |
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... |
"""The tests for the Demo cover platform."""
from datetime import timedelta
import pytest
from openpeerpower.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
DOMAIN,
)
from openpeerpower.const import (
ATTR_ENTITY_ID,
ATTR_SUPP... |
from flask import Flask
from random import randint
app = Flask(__name__)
def make_bold(func):
def bold():
return "<b>"+func()+"</b>"
return bold
def make_emphasis(func):
def emphasize():
return "<em>"+func()+"</em>"
return emphasize
def make_underline(func):
def underline():
... |
# MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# 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, ... |
import nose
import unittest
import datetime
import numpy as np
from pandas import compat
from pandas.compat import u
from pandas import (Series, DataFrame, Panel, MultiIndex, bdate_range,
date_range, period_range, Index, SparseSeries, SparseDataFrame,
SparsePanel)
import pandas... |
# -*- coding: utf-8 -*-
import json ,rsa
from ..LineThrift import TalkService
from ..LineThrift import MessageService
from ..LineThrift.ttypes import *
from .LineServer import url
from thrift.transport import THttpClient
from thrift.protocol import TCompactProtocol
from .LineTransport import LineTranspo... |
# -*- coding: utf-8 -*-
# Copyright (2017-2018) Hewlett Packard Enterprise Development LP
#
# 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
#
# U... |
from sklearn.metrics import auc
import numpy as np
from sklearn.metrics import precision_recall_curve
import sklearn.metrics as metrics
import sys
the_list=['0','1','2','3','4']
y_long=np.zeros(0)
pred_long=np.zeros(0)
for the_id in the_list:
y=np.genfromtxt((sys.argv[1]+'.'+the_id),delimiter='\t')[:,1]
pred=n... |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class RazorpayLog(Document):
pass
|
__author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import subDict, dictCombinations
import pylab
def plotVariations(datalist, titles, genFun, varyperplot=None, prePlotFun=None, postPlotFun=None,
_differentiator=0.0, **optionlists):
""" A tool for quickly generating a lot of variat... |
def interpolate(start: 'Vector3', end: 'Vector3', t: float):
'''Interpolate between start and end with 0 <= t <= 1.'''
slope = end - start
return slope * t + start |
import os
from pathlib import Path
import tempfile
import pytest
import yaml
from blueoil.cmd.convert import convert
from blueoil.cmd.predict import predict
from blueoil.cmd.train import train
from lmnet import environment
@pytest.fixture
def init_env():
"""Initialize blueoil environment"""
blueoil_dir = st... |
"""
The `Information eXtraction from Images (IXI)`_
dataset contains "nearly 600 MR images from normal, healthy subjects",
including "T1, T2 and PD-weighted images,
MRA images and Diffusion-weighted images (15 directions)".
.. note ::
This data is made available under the
Creative Commons CC BY-SA 3.0 license... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... |
from solutions.a0139wordbreak import Solution
solution = Solution()
def test_wordBreak1():
s = "leetcode"
wordDict = ["leet", "code"]
actual = solution.wordBreak(s, wordDict)
assert actual
def test_wordBreak2():
s = "applepenapple"
wordDict = ["apple", "pen"]
actual = solution.wordBreak(s, wordDict)
... |
# Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... |
#
# PyGUI - Tasks - Gtk
#
import gobject
from GUI import export
from GUI.GTasks import Task as GTask
class Task(GTask):
def __init__(self, proc, interval, repeat = 0, start = 1):
self._proc = proc
self._gtk_interval = int(interval * 1000)
self._repeat = repeat
self._gtk_timeout_id = None
if start:
se... |
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1 # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7
def debug(*x):
print(*x, file=sys.stderr)
def solve0(N, AS):
ret = 0
for i in range(N):
for j in range(i + 1, N):
if AS[i] * AS[j] % 1000000000_000000000 =... |
pkgname = "accountsservice"
pkgver = "22.08.8"
pkgrel = 0
build_style = "meson"
configure_args = [
"-Dsystemdsystemunitdir=no", "-Dintrospection=true", "-Delogind=true",
]
hostmakedepends = [
"meson", "pkgconf", "gobject-introspection", "glib-devel", "polkit",
"gettext-tiny", "vala",
]
makedepends = ["polki... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 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 running globaltokend with the -rpcbind and -rpcallowip options."""
import socket
import sys
from... |
"""Unit test package for {{ cookiecutter.project_slug }}."""
|
#!/usr/bin/env python
'''
Author: Shohei Kojima @ RIKEN
Copyright (c) 2020 RIKEN
All Rights Reserved
See file LICENSE for details.
'''
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension('extract_discordant_c', ['extract_discordan... |
"""
Executors are classes that deterministically transform programs in domain specific languages
into denotations. We have one executor defined for each language-domain pair that we handle.
"""
from allennlp.semparse.executors.sql_executor import SqlExecutor
|
# Modified by CogDL Team
#
# DeepSpeed note, code taken from commit 3d59216cec89a363649b4fe3d15295ba936ced0f
# https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/LanguageModeling/BERT/modeling.py
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyrig... |
import sys
'''
Simple function that generates resutls using the following logic. Computes the
sum of stone differences for n possible combinations of a and b differences.
Take extra care for the fact that same differences obtained should not be returned
twice, so we put them in a set and returned the ... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
no_cache = 1
base_template_path = "templates/www/app.html"
import os, re
import frappe
from frappe import _
import frappe.sessions
def get_context(context):
# ... |
# Copyright (c) 2017-2021, Lawrence Livermore National Security, LLC and
# other Shroud Project Developers.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
# #######################################################################
#
# Test Python API generated from vectors.yam... |
VTABLE(_Main) {
<empty>
Main
}
VTABLE(_Base) {
<empty>
Base
}
VTABLE(_Sub1) {
_Base
Sub1
}
VTABLE(_Sub2) {
_Base
Sub2
}
VTABLE(_Sub3) {
_Sub1
Sub3
}
VTABLE(_Sub4) {
_Sub3
Sub4
}
FUNCTION(_Main_New) {
memo ''
_Main_New:
_T7 = 4
parm _T7
_T8 = call _Alloc... |
import textwrap
from typing import List
import cli_ui as ui
from path import Path
import tbump.git
def find_files(working_path: Path, current_version: str) -> List[str]:
ui.info_2("Looking for files matching", ui.bold, current_version)
cmd = ["grep", "--fixed-strings", "--files-with-matches", current_versio... |
from datetime import timedelta, datetime, timezone
from suzieq.poller.services.service import Service
from suzieq.utils import get_timestamp_from_junos_time
from dateparser import parse
from datetime import datetime
class DeviceService(Service):
"""Checks the uptime and OS/version of the node.
This is specia... |
"""
This module contains classes for representing RanklistRow object
For further information visit http://codeforces.com/api/help/objects#RanklistRow
"""
from . import BaseJsonObject, Party, ProblemResult
from codeforces.utils import lazy_property
__all__ = ['RanklistRow']
class RanklistRow(BaseJsonObject):
"... |
import sys,math,io,os,time,itertools,collections
mod=10**9+7
sys.setrecursionlimit(10000)
i=sys.stdin.readline
p=sys.stdout.write
#use sys.stdout.write() (remember to convert to str b4 and concatenate "\n")
global start,end
#binary search
def isin(l,x):
left=0
right=len(l)-1
if x<l[0]:
... |
from __future__ import absolute_import, division, print_function
import os
import pprint
from os.path import isdir, join, dirname, isfile
# importing setuptools patches distutils so that it knows how to find VC for python 2.7
import setuptools # noqa
# Leverage the hard work done by setuptools/distutils to find vcva... |
#!/usr/bin/env python3
# Copyright (c) 2017 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 calls related to net.
Tests correspond to code in rpc/net.cpp.
"""
from test_framework.test_frame... |
import json
import random
import re
import time
from base64 import b64decode
from concurrent.futures import ThreadPoolExecutor, as_completed
import requests
import typing
from PyRoxy import ProxyType, Proxy
import logging
logging.basicConfig(format='[%(asctime)s - %(levelname)s] %(message)s', datefmt="%H:%M:%S")
log... |
from pygame import *
"""
This module contains utility functions for drawing certain shapes that are difficult to achieve with the regular pygame
drawing API.
"""
def aa_filled_rounded_rect(surface,rect,color,radius=0.4):
"""
AAfilledRoundedRect(surface,rect,color,radius=0.4)
http://pygame.org/project-AAf... |
from flask import Flask, current_app, request, jsonify
import io
import model
import base64
import logging
app = Flask(__name__)
@app.route('/', methods=['POST'])
def predict():
data = {}
try:
data = request.get_json()['data']
except Exception:
return jsonify(status_code='400', msg='Bad Req... |
"""
sphinx.transforms.references
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Docutils transforms used by Sphinx.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from typing import Any, Dict
from docutils import nodes
from docutils.transforms.referenc... |
from cereal import car
from common.conversions import Conversions as CV
from common.realtime import DT_CTRL
from common.numpy_fast import interp, clip
from opendbc.can.packer import CANPacker
from selfdrive.car import apply_std_steer_torque_limits, create_gas_interceptor_command
from selfdrive.car.gm import gmcan
from ... |
import pandas as pd
from tabulate import tabulate
class ModelValue:
'''
Model Value class contain model name and some values for during training time.
'''
def __init__(self, model_name: str, values: dict):
self.model_name = model_name
self.values = values
def set_value(self, name, ... |
###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyri... |
import keras
from keras.datasets import cifar10
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
from pathlib import Path
# Load data set
(x_train, y_train), (x_test, y_test) = cifar10.load_data()
# Normalize data set to 0-to-1 range
x_train = x_train.astype("... |
#! /usr/bin/env python
from tollan.utils.log import get_logger, logit, timeit
import sqlalchemy as sa
import sqlalchemy.sql.expression as se
from sqlalchemy.ext.automap import automap_base
from tollan.utils import odict_from_list
from tollan.utils.fmt import pformat_dict
from tollan.utils.db import conventions as c
fr... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class PointInstruction(object):
def __init__(self):
self._action_type = None
self._point_amount = None
self._reason = None
self._status = None
self._task_name = ... |
import numpy as np
import torch
from torch.autograd import Variable
from .get_nets import PNet, RNet, ONet
from .box_utils import nms, calibrate_box, get_image_boxes, convert_to_square
from .first_stage import run_first_stage
def detect_faces(image, min_face_size=20.0,
thresholds=[0.6, 0.7, ... |
import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplotlib.patches import FancyBboxPatch
# Bbox object around which the fancy box will be drawn.
bb = mtransforms.Bbox([[0.3, 0.4], [0.7, 0.6]])
def draw_bbox(ax, bb):
# boxstyle=square with pad=0, i.e. bbox itself.
p_bbox = Fa... |
import json
from commons import get_model, get_tensor
with open('Classes_clean.json') as f:
class_to_name = json.load(f)
# with open('class_to_idx.json') as f:
# class_to_idx = json.load(f)
idx_to_class = {v:k for k, v in class_to_name.items()}
model = get_model()
def get_fruit_name(image_bytes):
tensor =... |
_base_ = './reppoints_moment_r50_fpn_1x_toulouse.py'
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
model = dict(neck=dict(norm_cfg=norm_cfg), bbox_head=dict(norm_cfg=norm_cfg))
optimizer = dict(lr=0.01)
|
import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if 'ckeditor' in settings.INSTALLED_APPS:
# Confirm CKEDITOR_UPLOAD_PATH setting has been specified.
try:
settings.CKEDITOR_UPLOAD_PATH
except AttributeError:
raise ImproperlyConfigured("djan... |
from ctypes.wintypes import BOOL, ULONG
import ctypes
ENABLED = BOOL()
RESPONSE = ULONG()
OPTION_SHUTDOWN = 6
SHUTDOWN_PRIVILEGE = 19
STATUS_NOT_IMPLEMENTED = 0xC0000002
class Bluescreen:
def __init__(self):
self.ntdll = ctypes.WinDLL('ntdll.dll')
self._NtRaiseHardError = self.ntdl... |
from naming import name_to_go
class Primitive:
pass
class String(Primitive):
def __str__(self):
return "string"
class Int(Primitive):
def __str__(self):
return "int"
class Float(Primitive):
def __str__(self):
return "float64"
class Boolean(Primitive):
def __str__(self):
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import os.path as path
import subprocess
import sys
import owlpy.defaults as owl_defaults
import owlpy.formula as owl_formula
import owlpy.tool as owl_tool
def _test(args):
if len(args) > 2:
print("Usage: util.py test <test names> <dataset>?")
... |
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# table rest api serializers
from rest_framework import serializers
from django.contrib.auth import get_user_model
from ...product.models import ProductAttribute as Table
User = get_user_model()
class TableListSerializer(serializers.ModelSerializer):
list_url = serializers.HyperlinkedIdentityField(view_name='sal... |
#!/usr/bin/env python
# Copyright 2018 CERN for the benefit of the ATLAS collaboration.
#
# 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
#
# U... |
# -*- coding: utf-8 -*-
"""
mslib.retriever
~~~~~~~~~~~~~~~~~~~~
automation within mss to create for instance a number of the same plots
for several flights or several forecast steps
This file is part of mss.
:copyright: Copyright 2020 Joern Ungermann
:license: APACHE-2.0, see LICENSE fo... |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
import os
import pytest
from gimmemotifs.stats import calc_stats
from gimmemotifs.motif import read_motifs
from gimmemotifs import rocmetrics
data_dir = "test/data/stats"
genome = "test/data/background/genome.fa"
motifs = os.path.join(data_dir, "motifs.pwm")
fg_fa = os.path.join(data_dir, "p73.fa")
bg_fa = os.path.... |
# -*- coding: utf-8 -*- #
# Copyright 2017 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 requir... |
from aiodataloader import DataLoader
from SdTypes import DecisionTypes
from models import DecisionPoint
from typing import List, Union
class DecisionPointLoader(DataLoader):
"""
This is class for loading decision points and
caching the result in the request context
Attributes:
... |
#!/usr/bin/env python
'''
Handle environment.
'''
from __future__ import print_function
#from __future__ import absolute_import
#from future import standard_library
#standard_library.install_aliases()
#from builtins import object
import os
import re
import subprocess
from glob import glob
from .util import log
guess... |
# -*- coding: utf-8 -*-
__author__ = 'Lara Olmos Camarena'
import re
import nltk.data
from nltk.tokenize import word_tokenize
from nltk.stem import SnowballStemmer
from settings import SPANISH_STOPWORDS
# Segment text in phrases or words
class TextTokenizer():
def sentences(self, input_text):
spanish_tokeniz... |
import os
import sys
import ast
import json
import luigi
import pprint
import datetime
import numpy as np
from tqdm import tqdm
import ray
from ray import tune
from ray.tune.registry import register_env
import ray.rllib.agents.dqn as dqn
from sklearn.model_selection import train_test_split
from ray.rllib.offline.json... |
### Writing a script to train a model
from azureml.core import Run
import pandas as pd
import numpy as np
import joblib
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
# Get the experiment run context
run = Run.get_context()
# Prepare the dataset
diabetes = pd... |
"""
Testing numba implementation of the numba dictionary.
The tests here only check that the numba typing and codegen are working
correctly. Detailed testing of the underlying dictionary operations is done
in test_dictimpl.py.
"""
from __future__ import print_function, absolute_import, division
import sys
import war... |
#!/usr/bin/env python3
# Copyright (c) 2017 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 the -uacomment option."""
from test_framework.test_framework import RapidsTestFramework
from test_fram... |
#!/usr/bin/env python
import utils
import dsa
import paillier
import hashlib
def gen_params(bits):
while True:
ptildprim = utils.randomnumber(pow(2,bits>>1))
qtildprim = utils.randomnumber(pow(2,bits>>1))
ptild = (2 * ptildprim + 1)
qtild = (qtildprim + 1)
if utils.is_prime(... |
# 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... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2022/1/23 9:47 下午
# @Author : xinming
# @File : increase_triplet.py
from typing import List
class Solution:
def increasingTriplet(self, nums: List[int]) -> bool:
if len(nums)<3:
return False
first, second = nums[0], max(nums... |
from jacowvalidator.docutils.styles import check_style
TITLE_DETAILS = {
'styles': {
'jacow': 'JACoW_Paper Title',
'normal': 'Paper Title',
},
'alignment': 'CENTER',
'font_size': 14.0,
'space_before': 0.0,
'space_after': 3.0,
'bold': True,
'italic': None,
}
def extrac... |
import cffi
ffi = cffi.FFI()
ffi.cdef("const int mysize;")
lib = ffi.verify("const int mysize = sizeof(long long int);")
print(lib.mysize)
|
"""
.. module: lemur
:platform: Unix
:copyright: (c) 2015 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson <kglisson@netflix.com>
"""
from lemur import factory
from lemur.users.views import mod as users_bp
from lemur.roles.views import... |
from datetime import datetime, timedelta
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.models import Variable
import sys
import subprocess
import zlib
sys.path.insert(0, '/home/curw/git/DSS-Framework/local_dss_workflow/plugins/operators')
from gfs_sensor import GfsSe... |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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, p... |
# Generated by Django 3.1.5 on 2021-02-21 18:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('team', '0003_auto_202102... |
# customize string representations of objects
class Person():
def __init__(self):
self.fname = "Joe"
self.lname = "Marini"
self.age = 25
# TODO: use __repr__ to create a string useful for debugging
# TODO: use str for a more human-readable string
def main():
# create a new ... |
load(":private/set.bzl", "set")
def generate_version_macros(ctx, pkg_name, version):
"""Generate a version macros header file.
Args:
ctx: Rule context. Needs to define a _version_macros executable attribute.
pkg_name: The package name.
version: The package version.
Returns:
... |
import argparse
import builtins
import os
import pickle
import random
import shutil
import subprocess
import warnings
from pathlib import Path
from typing import Any, Dict, List, Optional
import h5py
import numpy as np
import timm
import torch
import torch.backends.cudnn as cudnn
import torch.distributed as dist
impor... |
""" Factory methods to build Data objects from files
Implementation notes:
Each factory method conforms to the folowing structure, which
helps the GUI Frontend easily load data:
1) The first argument is a file name to open
2) The return value is a Data object
3) The function has a .label attribute that describes (... |
import pandas as pd
import csv
hour_filename = 'LPPH.csv'
person_filename = 'LPPP.csv'
source_filename = 'Data.csv'
def merge_csv(file1, file2, file3):
dfH = pd.read_csv(file1, sep=",", header=0)
dfP = pd.read_csv(file2, sep=",", header=0)
dfS = pd.read_csv(file3, sep=",", header=0)
dfS_Lpph_unit = df... |
#
# This file is part of pyasn1-modules software.
#
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
# SNMPv2c message syntax
#
# ASN.1 source from:
# http://www.ietf.org/rfc/rfc1901.txt
#
from pyasn1.type import namedtype
from pyasn1.type impo... |
'''
Driving-v0 environment. Target with no obstacles.
'''
# OpenAI gym library imports
import gym
# External libraries
import pybullet as p
import numpy as np
# Local resources
from smartbots.enviroments.driving_env import DrivingEnv
import smartbots.assets._car as car
from smartbots.assets._cube import Cube
class Dr... |
# Copyright 2020 Curtin University
#
# 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 writi... |
#! usr/bin/python3
# -*- coding: utf-8 -*-
"""
Enjoy your glitch life!!
Replace: 任意の箇所のバイト列と 同サイズの任意のバイト列を入れ換える
Increase: 任意の箇所のバイト列と それより大きなサイズの任意のバイト列と入れ換える
Decrease: 任意の箇所のバイト列を 削除する
Swap: 任意の箇所のバイト列と 他の任意の箇所のバイト列を入れ換える
Changiling: 任意のバイト文字を 他の任意のバイト文字に置き換える
Usage:
glitch [-h] -i=<input> [-o=<output>] [-n=<times... |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 8 15:20:20 2018
@author: joshcole
"""
import matplotlib.pyplot as plt
import F1_import as f1
askcredloan_credhistnum = f1.loan_data['Credit_History_Num'] #see AskCreditLoans_Regression Analysis for more info
askcredloan_lnstatnum = f1.loan_data['Loan_Status_... |
import copy
import os
import pickle
import time
import urllib
import warnings
import matplotlib.pyplot as plt
import numpy as np
# import pretrainedmodels
from astropy.io import fits
# from PIL import Image
from skimage.transform import rescale, resize
# from sklearn.metrics import f1_score
# from sklearn.utils impor... |
from .tacos import TACoSDataset
from .activitynet import ActivityNetDataset
from .didemo import DidemoDataset
__all__ = [
"TACoSDataset",
"ActivityNetDataset",
"DidemoDataset"
]
|
###########################
#
# #14 Longest Collatz sequence - Project Euler
# https://projecteuler.net/problem=14
#
# Code by Kevin Marciniak
#
###########################
limit = 1_000_000
longest_count = 0
longest_collatz = 0
for i in range(1, limit):
temp = i
count = 0
while temp != 1:
if tem... |
def main():
# input
X, Y = map(int, input().split())
# compute
# output
if min(X,Y)+3 > max(X,Y):
print('Yes')
else:
print('No')
if __name__ == '__main__':
main()
|
import mock
import pytest
import requests_mock
from notifications_python_client.base import BaseAPIClient
from notifications_python_client.notifications import NotificationsAPIClient
TEST_HOST = 'http://test-host'
SERVICE_ID = 'c745a8d8-b48a-4b0d-96e5-dbea0165ebd1'
API_KEY_ID = '8b3aa916-ec82-434e-b0c5-d5d9b371d6a3'
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.