hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b09b722958bf9d73c722a3cd650c4a76ab673efe | 2,187 | py | Python | desktop/core/src/desktop/lib/rest/http_client_test.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 2 | 2020-02-02T15:22:13.000Z | 2020-07-29T15:25:44.000Z | desktop/core/src/desktop/lib/rest/http_client_test.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 7 | 2019-11-28T21:48:38.000Z | 2020-08-02T18:06:40.000Z | desktop/core/src/desktop/lib/rest/http_client_test.py | yetsun/hue | 2e48f0cc70e233ee0e1b40733d4b2a18d8836c66 | [
"Apache-2.0"
] | 6 | 2020-05-29T21:46:30.000Z | 2020-12-15T20:32:19.000Z | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | 32.641791 | 149 | 0.766804 |
dec31e5093b732827509e9f3b5576b2df486aaa7 | 5,140 | py | Python | photoplace/lib/PhotoPlace/UserInterface/commandUI.py | jriguera/photoplace | 93674ef8531d0e5b8f26de9ba568ed8e115b27e1 | [
"Apache-2.0"
] | 10 | 2015-02-20T19:01:19.000Z | 2021-12-13T23:07:19.000Z | photoplace/lib/PhotoPlace/UserInterface/commandUI.py | jriguera/photoplace | 93674ef8531d0e5b8f26de9ba568ed8e115b27e1 | [
"Apache-2.0"
] | 1 | 2020-06-16T13:23:05.000Z | 2021-02-13T14:14:57.000Z | photoplace/lib/PhotoPlace/UserInterface/commandUI.py | jriguera/photoplace | 93674ef8531d0e5b8f26de9ba568ed8e115b27e1 | [
"Apache-2.0"
] | 4 | 2017-03-28T23:06:14.000Z | 2019-09-25T07:59:36.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# commandUI.py
#
# Copyright 2010-2015 Jose Riguera Lopez <jriguera@gmail.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
#
... | 27.340426 | 76 | 0.556031 |
7d9a9a89018c1214bc6fc4b56e8c91837acac112 | 4,099 | py | Python | practical_machine_learning/ann_for_xor_donut.py | AndreiRoibu/NeuralNetwoks | fcca6f135330b07f753dfde99a6a296067e0882c | [
"BSD-3-Clause"
] | null | null | null | practical_machine_learning/ann_for_xor_donut.py | AndreiRoibu/NeuralNetwoks | fcca6f135330b07f753dfde99a6a296067e0882c | [
"BSD-3-Clause"
] | null | null | null | practical_machine_learning/ann_for_xor_donut.py | AndreiRoibu/NeuralNetwoks | fcca6f135330b07f753dfde99a6a296067e0882c | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
def forward(X, W1, b1, W2, b2):
"""As we are doing binary classification, just do 2 sigmoids in a row"""
Z = X.dot(W1) + b1
# Z = Z * (Z > 0) # ReLU
# Z = np.tanh(Z) # Tanh
Z = 1 / (1 + np.exp( -Z )) # Sigmoid
... | 30.139706 | 100 | 0.568431 |
8b04d5f70a389524e944142767283d90202779af | 3,937 | py | Python | src/scmodes/lra/wglmpca.py | aksarkar/scmodes | a05a81d69a1e4b2b21ee072c3cf0bcef65360f33 | [
"MIT"
] | 3 | 2020-05-04T19:50:26.000Z | 2021-03-01T06:30:48.000Z | src/scmodes/lra/wglmpca.py | aksarkar/scmodes | a05a81d69a1e4b2b21ee072c3cf0bcef65360f33 | [
"MIT"
] | null | null | null | src/scmodes/lra/wglmpca.py | aksarkar/scmodes | a05a81d69a1e4b2b21ee072c3cf0bcef65360f33 | [
"MIT"
] | null | null | null | """GLM-PCA, supporting missing values
We seek to fit the model
x_{ij} ~ Poisson(s_i μ_{ij})
where ln μ_{ij} = (LF)_{ij}. GLM-PCA fits this model using Fisher scoring
updates (Newton-Raphson updates, using the Fisher information instead of the
Hessian) to maximize the log likelihood (Townes 2019). To handle missing d... | 34.840708 | 92 | 0.642621 |
a99960cdc42a4b2bd5496b97141f58a5f22dceaa | 7,224 | py | Python | src/garage/tf/baselines/continuous_mlp_baseline.py | cnheider/garage | 70956d104ec245bcb3a5deba35a11c565755759d | [
"MIT"
] | 1 | 2021-01-11T18:40:52.000Z | 2021-01-11T18:40:52.000Z | src/garage/tf/baselines/continuous_mlp_baseline.py | cnheider/garage | 70956d104ec245bcb3a5deba35a11c565755759d | [
"MIT"
] | null | null | null | src/garage/tf/baselines/continuous_mlp_baseline.py | cnheider/garage | 70956d104ec245bcb3a5deba35a11c565755759d | [
"MIT"
] | null | null | null | """A value function (baseline) based on a MLP model."""
from dowel import tabular
import numpy as np
import tensorflow as tf
from garage import make_optimizer
from garage.experiment import deterministic
from garage.np.baselines import Baseline
from garage.tf import compile_function
from garage.tf.models import Normali... | 37.046154 | 79 | 0.597176 |
d9cf4550e2b65ab3625326ca3a7311c77a5353db | 852 | py | Python | blender/arm/logicnode/native/LN_script.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/native/LN_script.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/native/LN_script.py | notwarp/armory | bd6078e3035eefcb3c725664698eeb369b4c2d88 | [
"Zlib"
] | null | null | null | import bpy
from arm.logicnode.arm_nodes import *
class ScriptNode(ArmLogicTreeNode):
"""Executes the given script."""
bl_idname = 'LNScriptNode'
bl_label = 'Script'
arm_section = 'haxe'
arm_version = 1
@property
def property0(self):
return bpy.data.texts[self.property0_].as_strin... | 28.4 | 103 | 0.669014 |
ec60b675226c21439c6a6f6702e9b93a4997f59e | 16,597 | py | Python | tensorflow/python/framework/sparse_tensor.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | 10 | 2018-09-26T00:16:57.000Z | 2021-12-08T06:31:39.000Z | tensorflow/python/framework/sparse_tensor.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/sparse_tensor.py | MathMachado/tensorflow | 56afda20b15f234c23e8393f7e337e7dd2659c2d | [
"Apache-2.0"
] | 4 | 2018-09-18T19:56:31.000Z | 2020-09-15T09:54:44.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.046875 | 88 | 0.714346 |
53c9d5c625f93b92a8e3788ba52c3e5822af3489 | 15,129 | py | Python | autotest/ogr/ogr_ods.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | autotest/ogr/ogr_ods.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | autotest/ogr/ogr_ods.py | mihadyuk/gdal | d4627981715b82ff368547ef00ef26e0b9207048 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read functionality for OGR ODS driver.
# Author: Even Rouault <even dot rouault at mines dash paris dot org>
#
##############################################... | 28.762357 | 268 | 0.562364 |
bf0f9f47410b1e1769397cda8db885565697c516 | 434 | py | Python | Support/lib/webpreview.py | girvo/vico | c50abebe0832a60bd1304704936fb3a5041a1d0d | [
"Unlicense"
] | 75 | 2015-01-04T08:32:21.000Z | 2022-01-18T03:51:27.000Z | Support/lib/webpreview.py | Shadowfiend/vico | 5f8c1a2461e57e4c00e71529339d5cfc2b2d1e62 | [
"Unlicense"
] | 13 | 2015-01-16T05:46:17.000Z | 2019-11-05T14:39:24.000Z | Support/lib/webpreview.py | Shadowfiend/vico | 5f8c1a2461e57e4c00e71529339d5cfc2b2d1e62 | [
"Unlicense"
] | 26 | 2015-01-17T11:22:20.000Z | 2020-12-29T12:12:08.000Z |
# python bindings for soryu's web-preview
from cgi import escape
from os import path, environ
from tm_helpers import sh, sh_escape
webpreview = sh_escape(path.join(environ["TM_SUPPORT_PATH"], "lib/webpreview.sh"))
def html_header(title, subtitle):
return sh('source %s; html_header "%s" "%s"' % (webpreview, s... | 27.125 | 103 | 0.728111 |
95c7db0420502413071c2c1c21f573542073daf5 | 37,727 | py | Python | instances/passenger_demand/pas-20210421-2109-int12e/37.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int12e/37.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int12e/37.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 2700
passenger_arriving = (
(1, 10, 4, 2, 2, 0, 7, 4, 6, 2, 3, 0), # 0
(0, 7, 5, 1, 1, 0, 2, 8, 4, 4, 1, 0), # 1
(3, 5, 8, 3, 0, 0, 9, 8, 3, 4, 0, 0), # 2
(3, 5, 6, 5, 1, 0, 11, 7, 3, 4, 1, 0), # 3
(2, 3, 4, 2, 2, 0, 6, 7, 4, 5, 3, 0), # 4
(3, 7, 9, 3, 2, 0, 4, 4, 3, 2, ... | 112.61791 | 213 | 0.72794 |
52ce1967b2f4b64fd9ea1abe69939b1203673fe6 | 1,463 | py | Python | integration/v2/test_service_keys.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | 47 | 2017-12-17T00:54:33.000Z | 2022-02-25T09:54:52.000Z | integration/v2/test_service_keys.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | 125 | 2017-10-27T09:38:10.000Z | 2022-03-10T07:53:35.000Z | integration/v2/test_service_keys.py | subhash12/cf-python-client | c0ecbb8ec85040fc2f74b6c52e1f9a6c6c16c4b0 | [
"Apache-2.0"
] | 50 | 2018-01-19T07:57:21.000Z | 2022-02-14T14:47:31.000Z | import logging
import unittest
from config_test import build_client_from_configuration
_logger = logging.getLogger(__name__)
class TestServiceKeys(unittest.TestCase):
def test_create_delete(self):
client = build_client_from_configuration()
try:
instance = client.v2.service_instances.... | 36.575 | 122 | 0.614491 |
218894807e8e7e704f32b4f9c14451d4c49915dc | 15,082 | py | Python | st2common/tests/unit/services/test_rbac.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | st2common/tests/unit/services/test_rbac.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | 1 | 2020-03-19T23:45:59.000Z | 2020-03-19T23:45:59.000Z | st2common/tests/unit/services/test_rbac.py | machao19902/st2 | 6768a529af1b3c12109cbfeae19d3cf7fdb71bb7 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 45.020896 | 97 | 0.668015 |
7371290a58d36e8db401fffc9d71e4d841afaaba | 18,172 | py | Python | skabase/SKASubarray/test/SKASubarray_test.py | adityadangeska/lmc-base-classes | a3dada19b27fcc889546d754ef94986c55da5acc | [
"BSD-3-Clause"
] | 1 | 2019-05-31T09:47:31.000Z | 2019-05-31T09:47:31.000Z | skabase/SKASubarray/test/SKASubarray_test.py | adityadangeska/lmc-base-classes | a3dada19b27fcc889546d754ef94986c55da5acc | [
"BSD-3-Clause"
] | null | null | null | skabase/SKASubarray/test/SKASubarray_test.py | adityadangeska/lmc-base-classes | a3dada19b27fcc889546d754ef94986c55da5acc | [
"BSD-3-Clause"
] | null | null | null | #########################################################################################
# -*- coding: utf-8 -*-
#
# This file is part of the SKASubarray project
#
#
#
#########################################################################################
"""Contain the tests for the SKASubarray."""
# Path
import s... | 52.068768 | 97 | 0.706637 |
40187ce882621c15fee371c41172c89f7de51b66 | 3,539 | py | Python | setup.py | hyunjinjeong/confluent-kafka-python | 1ea2ecb984ce238dae37999769027e88cfa8fb0e | [
"Apache-2.0"
] | null | null | null | setup.py | hyunjinjeong/confluent-kafka-python | 1ea2ecb984ce238dae37999769027e88cfa8fb0e | [
"Apache-2.0"
] | null | null | null | setup.py | hyunjinjeong/confluent-kafka-python | 1ea2ecb984ce238dae37999769027e88cfa8fb0e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
from distutils.core import Extension
import platform
work_dir = os.path.dirname(os.path.realpath(__file__))
mod_dir = os.path.join(work_dir, 'src', 'confluent_kafka')
ext_dir = os.path.join(mod_dir, 'src')
with open(os.path.join(work_dir, 'R... | 34.359223 | 83 | 0.627578 |
05e05fde675bd1b3d3323b3dddd731adfbf01de8 | 35,156 | py | Python | tests/examples/minlplib/syn30h.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/syn30h.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/syn30h.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:54:29
#
# Equation counts
# Total E G L N X C B
# 346 161 37 148 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 36.967403 | 120 | 0.642678 |
f08547675811818c4d0850835dacedbdd6ee1847 | 3,344 | py | Python | sdk/python/pulumi_aws_native/sagemaker/get_notebook_instance_lifecycle_config.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/sagemaker/get_notebook_instance_lifecycle_config.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/sagemaker/get_notebook_instance_lifecycle_config.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 39.341176 | 167 | 0.708433 |
3568c538f06f2503d541ef9f3154cc2eb88b9fab | 20,375 | py | Python | tests/model_inheritance/tests.py | harvardinformatics/django | 8fe2447a01232d9598bf4692d1face12fa074288 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2021-06-24T13:21:03.000Z | 2021-06-24T13:29:26.000Z | tests/model_inheritance/tests.py | harvardinformatics/django | 8fe2447a01232d9598bf4692d1face12fa074288 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2019-11-20T18:59:31.000Z | 2019-11-21T01:55:57.000Z | tests/model_inheritance/tests.py | harvardinformatics/django | 8fe2447a01232d9598bf4692d1face12fa074288 | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 1 | 2020-06-02T00:24:16.000Z | 2020-06-02T00:24:16.000Z | from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.db import connection, models
from django.test import SimpleTestCase, TestCase
from django.test.utils import CaptureQueriesContext, isolate_apps
from .models import (
Base, Chef, CommonInfo, GrandChild, Grand... | 37.871747 | 108 | 0.620712 |
d4315393f16dd1112162c010956604db92e36f15 | 2,750 | py | Python | ucscsdk/mometa/dupe/DupeChangeTracker.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/dupe/DupeChangeTracker.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/dupe/DupeChangeTracker.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for DupeChangeTracker ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class DupeChangeTrackerConsts():
OPERATION_CREATE = "create"
OPERATION_DELETE = "dele... | 50.925926 | 250 | 0.640364 |
252b2765662986d8032244d9ebac0905b4424b3a | 2,342 | py | Python | AsianOption.py | ydai49/Derivatives | 081b8e6bc069ec10839c2155f001fe3f14885fdb | [
"MIT"
] | null | null | null | AsianOption.py | ydai49/Derivatives | 081b8e6bc069ec10839c2155f001fe3f14885fdb | [
"MIT"
] | null | null | null | AsianOption.py | ydai49/Derivatives | 081b8e6bc069ec10839c2155f001fe3f14885fdb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 7 14:58:36 2020
@author: daiyu
"""
import math
import numpy as np
np.random.seed(1)
class Asian_option:
def __init__(self,S, K, T, r, d,sigma):
self.S, self.K, self.T, self.r, self.d , self.sigma = S, K, T, r, d, sigma
# Monte Ca... | 29.64557 | 87 | 0.554227 |
06e2e43f1d7b87e394a71326ec06c8bcffb9625f | 4,132 | py | Python | tests/callbacks/meters/sequence_error_test.py | eivtho/PyLaia | 2a7a6e2eeb9b5af68c0faed0c564b02063e72be0 | [
"MIT"
] | 89 | 2018-12-12T23:06:26.000Z | 2022-02-03T09:04:21.000Z | tests/callbacks/meters/sequence_error_test.py | eivtho/PyLaia | 2a7a6e2eeb9b5af68c0faed0c564b02063e72be0 | [
"MIT"
] | 30 | 2019-03-06T14:29:48.000Z | 2022-03-16T14:53:43.000Z | tests/callbacks/meters/sequence_error_test.py | jpuigcerver/PyLaia | 1b2e864247f1bfb8d95ac1910de9c52df71c017a | [
"MIT"
] | 26 | 2018-12-13T17:48:19.000Z | 2022-02-28T12:52:29.000Z | import unittest
from laia.callbacks.meters.sequence_error import SequenceError, char_to_word_seq
class CharToWordSeqTest(unittest.TestCase):
def test_empty_string(self):
seq = ""
delimiters = []
actual = char_to_word_seq(seq, delimiters)
expected = []
self.assertEqual(actu... | 31.30303 | 87 | 0.498064 |
8c017c89e71ddb72690fba063cf0e8c85a1855e5 | 35,092 | py | Python | salt/modules/win_service.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2021-08-14T13:48:38.000Z | 2021-08-14T13:48:38.000Z | salt/modules/win_service.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 3 | 2015-03-31T14:44:05.000Z | 2015-06-18T19:02:24.000Z | salt/modules/win_service.py | jubrad/salt | 7960334fb726cfde45e6409da79a65535c626685 | [
"Apache-2.0"
] | 1 | 2020-01-02T09:03:24.000Z | 2020-01-02T09:03:24.000Z | # -*- coding: utf-8 -*-
'''
Windows Service module.
.. versionchanged:: 2016.11.0 - Rewritten to use PyWin32
'''
# Import Python libs
from __future__ import absolute_import
import fnmatch
import logging
import re
import time
# Import Salt libs
import salt.utils.platform
from salt.exceptions import CommandExecutionEr... | 31 | 114 | 0.59988 |
536508a971553350d6d18b5cb430cc25bd102d9a | 1,477 | py | Python | rest_api_auto/views.py | xiaomiba0904/rest_api_auto | 6ad66d41626dd26f997572f0d6a17bce581198eb | [
"MIT"
] | null | null | null | rest_api_auto/views.py | xiaomiba0904/rest_api_auto | 6ad66d41626dd26f997572f0d6a17bce581198eb | [
"MIT"
] | 4 | 2021-03-18T21:55:57.000Z | 2022-02-10T07:31:33.000Z | rest_api_auto/views.py | xiaomiba0904/rest_api_auto | 6ad66d41626dd26f997572f0d6a17bce581198eb | [
"MIT"
] | 2 | 2019-08-27T10:55:37.000Z | 2020-04-07T03:09:04.000Z | from django.http import HttpResponseNotFound
from rest_framework import exceptions
from rest_framework.generics import CreateAPIView, UpdateAPIView, DestroyAPIView, ListAPIView, RetrieveAPIView
from rest_api_auto import _api_globals
from rest_api_auto.utils import url_parameter_conversion
class BaseView(object):
... | 26.375 | 110 | 0.677048 |
aa5a3c47b147111b7c67e6d73061ce276298afd6 | 2,806 | py | Python | jupyterlab_sql_editor/ipython/common.py | CybercentreCanada/jupyterlab-sql-editor | 376c5c7a8eaaad04f27638be7f04f8c6f01f8ccf | [
"MIT"
] | 12 | 2021-12-11T12:20:43.000Z | 2022-03-27T06:27:00.000Z | jupyterlab_sql_editor/ipython/common.py | CybercentreCanada/jupyterlab-sql-editor | 376c5c7a8eaaad04f27638be7f04f8c6f01f8ccf | [
"MIT"
] | 4 | 2021-12-13T18:57:17.000Z | 2022-02-27T21:41:04.000Z | jupyterlab_sql_editor/ipython/common.py | CybercentreCanada/jupyterlab-sql-editor | 376c5c7a8eaaad04f27638be7f04f8c6f01f8ccf | [
"MIT"
] | 3 | 2021-12-31T10:41:40.000Z | 2022-02-19T12:06:00.000Z | import time
import math
import os
import re
import string
from html import escape
from html import escape as html_escape
PRINTABLE = string.ascii_letters + string.digits + string.punctuation + ' '
replchars = re.compile('([^' + re.escape(PRINTABLE) + '])')
def make_tag(tag_name, show_nonprinting, body='', **kwargs)... | 31.52809 | 95 | 0.631148 |
a604b65fe4dd133e7ff0520b437cd8b73fc2268d | 5,085 | py | Python | preprocess/image_to_amime_with_mxnet.py | zhangruihan1/robust-face-recognition | a7a03c7d260768fed2dfbe5a3af8dd65d6839ca5 | [
"MIT"
] | null | null | null | preprocess/image_to_amime_with_mxnet.py | zhangruihan1/robust-face-recognition | a7a03c7d260768fed2dfbe5a3af8dd65d6839ca5 | [
"MIT"
] | null | null | null | preprocess/image_to_amime_with_mxnet.py | zhangruihan1/robust-face-recognition | a7a03c7d260768fed2dfbe5a3af8dd65d6839ca5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""image_to_amime_with_mxnet.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1LTzdjBxSsx9vAmfF8Xt81FHVgSwGSUYU
"""
from PIL import Image
import torch
import IPython
from IPython.display import display
import numpy as np
... | 28.728814 | 135 | 0.670796 |
77b8f219b9c4308f890a75a2ef0cb38fe5f68014 | 3,741 | py | Python | Adafruit_SSD1306/Adafruit_SSD1306.py | jloosli/Adafruit-Raspberry-Pi-Python-Code | 1503073801f9201c4ce53daae9ee5d82b7053e6e | [
"Unlicense"
] | null | null | null | Adafruit_SSD1306/Adafruit_SSD1306.py | jloosli/Adafruit-Raspberry-Pi-Python-Code | 1503073801f9201c4ce53daae9ee5d82b7053e6e | [
"Unlicense"
] | null | null | null | Adafruit_SSD1306/Adafruit_SSD1306.py | jloosli/Adafruit-Raspberry-Pi-Python-Code | 1503073801f9201c4ce53daae9ee5d82b7053e6e | [
"Unlicense"
] | null | null | null | '''*********************************************************************
This is a library for our Monochrome OLEDs based on SSD1306 drivers
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/category/63_98
These displays use SPI to communicate, 4 or 5 pins are required to
interface
Adafru... | 29.226563 | 94 | 0.706496 |
95e44a05447c5ed981c936cdd4365829dae3ec6b | 52,694 | py | Python | greentest/2.7/test_urllib2.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | 2 | 2019-05-12T22:01:32.000Z | 2020-06-09T14:11:01.000Z | greentest/2.7/test_urllib2.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | null | null | null | greentest/2.7/test_urllib2.py | Eugeny/gevent | adb7b838ed66c13abe5059605730bb4b4531bbcd | [
"MIT"
] | 2 | 2019-11-24T12:11:50.000Z | 2020-12-26T19:00:20.000Z | import unittest
from test import test_support
import os
import socket
import StringIO
import urllib2
from urllib2 import Request, OpenerDirector
# XXX
# Request
# CacheFTPHandler (hard to write)
# parse_keqv_list, parse_http_list, HTTPDigestAuthHandler
class TrivialTests(unittest.TestCase):
def test_trivial(sel... | 39.177695 | 102 | 0.587581 |
ac59726b1e1f2bd36181c186398cf19ee93256e2 | 3,077 | py | Python | contrib/zmq/zmq_sub.py | kitkatty/bitcoinrandom | 290e9e5c48f12b89147cf59220449ce92e2ab892 | [
"MIT"
] | 3 | 2018-06-15T05:41:57.000Z | 2022-02-10T19:54:15.000Z | contrib/zmq/zmq_sub.py | kitkatty/bitcoinrandom | 290e9e5c48f12b89147cf59220449ce92e2ab892 | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | kitkatty/bitcoinrandom | 290e9e5c48f12b89147cf59220449ce92e2ab892 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
BitcoinRandom should be started with the command line ar... | 36.2 | 119 | 0.645759 |
c751ff1df6d8ab2b0ed4029d079517fa0b2dde77 | 370 | py | Python | thimbles/modeling/__init__.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/modeling/__init__.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | thimbles/modeling/__init__.py | quidditymaster/thimbles | b122654a012f0eb4f043d1ee757f884707c97615 | [
"MIT"
] | null | null | null | #from factor_models import *
#from spectral_models import *
#from predictors import *
from thimbles.modeling.parameters import Parameter
from thimbles.modeling.models import Model
from thimbles.modeling import associations
from thimbles.modeling.distributions import Distribution
from thimbles.modeling.factor_models im... | 33.636364 | 56 | 0.848649 |
44377f07f4f9b504ff225e5db64d279967d6e06b | 1,448 | py | Python | searching/binary_search.py | TrungLuong1194/retrieval_systems | 61441826ec7d55c9758faa63bd322a16b95300d2 | [
"MIT"
] | 1 | 2021-05-05T11:52:58.000Z | 2021-05-05T11:52:58.000Z | searching/binary_search.py | TrungLuong1194/retrieval_systems | 61441826ec7d55c9758faa63bd322a16b95300d2 | [
"MIT"
] | null | null | null | searching/binary_search.py | TrungLuong1194/retrieval_systems | 61441826ec7d55c9758faa63bd322a16b95300d2 | [
"MIT"
] | null | null | null | from utils import generate_random_sequence
def search(seq, l, r, x):
num_comparisons = 0
if r >= l:
mid = l + (r - l) // 2
num_comparisons += 1
if seq[mid] == x:
return mid, num_comparisons
elif seq[mid] > x:
res, num = search(seq, l, mid - 1, x)
... | 27.846154 | 85 | 0.57942 |
4914d327a2de3e3aa2c807929de79a9006901231 | 248 | py | Python | robosuite/models/arenas/__init__.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | null | null | null | robosuite/models/arenas/__init__.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | null | null | null | robosuite/models/arenas/__init__.py | kyungjaelee/robosuite | 0d73fcca9ed8e638632f4bd7b0f1b8ebf4640fb1 | [
"MIT"
] | null | null | null | from .arena import Arena
from .custom_table_arena import CustomTableArena
from .table_arena import TableArena
from .pegs_arena import PegsArena
from .bins_arena import BinsArena
from .empty_arena import EmptyArena
from .wipe_arena import WipeArena
| 31 | 48 | 0.858871 |
82fa51e2acfcfb8f1337a871ed57888f535ce8d5 | 521 | py | Python | experiments/heat-3d_chill_openmp/tmp_files/8833.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/heat-3d_chill_openmp/tmp_files/8833.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | experiments/heat-3d_chill_openmp/tmp_files/8833.py | LoopTilingBenchmark/benchmark | 52a3d2e70216552a498fd91de02a2fa9cb62122c | [
"BSD-2-Clause"
] | null | null | null | from chill import *
source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/heat-3d/kernel.c')
destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/heat-3d_chill_openmp/tmp_files/8833.c')
procedure('kernel_heat_3d')
loop(0)
known('n>3')
pragma(0,2,"... | 24.809524 | 120 | 0.737044 |
5a850064a415f170d45a07c0131f1677660b0ae3 | 4,455 | py | Python | clustering/validation/bcubed_score.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 3 | 2019-03-18T03:22:06.000Z | 2021-04-06T07:53:51.000Z | clustering/validation/bcubed_score.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | null | null | null | clustering/validation/bcubed_score.py | ryuzakyl/data-bloodhound | ae0413e748e55a0d2dbae35bbe96a672f313a64b | [
"Apache-2.0"
] | 2 | 2020-10-05T08:22:25.000Z | 2020-10-05T08:24:02.000Z | #!/usr/bin/env
# -*- coding: utf-8 -*-
# Copyright (C) Victor M. Mendiola Lau - All Rights Reserved
# Unauthorized copying of this file, via any medium is strictly prohibited
# Proprietary and confidential
# Written by Victor M. Mendiola Lau <ryuzakyl@gmail.com>, March 2017
"""BCubed metrics (clustering validation).
... | 38.73913 | 188 | 0.675645 |
49a95cfad8b19d255fb6956cb18b5181d20d57f9 | 32,862 | py | Python | Lib/site-packages/jupyterhub/apihandlers/users.py | KarmaScripter/PiggyPy | 25ba1d0c8933a0cb655f09db6c228f74f4d52894 | [
"MIT"
] | null | null | null | Lib/site-packages/jupyterhub/apihandlers/users.py | KarmaScripter/PiggyPy | 25ba1d0c8933a0cb655f09db6c228f74f4d52894 | [
"MIT"
] | null | null | null | Lib/site-packages/jupyterhub/apihandlers/users.py | KarmaScripter/PiggyPy | 25ba1d0c8933a0cb655f09db6c228f74f4d52894 | [
"MIT"
] | null | null | null | """User handlers"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import json
from datetime import datetime
from datetime import timedelta
from datetime import timezone
from async_generator import aclosing
from dateutil.parser import parse as parse_... | 37.385666 | 141 | 0.573915 |
f415f3004a7eeeecf91ed4e39e4b771330420453 | 180 | py | Python | model/transformer.py | aiwizzard/selene-bert | cd725d2f3722c8775a1f2111c5b641dc43c7cb75 | [
"Apache-2.0"
] | null | null | null | model/transformer.py | aiwizzard/selene-bert | cd725d2f3722c8775a1f2111c5b641dc43c7cb75 | [
"Apache-2.0"
] | null | null | null | model/transformer.py | aiwizzard/selene-bert | cd725d2f3722c8775a1f2111c5b641dc43c7cb75 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
class TransformerModel(nn.Module):
def __init__(self):
super(TransformerModel, self).__init__()
def forward(self):
pass | 20 | 48 | 0.683333 |
ddfb96b967e8567cf0b09a8e99fc899ea116227a | 12,612 | py | Python | arcade/experimental/shadertoy.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/experimental/shadertoy.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/experimental/shadertoy.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | """
Shadertoy
Inputs:
uniform vec3 iResolution; // viewport resolution (in pixels)
uniform float iTime; // shader playback time (in seconds)
uniform float iTimeDelta; // render time (in seconds)
uniform int iFrame; // shader playback frame
uniform... | 29.886256 | 101 | 0.596178 |
26a4a6865ba7c9e35b88af8ae2476b58d8d0c30f | 4,351 | py | Python | tapas/create_pretrain_examples_main.py | LysandreJik/tapas | 4908213eb4df7aa988573350278b44c4dbe3f71b | [
"Apache-2.0"
] | 1 | 2021-02-14T10:27:30.000Z | 2021-02-14T10:27:30.000Z | tapas/create_pretrain_examples_main.py | wcc17864158993/tapas | 4908213eb4df7aa988573350278b44c4dbe3f71b | [
"Apache-2.0"
] | null | null | null | tapas/create_pretrain_examples_main.py | wcc17864158993/tapas | 4908213eb4df7aa988573350278b44c4dbe3f71b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 38.848214 | 78 | 0.724891 |
669a93ff7483558ac4fc22e1650f9cc286ad8bd6 | 42,705 | py | Python | src/network-manager/azext_network_manager/_params.py | ravithanneeru/azure-cli-extensions | e0de87f3563ae39525370e9912589aac33e7bded | [
"MIT"
] | 207 | 2017-11-29T06:59:41.000Z | 2022-03-31T10:00:53.000Z | src/network-manager/azext_network_manager/_params.py | ravithanneeru/azure-cli-extensions | e0de87f3563ae39525370e9912589aac33e7bded | [
"MIT"
] | 4,061 | 2017-10-27T23:19:56.000Z | 2022-03-31T23:18:30.000Z | src/network-manager/azext_network_manager/_params.py | ravithanneeru/azure-cli-extensions | e0de87f3563ae39525370e9912589aac33e7bded | [
"MIT"
] | 802 | 2017-10-11T17:36:26.000Z | 2022-03-31T22:24:32.000Z | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 79.230056 | 168 | 0.688655 |
5086ec486117446f231a82955ea794a1afff1ca7 | 4,351 | py | Python | tests/gluon_autolog/test_gluon_autolog.py | brightsparc/mlflow | 31e4f969d3b65a2fd3e246e88a23433b72904d49 | [
"Apache-2.0"
] | 2 | 2020-09-15T14:19:27.000Z | 2021-05-21T09:59:02.000Z | tests/gluon_autolog/test_gluon_autolog.py | brightsparc/mlflow | 31e4f969d3b65a2fd3e246e88a23433b72904d49 | [
"Apache-2.0"
] | 36 | 2019-04-11T21:45:45.000Z | 2022-03-11T05:05:16.000Z | tests/gluon_autolog/test_gluon_autolog.py | brightsparc/mlflow | 31e4f969d3b65a2fd3e246e88a23433b72904d49 | [
"Apache-2.0"
] | 2 | 2020-06-28T01:39:36.000Z | 2022-01-06T17:26:50.000Z | import random
import warnings
import mxnet as mx
import mxnet.ndarray as nd
import numpy as np
import pytest
from mxnet.gluon import Trainer
from mxnet.gluon.contrib.estimator import estimator
from mxnet.gluon.data import Dataset, DataLoader
from mxnet.gluon.loss import SoftmaxCrossEntropyLoss
from mxnet.gluon.nn impo... | 31.302158 | 99 | 0.678695 |
029a752ff8a00d30be7f8bdcddfff064d34fd23d | 848 | py | Python | dashboard/gcloud.py | mburrieza/meraki-bot | 67833f5fb12511a4f6dbb530c12df1378aa11c49 | [
"MIT"
] | 10 | 2020-02-26T19:41:50.000Z | 2021-07-15T16:19:38.000Z | dashboard/gcloud.py | mburrieza/meraki-bot | 67833f5fb12511a4f6dbb530c12df1378aa11c49 | [
"MIT"
] | null | null | null | dashboard/gcloud.py | mburrieza/meraki-bot | 67833f5fb12511a4f6dbb530c12df1378aa11c49 | [
"MIT"
] | 4 | 2020-03-31T14:35:30.000Z | 2021-03-10T09:41:36.000Z | import os
from google.auth import compute_engine
from google.cloud import firestore
PROJECT_ID = os.environ.get('PROJECT_ID')
COLLECTION_ID = os.environ.get('COLLECTION_ID')
SERVICE_ACCOUNT_FILE = os.environ.get('SERVICE_ACCOUNT_FILE')
def get_demos(db):
coll_ref = db.collection(COLLECTION_ID)
docs = coll_... | 23.555556 | 70 | 0.731132 |
9d817e669336f515908e7e9f67eefc284d74f7d6 | 875 | py | Python | content_n_exceptions/ex138_remember_name_update.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 3 | 2020-11-28T08:26:54.000Z | 2020-12-23T18:37:37.000Z | content_n_exceptions/ex138_remember_name_update.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | 1 | 2020-10-22T02:05:11.000Z | 2020-10-22T02:05:53.000Z | content_n_exceptions/ex138_remember_name_update.py | Alyssonmach/learning-python-with-codes | e5ef70f3b56712e98449b3053eb34416b8025cb1 | [
"MIT"
] | null | null | null | import json
def get_stored_username():
"""Get stored username if available."""
filename = 'content_n_exceptions/json/username.json'
try:
with open(filename) as f_obj:
username = json.load(f_obj)
except FileNotFoundError:
return None
else:
return username
def get_... | 28.225806 | 73 | 0.634286 |
e5f06250490d24489159bef45ac31419f72367eb | 2,974 | py | Python | backend_signature.py | kudddy/ApiGateway-python-sdk-2.0.4 | 52a5b2eb45b5ce04a4e53ecb2a36ea47ea32736b | [
"Apache-2.0"
] | null | null | null | backend_signature.py | kudddy/ApiGateway-python-sdk-2.0.4 | 52a5b2eb45b5ce04a4e53ecb2a36ea47ea32736b | [
"Apache-2.0"
] | null | null | null | backend_signature.py | kudddy/ApiGateway-python-sdk-2.0.4 | 52a5b2eb45b5ce04a4e53ecb2a36ea47ea32736b | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask import request
from functools import wraps
import re
from datetime import datetime
from datetime import timedelta
from apig_sdk import signer
app = Flask(__name__)
def requires_apigateway_signature():
def wrapper(f):
secrets = {
"signature_key1": "signature... | 32.681319 | 92 | 0.519839 |
3d633e3bb7addf30c04317ac2506a043dbb5e216 | 2,026 | py | Python | util/compile_weak_scaling.py | cpphoo/shallow-water | a94e46da281266428310a1c90e97249a77de6e03 | [
"MIT"
] | null | null | null | util/compile_weak_scaling.py | cpphoo/shallow-water | a94e46da281266428310a1c90e97249a77de6e03 | [
"MIT"
] | null | null | null | util/compile_weak_scaling.py | cpphoo/shallow-water | a94e46da281266428310a1c90e97249a77de6e03 | [
"MIT"
] | null | null | null | import argparse
from parse_output import parse
import os
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
def main(args):
serial_time = parse(os.path.join(args.dir, 'serial.txt'))
print(serial_time)
num_threads = sorted(args.num_threads)
parall... | 28.535211 | 136 | 0.644126 |
c55ac2f4e68111e0a99b8cde7a0d4ee6007da936 | 9,712 | py | Python | awx/main/credential_plugins/hashivault.py | wes1997/awx | 45bd143c07f1330a5ead288522569f28fe8aa12e | [
"Apache-2.0"
] | null | null | null | awx/main/credential_plugins/hashivault.py | wes1997/awx | 45bd143c07f1330a5ead288522569f28fe8aa12e | [
"Apache-2.0"
] | null | null | null | awx/main/credential_plugins/hashivault.py | wes1997/awx | 45bd143c07f1330a5ead288522569f28fe8aa12e | [
"Apache-2.0"
] | null | null | null | import copy
import os
import pathlib
from urllib.parse import urljoin
from .plugin import CredentialPlugin, CertFiles, raise_for_status
import requests
from django.utils.translation import gettext_lazy as _
base_inputs = {
'fields': [
{
'id': 'url',
'label': _('Server URL'),
... | 34.562278 | 153 | 0.573517 |
a5850508083ce9070155290075174dd8919ffd3b | 2,805 | py | Python | api/models.py | shauryashahi/bantaipublic | 9a5c875cd334e06b8cbb6b433590280587bd12d8 | [
"Apache-2.0"
] | null | null | null | api/models.py | shauryashahi/bantaipublic | 9a5c875cd334e06b8cbb6b433590280587bd12d8 | [
"Apache-2.0"
] | 6 | 2020-06-05T20:18:55.000Z | 2021-09-22T18:18:17.000Z | api/models.py | shauryashahi/bantaipublic | 9a5c875cd334e06b8cbb6b433590280587bd12d8 | [
"Apache-2.0"
] | null | null | null | from django.db import models
import uuid
from django.conf import settings
def generate_user_id():
return str(uuid.uuid4())
class User(models.Model):
username = models.TextField(unique=True)
user_id = models.CharField(max_length=255, unique=True)
name = models.CharField(max_length=60, blank=True)
... | 30.16129 | 77 | 0.634581 |
eb6f0b2e3efca8f492f48a2c5198a565810dd2e4 | 9,242 | py | Python | lm_eval/tasks/drop.py | bigscience-workshop/lm-evaluation-harness | c639c81974d6d0efea2e471f6292cf3c6ae67e4c | [
"MIT"
] | null | null | null | lm_eval/tasks/drop.py | bigscience-workshop/lm-evaluation-harness | c639c81974d6d0efea2e471f6292cf3c6ae67e4c | [
"MIT"
] | null | null | null | lm_eval/tasks/drop.py | bigscience-workshop/lm-evaluation-harness | c639c81974d6d0efea2e471f6292cf3c6ae67e4c | [
"MIT"
] | null | null | null | """
DROP: A Reading Comprehension Benchmark Requiring Discrete Reasoning Over Paragraphs
https://aclanthology.org/attachments/N19-1246.Supplementary.pdf
DROP is a QA dataset which tests comprehensive understanding of paragraphs. In
this crowdsourced, adversarially-created, 96k question-answering benchmark, a
system ... | 35.140684 | 116 | 0.617074 |
270f796c85954e25da23c36b01afe8be2a8ca7fe | 3,037 | py | Python | tests/indexes/tests.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 3 | 2015-09-26T13:33:07.000Z | 2020-03-08T07:34:38.000Z | tests/indexes/tests.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/indexes/tests.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 15 | 2016-01-08T14:28:41.000Z | 2019-04-19T08:33:31.000Z | from unittest import skipUnless
from django.db import connection
from django.test import TestCase
from .models import Article, ArticleTranslation, IndexTogetherSingleList
class SchemaIndexesTests(TestCase):
"""
Test index handling by the db.backends.schema infrastructure.
"""
def test_index_name_ha... | 39.960526 | 91 | 0.665459 |
41e761ae082b81e443337a964cba0da4722adfe5 | 15,741 | py | Python | akshare/stock_feature/stock_gpzy_em.py | NovelResearchInvestment/akshare | ccce37101b26e89a46b9b8b7b27b4eebf49edccd | [
"MIT"
] | 721 | 2021-09-21T12:10:33.000Z | 2022-03-31T09:47:01.000Z | akshare/stock_feature/stock_gpzy_em.py | NovelResearchInvestment/akshare | ccce37101b26e89a46b9b8b7b27b4eebf49edccd | [
"MIT"
] | 135 | 2021-09-21T12:07:54.000Z | 2022-03-31T14:15:36.000Z | akshare/stock_feature/stock_gpzy_em.py | NovelResearchInvestment/akshare | ccce37101b26e89a46b9b8b7b27b4eebf49edccd | [
"MIT"
] | 234 | 2021-09-21T12:16:27.000Z | 2022-03-31T09:47:04.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Date: 2022/4/10 17:42
Desc: 东方财富网-数据中心-特色数据-股权质押
东方财富网-数据中心-特色数据-股权质押-股权质押市场概况: http://data.eastmoney.com/gpzy/marketProfile.aspx
东方财富网-数据中心-特色数据-股权质押-上市公司质押比例: http://data.eastmoney.com/gpzy/pledgeRatio.aspx
东方财富网-数据中心-特色数据-股权质押-重要股东股权质押明细: http://data.eastmoney.com/gpz... | 29.477528 | 144 | 0.548567 |
7c8c17708c1c51cecf03e08ad6c9f0bd25c48427 | 3,678 | py | Python | linorobot2_bringup/launch/sensors.launch.py | grassjelly/square | 1759a624a75d74533986cb3d92df11fd0f631df9 | [
"Apache-2.0"
] | 82 | 2021-09-23T06:57:55.000Z | 2022-03-31T23:19:47.000Z | linorobot2_bringup/launch/sensors.launch.py | grassjelly/square | 1759a624a75d74533986cb3d92df11fd0f631df9 | [
"Apache-2.0"
] | 23 | 2021-09-25T17:42:17.000Z | 2022-03-28T07:54:27.000Z | linorobot2_bringup/launch/sensors.launch.py | grassjelly/square | 1759a624a75d74533986cb3d92df11fd0f631df9 | [
"Apache-2.0"
] | 27 | 2021-09-23T12:04:56.000Z | 2022-03-31T19:39:04.000Z | # Copyright (c) 2021 Juan Miguel Jimeno
#
# 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... | 41.795455 | 170 | 0.66857 |
d6a45baeff1ed4eb1d9a058383a4977cab3a16b5 | 2,289 | py | Python | gui/vtc/vtctabbar.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | 1 | 2021-04-04T20:40:29.000Z | 2021-04-04T20:40:29.000Z | gui/vtc/vtctabbar.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | null | null | null | gui/vtc/vtctabbar.py | nxsofsys/electrum-zcl | 3675fa2f871a4e944fc875a4653f95d9b38b9e29 | [
"MIT"
] | null | null | null | from PyQt4.QtCore import *
from PyQt4.QtGui import *
class VtcTabBar(QTabBar):
def __init__(self, parent=None):
super(VtcTabBar, self).__init__(parent)
self.tabSize = QSize(120, 120)
self.borderColor = QColor(165, 162, 170)
self.backgroundColor = QColor(30, 24, 43)
self.fi... | 34.164179 | 77 | 0.583661 |
e03f0d87ea206f3688f8e20c409882fd89e8431d | 1,317 | py | Python | decision_making/scripts/plays/play_their_pre_kickoff.py | SSL-Roots/CON-SAI | dbe60090441547df3d31c87db948c8822b07bfb1 | [
"MIT"
] | 28 | 2017-08-15T03:38:53.000Z | 2021-11-25T02:11:05.000Z | decision_making/scripts/plays/play_their_pre_kickoff.py | SSL-Roots/CON-SAI | dbe60090441547df3d31c87db948c8822b07bfb1 | [
"MIT"
] | 41 | 2017-08-17T07:48:18.000Z | 2019-07-23T04:36:37.000Z | decision_making/scripts/plays/play_their_pre_kickoff.py | team-aisaac/aisaac-strategy | 3e4940cc7277bfa1d25ac8eef2aaf5904c5585aa | [
"MIT"
] | 10 | 2019-03-27T12:24:08.000Z | 2019-07-01T09:45:28.000Z |
from play_base import Play
from tactics.tactic_goalie import TacticGoalie
from tactics.tactic_interpose import TacticInterpose
from tactics.tactic_position import TacticPosition
import constants
class PlayTheirPreKickoff(Play):
def __init__(self):
super(PlayTheirPreKickoff, self).__init__('PlayTheirPreKi... | 33.769231 | 82 | 0.602126 |
e10d6134a03c29a63ebd139cc4ae55a00aef64de | 150 | py | Python | utils/lit/tests/usage.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 1,192 | 2017-01-23T23:27:01.000Z | 2019-05-05T14:08:40.000Z | utils/lit/tests/usage.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 2,214 | 2019-05-06T22:22:53.000Z | 2022-03-31T19:38:50.000Z | utils/lit/tests/usage.py | clayne/DirectXShaderCompiler | 0ef9b702890b1d45f0bec5fa75481290323e14dc | [
"NCSA"
] | 269 | 2019-05-07T11:59:04.000Z | 2022-03-30T08:41:50.000Z | # Basic sanity check that usage works.
#
# RUN: %{lit} --help > %t.out
# RUN: FileCheck < %t.out %s
#
# CHECK: Usage: lit.py [options] {file-or-path}
| 21.428571 | 47 | 0.62 |
4ba7b1f599f6241022fd44dd5c80d5ae8e136702 | 6,534 | py | Python | ops.py | hsab/Blender_GES_Import | 9ff67da66ec1a8fbc38c2368036719b5c32839c0 | [
"MIT"
] | null | null | null | ops.py | hsab/Blender_GES_Import | 9ff67da66ec1a8fbc38c2368036719b5c32839c0 | [
"MIT"
] | null | null | null | ops.py | hsab/Blender_GES_Import | 9ff67da66ec1a8fbc38c2368036719b5c32839c0 | [
"MIT"
] | null | null | null | import bpy
import bpy, json, mathutils, math, bmesh
from mathutils import *
class GESIO_OT_ImportSceneOperator(bpy.types.Operator):
bl_idname = "gesio.importscene"
bl_label = "GESIO_ImportScene"
def execute(self, context):
cam = bpy.context.scene.camera
globalsale = bpy.conte... | 36.915254 | 112 | 0.533976 |
6be71ddab8013b74b910a617388e22d56fdb59ff | 632 | py | Python | smriprep/__about__.py | oesteban/smriprep | 2f03ac6d7461c9018f19ef2c2b2b2b5bf8bf8eff | [
"Apache-2.0"
] | null | null | null | smriprep/__about__.py | oesteban/smriprep | 2f03ac6d7461c9018f19ef2c2b2b2b5bf8bf8eff | [
"Apache-2.0"
] | null | null | null | smriprep/__about__.py | oesteban/smriprep | 2f03ac6d7461c9018f19ef2c2b2b2b5bf8bf8eff | [
"Apache-2.0"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Base module variables
"""
from ._version import get_versions
__version__ = get_versions()["version"]
del get_versions
__copyright__ = (
"Copyright 2019, Center for Reproducible Neuroscience, Stan... | 24.307692 | 79 | 0.700949 |
d51442e5802a7e7a7d3c8bda504b303ddbb541d1 | 483 | py | Python | books/PythonAutomate/webscrap/using_bs4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/using_bs4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | books/PythonAutomate/webscrap/using_bs4.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import bs4
with open("example.html") as f:
# 텍스트 파일로 부터 BeautifulSoup 객체 생성
soup = bs4.BeautifulSoup(f.read(), "lxml")
print(type(soup)) # <class 'bs4.BeautifulSoup'>
# id가 author인 태그 리스트 조회
elems = soup.select("#author")
print(type(elems)) # <class 'list'>
print(type(elems[0])) # <class 'bs4.element.Tag'... | 19.32 | 50 | 0.654244 |
8b5105684b51a6d7896a42bc400f18cbe78b4bf9 | 12,444 | py | Python | gausspyplus/utils/moment_masking.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 34 | 2019-06-03T14:03:28.000Z | 2022-02-02T16:25:23.000Z | gausspyplus/utils/moment_masking.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 4 | 2020-03-13T06:35:58.000Z | 2021-04-06T07:06:23.000Z | gausspyplus/utils/moment_masking.py | cmurray-astro/gausspyplus | bb26e561da70b8b130c785fbc4324c95bc416766 | [
"BSD-3-Clause"
] | 8 | 2019-06-26T01:48:28.000Z | 2021-11-20T23:54:07.000Z | # @Author: riener
# @Date: 2019-01-09T12:27:55+01:00
# @Filename: moment_masking.py
# @Last modified by: riener
# @Last modified time: 2019-04-08T10:17:48+02:00
"""Moment masking procedure from Dame (2011)."""
import os
import itertools
import warnings
import numpy as np
from astropy.io import fits
from astropy... | 45.75 | 373 | 0.666185 |
e20b07b11d9a0d00ccaf57bc8a101daee926459e | 960 | py | Python | data/keywords.py | Biangkerok32/csapp | a78397322e85f20172b84e0ebe3147544583261c | [
"MIT"
] | null | null | null | data/keywords.py | Biangkerok32/csapp | a78397322e85f20172b84e0ebe3147544583261c | [
"MIT"
] | null | null | null | data/keywords.py | Biangkerok32/csapp | a78397322e85f20172b84e0ebe3147544583261c | [
"MIT"
] | 1 | 2019-08-01T19:56:37.000Z | 2019-08-01T19:56:37.000Z | from __future__ import absolute_import
from __future__ import print_function
import os
import rake
# spanish stopwords
stoppath = "SpanishStoplist.txt"
# 1. initialize RAKE by providing a path to a stopwords file and setting phrase length in words to 1
rake_object = rake.Rake(stoppath, 5, 1, 4)
# 2. run on RAKE on ... | 34.285714 | 100 | 0.626042 |
7b9493453662699fd3a6b0d97f13552e859109e3 | 20,595 | py | Python | hooks.py | pchanial/pyoperators | 57d924f181b93848e6ce570ef0ab8982e9b06bcc | [
"CECILL-B"
] | 5 | 2015-07-07T22:00:29.000Z | 2020-05-20T19:30:24.000Z | hooks.py | pchanial/pyoperators | 57d924f181b93848e6ce570ef0ab8982e9b06bcc | [
"CECILL-B"
] | 7 | 2015-02-13T13:43:57.000Z | 2019-01-28T22:33:48.000Z | hooks.py | pchanial/pyoperators | 57d924f181b93848e6ce570ef0ab8982e9b06bcc | [
"CECILL-B"
] | 4 | 2015-03-24T14:52:29.000Z | 2019-10-07T16:22:34.000Z | """
The version number is obtained from git tags, branch and commit identifier.
It has been designed for the following workflow:
- git init
- create setup.py commit
- more commit
- set version 0.1 in setup.py -> 0.1.dev03
- modify, commit -> 0.1.dev04
- git checkout -b v0.1 -> 0.1.dev04
- modify, c... | 35.386598 | 79 | 0.576305 |
f1ea6aff1afb6d36627f13ca096fb08d56c8a03f | 803 | py | Python | setup.py | markguo40/merkletree | 05af681de801d161e6b4917b389ea5b24125b46f | [
"MIT"
] | 1 | 2018-12-13T21:52:00.000Z | 2018-12-13T21:52:00.000Z | setup.py | markguo40/merkletree | 05af681de801d161e6b4917b389ea5b24125b46f | [
"MIT"
] | null | null | null | setup.py | markguo40/merkletree | 05af681de801d161e6b4917b389ea5b24125b46f | [
"MIT"
] | null | null | null |
#!/usr/bin/env python
from setuptools import setup
from os import path
setup(name='merkletree',
version='1.0',
description='A implemenation of Merkle Tree',
author='Zhanchen Guo',
author_email='markguo40@gmail.com',
url='https://github.com/markguo40/merkletree',
download_url='http... | 27.689655 | 65 | 0.597758 |
80bef994d19110821c2da00b9776588952c1cd58 | 1,838 | py | Python | opta/commands/logs.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 595 | 2021-05-21T22:30:48.000Z | 2022-03-31T15:40:25.000Z | opta/commands/logs.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 463 | 2021-05-24T21:32:59.000Z | 2022-03-31T17:12:33.000Z | opta/commands/logs.py | run-x/opta | 64606498334f2b1aa79f5a431465eafdf5ca5ed7 | [
"Apache-2.0"
] | 29 | 2021-05-21T22:27:52.000Z | 2022-03-28T16:43:45.000Z | from typing import Optional
import click
from opta.amplitude import amplitude_client
from opta.core.generator import gen_all
from opta.core.kubernetes import configure_kubectl, load_opta_kube_config, tail_module_log
from opta.exceptions import UserErrors
from opta.layer import Layer
from opta.utils import check_opta_... | 32.821429 | 90 | 0.698041 |
cf235826d5c4995a08e26f88e5defb73b51b8ea3 | 668 | py | Python | Resene naloge/euler115.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | Resene naloge/euler115.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | Resene naloge/euler115.py | CadezDavid/ProjectEuler | 9e11aa5782fb600c98eba9e04766b3bd79acea0e | [
"MIT"
] | null | null | null | slovar_moznosti = {0: 1}
def moznosti(dolzina, zadnji=1, m=3):
'''1 - siva in 0 - rdeča'''
if dolzina <= 0:
return int(dolzina == 0)
elif dolzina == 0:
return moznosti(m, 0, m) + moznosti(1, 1, m)
elif (dolzina, m) in slovar_moznosti and zadnji == 1:
return slovar_moznosti[(dolz... | 31.809524 | 97 | 0.579341 |
fbbbf9c2bfa49e98f88c9aa5eaeb8a760db3d9d0 | 889 | py | Python | api/autoGmeet/services/autoGmeet.py | iamsuvhro/AutoTask | 8a2c5c4f37a12c127becfe078158e40a9db88d5c | [
"Apache-2.0"
] | null | null | null | api/autoGmeet/services/autoGmeet.py | iamsuvhro/AutoTask | 8a2c5c4f37a12c127becfe078158e40a9db88d5c | [
"Apache-2.0"
] | 2 | 2022-02-15T19:31:48.000Z | 2022-02-15T19:33:03.000Z | api/autoGmeet/services/autoGmeet.py | iamsuvhro/AutoTask | 8a2c5c4f37a12c127becfe078158e40a9db88d5c | [
"Apache-2.0"
] | null | null | null | # Importing libraries
from lib2to3.pgen2 import driver
from selenium import webdriver
import datetime
import time
DRIVER_ADDRESS = (
"chromedriver"
)
class AutoGmeetTask:
def _getDriver():
driver = webdriver.Chrome(DRIVER_ADDRESS)
return driver
def getlinkOperation(meetingLink: str, l... | 24.027027 | 64 | 0.623172 |
6a654ecd2439bf51d41d4525992bae1715b50658 | 618 | py | Python | froide/bounce/tasks.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 198 | 2016-12-03T22:42:55.000Z | 2022-03-25T15:08:36.000Z | froide/bounce/tasks.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 264 | 2016-11-30T18:53:17.000Z | 2022-03-17T11:34:18.000Z | froide/bounce/tasks.py | xenein/froide | 59bd3eeded3c3ed00fbc858fe20bfea99c8dbefa | [
"MIT"
] | 42 | 2016-12-22T04:08:27.000Z | 2022-02-26T08:30:38.000Z | from django.conf import settings
from froide.celery import app as celery_app
from .utils import check_bounce_mails, check_unsubscribe_mails
HANDLE_BOUNCES = settings.FROIDE_CONFIG["bounce_enabled"]
HANDLE_UNSUBSCRIBE = settings.FROIDE_CONFIG["unsubscribe_enabled"]
@celery_app.task(name="froide.bounce.tasks.check_... | 25.75 | 79 | 0.778317 |
12df9f134c4e45c1247723f7c64cc03da7bd2e29 | 12,455 | py | Python | tensorbay/sensor/tests/test_intrinsics.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | tensorbay/sensor/tests/test_intrinsics.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | tensorbay/sensor/tests/test_intrinsics.py | YiweiLi4/tensorbay-python-sdk | 20fc8b37bad01c2d201a87b1436f1d4ff77d76df | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2021 Graviti. Licensed under MIT License.
#
import numpy as np
import pytest
from ...geometry import Vector2D
from .. import CameraIntrinsics, CameraMatrix, DistortionCoefficients
_3x3_MATRIX = [[1, 2, 3], [0, 4, 5], [0, 0, 1]]
_3x3_NUMPY = np.array([[1.0, 2.0, 3.0], [0.0, 5.0, 5.... | 41.795302 | 100 | 0.672421 |
14935c96f1f3e58348237e1eeadaacd97c843e80 | 2,499 | py | Python | demo.py | LCX666/Spoon | 4b85357f6891c3272728972cdca57c260879b181 | [
"MIT"
] | 3 | 2020-10-31T12:10:03.000Z | 2020-12-07T12:42:17.000Z | demo.py | LCX666/Spoon | 4b85357f6891c3272728972cdca57c260879b181 | [
"MIT"
] | null | null | null | demo.py | LCX666/Spoon | 4b85357f6891c3272728972cdca57c260879b181 | [
"MIT"
] | 2 | 2021-09-16T08:11:52.000Z | 2022-01-23T03:57:51.000Z | from calc import calc
import numpy as np
from pretreat import read
def MemoryMatrix():
print("="*10 + "This is function MemoryMatrix" + "="*10 + "\n")
matrix = np.array([[0,1,2,3],[1,0,2,3],[2,2,0,4],[3,3,4,0]], dtype = np.int32) # the data of the adjacency matrix
print("The matrix data is:")
print(matrix)
g... | 28.078652 | 114 | 0.613846 |
876b3a2ee755363661f9be68abc04ce91d87bd11 | 1,189 | py | Python | analytics/stats.py | YAtOff/lansync | 750588f3b1db87287b518cb29523980e778edfef | [
"MIT"
] | null | null | null | analytics/stats.py | YAtOff/lansync | 750588f3b1db87287b518cb29523980e778edfef | [
"MIT"
] | null | null | null | analytics/stats.py | YAtOff/lansync | 750588f3b1db87287b518cb29523980e778edfef | [
"MIT"
] | null | null | null | #%%
from glob import glob
import json
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set()
%matplotlib inline
def load_evnets():
for filename in glob("../log/stats-*.json"):
print(filename)
with open(filename, "rt") as file:
for line in file.readlines(... | 25.297872 | 97 | 0.710681 |
ecf3445b4cbb09f9ad1ee5758b0482e07a0ff825 | 6,917 | py | Python | kkcalc/PackRawData.py | dschick/kkcalc | 9218d557fb3217ff1339dcc81230380e2cc0059b | [
"Zlib"
] | null | null | null | kkcalc/PackRawData.py | dschick/kkcalc | 9218d557fb3217ff1339dcc81230380e2cc0059b | [
"Zlib"
] | 1 | 2021-02-09T10:18:14.000Z | 2021-02-17T08:28:58.000Z | kkcalc/PackRawData.py | dschick/kkcalc | 9218d557fb3217ff1339dcc81230380e2cc0059b | [
"Zlib"
] | 3 | 2021-02-06T23:37:14.000Z | 2022-01-19T15:26:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of the Kramers-Kronig Calculator software package.
#
# Copyright (c) 2013 Benjamin Watts, Daniel J. Lauk
#
# The software is licensed under the terms of the zlib/libpng license.
# For details see LICENSE.txt
"""
This module takes data from different so... | 40.688235 | 191 | 0.690039 |
ae816d9acb08ab58d736f549959dfa383cdf8314 | 2,337 | py | Python | manage.py | Frederick-S/braindump | b7bed35581149d7054a56a0e42d6ae6c7ee2e56a | [
"MIT"
] | null | null | null | manage.py | Frederick-S/braindump | b7bed35581149d7054a56a0e42d6ae6c7ee2e56a | [
"MIT"
] | null | null | null | manage.py | Frederick-S/braindump | b7bed35581149d7054a56a0e42d6ae6c7ee2e56a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
from app import (
create_app,
db)
from app.models import (
User,
Note,
Tag,
Notebook)
from flask_script import (
Manager,
Shell)
from flask_migrate import (
Migrate,
MigrateCommand)
COV = None
if os.environ.get('FLASK_COVERAGE'):
import cover... | 24.861702 | 74 | 0.639281 |
7b25dbbb679c71f10a8082d02393cc6a5b7cdbe4 | 8,603 | py | Python | astoria/consumers/astwifid.py | sedders123/astoria | d1e9603b10d765aed4c1237e79b5ab48a9af1d83 | [
"MIT"
] | 1 | 2021-02-03T02:54:54.000Z | 2021-02-03T02:54:54.000Z | astoria/consumers/astwifid.py | sedders123/astoria | d1e9603b10d765aed4c1237e79b5ab48a9af1d83 | [
"MIT"
] | 72 | 2020-12-15T18:29:18.000Z | 2022-03-08T09:42:53.000Z | astoria/consumers/astwifid.py | sedders123/astoria | d1e9603b10d765aed4c1237e79b5ab48a9af1d83 | [
"MIT"
] | 2 | 2022-02-05T23:00:51.000Z | 2022-03-09T21:40:49.000Z | """
Astoria WiFi Daemon.
Manages a WiFi hotspot for the robot.
"""
import asyncio
import logging
import os
import signal
import tempfile
from json import JSONDecodeError, loads
from pathlib import Path
from typing import IO, Match, Optional
import click
from pydantic import ValidationError
from astoria.common.consum... | 35.995816 | 87 | 0.580611 |
8e367d43ab04f877a9e50a299f234050521400de | 2,221 | py | Python | utils.py | xcs224-summary-team/attention-analysis | e179df571ae7e11c69f65932ce76f82d4dc55065 | [
"MIT"
] | null | null | null | utils.py | xcs224-summary-team/attention-analysis | e179df571ae7e11c69f65932ce76f82d4dc55065 | [
"MIT"
] | null | null | null | utils.py | xcs224-summary-team/attention-analysis | e179df571ae7e11c69f65932ce76f82d4dc55065 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import pickle
import time
import tensorflow as tf
def load_json(path):
with tf.io.gfile.GFile(path, 'r') as f:
return json.load(f)
def write_json(o, path):
print(path)
print(o)
tf.i... | 27.7625 | 79 | 0.587123 |
40c22248aee230cf12a47d68211c2dcb21511400 | 5,258 | py | Python | poem/Poem/poem/admin_interface/siteprobes.py | kzailac/poem | 9f898e3cc3378ef1c49517b4cf6335a93a3f49b0 | [
"Apache-2.0"
] | null | null | null | poem/Poem/poem/admin_interface/siteprobes.py | kzailac/poem | 9f898e3cc3378ef1c49517b4cf6335a93a3f49b0 | [
"Apache-2.0"
] | null | null | null | poem/Poem/poem/admin_interface/siteprobes.py | kzailac/poem | 9f898e3cc3378ef1c49517b4cf6335a93a3f49b0 | [
"Apache-2.0"
] | null | null | null | from django.forms import ModelForm, CharField, Textarea
from django.forms.widgets import TextInput
from django.contrib import admin
from django.urls import reverse
from django.utils.html import format_html
from reversion.models import Revision, Version
from reversion_compare.admin import CompareVersionAdmin
from Poem.... | 40.446154 | 80 | 0.518068 |
3aa7a01f2011ead0d1d984e4ad37756cd2f04651 | 463 | py | Python | accounts/migrations/0015_alter_job_brochure.py | H4CK3RD33P/SmartJobPortal | adb587ab89b522765919817a6cdd87d5313110a6 | [
"MIT"
] | null | null | null | accounts/migrations/0015_alter_job_brochure.py | H4CK3RD33P/SmartJobPortal | adb587ab89b522765919817a6cdd87d5313110a6 | [
"MIT"
] | null | null | null | accounts/migrations/0015_alter_job_brochure.py | H4CK3RD33P/SmartJobPortal | adb587ab89b522765919817a6cdd87d5313110a6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-07-07 13:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0014_job_brochure'),
]
operations = [
migrations.AlterField(
model_name='job',
name='brochure',
... | 24.368421 | 135 | 0.634989 |
4bcf8d19b3962a0a93c7a292f116e183c02c7a4e | 13,781 | py | Python | qiskit/backends/_qiskit_cpp_simulator.py | drmandaarbpande/qiskit-sdk-py | 04065ed68be2dbe25aefa1d153057f6f3986ae7b | [
"Apache-2.0"
] | null | null | null | qiskit/backends/_qiskit_cpp_simulator.py | drmandaarbpande/qiskit-sdk-py | 04065ed68be2dbe25aefa1d153057f6f3986ae7b | [
"Apache-2.0"
] | null | null | null | qiskit/backends/_qiskit_cpp_simulator.py | drmandaarbpande/qiskit-sdk-py | 04065ed68be2dbe25aefa1d153057f6f3986ae7b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 IBM RESEARCH. 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... | 37.045699 | 93 | 0.582904 |
5fda3043dc7890cd09a0b8081688b9ef15136d9f | 1,233 | py | Python | GPy/plotting/gpy_plot/inference_plots.py | ekalosak/GPy | ff82f12c3d321bfc3ce6615447fad25aea9de6bd | [
"BSD-3-Clause"
] | 1,685 | 2015-01-03T14:46:25.000Z | 2022-03-30T02:41:35.000Z | GPy/plotting/gpy_plot/inference_plots.py | ekalosak/GPy | ff82f12c3d321bfc3ce6615447fad25aea9de6bd | [
"BSD-3-Clause"
] | 778 | 2015-01-15T18:21:25.000Z | 2022-03-30T14:52:32.000Z | GPy/plotting/gpy_plot/inference_plots.py | ekalosak/GPy | ff82f12c3d321bfc3ce6615447fad25aea9de6bd | [
"BSD-3-Clause"
] | 584 | 2015-01-06T06:30:43.000Z | 2022-03-29T13:05:33.000Z | # Copyright (c) 2012, GPy authors (see AUTHORS.txt).
# Licensed under the BSD 3-clause license (see LICENSE.txt)
#import numpy as np
#import Tango
#from base_plots import gpplot, x_frame1D, x_frame2D
from . import plotting_library as pl
def plot_optimizer(optimizer, **kwargs):
if optimizer.trace == None:
... | 44.035714 | 123 | 0.695053 |
4650b59f622f8b29923f8860fa0cbe5a91e47279 | 9,643 | py | Python | search/django/adapters.py | seawolf42/search | 8b1a506e4a1117951237db7f6a1795e2f3b732e4 | [
"MIT"
] | 53 | 2015-02-27T15:17:49.000Z | 2022-02-12T11:42:34.000Z | search/django/adapters.py | seawolf42/search | 8b1a506e4a1117951237db7f6a1795e2f3b732e4 | [
"MIT"
] | 32 | 2015-01-20T13:03:55.000Z | 2019-05-14T10:29:52.000Z | search/django/adapters.py | seawolf42/search | 8b1a506e4a1117951237db7f6a1795e2f3b732e4 | [
"MIT"
] | 21 | 2015-06-05T09:07:07.000Z | 2021-09-14T11:01:43.000Z | import operator
from django.db.models import Q as DjangoQ
from django.db.models.lookups import Lookup
from ..ql import Q as SearchQ
def resolve_filter_value(v):
"""Resolve a filter value to one that the search API can handle
We can't pass model instances for example.
"""
return getattr(v, 'pk', v)
... | 30.323899 | 94 | 0.550866 |
9c4c029df0c582b136a0dddf90fc12f22df9a09b | 2,220 | py | Python | elegy/nn/linear.py | floscha/elegy | 2be3198859e142f744ea8e9982cf90169baba776 | [
"Apache-2.0"
] | null | null | null | elegy/nn/linear.py | floscha/elegy | 2be3198859e142f744ea8e9982cf90169baba776 | [
"Apache-2.0"
] | null | null | null | elegy/nn/linear.py | floscha/elegy | 2be3198859e142f744ea8e9982cf90169baba776 | [
"Apache-2.0"
] | null | null | null | import typing as tp
import haiku as hk
import jax.numpy as jnp
import numpy as np
from elegy import hooks, module, types
from elegy.initializers import TruncatedNormal
class Linear(module.Module):
"""Linear module."""
w: np.ndarray
b: np.ndarray
def __init__(
self,
output_size: int,... | 30.833333 | 87 | 0.596847 |
ed6ed714ebff06a858db53314d69e5c97e16cc0e | 3,996 | py | Python | jinahub/encoders/image/BigTransferEncoder/tests/unit/test_big_transfer.py | albertocarpentieri/executors | 3b025b6106fca9dba3c2569b0e60da050273fa6e | [
"Apache-2.0"
] | 29 | 2021-07-26T07:16:38.000Z | 2022-03-27T15:10:34.000Z | jinahub/encoders/image/BigTransferEncoder/tests/unit/test_big_transfer.py | albertocarpentieri/executors | 3b025b6106fca9dba3c2569b0e60da050273fa6e | [
"Apache-2.0"
] | 176 | 2021-07-23T08:30:21.000Z | 2022-03-14T12:29:06.000Z | jinahub/encoders/image/BigTransferEncoder/tests/unit/test_big_transfer.py | albertocarpentieri/executors | 3b025b6106fca9dba3c2569b0e60da050273fa6e | [
"Apache-2.0"
] | 16 | 2021-07-26T20:55:40.000Z | 2022-03-18T15:32:17.000Z | import os
import shutil
from pathlib import Path
from typing import Tuple
import numpy as np
import pytest
from big_transfer import BigTransferEncoder
from jina import Document, DocumentArray, Executor
from PIL import Image
directory = os.path.dirname(os.path.realpath(__file__))
_INPUT_DIM = 512
_EMBEDDING_DIM = 20... | 28.748201 | 82 | 0.668168 |
257a1b868b41d92d72e31736eafc902dcd636dca | 297 | py | Python | keras_contrib/tests/metrics.py | HaemanthSP/keras-contrib | f183ff70afb0450475b9d0381d4b9c7c07941fbc | [
"MIT"
] | 1 | 2020-09-15T10:00:05.000Z | 2020-09-15T10:00:05.000Z | keras_contrib/tests/metrics.py | HaemanthSP/keras-contrib | f183ff70afb0450475b9d0381d4b9c7c07941fbc | [
"MIT"
] | null | null | null | keras_contrib/tests/metrics.py | HaemanthSP/keras-contrib | f183ff70afb0450475b9d0381d4b9c7c07941fbc | [
"MIT"
] | 2 | 2020-07-24T07:59:46.000Z | 2021-02-07T16:25:35.000Z | import numpy as np
from tensorflow.keras import backend as K
all_metrics = []
all_sparse_metrics = []
def validate_metric(metric):
y_a = K.variable(np.random.random((6, 7)))
y_b = K.variable(np.random.random((6, 7)))
output = metric(y_a, y_b)
assert K.eval(output).shape == ()
| 21.214286 | 46 | 0.670034 |
4e2ceed13e7bba40f2ee8dedcebcae3afe9cb309 | 5,729 | py | Python | tests/fugue_spark/utils/test_io.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | tests/fugue_spark/utils/test_io.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | tests/fugue_spark/utils/test_io.py | LaurentErreca/fugue | 73d551b4d25b50b3d9051dd765e6111db2e3fc76 | [
"Apache-2.0"
] | null | null | null | import os
from fugue.collections.partition import PartitionSpec
from fugue.dataframe.pandas_dataframe import PandasDataFrame
from fugue.dataframe.utils import _df_eq as df_eq
from fugue_spark.dataframe import SparkDataFrame
from fugue_spark._utils.convert import to_schema, to_spark_schema
from fugue_spark._utils.io im... | 38.709459 | 87 | 0.625415 |
cbd544d1fa045df7c2e6b1467a6984c6ef414f6f | 913 | py | Python | pynes/tests/bcc_test.py | BmanisKing/Mine | d33fc14c84af336ae16fefda2dcebc9f0e1e12ab | [
"BSD-3-Clause"
] | null | null | null | pynes/tests/bcc_test.py | BmanisKing/Mine | d33fc14c84af336ae16fefda2dcebc9f0e1e12ab | [
"BSD-3-Clause"
] | null | null | null | pynes/tests/bcc_test.py | BmanisKing/Mine | d33fc14c84af336ae16fefda2dcebc9f0e1e12ab | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
'''
BCC, Branch on Carry Clear Test
This is a test for the branch instruction BMI of
the 6502. This instruction performs the branch
if C == 0.
'''
import unittest
from pynes.compiler import lexical, syntax, semantic
class BccTest(unittest.TestCase):
'''This is an relative instruction, s... | 30.433333 | 68 | 0.664841 |
2fe1d61e05100396b1769713af61715d46ac2819 | 568 | py | Python | 01_hello/solutions/hello.py | davidfurrer/python-exercises | 2fa2a4f08f6aededd28842f9843dd569ab0e2945 | [
"MIT"
] | null | null | null | 01_hello/solutions/hello.py | davidfurrer/python-exercises | 2fa2a4f08f6aededd28842f9843dd569ab0e2945 | [
"MIT"
] | 2 | 2020-08-27T09:15:40.000Z | 2020-08-28T15:16:03.000Z | 01_hello/solutions/hello.py | davidfurrer/python-exercises | 2fa2a4f08f6aededd28842f9843dd569ab0e2945 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : Python-projects
Purpose: Say Hello
"""
import argparse
def get_args():
"""Get the command-line arguments"""
parser = argparse.ArgumentParser(description='Say Hello')
parser.add_argument('-n',
'--name',
metavar='name',
... | 19.586207 | 61 | 0.533451 |
cb80d79f5994d8037064f788740c657c0ff5de21 | 3,560 | py | Python | rest-api/model.py | transentis/bptk_intro | 88d0a0cc0338ed6b381dfabafcb9f6a029ac526d | [
"MIT"
] | null | null | null | rest-api/model.py | transentis/bptk_intro | 88d0a0cc0338ed6b381dfabafcb9f6a029ac526d | [
"MIT"
] | null | null | null | rest-api/model.py | transentis/bptk_intro | 88d0a0cc0338ed6b381dfabafcb9f6a029ac526d | [
"MIT"
] | null | null | null | import BPTK_Py
from BPTK_Py import Model
from BPTK_Py import sd_functions as sd
def bptk_factory():
model = Model(starttime=1.0,stoptime=60.0, dt=1.0, name="Customer Acquisition SDDSL")
# stocks
customers = model.stock("customers")
potential_customers = model.stock("potential_customers")
#flows
... | 36.701031 | 127 | 0.697472 |
61af935bd822765ab3b64e0059e8876a89347615 | 62,809 | py | Python | pandas/io/formats/format.py | mtrbean/pandas | c0ff67a22df9c18da1172766e313732ed2ab6c30 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-02-18T00:47:14.000Z | 2019-02-18T00:47:14.000Z | pandas/io/formats/format.py | mtrbean/pandas | c0ff67a22df9c18da1172766e313732ed2ab6c30 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-08-18T16:00:45.000Z | 2019-08-18T16:00:45.000Z | pandas/io/formats/format.py | mtrbean/pandas | c0ff67a22df9c18da1172766e313732ed2ab6c30 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2019-12-01T23:32:18.000Z | 2019-12-01T23:32:18.000Z | """
Internal module for formatting output data in csv, html,
and latex files. This module also applies to display formatting.
"""
import codecs
from contextlib import contextmanager
import decimal
from functools import partial
from io import StringIO
import math
import re
from shutil import get_terminal_size
from typi... | 32.242813 | 88 | 0.572577 |
9dee406fac99c380cab72ad7df121fb30ed82a1a | 1,160 | py | Python | vega/datasets/common/__init__.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 724 | 2020-06-22T12:05:30.000Z | 2022-03-31T07:10:54.000Z | vega/datasets/common/__init__.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 147 | 2020-06-30T13:34:46.000Z | 2022-03-29T11:30:17.000Z | vega/datasets/common/__init__.py | jie311/vega | 1bba6100ead802697e691403b951e6652a99ccae | [
"MIT"
] | 160 | 2020-06-29T18:27:58.000Z | 2022-03-23T08:42:21.000Z | # -*- coding:utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the ... | 34.117647 | 72 | 0.662931 |
236c423c73e3ef35bcea402cef57b07031a4b983 | 65 | py | Python | folderspy/windows/__init__.py | rob-white/folderspy | 3d7b8329b821afc2caa7e93a6020fe6a901f1c09 | [
"MIT"
] | 1 | 2019-04-04T21:35:47.000Z | 2019-04-04T21:35:47.000Z | folderspy/windows/__init__.py | rob-white/folderspy | 3d7b8329b821afc2caa7e93a6020fe6a901f1c09 | [
"MIT"
] | 3 | 2020-03-24T16:20:29.000Z | 2021-06-01T22:49:32.000Z | folderspy/windows/__init__.py | rob-white/folderspy | 3d7b8329b821afc2caa7e93a6020fe6a901f1c09 | [
"MIT"
] | null | null | null | from .folder import WatchableFolder
from .spy import FolderSpy
| 21.666667 | 36 | 0.815385 |
613e29cbe839e1b727c0dac3547578152f7a7b67 | 5,706 | py | Python | pmemkv/pmemkv.py | ldorau/pmemkv-python | a0ce12bcf55eaa801509f0dfe550d7deee1ee76d | [
"BSD-3-Clause"
] | null | null | null | pmemkv/pmemkv.py | ldorau/pmemkv-python | a0ce12bcf55eaa801509f0dfe550d7deee1ee76d | [
"BSD-3-Clause"
] | null | null | null | pmemkv/pmemkv.py | ldorau/pmemkv-python | a0ce12bcf55eaa801509f0dfe550d7deee1ee76d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 35.222222 | 79 | 0.658955 |
3d7e155e8e0732d3642095250cf0744e877e5746 | 14,877 | py | Python | torba/torba/client/basenetwork.py | JupyterJones/lbry-sdk | be89436fa869e1b4b9f05c3faa5c126ebcfe6e57 | [
"MIT"
] | null | null | null | torba/torba/client/basenetwork.py | JupyterJones/lbry-sdk | be89436fa869e1b4b9f05c3faa5c126ebcfe6e57 | [
"MIT"
] | null | null | null | torba/torba/client/basenetwork.py | JupyterJones/lbry-sdk | be89436fa869e1b4b9f05c3faa5c126ebcfe6e57 | [
"MIT"
] | null | null | null | import logging
import asyncio
from operator import itemgetter
from typing import Dict, Optional, Tuple
from time import perf_counter
from torba.rpc import RPCSession as BaseClientSession, Connector, RPCError, ProtocolError
from torba import __version__
from torba.stream import StreamController
log = logging.getLogge... | 41.440111 | 107 | 0.642199 |
f83dfbb8b4d2109e4ff285051fc04e24ecb1ea92 | 1,555 | py | Python | tf_agents/networks/__init__.py | pipipuppypaul/agents | 832aad482c11b43f9f5d38d8df9f581cc6cbc63d | [
"Apache-2.0"
] | null | null | null | tf_agents/networks/__init__.py | pipipuppypaul/agents | 832aad482c11b43f9f5d38d8df9f581cc6cbc63d | [
"Apache-2.0"
] | 1 | 2021-02-24T00:52:43.000Z | 2021-02-24T00:52:43.000Z | tf_agents/networks/__init__.py | pipipuppypaul/agents | 832aad482c11b43f9f5d38d8df9f581cc6cbc63d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 40.921053 | 74 | 0.836013 |
faed8c0587e25e26675aa54d7a7b4815499b83c4 | 4,232 | py | Python | tests/__init__.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | null | null | null | tests/__init__.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | 7 | 2022-03-06T01:51:33.000Z | 2022-03-28T13:06:34.000Z | tests/__init__.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | null | null | null | #===================================================
# Fit a simple 5-variable linear regression model
# for unit testing.
#===================================================
from sklearn.linear_model import LinearRegression
from sklearn.ensemble import RandomForestRegressor
import shap
import unittest
import numpy ... | 30.446043 | 116 | 0.594991 |
c6950ba12d7a041387a75d3e3982878cd1083b0d | 4,441 | py | Python | tegaki/util.py | RShirohara/handwriting_detection | f24aba8ac695fef064d090db78229ab482f342cd | [
"MIT"
] | null | null | null | tegaki/util.py | RShirohara/handwriting_detection | f24aba8ac695fef064d090db78229ab482f342cd | [
"MIT"
] | 1 | 2021-02-24T00:31:12.000Z | 2021-02-26T00:11:24.000Z | tegaki/util.py | RShirohara/handwriting_detection | f24aba8ac695fef064d090db78229ab482f342cd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# author: @RShirohara
from queue import Queue, Empty
from threading import Event, Thread
from typing import NamedTuple
import cv2
class CapParams(NamedTuple):
"""Capture device params."""
source: str
width: int
height: int
class EventThread(Thread):
"""threading.Thread... | 26.123529 | 77 | 0.577347 |
e8fe8190e9acaf8a1c9432bebe2746febdc0133d | 678 | py | Python | everest/exceptions.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 2 | 2020-12-17T02:27:28.000Z | 2020-12-17T23:50:13.000Z | everest/exceptions.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 1 | 2020-12-07T10:14:45.000Z | 2020-12-07T10:14:45.000Z | everest/exceptions.py | rsbyrne/everest | 1ec06301cdeb7c2b7d85daf6075d996c5529247e | [
"MIT"
] | 1 | 2020-10-22T11:16:50.000Z | 2020-10-22T11:16:50.000Z | ###############################################################################
'''Defines the overarching exceptions inherited by all Everest code.'''
###############################################################################
class EverestException(Exception):
'''Parent exception of all Everest exceptions.''... | 48.428571 | 79 | 0.399705 |
229331f203e4d24a2772d0fe4648851a0fe871ce | 367 | py | Python | project/migrations/0003_rename_shape_files_project_shape_file.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | project/migrations/0003_rename_shape_files_project_shape_file.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | 3 | 2022-02-10T11:47:58.000Z | 2022-02-23T18:50:24.000Z | project/migrations/0003_rename_shape_files_project_shape_file.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-23 14:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("project", "0002_project_user"),
]
operations = [
migrations.RenameField(
model_name="project",
old_name="shape_files",
... | 19.315789 | 47 | 0.588556 |
fce0512fb50fccf1a7b5240c8eeb208ed836323a | 8,996 | py | Python | notebooks/SLAM/ekf_slam.py | GimpelZhang/git_test | 78dddbdc71209c3cfba58d831cfde1588989f8ab | [
"MIT"
] | 1 | 2020-11-30T03:23:22.000Z | 2020-11-30T03:23:22.000Z | notebooks/SLAM/ekf_slam.py | GimpelZhang/git_test | 78dddbdc71209c3cfba58d831cfde1588989f8ab | [
"MIT"
] | null | null | null | notebooks/SLAM/ekf_slam.py | GimpelZhang/git_test | 78dddbdc71209c3cfba58d831cfde1588989f8ab | [
"MIT"
] | null | null | null | """
Extended Kalman Filter SLAM example
author: Atsushi Sakai (@Atsushi_twi)
https://github.com/AtsushiSakai/PythonRobotics/tree/master/SLAM/EKFSLAM
"""
import math
import matplotlib.pyplot as plt
import numpy as np
# EKF state covariance: 3x3 size
Q = np.diag([0.5, 0.5, np.deg2rad(30.0)]) ** 2
R = np.diag([0.5, 0... | 28.200627 | 191 | 0.545909 |
511035365737f6c38c8a54c499f8d396877c9e93 | 1,161 | py | Python | crm/urls.py | uno-isqa-3900/assignment2-Conniesy2021 | f6b669f7d74b32b9b10f57da83ee059bb403e313 | [
"MIT"
] | 1 | 2021-02-22T21:58:24.000Z | 2021-02-22T21:58:24.000Z | crm/urls.py | uno-isqa-3900/assignment2-Conniesy2021 | f6b669f7d74b32b9b10f57da83ee059bb403e313 | [
"MIT"
] | null | null | null | crm/urls.py | uno-isqa-3900/assignment2-Conniesy2021 | f6b669f7d74b32b9b10f57da83ee059bb403e313 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
from django.urls import path, re_path
app_name = 'crm'
urlpatterns = [
path('', views.home, name='home'),
path('signup', views.signup, name='signup'),
re_path(r'^home/$', views.home, name='home'),
path('customer_list', views.customer_list, name='cust... | 52.772727 | 85 | 0.698536 |
33c104e00296132ca6188910d15db081ea39e346 | 1,947 | py | Python | lisc/core/modutils.py | koudyk/lisc | 679ba6624bb300f1b971be04fbf46e1fcfee65c9 | [
"Apache-2.0"
] | null | null | null | lisc/core/modutils.py | koudyk/lisc | 679ba6624bb300f1b971be04fbf46e1fcfee65c9 | [
"Apache-2.0"
] | null | null | null | lisc/core/modutils.py | koudyk/lisc | 679ba6624bb300f1b971be04fbf46e1fcfee65c9 | [
"Apache-2.0"
] | null | null | null | """Utility functions & decorators for dealing with LISC, as a module."""
from importlib import import_module
###################################################################################################
###################################################################################################
class De... | 28.632353 | 99 | 0.569594 |
dd9f9c6807bc54ef7592662df001ee7761c19abb | 3,124 | py | Python | Projective-Geometry/tony/com.tonybeltramelli.homography/CameraCalibrator.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 12 | 2017-05-26T12:04:38.000Z | 2021-07-11T04:42:19.000Z | Projective-Geometry/tony/com.tonybeltramelli.homography/CameraCalibrator.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | null | null | null | Projective-Geometry/tony/com.tonybeltramelli.homography/CameraCalibrator.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 4 | 2017-05-09T08:26:44.000Z | 2018-04-23T03:16:01.000Z | import cv2
from pylab import *
class CameraCalibrator:
is_calibrated = False
_n = 0
_output_path = None
_camera_matrix = None
_distortion_coefficient = None
_rotation_vectors = None
_translation_vectors = None
_pattern_size = None
_square_size = None
_pattern_points = None
... | 38.097561 | 232 | 0.650448 |
8de4d64057bd9656030a306fa131e5b9a3bd8f9c | 44,500 | py | Python | src/sage/interfaces/macaulay2.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/interfaces/macaulay2.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | null | null | null | src/sage/interfaces/macaulay2.py | switzel/sage | 7eb8510dacf61b691664cd8f1d2e75e5d473e5a0 | [
"BSL-1.0"
] | 1 | 2020-07-24T12:20:37.000Z | 2020-07-24T12:20:37.000Z | r"""
Interface to Macaulay2
.. NOTE::
You must have ``Macaulay2`` installed on your computer
for this interface to work. Macaulay2 is not included with Sage,
but you can obtain it from <http://www.math.uiuc.edu/Macaulay2/>.
Note additional optional Sage packages are required.
Sage provides an interfa... | 35.887097 | 154 | 0.49027 |
55e4c9681d500f4a8f2ade34c8ffc00be6f0e626 | 1,233 | py | Python | docs/cornell CS class/lesson 17. Recursion/demos/de2.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 17. Recursion/demos/de2.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | docs/cornell CS class/lesson 17. Recursion/demos/de2.py | LizzieDeng/kalman_fliter_analysis | 50e728f32c496c3fcbb8ca3ee00857b999b88d99 | [
"MIT"
] | null | null | null | """
Recursive functions to remove characters from a string.
These functions should be copied into the Python Tutor. That way you can
see how recursion affects the call stack.
Author: Walker M. White
Date: April 15, 2019
"""
import introcs
def deblank(s):
"""
Returns: s but with blanks removed
Parame... | 21.631579 | 74 | 0.584753 |
d19a203fceb42b692a47d350ddac6b133dc1c64b | 1,352 | py | Python | doc/keywords.py | r-owen/twistedActor | 949097deaac875b4774f75dde95b36b61967b939 | [
"BSD-3-Clause"
] | null | null | null | doc/keywords.py | r-owen/twistedActor | 949097deaac875b4774f75dde95b36b61967b939 | [
"BSD-3-Clause"
] | null | null | null | doc/keywords.py | r-owen/twistedActor | 949097deaac875b4774f75dde95b36b61967b939 | [
"BSD-3-Clause"
] | 1 | 2020-05-21T21:34:27.000Z | 2020-05-21T21:34:27.000Z | # These are the standard keywords output by twistedActor
# Add them to any actor dictionary based on twistedActor
Key("text",
String(),
help = "Text message",
),
Key("yourUserID",
Int(),
help = "Your user ID number; use this to recognize replies triggered by your commands; ne... | 31.44186 | 105 | 0.565089 |
11eaf0fed31d22bb1f394dcff983127cb4f18c92 | 3,694 | py | Python | old_agents/agentv6.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | old_agents/agentv6.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | old_agents/agentv6.py | tomarbeiter/yahtzee-rl | 51b09ca059740e798061fdeb31cda2b56255ca07 | [
"Apache-2.0"
] | null | null | null | """V6 of the agent.
Major upgrades: Another overhaul of the action and state spaces. New reward function.
"""
import random
from matplotlib import pyplot as plt
from util import make_action_space, make_state_space
class AgentV6:
def __init__(self, eps, gma, alp):
# Pregenerated list of possible dice coun... | 43.458824 | 125 | 0.585544 |
77f1dd0768015a662a646fd85eaa116c4fee42bd | 405 | py | Python | py23/algorithms/binary_search.py | xiaopeng163/python-2-3-compatible-demo | 18718b4b03adbdae80e1f798ed9d0f3d9b46ab03 | [
"Apache-2.0"
] | 1 | 2018-07-31T09:37:05.000Z | 2018-07-31T09:37:05.000Z | py23/algorithms/binary_search.py | xiaopeng163/python-2-3-compatible-demo | 18718b4b03adbdae80e1f798ed9d0f3d9b46ab03 | [
"Apache-2.0"
] | null | null | null | py23/algorithms/binary_search.py | xiaopeng163/python-2-3-compatible-demo | 18718b4b03adbdae80e1f798ed9d0f3d9b46ab03 | [
"Apache-2.0"
] | null | null | null | """
binary search
"""
def binary_search(l, n, t):
"""
:param l: list of sorted integer
:param n: the length of the list l
:param t: the target number want to find
"""
i = 0
r = n - 1
while i <= r:
mid = (r + i) / 2
if l[mid] == t:
return mid
elif l[m... | 17.608696 | 44 | 0.434568 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.