hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f8f17354375318e400a18bee690428baa3126f | 3,751 | py | Python | SRGAN/model.py | RyanMoussouni/iSeeBetter | af193ae0852f8e477fcd6875dce874eb5092a24a | [
"MIT"
] | 327 | 2019-11-30T02:07:57.000Z | 2022-03-16T20:05:10.000Z | SRGAN/model.py | RyanMoussouni/iSeeBetter | af193ae0852f8e477fcd6875dce874eb5092a24a | [
"MIT"
] | 40 | 2019-12-09T03:21:47.000Z | 2022-02-20T07:59:16.000Z | SRGAN/model.py | RyanMoussouni/iSeeBetter | af193ae0852f8e477fcd6875dce874eb5092a24a | [
"MIT"
] | 73 | 2019-12-09T02:46:56.000Z | 2022-03-16T06:50:55.000Z | import math
import torch
import torch.nn.functional as F
from torch import nn
class Generator(nn.Module):
def __init__(self, scale_factor):
upsample_block_num = int(math.log(scale_factor, 2))
super(Generator, self).__init__()
self.block1 = nn.Sequential(
nn.Conv2d(3, 64, kern... | 31.258333 | 97 | 0.583578 | import math
import torch
import torch.nn.functional as F
from torch import nn
class Generator(nn.Module):
def __init__(self, scale_factor):
upsample_block_num = int(math.log(scale_factor, 2))
super(Generator, self).__init__()
self.block1 = nn.Sequential(
nn.Conv2d(3, 64, kern... | true | true |
08f8f2ee16814ac85f637266d70ca40beb5ed3ed | 767 | py | Python | oaff/fastapi/api/middleware/request_context_log_middleware.py | JBurkinshaw/ogc-api-fast-features | 4fc6ba3cc4df1600450fe4c9f35320b00c69f158 | [
"MIT"
] | 19 | 2021-07-06T16:35:27.000Z | 2022-02-08T04:59:21.000Z | oaff/fastapi/api/middleware/request_context_log_middleware.py | JBurkinshaw/ogc-api-fast-features | 4fc6ba3cc4df1600450fe4c9f35320b00c69f158 | [
"MIT"
] | 30 | 2021-07-14T04:13:11.000Z | 2021-11-22T20:45:15.000Z | oaff/fastapi/api/middleware/request_context_log_middleware.py | JBurkinshaw/ogc-api-fast-features | 4fc6ba3cc4df1600450fe4c9f35320b00c69f158 | [
"MIT"
] | 6 | 2021-07-06T16:35:28.000Z | 2021-09-17T19:24:49.000Z | from contextvars import ContextVar
from uuid import uuid4
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request
REQUEST_ID_CTX_KEY = "request_id"
_request_id_ctx_var: ContextVar[str] = ContextVar(
REQUEST_ID_CTX_KEY, default=None # type: ignore
... | 27.392857 | 83 | 0.765319 | from contextvars import ContextVar
from uuid import uuid4
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint
from starlette.requests import Request
REQUEST_ID_CTX_KEY = "request_id"
_request_id_ctx_var: ContextVar[str] = ContextVar(
REQUEST_ID_CTX_KEY, default=None )
def get_req... | true | true |
08f8f2f20dd316fa1f24f3db40af9fc2609e0850 | 2,017 | py | Python | main.py | MOOOWOOO/PyUpdater | 06988f45e0ee8d6c214330d876ece507df3c60f6 | [
"MIT"
] | null | null | null | main.py | MOOOWOOO/PyUpdater | 06988f45e0ee8d6c214330d876ece507df3c60f6 | [
"MIT"
] | null | null | null | main.py | MOOOWOOO/PyUpdater | 06988f45e0ee8d6c214330d876ece507df3c60f6 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
"""
"""
import argparse
__author__ = 'Jux.Liu'
def update(args):
print('Start update process...')
def rollback():
pass
def check():
pass
if __name__ == '__main__':
desc = '''This Tool is for Mostfun Control Panel Check, Update and Rollback''... | 30.560606 | 89 | 0.537432 | import argparse
__author__ = 'Jux.Liu'
def update(args):
print('Start update process...')
def rollback():
pass
def check():
pass
if __name__ == '__main__':
desc = '''This Tool is for Mostfun Control Panel Check, Update and Rollback'''
parser = argparse.ArgumentParser(... | true | true |
08f8f399061de7fd965a22a0503134c675368743 | 1,632 | py | Python | python/test/function/test_squared_error.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 2,792 | 2017-06-26T13:05:44.000Z | 2022-03-28T07:55:26.000Z | python/test/function/test_squared_error.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 138 | 2017-06-27T07:04:44.000Z | 2022-02-28T01:37:15.000Z | python/test/function/test_squared_error.py | daniel-falk/nnabla | 3fe132ea52dc10521cc029a5d6ba8f565cf65ccf | [
"Apache-2.0"
] | 380 | 2017-06-26T13:23:52.000Z | 2022-03-25T16:51:30.000Z | # Copyright 2017,2018,2019,2020,2021 Sony 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 applicable law... | 39.804878 | 74 | 0.730392 |
import pytest
import numpy as np
import nnabla.functions as F
from nbla_test_utils import list_context
ctxs = list_context('SquaredError')
@pytest.mark.parametrize("ctx, func_name", ctxs)
@pytest.mark.parametrize("seed", [313])
def test_squared_error_forward_backward(seed, ctx, func_name):
from nbla_test_utils ... | true | true |
08f8f4548d35d79571362865ae876372859c9d74 | 5,386 | py | Python | Week4/utils.py | Ivancaminal72/mcv-m6-2018-team3 | dcdbc97d6d9534f1c0479e98113f35bca0084d86 | [
"MIT"
] | 1 | 2019-06-08T10:27:08.000Z | 2019-06-08T10:27:08.000Z | Week4/utils.py | Ivancaminal72/mcv-m6-2018-team3 | dcdbc97d6d9534f1c0479e98113f35bca0084d86 | [
"MIT"
] | null | null | null | Week4/utils.py | Ivancaminal72/mcv-m6-2018-team3 | dcdbc97d6d9534f1c0479e98113f35bca0084d86 | [
"MIT"
] | 1 | 2018-09-16T22:17:06.000Z | 2018-09-16T22:17:06.000Z | import glob
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
def rgb2gray(rgb):
r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
return gray
def video_to_frame(filename, grayscale=True):
vidcap = cv2.VideoCapture(filename)
# Check if c... | 25.770335 | 110 | 0.585035 | import glob
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
def rgb2gray(rgb):
r, g, b = rgb[:,:,0], rgb[:,:,1], rgb[:,:,2]
gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
return gray
def video_to_frame(filename, grayscale=True):
vidcap = cv2.VideoCapture(filename)
if not v... | true | true |
08f8f4636deb3df50b1807c08380720099fb24b7 | 274 | py | Python | owllook/views/__init__.py | yxlix/owllook | d604a67ae333ff2364b98b435fd90646cc857c56 | [
"Apache-2.0"
] | null | null | null | owllook/views/__init__.py | yxlix/owllook | d604a67ae333ff2364b98b435fd90646cc857c56 | [
"Apache-2.0"
] | null | null | null | owllook/views/__init__.py | yxlix/owllook | d604a67ae333ff2364b98b435fd90646cc857c56 | [
"Apache-2.0"
] | null | null | null | from .admin_blueprint import admin_bp
from .api_blueprint import api_bp
from .except_blueprint import except_bp
from .md_blueprint import md_bp
from .novels_blueprint import novels_bp
from .api_novels_blueprint import api_novels_bp
from .operate_blueprint import operate_bp
| 34.25 | 47 | 0.872263 | from .admin_blueprint import admin_bp
from .api_blueprint import api_bp
from .except_blueprint import except_bp
from .md_blueprint import md_bp
from .novels_blueprint import novels_bp
from .api_novels_blueprint import api_novels_bp
from .operate_blueprint import operate_bp
| true | true |
08f8f4e083dd3d845dfa06c6684e8a117acd8480 | 23,908 | py | Python | tensorflow/python/keras/engine/base_preprocessing_layer.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/python/keras/engine/base_preprocessing_layer.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/keras/engine/base_preprocessing_layer.py | AdaAlarm/tensorflow | e0db063159751276a92d88a4ad6d481b1199318c | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # 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 required by applica... | 38.009539 | 106 | 0.703112 |
import abc
import collections
import numpy as np
from tensorflow.python.eager import context
from tensorflow.python.eager import def_function
from tensorflow.python.eager import monitoring
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework impo... | true | true |
08f8f4e34cd33e2ae4d176817620b93b4859fc37 | 5,469 | py | Python | data/p3BR/R1/benchmark/startQiskit_QC357.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC357.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_QC357.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=64
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.090426 | 140 | 0.629366 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo, ... | true | true |
08f8f51fee6d3d4fd41a1cd1b9c3a5ff3c61cdd8 | 5,913 | py | Python | build/lib/catalog/views.py | kevmgb/LibAppDjango | 4d5aacb115f1c67b72e3931e561b027464e6bda0 | [
"MIT"
] | null | null | null | build/lib/catalog/views.py | kevmgb/LibAppDjango | 4d5aacb115f1c67b72e3931e561b027464e6bda0 | [
"MIT"
] | null | null | null | build/lib/catalog/views.py | kevmgb/LibAppDjango | 4d5aacb115f1c67b72e3931e561b027464e6bda0 | [
"MIT"
] | 2 | 2019-08-05T14:50:08.000Z | 2019-08-19T18:13:54.000Z | # from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
# pg 43, use explicit relative imports
# instead of {from catalog.serializers import BookSerializer, AuthorSerializer}
from .serializers import BookSerializer, AuthorSerializer
from .models import Book
from django.views... | 33.03352 | 79 | 0.723998 |
from django.shortcuts import render
from .serializers import BookSerializer, AuthorSerializer
from .models import Book
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.urls import reverse_lazy
from .models import Author
from django.views import generic
from django.contrib.auth.mixin... | true | true |
08f8f5eb3199ef0867692ddf6145b1160fd6c879 | 11,492 | py | Python | great_project/event/routes.py | tuprogramadorfav/foundations-project-template | a926e10139736e3dabc9b6573cfe4ccced936d7f | [
"MIT"
] | null | null | null | great_project/event/routes.py | tuprogramadorfav/foundations-project-template | a926e10139736e3dabc9b6573cfe4ccced936d7f | [
"MIT"
] | null | null | null | great_project/event/routes.py | tuprogramadorfav/foundations-project-template | a926e10139736e3dabc9b6573cfe4ccced936d7f | [
"MIT"
] | null | null | null | from flask import render_template, request, url_for, redirect, flash, request, jsonify, json, Blueprint, session
from flask_login import current_user, login_required
from great_project import db, login_manager
import datetime
from great_project.event.forms import EventRegistration
from great_project.models import Atlet... | 50.183406 | 276 | 0.675165 | from flask import render_template, request, url_for, redirect, flash, request, jsonify, json, Blueprint, session
from flask_login import current_user, login_required
from great_project import db, login_manager
import datetime
from great_project.event.forms import EventRegistration
from great_project.models import Atlet... | true | true |
08f8f637eb6d603eab04944f6eafe1573fd61d6f | 4,861 | py | Python | importasol/db/contasol/sal.py | telenieko/importasol | 92848ff369b664bee5077b821830d690c31e7830 | [
"BSD-3-Clause"
] | null | null | null | importasol/db/contasol/sal.py | telenieko/importasol | 92848ff369b664bee5077b821830d690c31e7830 | [
"BSD-3-Clause"
] | null | null | null | importasol/db/contasol/sal.py | telenieko/importasol | 92848ff369b664bee5077b821830d690c31e7830 | [
"BSD-3-Clause"
] | 1 | 2022-02-02T14:29:33.000Z | 2022-02-02T14:29:33.000Z | from ..base import SOLFile
from ..fields import CampoCuenta, CampoDebeHaber, Campo, CampoN
from ...utiles import num_to_col_letters, col2num
from decimal import Decimal
class CreadorSaldos(Campo):
""" CreadorSaldos: Utilidad para crear los campos de Saldos.
Este "campo" simplemente crea de golpe los campos ... | 32.624161 | 93 | 0.581362 | from ..base import SOLFile
from ..fields import CampoCuenta, CampoDebeHaber, Campo, CampoN
from ...utiles import num_to_col_letters, col2num
from decimal import Decimal
class CreadorSaldos(Campo):
def __init__(self, nombre, inicial, **kwargs):
self.inicial = inicial
self.columnas_euro = {}
... | true | true |
08f8f644a92dccaa11b6d5aefa226bbe4bec1aac | 10,361 | py | Python | mpi4jax/_src/collective_ops/sendrecv.py | Thenerdstation/mpi4jax | 8e2fa86abcf6e775d1acea1b85fe44d15ff57387 | [
"MIT"
] | 122 | 2021-03-27T20:46:28.000Z | 2022-03-31T22:23:45.000Z | mpi4jax/_src/collective_ops/sendrecv.py | Thenerdstation/mpi4jax | 8e2fa86abcf6e775d1acea1b85fe44d15ff57387 | [
"MIT"
] | 50 | 2021-03-25T10:48:17.000Z | 2022-03-18T14:52:51.000Z | mpi4jax/_src/collective_ops/sendrecv.py | Thenerdstation/mpi4jax | 8e2fa86abcf6e775d1acea1b85fe44d15ff57387 | [
"MIT"
] | 9 | 2021-03-27T03:46:34.000Z | 2022-02-16T12:44:22.000Z | import numpy as _np
from mpi4py import MPI as _MPI
from jax import abstract_arrays, core
from jax.core import Primitive
from jax.interpreters import ad, xla, batching
from jax.lax import create_token
from jax.lib import xla_client
from ..utils import (
HashableMPIType,
default_primitive_impl,
to_dtype_han... | 25.9025 | 86 | 0.656597 | import numpy as _np
from mpi4py import MPI as _MPI
from jax import abstract_arrays, core
from jax.core import Primitive
from jax.interpreters import ad, xla, batching
from jax.lax import create_token
from jax.lib import xla_client
from ..utils import (
HashableMPIType,
default_primitive_impl,
to_dtype_han... | true | true |
08f8f6ab84f8e19ccb06c437a86185e2289cbee5 | 738 | py | Python | bcs-ui/backend/tests/iam/permissions/__init__.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | 599 | 2019-06-25T03:20:46.000Z | 2022-03-31T12:14:33.000Z | bcs-ui/backend/tests/iam/permissions/__init__.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | 537 | 2019-06-27T06:03:44.000Z | 2022-03-31T12:10:01.000Z | bcs-ui/backend/tests/iam/permissions/__init__.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | 214 | 2019-06-25T03:26:05.000Z | 2022-03-31T07:52:03.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 49.2 | 115 | 0.781843 | true | true | |
08f8f6cf80cd7733370e164fe791dcf04d82b734 | 377 | py | Python | distributed_social_network/users/signals.py | leevtori/CMPUT404-project | 52214288855ae4b3f05b8d17e67a2686debffb19 | [
"Apache-2.0"
] | null | null | null | distributed_social_network/users/signals.py | leevtori/CMPUT404-project | 52214288855ae4b3f05b8d17e67a2686debffb19 | [
"Apache-2.0"
] | 51 | 2019-03-22T00:31:06.000Z | 2021-06-10T21:17:30.000Z | distributed_social_network/users/signals.py | leevtori/CMPUT404-project | 52214288855ae4b3f05b8d17e67a2686debffb19 | [
"Apache-2.0"
] | 1 | 2019-08-03T14:41:22.000Z | 2019-08-03T14:41:22.000Z | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Node
@receiver(post_save, sender=Node)
def nodeSaveHandler(sender, **kwargs):
"""
Set user.is_active to match node.active
"""
# get the instance
node = kwargs.get("instance")
user = node.us... | 25.133333 | 46 | 0.702918 | from django.db.models.signals import post_save
from django.dispatch import receiver
from .models import Node
@receiver(post_save, sender=Node)
def nodeSaveHandler(sender, **kwargs):
node = kwargs.get("instance")
user = node.user_auth
user.is_active = node.active
user.save()
| true | true |
08f8f7c1d0ffe5c85e4614d7e226e072939cad60 | 5,215 | py | Python | rlberry/agents/tests/test_a2c_ppo_avec.py | antoine-moulin/rlberry | 676af9d1bb9094a6790a9aa3ff7e67b13584a183 | [
"MIT"
] | null | null | null | rlberry/agents/tests/test_a2c_ppo_avec.py | antoine-moulin/rlberry | 676af9d1bb9094a6790a9aa3ff7e67b13584a183 | [
"MIT"
] | null | null | null | rlberry/agents/tests/test_a2c_ppo_avec.py | antoine-moulin/rlberry | 676af9d1bb9094a6790a9aa3ff7e67b13584a183 | [
"MIT"
] | null | null | null | from copy import deepcopy
from rlberry.agents import A2CAgent
from rlberry.agents import PPOAgent
from rlberry.agents import AVECPPOAgent
from rlberry.envs.benchmarks.ball_exploration.ball2d import get_benchmark_env
from rlberry.exploration_tools.discrete_counter import DiscreteCounter
from rlberry.wrappers.uncertainty... | 31.79878 | 79 | 0.540556 | from copy import deepcopy
from rlberry.agents import A2CAgent
from rlberry.agents import PPOAgent
from rlberry.agents import AVECPPOAgent
from rlberry.envs.benchmarks.ball_exploration.ball2d import get_benchmark_env
from rlberry.exploration_tools.discrete_counter import DiscreteCounter
from rlberry.wrappers.uncertainty... | true | true |
08f8faaa9055e6233cbe52a6f3843f01e7962aad | 3,123 | py | Python | Engine/Render/rpcore/gui/text_node.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | 3 | 2019-09-17T15:26:42.000Z | 2021-12-09T00:42:32.000Z | Engine/Render/rpcore/gui/text_node.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | null | null | null | Engine/Render/rpcore/gui/text_node.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | 1 | 2019-09-17T13:21:31.000Z | 2019-09-17T13:21:31.000Z | """
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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... | 35.488636 | 91 | 0.692603 |
from panda3d.core import Vec2, Vec3, Vec4
from panda3d.core import TextNode as TextNodeImpl
from Engine.Render.rpcore.globals import Globals
from Engine.Render.rpcore.rpobject import RPObject
from Engine.Render.rpcore.loader import RPLoader
class TextNode(RPObject):
def __init__(self, font="/$$rp/data/font/R... | true | true |
08f8faf48cd9c0e424ecdfedd90d858cb787a86a | 8,449 | py | Python | tests/test_steps_for_sliding_window_prediction.py | mikami520/nnUNet | ab0a12a0fa36f38fbae3b8f8a1e63cefefdc481a | [
"Apache-2.0"
] | null | null | null | tests/test_steps_for_sliding_window_prediction.py | mikami520/nnUNet | ab0a12a0fa36f38fbae3b8f8a1e63cefefdc481a | [
"Apache-2.0"
] | null | null | null | tests/test_steps_for_sliding_window_prediction.py | mikami520/nnUNet | ab0a12a0fa36f38fbae3b8f8a1e63cefefdc481a | [
"Apache-2.0"
] | 1 | 2022-03-15T03:15:02.000Z | 2022-03-15T03:15:02.000Z | # Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
#
# 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://w... | 45.424731 | 120 | 0.588472 | import unittest
import unittest2
import numpy as np
from nnunet.network_architecture.neural_network import SegmentationNetwork
class TestSlidingWindow(unittest2.TestCase):
def setUp(self) -> None:
pass
def _verify_steps(self, steps, patch_size, image_size, step_size):
debug_information = 'st... | true | true |
08f8fb7b1a93df42ea3a2043d1102a5b03a78aa6 | 17,563 | py | Python | nova/tests/unit/api/openstack/compute/test_disk_config.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/tests/unit/api/openstack/compute/test_disk_config.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_disk_config.py | bopopescu/Trusted-Platform-Module-nova | 20d28ef29daf6fd7a67b37b87ec2561c34b4230b | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Copyright 2011 OpenStack Foundation
# 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 requ... | 38.685022 | 79 | 0.60041 |
import datetime
from oslo_serialization import jsonutils
from nova.api.openstack import compute
from nova.compute import api as compute_api
from nova.compute import flavors
from nova import objects
from nova import test
from nova.tests.unit.api.openstack import fakes
from nova.tests.unit import fake_instance
import ... | true | true |
08f8fb9cc1ff673c4d087d51883952d884b48614 | 6,082 | py | Python | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/search_corp_vmr_request.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/search_corp_vmr_request.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-meeting/huaweicloudsdkmeeting/v1/model/search_corp_vmr_request.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class SearchCorpVmrRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the val... | 25.991453 | 119 | 0.576455 |
import pprint
import re
import six
class SearchCorpVmrRequest:
sensitive_list = []
openapi_types = {
'x_request_id': 'str',
'accept_language': 'str',
'offset': 'int',
'limit': 'int',
'search_key': 'str',
'status': 'int'
}
attribute_map = {
... | true | true |
08f8fc0977e4fe4f087017d752fe81f9708bcc7c | 8,688 | py | Python | fastestimator/xai/gradcam.py | rajesh1226/fastestimator | 0765c7478c0889cf4e2841d51a35c9a06a406472 | [
"Apache-2.0"
] | 1 | 2019-12-17T22:43:08.000Z | 2019-12-17T22:43:08.000Z | fastestimator/xai/gradcam.py | rajesh1226/fastestimator | 0765c7478c0889cf4e2841d51a35c9a06a406472 | [
"Apache-2.0"
] | null | null | null | fastestimator/xai/gradcam.py | rajesh1226/fastestimator | 0765c7478c0889cf4e2841d51a35c9a06a406472 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The FastEstimator 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 appl... | 42.588235 | 118 | 0.603821 | import math
import os
import cv2
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tf_explain.core.grad_cam import GradCAM
from tf_explain.utils.display import heatmap_display
from fastestimator.xai.util import show_image, show_text
from fastestimator.util.util import decode_predictions
... | true | true |
08f8fc2c5438f71f80ffc8c20b2e6056943d8dec | 19,191 | py | Python | vnet_manager/config/validate.py | ppartarr/vnet-manager | e7e8dfc9014c98f34bce639f48e0baa603d83b67 | [
"MIT"
] | null | null | null | vnet_manager/config/validate.py | ppartarr/vnet-manager | e7e8dfc9014c98f34bce639f48e0baa603d83b67 | [
"MIT"
] | null | null | null | vnet_manager/config/validate.py | ppartarr/vnet-manager | e7e8dfc9014c98f34bce639f48e0baa603d83b67 | [
"MIT"
] | null | null | null | from ipaddress import IPv4Interface, IPv6Interface, ip_interface
from re import fullmatch
from logging import getLogger
from os.path import isdir, isfile, join
from copy import deepcopy
from vnet_manager.utils.mac import random_mac_generator
from vnet_manager.conf import settings
logger = getLogger(__name__)
class ... | 51.450402 | 140 | 0.567089 | from ipaddress import IPv4Interface, IPv6Interface, ip_interface
from re import fullmatch
from logging import getLogger
from os.path import isdir, isfile, join
from copy import deepcopy
from vnet_manager.utils.mac import random_mac_generator
from vnet_manager.conf import settings
logger = getLogger(__name__)
class ... | true | true |
08f8fd13ca7540fb037f72d9f1800a13de20be4f | 5,865 | py | Python | discord/stage_instance.py | naoTimesdev/ndiscord.py | fbc933d18161763e198233cbe49e43b3e2669ddd | [
"MIT"
] | 2 | 2021-09-15T12:57:06.000Z | 2021-09-19T03:47:55.000Z | discord/stage_instance.py | naoTimesdev/ndiscord.py | fbc933d18161763e198233cbe49e43b3e2669ddd | [
"MIT"
] | 5 | 2021-09-15T07:11:35.000Z | 2022-02-06T01:53:44.000Z | discord/stage_instance.py | naoTimesdev/ndiscord.py | fbc933d18161763e198233cbe49e43b3e2669ddd | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 33.135593 | 117 | 0.660529 |
from __future__ import annotations
from typing import TYPE_CHECKING, Optional
from .enums import StagePrivacyLevel, try_enum
from .errors import InvalidArgument
from .mixins import Hashable
from .utils import MISSING, cached_slot_property
__all__ = ("StageInstance",)
if TYPE_CHECKING:
from .channel import Stag... | true | true |
08f8fd2c3ab2f3f973a4fba0c00f15b34e79701b | 3,065 | py | Python | explainaboard/utils/cache_api.py | hwidjaja/ExplainaBoard | 0e670ad2df9326eb6b4ad99ba435fd7b6806557a | [
"MIT"
] | null | null | null | explainaboard/utils/cache_api.py | hwidjaja/ExplainaBoard | 0e670ad2df9326eb6b4ad99ba435fd7b6806557a | [
"MIT"
] | null | null | null | explainaboard/utils/cache_api.py | hwidjaja/ExplainaBoard | 0e670ad2df9326eb6b4ad99ba435fd7b6806557a | [
"MIT"
] | null | null | null | from __future__ import annotations
import datetime
import json
import os
from pathlib import Path
import urllib.request
from explainaboard.utils.logging import get_logger
def sanitize_path(path):
return os.path.relpath(os.path.normpath(os.path.join("/", path)), "/")
def get_cache_dir() -> str:
if 'EXPLAIN... | 33.681319 | 88 | 0.691354 | from __future__ import annotations
import datetime
import json
import os
from pathlib import Path
import urllib.request
from explainaboard.utils.logging import get_logger
def sanitize_path(path):
return os.path.relpath(os.path.normpath(os.path.join("/", path)), "/")
def get_cache_dir() -> str:
if 'EXPLAIN... | true | true |
08f8ff3f0a51e643b1dcc6431639dde2e63ffb05 | 1,334 | py | Python | _unittests/ut_documentation/test_LONG_notebook_challenge_city_tour_cartopy.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | 1 | 2020-11-22T10:24:54.000Z | 2020-11-22T10:24:54.000Z | _unittests/ut_documentation/test_LONG_notebook_challenge_city_tour_cartopy.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | 13 | 2017-11-20T00:20:45.000Z | 2021-01-05T14:13:51.000Z | _unittests/ut_documentation/test_LONG_notebook_challenge_city_tour_cartopy.py | sdpython/ensae_projects | 9647751da053c09fa35402527b294e02a4e6e2ad | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@brief test log(time=160s)
"""
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import fix_tkinter_issues_virtualenv
from pyquickhelper.ipythonhelper import execute_notebook_list_fin... | 34.205128 | 115 | 0.687406 |
import sys
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import get_temp_folder
from pyquickhelper.pycode import fix_tkinter_issues_virtualenv
from pyquickhelper.ipythonhelper import execute_notebook_list_finalize_ut
from ensae_projects.automation.notebook_test_helper imp... | true | true |
08f8ff7ef155d1b303f654e5c2e9922aacaf1bb1 | 1,175 | py | Python | Python/DatasetUtilsPackage/DatasetUtils/datasets.py | amylenz/ShapeWorks | 78c2ee067a23e31f5b83d0121e60addb1b0bf462 | [
"MIT"
] | null | null | null | Python/DatasetUtilsPackage/DatasetUtils/datasets.py | amylenz/ShapeWorks | 78c2ee067a23e31f5b83d0121e60addb1b0bf462 | [
"MIT"
] | null | null | null | Python/DatasetUtilsPackage/DatasetUtils/datasets.py | amylenz/ShapeWorks | 78c2ee067a23e31f5b83d0121e60addb1b0bf462 | [
"MIT"
] | null | null | null | from DatasetUtils import GirderConnector
# By default tries to use locally stored login state with interactive login
def downloadDataset(filename, loginState = None):
print('.___________________________.')
print('| |')
print('| ShapeWorks Portal |')
print('|__________... | 35.606061 | 92 | 0.654468 | from DatasetUtils import GirderConnector
def downloadDataset(filename, loginState = None):
print('.___________________________.')
print('| |')
print('| ShapeWorks Portal |')
print('|___________________________|')
print()
print("Downloading " + filename + " fro... | true | true |
08f90096717c0cb15a6e84f3341a6782b6a8e31b | 408 | py | Python | spotify/spotify_project/wsgi.py | Arytur/Spotify-data | 8668956231a54710832dc393aa65c9ecbd355f53 | [
"MIT"
] | 5 | 2019-03-31T18:26:09.000Z | 2021-08-18T14:27:51.000Z | spotify/spotify_project/wsgi.py | Arytur/Spotify-data | 8668956231a54710832dc393aa65c9ecbd355f53 | [
"MIT"
] | 6 | 2019-11-18T22:16:06.000Z | 2021-09-22T18:55:46.000Z | spotify/spotify_project/wsgi.py | Arytur/Spotify-data | 8668956231a54710832dc393aa65c9ecbd355f53 | [
"MIT"
] | 1 | 2019-03-31T18:26:10.000Z | 2019-03-31T18:26:10.000Z | """
WSGI config for spotify_project 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/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJA... | 24 | 78 | 0.794118 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "spotify_project.settings")
application = get_wsgi_application()
| true | true |
08f90109a4f346e12e419d8e584a1695d52a2f34 | 1,154 | py | Python | request-management-api/request_api/models/ApplicantCategories.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | null | null | null | request-management-api/request_api/models/ApplicantCategories.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | 1,579 | 2021-04-14T18:27:45.000Z | 2022-03-31T23:49:42.000Z | request-management-api/request_api/models/ApplicantCategories.py | bcgov/foi-flow | 7f9897b3aad4ba91fbc8edcb8f526906efb490df | [
"Apache-2.0"
] | 1 | 2022-03-01T20:17:47.000Z | 2022-03-01T20:17:47.000Z | from .db import db, ma
from .default_method_result import DefaultMethodResult
class ApplicantCategory(db.Model):
__tablename__ = 'ApplicantCategories'
# Defining the columns
applicantcategoryid = db.Column(db.Integer, primary_key=True,autoincrement=True)
name = db.Column(db.String(100), unique=False... | 41.214286 | 89 | 0.737435 | from .db import db, ma
from .default_method_result import DefaultMethodResult
class ApplicantCategory(db.Model):
__tablename__ = 'ApplicantCategories'
applicantcategoryid = db.Column(db.Integer, primary_key=True,autoincrement=True)
name = db.Column(db.String(100), unique=False, nullable=False)
d... | true | true |
08f9012950d7b12b03ee15c5a52a48fbb80dbfe9 | 7,884 | py | Python | netsblox/transform.py | brollb/NetsBlox-python | 0c441f25f3aec862c833836aefa4f345e95a4631 | [
"Apache-2.0"
] | null | null | null | netsblox/transform.py | brollb/NetsBlox-python | 0c441f25f3aec862c833836aefa4f345e95a4631 | [
"Apache-2.0"
] | null | null | null | netsblox/transform.py | brollb/NetsBlox-python | 0c441f25f3aec862c833836aefa4f345e95a4631 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from typing import Any, List
import parso # docs: https://parso.readthedocs.io/_/downloads/en/latest/pdf/
import unittest
def remove_new_line(line: str) -> str:
if line.endswith('\r\n'):
return line[:-2]
if line.endswith('\n'):
return line[:-1]
return line
def trail... | 26.019802 | 132 | 0.5293 |
from typing import Any, List
import parso import unittest
def remove_new_line(line: str) -> str:
if line.endswith('\r\n'):
return line[:-2]
if line.endswith('\n'):
return line[:-1]
return line
def trailing_indent(txt: str) -> str:
i = len(txt)
while i > 0:
ch = txt[i - 1]... | true | true |
08f9026b046773a44429de540c304c8777feb909 | 15,895 | py | Python | python/ray/util/collective/collective.py | Rid039/ray | eb9330df07150adbb9a4e334ace6b1a3ba6602a2 | [
"Apache-2.0"
] | null | null | null | python/ray/util/collective/collective.py | Rid039/ray | eb9330df07150adbb9a4e334ace6b1a3ba6602a2 | [
"Apache-2.0"
] | 22 | 2021-06-05T07:12:33.000Z | 2022-03-19T07:16:25.000Z | python/ray/util/collective/collective.py | Rid039/ray | eb9330df07150adbb9a4e334ace6b1a3ba6602a2 | [
"Apache-2.0"
] | 2 | 2020-05-22T15:36:27.000Z | 2020-05-22T15:52:03.000Z | """APIs exposed under the namespace ray.util.collective."""
import logging
import os
from typing import List
import numpy as np
import ray
from ray.util.collective import types
_MPI_AVAILABLE = False
_NCCL_AVAILABLE = True
# try:
# from ray.util.collective.collective_group.mpi_collective_group \
# import MPI... | 33.183716 | 79 | 0.638125 | import logging
import os
from typing import List
import numpy as np
import ray
from ray.util.collective import types
_MPI_AVAILABLE = False
_NCCL_AVAILABLE = True
try:
from ray.util.collective.collective_group import NCCLGroup
except ImportError:
_NCCL_AVAILABLE = False
logger = logging.getLogger(__name__)
... | true | true |
08f903ad580a8db156208f83fc1f345ff1e8ab75 | 4,310 | py | Python | sabueso/tools/sabueso_UniProtKB_XMLDict/missing_info.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | null | null | null | sabueso/tools/sabueso_UniProtKB_XMLDict/missing_info.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | 2 | 2022-01-31T21:22:17.000Z | 2022-02-04T20:20:12.000Z | sabueso/tools/sabueso_UniProtKB_XMLDict/missing_info.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | 1 | 2021-07-20T15:01:14.000Z | 2021-07-20T15:01:14.000Z |
def missing_info(item):
# uniprot
for item_key in item:
if item_key not in ['uniprot']:
print(f'item["{item_key}"]')
for uniprot_key in item['uniprot']:
if uniprot_key not in ['@xmlns', '@xmlns:xsi', '@xsi:schemaLocation', 'entry', 'copyright']:
print(f'item["unipr... | 42.254902 | 106 | 0.591647 |
def missing_info(item):
for item_key in item:
if item_key not in ['uniprot']:
print(f'item["{item_key}"]')
for uniprot_key in item['uniprot']:
if uniprot_key not in ['@xmlns', '@xmlns:xsi', '@xsi:schemaLocation', 'entry', 'copyright']:
print(f'item["uniprot"]["{uni... | true | true |
08f904ade9b3f7d515e3d7fc192ae165a32dc070 | 37 | py | Python | lut2d/__init__.py | martinxyz/pixelcrawl | e1218be20ec2fb65ab577b366f54546b59db5854 | [
"MIT"
] | 4 | 2019-05-24T13:31:43.000Z | 2019-05-26T08:50:21.000Z | lut2d/__init__.py | martinxyz/pixelcrawl | e1218be20ec2fb65ab577b366f54546b59db5854 | [
"MIT"
] | 1 | 2019-10-31T02:21:45.000Z | 2019-10-31T02:21:46.000Z | lut2d/__init__.py | martinxyz/pixelcrawl | e1218be20ec2fb65ab577b366f54546b59db5854 | [
"MIT"
] | 1 | 2019-05-24T13:32:10.000Z | 2019-05-24T13:32:10.000Z | from .lut2d import binary_lut_filter
| 18.5 | 36 | 0.864865 | from .lut2d import binary_lut_filter
| true | true |
08f9057b5b81e2fe5015e2da19176c59b31646c2 | 4,896 | py | Python | maskrcnn_benchmark/modeling/backbone/backbone.py | megvii-model/DetNAS | aa92a90604c870fcb7e3ea9f60d16e6f107454d9 | [
"MIT"
] | 290 | 2019-10-26T03:37:41.000Z | 2022-03-07T11:16:34.000Z | maskrcnn_benchmark/modeling/backbone/backbone.py | pawopawo/DetNAS | 49b4e458c5fe68765ec1590433114db7cda28810 | [
"MIT"
] | 37 | 2019-10-29T12:18:59.000Z | 2022-03-04T07:54:52.000Z | maskrcnn_benchmark/modeling/backbone/backbone.py | pawopawo/DetNAS | 49b4e458c5fe68765ec1590433114db7cda28810 | [
"MIT"
] | 52 | 2019-10-26T13:13:55.000Z | 2022-01-18T00:57:08.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from collections import OrderedDict
from torch import nn
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform
from . import fpn as fpn_module
from . import resnet
from . im... | 37.090909 | 109 | 0.701797 | from collections import OrderedDict
from torch import nn
from maskrcnn_benchmark.modeling import registry
from maskrcnn_benchmark.modeling.make_layers import conv_with_kaiming_uniform
from . import fpn as fpn_module
from . import resnet
from . import detnasnet
@registry.BACKBONES.register("R-50-C4")
@registry.BACKB... | true | true |
08f9059e12544a6c77c48a0d28337e7c094d63ed | 6,550 | py | Python | homeassistant/components/zwave_js/select.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 6 | 2017-11-15T09:56:41.000Z | 2021-01-24T15:12:09.000Z | homeassistant/components/zwave_js/select.py | GuyKh/core | 859bcb6eb4dbb9a8b87b6e4e888e074502db5df1 | [
"Apache-2.0"
] | 100 | 2020-06-17T22:22:41.000Z | 2022-03-31T06:24:19.000Z | homeassistant/components/zwave_js/select.py | marecabo/home-assistant | e33774a61e7fcc88aff752dfa4618dd26a746872 | [
"Apache-2.0"
] | 8 | 2020-09-15T02:33:39.000Z | 2021-09-25T20:25:30.000Z | """Support for Z-Wave controls using the select platform."""
from __future__ import annotations
from typing import Dict, cast
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import TARGET_VALUE_PROPERTY, CommandClass
from zwave_js_server.const.command_class.sound_switch import Tone... | 37.643678 | 86 | 0.676336 | from __future__ import annotations
from typing import Dict, cast
from zwave_js_server.client import Client as ZwaveClient
from zwave_js_server.const import TARGET_VALUE_PROPERTY, CommandClass
from zwave_js_server.const.command_class.sound_switch import ToneID
from homeassistant.components.select import DOMAIN as SEL... | true | true |
08f905abd31ebb67839355b9463396ffe3e111f1 | 1,147 | py | Python | tutorials/TRY.py | ZHANGLAOJIU/LEARNING-GYM-AI | 044e00b06e996a59ab0a93cdb26e4da1363a837b | [
"MIT"
] | null | null | null | tutorials/TRY.py | ZHANGLAOJIU/LEARNING-GYM-AI | 044e00b06e996a59ab0a93cdb26e4da1363a837b | [
"MIT"
] | null | null | null | tutorials/TRY.py | ZHANGLAOJIU/LEARNING-GYM-AI | 044e00b06e996a59ab0a93cdb26e4da1363a837b | [
"MIT"
] | null | null | null | class Solution:
def numberOfWays(self, s: str) -> int:
os = 0
ls = 0
res = 0
for i in range(len(s)):
if int(s[i]) == 1:
ls += 1
else:
os += 1
l, r = 0, len(s) - 1
temp = os
while l < r:
if int... | 24.934783 | 43 | 0.272014 | class Solution:
def numberOfWays(self, s: str) -> int:
os = 0
ls = 0
res = 0
for i in range(len(s)):
if int(s[i]) == 1:
ls += 1
else:
os += 1
l, r = 0, len(s) - 1
temp = os
while l < r:
if int... | true | true |
08f905d4df9114725f119b5b8ad26c4814eab503 | 7,505 | py | Python | test/functional/qtum_dgp_block_size_restart.py | SecureChainFinance/SecureChainFinance | 16f52929e302efec672e9357921209fa7fbe0aab | [
"MIT"
] | 1,389 | 2017-06-28T02:35:01.000Z | 2022-03-25T20:09:01.000Z | test/functional/qtum_dgp_block_size_restart.py | SecureChainFinance/SecureChainFinance | 16f52929e302efec672e9357921209fa7fbe0aab | [
"MIT"
] | 311 | 2017-06-28T07:40:00.000Z | 2022-03-28T12:24:59.000Z | test/functional/qtum_dgp_block_size_restart.py | SecureChainFinance/SecureChainFinance | 16f52929e302efec672e9357921209fa7fbe0aab | [
"MIT"
] | 564 | 2017-06-28T03:55:03.000Z | 2022-03-30T14:57:40.000Z | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.qtum import *
from test_framework.address import *
from test_framework.blocktools import *
import sys
imp... | 59.094488 | 1,376 | 0.780413 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.qtum import *
from test_framework.address import *
from test_framework.blocktools import *
import sys
import time
import io
impo... | true | true |
08f9076ef3ae7fb75a375196bc093d05b0c6549b | 8,888 | py | Python | utils/kubernetes/kubeutil.py | WPMedia/dd-agent | 94c9ea0dc13037c1d413847d7c9a401e226a608e | [
"BSD-3-Clause"
] | 1 | 2019-12-22T22:14:24.000Z | 2019-12-22T22:14:24.000Z | utils/kubernetes/kubeutil.py | WPMedia/dd-agent | 94c9ea0dc13037c1d413847d7c9a401e226a608e | [
"BSD-3-Clause"
] | 3 | 2021-02-08T20:55:47.000Z | 2022-03-29T22:04:12.000Z | utils/kubernetes/kubeutil.py | WPMedia/dd-agent | 94c9ea0dc13037c1d413847d7c9a401e226a608e | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2015-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict
import logging
import os
from urlparse import urljoin
# project
from util import check_yaml
from utils.checkfiles import get_conf_path
from utils.http import retrieve_... | 36.727273 | 127 | 0.615774 |
from collections import defaultdict
import logging
import os
from urlparse import urljoin
from util import check_yaml
from utils.checkfiles import get_conf_path
from utils.http import retrieve_json
from utils.singleton import Singleton
from utils.dockerutil import DockerUtil
import requests
log = logging.getLogger(... | true | true |
08f9080b1c52e6fbd1cfb71da9470054a24b1882 | 3,331 | py | Python | all_baselines/fed-dane/flearn/optimizer/pggd.py | caifederated/mlhead-release | 703fe2294f210b7259cd1404632d7757766f5a7d | [
"BSD-2-Clause"
] | 26 | 2020-04-29T10:42:40.000Z | 2022-02-16T21:11:14.000Z | all_baselines/fed-dane/flearn/optimizer/pggd.py | caifederated/mlhead-release | 703fe2294f210b7259cd1404632d7757766f5a7d | [
"BSD-2-Clause"
] | 2 | 2020-06-02T16:06:18.000Z | 2020-07-01T06:13:32.000Z | all_baselines/fed-dane/flearn/optimizer/pggd.py | caifederated/mlhead-release | 703fe2294f210b7259cd1404632d7757766f5a7d | [
"BSD-2-Clause"
] | 6 | 2020-10-12T05:26:07.000Z | 2022-02-16T21:11:16.000Z | from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.framework import ops
from tensorflow.python.training import optimizer
import tensorflow as tf
class PerGodGradientDescent(optimizer.Optimizer):
"""Implem... | 42.164557 | 121 | 0.65656 | from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.ops import state_ops
from tensorflow.python.framework import ops
from tensorflow.python.training import optimizer
import tensorflow as tf
class PerGodGradientDescent(optimizer.Optimizer):
def __ini... | true | true |
08f908118adf80bfd76a81ecdfb563390568b0cb | 520 | py | Python | src/jvicount.py | Bhaskers-Blu-Org2/jackknife-variational-inference | b6e0c8571ddcc8a47bed544ac88e023ac899b7cb | [
"MIT"
] | 8 | 2019-05-24T05:39:41.000Z | 2021-04-20T16:13:35.000Z | src/jvicount.py | nowozin/jackknife-variational-inference | b6e0c8571ddcc8a47bed544ac88e023ac899b7cb | [
"MIT"
] | null | null | null | src/jvicount.py | nowozin/jackknife-variational-inference | b6e0c8571ddcc8a47bed544ac88e023ac899b7cb | [
"MIT"
] | 6 | 2019-05-30T00:51:31.000Z | 2022-03-21T13:24:03.000Z |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
"""Count number of JVI terms for a given sample size and JVI order.
Usage:
jvicount.py <n> <order>
The sample size is n and JVI order zero corresponds to the IWAE bound.
The tool returns the total number of terms in the ... | 20.8 | 70 | 0.723077 |
"""Count number of JVI terms for a given sample size and JVI order.
Usage:
jvicount.py <n> <order>
The sample size is n and JVI order zero corresponds to the IWAE bound.
The tool returns the total number of terms in the JVI objective.
"""
from docopt import docopt
import jvi
args = docopt(__doc__, version='jvic... | false | true |
08f908bfe864c2c5c8a9e8d4b6fbc27de26acffe | 796 | py | Python | nlp_chatbot/metrics.py | robinzixuan/chatbot | f71eb2a0972563e81fd32d90bb764e91432dad27 | [
"MIT"
] | null | null | null | nlp_chatbot/metrics.py | robinzixuan/chatbot | f71eb2a0972563e81fd32d90bb764e91432dad27 | [
"MIT"
] | null | null | null | nlp_chatbot/metrics.py | robinzixuan/chatbot | f71eb2a0972563e81fd32d90bb764e91432dad27 | [
"MIT"
] | null | null | null | from . import PAD_INDEX
import numpy as np
def mlm_accuracy(predictions, targets):
mlm_predictions, nsp_predictions = predictions
mlm_targets, is_nexts = targets
relevent_indexes = np.where(mlm_targets != PAD_INDEX)
relevent_predictions = mlm_predictions[relevent_indexes]
relevent_targets = mlm_... | 27.448276 | 63 | 0.742462 | from . import PAD_INDEX
import numpy as np
def mlm_accuracy(predictions, targets):
mlm_predictions, nsp_predictions = predictions
mlm_targets, is_nexts = targets
relevent_indexes = np.where(mlm_targets != PAD_INDEX)
relevent_predictions = mlm_predictions[relevent_indexes]
relevent_targets = mlm_... | true | true |
08f90a7a646c43032c0d4df110b506fa3eee5582 | 5,626 | py | Python | chainer_chemistry/dataset/parsers/sdf_file_parser.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | null | null | null | chainer_chemistry/dataset/parsers/sdf_file_parser.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | null | null | null | chainer_chemistry/dataset/parsers/sdf_file_parser.py | delta2323/chainerchem | 364dd2b26aec2d0b25d5e2b30a9510a9d44814af | [
"MIT"
] | null | null | null | from logging import getLogger
import numpy
from rdkit import Chem
from tqdm import tqdm
from chainer_chemistry.dataset.parsers.base_parser import BaseFileParser
from chainer_chemistry.dataset.preprocessors.common import MolFeatureExtractionError # NOQA
from chainer_chemistry.dataset.preprocessors.mol_preprocessor imp... | 40.185714 | 92 | 0.54497 | from logging import getLogger
import numpy
from rdkit import Chem
from tqdm import tqdm
from chainer_chemistry.dataset.parsers.base_parser import BaseFileParser
from chainer_chemistry.dataset.preprocessors.common import MolFeatureExtractionError from chainer_chemistry.dataset.preprocessors.mol_preprocessor import Mol... | true | true |
08f90a93588d7f4bedc9dd410c84056990916866 | 2,517 | py | Python | examples/2_load_bitmex_example_data.py | muhlar/quant-reseach | b9f9a9cde94bf0ebb3d809240cc7542dfcbf7634 | [
"MIT"
] | null | null | null | examples/2_load_bitmex_example_data.py | muhlar/quant-reseach | b9f9a9cde94bf0ebb3d809240cc7542dfcbf7634 | [
"MIT"
] | null | null | null | examples/2_load_bitmex_example_data.py | muhlar/quant-reseach | b9f9a9cde94bf0ebb3d809240cc7542dfcbf7634 | [
"MIT"
] | null | null | null | import sys
import requests
import datetime
import time
import zlib
import msgpack
import helpers.helper_functions as hf
import helpers.io_helper as ioh
import helpers.datetime_helper as dh
# define the url of the endpoint
endpoint_url = "https://www.bitmex.com/api/v1/trade/bucketed"
# define where we're going to sav... | 26.776596 | 82 | 0.70004 | import sys
import requests
import datetime
import time
import zlib
import msgpack
import helpers.helper_functions as hf
import helpers.io_helper as ioh
import helpers.datetime_helper as dh
endpoint_url = "https://www.bitmex.com/api/v1/trade/bucketed"
path_save_data = "data/example_data"
filename_save_data = "{:s}/bi... | true | true |
08f90bab14b0f16cad5eee3b2b151c2fc6711698 | 49,030 | py | Python | jina/types/document/__init__.py | SriSatyaT/jina | c687fac6dbe4c9c6bd02dcdcdfaee28458222cd7 | [
"Apache-2.0"
] | null | null | null | jina/types/document/__init__.py | SriSatyaT/jina | c687fac6dbe4c9c6bd02dcdcdfaee28458222cd7 | [
"Apache-2.0"
] | null | null | null | jina/types/document/__init__.py | SriSatyaT/jina | c687fac6dbe4c9c6bd02dcdcdfaee28458222cd7 | [
"Apache-2.0"
] | 1 | 2021-07-30T07:07:01.000Z | 2021-07-30T07:07:01.000Z | import base64
import io
import json
import mimetypes
import os
import urllib.parse
import urllib.request
import warnings
from hashlib import blake2b
from typing import (
Iterable,
Union,
Dict,
Optional,
TypeVar,
Any,
Tuple,
List,
Type,
)
import numpy as np
from google.protobuf impor... | 35.684134 | 245 | 0.587926 | import base64
import io
import json
import mimetypes
import os
import urllib.parse
import urllib.request
import warnings
from hashlib import blake2b
from typing import (
Iterable,
Union,
Dict,
Optional,
TypeVar,
Any,
Tuple,
List,
Type,
)
import numpy as np
from google.protobuf impor... | true | true |
08f90c598fafd45db8dc64069a08afcfaa58e27f | 7,512 | py | Python | htcondor_tests/bjec.py | seoester/bjec | 7b5255f314cf147357062ce4438788dd1378eade | [
"MIT"
] | 1 | 2021-03-09T17:33:53.000Z | 2021-03-09T17:33:53.000Z | htcondor_tests/bjec.py | seoester/bjec | 7b5255f314cf147357062ce4438788dd1378eade | [
"MIT"
] | 3 | 2020-11-14T15:45:12.000Z | 2021-06-02T01:34:49.000Z | htcondor_tests/bjec.py | seoester/bjec | 7b5255f314cf147357062ce4438788dd1378eade | [
"MIT"
] | null | null | null | from bjec import csv, json
from bjec.params import Join, P, String
from bjec.job import job, Job
from bjec.io import WriteableFromPath
from bjec.htcondor import HTCondor, Job as HTCondorJob
from bjec.process import Environment, Process, DeferredResult
from bjec.generator import Literal, Matrix
from bjec.collector impor... | 30.536585 | 157 | 0.610091 | from bjec import csv, json
from bjec.params import Join, P, String
from bjec.job import job, Job
from bjec.io import WriteableFromPath
from bjec.htcondor import HTCondor, Job as HTCondorJob
from bjec.process import Environment, Process, DeferredResult
from bjec.generator import Literal, Matrix
from bjec.collector impor... | true | true |
08f90cee1c5732dcbf1f78164426b10f06bdacdd | 603 | py | Python | log/migrations/0005_auto_20211212_1306.py | lahodny/log-app | c0adf6ad058cb1fc2b4a5d7083c55e5690d7c559 | [
"MIT"
] | 4 | 2021-11-22T11:41:18.000Z | 2022-01-17T14:16:26.000Z | log/migrations/0005_auto_20211212_1306.py | lahodny/log-app | c0adf6ad058cb1fc2b4a5d7083c55e5690d7c559 | [
"MIT"
] | null | null | null | log/migrations/0005_auto_20211212_1306.py | lahodny/log-app | c0adf6ad058cb1fc2b4a5d7083c55e5690d7c559 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.14 on 2021-12-12 13:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('log', '0004_workouttype_icon'),
]
operations = [
migrations.AlterField(
model_name='workout',
name='description',
... | 25.125 | 99 | 0.597015 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('log', '0004_workouttype_icon'),
]
operations = [
migrations.AlterField(
model_name='workout',
name='description',
field=models.TextField(blank=True, max... | true | true |
08f90d5e4e18051481668d36e569373b88002c23 | 8,612 | py | Python | tests/test_asset.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | tests/test_asset.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | tests/test_asset.py | DiPierro/civic-scraper | de3b41f6b1609b68be75d2223f4d0c8061267246 | [
"Apache-2.0"
] | null | null | null | '''
TITLE: test_asset.py
AUTHOR: Amy DiPierro
VERSION: 2020-09-02
USAGE: pytest -q test_asset.py
Tests basic functionality of asset.py
'''
import os
import hashlib
from civic_scraper.scrapers import CivicPlusSite
import pytest
@pytest.mark.vcr()
def test_to_csv_defaults(tmp_path):
"Tests the default behavior of... | 35.440329 | 121 | 0.68811 | import os
import hashlib
from civic_scraper.scrapers import CivicPlusSite
import pytest
@pytest.mark.vcr()
def test_to_csv_defaults(tmp_path):
directory = tmp_path / "sub"
directory.mkdir()
temp_csv = directory / "temp_csv_default.csv"
... | true | true |
08f90dd513450765246fe14a8d12384a8ae67a66 | 30,253 | py | Python | tools/testSelect/testSelect.py | France-ioi/taskgrader | 72b043195af752d68cfee1d28fb52ae6012bc9a2 | [
"MIT"
] | 12 | 2015-02-19T20:09:04.000Z | 2021-12-25T13:52:17.000Z | tools/testSelect/testSelect.py | France-ioi/taskgrader | 72b043195af752d68cfee1d28fb52ae6012bc9a2 | [
"MIT"
] | 102 | 2015-08-03T14:07:46.000Z | 2022-02-18T19:56:55.000Z | tools/testSelect/testSelect.py | France-ioi/taskgrader | 72b043195af752d68cfee1d28fb52ae6012bc9a2 | [
"MIT"
] | 3 | 2016-05-12T15:03:16.000Z | 2019-07-31T14:38:24.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2016 France-IOI, MIT license
#
# http://opensource.org/licenses/MIT
# This tool select a minimal set of tests finding errors in each solution.
import argparse, glob, json, os, shutil, subprocess, sys
SELFDIR = os.path.normpath(os.path.dirname(os.path.a... | 35.802367 | 260 | 0.598585 |
import argparse, glob, json, os, shutil, subprocess, sys
SELFDIR = os.path.normpath(os.path.dirname(os.path.abspath(__file__)))
CFG_TASKGRADER = os.path.join(SELFDIR, '../../', 'taskgrader.py')
def checkData(args, data):
testCasesNames = []
for case in data['testCases'][:]:
if case.get('path... | true | true |
08f90dfd2336a31a5352a29153ad788ae3f67eda | 66 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_String_rfind()_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_String_rfind()_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/mini-scripts/Python_String_rfind()_2.txt.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | txt = "Hello, welcome to my world."
x = txt.rfind("e")
print(x)
| 11 | 35 | 0.606061 | txt = "Hello, welcome to my world."
x = txt.rfind("e")
print(x)
| true | true |
08f90f1d5abc6652e21cac332ab36afef0eb11f9 | 3,842 | py | Python | src/inverse_text_normalization/ml/taggers/measure.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 15 | 2021-07-30T18:18:47.000Z | 2022-02-14T09:04:19.000Z | src/inverse_text_normalization/ml/taggers/measure.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 1 | 2021-12-15T12:42:12.000Z | 2022-02-15T05:33:00.000Z | src/inverse_text_normalization/ml/taggers/measure.py | yashiagar1999/indict_punc | 8697ac5a5245c7e0d35b0777b1dc6fb1b8d6d525 | [
"MIT"
] | 4 | 2021-07-30T10:03:38.000Z | 2021-12-01T14:46:54.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. 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 appli... | 35.906542 | 115 | 0.637949 |
from inverse_text_normalization.ml.data_loader_utils import get_abs_path
from inverse_text_normalization.ml.graph_utils import (
NEMO_SIGMA,
GraphFst,
convert_space,
delete_extra_space,
delete_space,
get_singulars,
)
try:
import pynini
from pynini.lib import pynutil
PYNINI_AVAILAB... | true | true |
08f91046580c2395d20904063c0716d4fb7b8248 | 4,673 | py | Python | src/networks/vae.py | leyiweb/Deep-SAD-PyTorch | 4f354ec443c464731e34f4c9d4ed791f49b359cd | [
"MIT"
] | 246 | 2019-06-14T17:38:02.000Z | 2022-03-28T09:13:42.000Z | src/networks/vae.py | ZIYU-DEEP/deepSAD-custom | 90e69e0e738580d400550b544e085e38a2fa9f65 | [
"MIT"
] | 15 | 2019-11-20T15:00:17.000Z | 2022-03-11T23:51:55.000Z | src/networks/vae.py | ZIYU-DEEP/DeepSAD-with-custom-dataset | 305667c84b92167792816794f84b41273a7b41c0 | [
"MIT"
] | 76 | 2019-07-05T09:35:32.000Z | 2022-02-28T07:52:18.000Z | import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from .layers.stochastic import GaussianSample
from .inference.distributions import log_standard_gaussian, log_gaussian
# Acknowledgements: https://github.com/wohlert/semi-supervised-pytorch
class Encoder(nn.Module):
"""
Encoder, ... | 32.006849 | 117 | 0.619088 | import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from .layers.stochastic import GaussianSample
from .inference.distributions import log_standard_gaussian, log_gaussian
class Encoder(nn.Module):
def __init__(self, dims, sample_layer=GaussianSample):
super(Encoder, self).__i... | true | true |
08f9109269ef8b072314b5779d8cb3fbd3490199 | 727 | py | Python | OpenGLCffi/GLES3/EXT/IMG/bindless_texture.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GLES3/EXT/IMG/bindless_texture.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | OpenGLCffi/GLES3/EXT/IMG/bindless_texture.py | cydenix/OpenGLCffi | c78f51ae5e6b655eb2ea98f072771cf69e2197f3 | [
"MIT"
] | null | null | null | from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['texture'])
def glGetTextureHandleIMG(texture):
pass
@params(api='gles3', prms=['texture', 'sampler'])
def glGetTextureSamplerHandleIMG(texture, sampler):
pass
@params(api='gles3', prms=['location', 'value'])
def glUniformHandleui64IMG(location, value... | 22.71875 | 69 | 0.729023 | from OpenGLCffi.GLES3 import params
@params(api='gles3', prms=['texture'])
def glGetTextureHandleIMG(texture):
pass
@params(api='gles3', prms=['texture', 'sampler'])
def glGetTextureSamplerHandleIMG(texture, sampler):
pass
@params(api='gles3', prms=['location', 'value'])
def glUniformHandleui64IMG(location, value... | true | true |
08f9110ef61a1bb95e78065fdb13368792068374 | 6,755 | py | Python | bindings/python/ensmallen_graph/datasets/string/granulicatellaadiacens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/granulicatellaadiacens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/granulicatellaadiacens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Granulicatella adiacens.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... | 35.366492 | 223 | 0.706588 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def GranulicatellaAdiacens(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
08f912437dc80b333a7b03731ddc87da77303905 | 647 | py | Python | sequences.py | chapman-cs510-2017f/cw-03-kris_ehsan_evan | befc0b448b81523f82a419b173999facc7dde46b | [
"MIT"
] | null | null | null | sequences.py | chapman-cs510-2017f/cw-03-kris_ehsan_evan | befc0b448b81523f82a419b173999facc7dde46b | [
"MIT"
] | null | null | null | sequences.py | chapman-cs510-2017f/cw-03-kris_ehsan_evan | befc0b448b81523f82a419b173999facc7dde46b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
def fibonacci(n):
count = 0
while True:
try:
if count >= 1:
n = int(input("enter a positve integer: "))
my_list = []
a,b = 0,1
for i in range(n):
a,b = b,a+b
... | 22.310345 | 91 | 0.502318 | import sys
def fibonacci(n):
count = 0
while True:
try:
if count >= 1:
n = int(input("enter a positve integer: "))
my_list = []
a,b = 0,1
for i in range(n):
a,b = b,a+b
my_list.append(a)
... | true | true |
08f91251d480818cb917dac0121e72e7c4113dae | 76 | py | Python | tests/asp/gringo/choice.008.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 19 | 2015-12-03T08:53:45.000Z | 2022-03-31T02:09:43.000Z | tests/asp/gringo/choice.008.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 80 | 2017-11-25T07:57:32.000Z | 2018-06-10T19:03:30.000Z | tests/asp/gringo/choice.008.test.py | bernardocuteri/wasp | 05c8f961776dbdbf7afbf905ee00fc262eba51ad | [
"Apache-2.0"
] | 6 | 2015-01-15T07:51:48.000Z | 2020-06-18T14:47:48.000Z | input = """
{a,b} :- c.
c | d.
:- not a.
:- b.
"""
output = """
{a, c}
"""
| 6.909091 | 12 | 0.302632 | input = """
{a,b} :- c.
c | d.
:- not a.
:- b.
"""
output = """
{a, c}
"""
| true | true |
08f9126371c0f909e96999ed9801f62204a9c597 | 3,322 | py | Python | mmf/models/transformers/heads/mlp.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | 3,252 | 2018-07-27T02:32:24.000Z | 2020-05-07T17:54:46.000Z | mmf/models/transformers/heads/mlp.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | 914 | 2020-05-07T18:36:26.000Z | 2022-03-31T05:45:26.000Z | mmf/models/transformers/heads/mlp.py | sisilmehta2000/mmf | ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4 | [
"BSD-3-Clause"
] | 490 | 2020-05-07T20:05:10.000Z | 2022-03-31T14:17:23.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import copy
from dataclasses import dataclass
from typing import Dict, List, Optional
import torch
from mmf.common.registry import registry
from mmf.models.transformers.base import BaseTransformerHead
from mmf.modules import layers
from omegaconf import OmegaConf, op... | 36.505495 | 84 | 0.677604 |
import copy
from dataclasses import dataclass
from typing import Dict, List, Optional
import torch
from mmf.common.registry import registry
from mmf.models.transformers.base import BaseTransformerHead
from mmf.modules import layers
from omegaconf import OmegaConf, open_dict
from torch import nn
from transformers.mode... | true | true |
08f912dd6d5bb36fb81a4eb1f654a32db7892a5a | 710 | py | Python | Class_4.py | SimranSwain/OOPs-in-Python | 43bbe8be59f30ec71111a164b741bd4115e96f3d | [
"MIT"
] | null | null | null | Class_4.py | SimranSwain/OOPs-in-Python | 43bbe8be59f30ec71111a164b741bd4115e96f3d | [
"MIT"
] | null | null | null | Class_4.py | SimranSwain/OOPs-in-Python | 43bbe8be59f30ec71111a164b741bd4115e96f3d | [
"MIT"
] | null | null | null | class Student:
def __init__(self, firstname, lastname, age, bunk_classes, code_day):
self.fn = firstname
self.ln = lastname
self.age = age
self.bc = bunk_classes
self.cd = code_day
def student_details(self):
return f'The student name is {self.fn}, {self.... | 35.5 | 103 | 0.61831 | class Student:
def __init__(self, firstname, lastname, age, bunk_classes, code_day):
self.fn = firstname
self.ln = lastname
self.age = age
self.bc = bunk_classes
self.cd = code_day
def student_details(self):
return f'The student name is {self.fn}, {self.... | true | true |
08f91336dad245f4c5c73c21a4c28d939a8d35d4 | 461 | py | Python | tests/websocketevent_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 19 | 2015-02-06T13:31:25.000Z | 2021-03-19T03:36:09.000Z | tests/websocketevent_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 3 | 2017-10-05T18:20:26.000Z | 2021-04-24T15:06:36.000Z | tests/websocketevent_tests.py | fanout/pygripcontrol | e139d29203a0bdb5d44904a517a81e3a9c400735 | [
"MIT"
] | 5 | 2016-10-08T10:30:07.000Z | 2017-10-06T20:30:17.000Z | import sys
import unittest
sys.path.append('../')
from src.websocketevent import WebSocketEvent
class TestWebSocketEvent(unittest.TestCase):
def test_initialize(self):
event = WebSocketEvent('type')
self.assertEqual(event.type, 'type');
self.assertEqual(event.content, None);
event = WebSocketEvent('type', 'c... | 25.611111 | 45 | 0.741866 | import sys
import unittest
sys.path.append('../')
from src.websocketevent import WebSocketEvent
class TestWebSocketEvent(unittest.TestCase):
def test_initialize(self):
event = WebSocketEvent('type')
self.assertEqual(event.type, 'type');
self.assertEqual(event.content, None);
event = WebSocketEvent('type', 'c... | true | true |
08f913d531a26c49c405bba1f44ddbc2b36ab03c | 272 | py | Python | materials/ch_03/Integers.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | materials/ch_03/Integers.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | materials/ch_03/Integers.py | epsilonxe/RMUTT_09090016 | 863dd8a6471b560831b742da4aec27209c294df5 | [
"MIT"
] | null | null | null | '''
Binary เลขฐานสอง: 0, 1 --> 100100001
Octal เลขฐานแปด: 0, 1, 2, ..., 7 --> 312345, 4237
Decimal เลขฐานสิบ: 0, 1, 2, ..., 9 --> 2564, 2010
Hexadecimal เลขฐานสิบหก:
0, 1, 2, ..., 9, A(10), B(11), C(12), D(13), E(14), F(15)
--> 541B5F0E == 541b5f0e
--> 544324234
''' | 20.923077 | 57 | 0.547794 | true | true | |
08f913f2264f0426caf68d0ae646c8b02a8c1967 | 2,912 | py | Python | src/minecraft/__init__.py | Acropolis/eorzeas-only-hope | c6c0f84066ddb84dace44954e229203a478b43b3 | [
"BSD-2-Clause"
] | null | null | null | src/minecraft/__init__.py | Acropolis/eorzeas-only-hope | c6c0f84066ddb84dace44954e229203a478b43b3 | [
"BSD-2-Clause"
] | 3 | 2020-11-20T09:34:36.000Z | 2021-11-15T20:52:56.000Z | src/minecraft/__init__.py | Acropolis/eorzeas-only-hope | c6c0f84066ddb84dace44954e229203a478b43b3 | [
"BSD-2-Clause"
] | 4 | 2020-03-04T08:56:10.000Z | 2021-04-02T20:11:25.000Z | #!/usr/bin/env python3
"""Minecraft Bot Commands"""
from __future__ import annotations
import math
import bot.commands
from bot.commands import MessageContext
class Pillars(bot.commands.ParamCommand):
"""Calculates even pillar arrangement for Minecraft"""
def __init__(self) -> None:
super().__ini... | 26 | 94 | 0.562157 |
from __future__ import annotations
import math
import bot.commands
from bot.commands import MessageContext
class Pillars(bot.commands.ParamCommand):
def __init__(self) -> None:
super().__init__("pillars", 1, 2)
async def process_args(
self, context: bot.commands.MessageContext, *args: st... | true | true |
08f9156ec28a6cd8923e2fc8a4da8cd6abf1b4f0 | 2,470 | py | Python | checkout/migrations/0003_auto_20160818_2257.py | Renanf68/gir_ecommerce | df7199a3863d3927c48f6428b72dc006389e5294 | [
"CC0-1.0"
] | null | null | null | checkout/migrations/0003_auto_20160818_2257.py | Renanf68/gir_ecommerce | df7199a3863d3927c48f6428b72dc006389e5294 | [
"CC0-1.0"
] | null | null | null | checkout/migrations/0003_auto_20160818_2257.py | Renanf68/gir_ecommerce | df7199a3863d3927c48f6428b72dc006389e5294 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-19 01:57
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... | 45.740741 | 171 | 0.605263 | from __future__ import unicode_literals
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),
('catalog', '0001_initial'),
... | true | true |
08f9158600206bf044339840b08af65045154157 | 643 | py | Python | 2020-11-07/pipoca.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | 2 | 2020-12-12T00:02:40.000Z | 2021-04-21T19:49:59.000Z | 2020-11-07/pipoca.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | null | null | null | 2020-11-07/pipoca.py | pufe/programa | 7f79566597446e9e39222e6c15fa636c3dd472bb | [
"MIT"
] | null | null | null | n, c, t = [int(x) for x in input().split()]
sacos = [int(x) for x in input().split()]
def possivel(x):
total = x*t
competidor = 0
pessoas = 1
for i in range(n):
if sacos[i] > total:
return False
elif competidor+sacos[i] > total:
pessoas += 1
... | 22.964286 | 44 | 0.496112 | n, c, t = [int(x) for x in input().split()]
sacos = [int(x) for x in input().split()]
def possivel(x):
total = x*t
competidor = 0
pessoas = 1
for i in range(n):
if sacos[i] > total:
return False
elif competidor+sacos[i] > total:
pessoas += 1
... | true | true |
08f915fed89e3b45656abee75df4605c11dcd1aa | 1,427 | py | Python | CS225/groupCode/CA2/testDataBase.py | debugevent90901/courseArchive | 1585c9a0f4a1884c143973dcdf416514eb30aded | [
"MIT"
] | null | null | null | CS225/groupCode/CA2/testDataBase.py | debugevent90901/courseArchive | 1585c9a0f4a1884c143973dcdf416514eb30aded | [
"MIT"
] | null | null | null | CS225/groupCode/CA2/testDataBase.py | debugevent90901/courseArchive | 1585c9a0f4a1884c143973dcdf416514eb30aded | [
"MIT"
] | null | null | null | ###############################################################
#######################Ignore this file########################
###############################################################
# this is the testing database for the stack machine
# not the formal one
class TestDB():
def __init__(self):
self.d... | 31.711111 | 63 | 0.457603 | class TestDB():
def __init__(self):
self.data = {}
self.schemas = {}
def newList(self, name, schema):
if not (name in self.schemas):
self.schemas[name] = schema
self.data[name] = []
else:
print("list exist")
def addData(self, name, data):... | true | true |
08f916e4ff726db60b5b9a99320da6b1522efe7c | 8,096 | py | Python | fluid/status.py | PaulDodd/signac-flow-project-helpers | 208c7c8da52c4b0108c3989c77423cc5ff86ba59 | [
"MIT"
] | 1 | 2017-05-30T14:22:59.000Z | 2017-05-30T14:22:59.000Z | fluid/status.py | PaulDodd/signac-flow-project-helpers | 208c7c8da52c4b0108c3989c77423cc5ff86ba59 | [
"MIT"
] | null | null | null | fluid/status.py | PaulDodd/signac-flow-project-helpers | 208c7c8da52c4b0108c3989c77423cc5ff86ba59 | [
"MIT"
] | null | null | null | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
#
#
# def is_active(status):
# for gid, s in status.items():
# if s > manage.JobStatus.inactive:
# return True
# return False
#
#
# def draw_progr... | 38.923077 | 95 | 0.534338 | # progress = defaultdict(int)
# for status in stati:
# for label in status['labels']:
# progress[label] += 1
# progress_sorted = islice(sorted(
# progress.items(), key=lambda x: (x[1], x[0]), reverse=True), max_lines)
# table_header = ['label', 'pr... | true | true |
08f91779a5ac7cad57158b95fbf3a1f72b308dd0 | 1,763 | py | Python | .install/.backup/platform/gsutil/gslib/third_party/oauth2_plugin/oauth2_plugin.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | .install/.backup/platform/gsutil/gslib/third_party/oauth2_plugin/oauth2_plugin.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | null | null | null | .install/.backup/platform/gsutil/gslib/third_party/oauth2_plugin/oauth2_plugin.py | bopopescu/google-cloud-sdk | b34e6a18f1e89673508166acce816111c3421e4b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:04:47.000Z | 2020-07-24T20:04:47.000Z | from boto.auth_handler import AuthHandler
from boto.auth_handler import NotReadyToAuthenticate
import oauth2_client
import oauth2_helper
from gslib.cred_types import CredTypes
IS_SERVICE_ACCOUNT = False
class OAuth2Auth(AuthHandler):
capability = ['google-oauth2', 's3']
def __init__(self, path, config, provide... | 35.979592 | 79 | 0.724901 | from boto.auth_handler import AuthHandler
from boto.auth_handler import NotReadyToAuthenticate
import oauth2_client
import oauth2_helper
from gslib.cred_types import CredTypes
IS_SERVICE_ACCOUNT = False
class OAuth2Auth(AuthHandler):
capability = ['google-oauth2', 's3']
def __init__(self, path, config, provide... | true | true |
08f918dd0f2c533a7d8b383be80d6097726b532c | 2,158 | py | Python | test/functional/rpc_estimatefee.py | tokyocoin-project/tokyocoin | 48cbabf73f0687cc04b6658cf69aba65aa1b997d | [
"MIT"
] | null | null | null | test/functional/rpc_estimatefee.py | tokyocoin-project/tokyocoin | 48cbabf73f0687cc04b6658cf69aba65aa1b997d | [
"MIT"
] | null | null | null | test/functional/rpc_estimatefee.py | tokyocoin-project/tokyocoin | 48cbabf73f0687cc04b6658cf69aba65aa1b997d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Tokyocoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the estimatefee RPCs.
Test the following RPCs:
- estimatesmartfee
- estimaterawfee
"""
f... | 41.5 | 167 | 0.709917 |
from test_framework.test_framework import TokyocoinTestFramework
from test_framework.util import assert_raises_rpc_error
class EstimateFeeTest(TokyocoinTestFramework):
def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
def run_test(self):
assert_raise... | true | true |
08f919a758d0a984f4d15a658f5e9d6ae2ce4b9a | 4,981 | py | Python | applications/examples/controllers/database_examples.py | trosa/listool | f175c6e30bcc788a381a92c3a8b818a1f1a88de6 | [
"BSD-3-Clause"
] | 1 | 2017-08-11T20:37:21.000Z | 2017-08-11T20:37:21.000Z | applications/examples/controllers/database_examples.py | trosa/listool | f175c6e30bcc788a381a92c3a8b818a1f1a88de6 | [
"BSD-3-Clause"
] | null | null | null | applications/examples/controllers/database_examples.py | trosa/listool | f175c6e30bcc788a381a92c3a8b818a1f1a88de6 | [
"BSD-3-Clause"
] | null | null | null |
response.menu = [['Register User', False, URL(r=request,
f='register_user')], ['Register Dog', False,
URL('register_dog')], ['Register Product'
, False, URL('register_product')],
['Buy product', False, URL('buy')]]
def register_user():
""" simpl... | 32.555556 | 75 | 0.583216 |
response.menu = [['Register User', False, URL(r=request,
f='register_user')], ['Register Dog', False,
URL('register_dog')], ['Register Product'
, False, URL('register_product')],
['Buy product', False, URL('buy')]]
def register_user():
for... | true | true |
08f91a1bb4472aa9d42a04aa99b5b654cf93f039 | 113 | py | Python | problems/reverse-bits/solution-1.py | MleMoe/LeetCode-1 | 14f275ba3c8079b820808da17c4952fcf9c8253c | [
"MIT"
] | 2 | 2021-03-25T01:58:55.000Z | 2021-08-06T12:47:13.000Z | problems/reverse-bits/solution-1.py | MleMoe/LeetCode-1 | 14f275ba3c8079b820808da17c4952fcf9c8253c | [
"MIT"
] | 3 | 2019-08-27T13:25:42.000Z | 2021-08-28T17:49:34.000Z | problems/reverse-bits/solution-1.py | MleMoe/LeetCode-1 | 14f275ba3c8079b820808da17c4952fcf9c8253c | [
"MIT"
] | 1 | 2021-08-14T08:49:39.000Z | 2021-08-14T08:49:39.000Z | class Solution:
def reverseBits(self, n: int) -> int:
return int(bin(n)[2:].zfill(32)[::-1], base=2)
| 28.25 | 54 | 0.575221 | class Solution:
def reverseBits(self, n: int) -> int:
return int(bin(n)[2:].zfill(32)[::-1], base=2)
| true | true |
08f91c02004c365cc0238a3124a4f767f8034226 | 77 | py | Python | python/testData/refactoring/move/conditionalImportFromPackage/after/src/mod1.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/refactoring/move/conditionalImportFromPackage/after/src/mod1.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/refactoring/move/conditionalImportFromPackage/after/src/mod1.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | if True:
import pkgutil
else:
import mod2 as pkgutil
print(pkgutil)
| 11 | 26 | 0.701299 | if True:
import pkgutil
else:
import mod2 as pkgutil
print(pkgutil)
| true | true |
08f91ce7af25322c32d947df08dd033a01542312 | 10,188 | py | Python | karbor-1.3.0/karbor/api/v1/restores.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | karbor-1.3.0/karbor/api/v1/restores.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | karbor-1.3.0/karbor/api/v1/restores.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # 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
# d... | 37.047273 | 78 | 0.619749 |
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import uuidutils
from webob import exc
from karbor.api import common
from karbor.api.openstack import wsgi
from karbor.api.schemas import restores as restore_schema
from karbor.api import validation
from karbor.common import constants
f... | true | true |
08f91d447399d43c381bedfe482776af237bf483 | 68,758 | py | Python | ironic/tests/unit/drivers/modules/test_agent_base_vendor.py | bacaldwell/ironic | 8cefa2b73639741fe7d631835aa23dc679a46703 | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/drivers/modules/test_agent_base_vendor.py | bacaldwell/ironic | 8cefa2b73639741fe7d631835aa23dc679a46703 | [
"Apache-2.0"
] | null | null | null | ironic/tests/unit/drivers/modules/test_agent_base_vendor.py | bacaldwell/ironic | 8cefa2b73639741fe7d631835aa23dc679a46703 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2015 Red Hat, 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... | 48.015363 | 79 | 0.614038 |
import copy
import time
import types
import mock
from ironic.common import boot_devices
from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.conductor import utils as manager_utils
from ironic.drivers.modules import agent_base_vendor
from ironic.d... | true | true |
08f91d47077ab83ddb860e4c5fe4ead93015dc2a | 45 | py | Python | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer/wrong_answer_dynamic_input_4/main.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer/wrong_answer_dynamic_input_4/main.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | 5 | 2021-04-08T22:02:15.000Z | 2022-02-10T14:53:45.000Z | .idea/VirtualEnvironment/Lib/site-packages/tests/outcomes/wrong_answer/wrong_answer_dynamic_input_4/main.py | Vladpetr/NewsPortal | cd4127fbc09d9c8f5e65c8ae699856c6d380a320 | [
"Apache-2.0"
] | null | null | null | print(input())
print(input())
print(input())
| 11.25 | 14 | 0.666667 | print(input())
print(input())
print(input())
| true | true |
08f91f4e81ac534aefdaaf219385d63036a7cc6f | 11,783 | py | Python | testplan/exporters/testing/pdf/renderers/reports.py | raoyitao/testplan | aae3e9cee597ca3d01b6d64eed2642c421c56cbb | [
"Apache-2.0"
] | 96 | 2018-03-14T13:14:50.000Z | 2021-01-14T08:26:08.000Z | testplan/exporters/testing/pdf/renderers/reports.py | raoyitao/testplan | aae3e9cee597ca3d01b6d64eed2642c421c56cbb | [
"Apache-2.0"
] | 135 | 2018-06-28T02:41:05.000Z | 2021-01-19T02:16:58.000Z | testplan/exporters/testing/pdf/renderers/reports.py | raoyitao/testplan | aae3e9cee597ca3d01b6d64eed2642c421c56cbb | [
"Apache-2.0"
] | 53 | 2018-03-17T14:39:15.000Z | 2021-01-21T10:54:13.000Z | """PDF Renderer classes for test report objects"""
import os
import logging
from reportlab.lib import colors
from testplan.common.exporters.pdf import RowStyle
from testplan.common.utils.registry import Registry
from testplan.common.utils.strings import format_description, wrap, split_text
from testplan.report import... | 31.505348 | 79 | 0.542052 | import os
import logging
from reportlab.lib import colors
from testplan.common.exporters.pdf import RowStyle
from testplan.common.utils.registry import Registry
from testplan.common.utils.strings import format_description, wrap, split_text
from testplan.report import (
Status,
TestReport,
TestGroupReport,... | true | true |
08f91f9258fab33f56e591af9b672d353aaef5f4 | 1,822 | py | Python | WarmUp/plt_specgram.py | tam17aki/speech_process_exercise | 5acca627fac3114e75749d5e272405b33eee2e04 | [
"MIT"
] | 74 | 2020-06-08T04:31:22.000Z | 2022-03-21T06:51:20.000Z | WarmUp/plt_specgram.py | theLittleTiger/speech_process_exercise | c241becdf0ab1f79f65fc445513df3e0fe7638b7 | [
"MIT"
] | null | null | null | WarmUp/plt_specgram.py | theLittleTiger/speech_process_exercise | c241becdf0ab1f79f65fc445513df3e0fe7638b7 | [
"MIT"
] | 5 | 2020-07-14T16:41:06.000Z | 2022-03-30T23:22:03.000Z | #!/usr/bin/env python3
""" 音声情報処理 n本ノック !! """
# MIT License
# Copyright (C) 2020 by Akira TAMAMORI
# 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... | 29.387097 | 74 | 0.760703 |
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
# The above copyright notice and this permission notice shall be
#... | true | true |
08f92135286aa5c7a2a1afb400ba14a9a75cf52b | 2,555 | py | Python | composer/core/precision.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | composer/core/precision.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | composer/core/precision.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
"""Enum class for the numerical precision to be used by the model."""
import contextlib
from typing import Generator, Union
import torch
from packaging import version
from composer.utils.string_enum import StringEnum
__all__ = ["Precision", "get_precision_context"]
... | 35.486111 | 108 | 0.67045 |
import contextlib
from typing import Generator, Union
import torch
from packaging import version
from composer.utils.string_enum import StringEnum
__all__ = ["Precision", "get_precision_context"]
class Precision(StringEnum):
AMP = "amp"
FP16 = "fp16"
FP32 = "fp32"
BF16 = "bf16"
@contextlib.cont... | true | true |
08f921e68be3c70b1d65507ab17548c30157eb18 | 13,723 | py | Python | AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py | LB-JakubSkoczylas/o3de | 4cf384c2c555919e9e234c02c4d87fa0aef21840 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py | LB-JakubSkoczylas/o3de | 4cf384c2c555919e9e234c02c4d87fa0aef21840 | [
"Apache-2.0",
"MIT"
] | null | null | null | AutomatedTesting/Gem/PythonTests/atom_renderer/atom_hydra_scripts/hydra_GPUTest_LightComponent.py | LB-JakubSkoczylas/o3de | 4cf384c2c555919e9e234c02c4d87fa0aef21840 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
Hydra script that is used to create an entity with a Light component attached.
It then updates the property values ... | 51.01487 | 119 | 0.754573 | import os
import sys
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.math as math
import azlmbr.paths
import azlmbr.legacy.general as general
sys.path.append(os.path.join(azlmbr.paths.devroot, "AutomatedTesting", "Gem", "PythonTests"))
import editor_python_test_tool... | true | true |
08f9228b25c2a051346b3cda7297f90a11e01c6e | 4,947 | py | Python | greentest/test__greenio.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | greentest/test__greenio.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | greentest/test__greenio.py | patricklx/gevent | 4bfd06c708e7f408a086398babe8edeb9e74b094 | [
"MIT"
] | null | null | null | # Copyright (c) 2006-2007, Linden Research, Inc.
# 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, pu... | 37.763359 | 85 | 0.576511 |
from greentest import TestCase, main, tcp_listener
import gevent
from gevent import socket
from gevent.hub import PY3
import sys
PYPY = hasattr(sys, 'pypy_version_info')
class TestGreenIo(TestCase):
def test_close_with_makefile(self):
def accept_close_early(listener):
... | true | true |
08f9230f245446a8dc9356fddcfee3c7e1b5a1e2 | 372 | py | Python | 8/8.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | 8/8.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | 8/8.1.py | BillZong/CorePythonProgrammingDemos | c97b6f2c1533a3eeaf35d2de39902b95e969a411 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Exercise answer 8.1 for chapter 8."""
def if_state_pass(x):
"""Check the statement routine."""
print 'A'
if x > 0:
print 'B'
pass
elif x < 0:
print 'C'
pass
else:
print 'D'
pass
print 'E'
if_state_pass(1)
print ''
i... | 14.307692 | 40 | 0.526882 |
"""Exercise answer 8.1 for chapter 8."""
def if_state_pass(x):
"""Check the statement routine."""
print 'A'
if x > 0:
print 'B'
pass
elif x < 0:
print 'C'
pass
else:
print 'D'
pass
print 'E'
if_state_pass(1)
print ''
if_state_pass(-1)
print... | false | true |
08f923f25721c892d0d94900388510f59042498f | 443 | py | Python | backend/rflocator/serializers.py | ffedoroff/rflocator | bba6285dd5872bbce79355689f572bdee48ca613 | [
"MIT"
] | null | null | null | backend/rflocator/serializers.py | ffedoroff/rflocator | bba6285dd5872bbce79355689f572bdee48ca613 | [
"MIT"
] | null | null | null | backend/rflocator/serializers.py | ffedoroff/rflocator | bba6285dd5872bbce79355689f572bdee48ca613 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .model.clientdata import ClientData
class ClientDataSerializerShort(serializers.ModelSerializer):
class Meta:
model = ClientData
fields = ('id', 'created', 'loc_lat', 'loc_lon', 'loc_acc', 'loc_spd',
'source', 'ups', 'batt')
class Cl... | 26.058824 | 78 | 0.672686 | from rest_framework import serializers
from .model.clientdata import ClientData
class ClientDataSerializerShort(serializers.ModelSerializer):
class Meta:
model = ClientData
fields = ('id', 'created', 'loc_lat', 'loc_lon', 'loc_acc', 'loc_spd',
'source', 'ups', 'batt')
class Cl... | true | true |
08f92446e98cc6e65adcf364c781396943368a38 | 3,904 | py | Python | api/applications/serializers.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | api/applications/serializers.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | api/applications/serializers.py | sf2ne/Playground | 95b2d222d7ac43baca0249acbfc34e043d6a95b3 | [
"Apache-2.0"
] | null | null | null | from django.core.validators import URLValidator
from rest_framework import serializers as ser
from modularodm import Q
from website.models import ApiOAuth2Application
from api.base.serializers import JSONAPISerializer, LinksField, IDField, TypeField
from api.base.utils import absolute_reverse
class ApiOAuthApplicat... | 40.247423 | 126 | 0.663166 | from django.core.validators import URLValidator
from rest_framework import serializers as ser
from modularodm import Q
from website.models import ApiOAuth2Application
from api.base.serializers import JSONAPISerializer, LinksField, IDField, TypeField
from api.base.utils import absolute_reverse
class ApiOAuthApplicat... | true | true |
08f9244a10000fa2f18dcebb0d896c648aa6bbea | 6,057 | py | Python | secretmanager/api-client/snippets_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 1 | 2020-05-07T02:21:17.000Z | 2020-05-07T02:21:17.000Z | secretmanager/api-client/snippets_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | null | null | null | secretmanager/api-client/snippets_test.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 1 | 2021-10-23T01:22:02.000Z | 2021-10-23T01:22:02.000Z | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 31.546875 | 78 | 0.766056 |
import os
import pytest
import uuid
from quickstart import quickstart
from access_secret_version import access_secret_version
from add_secret_version import add_secret_version
from create_secret import create_secret
from delete_secret import delete_secret
from destroy_secret_version import destroy_secret_version
from... | true | true |
08f924776d98ea11da3b7cd72bf8d09cdc685293 | 955 | py | Python | src/core/generate_swizzles.py | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 31 | 2020-11-21T08:16:53.000Z | 2021-09-05T13:46:32.000Z | src/core/generate_swizzles.py | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 1 | 2021-03-08T04:15:26.000Z | 2021-03-19T04:40:02.000Z | src/core/generate_swizzles.py | shiinamiyuki/LuisaCompute | f8358f8ec138950a84f570c0ede24cc76fc159de | [
"BSD-3-Clause"
] | 4 | 2020-12-02T09:41:22.000Z | 2021-03-06T06:36:40.000Z | def generate(file, dim):
entries = ["x", "y", "z", "w"][:dim]
for x in entries:
for y in entries:
print(f"[[nodiscard]] auto {x}{y}() const noexcept {{ return Vector<T, 2>{{{x}, {y}}}; }}", file=file)
for x in entries:
for y in entries:
for z in entries:
... | 38.2 | 115 | 0.452356 | def generate(file, dim):
entries = ["x", "y", "z", "w"][:dim]
for x in entries:
for y in entries:
print(f"[[nodiscard]] auto {x}{y}() const noexcept {{ return Vector<T, 2>{{{x}, {y}}}; }}", file=file)
for x in entries:
for y in entries:
for z in entries:
... | true | true |
08f924cf29b9baa2417282e25bb8c570c0a91f17 | 678 | py | Python | extmod/uasyncio/__init__.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 49 | 2020-07-22T14:41:53.000Z | 2022-01-24T00:27:58.000Z | extmod/uasyncio/__init__.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 176 | 2020-10-18T14:31:03.000Z | 2022-03-30T23:22:39.000Z | extmod/uasyncio/__init__.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 13 | 2019-07-30T10:17:10.000Z | 2022-02-08T08:04:52.000Z | # MicroPython uasyncio module
# MIT license; Copyright (c) 2019 Damien P. George
from .core import *
__version__ = (3, 0, 0)
_attrs = {
"wait_for": "funcs",
"wait_for_ms": "funcs",
"gather": "funcs",
"Event": "event",
"Lock": "lock",
"open_connection": "stream",
"start_server": "stream",
... | 22.6 | 63 | 0.622419 |
from .core import *
__version__ = (3, 0, 0)
_attrs = {
"wait_for": "funcs",
"wait_for_ms": "funcs",
"gather": "funcs",
"Event": "event",
"Lock": "lock",
"open_connection": "stream",
"start_server": "stream",
"StreamReader": "stream",
"StreamWriter": "stream",
}
def __getattr__(at... | true | true |
08f9256642443151ccea834b78a713b07cbafc18 | 1,068 | py | Python | features/example_functions.py | CRitter93/beehyve | 8e21dda571cfecb8ec903b8db79e200d744806a2 | [
"BSD-3-Clause"
] | 1 | 2022-03-16T09:36:54.000Z | 2022-03-16T09:36:54.000Z | features/example_functions.py | CRitter93/beehyve | 8e21dda571cfecb8ec903b8db79e200d744806a2 | [
"BSD-3-Clause"
] | 1 | 2022-02-23T15:14:43.000Z | 2022-02-23T15:41:01.000Z | features/example_functions.py | CRitter93/beehyve | 8e21dda571cfecb8ec903b8db79e200d744806a2 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
def add_2_to_dataframe(df, col):
df = df.copy()
df[col] = df[col] + 2
return df
def create_new_df(fill_val=0):
return pd.DataFrame(
{col: [fill_val for _ in range(3)] for col in ("col_a", "col_b", "col_c")}
)
def join_args(*args):
return ".".join(args)
def joi... | 20.538462 | 82 | 0.598315 | import pandas as pd
def add_2_to_dataframe(df, col):
df = df.copy()
df[col] = df[col] + 2
return df
def create_new_df(fill_val=0):
return pd.DataFrame(
{col: [fill_val for _ in range(3)] for col in ("col_a", "col_b", "col_c")}
)
def join_args(*args):
return ".".join(args)
def joi... | true | true |
08f925d25d4591dbb6f3368691e2530fbada749b | 1,651 | py | Python | gitfs/utils/path.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | gitfs/utils/path.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | gitfs/utils/path.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 PressLabs SRL
#
# 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,... | 28.465517 | 77 | 0.658389 |
import os
from collections import deque
def split_path_into_components(path):
head, tail = os.path.split(path)
if not tail:
return []
components = deque()
components.appendleft(tail)
path = head
while path and path != '/':
head, tail = os.path.split(path)
componen... | true | true |
08f92698ed9a07faf03c9432c7939bc35349fb6b | 48,941 | py | Python | pandas/_testing/asserters.py | dycloud-chan/pandas | 39ccb352b53e9b5b694c4f7f044774f9c3677e98 | [
"BSD-3-Clause"
] | 1 | 2021-03-29T05:44:01.000Z | 2021-03-29T05:44:01.000Z | pandas/_testing/asserters.py | dycloud-chan/pandas | 39ccb352b53e9b5b694c4f7f044774f9c3677e98 | [
"BSD-3-Clause"
] | null | null | null | pandas/_testing/asserters.py | dycloud-chan/pandas | 39ccb352b53e9b5b694c4f7f044774f9c3677e98 | [
"BSD-3-Clause"
] | 1 | 2020-01-03T17:02:48.000Z | 2020-01-03T17:02:48.000Z | from __future__ import annotations
from typing import cast
import warnings
import numpy as np
from pandas._libs.lib import (
NoDefault,
no_default,
)
from pandas._libs.missing import is_matching_na
import pandas._libs.testing as _testing
from pandas.util._exceptions import find_stack_level
from pandas.core.... | 33.202849 | 88 | 0.635582 | from __future__ import annotations
from typing import cast
import warnings
import numpy as np
from pandas._libs.lib import (
NoDefault,
no_default,
)
from pandas._libs.missing import is_matching_na
import pandas._libs.testing as _testing
from pandas.util._exceptions import find_stack_level
from pandas.core.... | true | true |
08f9281e63a1106e6a70d274ea6125f7c2e78737 | 1,907 | py | Python | examples/coapput.py | okoye/COAP | a12aef1b45555bc23c9b6788a215db7c10f41063 | [
"BSD-3-Clause"
] | 3 | 2015-06-15T17:57:25.000Z | 2018-04-22T18:13:43.000Z | examples/coapput.py | okoye/COAP | a12aef1b45555bc23c9b6788a215db7c10f41063 | [
"BSD-3-Clause"
] | null | null | null | examples/coapput.py | okoye/COAP | a12aef1b45555bc23c9b6788a215db7c10f41063 | [
"BSD-3-Clause"
] | null | null | null | import sys
import getopt
import coapy.connection
import time
uri_path = 'sink'
host = 'ns.tzi.org'
port = 61616
verbose = False
try:
opts, args = getopt.getopt(sys.argv[1:], 'u:h:p:v', [ 'uri-path=', 'host=', 'port=', 'verbose' ])
for (o, a) in opts:
if o in ('-u', '--uri-path'):
uri_path ... | 29.338462 | 101 | 0.593603 | import sys
import getopt
import coapy.connection
import time
uri_path = 'sink'
host = 'ns.tzi.org'
port = 61616
verbose = False
try:
opts, args = getopt.getopt(sys.argv[1:], 'u:h:p:v', [ 'uri-path=', 'host=', 'port=', 'verbose' ])
for (o, a) in opts:
if o in ('-u', '--uri-path'):
uri_path ... | false | true |
08f9283808a6ea68964de98c986c86f3ef8a56b3 | 1,819 | py | Python | tests/test_s3.py | lgeiger/io | 90be860451a705e2fbe8cfdec3c30030112b5c69 | [
"Apache-2.0"
] | 558 | 2018-11-09T22:45:27.000Z | 2022-03-24T04:59:36.000Z | tests/test_s3.py | lgeiger/io | 90be860451a705e2fbe8cfdec3c30030112b5c69 | [
"Apache-2.0"
] | 1,122 | 2018-12-09T03:30:40.000Z | 2022-03-31T16:22:15.000Z | tests/test_s3.py | lgeiger/io | 90be860451a705e2fbe8cfdec3c30030112b5c69 | [
"Apache-2.0"
] | 319 | 2018-12-09T00:18:47.000Z | 2022-03-30T21:49:46.000Z | # Copyright 2020 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 applic... | 31.362069 | 80 | 0.678944 |
import os
import sys
import time
import tempfile
import tensorflow as tf
import tensorflow_io as tfio
import pytest
@pytest.mark.skipif(
sys.platform in ("win32", "darwin"),
reason="TODO Localstack not setup properly on macOS/Windows yet",
)
def test_read_file():
import boto3
os.environ["AWS_REGION"... | true | true |
08f928cbc1cb237510f2525b2909d6de330c8d10 | 545 | py | Python | nnetsauce/utils/misc.py | Techtonique/nnetsauce | edd5344598877bd8017db0d8889de5a0f970d2ec | [
"BSD-3-Clause-Clear"
] | 4 | 2020-12-04T05:36:05.000Z | 2021-10-30T10:35:02.000Z | nnetsauce/utils/misc.py | Techtonique/nnetsauce | edd5344598877bd8017db0d8889de5a0f970d2ec | [
"BSD-3-Clause-Clear"
] | 5 | 2020-09-25T04:26:04.000Z | 2022-02-26T12:07:29.000Z | nnetsauce/utils/misc.py | Techtonique/nnetsauce | edd5344598877bd8017db0d8889de5a0f970d2ec | [
"BSD-3-Clause-Clear"
] | 2 | 2021-02-22T04:59:28.000Z | 2021-10-30T10:35:07.000Z | import numpy as np
from .memoize import memoize
# merge two dictionaries
def merge_two_dicts(x, y):
z = x.copy()
z.update(y)
return z
# check if x is int
@memoize
def is_int(x):
try:
return int(x) == x
except:
return False
# check if x is float
@memoize
def is_float(x):
ret... | 15.571429 | 63 | 0.658716 | import numpy as np
from .memoize import memoize
def merge_two_dicts(x, y):
z = x.copy()
z.update(y)
return z
@memoize
def is_int(x):
try:
return int(x) == x
except:
return False
@memoize
def is_float(x):
return isinstance(x, float)
@memoize
def is_factor(y):
return no... | true | true |
08f92ad34eac366333fee165c2553b4caac8453a | 6,518 | py | Python | simulator/utilities.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | 3 | 2020-04-29T05:42:14.000Z | 2021-07-13T17:54:13.000Z | simulator/utilities.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | null | null | null | simulator/utilities.py | liiliiliil/ride-hailing-platform-with-simulator | c9eae7f718c9e10c7ba4955e5093d4fb21d16d25 | [
"MIT"
] | null | null | null | import numpy as np
import os
import errno
from datetime import datetime, timedelta
def datetime_range(start, end, delta):
current = start
while current < end:
yield current
current += delta
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
... | 32.108374 | 112 | 0.484965 | import numpy as np
import os
import errno
from datetime import datetime, timedelta
def datetime_range(start, end, delta):
current = start
while current < end:
yield current
current += delta
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: if exc.err... | true | true |
08f92b2dc5a339c90f7dad6f3921207085e113bb | 4,424 | py | Python | test/functional/rpc_signrawtransaction.py | sberkoin/sbercoin | ba61e50fab7e3b15e39a9cbe3a7adf08cab96d39 | [
"MIT"
] | null | null | null | test/functional/rpc_signrawtransaction.py | sberkoin/sbercoin | ba61e50fab7e3b15e39a9cbe3a7adf08cab96d39 | [
"MIT"
] | null | null | null | test/functional/rpc_signrawtransaction.py | sberkoin/sbercoin | ba61e50fab7e3b15e39a9cbe3a7adf08cab96d39 | [
"MIT"
] | 1 | 2021-03-30T16:26:27.000Z | 2021-03-30T16:26:27.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-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 transaction signing using the signrawtransaction RPC."""
from test_framework.test_framework impor... | 42.133333 | 118 | 0.676311 |
from test_framework.test_framework import SberTestFramework
from test_framework.util import *
class SignRawTransactionsTest(SberTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
def successful_signing_test(self):
privKeys = ['cUeKHd5orzT3mz8P... | true | true |
08f92b66cc4e4c047152b239530b1e6bcfe07702 | 538 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/awarehuman-29335 | 8b41b5e8f6f5984cd285183d7d3f53093d57d790 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/awarehuman-29335 | 8b41b5e8f6f5984cd285183d7d3f53093d57d790 | [
"FTL",
"AML",
"RSA-MD"
] | 27 | 2021-08-08T21:41:43.000Z | 2022-03-27T19:32:27.000Z | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/awarehuman-29335 | 8b41b5e8f6f5984cd285183d7d3f53093d57d790 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "awarehuman-29335.botics.co"
site_params = {
"name": "awarehuman",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_cr... | 20.692308 | 61 | 0.657993 | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "awarehuman-29335.botics.co"
site_params = {
"name": "awarehuman",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_cr... | true | true |
08f92c22d2031c9d0c707346ad363b68453d4f25 | 5,667 | py | Python | RuleEngine/handler/executor.py | MioYvo/RCS | 280a993ef4790850f3ebb1556b78f97eaee48142 | [
"Apache-2.0"
] | 1 | 2022-03-25T08:02:20.000Z | 2022-03-25T08:02:20.000Z | RuleEngine/handler/executor.py | MioYvo/RCS | 280a993ef4790850f3ebb1556b78f97eaee48142 | [
"Apache-2.0"
] | null | null | null | RuleEngine/handler/executor.py | MioYvo/RCS | 280a993ef4790850f3ebb1556b78f97eaee48142 | [
"Apache-2.0"
] | null | null | null | # __author__ = "Mio"
# __email__: "liurusi.101@gmail.com"
# created: 3/31/21 4:54 AM
import datetime
import json
from typing import Optional
from aio_pika import IncomingMessage
from bson import ObjectId
from schema import Schema, SchemaError, Use
from model.odm import Record, Rule, Result, PUNISH_ACTION_LEVEL_MAP, A... | 37.529801 | 111 | 0.548615 | import datetime
import json
from typing import Optional
from aio_pika import IncomingMessage
from bson import ObjectId
from schema import Schema, SchemaError, Use
from model.odm import Record, Rule, Result, PUNISH_ACTION_LEVEL_MAP, Action, ResultInRecordStatus
from utils.fastapi_app import app
from utils.rule_operato... | true | true |
08f92c563e9d0cda181291861754c72ed374dc4a | 1,329 | py | Python | dnn_demo.py | williamFalcon/theano-deep-neural-net | 94b7cbe56d504c94ed8851a01d6ed7b2b82029e5 | [
"MIT"
] | 1 | 2019-04-17T10:48:29.000Z | 2019-04-17T10:48:29.000Z | dnn_demo.py | williamFalcon/theano-deep-neural-net | 94b7cbe56d504c94ed8851a01d6ed7b2b82029e5 | [
"MIT"
] | null | null | null | dnn_demo.py | williamFalcon/theano-deep-neural-net | 94b7cbe56d504c94ed8851a01d6ed7b2b82029e5 | [
"MIT"
] | null | null | null |
import sys
import os
from dnn.dnn import MLP
import pandas as pd
import numpy as np
def load_dataset():
data_path = os.path.dirname(os.path.realpath(__file__)) + '/db/train.csv'
train_df = pd.read_csv(data_path)
# extract the x and y for the models
# format for the nn
X = train_df.values[:, 1:] ... | 22.913793 | 77 | 0.639579 |
import sys
import os
from dnn.dnn import MLP
import pandas as pd
import numpy as np
def load_dataset():
data_path = os.path.dirname(os.path.realpath(__file__)) + '/db/train.csv'
train_df = pd.read_csv(data_path)
X = train_df.values[:, 1:] / np.float32(256)
Y = train_df.values[:, 0].astype(np... | true | true |
08f92d54e1b7460785ada95424ace29c5f6a1a95 | 599 | py | Python | setup.py | spaceml-org/Lightning-Severe-Weather | 8810705796b4d389fefb5e2819b48e90cabf473e | [
"MIT"
] | 2 | 2021-04-15T18:36:11.000Z | 2021-09-30T21:32:14.000Z | setup.py | spaceml-org/Lightning-Severe-Weather | 8810705796b4d389fefb5e2819b48e90cabf473e | [
"MIT"
] | null | null | null | setup.py | spaceml-org/Lightning-Severe-Weather | 8810705796b4d389fefb5e2819b48e90cabf473e | [
"MIT"
] | 1 | 2021-01-23T06:14:24.000Z | 2021-01-23T06:14:24.000Z | from setuptools import find_packages, setup
setup(
name="pikajoule",
author="FDL 2020 Lightning & Extreme Weather team",
author_email="",
description="Timeseries classification of severe weather events using GLM data.",
url="https://github.com/spaceml-org/Lightning-Severe-Weather",
version="0.1... | 27.227273 | 85 | 0.60601 | from setuptools import find_packages, setup
setup(
name="pikajoule",
author="FDL 2020 Lightning & Extreme Weather team",
author_email="",
description="Timeseries classification of severe weather events using GLM data.",
url="https://github.com/spaceml-org/Lightning-Severe-Weather",
version="0.1... | true | true |
08f92defc3b7897ef67f1b57273c67da9f3c79d1 | 10,395 | py | Python | lunchtime.py | shivrams/lunchtime | 907f63a3f623bdee40b883a6be9bd53374bfb7ce | [
"MIT"
] | 3 | 2015-07-09T20:46:29.000Z | 2021-12-23T18:41:49.000Z | lunchtime.py | shivrams/lunchtime | 907f63a3f623bdee40b883a6be9bd53374bfb7ce | [
"MIT"
] | null | null | null | lunchtime.py | shivrams/lunchtime | 907f63a3f623bdee40b883a6be9bd53374bfb7ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
''' This is where all the action happens. Running this module fires up
the webserver listening for requests from slack
Additionally also
'''
import cherrypy
import logging
from config import Config
from slack.incoming_webhook import IncomingWebhook
from utils import require_in_self
imp... | 34.88255 | 98 | 0.642809 | import cherrypy
import logging
from config import Config
from slack.incoming_webhook import IncomingWebhook
from utils import require_in_self
import responses
conf = Config()
class LunchTimeCommandHandler(object):
command_handlers = None
def __init__(self):
self.current_order = {}
self.curr... | true | true |
08f92e34ab58dd7bec9ea902fe180cb0032b1170 | 134 | py | Python | word_cutting.py | FrederichRiver/taurus | 1da240b7723bdc99883d7afe0253608cfdababb5 | [
"BSD-3-Clause"
] | null | null | null | word_cutting.py | FrederichRiver/taurus | 1da240b7723bdc99883d7afe0253608cfdababb5 | [
"BSD-3-Clause"
] | null | null | null | word_cutting.py | FrederichRiver/taurus | 1da240b7723bdc99883d7afe0253608cfdababb5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
import jieba
from jieba import cut
sentence = '我爱北京天安门,天安门上太阳升。'
result = cut(sentence)
print('/'.join(result)) | 13.4 | 29 | 0.716418 |
import jieba
from jieba import cut
sentence = '我爱北京天安门,天安门上太阳升。'
result = cut(sentence)
print('/'.join(result)) | true | true |
08f92e7fa5aff7e48acfcc4ec8f6d86b8e9bcdd0 | 10,387 | py | Python | keras_retinanet/bin/debug.py | avf2/keras-retinanet | 1a559a6ea9dadc48fea07961ed25fba81b6356be | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/debug.py | avf2/keras-retinanet | 1a559a6ea9dadc48fea07961ed25fba81b6356be | [
"Apache-2.0"
] | null | null | null | keras_retinanet/bin/debug.py | avf2/keras-retinanet | 1a559a6ea9dadc48fea07961ed25fba81b6356be | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Copyright 2017-2018 Fizyr (https://fizyr.com)
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... | 40.416342 | 138 | 0.686531 |
import argparse
import os
import sys
import cv2
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
import keras_retinanet.bin __package__ = "keras_retinanet.bin"
from ..preprocessing.pascal_voc import PascalVocGenerator
from ..prep... | true | true |
08f931356b0a6636ca8ab4e1e26d8294583d9dcb | 364 | py | Python | new_lambdata_ssbyrne89/car_stuff.py | ssbyrne89/new_lambdata | 48656141412484dbd21f0e9695e68802685af6ce | [
"MIT"
] | null | null | null | new_lambdata_ssbyrne89/car_stuff.py | ssbyrne89/new_lambdata | 48656141412484dbd21f0e9695e68802685af6ce | [
"MIT"
] | null | null | null | new_lambdata_ssbyrne89/car_stuff.py | ssbyrne89/new_lambdata | 48656141412484dbd21f0e9695e68802685af6ce | [
"MIT"
] | 1 | 2020-08-04T22:20:16.000Z | 2020-08-04T22:20:16.000Z | # car_stuff.py
class Auto():
def __init__(self, make, model, year, color, num_wheels):
self.make = make
self.model = model
self.year = year
self.color = color
self.num_wheels = num_wheels
def drive(self):
print("WE ARE DRIVING A", self.model)
def advertise(... | 22.75 | 61 | 0.587912 |
class Auto():
def __init__(self, make, model, year, color, num_wheels):
self.make = make
self.model = model
self.year = year
self.color = color
self.num_wheels = num_wheels
def drive(self):
print("WE ARE DRIVING A", self.model)
def advertise(self):
... | true | true |
08f931b573def7101a4dcd0c7bfa263e54197193 | 926 | py | Python | core/migrations/0001_initial.py | whoismaruf/mygames_api | 0aa65bdc9f46e3f81989029d5167759490e85e4d | [
"MIT",
"Unlicense"
] | null | null | null | core/migrations/0001_initial.py | whoismaruf/mygames_api | 0aa65bdc9f46e3f81989029d5167759490e85e4d | [
"MIT",
"Unlicense"
] | null | null | null | core/migrations/0001_initial.py | whoismaruf/mygames_api | 0aa65bdc9f46e3f81989029d5167759490e85e4d | [
"MIT",
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-02 07:15
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUT... | 31.931034 | 119 | 0.643629 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... | true | true |
08f931c49c3a4b08b7bd84707d5ded71841be842 | 1,291 | py | Python | apps/ast.py | deeplook/streamlit-helpers | 11fa581c8908db370bc78a4bb32247b51ff270cd | [
"MIT"
] | null | null | null | apps/ast.py | deeplook/streamlit-helpers | 11fa581c8908db370bc78a4bb32247b51ff270cd | [
"MIT"
] | null | null | null | apps/ast.py | deeplook/streamlit-helpers | 11fa581c8908db370bc78a4bb32247b51ff270cd | [
"MIT"
] | null | null | null | import ast
import platform
import astpretty
import streamlit as st
from .generic import Tool
py_version = list(map(int, platform.python_version_tuple()))
class AST(Tool):
name = "AST"
description = """
Show [Abstract Syntax Trees](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for Python source c... | 27.468085 | 248 | 0.615027 | import ast
import platform
import astpretty
import streamlit as st
from .generic import Tool
py_version = list(map(int, platform.python_version_tuple()))
class AST(Tool):
name = "AST"
description = """
Show [Abstract Syntax Trees](https://en.wikipedia.org/wiki/Abstract_syntax_tree) for Python source c... | true | true |
08f9329740235f0171b167d27424a1c24bd6916a | 2,749 | py | Python | scripts/check_silence.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 139 | 2018-02-24T21:33:47.000Z | 2022-03-19T03:59:05.000Z | scripts/check_silence.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 73 | 2018-02-17T14:27:11.000Z | 2021-06-05T18:11:09.000Z | scripts/check_silence.py | m95music/yukarin | 87e4e813e1b846720ef7a89162edf1c379700619 | [
"MIT"
] | 31 | 2018-03-05T18:08:18.000Z | 2022-03-28T05:23:16.000Z | """
check silence of wave.
"""
import argparse
import glob
import math
import multiprocessing
from pathlib import Path
from pprint import pprint
import matplotlib.pyplot as plt
import numpy
import tqdm
from sprocket.speech import FeatureExtractor
from yukarin import Wave
from yukarin.param import AcousticParam
from ... | 27.767677 | 97 | 0.702801 |
import argparse
import glob
import math
import multiprocessing
from pathlib import Path
from pprint import pprint
import matplotlib.pyplot as plt
import numpy
import tqdm
from sprocket.speech import FeatureExtractor
from yukarin import Wave
from yukarin.param import AcousticParam
from yukarin.utility.sprocket_utilit... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.