text stringlengths 1 927k |
|---|
# Copyright (c) 2013 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 applica... |
from analizer.abstract import instruction
from analizer.reports import Nodo
from analizer.typechecker.Metadata import File
from analizer.typechecker.Metadata import Struct
class CreateIndex(instruction.Instruction):
def __init__(self, unique, idIndex, idTable, usingMethod, whereCl, optList=[]):
self.uniqu... |
#!/usr/bin/env python2
from stripstream.fts.constraint import Eq, ConType, Unconstrained
from stripstream.fts.variable import VarType, Par, Var, X, U, nX
from stripstream.fts.clause import Clause
from stripstream.fts.sampler import Sampler
from stripstream.fts.problem import FTSProblem
from stripstream.fts.stripstream... |
#
# Copyright 2015 Tickle Labs, 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 agreed to in w... |
#!/usr/bin/env python3
import argparse
import configparser
import copy
import logging
import os
import stat
import sys
import lib.fsm_config as fsm_config
import lib.tags as tag
import lib.iface as tap
import lib.flows as flow
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logger = logging.getLog... |
from swift.ipvl.inspect_custom import whoami, whosdaddy
pass # (WIS) print __name__
class StaticLargeObject(object):
"""docstring for StaticLargeObject"""
def __init__(self, app, conf):
pass # (WIS) print "%s %s (%s -> %s)" % (__name__, self.__class__.__name__, whosdaddy(), whoami())
self.... |
# 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.
#
# Port From UniBorg to UserBot by MoveAngel
import random
import requests
from asyncio.exceptions import TimeoutError
... |
# vim:fileencoding=utf-8:ts=2:sw=2:expandtab
import json
import mimetypes
import traceback
from datetime import datetime, timezone, timedelta
from collections import OrderedDict
from AppStruct.Util import aadict
from AppStruct.Security import RandomHex
from ..Base import GetSession, S3, SQS
from . import AWS
class... |
# coding=utf-8
# Copyright 2019 The Tensor2Tensor 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 required by applicable... |
# -*- coding: utf-8 -*-
# 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... |
#!/usr/bin/env python3
import copy
import io
import json
import os.path
import pycurl
import urllib.parse
from blindbackup.util import localpath
def create_client(settings):
certfile = localpath(settings, "ssl_certfile", None)
return Client(
settings["server_url"], certfile,
settings["login"]... |
from armulator.armv6.opcodes.abstract_opcode import AbstractOpcode
class AndImmediate(AbstractOpcode):
def __init__(self, setflags, d, n, imm32, carry):
super(AndImmediate, self).__init__()
self.setflags = setflags
self.d = d
self.n = n
self.imm32 = imm32
self.carry... |
#!/usr/bin/python
"""
(C) Copyright 2020-2022 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import time
from ior_test_base import IorTestBase
from general_utils import human_to_bytes
class DaosAggregationIOSmall(IorTestBase):
# pylint: disable=too-many-ancestors,too-few-public-methods
... |
import copy
import json
import random
import hashlib
import numpy as np
class IntrinsicParameters():
""" Global parameter values for the algorithm """
def __init__(self):
#: if True, print progress to the console
self.logging = False
#: if True, use a fixed seed for k-means clusteri... |
# Copyright 2015 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 -*-
"""
LemonSoap - impute scent.
Determines which columns have potentially sequential data, and if so offers to
estimate values.
* Missing completely at random (MCAR)
* Missing at random (MAR)
* Not missing at random (NMAR)
1. If numerical:
1. If constant, then fill in with same values.
... |
"""
Afterglow Core: imaging survey data provider plugin
"""
from typing import List as TList, Optional, Tuple, Union
from io import BytesIO
from threading import Lock
from astropy import units as u
from astropy.coordinates import Angle
from astroquery.skyview import SkyView
from ...models import DataProvider, DataP... |
import h5py
import math
import nibabel as nib
import numpy as np
from medpy import metric
import torch
import torch.nn.functional as F
from tqdm import tqdm
from skimage.measure import label
def getLargestCC(segmentation):
labels = label(segmentation)
assert(labels.max() != 0) # assume at least 1 CC
larg... |
# Copyright 2017 The Chromium Authors.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd.
"""Command line interface to Chromium Code Search.
Currently emits JSON formatted responses from the Chromium Cod... |
#%%
import json
with open("meditations.json", "r") as read_file:
data = json.load(read_file)
#%%
book_names = [
"Book I",
"Book II",
"Book III",
"Book IV",
"Book V",
"Book VI",
"Book VII",
"Book VIII",
"Book IX",
"Book X",
"Book XI",
"Book XII",
]
result = []
... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2018-11
import base64
import json
import logging
import time
from collections import namedtuple
from enum import Enum
from functools import partial
from typing import List, Union, Callable
import ipaddress
from PyQt5 import QtWidgets, Q... |
'''
Copyright 2018 Riverstone Software, 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... |
from opentuner.resultsdb.models import *
class DriverBase(object):
"""
shared base class between MeasurementDriver and SearchDriver
"""
def __init__(self,
session,
tuning_run,
objective,
tuning_run_main,
args,
**kwargs)... |
import sys
if sys.version_info < (3, 7):
from ._showscale import ShowscaleValidator
from ._reversescale import ReversescaleValidator
from ._pattern import PatternValidator
from ._opacitysrc import OpacitysrcValidator
from ._opacity import OpacityValidator
from ._line import LineValidator
fr... |
import sqlite3
import click
from flask import current_app, g
from flask.cli import with_appcontext
def get_db():
if 'db' not in g:
g.db = sqlite3.connect(
current_app.config['DATABASE'],
detect_types=sqlite3.PARSE_DECLTYPES
)
g.db.row_factory = sqlite3.Row
retu... |
import torch
import torch.nn as nn
import torchvision.models.detection.backbone_utils as backbone_utils
import torchvision.models._utils as _utils
import torch.nn.functional as F
from collections import OrderedDict
from retina_models.net import MobileNetV1 as MobileNetV1
from retina_models.net import FPN as FPN
from r... |
from torch import nn
from .base_models import BaseEncoderMaskerDecoder
from asteroid_filterbanks import make_enc_dec
from asteroid_filterbanks.transforms import mag, magreim
from ..masknn import norms, activations
from ..utils.torch_utils import pad_x_to_y
import warnings
class DeMask(BaseEncoderMaskerDecoder):
"... |
import ipaddress
import uuid
import weakref
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from enum import Enum
from pathlib import Path
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Callable,
ClassVar,
Dict,
List,
Mapping,
Optional,
Seq... |
from pathlib import Path
from random import shuffle
from discord import VoiceChannel
from music.abstract_music_player import AbstractMusicPlayer
from music.entry import Entry
class FilePlayer(AbstractMusicPlayer):
"""
Audio player for playing local files.
"""
__slots__ = ('default_path',)
def _... |
# Copyright 2018 REMME
#
# 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... |
import abc
import copy
import os
import tempfile
from abc import abstractmethod
from threading import Lock
import click
import six
import yaml
from tqdm import tqdm
from cli.config import Config
from cli.internal.commands.command import Command
from cli.internal.models.apk import Apk
from cli.internal.models.artifact... |
import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... |
# Union-findを使う
# 論文検索には(Disjoint Set)
from scipy.special import comb
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
a0, b0 = [int(i) for i in input().split()]
a.append(a0)
b.append(b0)
a.append(b)
l = len(a)
cmb = comb(m, 2, exact=True)
base = int(cmb / 2) + 1
for _ in range(m):
... |
import unittest
from pathlib import Path
import mock
import requests_mock
def check_upload_to_aws_s3(csv_path, s3_bucket):
assert isinstance(csv_path, Path)
return True
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
import os
os.makedirs("test", exist_ok=True)
os... |
from PIL import Image
import glob
import os.path
import re
import json
def get_frame(path):
return int(path.rpartition('.')[0].rpartition('\\')[2])
for character in glob.glob('.\\raw\\*'):
character_name = character.rpartition('\\')[2]
for move in glob.glob(character + '\\*'):
move_name = move.rpartition('\\')... |
# baseline: constant 0
# local score 4.668
# kaggle score 4.69
import sys # pylint: disable=unused-import
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from time import time
import os
is_kaggle = os.environ['HOME'] == '/tmp'
zipext = '' if is_kaggle else '.zip'
# load data
... |
"""
Useful scientific constants defined as iris cubes
Uses constants defined by metpy.constansts
"""
from scipy import constants
from metpy import constants as mpconst
from iris.cube import Cube
# Ratio of radians to degrees
radians_per_degree = Cube(constants.degree, units='radians degrees-1')
# Import all const... |
from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
# https://zhuanlan.zhihu.com/p/109933924
def dfm_criteo(dense, sparse, labels):
batch_size = 128
feature_dimensio... |
import numpy as np
class RepeatedUpdateQLearningAlgorithm():
'''
Repeated Update Q Learning (RUQL) as introduced in:
"Addressing the Policy Bias of Q-Learning by Repeating Updates" - Sherief Abdallah, Michael Kaisers
'''
def __init__(self, state_space_size, action_space_size, hashing_function, dis... |
import torch
import librosa
import numpy as np
import torch.nn.functional as F
from hparams import hparams as hps
from utils.util import to_arr, mode
class Loss(torch.nn.Module):
def __init__(self):
super(Loss, self).__init__()
self.d = 2*hps.sigma*hps.sigma
self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, h... |
from functools import reduce
import keyfunctions.globals as consts
def create_key(values, depth):
"""
This function returns a Z-order key for any number of dimensions.
:param values: a list of floats - one of dimension - each of them with value between 0 and 1 [0,1)
:param depth: an strictly positi... |
# Copyright (c) 2015, 2016 Gregory K. Ngirmang
# All rights reserved.
#
# Copyright (C) Pauli Virtanen, 2010.
# All rights reserved.
#
# Copyright (c) 2001, 2002 Enthought, Inc.
# All rights reserved.
#
# Copyright (c) 2003-2012 SciPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary f... |
import enum
import logging
import random
import socket
import struct
import subprocess
import sys
import threading
import time
from brainflow_emulator.emulate_common import TestFailureError, log_multilines
class State(enum.Enum):
wait = 'wait'
stream = 'stream'
class Message(enum.Enum):
start_stream = ... |
from urllib.request import urlopen
import json
url = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-json-pokedex/master/output/pokemon.json"
response = urlopen(url)
final_data = []
json_data = json.loads(response.read())
for p in json_data:
final_data.append({
'dex': p['dex'],
... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import threading
import re
import uuid
import tenacity
from past.builtins import xrange
from tenacity import (after_log, retry_if_exception,
stop_after_attempt, ... |
import numpy as np
from sklearn import svm
def train_boundary(pos_codes, neg_codes, split_ratio=0.7):
pos_ids = np.arange(len(pos_codes))
np.random.shuffle(pos_ids)
train_pos_num = int(len(pos_ids) * split_ratio)
train_pos_codes = pos_codes[pos_ids[:train_pos_num]]
val_pos_codes = pos_codes[pos_id... |
#Mehmet Salih Çelik 170401073
import socket
import datetime
import os
import time
import sys
ipiste=str(input("Sunucunun ip adresini giriniz :"))
HOST = ipiste
PORT = 142
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
a=time.time()
data = s.recv(1024)
b=time.time... |
from .client import Client # noqa
from .params import Params, ListSymbolsFormat # noqa
from .jsonrpc_client import MsgpackRpcClient # noqa
from .grpc_client import GRPCClient # noqa
# alias
Param = Params # noqa
from .stream import StreamConn # noqa
__version__ = '0.18' |
# Copyright (c) 2018, Xilinx, Inc.
# All rights reserved.
#
# 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 ... |
"""Support for Pocket Casts."""
from datetime import timedelta
import logging
from pycketcasts import pocketcasts
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validati... |
from utils.misc import read_hdf5
from utils.misc import extract_deps_from_weights_file
import sys
import numpy as np
wf = sys.argv[1]
deps = extract_deps_from_weights_file(wf)
di = read_hdf5(wf)
num_kernel_params = 0
conv_kernel_cnt = 0
matrix_param_cnt = 0
vec_param_cnt = 0
bias_cnt = 0
beta_cnt = 0
gamma_cnt = 0
m... |
DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://scire@localhost/testing_environ'
SECRET_KEY = 'something_secret'
BCRYPT_LOG_ROUNDS = 12
SQLALCHEMY_TRACK_MODIFICATIONS = True |
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# Allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-wordcensor',
pa... |
# Lint as: python3
# Copyright 2019 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 ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# *****************************************************************************
# $Id$
#
# Project: GDAL
# Purpose: GDAL API_PROXY server written in Python
# Author: Even Rouault, <even dot rouault at spatialys.com>
#
# ******************************************************... |
"""
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize import QuartileDiscre... |
# tests for things that are not implemented, or have non-compliant behaviour
try:
import array
import struct
except ImportError:
print("SKIP")
raise SystemExit
# when super can't find self
try:
exec("def f(): super()")
except SyntaxError:
print("SyntaxError")
# store to exception attribute is... |
# Generated from C.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
## @file
# The file defines the parser for C source files.
#
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
# This file is gen... |
"""
flask_security.babel
~~~~~~~~~~~~~~~~~~~~
I18N support for Flask-Security.
As of Flask-Babel 2.0.0 - it supports the Flask-BabelEx Domain extension - and it
is maintained. (Flask-BabelEx is no longer maintained). So we start with that,
then fall back to Flask-BabelEx, then fall back to a N... |
"""DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... |
from dataset import SMPLyDataset
import pickle
from typing import Tuple
from model import SMPLyModel
from renderer import DefaultRenderer
import cv2
from tqdm import tqdm
import numpy as np
from scipy import interpolate
def make_video(images, video_name: str, fps=30, ext: str = "mp4", post_process_frame=None):
im... |
"""Adds config flow for Airly."""
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
HTTP_UNAUTHORIZED,
)
fro... |
#
# 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... |
from electrum_deeponion.i18n import _
fullname = _('LabelSync')
description = ' '.join([
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
])... |
"""Utility code for running native pytorch distributed"""
import os
import torch.distributed as dist
def init_workers_file():
rank = int(os.environ['SLURM_PROCID'])
n_ranks = int(os.environ['SLURM_NTASKS'])
sync_file = 'file:///tmp/%s_%s_pytorch_sync' % (
os.environ['USER'], os.environ['SLURM_JOB... |
'''IOSXR implementation of InitExecCommands class'''
class InitExecCommands(object):
"""InitExecCommands class
`InitExecCommands` class provides the functionality to retrieve the
platform specific initiation executed commands.
"""
def get_commands(self):
"""Method to return the list of ... |
import unittest
import pandas as pd
import pytest
import riptable as rt
# N.B. TL;DR We have to import the actual implementation module to override the module global
# variable "tm.N" and "tm.K".
# In pandas 1.0 they move the code from pandas/util/testing.py to pandas/_testing.py.
# The "import pandas.u... |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies actions can be in 'none' type targets with source files.
"""
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcod... |
# Generated by Django 2.1.2 on 2018-10-26 22:35
from django.db import migrations
import apps.photo.cropping.boundingbox
import utils.model_fields
class Migration(migrations.Migration):
dependencies = [
('photo', '0029_auto_20181023_0021'),
]
operations = [
migrations.AlterField(
... |
SECRET_KEY = 'mysecret' |
# @date 2019-01-19
# @author Frederic Scherma, All rights reserved without prejudices.
# @license Copyright (c) 2019 Dream Overflow
# Crystal Ball strategy sub-strategy base class.
from strategy.timeframebasedsub import TimeframeBasedSub
class CrystalBallStrategySub(TimeframeBasedSub):
"""
Bitcoin Alpha sub ... |
#!/usr/bin/env python3
# vim: set fileencoding=utf-8:
# Standard library
import json
import logging
import os
# Third-party
import git
# First-party/Local
import log
GIT_USER_NAME = "CC creativecommons.github.io Bot"
GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org"
GITHUB_USERNAME = "cc-crea... |
# 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 pandas as pd
import numpy as np
base = pd.read_csv('credit_data.csv')
base.loc[base.age < 0, 'age'] = 40.92
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values = np.nan, strategy = 'mean')
imputer ... |
import shutil
import os
import glob
import numpy as np
from sklearn.model_selection import train_test_split
import shutil
import re
clouds = glob.glob('range_images/point_cloud_*.pcd')
train, test = train_test_split(clouds, test_size=0.20, random_state=42)
for file in train:
shutil.copy(file, "simulated_data/seque... |
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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 ... |
# flake8: noqa
import numpy as np
from skimage.data import camera
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import (
normalise,
add_noise,
dots,
lizard,
pollen,
characters,
cropped_newyork,
)
from aydin.it.fgr import ImageTranslatorFGR
from... |
# coding: utf-8
"""
Copyright 2016 SmartBear Software
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... |
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
try:
from tablib import Dataset
except ImportError: # pragma: no cover
raise ImproperlyConfigured(
"You must have tablib installed in order to use the django-tables2 export functionality"
)
class TableEx... |
def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s (subdir/)";\n' % req.GET[b'msg']) |
# Copyright 2021 The HuggingFace Team. 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 applicabl... |
import disnake as discord
import random
from disnake.ext import commands
from api.check import utils, block
from api.server import base, main
class Gay(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@block.block()
async def gay(self, ctx, user: discord.Me... |
import os
import subprocess
from ..utils import RepoStats, ThreadedSegment, get_subprocess_env
def _get_fossil_branch():
branches = os.popen("fossil branch 2>/dev/null").read().strip().split("\n")
return ''.join([
i.replace('*','').strip()
for i in branches
if i.startswith('*')
])
... |
"""
import state will import all possible pre-defined state classes
"""
from .simple import SimpleStore
from .in_memory_key_value_store import InMemoryKeyValueStore
from .change_logging_key_value_store import ChangeLoggingKeyValueStore |
"""
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... |
import os
from glob import glob
from setuptools import setup, find_packages
package_name = 'part3_3_py_original_msg_example'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name])... |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import json
import os
from builtins import object
import pandas as pd
from pandas import Series
from . import find_pmag_dir
pmag_dir = find_pmag_dir.get_pmag_dir()
data_model_dir = os.path.join(pmag_dir, 'pmagpy', 'dat... |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: temporal/api/operatorservice/v1/request_response.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.prot... |
# -*- coding: utf-8 -*-
'''
tests for pkg state
'''
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains,
requires_salt_modules
)
ensure_in_syspath('../../')
# Import python libs
import os
import time
#... |
import json
import logging
import os
from datetime import datetime
from pathlib import Path
from telegram import ParseMode
from telegram.ext import Updater, MessageHandler, Filters
from uploader import Uploader
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
log... |
from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from simpleApi.models import Teacher, Student, Gradeable
class TeacherTestCase(TestCase):
def setUp(self):
s = Student.objects.create(username="student1", password="student", first_name="student")
Teacher... |
# Generated by Django 2.0 on 2018-01-03 02:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecweb', '0010_event'),
]
operations = [
migrations.AlterField(
model_name='event',
name='end_event',
field... |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
# Certipy - Active Directory certificate abuse
#
# Description:
# Request a new certificate
#
# Authors:
# @ollypwn (https://github.com/ollypwn)
#
# References:
# https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-icpr/d98e6cfb-87ba-4915-b3ec-a1b7c6129a53
# https://docs.microsoft.com/en-us/openspec... |
#!/usr/bin/env python
"""
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");... |
# python3.7
"""Dumps available arguments of all commands (configurations).
This file parses the arguments of all commands provided in `configs/` and dump
the results as a json file. Each parsed argument includes the name, argument
type, default value, and the help message (description). The dumped file looks
like
{
... |
import re
import numpy as np
from openpnm.io.Pandas import Pandas
from openpnm.io import GenericIO, Dict
from openpnm.utils import logging, Workspace
logger = logging.getLogger(__name__)
ws = Workspace()
class CSV(GenericIO):
r"""
Reads and writes CSV (comma-separated-value files) containing pore and
thro... |
"""
-import mysql.conecctor -> memanggil function conecctor dari modul mysql
-from connect_Db import Connect_db -> memanggil class connect_db di file connect_Db yang telah di buat sebelumnya
-from Validation import Validations-> memanggil class Validataions yang ada pada file Validation
-from termcolor import colored -... |
from .util import train_test_split
import numpy as np
import itertools
# MODEL SELECTION
class Cross_Validation:
#avaliar a performance de um modelo
def __init__(self, model, dataset,score=None, **kwargs):
self.model=model #modelo que se quer avaliar
self.dataset=dataset
self.cv=kwargs... |
import warnings
from os import path
from tempfile import TemporaryDirectory
import pytest
from petab.C import *
from petab.visualize import (plot_data_and_simulation,
plot_measurements_by_observable,
save_vis_spec)
import matplotlib.pyplot as plt
@pytest.fixtu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.