hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
795e215708e7f77ef40cca0f22a4146fc5abef96 | 4,561 | py | Python | src/htrun/host_tests_runner/host_test.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 37 | 2015-09-10T13:52:40.000Z | 2021-11-17T11:53:30.000Z | src/htrun/host_tests_runner/host_test.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 270 | 2015-09-09T13:00:53.000Z | 2021-12-16T17:39:05.000Z | src/htrun/host_tests_runner/host_test.py | Patater/greentea | 4fcf55396ab7f5960a542edb88365686b8f33624 | [
"Apache-2.0"
] | 51 | 2015-09-04T13:16:47.000Z | 2021-11-18T15:40:03.000Z | #
# Copyright (c) 2021 Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""Classes performing test selection, test execution and reporting of test results."""
from sys import stdout
from .target_base import TargetBase
from . import __version__
class HostTestResults(object):
... | 30.406667 | 86 | 0.614997 |
795e271964e76c13ec8d852392a45eea05501663 | 7,464 | py | Python | neutron/agent/l3/ha.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 4 | 2018-08-05T00:43:03.000Z | 2021-10-13T00:45:45.000Z | neutron/agent/l3/ha.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 8 | 2018-06-14T14:50:16.000Z | 2018-11-13T16:30:42.000Z | neutron/agent/l3/ha.py | kklimonda/neutron | ccdddad358a4bf802d59b3fbbfe88a1e9881c96c | [
"Apache-2.0"
] | 7 | 2018-06-12T18:57:04.000Z | 2019-05-09T15:42:30.000Z | # Copyright (c) 2014 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 41.237569 | 78 | 0.666801 |
795ea6a5d40d77db454a99cce3a929a7044f2358 | 1,787 | py | Python | .leetcode/405.convert-a-number-to-hexadecimal.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/405.convert-a-number-to-hexadecimal.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/405.convert-a-number-to-hexadecimal.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=405 lang=python3
#
# [405] Convert a Number to Hexadecimal
#
# https://leetcode.com/problems/convert-a-number-to-hexadecimal/description/
#
# algorithms
# Easy (44.92%)
# Likes: 702
# Dislikes: 142
# Total Accepted: 85.9K
# Total Submissions: 190.7K
# Testcase Example: '26'
#
# Given an int... | 18.050505 | 76 | 0.609401 |
795eb5df2021f44e76854d8713514ab68edd1042 | 4,417 | py | Python | alsek/core/concurrency.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | 1 | 2021-08-16T02:38:40.000Z | 2021-08-16T02:38:40.000Z | alsek/core/concurrency.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | alsek/core/concurrency.py | TariqAHassan/alsek | a0d0f44d2eea1538c9d04530ae917695f624d269 | [
"MIT"
] | null | null | null | """
Concurrency
"""
from __future__ import annotations
from socket import gethostname
from types import TracebackType
from typing import Optional, Type, cast
from alsek._utils.printing import auto_repr
from alsek.storage.backends import Backend
class Lock:
"""Distributed mutual exclusion (MUTEX) lock.
... | 27.955696 | 88 | 0.56192 |
795eb5f5c55d6503c9cecccabf953da0d6adaf8a | 824 | py | Python | err/try04.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | err/try04.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | err/try04.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""try except else and finally | Alta3 Research"""
# python standard library
import uuid
# generate a UUID based on the host id, sequence number, and current time
# simulating a ticketed job number
ticket = uuid.uuid1()
try: # try to do this
print('Type the name of the configuration file to lo... | 32.96 | 73 | 0.686893 |
795eb791c7e9fa3c8e860b822f8653ee76664127 | 4,503 | py | Python | tools/scripts/coco/coco_caption_eval.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | tools/scripts/coco/coco_caption_eval.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | tools/scripts/coco/coco_caption_eval.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# The following script requires Java 1.8.0 and pycocotools installed.
# The pycocoevalcap can be installed with pip as
# pip install git+https://github.com/flauted/coco-caption.git@python23
# Original pycocoevalcap code is at https://github.com/tylin/coco-caption
# bu... | 34.638462 | 83 | 0.562958 |
795ebf1d74a2a6fe4007ce6f54a2a20c2437f469 | 506 | py | Python | alipay/aop/api/response/AlipayCommerceOperationTimescardAuthorityDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceOperationTimescardAuthorityDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayCommerceOperationTimescardAuthorityDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayCommerceOperationTimescardAuthorityDeleteResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceOperationTimescardAuthorityDeleteResponse, self).__init__()
... | 31.625 | 128 | 0.8083 |
795ec6fea5b5d5c4f796240fea52139b9d4f5799 | 345 | py | Python | buyer/tests/test_tasks.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | 1 | 2021-11-06T12:08:26.000Z | 2021-11-06T12:08:26.000Z | buyer/tests/test_tasks.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | buyer/tests/test_tasks.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | from unittest import mock
from buyer.tasks import buyers_csv_upload
@mock.patch('buyer.tasks.lock_acquired', mock.Mock(return_value=True))
@mock.patch('buyer.tasks.call_command')
def test_buyers_csv_upload(mocked_call_command):
buyers_csv_upload()
mocked_call_command.assert_called_once_with(
'generat... | 26.538462 | 70 | 0.791304 |
795ece2e655ea62f15944bacf4039d976d004ebf | 7,915 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_resource_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_resource_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2020_10_01/models/_resource_management_client_enums.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# 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 ... | 39.378109 | 102 | 0.704106 |
795f1993ba5c31bf5a26333f31f1bc73125bff07 | 8,125 | py | Python | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sinh_arcsinh_bijector_test.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sinh_arcsinh_bijector_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sinh_arcsinh_bijector_test.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 26 | 2017-04-12T16:25:44.000Z | 2018-10-30T10:10:15.000Z | # Copyright 2017 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... | 42.317708 | 112 | 0.650585 |
795f2701cad81fa95be8381754be675144d5cb86 | 939 | py | Python | python3/tests/test_T.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | 2 | 2017-10-01T16:50:37.000Z | 2019-07-03T21:19:09.000Z | python3/tests/test_T.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | 3 | 2020-03-31T03:04:38.000Z | 2021-11-15T17:48:34.000Z | python3/tests/test_T.py | blackelk/hell | 4bb72b2efcb8c83396a95fb6b75c169e2d2315cd | [
"MIT"
] | null | null | null | from termcolor import colored
from hell import T
from conftest import capture_out
t = capture_out(T)
def test_arg():
assert t('') == colored("<class 'str'>\n")
assert t(1) == colored("<class 'int'>\n")
def test_c():
assert t(object, c='green') == colored("<class 'type'>\n", 'green')
assert t(type... | 22.902439 | 91 | 0.561235 |
795f3be9c2859ccf26b85fb101478b41b6cb5b4c | 5,787 | py | Python | pcapparser/printer.py | abzcoding/pcap-parser | 09ef92e08547141637eff62b8a5b64f6d23e945d | [
"BSD-3-Clause"
] | 5 | 2015-09-17T08:17:42.000Z | 2021-11-09T08:21:03.000Z | pcapparser/printer.py | abzcoding/pcap-parser | 09ef92e08547141637eff62b8a5b64f6d23e945d | [
"BSD-3-Clause"
] | null | null | null | pcapparser/printer.py | abzcoding/pcap-parser | 09ef92e08547141637eff62b8a5b64f6d23e945d | [
"BSD-3-Clause"
] | 4 | 2016-09-18T07:13:12.000Z | 2021-08-30T16:15:50.000Z | from __future__ import unicode_literals, print_function, division
from io import StringIO
import sys
from pcapparser.config import OutputLevel
# print http req/resp
from pcapparser import utils, six
from pcapparser import config
import threading
from pcapparser.constant import Compress
printer_lock = threading.Lock(... | 37.335484 | 100 | 0.574909 |
795f460aa62a2f8bf6acef1218232692a0109695 | 7,190 | py | Python | plugins/luminos/luminos.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | null | null | null | plugins/luminos/luminos.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | 2 | 2021-10-03T08:44:45.000Z | 2021-10-03T08:49:49.000Z | plugins/luminos/luminos.py | linuxaddict89/luminos | cd525173bd6766eb109c4409581f6c6273d1c1bd | [
"MIT"
] | null | null | null | import os
from luminos.utils import version, constants, standarddir
from luminos.core.Bridge import BridgeObject, Bridge, Variant
from luminos.Application import Application
from PyQt5.QtWidgets import QApplication
from PyQt5.QtGui import QPalette, QColor
versionInstance = None
pluginManagerInstance = None
directoryI... | 31.26087 | 115 | 0.696662 |
795f46e1b152e47f50205724249ac6878c6b7f27 | 6,352 | py | Python | tfx/components/trainer/rewriting/tflite_rewriter.py | joshtemple/tfx | 169519c8149534294f1f9bc39a6597d6a3fcefb2 | [
"Apache-2.0"
] | 1 | 2020-11-24T16:59:37.000Z | 2020-11-24T16:59:37.000Z | tfx/components/trainer/rewriting/tflite_rewriter.py | fsx950223/tfx | 527fe2bab6e4f62febfe1a2029358fabe55f418c | [
"Apache-2.0"
] | null | null | null | tfx/components/trainer/rewriting/tflite_rewriter.py | fsx950223/tfx | 527fe2bab6e4f62febfe1a2029358fabe55f418c | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2020 Google LLC. 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 req... | 36.716763 | 80 | 0.72182 |
795f4a1ce521feeee7a76da987f8384de9b9b63a | 1,703 | py | Python | galpy/potential/IsothermalDiskPotential.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | 1 | 2019-02-07T10:58:17.000Z | 2019-02-07T10:58:17.000Z | galpy/potential/IsothermalDiskPotential.py | BurcuAkbulut/galpy | cabb42bef3b4f88a2f593cdb123452cd41451db3 | [
"BSD-3-Clause"
] | null | null | null | galpy/potential/IsothermalDiskPotential.py | BurcuAkbulut/galpy | cabb42bef3b4f88a2f593cdb123452cd41451db3 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# IsothermalDiskPotential.py: class that implements the one-dimensional
# self-gravitating isothermal disk
###############################################################################
import numpy
from .li... | 30.410714 | 154 | 0.554903 |
795f974d3c6247b67019155fee8de39e00c40379 | 3,671 | py | Python | timm/scheduler/tanh_lr.py | bermanmaxim/pytorch-image-models | 1d7f2d93a68bdc3c5d8d634d869709f6cdd7cecd | [
"Apache-2.0"
] | 1 | 2021-12-28T10:41:13.000Z | 2021-12-28T10:41:13.000Z | scheduler/tanh_lr.py | hhy5277/pytorch-image-models | ff9962560368f31cf62397ff0c2930b632ef9f48 | [
"Apache-2.0"
] | null | null | null | scheduler/tanh_lr.py | hhy5277/pytorch-image-models | ff9962560368f31cf62397ff0c2930b632ef9f48 | [
"Apache-2.0"
] | 1 | 2019-07-09T08:30:49.000Z | 2019-07-09T08:30:49.000Z | import logging
import math
import numpy as np
import torch
from .scheduler import Scheduler
logger = logging.getLogger(__name__)
class TanhLRScheduler(Scheduler):
"""
Hyberbolic-Tangent decay with restarts.
This is described in the paper https://arxiv.org/abs/1806.01593
"""
def __init__(self,
... | 33.678899 | 106 | 0.535276 |
795fda386e460a0f380180805b775f7668d9b394 | 1,991 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_chat_invite.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_chat_invite.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_chat_invite.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.109375 | 103 | 0.632848 |
795fe2652d5140efcf92f9c79e5ea7a03003ded7 | 4,017 | py | Python | budget-rnn/src/controllers/noise_generators.py | tejaskannan/ml-models | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | 1 | 2021-06-28T15:40:41.000Z | 2021-06-28T15:40:41.000Z | budget-rnn/src/controllers/noise_generators.py | tejaskannan/ml-models | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | 5 | 2021-03-04T19:42:15.000Z | 2022-02-10T05:46:15.000Z | budget-rnn/src/controllers/noise_generators.py | tejaskannan/budget-rnn | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from typing import Optional, Dict, Any, Iterable
class NoiseGenerator:
def __init__(self, max_time: int, loc: float, scale: float, seed: int):
self._max_time = max_time
self._loc = loc
self._scale = scale
self._rand = np.random.RandomState(seed=seed)
se... | 37.194444 | 158 | 0.59298 |
79603ba2936184189e67df4f853188242bdf8f80 | 32,676 | py | Python | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | scripts/Rotation/lambda_mp_GM.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | """
MODIFICATIONS
2015.12.03
final_gal is removed as non-main-progenitors are also analized,
there is no 1:1 correlation between final galaxies and earlier galaxies.
2015.12.21
Galaxies are saved in HDF format at selected nouts.
(for example,
nouts_d... | 37.174061 | 127 | 0.55325 |
7960543b0193d3c305c9c2eebaf869042e76d0ea | 26,738 | py | Python | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/test_config.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import pytest
import random
import shutil
import tempfile
import time
from unittest.mock import patch, MagicMock
from helpers.cli import CLI
from helpers.config import Config
from .utils import (
read_config,
write_trigger_upsert_db_users,
MockAWSValidation
)
CHOICE_YES =... | 35.089239 | 81 | 0.632957 |
79605aa04c1a0fb10a7c4a02040059abe2c0a9cf | 21,982 | py | Python | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | 6 | 2022-02-09T05:35:37.000Z | 2022-03-12T11:54:59.000Z | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | src/emitters/gradient_improvement_emitter.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | """Provides the GradientImprovementEmitter used in CMA-MEGA and its variants."""
import itertools
import logging
import gin
import numpy as np
from ribs.archives import AddStatus
from ribs.emitters import EmitterBase
from src.emitters.opt.cma_es import CMAEvolutionStrategy
from src.emitters.opt.gradients import AdamO... | 42.683495 | 94 | 0.592348 |
796082f86cbc2b99b0dbbcc476d0ab1321fa665c | 2,344 | py | Python | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 2 | 2022-03-01T18:19:30.000Z | 2022-03-18T12:19:39.000Z | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 9 | 2022-03-01T21:08:38.000Z | 2022-03-22T17:27:36.000Z | examples/gaussian/functions/model.py | wjlei1990/nnodes | f305ca59b914427693f4a0420c1656cf2da3f0c6 | [
"MIT"
] | 1 | 2022-03-09T23:18:10.000Z | 2022-03-09T23:18:10.000Z | import os
import numpy as np
def write_model(m, outdir, it, ls=None):
"""Takes in model vector, modldirectory, iteration and linesearch number
and write model to modl directory.
Parameters
----------
m : ndarray
modelvector
modldir : str
model directory
it : int
it... | 21.906542 | 76 | 0.625853 |
79608c8ea4510ca03220a106bf9bce91342c4ad4 | 81,145 | py | Python | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/caldav/datastore/test/test_sql_sharing.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2005-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 42.484293 | 149 | 0.676949 |
7960d6a71ad771677271485cdcb23051eab470cc | 15,153 | py | Python | district_FIRs.py | sangharshbyss/online_FIRs | 564eeccf045f0a7462e859221c7b2d93b7331c89 | [
"CC0-1.0"
] | null | null | null | district_FIRs.py | sangharshbyss/online_FIRs | 564eeccf045f0a7462e859221c7b2d93b7331c89 | [
"CC0-1.0"
] | null | null | null | district_FIRs.py | sangharshbyss/online_FIRs | 564eeccf045f0a7462e859221c7b2d93b7331c89 | [
"CC0-1.0"
] | null | null | null | """This file is not fully ready, coz, selection act is not going well."""
import base64
from typing import List
from selenium import webdriver
from selenium.webdriver.support.expected_conditions import staleness_of
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import Select
... | 40.843666 | 120 | 0.65591 |
7960e07f1f641057e7f012b2b1ceb25bd238668c | 24,819 | py | Python | src/toil/test/provisioners/aws/awsProvisionerTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 348 | 2018-07-08T03:38:28.000Z | 2022-03-11T18:57:44.000Z | src/toil/test/provisioners/aws/awsProvisionerTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 1,700 | 2018-07-05T18:28:49.000Z | 2022-03-31T14:09:04.000Z | src/toil/test/provisioners/aws/awsProvisionerTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 126 | 2018-07-11T18:59:29.000Z | 2022-01-24T03:14:02.000Z | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... | 39.395238 | 133 | 0.611507 |
79610d09c91a213f40046d045aabfd43d18b7c82 | 60,212 | py | Python | tests/app/template/test_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | tests/app/template/test_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | tests/app/template/test_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | null | null | null | import base64
import json
import random
import string
import uuid
from datetime import datetime, timedelta
import botocore
import pytest
import requests_mock
from freezegun import freeze_time
from notifications_utils import SMS_CHAR_COUNT_LIMIT
from PyPDF2.utils import PdfReadError
from app.dao.templates_dao import (... | 35.586288 | 148 | 0.641483 |
79610fb91754900a03c23b05d094630435cd1269 | 397 | py | Python | Medium/2221 Find Triangular Sum of an Array.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/2221 Find Triangular Sum of an Array.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | Medium/2221 Find Triangular Sum of an Array.py | raj713335/LeetCode | e60e145d90f45d37e148e8307a3d97f5f0741de0 | [
"Apache-2.0"
] | null | null | null | # https://leetcode.com/problems/find-triangular-sum-of-an-array/
class Solution:
def triangularSum(self, nums: List[int]) -> int:
while(len(nums)!=1):
temp_array = []
for i in range(0, len(nums)-1):
temp_array.append((nums[i]+nums[i+1])%10... | 23.352941 | 64 | 0.488665 |
7961df323787e2338dc1436a73c84adbf8d63dae | 1,319 | py | Python | doctor_tests/installer/common/set_congress.py | opnfv/doctor | 72a1f8c92f1692f1ea8dcb5bc706ec9939c30e0a | [
"Apache-2.0"
] | 3 | 2017-04-05T19:09:36.000Z | 2019-02-28T05:27:21.000Z | doctor_tests/installer/common/set_congress.py | opnfv/doctor | 72a1f8c92f1692f1ea8dcb5bc706ec9939c30e0a | [
"Apache-2.0"
] | 2 | 2017-09-20T07:31:39.000Z | 2018-04-09T09:38:45.000Z | doctor_tests/installer/common/set_congress.py | opnfv/doctor | 72a1f8c92f1692f1ea8dcb5bc706ec9939c30e0a | [
"Apache-2.0"
] | 7 | 2017-05-24T02:21:08.000Z | 2019-12-09T16:54:02.000Z | ##############################################################################
# Copyright (c) 2018 ZTE Corporation and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is avail... | 32.975 | 78 | 0.623958 |
7961ea3f212a125d3662c018aeae5214c8754bfb | 13,501 | py | Python | ontobio/io/gpadparser.py | valearna/ontobio | 460915df0beb0d4fbcd414cf4157769b08954857 | [
"BSD-3-Clause"
] | 1 | 2019-08-03T23:48:04.000Z | 2019-08-03T23:48:04.000Z | ontobio/io/gpadparser.py | valearna/ontobio | 460915df0beb0d4fbcd414cf4157769b08954857 | [
"BSD-3-Clause"
] | null | null | null | ontobio/io/gpadparser.py | valearna/ontobio | 460915df0beb0d4fbcd414cf4157769b08954857 | [
"BSD-3-Clause"
] | null | null | null | from ontobio.io import assocparser
from ontobio.io import entityparser
from ontobio.io import entitywriter
from ontobio.io.assocparser import ENTITY, EXTENSION, ANNOTATION, Report
from ontobio.io import qc
from ontobio.model import association
from ontobio.rdfgen import relations
from prefixcommons import curie_util
... | 39.020231 | 148 | 0.605214 |
7961eceeba046356669267d607b6ce57c9df5317 | 4,075 | py | Python | add-comment.py | GregSharpe1/chuck-norris-action | 35a3c96806e917747d549ea54a242fe68fa370ba | [
"MIT"
] | null | null | null | add-comment.py | GregSharpe1/chuck-norris-action | 35a3c96806e917747d549ea54a242fe68fa370ba | [
"MIT"
] | null | null | null | add-comment.py | GregSharpe1/chuck-norris-action | 35a3c96806e917747d549ea54a242fe68fa370ba | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
import requests
import json
import time
import sys
# Used with the ENV vars set within the Github Action.
import os
GITHUB_REPO=os.environ["GITHUB_REPOSITORY"]
GITHUB_TOKEN=os.environ["GITHUB_TOKEN"]
GITHUB_SHA=os.environ["GITHUB_SHA"]
with open(os.environ["GITHUB_EVENT_PATH"]) as json_file:... | 32.862903 | 124 | 0.65816 |
7962082f97323330916826aaffc773e3e353dba6 | 5,228 | py | Python | enhterm/provider/parser/argparser/commands.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/provider/parser/argparser/commands.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | enhterm/provider/parser/argparser/commands.py | pyl1b/enhterm | b4eacc25ef1bdfecab9a662b5269d016070d4e6b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Predefined commands.
"""
import logging
import os
import re
from enhterm.provider.queue_provider import QueueProvider
from enhterm.errors import QuitError
logger = logging.getLogger('et.argparser')
def do_quit(command):
raise QuitError
def do_prefix(command, modifiers, show=False)... | 31.684848 | 99 | 0.622418 |
7962212004dbaccb25e080af4bd1439bc8c82bd4 | 18,788 | py | Python | nova/scheduler/host_manager.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/scheduler/host_manager.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | nova/scheduler/host_manager.py | osrg/nova | 14b6bc655145c832bd9c822e48f877818e0e53ff | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 39.72093 | 79 | 0.616617 |
79622616d37a34a546c4414b5b7b975b7f71afa3 | 491 | py | Python | src/olympia/browse/urls.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 3 | 2020-03-05T18:17:14.000Z | 2020-03-09T01:24:38.000Z | src/olympia/browse/urls.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 6 | 2020-09-28T03:15:57.000Z | 2021-09-28T23:33:19.000Z | src/olympia/browse/urls.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1 | 2020-06-04T10:18:59.000Z | 2020-06-04T10:18:59.000Z | from django.conf.urls import url
from olympia.amo.views import frontend_view
urlpatterns = [
url(r'^language-tools/(?P<category>[^/]+)?$', frontend_view,
name='browse.language-tools'),
url(r'^themes/(?P<category>[^/]+)?$', frontend_view,
name='browse.themes'),
url(r'^extensions/(?:(?P<cat... | 30.6875 | 65 | 0.610998 |
796242e5b1fae3c46368b8b3ddf3bac385b21bef | 2,198 | py | Python | program_synthesis/naps/examples/seq2seq/executor.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 123 | 2018-06-09T00:49:39.000Z | 2022-03-09T05:41:20.000Z | program_synthesis/naps/examples/seq2seq/executor.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 9 | 2018-06-12T01:01:17.000Z | 2022-03-18T09:06:39.000Z | program_synthesis/naps/examples/seq2seq/executor.py | kavigupta/program_synthesis | 0b04b1d3b63954ba3d404a8d96c4da18667a1b02 | [
"Apache-2.0"
] | 24 | 2018-06-09T00:42:46.000Z | 2021-09-29T08:23:32.000Z | import copy
import collections
from program_synthesis.naps import uast
from program_synthesis.naps.uast import lisp_to_uast
from program_synthesis.naps.uast import uast_test_config
ExecutionResult = collections.namedtuple('ExecutionResult', ['result', 'trace'])
class ExecutorSyntaxException(Exception):
pass
... | 30.109589 | 91 | 0.613285 |
7962483e07bbf5e700f612f65246f3ff5e1e7b55 | 10,105 | py | Python | unit_tests/glhe/utilities/test_functions.py | stianchris/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 2 | 2018-11-06T08:04:04.000Z | 2020-10-09T14:52:36.000Z | unit_tests/glhe/utilities/test_functions.py | stianchris/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 68 | 2018-03-27T01:43:22.000Z | 2019-09-09T12:05:44.000Z | unit_tests/glhe/utilities/test_functions.py | mitchute/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 4 | 2018-05-24T03:02:44.000Z | 2021-08-16T13:54:09.000Z | import os
import tempfile
import unittest
from math import cos, sin
from numpy import arange, array
from numpy.linalg import solve as lin_alg_solve
from scipy.interpolate.interpolate import interp1d
from scipy.interpolate.interpolate import interp2d
from glhe.utilities.functions import c_to_k
from glhe.utilities.func... | 32.181529 | 104 | 0.596437 |
79625c0250fe9c8c4b9e8b6ef126bf0500a9b0b8 | 192 | py | Python | predictor/data_structures/enums/graph_type.py | dlasecki/QaoaParamsPredictor | 250b48d36d033adfe3d02a59e3e4a34991834e8f | [
"Apache-2.0"
] | null | null | null | predictor/data_structures/enums/graph_type.py | dlasecki/QaoaParamsPredictor | 250b48d36d033adfe3d02a59e3e4a34991834e8f | [
"Apache-2.0"
] | null | null | null | predictor/data_structures/enums/graph_type.py | dlasecki/QaoaParamsPredictor | 250b48d36d033adfe3d02a59e3e4a34991834e8f | [
"Apache-2.0"
] | 1 | 2021-03-15T21:46:49.000Z | 2021-03-15T21:46:49.000Z | from enum import Enum
class GraphType(Enum):
"""Enum containing possible graph types."""
BARBELL = "barbell"
RANDOM = "erdos_renyi"
LADDER = "ladder"
CAVEMAN = "caveman"
| 19.2 | 47 | 0.651042 |
79625c6080b053380153cdf47d8805064d495444 | 3,753 | py | Python | tetra/fermi.py | tflovorn/tetra | c5a1e1938f8720c9023b45a7a001220a3e06fa1d | [
"MIT"
] | 10 | 2018-03-30T19:56:45.000Z | 2021-12-29T13:53:26.000Z | tetra/fermi.py | tflovorn/tetra | c5a1e1938f8720c9023b45a7a001220a3e06fa1d | [
"MIT"
] | null | null | null | tetra/fermi.py | tflovorn/tetra | c5a1e1938f8720c9023b45a7a001220a3e06fa1d | [
"MIT"
] | 2 | 2018-03-30T19:57:08.000Z | 2022-01-26T22:31:35.000Z | from scipy.optimize import bisect
from tetra.numstates import NumStates
from tetra.ksample import OptimizeGs, MakeEks
from tetra.submesh import MakeSubmesh, MakeTetra
def FindFermiToTol(n0, Efn, R, num_electrons, tol=None, tetras0=None, Eks0=None):
'''Returns the Fermi energy E_F, at which the integrated number of... | 36.436893 | 81 | 0.654676 |
79626e1148f82fc9b84be10ded44d4df7fcc0d35 | 845 | py | Python | korona/templates/html/tags/button.py | bharadwajyarlagadda/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 2 | 2016-10-11T03:57:30.000Z | 2018-01-19T20:13:47.000Z | korona/templates/html/tags/button.py | iskodirajga/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 16 | 2016-08-19T04:08:45.000Z | 2016-09-27T03:26:39.000Z | korona/templates/html/tags/button.py | iskodirajga/korona | ee4662b6a29907495e31ed2581dc5484bb03eadc | [
"MIT"
] | 1 | 2016-10-11T03:57:33.000Z | 2016-10-11T03:57:33.000Z | # -*- coding: utf-8 -*-
"""<button> template"""
from ..environment import env
button = env.from_string("""\
<button {% if name -%} name="{{ name }}" {% endif -%}
{% if type -%} type="{{ type }}" {% endif -%}
{% if value -%} value="{{ value }}" {% endif -%}
{% if form -%} form="{{ form }}" {% e... | 42.25 | 74 | 0.48284 |
79627aa06b9df345e1dd8d097a0c5fbcdf0116b6 | 9,314 | py | Python | test/api/test_dataset_collections.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 4 | 2018-10-29T18:34:38.000Z | 2021-09-29T23:30:42.000Z | test/api/test_dataset_collections.py | tdans1/Use-Galaxy | e9f05cb1b11db20a729ac73520f886ee619c6b90 | [
"CC-BY-3.0"
] | 1 | 2019-02-04T16:21:27.000Z | 2019-02-04T16:45:17.000Z | test/api/test_dataset_collections.py | chambm/galaxy | fd1926767996a161cd2fc8bd184e6835fd688765 | [
"CC-BY-3.0"
] | 3 | 2020-02-12T15:22:24.000Z | 2021-08-19T10:27:39.000Z | import json
import tarfile
from base import api
from base.populators import DatasetCollectionPopulator, DatasetPopulator
from six import StringIO
class DatasetCollectionApiTestCase(api.ApiTestCase):
def setUp(self):
super(DatasetCollectionApiTestCase, self).setUp()
self.dataset_populator = Datas... | 50.075269 | 153 | 0.699163 |
7962bdd56e2d9ef068e7cd6bbb7458028018a4bc | 10,647 | py | Python | workjets/torchnets/RAUnet3D/RAUnet3D.py | geekac/workjets | 0e4bca01e0579aade353aeaeb8e087bb8da2037b | [
"MIT"
] | null | null | null | workjets/torchnets/RAUnet3D/RAUnet3D.py | geekac/workjets | 0e4bca01e0579aade353aeaeb8e087bb8da2037b | [
"MIT"
] | null | null | null | workjets/torchnets/RAUnet3D/RAUnet3D.py | geekac/workjets | 0e4bca01e0579aade353aeaeb8e087bb8da2037b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import torch
import torch.nn as nn
from torch.nn import functional as F
class ResidualBlock(nn.Module):
"""
implemention of Residual Block 残差机制
https://arxiv.org/pdf/1603.05027.pdf
"""
def __init__(self, in_channels=None, out_channels=None):
super(ResidualB... | 39.143382 | 118 | 0.617263 |
7962c225b846daa1c2de51ba3dd07f0ba5561985 | 1,964 | py | Python | src/sdk/pynni/setup.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | 1 | 2019-06-27T16:31:20.000Z | 2019-06-27T16:31:20.000Z | src/sdk/pynni/setup.py | vipulgupta2048/nni | e14476838852357b8ec0cd5161e0445bafb54b25 | [
"MIT"
] | 4 | 2022-02-10T06:23:52.000Z | 2022-03-08T23:37:29.000Z | src/sdk/pynni/setup.py | ZeroInfinite/nni | b07309d9c63919f2fd601c596fda08114a9da0a6 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to u... | 37.769231 | 100 | 0.679226 |
7962d62973f32fb0547daccafe95307a6ad8d269 | 8,850 | py | Python | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 1 | 2019-02-22T14:27:06.000Z | 2019-02-22T14:27:06.000Z | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | 4 | 2015-12-18T10:30:02.000Z | 2015-12-18T10:36:28.000Z | modelscript/metamodels/objects/objects.py | ScribesZone/ModelScribes | a36be1047283f2e470dc2dd4353f2a714377bb7d | [
"MIT"
] | null | null | null | # coding=utf-8
"""Metamodel for object models.
"""
from typing import Dict, Text, Optional, Union, List
from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from modelscript.megamodels.models import Placeholder
# from modelscript.metamodels.classes.classes import Class
from modelscript.metamodel... | 32.777778 | 144 | 0.583164 |
7962f14aa42f5e09ac15735cd2d1116832b5fce4 | 12,310 | py | Python | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | Experiments/Markov_Chain_On_State_Dual_Graphs/north_carolina_analysis/simple_grid_graph.py | Szhang577/Sensitivity_To_Dual_Graph | a52e689422dc5da59437d22e18e7514119a66ee3 | [
"MIT"
] | null | null | null | import math
import random
import tqdm
import copy
import numpy as np
import statistics
import os
import json
from collections import defaultdict
# import matplotlib
# matplotlib.use('Agg')
import matplotlib.pyplot as plt
from functools import partial
import networkx as nx
from gerrychain import MarkovChain, accept
... | 39.329073 | 164 | 0.62169 |
796315b86481fed44761e686be962d486b85a3a8 | 6,897 | py | Python | dacc/__init__.py | i2mint/dacc | 09f8048cf7ad5e21cb0b930ddad3e9ca79896974 | [
"MIT"
] | null | null | null | dacc/__init__.py | i2mint/dacc | 09f8048cf7ad5e21cb0b930ddad3e9ca79896974 | [
"MIT"
] | null | null | null | dacc/__init__.py | i2mint/dacc | 09f8048cf7ad5e21cb0b930ddad3e9ca79896974 | [
"MIT"
] | null | null | null | __author__ = 'thor'
from typing import Iterable
def has_non_callable_attr(obj, attr):
return hasattr(obj, attr) and not hasattr(getattr(obj, attr), '__call__')
def ascertain_list(x):
"""
ascertain_list(x) blah blah returns [x] if x is not already a list, and x itself if it's already a list
Use: Thi... | 43.10625 | 120 | 0.61621 |
79631e1e905f6e6d243cad88a0e1d0c7a75da48f | 1,110 | py | Python | scons/templates/focal_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | scons/templates/focal_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null | scons/templates/focal_options.py | markendr/esys-escript.github.io | 0023eab09cd71f830ab098cb3a468e6139191e8d | [
"Apache-2.0"
] | null | null | null |
##############################################################################
#
# Copyright (c) 2003-2020 by The University of Queensland
# http://www.uq.edu.au
#
# Primary Business: Queensland, Australia
# Licensed under the Apache License, version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Development unt... | 31.714286 | 78 | 0.654054 |
7963733ba02fb5395378bdb025e8ec9f903ccd58 | 10,034 | py | Python | LassyExtraction/mill/nets.py | prednaz/lassy-tlg-extraction | 1fa0e7cc76b4f1c21662c4b0a6b799bfd9df0bf7 | [
"MIT"
] | null | null | null | LassyExtraction/mill/nets.py | prednaz/lassy-tlg-extraction | 1fa0e7cc76b4f1c21662c4b0a6b799bfd9df0bf7 | [
"MIT"
] | null | null | null | LassyExtraction/mill/nets.py | prednaz/lassy-tlg-extraction | 1fa0e7cc76b4f1c21662c4b0a6b799bfd9df0bf7 | [
"MIT"
] | null | null | null | import pdb
from .types import Type, Atom, Functor, Box, Diamond, Proof, T
from typing import NamedTuple
class Leaf(NamedTuple):
atom: Atom
polarity: bool
index: int
def __repr__(self) -> str:
return f'{self.atom}({"+" if self.polarity else "-"},{self.index})'
class Unary(NamedTuple):
p... | 48.240385 | 120 | 0.633446 |
7963898657cd4296621b1066f9bd94e6c2c98d68 | 7,793 | py | Python | sakt/iter_env_sakt_new.py | scaomath/kaggle-riiid-test | 6c99deccc33def7e5d0c982b0a9a19612138e893 | [
"MIT"
] | null | null | null | sakt/iter_env_sakt_new.py | scaomath/kaggle-riiid-test | 6c99deccc33def7e5d0c982b0a9a19612138e893 | [
"MIT"
] | null | null | null | sakt/iter_env_sakt_new.py | scaomath/kaggle-riiid-test | 6c99deccc33def7e5d0c982b0a9a19612138e893 | [
"MIT"
] | null | null | null | #%%
import os
os.environ["CUDA_LAUNCH_BLOCKING"] = "1"
import sys
import psutil
import pandas as pd
import numpy as np
from tqdm import tqdm
import time
from sklearn.metrics import roc_auc_score
import torch
HOME = "/home/scao/Documents/kaggle-riiid-test/"
DATA_DIR = '/home/scao/Documents/kaggle-riiid-test/data/'
MOD... | 41.232804 | 128 | 0.626716 |
79639c4edafcf0b8a869401842069e4656560dd7 | 1,040 | py | Python | setup.py | SUNET/pysmscom | 890cdf3a420e11517e909351d3b2e20c7b045379 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | SUNET/pysmscom | 890cdf3a420e11517e909351d3b2e20c7b045379 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | setup.py | SUNET/pysmscom | 890cdf3a420e11517e909351d3b2e20c7b045379 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import os
from setuptools import setup, find_packages
__author__ = 'leifj'
here = os.path.abspath(os.path.dirname(__file__))
README_fn = os.path.join(here, 'README.rst')
README = 'smscom.se client'
if os.path.exists(README_fn):
README = open(README_fn).read()
version = '0.9'
install_requires = [
'six>=1.11... | 21.22449 | 81 | 0.654808 |
7963c2437c8cdef472031140d9ea3f6609904098 | 7,179 | py | Python | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | 2 | 2021-03-17T18:14:22.000Z | 2021-09-19T13:50:02.000Z | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | src/compas/geometry/_shapes/capsule.py | shervinazadi/compas | a3f5a0dd59247b6b6cdac3f14a45f9ff414f44b3 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from math import cos
from math import pi
from math import sin
from compas.geometry import matrix_from_frame
from compas.geometry import transform_points
from compas.geometry import Frame
from compas.geometry i... | 27.090566 | 80 | 0.492687 |
7963df5c8daac15a5c2eaa6e490a883d4dfc5a2a | 848 | py | Python | angalabiri/users/tests/test_drf_views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 1 | 2021-03-25T14:06:23.000Z | 2021-03-25T14:06:23.000Z | angalabiri/users/tests/test_drf_views.py | dark-codr/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | 5 | 2021-09-08T03:08:46.000Z | 2022-03-12T00:56:35.000Z | angalabiri/users/tests/test_drf_views.py | me-edavids/ebiangala | 0af3de29b2afa71df3e138cd16ecddc69fbd597d | [
"MIT"
] | null | null | null | import pytest
from django.test import RequestFactory
from angalabiri.users.api.views import UserViewSet
from angalabiri.users.models import User
pytestmark = pytest.mark.django_db
class TestUserViewSet:
def test_get_queryset(self, user: User, rf: RequestFactory):
view = UserViewSet()
request = r... | 24.941176 | 67 | 0.626179 |
7963f152b24d093d269dc860309a97cc88d33ef3 | 2,166 | py | Python | test/vanilla/low-level/Expected/AcceptanceTests/RequiredOptionalLowLevel/requiredoptionallowlevel/rest/implicit/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/low-level/Expected/AcceptanceTests/RequiredOptionalLowLevel/requiredoptionallowlevel/rest/implicit/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/low-level/Expected/AcceptanceTests/RequiredOptionalLowLevel/requiredoptionallowlevel/rest/implicit/__init__.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# 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 ... | 57 | 94 | 0.771468 |
79641239d5a650ea929537481aff7e601442626a | 1,747 | py | Python | django_soft_delete/models.py | yucealiosman/soft-delete | 43e437c7fb7428c086721d42a907889f22fc8943 | [
"MIT"
] | null | null | null | django_soft_delete/models.py | yucealiosman/soft-delete | 43e437c7fb7428c086721d42a907889f22fc8943 | [
"MIT"
] | null | null | null | django_soft_delete/models.py | yucealiosman/soft-delete | 43e437c7fb7428c086721d42a907889f22fc8943 | [
"MIT"
] | null | null | null | from django.db import models, router
from .collector import DeleteCollector, UndeleteCollector
from .managers import SoftDeletionManager
class SoftDeletionModel(models.Model):
created_at = models.DateTimeField(auto_now_add=True, null=True, blank=True)
updated_at = models.DateTimeField(auto_now=True, null=Tru... | 32.351852 | 79 | 0.669147 |
79642c66411f548c702f2efe3463604e753ab5f9 | 15,745 | py | Python | experiment.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | experiment.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | null | null | null | experiment.py | Meso272/PyTorch-VAE | b1f80082a92c706969a63162ae083b9f7d15d9aa | [
"Apache-2.0"
] | 1 | 2022-02-11T23:22:41.000Z | 2022-02-11T23:22:41.000Z | import math
import torch
from torch import optim
from models import BaseVAE
from models.types_ import *
from utils import data_loader
import pytorch_lightning as pl
from torchvision import transforms
import torchvision.utils as vutils
from torchvision.datasets import CelebA
from torch.utils.data import DataLoader
from ... | 52.30897 | 297 | 0.543157 |
79642f230ab31df275cacecf33c7ab9b5aefba97 | 4,898 | py | Python | cinder/tests/functional/test_volumes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/functional/test_volumes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/functional/test_volumes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 38.566929 | 79 | 0.665374 |
79643c43b539c7e4556a06e467008edb64569aee | 683 | py | Python | leetcode_python/tests/test_vallid_parentheses.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/tests/test_vallid_parentheses.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | leetcode_python/tests/test_vallid_parentheses.py | attilagyoriid/leetcode_python | 457b1271cf58df8726d3ec35b4ac6d78a33c49a9 | [
"MIT"
] | null | null | null | import unittest
from leetcode_python.src.algorithms.string.vallid_parentheses import ValidParentheses
class TestValidParentheses(unittest.TestCase):
def test_is_valid(self):
parentheses = ValidParentheses()
self.assertTrue(parentheses.is_valid("[({})]"))
def test_is_valid2(self):
pa... | 29.695652 | 85 | 0.692533 |
796447058932f5b6a393a71f54b4b67a545d9974 | 34,420 | py | Python | axolotl/d3m_grpc/server.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | axolotl/d3m_grpc/server.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | axolotl/d3m_grpc/server.py | tods-doc/axolotl | 6fc87bedb514677db09c039d492d1d3c7864913d | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import logging
import os
import pathlib
import time
import warnings
from concurrent import futures
import ray
import os
import uuid
import google.protobuf.timestamp_pb2 as p_timestamp
import grpc
from d3m import utils as d3m_utils, index as d3m_index
from d3m.metadata import problem as prob... | 40.25731 | 133 | 0.657263 |
7964473b130008e3fbac933ba5f33053a9efd538 | 5,466 | py | Python | tests/test_docs/helper.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/test_docs/helper.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/test_docs/helper.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 33.127273 | 86 | 0.647091 |
79648e6ae030410e055f47dae8f06609e1f39759 | 324 | py | Python | src/olympia/tags/admin.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 10 | 2018-08-16T04:55:06.000Z | 2022-01-08T16:09:39.000Z | src/olympia/tags/admin.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 1,398 | 2020-10-08T06:32:26.000Z | 2022-03-31T12:06:24.000Z | src/olympia/tags/admin.py | shashwatsingh/addons-server | 8fce98901104349055a828b5a47865f5e8f4120b | [
"BSD-3-Clause"
] | 12 | 2018-08-01T16:46:09.000Z | 2022-01-08T16:09:46.000Z | from django.contrib import admin
from .models import Tag
class TagAdmin(admin.ModelAdmin):
list_display = ('tag_text', 'popularity', 'created', 'denied')
list_editable = ('denied',)
list_filter = ('denied',)
ordering = ('-created',)
search_fields = ('^tag_text',)
admin.site.register(Tag, TagAdm... | 21.6 | 66 | 0.67284 |
7964c561c2ab4067d15574a931ceb41db9bbfe85 | 12,630 | py | Python | parl/remote/master.py | tanzeyy/PARL | c9be73a87b6618e5a3b2c945327478f365caab74 | [
"Apache-2.0"
] | 1 | 2020-12-24T06:23:08.000Z | 2020-12-24T06:23:08.000Z | parl/remote/master.py | Wangding-han/PARL | b966fa787db2bd8ccfcc8f7afe49e53f633f217c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | parl/remote/master.py | Wangding-han/PARL | b966fa787db2bd8ccfcc8f7afe49e53f633f217c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle 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 app... | 41.27451 | 123 | 0.632225 |
7964cfa3edb7b63a68efb9b6dd0ae4b9c9ca788d | 31,750 | py | Python | Selenium_PhantomJS/source/botocore/parsers.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 1 | 2019-06-27T12:09:44.000Z | 2019-06-27T12:09:44.000Z | Selenium_PhantomJS/source/botocore/parsers.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | null | null | null | Selenium_PhantomJS/source/botocore/parsers.py | Con-Mi/lambda-packs | b23a8464abdd88050b83310e1d0e99c54dac28ab | [
"MIT"
] | 2 | 2016-09-01T21:11:47.000Z | 2018-07-01T01:28:02.000Z | # Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 40.54917 | 81 | 0.602709 |
7964e76c6081d608d1aeb90170636565ff1dc586 | 9,373 | py | Python | configs/mvxnet/actr/dv_mvx-fpn_second_dbsamp_secfpn_adamw_2x8_80e_kitti-3d-3class_actr_pos4_dpe_sum.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/actr/dv_mvx-fpn_second_dbsamp_secfpn_adamw_2x8_80e_kitti-3d-3class_actr_pos4_dpe_sum.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | configs/mvxnet/actr/dv_mvx-fpn_second_dbsamp_secfpn_adamw_2x8_80e_kitti-3d-3class_actr_pos4_dpe_sum.py | rasd3/mmdet3d_actr | d1c86d54f498fca166e957d249b109645ea13627 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/schedules/cosine.py', '../../_base_/default_runtime.py'
]
# model settings
voxel_size = [0.05, 0.05, 0.1]
point_cloud_range = [0, -40, -3, 70.4, 40, 1]
model = dict(
type='DynamicMVXFasterRCNN',
img_backbone=dict(
type='ResNet',
depth=50,
num_stages=4,
... | 33.715827 | 193 | 0.57815 |
796555b1737dcb29782e6de38c567a244df74ca4 | 2,886 | py | Python | trax/rl/__init__.py | yakovkeselman/trax | 615432bbc58ffb5bdf83a771e8f8b470995456db | [
"Apache-2.0"
] | null | null | null | trax/rl/__init__.py | yakovkeselman/trax | 615432bbc58ffb5bdf83a771e8f8b470995456db | [
"Apache-2.0"
] | null | null | null | trax/rl/__init__.py | yakovkeselman/trax | 615432bbc58ffb5bdf83a771e8f8b470995456db | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.48 | 79 | 0.796604 |
796565fe7b5d2c32401a8e047297a9207cade632 | 6,321 | py | Python | starthinker/task/dv_editor/patch.py | danieldjewell/starthinker | 3327d5874f01d7563603b8a82c1ecd6615b9768d | [
"Apache-2.0"
] | 1 | 2020-12-04T17:13:35.000Z | 2020-12-04T17:13:35.000Z | starthinker/task/dv_editor/patch.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"Apache-2.0"
] | null | null | null | starthinker/task/dv_editor/patch.py | hgrias/starthinker | b9ed33e23b4ffd72565a31ebb8a8041d346bfca2 | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 25.487903 | 85 | 0.523335 |
796576a149e0e4b7f10ee0454e9136021496afde | 17,503 | py | Python | hs_core/hydroshare/users.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/hydroshare/users.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/hydroshare/users.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z | import json
import logging
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist, ValidationError
from django.contrib.auth.models import User, Group
from django.contrib.gis.geos import Polygon, Point
from django.core.files import File
from django.core.files.uploadedfile import UploadedFile
from djang... | 36.313278 | 126 | 0.634634 |
7965ab0241100c5f6df7d7d5f4e657109e8dbff3 | 905 | py | Python | sources/ArgumentHandler.py | 0Nom4D/mdCreator | 476fe6c4c0f2d866e573121996cb53d52552cd6d | [
"MIT"
] | 4 | 2021-04-21T12:53:28.000Z | 2021-05-12T08:47:58.000Z | sources/ArgumentHandler.py | 0Nom4D/mdCreator | 476fe6c4c0f2d866e573121996cb53d52552cd6d | [
"MIT"
] | 13 | 2021-04-19T21:55:48.000Z | 2022-02-05T14:26:36.000Z | sources/ArgumentHandler.py | 0Nom4D/mdCreator | 476fe6c4c0f2d866e573121996cb53d52552cd6d | [
"MIT"
] | 2 | 2021-05-12T09:34:59.000Z | 2021-05-17T08:14:58.000Z | #!/usr/bin/env python3
import argparse
def parseArgs(args):
"""
Parses arguments passed to the program.
Parameters
-------
args : list
List of arguments given as parameters
Returns
-------
Class built depending on the arguments.
"""
parser = argparse.ArgumentParser(p... | 36.2 | 148 | 0.668508 |
7965bd0b87d6fd669ab45392353033b7589d5c6b | 7,470 | py | Python | src/virtualenv/create/creator.py | jezdez/virtualenv | 5c9b6246a4107e5e613a23c42b805d0373672400 | [
"MIT"
] | 1 | 2022-02-21T02:01:37.000Z | 2022-02-21T02:01:37.000Z | src/virtualenv/create/creator.py | jezdez/virtualenv | 5c9b6246a4107e5e613a23c42b805d0373672400 | [
"MIT"
] | null | null | null | src/virtualenv/create/creator.py | jezdez/virtualenv | 5c9b6246a4107e5e613a23c42b805d0373672400 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, print_function, unicode_literals
import json
import logging
import os
import shutil
import sys
from abc import ABCMeta, abstractmethod
from argparse import ArgumentTypeError
from ast import literal_eval
from collections import OrderedDict
from stat import S_IWUSR
import six
fro... | 35.913462 | 113 | 0.610442 |
7965d4190cfc8cc49f15ecff994fdd7f271620b7 | 4,132 | py | Python | Old - os.system standard/Archived (Old and backups)/PDFImagesOCR Good backup.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | 2 | 2016-02-04T18:43:12.000Z | 2020-04-03T03:08:32.000Z | Old - os.system standard/Archived (Old and backups)/PDFImagesOCR Good backup.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | 1 | 2016-02-22T18:15:36.000Z | 2016-02-22T18:15:36.000Z | Old - os.system standard/Archived (Old and backups)/PDFImagesOCR Good backup.py | alset333/PDFImagesOCR | ffaf79a3d32cdfabed2ffc57167929bd795f5407 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# PDFImagesOCR.py
import sys
import os
import tempfile
import shutil
__author__ = "Peter Maar"
__version__ = "0.1.0"
################################## PREPARATIONS BEGIN ##########################################
# Print help text if needed
if (len(sys.argv) != 3 and len(sys.argv) != 4) ... | 31.541985 | 156 | 0.632623 |
79660b4ccec81cb775ceb7b7e7f8b9fe3d26de4d | 2,657 | py | Python | reasonerAPI/python-flask-server/openapi_server/models/node_binding.py | codewarrior2000/molecular-data-provider | 820b7db35cf6578f13671caaade2d48811447822 | [
"MIT"
] | null | null | null | reasonerAPI/python-flask-server/openapi_server/models/node_binding.py | codewarrior2000/molecular-data-provider | 820b7db35cf6578f13671caaade2d48811447822 | [
"MIT"
] | null | null | null | reasonerAPI/python-flask-server/openapi_server/models/node_binding.py | codewarrior2000/molecular-data-provider | 820b7db35cf6578f13671caaade2d48811447822 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from openapi_server.models.base_model_ import Model
from openapi_server import util
class NodeBinding(Model):
"""NOTE: This class is auto generated by OpenAPI Gen... | 26.838384 | 96 | 0.587128 |
79660bcceb923f166560e17f345a8bca594f1a78 | 964 | py | Python | dragons/helpers/tools.py | TeamDragons/Dragons-Userbot | e40584f4dc898b785523adea4519ffb412dc92c4 | [
"MIT"
] | 3 | 2021-08-11T08:33:39.000Z | 2022-01-17T00:09:11.000Z | dragons/helpers/tools.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | null | null | null | dragons/helpers/tools.py | sophiashirashaki/Dragons-Userbot | 2255c18428e488a267eaec1ec8c081fabcde167a | [
"MIT"
] | 6 | 2021-08-14T08:20:41.000Z | 2022-03-20T02:31:45.000Z | from html_telegraph_poster import TelegraphPoster
def media_type(message):
if message and message.photo:
return "Photo"
if message and message.audio:
return "Audio"
if message and message.voice:
return "Voice"
if message and message.video_note:
return "Round Video"
... | 27.542857 | 61 | 0.677386 |
79660f932386d729328268095c0b57ab470a2ca8 | 20,201 | py | Python | spineq/data_fetcher.py | alan-turing-institute/spatial-inequality | 13e47817db92c14aaf3b0f3d020305adb821e0b5 | [
"MIT"
] | 5 | 2021-07-14T12:42:32.000Z | 2022-03-02T18:14:48.000Z | spineq/data_fetcher.py | alan-turing-institute/spatial-inequality | 13e47817db92c14aaf3b0f3d020305adb821e0b5 | [
"MIT"
] | 40 | 2020-01-29T14:44:13.000Z | 2022-02-11T16:14:53.000Z | spineq/data_fetcher.py | alan-turing-institute/spatial-inequality | 13e47817db92c14aaf3b0f3d020305adb821e0b5 | [
"MIT"
] | 1 | 2021-03-27T20:26:39.000Z | 2021-03-27T20:26:39.000Z | import os
from io import BytesIO
import zipfile
import time
import warnings
import json
from pathlib import Path
import argparse
import requests
import pandas as pd
import geopandas as gpd
import fiona
DATA_DIR = Path(os.path.dirname(__file__), "../data")
RAW_DIR = Path(DATA_DIR, "raw")
PROCESSED_DIR = Path(DATA_DIR,... | 38.478095 | 254 | 0.701797 |
7966112803d1761820f11f008630abc1d231b929 | 2,352 | py | Python | tests/test_drop_emptier_dups.py | craigshall/chiptools | a3358203a1e1f873c4a3c9a490b57fa847f5bd13 | [
"BSD-3-Clause"
] | null | null | null | tests/test_drop_emptier_dups.py | craigshall/chiptools | a3358203a1e1f873c4a3c9a490b57fa847f5bd13 | [
"BSD-3-Clause"
] | null | null | null | tests/test_drop_emptier_dups.py | craigshall/chiptools | a3358203a1e1f873c4a3c9a490b57fa847f5bd13 | [
"BSD-3-Clause"
] | null | null | null | from chiptools import drop_emptier_dups
import pandas as pd
import numpy as np
from pandas.util.testing import assert_frame_equal
columns = ['A', 'B', 'C']
rows = [[1.0, 2.0, np.NaN], [3.0, np.NaN, 4.0], [np.NaN, 5.0, np.NaN]]
time = '2019-04-02 11:00:00'
def _create_docstring_df():
"""creates the df used in the ... | 38.557377 | 112 | 0.647959 |
79665098b67e74585be1143e77c3cefe1950934a | 10,699 | py | Python | alipay/aop/api/domain/AlipayOpenMiniInnerbaseinfoCreateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniInnerbaseinfoCreateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniInnerbaseinfoCreateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniInnerbaseinfoCreateModel(object):
def __init__(self):
self._app_alias_name = None
self._app_category_ids = None
self._app_desc = None
self._app_engli... | 32.819018 | 85 | 0.596785 |
7966543da7c6a5e626274b076cb315b2cfc32048 | 8,011 | py | Python | gibson2/utils/map_utils.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/utils/map_utils.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | null | null | null | gibson2/utils/map_utils.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | import os
import numpy as np
from tqdm import tqdm
import cv2
from PIL import Image
import sys
from scipy.spatial import ConvexHull
def get_xy_floors(vertices, faces, dist_threshold=-0.98):
z_faces = []
z = np.array([0, 0, 1])
faces_selected = []
for face in tqdm(faces):
normal = np.cross(
... | 37.260465 | 120 | 0.597553 |
79666a95fdb5d7dd6d744789d466a7449908dce0 | 1,870 | py | Python | tools/cubegen.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | tools/cubegen.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | tools/cubegen.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Author: Qiming Sun <osirpt.sun@gmail.com>
#
import numpy
from pyscf import lib
from pyscf.dft import numint, gen_grid
'''
Gaussian cube file format
'''
def density(mol, outfile, dm, nx=80, ny=80, nz=80):
coord = mol.atom_coords()
box = numpy.max(coord,axis=0) - numpy.min(coord,axis=... | 31.694915 | 68 | 0.55615 |
79667301d203d4310319548061494910d6234e97 | 3,121 | py | Python | serve.py | yukosgiti/covid-sanity | cc0685ff4d05fa43e47a3647e1b53bc83a59d9e4 | [
"MIT"
] | 1 | 2020-04-04T06:53:14.000Z | 2020-04-04T06:53:14.000Z | serve.py | doc22940/covid-sanity | 8ce4543c3457174af8ced432f96b8a92fe47c809 | [
"MIT"
] | null | null | null | serve.py | doc22940/covid-sanity | 8ce4543c3457174af8ced432f96b8a92fe47c809 | [
"MIT"
] | null | null | null | """
Simple flask server for the interface
"""
import os
import json
from flask import Flask, request, redirect, url_for
from flask import render_template
# -----------------------------------------------------------------------------
app = Flask(__name__)
# load raw paper data
with open('jall.json', 'r') as f:
... | 32.510417 | 87 | 0.601089 |
7966a80a879dd2d80d2d8de1106ee70686c33f67 | 265 | py | Python | abc/240/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/240/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/240/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
a, b = na()
if a + 1 == b or a == 1 and b == 10:
print("Yes")
else:
print("No") | 18.928571 | 53 | 0.596226 |
7966bacc031c31883fec53a40e5b83ccd321587c | 7,021 | py | Python | notebooks/boost_and_layouts/test_layouts.py | compgeolab/eql-gradient-boosted | 759a0c6f34e92d83551b14c8dfaeae2a8be1e949 | [
"BSD-3-Clause"
] | 17 | 2021-02-25T18:03:14.000Z | 2022-03-28T22:47:37.000Z | notebooks/boost_and_layouts/test_layouts.py | compgeolab/eql-gradient-boosted | 759a0c6f34e92d83551b14c8dfaeae2a8be1e949 | [
"BSD-3-Clause"
] | 24 | 2021-02-25T15:21:40.000Z | 2021-08-25T10:29:33.000Z | notebooks/boost_and_layouts/test_layouts.py | compgeolab/eql-gradient-boosted | 759a0c6f34e92d83551b14c8dfaeae2a8be1e949 | [
"BSD-3-Clause"
] | 4 | 2021-07-27T15:55:05.000Z | 2021-09-17T07:26:42.000Z | """
Test functions for layouts constructors
"""
import pytest
import numpy as np
import numpy.testing as npt
import verde as vd
from .layouts import (
constant_depth,
relative_depth,
variable_depth,
source_below_data,
block_averaged_sources,
grid_sources,
)
@pytest.fixture
def coordinates():
... | 28.425101 | 86 | 0.64535 |
7966bc98eee40d449609f5311431cba50e0906aa | 731 | py | Python | abc/abc250/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/abc250/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/abc250/c/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
import math
from collections import defaultdict, deque, Counter
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
N, Q = na()
A = []
d = defaultdict(int) # d[num] = index
d... | 20.305556 | 53 | 0.567715 |
7966d8d87b0a07a594068e24c6703903b8bc9c29 | 574 | py | Python | models/grid.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | null | null | null | models/grid.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | 4 | 2021-06-08T22:56:00.000Z | 2022-03-12T00:53:10.000Z | models/grid.py | LunaDilangalen/gpu-pathfinding | ba34c44595a6ede0c3c47bc60bb2a34355fc4891 | [
"MIT"
] | null | null | null | class Grid:
def __init__(self, width, height):
self.width = width
self.height = height
self.walls = []
def in_bounds(self, id):
(x, y) = id
return 0 <= x < self.width and 0 <= y < self.height
def passable(self, id):
return id not in self.walls
def neighbor... | 33.764706 | 59 | 0.533101 |
7966eddaf39d38a98acc0ef046b5d41c816a775d | 1,769 | py | Python | lapis/writer.py | movermeyer/lapis | 623a3fc623a7a8fa8c292912b4172787f772f807 | [
"CC0-1.0"
] | 3 | 2015-02-21T05:32:35.000Z | 2017-04-22T21:18:32.000Z | lapis/writer.py | movermeyer/lapis | 623a3fc623a7a8fa8c292912b4172787f772f807 | [
"CC0-1.0"
] | 32 | 2015-02-04T00:52:32.000Z | 2017-03-05T17:17:57.000Z | lapis/writer.py | dandesousa/Lapis | 623a3fc623a7a8fa8c292912b4172787f772f807 | [
"CC0-1.0"
] | 1 | 2018-03-05T17:16:16.000Z | 2018-03-05T17:16:16.000Z | #!/usr/bin/env python
# encoding: utf-8
"""module repsonsible for writing content data to different formats"""
import os
from datetime import datetime
from jinja2 import Environment, FileSystemLoader
from lapis.formats import default_format
TEMPLATES_DIRECTORY = os.path.join(os.path.dirname(__file__), "templates")... | 35.38 | 94 | 0.6987 |
7966fe3ea6ab6cb80ff096b6f464cccbd1de0ce2 | 3,425 | py | Python | homeassistant/components/device_tracker/swisscom.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | homeassistant/components/device_tracker/swisscom.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | homeassistant/components/device_tracker/swisscom.py | 1Forward1Back/home-assistant | ce24ef0c20dea0fd671d6f2c2a8b1456b4b66ba6 | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """
Support for Swisscom routers (Internet-Box).
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.swisscom/
"""
import logging
import threading
from datetime import timedelta
import requests
import voluptuous as vol
import homeassistant.he... | 31.422018 | 77 | 0.628613 |
7966ff0e3ec71eb4e1488f14179e8279435c501d | 2,142 | py | Python | exe0908.py | juniorpedroso/Curso-Intensivo-de-Python | 4357e313660e77f5e43bb516c1b19fd979de5070 | [
"MIT"
] | null | null | null | exe0908.py | juniorpedroso/Curso-Intensivo-de-Python | 4357e313660e77f5e43bb516c1b19fd979de5070 | [
"MIT"
] | null | null | null | exe0908.py | juniorpedroso/Curso-Intensivo-de-Python | 4357e313660e77f5e43bb516c1b19fd979de5070 | [
"MIT"
] | null | null | null | class User():
"""Represent a simple user profile."""
def __init__(self, first_name, last_name, username, email, location):
"""Initialize the user."""
self.first_name = first_name.title()
self.last_name = last_name.title()
self.username = username
self.email = email
... | 29.342466 | 79 | 0.634454 |
796705a39269ed1b0f20406e6d945dd4f5085410 | 6,445 | py | Python | Tools/scons/scons-local/SCons/Tool/dmd.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/dmd.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Tools/scons/scons-local/SCons/Tool/dmd.py | Syeberman/nohtyP | 59d7214a5a5474a03c54f45d79ad4fd037989a79 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | from __future__ import print_function
"""SCons.Tool.dmd
Tool-specific initialization for the Digital Mars D compiler.
(http://digitalmars.com/d)
Originally coded by Andy Friesen (andy@ikagames.com)
15 November 2003
Evolved by Russel Winder (russel@winder.org.uk)
2010-02-07 onwards
Compiler variables:
... | 39.783951 | 138 | 0.674787 |
7967226f917dce58f88ff4848c5941e72fc045d5 | 3,838 | py | Python | examples/plugin_examples/plugin_templates/general/plugin_template5.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | examples/plugin_examples/plugin_templates/general/plugin_template5.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | examples/plugin_examples/plugin_templates/general/plugin_template5.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # Copyright 2014 Diamond Light Source 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-2.0
#
# Unless required by applicable law or agreed t... | 38.38 | 79 | 0.609432 |
7967358666c1871c63f181874c64cb034fe1549b | 6,421 | py | Python | SSTCN-for-SLR/train_parallel.py | Sun1992/T-Pose-model-for-SLR | 301087fd14f1c36c6b922c075269aa398120defa | [
"CC0-1.0"
] | 9 | 2021-03-24T05:10:18.000Z | 2022-01-28T18:00:48.000Z | SSTCN-for-SLR/train_parallel.py | Sun1992/T-Pose-model-for-SLR | 301087fd14f1c36c6b922c075269aa398120defa | [
"CC0-1.0"
] | null | null | null | SSTCN-for-SLR/train_parallel.py | Sun1992/T-Pose-model-for-SLR | 301087fd14f1c36c6b922c075269aa398120defa | [
"CC0-1.0"
] | 1 | 2021-06-09T03:28:22.000Z | 2021-06-09T03:28:22.000Z | import torch
import sys
import numpy as np
import itertools
from SSTCN_Pose_model import *
from load_newfeature import *
from torch.utils.data import DataLoader
from torch.autograd import Variable
import torch.nn.parallel
import argparse
import time
import datetime
if __name__ == "__main__":
parser = argparse.Argu... | 38.680723 | 121 | 0.581218 |
79675a21e6fee85f09b6a8134c826c384c69ba5b | 1,838 | py | Python | ote_sdk/ote_sdk/tests/entities/interfaces/test_graph_interface.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 775 | 2019-03-01T02:13:33.000Z | 2020-09-07T22:49:15.000Z | ote_sdk/ote_sdk/tests/entities/interfaces/test_graph_interface.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 229 | 2019-02-28T21:37:08.000Z | 2020-09-07T15:11:49.000Z | ote_sdk/ote_sdk/tests/entities/interfaces/test_graph_interface.py | ntyukaev/training_extensions | c897d42e50828fea853ceda0795e1f0e7d6e9909 | [
"Apache-2.0"
] | 290 | 2019-02-28T20:32:11.000Z | 2020-09-07T05:51:41.000Z | # Copyright (C) 2021-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
from unittest.mock import patch
import pytest
from ote_sdk.entities.interfaces.graph_interface import IGraph
from ote_sdk.tests.constants.ote_sdk_components import OteSdkComponent
from ote_sdk.tests.constants.requirements import Requi... | 33.418182 | 87 | 0.678455 |
79678f038dbe9b28ae65413d4cdba51bde31b0c8 | 4,039 | py | Python | rod_motion_planning/rod_DiscoPygal/rod_DiscoPygal/gui/RSegment_angle.py | galmw/AlgorithmicRobotics | 1a616a911e74fa965f34075bc2fc683876e1a6be | [
"MIT"
] | null | null | null | rod_motion_planning/rod_DiscoPygal/rod_DiscoPygal/gui/RSegment_angle.py | galmw/AlgorithmicRobotics | 1a616a911e74fa965f34075bc2fc683876e1a6be | [
"MIT"
] | null | null | null | rod_motion_planning/rod_DiscoPygal/rod_DiscoPygal/gui/RSegment_angle.py | galmw/AlgorithmicRobotics | 1a616a911e74fa965f34075bc2fc683876e1a6be | [
"MIT"
] | null | null | null | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (QApplication, QGraphicsView,
QGraphicsPixmapItem, QGraphicsScene, QGraphicsPolygonItem,
QGraphicsEllipseItem, QGraphicsLineItem, QOpenGLWidget)
from PyQt5.QtGui import QPainter, QPixmap, QPo... | 33.658333 | 112 | 0.598663 |
796794fd6419c52fa9352bcc1021e51829703264 | 2,943 | py | Python | sites/lapinkansa.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | null | null | null | sites/lapinkansa.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | 14 | 2016-10-14T15:09:42.000Z | 2017-03-01T14:29:29.000Z | sites/lapinkansa.py | joniok/hybra-medialoader | ebc6df58287b5146917d66de69d807309cea4a8f | [
"MIT"
] | 1 | 2020-11-18T13:06:48.000Z | 2020-11-18T13:06:48.000Z | # -*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
import processor
from datetime import datetime
def parse( url ):
r = requests.get( url )
if r.status_code == 404:
return processor.create_dictionary('', url, r.status_code, [u''], [u''], u'', u'', u'', u'', [u''], [u''])
r.encoding = 'UTF-8'... | 39.24 | 145 | 0.681957 |
79679537b738cae093f93be0d4dc2def0f3013ee | 3,442 | py | Python | tests/func_sim/test_func_sim.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 15 | 2019-05-14T10:12:23.000Z | 2022-03-29T15:29:52.000Z | tests/func_sim/test_func_sim.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 19 | 2020-01-22T21:44:33.000Z | 2021-06-05T02:10:41.000Z | tests/func_sim/test_func_sim.py | sgherbst/msdsl | e38d5ecdb88b3574bda62f22a4f91ce3e4173d12 | [
"MIT"
] | 5 | 2019-10-21T09:53:17.000Z | 2021-08-10T17:32:20.000Z | # general imports
from pathlib import Path
import numpy as np
import importlib
# AHA imports
import magma as m
# msdsl imports
from ..common import *
from msdsl import MixedSignalModel, VerilogGenerator
BUILD_DIR = Path(__file__).resolve().parent / 'build'
DOMAIN = np.pi
RANGE = 1.0
def pytest_generate_tests(metafu... | 27.536 | 95 | 0.639744 |
7967c64ba1f1517d41a6ffb68feda5bc2df46aab | 15,793 | py | Python | armi/physics/thermalHydraulics/parameters.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/physics/thermalHydraulics/parameters.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/physics/thermalHydraulics/parameters.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 TerraPower, 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 writi... | 31.088583 | 129 | 0.569683 |
7967d5deda30b330a5ee231981e0176126d84fcf | 8,402 | py | Python | cornac/models/ncf/recom_gmf.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/ncf/recom_gmf.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | null | null | null | cornac/models/ncf/recom_gmf.py | redhat6/cornac | 856cf0f546a0dc6b46f407128d89ef2534994c60 | [
"Apache-2.0"
] | 1 | 2020-03-19T13:58:33.000Z | 2020-03-19T13:58:33.000Z | # Copyright 2018 The Cornac 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 applicable ... | 38.365297 | 119 | 0.604499 |
7967dd69cf41783781683f25b25c17d1f728c96c | 2,240 | py | Python | tests/test_log.py | barretobrock/easylogger | 68bc54d30494abfd2627a690e46bc226a7bcd3d7 | [
"MIT"
] | null | null | null | tests/test_log.py | barretobrock/easylogger | 68bc54d30494abfd2627a690e46bc226a7bcd3d7 | [
"MIT"
] | null | null | null | tests/test_log.py | barretobrock/easylogger | 68bc54d30494abfd2627a690e46bc226a7bcd3d7 | [
"MIT"
] | null | null | null | import unittest
from easylogger import Log
class TestLogger(unittest.TestCase):
def setUp(self) -> None:
pass
def test_child_log(self):
parent = Log('parent', log_level_str='DEBUG')
# Regular child - should inherit level
child_1 = Log(parent, child_name='child_1')
# Ch... | 32.941176 | 88 | 0.60625 |
7967e22d6a0319a530cb2f00e54872f022ac0095 | 8,463 | py | Python | tensorflow/examples/tutorials/mnist/mnist_with_summaries.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 71 | 2017-05-25T16:02:15.000Z | 2021-06-09T16:08:08.000Z | tensorflow/examples/tutorials/mnist/mnist_with_summaries.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/examples/tutorials/mnist/mnist_with_summaries.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 31 | 2018-09-11T02:17:17.000Z | 2021-12-15T10:33:35.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... | 39.546729 | 80 | 0.675292 |
7968289c048711797481539ac8ceffb604c5b190 | 10,598 | py | Python | roles/models/third_party/auto_augment/policies.py | JMFlin/auto-preference-finder | 07dd2e6b2b28398ca9bfb6ad328c578eb9987417 | [
"MIT"
] | null | null | null | roles/models/third_party/auto_augment/policies.py | JMFlin/auto-preference-finder | 07dd2e6b2b28398ca9bfb6ad328c578eb9987417 | [
"MIT"
] | 7 | 2020-11-13T17:50:07.000Z | 2022-02-10T02:17:14.000Z | roles/models/third_party/auto_augment/policies.py | JMFlin/auto-preference-finder | 07dd2e6b2b28398ca9bfb6ad328c578eb9987417 | [
"MIT"
] | null | null | null | # Copyright 2018 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 ... | 54.348718 | 82 | 0.42725 |
796837c139f9ea2b95720de9ff68aa07a7b83f97 | 26,752 | py | Python | models_search/ViT_custom_local544444_256_rp.py | Pragyanstha/SummerCamp2021 | caa8bba64020ba52bdef2b23a7a54de93e93b8af | [
"MIT"
] | null | null | null | models_search/ViT_custom_local544444_256_rp.py | Pragyanstha/SummerCamp2021 | caa8bba64020ba52bdef2b23a7a54de93e93b8af | [
"MIT"
] | null | null | null | models_search/ViT_custom_local544444_256_rp.py | Pragyanstha/SummerCamp2021 | caa8bba64020ba52bdef2b23a7a54de93e93b8af | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import math
import numpy as np
from models_search.ViT_helper import DropPath, to_2tuple, trunc_normal_
from models_search.diff_aug import DiffAugment
import torch.utils.checkpoint as checkpoint
class matmul(nn.Module):
def __init__(self):
super().__init__()
... | 43.078905 | 185 | 0.553977 |
79684625c2668f28cce52e8800bcdd7962d31cd7 | 13,791 | py | Python | tests/script_tests.py | ankitdobhal/pywikibot | d6328a486296c0e8452b9f5334d5467a2c77ec07 | [
"MIT"
] | null | null | null | tests/script_tests.py | ankitdobhal/pywikibot | d6328a486296c0e8452b9f5334d5467a2c77ec07 | [
"MIT"
] | null | null | null | tests/script_tests.py | ankitdobhal/pywikibot | d6328a486296c0e8452b9f5334d5467a2c77ec07 | [
"MIT"
] | null | null | null | """Test that each script can be compiled and executed."""
#
# (C) Pywikibot team, 2014-2021
#
# Distributed under the terms of the MIT license.
#
import os
import sys
import unittest
from contextlib import suppress
from pywikibot.tools import has_module
from tests import join_root_path, unittest_print
from tests.asp... | 35.635659 | 79 | 0.572257 |
79685bbda302ac4201576893904a9f3f43e16c42 | 20,291 | py | Python | applications/mixed_reality.py | wpeebles/gangealing | 870eab8f1685f62000f98a05d983e2a2ed78e68c | [
"BSD-2-Clause"
] | 605 | 2021-12-10T00:56:58.000Z | 2022-03-31T03:34:08.000Z | applications/mixed_reality.py | wpeebles/gangealing | 870eab8f1685f62000f98a05d983e2a2ed78e68c | [
"BSD-2-Clause"
] | 7 | 2021-12-10T11:40:19.000Z | 2022-03-31T07:05:29.000Z | applications/mixed_reality.py | wpeebles/gangealing | 870eab8f1685f62000f98a05d983e2a2ed78e68c | [
"BSD-2-Clause"
] | 71 | 2021-12-10T01:00:55.000Z | 2022-03-30T04:57:16.000Z | """
This script directly applies our method to video, finding dense correspondences across time in an input video. This works
by applying GANgealing per-frame without using any temporal information.
"""
import torch
import numpy as np
import math
from datasets import img_dataloader
from prepare_data import nchw_center_... | 63.60815 | 175 | 0.643487 |
79686bca5c19af0a2e521f8a3d403f5d245ba1e6 | 1,244 | py | Python | tests/functional/step_defs/test_call_requests.py | barbosa/scanapi | 82def9d7c9ef19a2b658d9aa6c973790e2c16ddc | [
"MIT"
] | null | null | null | tests/functional/step_defs/test_call_requests.py | barbosa/scanapi | 82def9d7c9ef19a2b658d9aa6c973790e2c16ddc | [
"MIT"
] | null | null | null | tests/functional/step_defs/test_call_requests.py | barbosa/scanapi | 82def9d7c9ef19a2b658d9aa6c973790e2c16ddc | [
"MIT"
] | null | null | null | import pytest
from pytest_bdd import scenario, given, when, then
from scanapi.requests_builder import RequestsBuilder
@pytest.fixture(autouse=True)
def mock_request(mocker):
return mocker.patch("scanapi.requests_builder.requests.request")
@pytest.fixture
def api_spec():
return {"api": {"base_url": "", "req... | 24.392157 | 78 | 0.691318 |
79686fc598bd3481c2d0bd6bb52d323a5e04a9cb | 2,125 | py | Python | hint/01-theo-BTC/02_DQN-5-cations/01_map-wise/Miner-Testing-CodeSample-Approach1/build/TestingAgent.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | hint/01-theo-BTC/02_DQN-5-cations/01_map-wise/Miner-Testing-CodeSample-Approach1/build/TestingAgent.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | 1 | 2022-02-10T02:27:10.000Z | 2022-02-10T02:27:10.000Z | hint/01/Miner-Testing-CodeSample-Approach1/build/TestingAgent.py | phunc20/rlcomp2020 | c37f8f05cc86d55fca2648bf5491d6a2218c2cad | [
"MIT"
] | null | null | null | from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
import sys
from keras.models import model_from_json
from MinerEnv import MinerEnv
import numpy as np
ACTION_GO_LEFT = 0
ACTION_GO_RIGHT = 1
ACTION_GO_UP = 2
ACTION_GO_DOWN = 3
ACTION_FREE = 4
ACTION_CRAFT = 5
HOST... | 34.836066 | 119 | 0.646588 |
796883037fda927af12a1ff88e0f9ecb60fb9602 | 10,204 | py | Python | chartesians/graphicsconstants.py | femtotrader/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | 22 | 2017-06-04T21:05:18.000Z | 2022-01-22T19:01:43.000Z | chartesians/graphicsconstants.py | faruto/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | null | null | null | chartesians/graphicsconstants.py | faruto/pythalesians | febdfbabc9f99b0ae3eb0b20ce4c5ed6a34c0bbb | [
"Apache-2.0"
] | 11 | 2016-10-06T21:25:20.000Z | 2020-07-08T19:13:35.000Z | __author__ = 'saeedamen' # Saeed Amen / saeed@thalesians.com
#
# Copyright 2015 Thalesians Ltd. - http//www.thalesians.com / @thalesians
#
# 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://... | 35.929577 | 154 | 0.50098 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.