hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
796ed9a55de032a32f99765f3587d350aa1d0d01 | 3,828 | py | Python | draw_card/fgo_handle.py | HibiKier/nonebot_plugin_gamedraw | 0dfb8e6a5491eb2df8923119142fe3c35d50e68a | [
"MIT"
] | 90 | 2021-05-18T02:24:56.000Z | 2022-03-30T12:29:01.000Z | draw_card/fgo_handle.py | yuan488/nonebot_plugin_gamedraw | 6d6fda5e8051026027b9eec2550e12184dc53674 | [
"MIT"
] | 30 | 2021-05-17T09:05:24.000Z | 2022-03-28T07:27:52.000Z | draw_card/fgo_handle.py | yuan488/nonebot_plugin_gamedraw | 6d6fda5e8051026027b9eec2550e12184dc53674 | [
"MIT"
] | 15 | 2021-05-24T05:28:15.000Z | 2022-03-17T11:23:19.000Z |
from nonebot.adapters.cqhttp import MessageSegment
import random
from .update_game_requests_info import update_requests_info
from .util import generate_img, init_star_rst, BaseData, set_list, get_star, max_card
from .config import FGO_CARD_FOUR_P, FGO_CARD_FIVE_P, FGO_CARD_THREE_P, FGO_SERVANT_THREE_P, \
FGO... | 33.876106 | 106 | 0.602665 |
796ed9ce557d0f1789035f1f9869b9bea0c03a2b | 2,624 | py | Python | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageCapacityUnitAttributeRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | 1 | 2020-12-05T03:03:46.000Z | 2020-12-05T03:03:46.000Z | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageCapacityUnitAttributeRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/ModifyStorageCapacityUnitAttributeRequest.py | hetw/aliyun-openapi-python-sdk | 7443eacee9fbbaa93c7975c6dbec92d3c364c577 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 35.459459 | 87 | 0.77782 |
796eda1e3d2a875b2f448252c3b9a867753da8c6 | 553 | py | Python | tests/conftest.py | agallant/fastapi_login | dc1a9581f3c4c5d07f04c3e9e939ce110f617770 | [
"MIT"
] | null | null | null | tests/conftest.py | agallant/fastapi_login | dc1a9581f3c4c5d07f04c3e9e939ce110f617770 | [
"MIT"
] | null | null | null | tests/conftest.py | agallant/fastapi_login | dc1a9581f3c4c5d07f04c3e9e939ce110f617770 | [
"MIT"
] | null | null | null | from asyncio import get_event_loop
import pytest
from async_asgi_testclient import TestClient
from tests.app import app, manager
@pytest.fixture(scope='session')
def client() -> TestClient:
return TestClient(app)
@pytest.fixture()
def default_data() -> dict:
return {'sub': 'john@doe.com'}
@pytest.fixture(... | 19.068966 | 44 | 0.719711 |
796eda985a3ada713c8515e3900adc7fbab9e07c | 81 | py | Python | api/config.py | seanbenhur/tanglish_offensive_language_identification | 41060a78735793d17db0dca715f54a2eb276fd0a | [
"MIT"
] | null | null | null | api/config.py | seanbenhur/tanglish_offensive_language_identification | 41060a78735793d17db0dca715f54a2eb276fd0a | [
"MIT"
] | null | null | null | api/config.py | seanbenhur/tanglish_offensive_language_identification | 41060a78735793d17db0dca715f54a2eb276fd0a | [
"MIT"
] | 1 | 2022-01-22T14:51:29.000Z | 2022-01-22T14:51:29.000Z | max_len = 128
path = "transformer.ckpt"
tokenizer_name = "distilbert-base-cased"
| 20.25 | 40 | 0.765432 |
796edad306eb24b293761982e4a9276fb37bdebd | 7,497 | py | Python | lib/ruxcryptod.py | Toni-d-e-v/cuvar-sentinel | 2355e8d1d9606a4a84932b6337ed0a5f84efadc0 | [
"MIT"
] | null | null | null | lib/ruxcryptod.py | Toni-d-e-v/cuvar-sentinel | 2355e8d1d9606a4a84932b6337ed0a5f84efadc0 | [
"MIT"
] | null | null | null | lib/ruxcryptod.py | Toni-d-e-v/cuvar-sentinel | 2355e8d1d9606a4a84932b6337ed0a5f84efadc0 | [
"MIT"
] | null | null | null | """
dashd JSONRPC interface
"""
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
import config
import base58
from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from masternode import Masternode
from... | 34.869767 | 87 | 0.657063 |
796edb10ac8004badb5f3d755db36a34b33ce251 | 11,065 | py | Python | tsfresh/feature_extraction/settings.py | anurag-gandhi/tsfresh | 8ceb1f16e9a7069c114b28d0491c059f62462056 | [
"MIT"
] | 1 | 2020-05-22T04:33:14.000Z | 2020-05-22T04:33:14.000Z | tsfresh/feature_extraction/settings.py | enzoampil/tsfresh | d190be5c1242ca8e68de9c1a5ae6082eb57ccdab | [
"MIT"
] | 1 | 2020-08-28T20:47:55.000Z | 2020-09-10T22:24:09.000Z | tsfresh/feature_extraction/settings.py | enzoampil/tsfresh | d190be5c1242ca8e68de9c1a5ae6082eb57ccdab | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file as well as the whole tsfresh package are licenced under the MIT licence (see the LICENCE.txt)
# Maximilian Christ (maximilianchrist.com), Blue Yonder Gmbh, 2016
"""
This file contains methods/objects for controlling which features will be extracted when calling extract_features.
For ... | 46.104167 | 116 | 0.62648 |
796edba758c32b91f77546bcc82063182fcd2d0f | 13,012 | py | Python | tensorflow_model_optimization/python/core/clustering/keras/clustering_registry.py | moneypi/model-optimization | 1408a1ae328304f3b5d238c41479382efb015869 | [
"Apache-2.0"
] | null | null | null | tensorflow_model_optimization/python/core/clustering/keras/clustering_registry.py | moneypi/model-optimization | 1408a1ae328304f3b5d238c41479382efb015869 | [
"Apache-2.0"
] | null | null | null | tensorflow_model_optimization/python/core/clustering/keras/clustering_registry.py | moneypi/model-optimization | 1408a1ae328304f3b5d238c41479382efb015869 | [
"Apache-2.0"
] | null | null | null | # 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... | 36.245125 | 91 | 0.679834 |
796edd3362b5604ed3c05a2ffbf2d717a17955e4 | 9,100 | py | Python | models/official/efficientnet/efficientnet_builder.py | artyompal/tpu_models | 639306f30e085bb1cdb5b1118a4c96a2dbe14e3e | [
"Apache-2.0"
] | 53 | 2019-10-02T22:00:54.000Z | 2021-11-16T13:50:02.000Z | models/official/efficientnet/efficientnet_builder.py | artyompal/tpu_models | 639306f30e085bb1cdb5b1118a4c96a2dbe14e3e | [
"Apache-2.0"
] | null | null | null | models/official/efficientnet/efficientnet_builder.py | artyompal/tpu_models | 639306f30e085bb1cdb5b1118a4c96a2dbe14e3e | [
"Apache-2.0"
] | 7 | 2019-10-02T14:24:37.000Z | 2020-05-06T08:19:59.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... | 36.111111 | 80 | 0.687033 |
796edf04f0687598ccb23aa56675d8017c279dc0 | 28,696 | py | Python | tests/integration/test_postgresql_replica_database_engine_2/test.py | mrk-andreev/ClickHouse | a36f05d6b892aa714c02661c87e2c28f2239020d | [
"Apache-2.0"
] | 8,629 | 2016-06-14T21:03:01.000Z | 2019-09-23T07:46:38.000Z | tests/integration/test_postgresql_replica_database_engine_2/test.py | mrk-andreev/ClickHouse | a36f05d6b892aa714c02661c87e2c28f2239020d | [
"Apache-2.0"
] | 4,335 | 2016-06-15T12:58:31.000Z | 2019-09-23T11:18:43.000Z | tests/integration/test_postgresql_replica_database_engine_2/test.py | Vector-Similarity-Search-for-ClickHouse/ClickHouse | 996d838ca33f1156a1c6d0868140bab23f8b6155 | [
"Apache-2.0"
] | 1,700 | 2016-06-15T09:25:11.000Z | 2019-09-23T11:16:38.000Z | import pytest
import time
import psycopg2
import os.path as p
import random
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from helpers.test_tools import TSV
from random import randrange
import threading
fro... | 38.98913 | 264 | 0.721494 |
796edf4e4ac26a26cd13fb07f9f9e880916f07d5 | 566 | py | Python | mmdnn/conversion/caffe/saver.py | Gwinhen/MMdnn | 6d2e83002a37acd8a31b1a2d497e3554606db00c | [
"MIT"
] | 1 | 2021-05-12T21:45:25.000Z | 2021-05-12T21:45:25.000Z | mmdnn/conversion/caffe/saver.py | Gwinhen/MMdnn | 6d2e83002a37acd8a31b1a2d497e3554606db00c | [
"MIT"
] | null | null | null | mmdnn/conversion/caffe/saver.py | Gwinhen/MMdnn | 6d2e83002a37acd8a31b1a2d497e3554606db00c | [
"MIT"
] | 1 | 2018-12-18T11:44:17.000Z | 2018-12-18T11:44:17.000Z | import caffe
def save_model(MainModel, network_filepath, weight_filepath, dump_filepath):
dump_net = dump_filepath + '.prototxt'
dump_weight = dump_filepath + '.caffemodel'
dump_net = str(dump_net)
dump_weight = str(dump_weight)
MainModel.make_net(dump_net)
MainModel.gen_weight(weight_filepath... | 40.428571 | 96 | 0.720848 |
796edf503e48a13c38ac2373f123b85ab67816ec | 1,663 | py | Python | api/api/endpoints/auth.py | andschneider/ss_api | 4ddf5cd60d5e0e87e7641e97c9fbe78965c4b522 | [
"MIT"
] | null | null | null | api/api/endpoints/auth.py | andschneider/ss_api | 4ddf5cd60d5e0e87e7641e97c9fbe78965c4b522 | [
"MIT"
] | 2 | 2019-12-26T17:31:56.000Z | 2020-01-06T19:45:05.000Z | api/api/endpoints/auth.py | andschneider/soil_sense | 4ddf5cd60d5e0e87e7641e97c9fbe78965c4b522 | [
"MIT"
] | null | null | null | import json
from flask import Blueprint, Response
from flask_jwt_extended import create_access_token
from flask_restplus import reqparse, Api, Namespace, Resource
from api import bcrypt
from api.core.db_execptions import bad_db_response
from api.core.models import UserModel
api = Namespace("auth", description="Auth... | 32.607843 | 84 | 0.595911 |
796edf554d65beb435ab6ea711f5a0f554f07a7e | 1,542 | py | Python | scripts/consistency/ensure_piwik_nodes.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | scripts/consistency/ensure_piwik_nodes.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | 13 | 2020-03-24T15:29:41.000Z | 2022-03-11T23:15:28.000Z | scripts/consistency/ensure_piwik_nodes.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Ensure all projects modified today are consistent between the OSF and Piwik
"""
import datetime
import logging
import sys
import time
from modularodm import Q
from framework.analytics import piwik
from scripts import utils as scripts_utils
from website.app import init... | 24.47619 | 78 | 0.612192 |
796ee0011119e51b071ce99b26561120dce46f16 | 46 | py | Python | tools/github/release/exceptions.py | gy95/envoy | db74e313b3651588e59c671af45077714ac32cef | [
"Apache-2.0"
] | 3 | 2021-08-19T18:42:11.000Z | 2022-02-20T10:31:30.000Z | tools/github/release/exceptions.py | gy95/envoy | db74e313b3651588e59c671af45077714ac32cef | [
"Apache-2.0"
] | 281 | 2021-06-02T20:02:12.000Z | 2022-03-28T04:27:14.000Z | tools/github/release/exceptions.py | lavignes/envoy | 365acdbe02ed7bfd2f8fdc616d057b430da2621e | [
"Apache-2.0"
] | 2 | 2019-10-17T01:25:13.000Z | 2021-09-13T16:25:11.000Z | class GithubReleaseError(Exception):
pass
| 15.333333 | 36 | 0.782609 |
796ee053723693c584a1feec34c70570822dbc8d | 3,484 | py | Python | bin/spm/spm_blowout_sim.py | ChrisBarker-NOAA/tamoc | c797cbb6fee28d788b76d21cc5b0cc0df5444ba8 | [
"MIT"
] | 18 | 2016-02-24T01:48:41.000Z | 2021-11-05T03:18:24.000Z | bin/spm/spm_blowout_sim.py | ChrisBarker-NOAA/tamoc | c797cbb6fee28d788b76d21cc5b0cc0df5444ba8 | [
"MIT"
] | 16 | 2016-08-09T07:06:35.000Z | 2021-12-23T19:38:37.000Z | bin/spm/spm_blowout_sim.py | ChrisBarker-NOAA/tamoc | c797cbb6fee28d788b76d21cc5b0cc0df5444ba8 | [
"MIT"
] | 9 | 2017-03-01T01:22:27.000Z | 2021-09-17T12:13:40.000Z | """
Stratified Plume Model: Blowout simulation
===========================================
Use the ``TAMOC`` `stratified_plume_model` to simulate a subsea accidental
oil spill plume. This script demonstrates the typical steps involved in
running the single bubble model with petroleum fluids in the ocean.
This simu... | 36.673684 | 78 | 0.6438 |
796ee0ee047682eb25ef49635d7cc5c7f1835580 | 8,300 | py | Python | test/lib/testMayaUsdConverter.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 507 | 2019-07-30T20:05:10.000Z | 2022-03-30T07:38:43.000Z | test/lib/testMayaUsdConverter.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 1,188 | 2019-07-31T11:27:27.000Z | 2022-03-31T21:06:06.000Z | test/lib/testMayaUsdConverter.py | ika-rporter/maya-usd | 8f216a4fb955fc44c0abda55caa53ed295aaa625 | [
"Apache-2.0"
] | 165 | 2019-07-30T22:27:57.000Z | 2022-03-25T07:20:23.000Z | #!/usr/bin/env python
#
# Copyright 2020 Autodesk
#
# 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 ... | 36.403509 | 108 | 0.626506 |
796ee107182e0171329201fa7d98fff017c2eb92 | 12,546 | py | Python | imsegm/utils/experiments.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | null | null | null | imsegm/utils/experiments.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | null | null | null | imsegm/utils/experiments.py | alexlib/pyImSegm | eb75b48066047a9201ba45ad85f816995b35eef4 | [
"BSD-3-Clause"
] | 1 | 2019-04-07T09:35:23.000Z | 2019-04-07T09:35:23.000Z | """
Framework for general experiments
Copyright (C) 2014-2018 Jiri Borovec <jiri.borovec@fel.cvut.cz>
"""
import os
import json
import copy
import time
import types
import logging
import traceback
import multiprocessing as mproc
# from functools import partial
import tqdm
import numpy as np
# import pandas as pd
fro... | 32.587013 | 82 | 0.589989 |
796ee17f51f7d43ababfe446cd1ba10d8a37f149 | 573 | py | Python | setup.py | edc1591/bondpy | f8dafe34f96622e0522d49a1681f1c7a6d27d228 | [
"MIT"
] | null | null | null | setup.py | edc1591/bondpy | f8dafe34f96622e0522d49a1681f1c7a6d27d228 | [
"MIT"
] | null | null | null | setup.py | edc1591/bondpy | f8dafe34f96622e0522d49a1681f1c7a6d27d228 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bondpy",
version="0.1.6",
author="Evan Coleman",
author_email="oss@edc.me",
description="A Python library for the BOND API with Python 3+",
long_description=long_description,
long_... | 26.045455 | 67 | 0.657941 |
796ee21cba96f0b7284a4e756e059b0f88eb45f6 | 564 | py | Python | tests/test_delete_project.py | gerberolya/python_training_mantis | e67a52dfcf0fe373480d8c1c71460364ac08d5b4 | [
"Apache-2.0"
] | null | null | null | tests/test_delete_project.py | gerberolya/python_training_mantis | e67a52dfcf0fe373480d8c1c71460364ac08d5b4 | [
"Apache-2.0"
] | null | null | null | tests/test_delete_project.py | gerberolya/python_training_mantis | e67a52dfcf0fe373480d8c1c71460364ac08d5b4 | [
"Apache-2.0"
] | null | null | null | from model.project import Project
from data.projects import testdata
import pytest
from random import randrange
#@pytest.mark.parametrize("project", testdata, ids=[repr(x) for x in testdata])
def test_delete_project(app):
if app.project.count_projects() == 0:
app.project.create(Project(name="to_delete"))
... | 35.25 | 79 | 0.751773 |
796ee3985122bce5f0bfe4dadc92b84a39f23b71 | 8,364 | py | Python | scripts/pineapple/pydwarf.cavegrass.py | Charcoal-Apple/PyDwarf | 6f2dd294509c83802e06b9ca5e084f89c9fe4bda | [
"Zlib"
] | 49 | 2015-05-21T19:40:41.000Z | 2021-09-30T03:04:32.000Z | scripts/pineapple/pydwarf.cavegrass.py | Charcoal-Apple/PyDwarf | 6f2dd294509c83802e06b9ca5e084f89c9fe4bda | [
"Zlib"
] | 6 | 2015-05-30T01:50:01.000Z | 2021-09-22T14:22:41.000Z | scripts/pineapple/pydwarf.cavegrass.py | Charcoal-Apple/PyDwarf | 6f2dd294509c83802e06b9ca5e084f89c9fe4bda | [
"Zlib"
] | 13 | 2015-05-23T16:26:31.000Z | 2021-09-05T18:46:36.000Z | import pydwarf
import raws
default_grasses = {
'FLOOR FUNGI': {
# Arguments for GRASS_COLORS token
'colors': raws.color.yellow() + raws.color.brown() + raws.color.lgray() + raws.color.dgray(),
# Arguments for UNDERGROUND_DEPTH
'depth': (1, 1)
},
'PALE FERN PINEAPPLE': {
... | 41.20197 | 135 | 0.571497 |
796ee3d633fbe4f57d938787608f8bc96010456f | 105,805 | py | Python | electrum_mona/lnworker.py | wakiyamap/electrum-mona | d00830c96785c77025432669158ad903146a2298 | [
"MIT"
] | 61 | 2017-08-06T08:51:49.000Z | 2021-12-28T06:25:36.000Z | electrum_mona/lnworker.py | wakiyamap/electrum-mona | d00830c96785c77025432669158ad903146a2298 | [
"MIT"
] | 15 | 2017-09-12T07:15:01.000Z | 2021-12-28T06:25:15.000Z | electrum_mona/lnworker.py | wakiyamap/electrum-mona | d00830c96785c77025432669158ad903146a2298 | [
"MIT"
] | 27 | 2017-08-18T19:40:30.000Z | 2021-03-01T11:16:02.000Z | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import asyncio
import os
from decimal import Decimal
import random
import time
from typing import (Optional, Sequence, Tuple, List, Set, D... | 47.446188 | 174 | 0.622627 |
796ee57d5aeb84e81fe8dc769facc8339798cc3e | 8,168 | py | Python | basicsr/models/video_recurrent_model.py | Cospel/BasicSR | 430dd1989f75b1400d77df97808b2c7896808a43 | [
"Apache-2.0",
"MIT"
] | 3,168 | 2018-04-26T16:11:32.000Z | 2022-03-31T09:37:39.000Z | basicsr/models/video_recurrent_model.py | Cospel/BasicSR | 430dd1989f75b1400d77df97808b2c7896808a43 | [
"Apache-2.0",
"MIT"
] | 437 | 2018-06-14T02:05:58.000Z | 2022-03-28T02:37:15.000Z | basicsr/models/video_recurrent_model.py | Cospel/BasicSR | 430dd1989f75b1400d77df97808b2c7896808a43 | [
"Apache-2.0",
"MIT"
] | 837 | 2018-06-05T06:52:47.000Z | 2022-03-31T09:58:20.000Z | import torch
from collections import Counter
from os import path as osp
from torch import distributed as dist
from tqdm import tqdm
from basicsr.metrics import calculate_metric
from basicsr.utils import get_root_logger, imwrite, tensor2img
from basicsr.utils.dist_util import get_dist_info
from basicsr.utils.registry i... | 41.252525 | 111 | 0.530607 |
796ee59652ead802c01570021ce72f40d2a6f29b | 4,089 | py | Python | laa_court_data_api_app/routers/hearing_summaries.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | 1 | 2022-01-27T14:28:40.000Z | 2022-01-27T14:28:40.000Z | laa_court_data_api_app/routers/hearing_summaries.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | 16 | 2022-01-28T11:01:27.000Z | 2022-03-30T14:01:11.000Z | laa_court_data_api_app/routers/hearing_summaries.py | ministryofjustice/laa-court-data-api | 2e79faac7469f0b31ecca0539906d281db08f86c | [
"MIT"
] | null | null | null | import structlog
from fastapi import APIRouter
from fastapi.responses import Response
import laa_court_data_api_app.constants.endpoint_constants as endpoints
from laa_court_data_api_app.internal.court_data_adaptor_client import CourtDataAdaptorClient
from laa_court_data_api_app.models.hearing_summaries.defendants imp... | 48.678571 | 116 | 0.746148 |
796ee697479cae71c64d7ef8619c588477aba1fa | 20,820 | py | Python | lib/mixminion/directory/ServerList.py | rxcomm/mixminion | 363a5f7d4e3205b396c8fcef63bda0d39a206596 | [
"MIT"
] | 2 | 2015-11-30T11:23:38.000Z | 2016-02-11T19:05:48.000Z | lib/mixminion/directory/ServerList.py | rxcomm/mixminion | 363a5f7d4e3205b396c8fcef63bda0d39a206596 | [
"MIT"
] | 1 | 2015-10-24T13:20:54.000Z | 2015-10-24T13:20:54.000Z | lib/mixminion/directory/ServerList.py | rxcomm/mixminion | 363a5f7d4e3205b396c8fcef63bda0d39a206596 | [
"MIT"
] | 2 | 2015-10-02T10:45:47.000Z | 2020-06-08T12:45:19.000Z | # Copyright 2002-2011 Nick Mathewson. See LICENSE for licensing information.
"""mixminion.directory.ServerList
Implements a store of serverinfos for a directory, as well as functions
to generate and sign directories.
FFFF Right now, this is about maximally slow. There are a lot of tricks
FFFF we could ... | 40.74364 | 79 | 0.56316 |
796ee6de46b004f16b0adc85799532af11555895 | 7,731 | py | Python | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | DDPG & TD3/main.py | baturaysaglam/AC-Off-POC | 0bf1b450190f0f16fd42423e303b0e558fd51015 | [
"MIT"
] | null | null | null | import argparse
import os
import socket
import gym
import numpy as np
import torch
import DDPG
import AC_Off_POC_DDPG
import TD3
import AC_Off_POC_TD3
import utils
# Runs policy for X episodes and returns average reward
# A fixed seed is used for the eval environment
def evaluate_policy(agent, env_name, seed, eval_... | 41.789189 | 130 | 0.611952 |
796ee7cf2d338062d254ed8e2a03d2d99e124fb0 | 41 | py | Python | zutils/py_utils.py | YutingZhang/zcode | 79f4a990298ccf21b5de569821a84a8553220d3f | [
"Apache-2.0"
] | null | null | null | zutils/py_utils.py | YutingZhang/zcode | 79f4a990298ccf21b5de569821a84a8553220d3f | [
"Apache-2.0"
] | null | null | null | zutils/py_utils.py | YutingZhang/zcode | 79f4a990298ccf21b5de569821a84a8553220d3f | [
"Apache-2.0"
] | null | null | null | from z_python_utils import *
_ = mkdir_p
| 13.666667 | 28 | 0.780488 |
796ee8352c87c9d5378a3e96efe8dea1bcde8f51 | 20,902 | py | Python | tests/test_cli_iscsi_config_create.py | guidotijskens/oci-utils | 77c75e940f3a9875c97b76f5d740cc65b664efb5 | [
"UPL-1.0"
] | 35 | 2019-04-21T00:58:30.000Z | 2022-01-28T15:22:41.000Z | tests/test_cli_iscsi_config_create.py | guidotijskens/oci-utils | 77c75e940f3a9875c97b76f5d740cc65b664efb5 | [
"UPL-1.0"
] | 43 | 2019-05-19T20:13:41.000Z | 2022-03-31T17:39:25.000Z | tests/test_cli_iscsi_config_create.py | guidotijskens/oci-utils | 77c75e940f3a9875c97b76f5d740cc65b664efb5 | [
"UPL-1.0"
] | 23 | 2019-04-10T12:48:00.000Z | 2022-03-25T16:57:47.000Z | # Copyright (c) 2018, 2021 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown
# at http://oss.oracle.com/licenses/upl.
import os
import re
import subprocess
import time
import unittest
import uuid
from tools.oci_test_case import OciTestCase
from tools.de... | 39.21576 | 157 | 0.53105 |
796ee8645c540fe07cc1aeac627e7e6c85ce0ed2 | 244 | py | Python | tests/urls.py | slapec/bangoo | 34facf122f15943a4368d5c2f45fe178ff01edaa | [
"MIT"
] | null | null | null | tests/urls.py | slapec/bangoo | 34facf122f15943a4368d5c2f45fe178ff01edaa | [
"MIT"
] | null | null | null | tests/urls.py | slapec/bangoo | 34facf122f15943a4368d5c2f45fe178ff01edaa | [
"MIT"
] | null | null | null | from django.conf.urls import url, patterns, include
from bangoo.media import views
urlpatterns = patterns('',
url(r'^admin/', include('bangoo.admin.urls', namespace='admin')),
url('images/$', views.images_home, name='images-list'),
)
| 27.111111 | 69 | 0.70082 |
796ee8748164214a855af64229f0e9ff750aa7f5 | 1,133 | py | Python | app/utility/logger.py | xxproto/caldera | e2118b4c8c3326cff4357888c5f2613ad7bfce2f | [
"Apache-2.0"
] | null | null | null | app/utility/logger.py | xxproto/caldera | e2118b4c8c3326cff4357888c5f2613ad7bfce2f | [
"Apache-2.0"
] | null | null | null | app/utility/logger.py | xxproto/caldera | e2118b4c8c3326cff4357888c5f2613ad7bfce2f | [
"Apache-2.0"
] | null | null | null | import logging
class Logger:
"""
Custom logger. By default, all logs will be:
1) logged to console
2) To a file in the .logs directory
3) (optionally) sent to a 3rd party like Logstash
EXAMPLE: To direct logs to Logstash: replace the handler with:
import logstash
s... | 29.815789 | 78 | 0.634598 |
796ee8a9ad747242418a081029aaeaef1125548d | 1,635 | py | Python | django/contrib/sites/management.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/sites/management.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/contrib/sites/management.py | Yoann-Vie/esgi-hearthstone | 115d03426c7e8e80d89883b78ac72114c29bed12 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | """
Creates the default Site object.
"""
from django.apps import apps as global_apps
from django.conf import settings
from django.core.management.color import no_style
from django.db import DEFAULT_DB_ALIAS, connections, router
def create_default_site(app_config, verbosity=2, interactive=True, using=DEFAUL... | 41.923077 | 120 | 0.647095 |
796ee9ccd67b228d6cfa3f87b0118c14e9a197c2 | 439 | py | Python | test/test_harness.py | Ham22/python-as1130-clock | a97fbdf3d0fe5a9cafa7392458c44782f688daa7 | [
"Apache-2.0"
] | null | null | null | test/test_harness.py | Ham22/python-as1130-clock | a97fbdf3d0fe5a9cafa7392458c44782f688daa7 | [
"Apache-2.0"
] | null | null | null | test/test_harness.py | Ham22/python-as1130-clock | a97fbdf3d0fe5a9cafa7392458c44782f688daa7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import unittest
import time
from as1130_led_grid import AS1130LedGrid
from clock import Clock
class TestHarness(unittest.TestCase):
def test_run(self):
self.clock = Clock(AS1130LedGrid(0, 0x30), animations_on=False)
for i in range(24):
for j in range(60):
... | 19.086957 | 71 | 0.640091 |
796eea24bfbef18b1c53041bde958d757a6a1b3b | 5,956 | py | Python | tensorflow/lite/python/lite_v2_test_util.py | kalosisz/tensorflow | b7ecd75b24f577b73500024fe91d2ea0c806d05a | [
"Apache-2.0"
] | 3 | 2021-08-21T13:38:47.000Z | 2021-08-24T12:22:49.000Z | tensorflow/lite/python/lite_v2_test_util.py | kalosisz/tensorflow | b7ecd75b24f577b73500024fe91d2ea0c806d05a | [
"Apache-2.0"
] | 17 | 2021-08-12T19:38:42.000Z | 2022-01-27T14:39:35.000Z | tensorflow/lite/python/lite_v2_test_util.py | kalosisz/tensorflow | b7ecd75b24f577b73500024fe91d2ea0c806d05a | [
"Apache-2.0"
] | 2 | 2018-05-31T19:43:16.000Z | 2018-11-22T09:20:53.000Z | # Lint as: python2, python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | 33.840909 | 80 | 0.685863 |
796eea8a0637c38c81c52cb8d611e10d7acd7aba | 2,864 | py | Python | pointnet/data_loader.py | ZzzzzZXxxX/flask-pointnet | 184fde06ebc7ebf08211a997645d3c34db5ebad9 | [
"MIT"
] | 1 | 2021-04-06T08:19:26.000Z | 2021-04-06T08:19:26.000Z | pointnet/data_loader.py | ZzzzzZXxxX/flask-pointnet | 184fde06ebc7ebf08211a997645d3c34db5ebad9 | [
"MIT"
] | 3 | 2020-09-26T01:07:55.000Z | 2022-02-10T02:00:53.000Z | pointnet/data_loader.py | ZzzzzZXxxX/flask-pointnet | 184fde06ebc7ebf08211a997645d3c34db5ebad9 | [
"MIT"
] | 1 | 2021-04-06T08:19:29.000Z | 2021-04-06T08:19:29.000Z | """
Data generator for ModelNet40
reference: https://github.com/garyli1019/pointnet-keras
Date: 08/13/2018
Author: Tianzhong
"""
import numpy as np
import h5py
import random
from keras.utils import np_utils
class DataGenerator:
def __init__(self, file_name, batch_size, nb_classes=40, train=True):
... | 36.717949 | 80 | 0.513617 |
796eea960de9211a6c0ae7f898c0b3daf3745919 | 1,164 | py | Python | graphgallery/nn/metrics/pytorch/accuracy.py | kisekizzz/GraphGallery | fd4a1f474c244f774397460ae95935638ef48f5b | [
"MIT"
] | null | null | null | graphgallery/nn/metrics/pytorch/accuracy.py | kisekizzz/GraphGallery | fd4a1f474c244f774397460ae95935638ef48f5b | [
"MIT"
] | null | null | null | graphgallery/nn/metrics/pytorch/accuracy.py | kisekizzz/GraphGallery | fd4a1f474c244f774397460ae95935638ef48f5b | [
"MIT"
] | null | null | null | import torch
from torch import nn
from .metric import Metric
class Accuracy(Metric):
def __init__(self, name="accuracy", dtype=None,
reduction="sum", **kwargs):
super().__init__(name, dtype, **kwargs)
assert reduction in {"sum", "mean", "max", "min"}
# TODO: mo... | 32.333333 | 62 | 0.571306 |
796eeb312a8b61e44252be35c981bd7a72e3c0f7 | 81 | py | Python | book/admin.py | jamesbond007dj/django-crud-stretch | 8f7afa1f48fc88718c73d3278d8b56ffc263c1ad | [
"MIT"
] | 1 | 2020-01-22T21:46:35.000Z | 2020-01-22T21:46:35.000Z | book/admin.py | jamesbond007dj/django-crud-stretch | 8f7afa1f48fc88718c73d3278d8b56ffc263c1ad | [
"MIT"
] | 5 | 2021-03-18T22:51:34.000Z | 2021-09-22T18:35:28.000Z | book/admin.py | jamesbond007dj/django-crud-stretch | 8f7afa1f48fc88718c73d3278d8b56ffc263c1ad | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Bk
admin.site.register(Bk)
| 16.2 | 32 | 0.802469 |
796eeb8445fff266c59f32f9494f140a835705c7 | 7,197 | py | Python | project_settings/settings/base.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | null | null | null | project_settings/settings/base.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | 1 | 2015-01-12T05:54:20.000Z | 2015-01-12T05:55:23.000Z | project_settings/settings/base.py | qsic/qsic3 | b45dfcc76c80001b0c35c6a887a0cfcdf8d1c1e2 | [
"BSD-3-Clause"
] | null | null | null | # Django settings for qsic3 project.
import os
import dj_database_url
from easy_thumbnails.conf import Settings as thumbnail_settings
def get_env_var(env_var, default=None, isbool=False):
"""
Return value of envirnoment variable or throw exception
"""
from django.core.exceptions import ImproperlyConf... | 31.155844 | 111 | 0.700431 |
796eeca2dbaabf95ec69fc5b2cd6bce1c80d5f87 | 1,123 | py | Python | premieres/premieres/main.py | entering/crawl-airdates | cfb4e302da2c482b9c64fb1078dedae99e573e98 | [
"MIT"
] | null | null | null | premieres/premieres/main.py | entering/crawl-airdates | cfb4e302da2c482b9c64fb1078dedae99e573e98 | [
"MIT"
] | null | null | null | premieres/premieres/main.py | entering/crawl-airdates | cfb4e302da2c482b9c64fb1078dedae99e573e98 | [
"MIT"
] | null | null | null | import typer
import requests
from bs4 import BeautifulSoup
airdates_baseurl = 'https://www.airdates.tv/'
app = typer.Typer()
def get_page(url: str) -> requests.Response:
page = requests.get(url)
if not page.ok:
raise Exception("Error, unable to fetch " + url + " status code " + str(page.status_code))
... | 26.738095 | 96 | 0.689225 |
796eeca788922a7c41b7af3a96b5c3c34d34afc8 | 754 | py | Python | Python/Ex089v2.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | Python/Ex089v2.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | Python/Ex089v2.py | EspagueteTV/Meus-Estudos-CursoEmVideo | 1bf3cc367bc754625a3fd59114ab63470e8d934b | [
"MIT"
] | null | null | null | ficha = list()
while True:
nome = str(input('Nome: '))
nota1 = float(input('Nota 01: '))
nota2 = float(input('Nota 02: '))
media = (nota1 + nota2) / 2
ficha.append([nome, nota1, nota2, media])
resp = str(input('Quer continuar? (S/N) '))
if resp in 'Nn':
break
print('-=' * 30)
print(... | 30.16 | 77 | 0.533156 |
796eed2fc2a0955733c921161db406985de4afa8 | 14,067 | py | Python | keepercommander/commands/msp.py | sndrr/Commander | 355eb7c0de44a0e7025d50ee5a944ed978eb92b2 | [
"MIT"
] | null | null | null | keepercommander/commands/msp.py | sndrr/Commander | 355eb7c0de44a0e7025d50ee5a944ed978eb92b2 | [
"MIT"
] | null | null | null | keepercommander/commands/msp.py | sndrr/Commander | 355eb7c0de44a0e7025d50ee5a944ed978eb92b2 | [
"MIT"
] | null | null | null | # _ __
# | |/ /___ ___ _ __ ___ _ _ ®
# | ' </ -_) -_) '_ \/ -_) '_|
# |_|\_\___\___| .__/\___|_|
# |_|
#
# Keeper Commander
# Copyright 2020 Keeper Security Inc.
# Contact: ops@keepersecurity.com
#
import argparse
import os
import string
from datetime import datetime, timedelta
import calendar
from .b... | 39.625352 | 287 | 0.608232 |
796eedc602b0156afa079b504799b0d3775c25d9 | 726 | py | Python | PyQT/main.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | PyQT/main.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | PyQT/main.py | DjCod3r/PythonScripts | 95e70ebb81d2bc37b0283daff8ee723c5d2a382c | [
"MIT"
] | null | null | null | import sys
from PyQt5.QtWidgets import QMainWindow, QApplication, QPushButton, QWidget
from PyQt5.QtWidgets import QGridLayout
class App(QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
self.cw = QWidget()
self.grid = QGridLayout(self.cw)
self.btn = Q... | 26.888889 | 80 | 0.628099 |
796eee0bf176c61eece7ff6da41f871e5c7c9724 | 23,583 | py | Python | electrum/exchange_rate.py | c4pt000/electrum-radiocoin | 7cb5f618a9aa8cd03d60191624a0e57cc24646d2 | [
"MIT"
] | null | null | null | electrum/exchange_rate.py | c4pt000/electrum-radiocoin | 7cb5f618a9aa8cd03d60191624a0e57cc24646d2 | [
"MIT"
] | null | null | null | electrum/exchange_rate.py | c4pt000/electrum-radiocoin | 7cb5f618a9aa8cd03d60191624a0e57cc24646d2 | [
"MIT"
] | null | null | null | import asyncio
from datetime import datetime
import inspect
import sys
import os
import json
import time
import csv
import decimal
from decimal import Decimal
from typing import Sequence, Optional
from aiorpcx.curio import timeout_after, TaskTimeout, TaskGroup
import aiohttp
from . import util
from .bitcoin import CO... | 35.041605 | 128 | 0.611542 |
796eeed6bcca58b96277e6a2194b2e3fe4f71679 | 3,069 | py | Python | pytools/indices.py | jph58/runko | ccc22dc951344f7b0b3e74973ac75670fae56f8c | [
"MIT"
] | 5 | 2018-10-26T07:08:16.000Z | 2019-05-10T06:47:37.000Z | pytools/indices.py | jph58/runko | ccc22dc951344f7b0b3e74973ac75670fae56f8c | [
"MIT"
] | 9 | 2018-11-09T08:50:48.000Z | 2019-06-06T20:11:12.000Z | pytools/indices.py | jph58/runko | ccc22dc951344f7b0b3e74973ac75670fae56f8c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# dig out indices from inside the tile
def get_index(tile, conf):
ind = tile.index
if conf.threeD:
i,j,k = ind
elif conf.twoD:
i,j = ind
k = 0
return i,j,k
class Stagger:
staggers = {
'ex':[1,0,0],
'ey':[0,1,0],
... | 19.062112 | 112 | 0.467579 |
796eeeec8ac88d1a6042352361a6781838dfd404 | 583 | py | Python | examples/devel/cgo01.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 636 | 2018-06-21T20:46:36.000Z | 2022-03-30T13:07:47.000Z | examples/devel/cgo01.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 218 | 2018-06-25T00:10:59.000Z | 2022-03-23T14:15:48.000Z | examples/devel/cgo01.py | dualword/pymol-open-source | abc307745d7d231af4f77f984ebd64f1b428cef8 | [
"CNRI-Python"
] | 192 | 2018-06-21T17:33:10.000Z | 2022-03-31T17:53:03.000Z | from pymol.cgo import *
from pymol import cmd
# this is a trivial example of creating a cgo object consisting of a
# a single state
# first we create a list of floats containing a GL rendering stream
obj = [
BEGIN, LINES,
COLOR, 1.0, 1.0, 1.0,
VERTEX, 0.0, 0.0, 0.0,
VERTEX, 1.0, 0.0, 0.0,
VER... | 17.666667 | 69 | 0.617496 |
796eeeff67d7bd440955a381cb2265c72612293d | 1,087 | py | Python | closed_form_factorization.py | NoirChad/stylegan2-pytorch-add_profiling | 9adbec56872e38b6fc30ebf5827ace3e5fb691a2 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | closed_form_factorization.py | NoirChad/stylegan2-pytorch-add_profiling | 9adbec56872e38b6fc30ebf5827ace3e5fb691a2 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | closed_form_factorization.py | NoirChad/stylegan2-pytorch-add_profiling | 9adbec56872e38b6fc30ebf5827ace3e5fb691a2 | [
"MIT",
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | import argparse
import time
import torch
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Extract factor/eigenvectors of latent spaces using closed form factorization"
)
parser.add_argument(
"--out", type=str, default="factor.pt", help="name of the result factor f... | 27.175 | 98 | 0.639374 |
796ef020a298e218a55b01bf8db975a05a2f9c63 | 10,622 | py | Python | Summarize.py | broadinstitute/file-stats | 327684590a9e383951ef55842cbe4fe6698f2dc0 | [
"BSD-3-Clause"
] | 1 | 2019-06-27T22:02:44.000Z | 2019-06-27T22:02:44.000Z | Summarize.py | broadinstitute/file-stats | 327684590a9e383951ef55842cbe4fe6698f2dc0 | [
"BSD-3-Clause"
] | 3 | 2019-06-28T10:07:44.000Z | 2019-08-12T18:52:59.000Z | Summarize.py | broadinstitute/file-stats | 327684590a9e383951ef55842cbe4fe6698f2dc0 | [
"BSD-3-Clause"
] | null | null | null | #!/bin/env python
#
import cProfile
import os
import csv
from collections import Counter
import sys
import re
import cga_util
#
# program to take as input a set of file data produced by a file system scanner and produce a report containing
# for each file owner
# 1. a count of the files they own
# 2. total size of th... | 44.630252 | 130 | 0.638863 |
796ef0b859aa725f6fc36ff9cca509ebe55bc07e | 2,834 | py | Python | l5kit/l5kit/rasterization/render_context.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | 1 | 2021-12-04T17:48:53.000Z | 2021-12-04T17:48:53.000Z | l5kit/l5kit/rasterization/render_context.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | null | null | null | l5kit/l5kit/rasterization/render_context.py | cdicle-motional/l5kit | 4dc4ee5391479bb71f0b373f39c316f9eef5a961 | [
"Apache-2.0"
] | 1 | 2021-11-19T08:13:46.000Z | 2021-11-19T08:13:46.000Z | import numpy as np
from ..geometry import vertical_flip
class RenderContext:
def __init__(
self,
raster_size_px: np.ndarray,
pixel_size_m: np.ndarray,
center_in_raster_ratio: np.ndarray,
set_origin_to_bottom: bool,
) -> None:
"""
Thi... | 42.298507 | 116 | 0.646083 |
796ef14131c7950c0dd7d9ea32779815bf0b5441 | 2,805 | py | Python | bird-configwatcher.py | openvnf/bird-configwatcher | 4162172dabf7f926261c281b41a457a64197a4e7 | [
"Apache-2.0"
] | 1 | 2020-08-04T09:19:58.000Z | 2020-08-04T09:19:58.000Z | bird-configwatcher.py | openvnf/bird-configwatcher | 4162172dabf7f926261c281b41a457a64197a4e7 | [
"Apache-2.0"
] | 1 | 2021-06-09T14:48:49.000Z | 2021-06-09T14:48:49.000Z | bird-configwatcher.py | openvnf/bird-configwatcher | 4162172dabf7f926261c281b41a457a64197a4e7 | [
"Apache-2.0"
] | 1 | 2019-11-11T14:25:23.000Z | 2019-11-11T14:25:23.000Z |
from lib import bird_control
from lib import hashing
from inotify_simple import INotify, flags
from prometheus_client import start_http_server, Enum
import os
def main():
print('Starting prometheus exporter')
start_http_server(int(os.getenv('METRICS_PORT', 8000)))
bird_config_folder = '/opt/bird'
bir... | 40.652174 | 104 | 0.639929 |
796ef1560463471fc516bb50a21cc3938f9a4676 | 2,179 | py | Python | ALTANTIS/world/extras.py | the-Bruce/ALTANTIS | 3833b99467d2c96762c666f2d2277090c39ed96b | [
"MIT"
] | null | null | null | ALTANTIS/world/extras.py | the-Bruce/ALTANTIS | 3833b99467d2c96762c666f2d2277090c39ed96b | [
"MIT"
] | null | null | null | ALTANTIS/world/extras.py | the-Bruce/ALTANTIS | 3833b99467d2c96762c666f2d2277090c39ed96b | [
"MIT"
] | null | null | null | from typing import Tuple, List
from ALTANTIS.utils.entity import Entity
from ALTANTIS.utils.direction import diagonal_distance
def all_in_submap(pos : Tuple[int, int], dist : int, sub_exclusions : List[str] = [], npc_exclusions : List[int] = []) -> List[Entity]:
from ALTANTIS.subs.state import filtered_teams, get... | 36.932203 | 135 | 0.655346 |
796ef15db1ec90c82c49000beabd6424c4e31211 | 3,299 | py | Python | pymongo/__init__.py | Olegt0rr/mongo-python-driver | 6b0123594aeb6d4fa618568a28cab3344c5422f0 | [
"Apache-2.0"
] | 1 | 2021-12-14T12:44:24.000Z | 2021-12-14T12:44:24.000Z | pymongo/__init__.py | Olegt0rr/mongo-python-driver | 6b0123594aeb6d4fa618568a28cab3344c5422f0 | [
"Apache-2.0"
] | null | null | null | pymongo/__init__.py | Olegt0rr/mongo-python-driver | 6b0123594aeb6d4fa618568a28cab3344c5422f0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2009-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 29.990909 | 78 | 0.687784 |
796ef3341608fc84e4eb481d0ce657041ecd252a | 174 | py | Python | docker-compose/scale-demo/demo_server.py | frkhit/docker-practice | c872cf00bff575e9731bd67686a43309dd1bd7bb | [
"MIT"
] | 1 | 2020-03-01T07:38:53.000Z | 2020-03-01T07:38:53.000Z | docker-compose/scale-demo/demo_server.py | frkhit/docker-practice | c872cf00bff575e9731bd67686a43309dd1bd7bb | [
"MIT"
] | null | null | null | docker-compose/scale-demo/demo_server.py | frkhit/docker-practice | c872cf00bff575e9731bd67686a43309dd1bd7bb | [
"MIT"
] | null | null | null | import os
import time
host_name = os.environ.get("HOSTNAME")
with open("/app/demo.log", "a") as f:
f.write("{}\n".format(host_name))
while True:
time.sleep(60)
| 12.428571 | 38 | 0.637931 |
796ef3c3ab7c18eb2de658e5afa6dba683980530 | 16,721 | py | Python | aiida_fleur/tools/extract_corelevels.py | broeder-j/aiida_fleur_plugin | cca54b194f4b217abb69aaa1fca0db52c6c830c3 | [
"MIT"
] | 1 | 2017-02-07T12:31:38.000Z | 2017-02-07T12:31:38.000Z | aiida_fleur/tools/extract_corelevels.py | broeder-j/aiida_fleur_plugin | cca54b194f4b217abb69aaa1fca0db52c6c830c3 | [
"MIT"
] | 16 | 2017-04-03T11:42:50.000Z | 2017-05-18T16:25:39.000Z | aiida_fleur/tools/extract_corelevels.py | broeder-j/aiida_fleur_plugin | cca54b194f4b217abb69aaa1fca0db52c6c830c3 | [
"MIT"
] | null | null | null | ###############################################################################
# Copyright (c), Forschungszentrum Jülich GmbH, IAS-1/PGI-1, Germany. #
# All rights reserved. #
# This file is part of the AiiDA-FLEUR package. #
... | 37.65991 | 252 | 0.596794 |
796ef3dfcac2ba1f348d9141400d13fc6741213b | 69 | py | Python | dev/Tools/AWSPythonSDK/1.5.8/dateutil/__init__.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | virtual/lib/python3.6/site-packages/dateutil/__init__.py | annstella/blog | 1cdb7e7e7df028a84fae9b7d901116aae577589d | [
"MIT"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | virtual/lib/python3.6/site-packages/dateutil/__init__.py | annstella/blog | 1cdb7e7e7df028a84fae9b7d901116aae577589d | [
"MIT"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | # -*- coding: utf-8 -*-
from ._version import VERSION as __version__
| 23 | 44 | 0.695652 |
796ef42bc7dd7967f03707fd331d5617e55e77b9 | 5,896 | py | Python | mapentity/decorators.py | pierreloicq/Geotrek-admin | 00cd29f29843f2cc25e5a3c7372fcccf14956887 | [
"BSD-2-Clause"
] | 26 | 2015-01-12T13:22:40.000Z | 2022-03-07T16:50:52.000Z | mapentity/decorators.py | pierreloicq/Geotrek-admin | 00cd29f29843f2cc25e5a3c7372fcccf14956887 | [
"BSD-2-Clause"
] | 94 | 2015-01-21T16:20:47.000Z | 2022-03-24T13:44:56.000Z | mapentity/decorators.py | pierreloicq/Geotrek-admin | 00cd29f29843f2cc25e5a3c7372fcccf14956887 | [
"BSD-2-Clause"
] | 13 | 2015-01-22T07:11:15.000Z | 2019-10-28T02:07:48.000Z | from functools import wraps
from django.utils.decorators import available_attrs, method_decorator
from django.views.decorators.cache import cache_control
from django.views.decorators.http import last_modified as cache_last_modified
from django.utils.translation import ugettext_lazy as _
from django.core.exceptions imp... | 38.285714 | 95 | 0.619064 |
796ef598271271bfaf4e8d73102d91acccdafa74 | 113 | py | Python | src/kgmk/datetime/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/datetime/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/datetime/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | from .datetime_from_str import(
DatetimeFromStr,
)
from .datetime_to_rfc3339 \
import (
DatetimeToRFC3339,
) | 14.125 | 31 | 0.778761 |
796ef73515ccf0cad8b78b376abe540791984067 | 6,534 | py | Python | examples/gmm/gmm.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 6,180 | 2016-11-01T14:22:30.000Z | 2022-03-31T08:39:20.000Z | examples/gmm/gmm.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 6,281 | 2016-12-22T07:42:31.000Z | 2022-03-31T19:57:02.000Z | examples/gmm/gmm.py | svlandeg/cupy | 484e007d5bf58a0445af2f6e7aa3fdfe0fcc2363 | [
"MIT"
] | 829 | 2017-02-23T05:46:12.000Z | 2022-03-27T17:40:03.000Z | import argparse
import contextlib
import time
import matplotlib.pyplot as plt
import numpy as np
from scipy import stats
import cupy
@contextlib.contextmanager
def timer(message):
cupy.cuda.Stream.null.synchronize()
start = time.time()
yield
cupy.cuda.Stream.null.synchronize()
end = time.time()
... | 36.707865 | 78 | 0.624273 |
796ef73f1c866bfa54c7b0b91ffeac2fb2bd1f52 | 11,274 | py | Python | qiskit/quantum_info/synthesis/xx_decompose/circuits.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | qiskit/quantum_info/synthesis/xx_decompose/circuits.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | qiskit/quantum_info/synthesis/xx_decompose/circuits.py | TheGupta2012/qiskit-terra | 5ea6e9557655b144228c29d7099375f5d2c91120 | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2021
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wor... | 37.705686 | 100 | 0.630122 |
796ef7de745aca2ab9df8b8d541a914c2c56d43e | 3 | py | Python | 2.py | Color-cloud/The-Second | 274e547a0bea7975f80acb51f6e3ecc603b163e3 | [
"Apache-2.0"
] | null | null | null | 2.py | Color-cloud/The-Second | 274e547a0bea7975f80acb51f6e3ecc603b163e3 | [
"Apache-2.0"
] | null | null | null | 2.py | Color-cloud/The-Second | 274e547a0bea7975f80acb51f6e3ecc603b163e3 | [
"Apache-2.0"
] | null | null | null | 全新
| 1.5 | 2 | 0.666667 |
796ef84b1d6116ded4fbfa475c2e1f91a6007f81 | 527 | py | Python | src/flaskdoc/cli.py | kulgan/flaskdoc | e61fcbc246bcc3695c0e7dcb474067d47a6d70f0 | [
"Apache-2.0"
] | 4 | 2020-08-17T03:07:26.000Z | 2021-06-24T13:01:56.000Z | src/flaskdoc/cli.py | kulgan/flaskdoc | e61fcbc246bcc3695c0e7dcb474067d47a6d70f0 | [
"Apache-2.0"
] | 14 | 2019-10-09T13:50:43.000Z | 2020-08-17T02:35:55.000Z | src/flaskdoc/cli.py | kulgan/flaskdoc | e61fcbc246bcc3695c0e7dcb474067d47a6d70f0 | [
"Apache-2.0"
] | 2 | 2020-08-09T06:10:24.000Z | 2022-03-06T11:23:30.000Z | import sys
import click
from flaskdoc.examples.app import run_examples
@click.group(name="flaskdoc")
def flaskdoc():
pass
@click.command(name="start")
@click.option(
"--name",
"-n",
type=click.Choice(
["inventory", "petstore", "all", "mocks", "api-with-examples", "link-example"],
c... | 16.46875 | 87 | 0.658444 |
796ef8e7ff1d5c9a075e38d12abf8759fd044ed6 | 4,924 | py | Python | src/robotide/publish/__init__.py | veryl-technologies/t24-tests-ide | 16cd803895916a785c0e1fec3f71f9388c21edc9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-06-27T08:48:24.000Z | 2019-06-27T08:48:24.000Z | src/robotide/publish/__init__.py | veryl-technologies/t24-tests-ide | 16cd803895916a785c0e1fec3f71f9388c21edc9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robotide/publish/__init__.py | veryl-technologies/t24-tests-ide | 16cd803895916a785c0e1fec3f71f9388c21edc9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2012 Nokia Siemens Networks Oyj
#
# 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... | 38.46875 | 85 | 0.76645 |
796ef91285446b07045f2648a3d71728cba55d34 | 3,942 | py | Python | tests/text_classification_integration_test.py | javispp/biome-text | d4f49fde92c5f5efec51e2a285bb243bf7b25c0f | [
"Apache-2.0"
] | 62 | 2019-04-09T02:20:57.000Z | 2022-02-19T12:29:27.000Z | tests/text_classification_integration_test.py | javispp/biome-text | d4f49fde92c5f5efec51e2a285bb243bf7b25c0f | [
"Apache-2.0"
] | 213 | 2019-03-20T15:40:47.000Z | 2021-07-05T16:00:02.000Z | tests/text_classification_integration_test.py | javispp/biome-text | d4f49fde92c5f5efec51e2a285bb243bf7b25c0f | [
"Apache-2.0"
] | 8 | 2020-09-03T18:16:16.000Z | 2021-08-13T08:38:24.000Z | from typing import Tuple
import pytest
from pytorch_lightning import seed_everything
from biome.text import Dataset
from biome.text import Pipeline
from biome.text import Trainer
from biome.text import VocabularyConfiguration
from biome.text.configuration import CharFeatures
from biome.text.configuration import Train... | 30.55814 | 83 | 0.571791 |
796ef920243b496f7d0ca39554fdc7de617ca9c1 | 13,952 | py | Python | mars/tensor/execution/arithmetic.py | immortalFrogJiang/mars | 93c786e38bdc0fbb483282d7792379db0345a3b6 | [
"Apache-2.0"
] | 1 | 2019-02-01T07:41:48.000Z | 2019-02-01T07:41:48.000Z | mars/tensor/execution/arithmetic.py | immortalFrogJiang/mars | 93c786e38bdc0fbb483282d7792379db0345a3b6 | [
"Apache-2.0"
] | null | null | null | mars/tensor/execution/arithmetic.py | immortalFrogJiang/mars | 93c786e38bdc0fbb483282d7792379db0345a3b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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-... | 33.782082 | 109 | 0.603928 |
796ef9405eb7623223ae4d2a06e48b489ed41a29 | 27,119 | py | Python | landlab/components/erosion_deposition/erosion_deposition.py | Giuseppecipolla95/landlab | c59131a0c3595c9f1d42c6124b381b8892bed55d | [
"MIT"
] | null | null | null | landlab/components/erosion_deposition/erosion_deposition.py | Giuseppecipolla95/landlab | c59131a0c3595c9f1d42c6124b381b8892bed55d | [
"MIT"
] | 1 | 2018-04-07T08:24:56.000Z | 2018-04-07T13:52:03.000Z | landlab/components/erosion_deposition/erosion_deposition.py | Giuseppecipolla95/landlab | c59131a0c3595c9f1d42c6124b381b8892bed55d | [
"MIT"
] | null | null | null | import numpy as np
from landlab import Component
from .cfuncs import calculate_qs_in
ROOT2 = np.sqrt(2.0) # syntactic sugar for precalculated square root of 2
TIME_STEP_FACTOR = 0.5 # factor used in simple subdivision solver
DEFAULT_MINIMUM_TIME_STEP = 0.001 # default minimum time step duration
class ErosionDepo... | 46.042445 | 95 | 0.556105 |
796ef982a8f5958b3cf9f4125c760e250a910b07 | 1,380 | py | Python | floodsystem/flood.py | TK594/IA-flood-risk-project | 17902a255d1e76b4085760d5ab655aa5dce762dc | [
"MIT"
] | null | null | null | floodsystem/flood.py | TK594/IA-flood-risk-project | 17902a255d1e76b4085760d5ab655aa5dce762dc | [
"MIT"
] | null | null | null | floodsystem/flood.py | TK594/IA-flood-risk-project | 17902a255d1e76b4085760d5ab655aa5dce762dc | [
"MIT"
] | null | null | null | from .utils import sorted_by_key # noqa
from floodsystem.stationdata import update_water_levels
#2B
def stations_level_over_threshold(stations, tol):
"""for a list of stations and a tolerance, return a list of tuples of station objects and their relative level if it's above the tolerance"""
# Update latest lev... | 34.5 | 145 | 0.718841 |
796efa2c2316a81f02589e7cafa1b366d25e49ed | 568 | py | Python | src/util/github.py | mcarun123/airworkflowtest-action | 284850e37730e2fa6169a9324b0705c4a1ec7eb2 | [
"Apache-2.0"
] | null | null | null | src/util/github.py | mcarun123/airworkflowtest-action | 284850e37730e2fa6169a9324b0705c4a1ec7eb2 | [
"Apache-2.0"
] | null | null | null | src/util/github.py | mcarun123/airworkflowtest-action | 284850e37730e2fa6169a9324b0705c4a1ec7eb2 | [
"Apache-2.0"
] | null | null | null | import json
from typing import List
import requests
from src.util import env
def get_open_pr_refs() -> List[str]:
repository_name = env.get_repo_name_auto()
url = "https://api.github.com/repos/" + repository_name + "/pulls"
authorization_string = "Bearer " + env.get_github_token()
payload = {"state"... | 29.894737 | 112 | 0.68838 |
796efa75eb340674f37a23317b79ee2c762f3bf3 | 34,012 | py | Python | reeds/function_libs/pipeline/module_functions.py | rinikerlab/reeds | d5d13eaf844d8f78456634f68455ba6239a106de | [
"MIT"
] | 3 | 2021-06-18T03:27:17.000Z | 2021-11-15T13:55:51.000Z | reeds/function_libs/pipeline/module_functions.py | rinikerlab/reeds | d5d13eaf844d8f78456634f68455ba6239a106de | [
"MIT"
] | 11 | 2021-06-25T08:53:37.000Z | 2021-10-19T10:17:58.000Z | reeds/function_libs/pipeline/module_functions.py | rinikerlab/reeds | d5d13eaf844d8f78456634f68455ba6239a106de | [
"MIT"
] | 1 | 2021-09-16T12:18:17.000Z | 2021-09-16T12:18:17.000Z | import copy
import glob
import os
import typing as t
from inspect import signature, _empty
from numbers import Number
from typing import Tuple, List, Union, Dict
from pygromos.euler_submissions import FileManager as fM
from pygromos.files import imd, coord
from pygromos.files.coord import cnf as cnf_cls
from pygromos.... | 45.168659 | 192 | 0.628543 |
796efb61aaf16de71ff5bc4a10b4dd77c3cd32b1 | 603 | py | Python | aliyun/api/rest/Ess20140828ModifyScheduledTaskRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 14 | 2015-11-30T02:35:18.000Z | 2019-05-14T11:49:24.000Z | aliyun/api/rest/Ess20140828ModifyScheduledTaskRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 2 | 2015-11-30T02:51:40.000Z | 2017-03-16T01:51:45.000Z | aliyun/api/rest/Ess20140828ModifyScheduledTaskRequest.py | francisar/rds_manager | 458298669bf7d1990a85648b466b88f905256690 | [
"MIT"
] | 12 | 2016-01-04T06:48:17.000Z | 2020-11-07T14:08:25.000Z | '''
Created by auto_sdk on 2015.06.23
'''
from aliyun.api.base import RestApi
class Ess20140828ModifyScheduledTaskRequest(RestApi):
def __init__(self,domain='ess.aliyuncs.com',port=80):
RestApi.__init__(self,domain, port)
self.Description = None
self.LaunchExpirationTime = None
self.LaunchTime = None
self.Re... | 28.714286 | 58 | 0.771144 |
796efba6ef6cfb48b1fc12a8e77139cddf50cced | 2,332 | py | Python | malib/gt/algos/elo_rating.py | ReinholdM/play_football_with_human | 9ac2f0a8783aede56f4ac1f6074db7daa41b6b6c | [
"MIT"
] | 5 | 2021-11-17T03:11:13.000Z | 2021-12-23T09:04:21.000Z | malib/gt/algos/elo_rating.py | ReinholdM/play_football_with_human | 9ac2f0a8783aede56f4ac1f6074db7daa41b6b6c | [
"MIT"
] | null | null | null | malib/gt/algos/elo_rating.py | ReinholdM/play_football_with_human | 9ac2f0a8783aede56f4ac1f6074db7daa41b6b6c | [
"MIT"
] | null | null | null | from typing import Dict
from collections import defaultdict
class EloManager:
def __init__(self, K, default_elo=1000):
"""
Create an Elo Rating Manager, which will manager all player's elo in it.
https://en.wikipedia.org/wiki/Elo_rating_system#Implementing_Elo's_scheme
:param K: th... | 32.84507 | 100 | 0.613208 |
796efcbbb071e498f2a86a08bdb3bee723a53f98 | 2,249 | py | Python | test/test_treedist.py | smola/badcode | c0ce3dbff9164e25e500aee7e01f43337f09ffd1 | [
"Apache-2.0"
] | 1 | 2018-09-17T10:13:57.000Z | 2018-09-17T10:13:57.000Z | test/test_treedist.py | smola/badcode | c0ce3dbff9164e25e500aee7e01f43337f09ffd1 | [
"Apache-2.0"
] | 1 | 2021-06-01T23:00:17.000Z | 2021-06-01T23:00:17.000Z | test/test_treedist.py | smola/badcode | c0ce3dbff9164e25e500aee7e01f43337f09ffd1 | [
"Apache-2.0"
] | 3 | 2018-11-01T12:35:19.000Z | 2021-08-09T05:50:37.000Z |
import unittest
from bblfsh import Node
from badcode.bblfshutil import UAST, WILDCARD
from badcode.treedist import single_node_merge
from badcode.treedist import TreeToSeq
from badcode.treedist import single_node_merge_precalc
def test_single_node_merge():
a = UAST(key=('A', 'a'))
b = UAST(key=('B', 'b'))
... | 28.1125 | 64 | 0.52779 |
796efd62196200206e45cd39ef746218ac5c06d6 | 38,760 | py | Python | zproject/urls.py | laurynmm/zulip | aa5536fe3046d76813015dd7db83297a213ca03a | [
"Apache-2.0"
] | 4 | 2021-09-16T16:46:55.000Z | 2022-02-06T13:00:21.000Z | zproject/urls.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | zproject/urls.py | jai2201/zulip | 95303a9929424b55a1f7c7cce9313c4619a9533b | [
"Apache-2.0"
] | null | null | null | import os
from typing import List, Union
from django.conf import settings
from django.conf.urls import include
from django.conf.urls.i18n import i18n_patterns
from django.contrib.auth.views import (
LoginView,
PasswordResetCompleteView,
PasswordResetConfirmView,
PasswordResetDoneView,
)
from django.url... | 40.586387 | 103 | 0.720949 |
796efd76b211aa5f639f9bfeb3ca5294749b4bb8 | 1,263 | py | Python | stacks/XIAOMATECH/1.0/services/KIBANA/package/scripts/params.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 3 | 2019-08-13T01:44:16.000Z | 2019-12-10T04:05:56.000Z | stacks/XIAOMATECH/1.0/services/KIBANA/package/scripts/params.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | null | null | null | stacks/XIAOMATECH/1.0/services/KIBANA/package/scripts/params.py | tvorogme/dataops | acfa21df42a20768c004c6630a064f4e38e280b2 | [
"Apache-2.0"
] | 7 | 2019-05-29T17:35:25.000Z | 2021-12-04T07:55:10.000Z | #!/usr/bin/env python
from urlparse import urlparse
from resource_management.libraries.functions import format
from resource_management.libraries.script import Script
from resource_management.libraries.functions import default
# server configurations
config = Script.get_config()
kibana_home = '/usr/share/kibana/'
kib... | 39.46875 | 74 | 0.76247 |
796efda9d127cc71bcb4778cec06dd56815e2563 | 585 | py | Python | Day_20/part1.py | Uklusi/AdventOfCode2016 | c3f9273f4a7ea4bd2a3e1727936c70267cc6a271 | [
"MIT"
] | null | null | null | Day_20/part1.py | Uklusi/AdventOfCode2016 | c3f9273f4a7ea4bd2a3e1727936c70267cc6a271 | [
"MIT"
] | null | null | null | Day_20/part1.py | Uklusi/AdventOfCode2016 | c3f9273f4a7ea4bd2a3e1727936c70267cc6a271 | [
"MIT"
] | null | null | null | result = 0
blockedIps = []
with open("input.txt", "r") as input:
for line in input:
line = line.strip()
limits = [int(n) for n in line.split("-")]
blockedIps.append({"min": limits[0], "max": limits[1]})
blockedIps.sort(key=lambda x: x["min"])
found = False
i = 0
while not found and i < len... | 23.4 | 63 | 0.576068 |
796efe1b8eeca1233730315d19cd6a5b9a830881 | 6,171 | py | Python | demo/demo_pkg/rst_structural_elements.py | tristanlatr/pydoctor-theme-readthedocs | 0906e584942abe6edf5cba6896c7aa1b734695c3 | [
"MIT"
] | 1 | 2021-06-15T23:44:09.000Z | 2021-06-15T23:44:09.000Z | demo/demo_pkg/rst_structural_elements.py | tristanlatr/pydoctor-theme-readthedocs | 0906e584942abe6edf5cba6896c7aa1b734695c3 | [
"MIT"
] | null | null | null | demo/demo_pkg/rst_structural_elements.py | tristanlatr/pydoctor-theme-readthedocs | 0906e584942abe6edf5cba6896c7aa1b734695c3 | [
"MIT"
] | null | null | null | r"""
.. contents:: Table of Contents
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lorem neque, interdum in ipsum nec,
finibus dictum velit. Ut eu efficitur arcu, id aliquam erat. In sit amet diam gravida, imperdiet tellus eu,
gravida nisl. Praesent aliquet odio eget libero elementum, quis rhoncus tel... | 61.71 | 119 | 0.794685 |
796eff3b6deef615723e2bc99dc2a5f2ae748496 | 3,418 | py | Python | corehq/apps/ota/tests/test_digest_restore.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 471 | 2015-01-10T02:55:01.000Z | 2022-03-29T18:07:18.000Z | corehq/apps/ota/tests/test_digest_restore.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 14,354 | 2015-01-01T07:38:23.000Z | 2022-03-31T20:55:14.000Z | corehq/apps/ota/tests/test_digest_restore.py | andyasne/commcare-hq | c59a24e57bdd4d2536493f9ecdcc9906f4ae1b88 | [
"BSD-3-Clause"
] | 175 | 2015-01-06T07:16:47.000Z | 2022-03-29T13:27:01.000Z | import time
from django.conf import settings
from django.http import HttpResponse
from django.test import Client, TestCase
from django.urls import reverse
import mock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.domain.tests.test_utils import delete_all_domains
from corehq.apps.users.model... | 37.152174 | 99 | 0.703628 |
796f010c5197b50eff339217b04f5ed23079e7c9 | 4,853 | py | Python | graph-model/main.py | shubhomb/clonal_evolution | bbbd0a482293d41cadebe53028e0adeded591e6b | [
"MIT"
] | 1 | 2020-03-19T22:31:05.000Z | 2020-03-19T22:31:05.000Z | graph-model/main.py | shubhomb/mm_clonal_evolution | bbbd0a482293d41cadebe53028e0adeded591e6b | [
"MIT"
] | null | null | null | graph-model/main.py | shubhomb/mm_clonal_evolution | bbbd0a482293d41cadebe53028e0adeded591e6b | [
"MIT"
] | null | null | null | """
This file contains functions necessary to simulate the entire evolution
of a finite number of subclone colonies using a graph framework.
First, we set up an environment containing the names of subclone colonies,
the adjacency matrix describing the relationship, the alpha values denoting
their ... | 29.591463 | 81 | 0.59695 |
796f01765c5bc8789fe09a664ac672c1274c90ac | 23,132 | py | Python | pybind/nos/v7_1_0/rbridge_id/maps/rule/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/rbridge_id/maps/rule/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/rbridge_id/maps/rule/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 76.343234 | 1,008 | 0.6772 |
796f019838f001383b7f34dae0b464bd077a362c | 6,203 | py | Python | tests/test_color.py | gefei/rich | 8c3e6be424f36522cbb3c4773e58a01f5f39761f | [
"MIT"
] | 33,622 | 2019-12-24T05:18:43.000Z | 2022-01-05T10:34:21.000Z | tests/test_color.py | gefei/rich | 8c3e6be424f36522cbb3c4773e58a01f5f39761f | [
"MIT"
] | 1,126 | 2020-01-23T19:34:37.000Z | 2022-01-04T11:55:56.000Z | tests/test_color.py | gefei/rich | 8c3e6be424f36522cbb3c4773e58a01f5f39761f | [
"MIT"
] | 1,261 | 2020-01-23T11:11:31.000Z | 2022-01-04T19:35:56.000Z | from rich.color import (
blend_rgb,
parse_rgb_hex,
Color,
ColorParseError,
ColorSystem,
ColorType,
ColorTriplet,
)
from rich.style import Style
from rich.text import Text, Span
import pytest
def test_str() -> None:
assert str(Color.parse("red")) == "Color('red', ColorType.STANDARD, nu... | 32.820106 | 88 | 0.647106 |
796f048690baa473b1275fdbdd0cc5407b4f5a03 | 2,888 | py | Python | attribution/authorship_pipeline/run_preprocessing.py | yangzhou6666/authorship-detection | f28701dea256da70eb8ba216c2572e1975c99b54 | [
"MIT"
] | 14 | 2020-10-26T06:05:55.000Z | 2022-03-08T08:32:17.000Z | attribution/authorship_pipeline/run_preprocessing.py | yangzhou6666/authorship-detection | f28701dea256da70eb8ba216c2572e1975c99b54 | [
"MIT"
] | 10 | 2020-02-29T16:55:20.000Z | 2021-11-06T10:40:32.000Z | attribution/authorship_pipeline/run_preprocessing.py | yangzhou6666/authorship-detection | f28701dea256da70eb8ba216c2572e1975c99b54 | [
"MIT"
] | 4 | 2021-07-28T12:27:46.000Z | 2021-10-04T18:12:33.000Z | from argparse import ArgumentParser
import numpy as np
from preprocessing.compute_caliskan_features import compute_caliskan_features
from preprocessing.compute_occurrences import compute_occurrences
from preprocessing.context_split import context_split
from preprocessing.merge_aliases_bipartite import merge_aliases_b... | 48.949153 | 112 | 0.732341 |
796f04cf177cfe5a279419f47c64517dd73ab2e3 | 1,427 | py | Python | nn/scripts/plot_log.py | awesome-archive/sentence-space | b986de7855527dfed639c2bd0b457f0c7c69d4ad | [
"MIT"
] | 211 | 2017-02-09T13:33:55.000Z | 2020-06-07T23:04:20.000Z | nn/scripts/plot_log.py | richardassar/sentence-space | b986de7855527dfed639c2bd0b457f0c7c69d4ad | [
"MIT"
] | 6 | 2017-02-18T00:10:21.000Z | 2018-01-28T17:54:57.000Z | nn/scripts/plot_log.py | richardassar/sentence-space | b986de7855527dfed639c2bd0b457f0c7c69d4ad | [
"MIT"
] | 49 | 2017-02-10T12:12:09.000Z | 2020-03-15T15:04:57.000Z | import argparse
import numpy
import matplotlib.pyplot as plt
def get_logs(exp, y_idx):
train_log = numpy.loadtxt(exp + "/log.train.csv", delimiter=',')
assert train_log.ndim == 2, '%d dims for train log, expected 2' % train_log.ndim
train_x = train_log[:, 0]
train_y = train_log[:, y_idx]
val_log =... | 29.729167 | 84 | 0.628591 |
796f04e60e65c4bdfb0d0ab7ba9c48634cd4ef13 | 3,894 | py | Python | comancpipeline/Tools/ParserClass.py | S-Yuan137/COMAPreduce | bcb8b171ae3a226b10978e83f85ec72f538466ff | [
"MIT"
] | 5 | 2019-03-05T11:56:13.000Z | 2022-02-16T17:24:07.000Z | SWGSimulator/Tools/Parser.py | SharperJBCA/SWGSimulator | 57357c1f1dc961d46fc18d90514ee755056d7735 | [
"Apache-2.0"
] | null | null | null | SWGSimulator/Tools/Parser.py | SharperJBCA/SWGSimulator | 57357c1f1dc961d46fc18d90514ee755056d7735 | [
"Apache-2.0"
] | 2 | 2021-02-12T14:32:51.000Z | 2021-03-10T08:44:44.000Z | import numpy as np
import re
class Parser(object):
"""
"""
def __init__(self, filename):
super(Parser, self)
self.infodict = {}
self.file = open(filename, 'r')
self.ReadLines()
def __str__(self):
headers = [k+',\n' for k in self.infodict.keys()]
... | 38.176471 | 88 | 0.384694 |
796f05599aa4ea38cdbf1c446ac1fc796051af3a | 30,866 | py | Python | certbot/certbot/_internal/client.py | armanc-code/certbot | 2622a700e0a83e0de0994c970929b624b98dad40 | [
"Apache-2.0"
] | null | null | null | certbot/certbot/_internal/client.py | armanc-code/certbot | 2622a700e0a83e0de0994c970929b624b98dad40 | [
"Apache-2.0"
] | null | null | null | certbot/certbot/_internal/client.py | armanc-code/certbot | 2622a700e0a83e0de0994c970929b624b98dad40 | [
"Apache-2.0"
] | null | null | null | """Certbot client API."""
import datetime
import logging
import platform
from typing import Optional
from cryptography.hazmat.backends import default_backend
# See https://github.com/pyca/cryptography/issues/4275
from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key # type: ignore
import jose... | 40.506562 | 99 | 0.6374 |
796f05db1dbeec7641406efdacdb9e1e01eb9b60 | 23,904 | py | Python | test/functional/test_framework/test_framework.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | test/functional/test_framework/test_framework.py | DiniMuhd7/asusucoin | a28c442369571bc0280a84a686e00e7dffd91064 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Base class for RPC testing."""
import configparser
from enum import Enum
import logging
import argpars... | 41.644599 | 312 | 0.622406 |
796f0667311a58dad09eb2c7358fe60314338491 | 10,324 | py | Python | keras/layers/preprocessing/category_encoding.py | collinzrj/keras | 79e9e20d8b95f043cd8a3a240b70928d468a60ac | [
"Apache-2.0"
] | 1 | 2021-08-22T13:00:14.000Z | 2021-08-22T13:00:14.000Z | keras/layers/preprocessing/category_encoding.py | collinzrj/keras | 79e9e20d8b95f043cd8a3a240b70928d468a60ac | [
"Apache-2.0"
] | null | null | null | keras/layers/preprocessing/category_encoding.py | collinzrj/keras | 79e9e20d8b95f043cd8a3a240b70928d468a60ac | [
"Apache-2.0"
] | null | null | null | # 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 applica... | 38.095941 | 80 | 0.650814 |
796f076eb97120a93008f9d06b0920e746ad6496 | 319 | py | Python | mindefuse/strategy/swaszek/agent/agent_same_pos.py | sinistro14/mindefuse | c7371a81731d0b9a03d3ef18f91c336e4135c17d | [
"MIT"
] | null | null | null | mindefuse/strategy/swaszek/agent/agent_same_pos.py | sinistro14/mindefuse | c7371a81731d0b9a03d3ef18f91c336e4135c17d | [
"MIT"
] | 1 | 2019-08-22T19:51:12.000Z | 2019-08-22T19:51:12.000Z | mindefuse/strategy/swaszek/agent/agent_same_pos.py | sinistro14/mindefuse | c7371a81731d0b9a03d3ef18f91c336e4135c17d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.7
from .agent import Agent
class AgentSamePos(Agent):
def __init__(self, pos):
self.pos = pos
def agent_choice(self, possibilities):
if self.pos > len(possibilities) - 1:
return possibilities[len(possibilities) - 1]
return possibilities[self.pos]
| 21.266667 | 56 | 0.648903 |
796f08d3d615a60deb242a7d04ab38aa8c88e5be | 14,531 | py | Python | exovetter/modshift/modshift.py | spacetelescope/exovetter | 58786e78b7a6caf9e582ef9db5515e612166c02f | [
"MIT",
"BSD-3-Clause"
] | 3 | 2020-07-02T03:47:17.000Z | 2022-03-14T19:19:41.000Z | exovetter/modshift/modshift.py | spacetelescope/exovetter | 58786e78b7a6caf9e582ef9db5515e612166c02f | [
"MIT",
"BSD-3-Clause"
] | 65 | 2020-07-02T03:39:04.000Z | 2021-07-27T00:59:54.000Z | exovetter/modshift/modshift.py | spacetelescope/exovetter | 58786e78b7a6caf9e582ef9db5515e612166c02f | [
"MIT",
"BSD-3-Clause"
] | 3 | 2020-07-02T03:47:05.000Z | 2020-07-16T12:22:39.000Z | # -*- coding: utf-8 -*-
"""
Compute Jeff Coughlin's Modshift metrics.
Coughlin uses modshift to refer to both the transit significance tests, as
well as a suite of other, related, tests. This code only measures the
metrics for the transit significance measurements. So, for example,
the Odd Even test is not included he... | 31.796499 | 79 | 0.659831 |
796f0c9a430c7e26d8bee2d52661cc2df67c3108 | 30,400 | py | Python | art/attacks/evasion/wasserstein.py | zacps/adversarial-robustness-toolbox | 9471b5f9fbca69521803244a0cf191d6b8e281b6 | [
"MIT"
] | null | null | null | art/attacks/evasion/wasserstein.py | zacps/adversarial-robustness-toolbox | 9471b5f9fbca69521803244a0cf191d6b8e281b6 | [
"MIT"
] | null | null | null | art/attacks/evasion/wasserstein.py | zacps/adversarial-robustness-toolbox | 9471b5f9fbca69521803244a0cf191d6b8e281b6 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# 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
# r... | 40.052701 | 120 | 0.614178 |
796f0ce02574ea7da04301c556311a2c0f658328 | 9,661 | py | Python | nephoria/testcases/admintests/selinux_audit.py | Corymbia/nephoria | fe8ad7beba479e7a8de70f09cf1fdb4d640b4987 | [
"BSD-2-Clause"
] | 5 | 2016-08-31T06:51:18.000Z | 2018-04-25T20:50:25.000Z | nephoria/testcases/admintests/selinux_audit.py | Corymbia/nephoria | fe8ad7beba479e7a8de70f09cf1fdb4d640b4987 | [
"BSD-2-Clause"
] | 49 | 2016-04-19T07:01:46.000Z | 2017-11-17T23:57:18.000Z | nephoria/testcases/admintests/selinux_audit.py | Corymbia/nephoria | fe8ad7beba479e7a8de70f09cf1fdb4d640b4987 | [
"BSD-2-Clause"
] | 14 | 2016-04-14T17:01:35.000Z | 2021-07-13T13:35:38.000Z | #!/usr/bin/env python
from nephoria.testcase_utils.cli_test_runner import CliTestRunner, SkipTestException
from cloud_utils.log_utils import get_traceback, red, ForegroundColor, BackGroundColor, markup
from cloud_utils.net_utils.remote_commands import RemoteCommands
from cloud_utils.net_utils.sshconnection import SshC... | 39.594262 | 97 | 0.522824 |
796f0d2ff73360612f452f04433e3ac77069c4d9 | 1,866 | py | Python | google/cloud/logging_v2/handlers/transports/sync.py | LaudateCorpus1/python-logging | d86be6cf83c3f3b91c4fc0b2e0666b0ca1d7e248 | [
"Apache-2.0"
] | null | null | null | google/cloud/logging_v2/handlers/transports/sync.py | LaudateCorpus1/python-logging | d86be6cf83c3f3b91c4fc0b2e0666b0ca1d7e248 | [
"Apache-2.0"
] | null | null | null | google/cloud/logging_v2/handlers/transports/sync.py | LaudateCorpus1/python-logging | d86be6cf83c3f3b91c4fc0b2e0666b0ca1d7e248 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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... | 35.207547 | 81 | 0.675241 |
796f0d92c543f769712657daf96d8e58c9f21635 | 111 | py | Python | atvirtual/atvirtual/web_form/registro/registro.py | fderyckel/atvirtual_msg | 006e88f8f6fdcfef8ba7e32efea1c36ad220dc88 | [
"MIT"
] | 3 | 2021-06-04T11:25:33.000Z | 2022-02-21T09:33:11.000Z | atvirtual/atvirtual/web_form/registro/registro.py | fderyckel/atvirtual_msg | 006e88f8f6fdcfef8ba7e32efea1c36ad220dc88 | [
"MIT"
] | null | null | null | atvirtual/atvirtual/web_form/registro/registro.py | fderyckel/atvirtual_msg | 006e88f8f6fdcfef8ba7e32efea1c36ad220dc88 | [
"MIT"
] | 4 | 2021-02-23T04:14:43.000Z | 2021-12-28T18:45:42.000Z | from __future__ import unicode_literals
import frappe
def get_context(context):
# do your magic here
pass | 15.857143 | 39 | 0.792793 |
796f0dcb97ede1832ca519f70edb898231981723 | 505 | py | Python | huntserver/migrations/0040_auto_20200108_1126.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 18 | 2017-03-07T19:53:03.000Z | 2022-02-24T04:58:47.000Z | huntserver/migrations/0040_auto_20200108_1126.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 161 | 2016-11-14T00:04:42.000Z | 2021-06-10T17:25:17.000Z | huntserver/migrations/0040_auto_20200108_1126.py | adenylyl/pi_day_puzzle_hunt | aa01cef427bc5f524e89558da72a2f79b0c78514 | [
"MIT"
] | 22 | 2016-09-27T18:00:10.000Z | 2022-03-13T17:51:44.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.23 on 2020-01-08 16:26
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('huntserver', '0039_auto_20200108_1124'),
]
operations = [
migrations.Alter... | 24.047619 | 95 | 0.637624 |
796f0e1ab672863cd58f32239a95d4dfb21ba006 | 200 | py | Python | src/fl_simulation/server/aggregation/fedprox.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | 5 | 2021-12-14T02:21:53.000Z | 2021-12-26T07:45:13.000Z | src/fl_simulation/server/aggregation/fedprox.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | 1 | 2022-01-04T04:51:20.000Z | 2022-01-04T04:51:20.000Z | src/fl_simulation/server/aggregation/fedprox.py | microsoft/fl-simulation | d177d329c82559c7efe82deae8dea8f9baa49495 | [
"MIT"
] | null | null | null | """FedProx algorithm."""
from fl_simulation.server.aggregation.fedavg import FedAvgAggregator
FedProxAggregator = FedAvgAggregator
"""*FedProx* follows the same aggregation algorithm as *FedAvg*"""
| 28.571429 | 68 | 0.8 |
796f0e8b17ab95e2ed0e83746be724e94219a528 | 391 | py | Python | test/generate_test_file.py | mailgun/uasparser2 | 9066f4922f3245cc2b2fd61084ff6ee0f32d0ba4 | [
"BSD-3-Clause"
] | 1 | 2016-11-20T16:20:58.000Z | 2016-11-20T16:20:58.000Z | test/generate_test_file.py | mailgun/uasparser2 | 9066f4922f3245cc2b2fd61084ff6ee0f32d0ba4 | [
"BSD-3-Clause"
] | null | null | null | test/generate_test_file.py | mailgun/uasparser2 | 9066f4922f3245cc2b2fd61084ff6ee0f32d0ba4 | [
"BSD-3-Clause"
] | 1 | 2016-03-14T19:31:32.000Z | 2016-03-14T19:31:32.000Z | import json
from uasparser import UASparser
up = UASparser()
uas_list = []
ua_file = open('user_agents_sample.txt', 'r').read().split('\n')
ua_file += open('user_agents.txt', 'r').read().split('\n')[:10000]
c = 0
for uas in ua_file:
if uas:
c += 1
if c % 1000 == 0:
print c, '/', len(ua_file)
uas_list.ap... | 17.772727 | 66 | 0.624041 |
796f0f068a079513f18125f65f2fe32acea889c6 | 4,604 | py | Python | stable_baselines3/common/envs/dummy_hybrid.py | martinwimpff/stable-baselines3-hmlf | 6ffa947760f8c42a09f9ae42aa7485c608efc42d | [
"MIT"
] | null | null | null | stable_baselines3/common/envs/dummy_hybrid.py | martinwimpff/stable-baselines3-hmlf | 6ffa947760f8c42a09f9ae42aa7485c608efc42d | [
"MIT"
] | null | null | null | stable_baselines3/common/envs/dummy_hybrid.py | martinwimpff/stable-baselines3-hmlf | 6ffa947760f8c42a09f9ae42aa7485c608efc42d | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Tuple
import gym
import numpy as np
from gym.spaces import Box
from stable_baselines3.common.spaces import SimpleHybrid
class DummyHybrid(gym.Env):
"""
Dummy environment for testing of with SimpleHybrid action spaces.
The 'goal' of the environment is to provi... | 41.854545 | 120 | 0.689183 |
796f0fcf22f5320c294abf094032449c2729eb9f | 1,247 | py | Python | official/nlp/modeling/layers/__init__.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 5 | 2020-11-16T06:26:19.000Z | 2022-03-27T02:01:40.000Z | official/nlp/modeling/layers/__init__.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 5 | 2020-11-13T18:50:30.000Z | 2022-02-10T01:42:36.000Z | official/nlp/modeling/layers/__init__.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 1 | 2020-01-11T04:49:18.000Z | 2020-01-11T04:49:18.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... | 54.217391 | 87 | 0.761026 |
796f0ff052969c05847d78278b6258bd63ce38fc | 22,896 | py | Python | packages/sdk/tests/test_itly.py | amplitude/itly-sdk-python | ee6b1a20a8eab901a7ff897e4980a824388df6c4 | [
"MIT"
] | 1 | 2020-11-16T19:42:53.000Z | 2020-11-16T19:42:53.000Z | packages/sdk/tests/test_itly.py | iterativelyhq/itly-sdk-python | ee6b1a20a8eab901a7ff897e4980a824388df6c4 | [
"MIT"
] | null | null | null | packages/sdk/tests/test_itly.py | iterativelyhq/itly-sdk-python | ee6b1a20a8eab901a7ff897e4980a824388df6c4 | [
"MIT"
] | null | null | null | # flake8: noqa E501
import enum
from typing import List, Optional, Tuple
import pytest
from itly_sdk import Itly, Options, Environment, Event, Properties, Logger, \
Plugin, PluginLoadOptions, ValidationResponse, ValidationOptions
class CustomLogger(Logger):
def __init__(self) -> None:
self.log_lines... | 45.883768 | 439 | 0.687456 |
796f1012fb9c4f3a9d64417eea89b612aaed030f | 1,634 | py | Python | devtest/api/models/model_country.py | oskar-j/flask-api | 857faae7bf8a4e701bb943afdb531e21ad517881 | [
"MIT"
] | 1 | 2018-06-03T19:28:44.000Z | 2018-06-03T19:28:44.000Z | devtest/api/models/model_country.py | oskar-j/flask-api | 857faae7bf8a4e701bb943afdb531e21ad517881 | [
"MIT"
] | null | null | null | devtest/api/models/model_country.py | oskar-j/flask-api | 857faae7bf8a4e701bb943afdb531e21ad517881 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
from api.utils.database import db
from marshmallow_sqlalchemy import ModelSchema
from marshmallow import fields
from api.models.model_location_group import LocationGroupSchema
from api.models import Base
class Country(Base):
__tablename__ = 'country'
# Longest coun... | 30.259259 | 97 | 0.72399 |
796f10c41a75859216f79991761b19f4815761a9 | 18,888 | py | Python | sdk/python/pulumi_azure_native/documentdb/v20210701preview/sql_resource_sql_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20210701preview/sql_resource_sql_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/documentdb/v20210701preview/sql_resource_sql_database.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # 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
fro... | 59.025 | 3,222 | 0.69695 |
796f112a2646dc408dcb72feaf570952b208a823 | 914 | py | Python | SRC/01_Array/03_array_rotation.py | archeranimesh/Geeks4Geeks-Python | 30c8ea592c5df142ed7623d908bfb987f976e3b0 | [
"MIT"
] | null | null | null | SRC/01_Array/03_array_rotation.py | archeranimesh/Geeks4Geeks-Python | 30c8ea592c5df142ed7623d908bfb987f976e3b0 | [
"MIT"
] | null | null | null | SRC/01_Array/03_array_rotation.py | archeranimesh/Geeks4Geeks-Python | 30c8ea592c5df142ed7623d908bfb987f976e3b0 | [
"MIT"
] | null | null | null | # This is the same array rotation program using reversing an Array.
# https://www.geeksforgeeks.org/program-for-array-rotation-continued-reversal-algorithm/
# 2. Reversal algorithm for array rotation
# Reverse the array within the start and end index
def reverse_array(arr, start, end):
while(start < end):
... | 23.435897 | 88 | 0.607221 |
796f116436870a3475d728c2a3972467a5d3ed22 | 811 | py | Python | test.py | ssinad/shopify-backend-challenge-summer-2018 | aa7a3ab28a6c2e2586aa8755f9871abc5bf1eaf6 | [
"MIT"
] | null | null | null | test.py | ssinad/shopify-backend-challenge-summer-2018 | aa7a3ab28a6c2e2586aa8755f9871abc5bf1eaf6 | [
"MIT"
] | null | null | null | test.py | ssinad/shopify-backend-challenge-summer-2018 | aa7a3ab28a6c2e2586aa8755f9871abc5bf1eaf6 | [
"MIT"
] | null | null | null | from GraphBuilder import JsonGraphBuilder
from DFS import DFS
import json
if __name__ == "__main__":
json_obj = json.loads(
# """{"menus":
"""
[
{
"id":1,
"data":"House",
"child_ids":[3]
},
{
"id":2,
"data":"Company",
"child_ids":[4]
},
{
... | 15.596154 | 41 | 0.4291 |
796f11a5c02264114a47235dda2ad258f73b09fa | 4,630 | py | Python | mplStyle/types/test/test_StyleProperty.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 39 | 2015-03-08T23:05:01.000Z | 2022-02-07T16:03:35.000Z | mplStyle/types/test/test_StyleProperty.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | null | null | null | mplStyle/types/test/test_StyleProperty.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 23 | 2015-03-08T19:56:59.000Z | 2021-07-15T15:16:26.000Z | #===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | 37.33871 | 76 | 0.537581 |
796f12cc33ef25b73ea4f97448cd96fac6c0e4d2 | 418 | py | Python | python_modules/automation/automation/helm/schema/subschema/rabbitmq.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/automation/automation/helm/schema/subschema/rabbitmq.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | null | null | null | python_modules/automation/automation/helm/schema/subschema/rabbitmq.py | chasleslr/dagster | 88907f9473fb8e7a9b1af9a0a8b349d42f4b8153 | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | from pydantic import BaseModel, Field # pylint: disable=E0611
class RabbitMQConfiguration(BaseModel):
username: str
password: str
class Service(BaseModel):
port: int
class VolumePermissions(BaseModel):
enabled: bool = Field(default=True, const=True)
class RabbitMQ(BaseModel):
enabled: bool
... | 19 | 62 | 0.746411 |
796f137810939e9e9f4fa1b224eb8d29aa115b85 | 6,933 | py | Python | pydm/widgets/enum_button.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/widgets/enum_button.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | null | null | null | pydm/widgets/enum_button.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from qtpy.QtCore import (Qt, QSize, Property, Slot, Q_ENUMS)
from qtpy.QtWidgets import (QWidget, QButtonGroup, QGridLayout, QPushButton,
QRadioButton)
from .base import PyDMWritableWidget
from .. import data_plugins
class WidgetType(object):
PushButton = 0
RadioButton = 1
class... | 30.275109 | 78 | 0.583009 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.