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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
932237741f0e44327588ced1fc90df550bde09e2 | 6,464 | py | Python | Amplo/Documenting/MultiDocumenting.py | Amplo-GmbH/AutoML | eb6cc83b6e4a3ddc7c3553e9c41d236e8b48c606 | [
"MIT"
] | 5 | 2022-01-07T13:34:37.000Z | 2022-03-17T06:40:28.000Z | Amplo/Documenting/MultiDocumenting.py | Amplo-GmbH/AutoML | eb6cc83b6e4a3ddc7c3553e9c41d236e8b48c606 | [
"MIT"
] | 5 | 2022-03-22T13:42:22.000Z | 2022-03-31T16:20:44.000Z | Amplo/Documenting/MultiDocumenting.py | Amplo-GmbH/AutoML | eb6cc83b6e4a3ddc7c3553e9c41d236e8b48c606 | [
"MIT"
] | 1 | 2021-12-17T22:41:11.000Z | 2021-12-17T22:41:11.000Z | import os
import copy
import numpy as np
from sklearn import metrics
import matplotlib.pyplot as plt
from sklearn.model_selection import StratifiedKFold
from .BinaryDocumenting import BinaryDocumenting
class MultiDocumenting(BinaryDocumenting):
def __init__(self, pipeline):
super().__init__(pipeline)
... | 45.843972 | 120 | 0.571163 |
93224be34749ddf6b2484d22e9132f9451f8859d | 5,311 | py | Python | PN.py/img/tmp/04.PN generalized time domain functions.py | andrzejQ/Polynomial_Numbers.py | 9e3eb52f378383ea8eb22fe3b166fd160ac3dac8 | [
"MIT"
] | null | null | null | PN.py/img/tmp/04.PN generalized time domain functions.py | andrzejQ/Polynomial_Numbers.py | 9e3eb52f378383ea8eb22fe3b166fd160ac3dac8 | [
"MIT"
] | null | null | null | PN.py/img/tmp/04.PN generalized time domain functions.py | andrzejQ/Polynomial_Numbers.py | 9e3eb52f378383ea8eb22fe3b166fd160ac3dac8 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
# place folder `PNlib` near to *.ipynb
from PNlib import PolyNumConf
PolyNumConf.max_N=32 # PN significant digits number (restart jupyter kernel on change)
# In[2]:
from PNlib.PolyNum import PolyNum
get_ipython().run_line_magic('matplotlib', 'inline')
# # Discrete representations of g... | 29.342541 | 268 | 0.568443 |
93229f182439c50950dd2843fbeeb2e1562ca16d | 234 | py | Python | terrascript/resource/hashicorp/hashicups.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/hashicorp/hashicups.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/hashicorp/hashicups.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/hashicorp/hashicups.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:18:02 UTC)
import terrascript
class hashicups_order(terrascript.Resource):
pass
__all__ = [
"hashicups_order",
]
| 18 | 73 | 0.760684 |
9322a30ab19aebb0112385a6b2011614ccf46637 | 2,679 | py | Python | sdk/security/azure-mgmt-security/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/security/azure-mgmt-security/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/security/azure-mgmt-security/setup.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 35.72 | 103 | 0.610302 |
9322a7add8bb4c88a086110c4ff5fd2723a58a8c | 4,520 | py | Python | appium/webdriver/common/touch_action.py | Jonahss/python-client | 6e4ae308f98653966b96294f779a9df061d0d56b | [
"Apache-2.0"
] | 1 | 2019-05-01T11:05:43.000Z | 2019-05-01T11:05:43.000Z | appium/webdriver/common/touch_action.py | zgq346712481/python-client | 1c179d2c84c76bbed33e6333f381cc8a86f3bb82 | [
"Apache-2.0"
] | null | null | null | appium/webdriver/common/touch_action.py | zgq346712481/python-client | 1c179d2c84c76bbed33e6333f381cc8a86f3bb82 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software... | 32.056738 | 146 | 0.62323 |
9322c9da6fddb9979ec9cfbbd2b204a8d9ef0634 | 8,621 | py | Python | elit/components/amr/amr_parser/work.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | 9 | 2021-07-12T22:05:47.000Z | 2022-02-22T03:10:14.000Z | elit/components/amr/amr_parser/work.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | 4 | 2021-08-31T08:28:37.000Z | 2022-03-28T05:52:14.000Z | elit/components/amr/amr_parser/work.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Deng Cai
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, pub... | 41.447115 | 114 | 0.586127 |
9322d53b0497b31eb030f182ce523430b679b8e5 | 4,226 | py | Python | PID/PIDControl.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | PID/PIDControl.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | PID/PIDControl.py | l756302098/ros_practice | 4da8b4ddb25ada2e6f1adb3c0f8b34576aedf6b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import random
import numpy as np
import matplotlib.pyplot as plt
class Robot(object):
def __init__(self, length=20.0):
"""
Creates robotand initializes location/orientation to 0, 0, 0.
"""
self.x = 0.0
self.y = 0.0
self.orientati... | 18.137339 | 85 | 0.628964 |
9322e1547699b798f26f0edacbf1679f0ea0b144 | 7,065 | py | Python | data/make_annotation_from_vertex_labels.py | IvanHahan/MeshCNN | d99b7fc62b632151a7e4c51c9f65c53dbbc91469 | [
"MIT"
] | null | null | null | data/make_annotation_from_vertex_labels.py | IvanHahan/MeshCNN | d99b7fc62b632151a7e4c51c9f65c53dbbc91469 | [
"MIT"
] | 1 | 2021-11-23T11:18:28.000Z | 2021-11-23T11:18:28.000Z | data/make_annotation_from_vertex_labels.py | IvanHahan/MeshCNN | d99b7fc62b632151a7e4c51c9f65c53dbbc91469 | [
"MIT"
] | null | null | null | import numpy as np
import os
import glob
import filecmp
import sys
'''
Creates esseg files for accuracy with smooth transitions between classes
Requires Objects and corresponding labels per edge
Author: Rana Hanocka / Lisa Schneider
@input:
<input_path> path where seg, sseg, train, test folders are placed
@o... | 36.045918 | 132 | 0.591932 |
9322e1fcd79a558ffbe306c50e9231f3fd7ed746 | 16,088 | py | Python | python/ray/rllib/optimizers/async_samples_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 2 | 2019-10-08T13:31:08.000Z | 2019-10-22T18:34:52.000Z | python/ray/rllib/optimizers/async_samples_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 1 | 2018-12-26T01:09:50.000Z | 2018-12-26T01:09:50.000Z | python/ray/rllib/optimizers/async_samples_optimizer.py | cumttang/ray | eb1e5fa2cf26233701ccbda3eb8a301ecd418d8c | [
"Apache-2.0"
] | 6 | 2019-03-12T05:37:35.000Z | 2020-03-09T12:25:17.000Z | """Implements the IMPALA architecture.
https://arxiv.org/abs/1802.01561"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import numpy as np
import random
import time
import threading
from six.moves import queue
import ray
from ray.rllib.... | 37.765258 | 79 | 0.599018 |
93232db55135ba25fd1ba47957e7e08db80d06ea | 4,254 | py | Python | packages/vaex-core/vaex/test/plot.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 337 | 2016-02-11T07:36:35.000Z | 2018-12-10T07:17:35.000Z | packages/vaex-core/vaex/test/plot.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 127 | 2016-07-06T15:43:14.000Z | 2018-12-11T18:46:27.000Z | packages/vaex-core/vaex/test/plot.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 29 | 2016-10-05T14:15:28.000Z | 2018-11-29T10:17:00.000Z | __author__ = 'maartenbreddels'
import unittest
import os
import tempfile
import logging
import shutil
import numpy as np
import PIL.Image
import PIL.ImageChops
import matplotlib.pyplot as plt
import vaex as vx
import vaex.utils
try:
raw_input = input
except:
pass # py2/3 fix
base_path = os.path.dirname(__file__)
... | 30.604317 | 131 | 0.665491 |
932346eaf68b957fbe4239914fcd42983a6d786b | 3,138 | py | Python | tests/victorops/test_plugin.py | pawelkoston/sentry-plugins | 03cd2d4ccabdd5be1a1983730d0f3fff79e28444 | [
"Apache-2.0"
] | null | null | null | tests/victorops/test_plugin.py | pawelkoston/sentry-plugins | 03cd2d4ccabdd5be1a1983730d0f3fff79e28444 | [
"Apache-2.0"
] | null | null | null | tests/victorops/test_plugin.py | pawelkoston/sentry-plugins | 03cd2d4ccabdd5be1a1983730d0f3fff79e28444 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import responses
from exam import fixture
from sentry.models import Rule
from sentry.plugins import Notification
from sentry.testutils import PluginTestCase
from sentry.utils import json
from sentry_plugins.victorops.plugin import VictorOpsPlugin
SUCCESS = """{
"result":"suc... | 35.258427 | 236 | 0.652964 |
9323565e08be441a1e655ac961fc5fe9f3360fab | 444 | py | Python | topo/sparse/__init__.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | null | null | null | topo/sparse/__init__.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | null | null | null | topo/sparse/__init__.py | ceball/topographica | ec0eea614409ceb7473e04bc2f6b6c888099160f | [
"BSD-3-Clause"
] | null | null | null | import os
(basepath, _) = os.path.split(os.path.abspath(__file__))
try:
from distutils.core import run_setup
# Run the setup script in the sandbox, so that it doesn't complain about unknown args when launched through nose
run_setup(basepath + "/compile.py")
from topo.sparse import sparse # pyflakes:... | 31.714286 | 116 | 0.745495 |
93236c8a69192310df2d2225f5d5520922bfcc50 | 4,908 | py | Python | ht/__init__.py | CalebBell/ht | 3b95f9cfff30c8c0272443d523a484977eedbf0d | [
"MIT"
] | 118 | 2016-01-04T07:46:23.000Z | 2022-03-29T14:12:59.000Z | ht/__init__.py | CalebBell/ht | 3b95f9cfff30c8c0272443d523a484977eedbf0d | [
"MIT"
] | 4 | 2017-06-27T08:01:02.000Z | 2020-10-06T14:18:46.000Z | ht/__init__.py | CalebBell/ht | 3b95f9cfff30c8c0272443d523a484977eedbf0d | [
"MIT"
] | 22 | 2016-04-20T06:17:35.000Z | 2022-03-07T01:40:25.000Z | # -*- coding: utf-8 -*-
'''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation fi... | 38.952381 | 91 | 0.708639 |
93237fd2cdf8ee25a39c4d36f2fe02e8091382c6 | 39,632 | py | Python | qiskit_dynamics/signals/signals.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | 1 | 2022-01-21T01:47:40.000Z | 2022-01-21T01:47:40.000Z | qiskit_dynamics/signals/signals.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | null | null | null | qiskit_dynamics/signals/signals.py | haggaila/qiskit-dynamics | fd20314e2b591c35323782bc429d9f928fdb9a12 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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 modif... | 34.492602 | 100 | 0.588868 |
93239d48fca0ef0c0fa24722ceae38a3fcea63e2 | 250 | py | Python | mudpi/extensions/rtsp/__init__.py | icyspace/mudpi-core | d2afffacee0ba5c5ca57eada3017495d8697c5a4 | [
"BSD-4-Clause"
] | 163 | 2020-02-17T16:34:54.000Z | 2022-02-28T23:12:11.000Z | mudpi/extensions/rtsp/__init__.py | icyspace/mudpi-core | d2afffacee0ba5c5ca57eada3017495d8697c5a4 | [
"BSD-4-Clause"
] | 28 | 2020-05-05T19:42:25.000Z | 2021-08-04T18:36:32.000Z | mudpi/extensions/rtsp/__init__.py | icyspace/mudpi-core | d2afffacee0ba5c5ca57eada3017495d8697c5a4 | [
"BSD-4-Clause"
] | 31 | 2020-02-27T18:30:42.000Z | 2022-01-18T21:14:56.000Z | """
RTSP Camera Extension
Connects to a RTSP or HTTP camera
stream to capture images and record
videos.
"""
from mudpi.extensions import BaseExtension
class Extension(BaseExtension):
namespace = 'rtsp'
update_interval = 1
| 19.230769 | 42 | 0.704 |
9323ad2746bae81655af8a3a617e3e1a9d65558e | 89 | py | Python | lewis_emulators/tti355/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/tti355/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/tti355/interfaces/__init__.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | from .stream_interface import Tti355StreamInterface
__all__ = ['Tti355StreamInterface']
| 22.25 | 51 | 0.842697 |
9323b42ad99104d0b365d5ec803c16779c145fdc | 7,175 | py | Python | spvcm/tests/test_diagnostics.py | ljwolf/spvcm | 991341c6ee821f4487fcc15d39d0b97ce836a4e3 | [
"MIT"
] | 14 | 2017-06-20T18:39:04.000Z | 2021-03-27T02:21:46.000Z | spvcm/tests/test_diagnostics.py | gisdevelope/spvcm | 991341c6ee821f4487fcc15d39d0b97ce836a4e3 | [
"MIT"
] | null | null | null | spvcm/tests/test_diagnostics.py | gisdevelope/spvcm | 991341c6ee821f4487fcc15d39d0b97ce836a4e3 | [
"MIT"
] | 5 | 2018-02-17T14:51:25.000Z | 2021-07-13T20:24:46.000Z | import unittest as ut
import numpy as np
from spvcm.utils import south
from spvcm.diagnostics import psrf, geweke, effective_size, hpd_interval, summarize, mcse
from spvcm._constants import RTOL, ATOL, TEST_SEED
from spvcm.abstracts import Trace, Hashmap
import os
import json
FULL_PATH = os.path.dirname(os.path.abspath... | 47.833333 | 111 | 0.601254 |
9323be9cb7875fd17900024118f4bf8e27337b58 | 1,266 | py | Python | python/src/aoc/year2015/day12.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | 1 | 2021-02-16T21:30:04.000Z | 2021-02-16T21:30:04.000Z | python/src/aoc/year2015/day12.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | python/src/aoc/year2015/day12.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | import json
from aoc.util import load_input
def traverse(node, ignore_red):
if isinstance(node, dict):
if ignore_red and "red" in node.values():
return 0
# keys are never numeric
return sum(traverse(value, ignore_red) for value in node.values())
elif isinstance(node, list)... | 20.419355 | 74 | 0.488942 |
9323d3e5f66f4d4d93eb009975a916a9406ff59e | 2,023 | py | Python | troveclient/v1/volume_types.py | hrnciar/python-troveclient | e41d08d24325a61a213592934b508bf77ce67dac | [
"Apache-2.0"
] | 46 | 2015-01-14T12:26:24.000Z | 2021-01-05T12:54:03.000Z | troveclient/v1/volume_types.py | Tesora-Release/tesora-python-troveclient | fb1caf89b52a4ae3bcf2a71cbf9f6d8aa76b29c1 | [
"Apache-2.0"
] | 3 | 2015-05-22T19:58:11.000Z | 2021-04-30T06:12:21.000Z | troveclient/v1/volume_types.py | Tesora-Release/tesora-python-troveclient | fb1caf89b52a4ae3bcf2a71cbf9f6d8aa76b29c1 | [
"Apache-2.0"
] | 34 | 2015-01-21T12:33:53.000Z | 2021-10-13T00:29:35.000Z | # Copyright 2016 Tesora, 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 ... | 34.87931 | 78 | 0.625309 |
9323dc7f5c58af0ff39f680e1f00f7fb08a2576e | 99 | py | Python | stests/core/logging/__init__.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 4 | 2020-03-10T15:28:17.000Z | 2021-10-02T11:41:17.000Z | stests/core/logging/__init__.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 1 | 2020-03-25T11:31:44.000Z | 2020-03-25T11:31:44.000Z | stests/core/logging/__init__.py | goral09/stests | 4de26485535cadf1b708188a7133a976536ccba3 | [
"Apache-2.0"
] | 9 | 2020-02-25T18:43:42.000Z | 2021-08-10T17:08:42.000Z | from stests.core.logging.logger import log_event
from stests.core.logging.logger import initialise
| 33 | 49 | 0.858586 |
9323eeaab14ffca819b8b992acba630a4e5f88bf | 7,812 | py | Python | cdp_scrapers/tests/scraper_tests.py | AZIZXlaouiti/cdp-scrapers | 4b23cb45c5b2c3a3914494ef39e3e604e893d954 | [
"MIT"
] | null | null | null | cdp_scrapers/tests/scraper_tests.py | AZIZXlaouiti/cdp-scrapers | 4b23cb45c5b2c3a3914494ef39e3e604e893d954 | [
"MIT"
] | null | null | null | cdp_scrapers/tests/scraper_tests.py | AZIZXlaouiti/cdp-scrapers | 4b23cb45c5b2c3a3914494ef39e3e604e893d954 | [
"MIT"
] | null | null | null | from datetime import datetime
import pytest
from cdp_scrapers.instances.kingcounty import KingCountyScraper
from cdp_scrapers.instances.portland import PortlandScraper
from cdp_scrapers.instances.seattle import SeattleScraper
@pytest.mark.parametrize(
"start_date_time, end_date_time, number_of_events,"
"num... | 31.62753 | 87 | 0.59191 |
93241610de5ee68ebb699802552b05f5e44eb4fb | 2,034 | py | Python | tests/test_spatial_pad.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"Apache-2.0"
] | 1 | 2021-07-13T00:34:41.000Z | 2021-07-13T00:34:41.000Z | tests/test_spatial_pad.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"Apache-2.0"
] | null | null | null | tests/test_spatial_pad.py | albarqounilab/MONAI | bb0b307d68021a243011a58fd82a1d275f00a51a | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 - 2021 MONAI Consortium
# 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... | 35.068966 | 105 | 0.657817 |
932433acfb38ddb79253a90a72f01325f63042d0 | 2,052 | py | Python | pbc/gto/pseudo/__init__.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | pbc/gto/pseudo/__init__.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | pbc/gto/pseudo/__init__.py | gmwang18/pyscf | fcd6877751661c8a9743c1c872a4a2b65f6dd7ac | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8
# Author: Qiming Sun <osirpt.sun@gmail.com>
# Timothy Berkelbach <tim.berkelbach@gmail.com>
import os
from pyscf.pbc.gto.pseudo import parse_cp2k
from pyscf.pbc.gto.pseudo.pp import *
from pyscf.pbc.gto.pseudo import pp_int
ALIAS = {
'gthblyp' : 'gth-blyp.dat' ... | 29.73913 | 89 | 0.587719 |
93243b946bff37bf52ed91ca9a1a9fa3c52a1004 | 2,886 | py | Python | test/representation/text_representation_test.py | lantuzi/Joint-Text-and-Image-Representation | 906d490f2795fdd1dd76abb70d658b49bf68f8bd | [
"MIT"
] | null | null | null | test/representation/text_representation_test.py | lantuzi/Joint-Text-and-Image-Representation | 906d490f2795fdd1dd76abb70d658b49bf68f8bd | [
"MIT"
] | null | null | null | test/representation/text_representation_test.py | lantuzi/Joint-Text-and-Image-Representation | 906d490f2795fdd1dd76abb70d658b49bf68f8bd | [
"MIT"
] | null | null | null | #####################################################################################
# MIT License #
# #
# Copyright (C) 2019 Charly Lamothe, Guillaume Ollier, Bal... | 55.5 | 95 | 0.509702 |
932484d7953b85b02fcdc7a69f9fd9d269b79eac | 4,053 | py | Python | flappy-brird/utils/bird.py | victorathanasio/Personal-projects | 94c870179cec32aa733a612a6faeb047df16d977 | [
"MIT"
] | null | null | null | flappy-brird/utils/bird.py | victorathanasio/Personal-projects | 94c870179cec32aa733a612a6faeb047df16d977 | [
"MIT"
] | null | null | null | flappy-brird/utils/bird.py | victorathanasio/Personal-projects | 94c870179cec32aa733a612a6faeb047df16d977 | [
"MIT"
] | null | null | null | import pygame
import os
VEL_JUMP = -23
G = 98 * 1.5
MAX_D = 16
X0 = 200
Y0 = 200
class Bird:
def __init__(self, theme='Theme_mvp'):
"""
Method that initiates the object Bird using pre-established specifications
"""
path = os.path.join("Assets/", theme)
path1 = os.p... | 27.951724 | 99 | 0.492721 |
9324a6c566bbe5511bd7f366e94e85f3462e06c6 | 10,282 | py | Python | dataloader/definitions/labels_file.py | VladimirYugay/SGDepth | ed68e05431ad0131658ee76b8c50142979f859a5 | [
"MIT"
] | null | null | null | dataloader/definitions/labels_file.py | VladimirYugay/SGDepth | ed68e05431ad0131658ee76b8c50142979f859a5 | [
"MIT"
] | null | null | null | dataloader/definitions/labels_file.py | VladimirYugay/SGDepth | ed68e05431ad0131658ee76b8c50142979f859a5 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Marvin Klingner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | 60.128655 | 138 | 0.477436 |
9324e76394468257040d6c5eafef040ae316999d | 2,109 | py | Python | solutions_automation/dashboard_solutions/ubuntu.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 13 | 2020-09-02T09:05:08.000Z | 2022-03-12T02:43:24.000Z | solutions_automation/dashboard_solutions/ubuntu.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 1,998 | 2020-06-15T11:46:10.000Z | 2022-03-24T22:12:41.000Z | solutions_automation/dashboard_solutions/ubuntu.py | threefoldtech/js-sdk | 811f783ac34a60225175bab2d806802a87b9d5c7 | [
"Apache-2.0"
] | 8 | 2020-09-29T06:50:35.000Z | 2021-06-14T03:30:52.000Z | from jumpscale.packages.tfgrid_solutions.chats.ubuntu import UbuntuDeploy
from solutions_automation.utils.gedispatch import GedisChatBotPatch
class UbuntuAutomated(GedisChatBotPatch, UbuntuDeploy):
NAME_MESSAGE = "Please enter a name for your workload (Can be used to prepare domain for you and needed to track you... | 43.9375 | 144 | 0.667615 |
9324e93d72abc994cf1642c628db006e67a3e6a0 | 1,968 | py | Python | WQ_tools/dwaqFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | WQ_tools/dwaqFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | WQ_tools/dwaqFunctions.py | lkschn/WQ_tools | 15c9a290794f00dc2b10b7b261a744bb11cdb9cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 11 10:20:49 2022
@author: schne_la
"""
# =============================================================================
# load packages
# =============================================================================
from netCDF4 import Dataset, num2date #, num2date #, da... | 27.333333 | 96 | 0.519817 |
9324e98ee5a0c3de9fb084ad353782c62f4acc18 | 1,001 | py | Python | insomniac/device.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | insomniac/device.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | insomniac/device.py | edukessen/Insomniac | 44334aa5991c506282f5a5e6432d602774569eae | [
"MIT"
] | null | null | null | from insomniac.device_facade import create_device
from insomniac.typewriter import Typewriter
from insomniac.utils import *
class DeviceWrapper(object):
device = None
def __init__(self, device_id, old_uiautomator, wait_for_device, app_id, dont_set_typewriter):
self.device_id = device_id
self.... | 29.441176 | 97 | 0.706294 |
9324efa85b573d8c9d2fe206603a4fbeeec11944 | 2,010 | py | Python | tests/elec_tweets/elec_tweets.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | tests/elec_tweets/elec_tweets.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | 2 | 2021-07-28T10:38:03.000Z | 2021-07-31T10:37:09.000Z | tests/elec_tweets/elec_tweets.py | Thanatoz-1/EmotionStimuli | f7774cf77ec2a66949949905ed70d62117179666 | [
"BSD-3-Clause"
] | null | null | null | __author__ = "Maximilian Wegge"
from emotion.utils import Data, Dataset
from emotion import HMM
from emotion.evaluation import Evaluation
# read Data from file, only gne, all labels
elec_all = Data(
filename="data/rectified-unified-with-offsets.json",
roles=["experiencer", "target", "cue", "cause"],
corp... | 36.545455 | 88 | 0.788557 |
9324f7c43be78df55e3445a01c6de190939e2151 | 1,051 | py | Python | var/spack/repos/builtin/packages/r-crayon/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/r-crayon/package.py | BenWibking/spack | 49b3b43a4a9375210b578635d9240875a5f3106b | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/r-crayon/package.py | joequant/spack | e028ee0d5903045e1cdeb57550cbff61f2ffb2fa | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RCrayon(RPackage):
"""Colored terminal output on terminals that support 'ANSI' color and
... | 45.695652 | 95 | 0.769743 |
93250786fb05b0f4f96bb0426efe1964ec001a3a | 1,580 | py | Python | cuor/harvester/wikidata/Controllers/subclass.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | cuor/harvester/wikidata/Controllers/subclass.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | cuor/harvester/wikidata/Controllers/subclass.py | tocororo/cuor | 0202970f19b927562f34eb4367ea4f91e08e6706 | [
"MIT"
] | null | null | null | from cuor.harvester.wikidata.Class.subclass import Subclass
from cuor.harvester.wikidata.Database.cursorPool import CursorPool
from cuor.harvester.wikidata.logger_base import logger
class Subclass:
'''
DAO (Data Access Object)
CRUD: Create-Read-Update-Delete entidad subClass
'''
__SELECT = 'SELECT... | 33.617021 | 73 | 0.64557 |
93254183eb6ec229e44b12d2ec2f5ed1e0920200 | 5,676 | py | Python | src/app.py | ubco-mds-2021-labs/dashboard1-group-f | 9de5ffc12974ff0f2f1b0585e3c81410578ed41d | [
"MIT"
] | 4 | 2022-02-16T22:30:24.000Z | 2022-02-17T01:24:46.000Z | src/app.py | ubco-mds-2021-labs/dashboard1-group-f | 9de5ffc12974ff0f2f1b0585e3c81410578ed41d | [
"MIT"
] | 26 | 2022-02-16T23:02:02.000Z | 2022-03-25T20:12:36.000Z | src/app.py | ubco-mds-2021-labs/dashboard1-group-f | 9de5ffc12974ff0f2f1b0585e3c81410578ed41d | [
"MIT"
] | 1 | 2022-03-11T01:54:37.000Z | 2022-03-11T01:54:37.000Z | from dash import Dash, dcc, html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
import pandas as pd
import numpy as np
from src.SideBar import sidebar
import src.SummaryTab as SummaryTab
import src.CountTab as CountTab
import src.TimesTab as TimesTab
# Load data
# Data for first ... | 30.681081 | 119 | 0.672304 |
93255d321b5e71fae046341878b365841698557e | 6,178 | py | Python | exercises/P4Runtime_test/my_controller.py | joaofelicio98/tutorials | dfc2074c67cc1e95d4800a280fda2ea6e092fa03 | [
"Apache-2.0"
] | null | null | null | exercises/P4Runtime_test/my_controller.py | joaofelicio98/tutorials | dfc2074c67cc1e95d4800a280fda2ea6e092fa03 | [
"Apache-2.0"
] | null | null | null | exercises/P4Runtime_test/my_controller.py | joaofelicio98/tutorials | dfc2074c67cc1e95d4800a280fda2ea6e092fa03 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
import argparse
import grpc
import os
import sys
from time import sleep
# Import P4Runtime lib from parent utils dir
# Probably there's a better way of doing this.
sys.path.append(
os.path.join(os.path.dirname(os.path.abspath(__file__)),
'../../utils/'))
import p4runtime_lib... | 40.379085 | 163 | 0.632729 |
93258abe25ba31f163c3dbc4052923c350aeaf74 | 125 | py | Python | bs/loader.py | chasinglogic/bs | ea91630d9050e261e8f3f3f29c0c5af43725bc6e | [
"Apache-2.0"
] | 1 | 2020-02-13T17:46:51.000Z | 2020-02-13T17:46:51.000Z | bs/loader.py | chasinglogic/bs | ea91630d9050e261e8f3f3f29c0c5af43725bc6e | [
"Apache-2.0"
] | null | null | null | bs/loader.py | chasinglogic/bs | ea91630d9050e261e8f3f3f29c0c5af43725bc6e | [
"Apache-2.0"
] | null | null | null | """Script loader for BS."""
class Loader:
"""Loads and verifies build definitions and turns them into build states."""
| 20.833333 | 80 | 0.696 |
93258e78c71c9985ed4fc7e5eee1941f7078070e | 2,243 | py | Python | Analytics/db_setup.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 4 | 2018-11-21T14:42:18.000Z | 2020-05-11T10:52:59.000Z | Analytics/db_setup.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 60 | 2018-11-21T15:11:59.000Z | 2019-12-02T10:46:44.000Z | Analytics/db_setup.py | thanosbnt/SharingCitiesDashboard | 5d123691d1f25d0b85e20e4e8293266bf23c9f8a | [
"Apache-2.0"
] | 7 | 2018-11-21T14:42:44.000Z | 2019-11-28T16:24:14.000Z | # Using Model classes to add data to tables
import logging
from flask import Flask
from app import create_app
from models.theme import Theme, SubTheme
from models.unit import Unit
logging.basicConfig(level='INFO')
logger = logging.getLogger(__name__)
def create_unit(symbol: str = 'kg', description: str = 'Kilogram... | 27.024096 | 98 | 0.665626 |
9325b19f47fb2c0e39d930f6db6174c7403837d6 | 7,276 | py | Python | recognition/arcface_torch/partial_fc.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 18 | 2018-04-13T02:55:03.000Z | 2020-10-12T01:37:52.000Z | recognition/arcface_torch/partial_fc.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 1 | 2019-05-08T01:58:46.000Z | 2019-05-08T01:58:46.000Z | recognition/arcface_torch/partial_fc.py | dwhite54/insightface | ea172e4921c3960c0684404afff6d0d862447eae | [
"MIT"
] | 7 | 2018-08-29T06:41:19.000Z | 2019-09-11T06:10:39.000Z | import logging
import os
import torch
import torch.distributed as dist
from torch.nn import Module
from torch.nn.functional import normalize, linear
from torch.nn.parameter import Parameter
class PartialFC(Module):
"""
Author: {Xiang An, Yang Xiao, XuHan Zhu} in DeepGlint,
Partial FC: Training 10 Million... | 44.91358 | 110 | 0.637438 |
9325b2504cb6bbe5306f936cc7eb76ffbdc1646b | 11,241 | py | Python | var/spack/repos/builtin/packages/py-torch/package.py | lguyot/spack | e910c227a7bac3adf2c18fc86cf994811b7d14f7 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2020-10-15T01:08:42.000Z | 2021-10-18T01:28:18.000Z | var/spack/repos/builtin/packages/py-torch/package.py | lguyot/spack | e910c227a7bac3adf2c18fc86cf994811b7d14f7 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 2 | 2019-07-30T10:12:28.000Z | 2019-12-17T09:02:27.000Z | var/spack/repos/builtin/packages/py-torch/package.py | lguyot/spack | e910c227a7bac3adf2c18fc86cf994811b7d14f7 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 5 | 2019-07-30T09:42:14.000Z | 2021-01-25T05:39:20.000Z | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyTorch(PythonPackage):
"""Tensors and Dynamic neural networks in Python
with strong G... | 46.643154 | 106 | 0.630994 |
9325d7cc20b1390228cb766f77cd2561e45f7602 | 5,284 | py | Python | method/read.py | jingslaw/ab-crystal-library | aa60bbc79b3f1fb023dbf1cf9e6dac4517a5feaf | [
"MIT"
] | 9 | 2019-04-20T15:41:27.000Z | 2021-12-31T13:19:59.000Z | method/read.py | jingslaw/ab-crystal-library | aa60bbc79b3f1fb023dbf1cf9e6dac4517a5feaf | [
"MIT"
] | null | null | null | method/read.py | jingslaw/ab-crystal-library | aa60bbc79b3f1fb023dbf1cf9e6dac4517a5feaf | [
"MIT"
] | null | null | null | ###############################
# This file is part of PyLaDa.
#
# Copyright (C) 2013 National Renewable Energy Lab
#
# PyLaDa is a high throughput computational platform for Physics. It aims to make it easier to submit
# large numbers of jobs on supercomputers. It provides a python interface to physical input, suc... | 42.272 | 103 | 0.584595 |
93261b21072ad58a3f08c897129f4342411555e6 | 868 | py | Python | sunpy/time/utime.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/time/utime.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | sunpy/time/utime.py | Naman9639/sunpy | 24c0cfbd9b03d7f9554bc86036fac2b78a5fcc56 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from astropy.time.formats import erfa, TimeFromEpoch
__all__ = ['TimeUTime']
class TimeUTime(TimeFromEpoch):
"""
Seconds from 1979-01-01 00:00:00 UTC. Same as Unix time
but this starts 9 years later.
This time format is included for historical reasons. Some
... | 27.125 | 64 | 0.647465 |
93261b63f27abb0808574cec3d15dbd96f0e7868 | 952 | py | Python | python/array/0697_degree_of_an_array.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 6 | 2019-07-15T13:23:57.000Z | 2020-01-22T03:12:01.000Z | python/array/0697_degree_of_an_array.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | null | null | null | python/array/0697_degree_of_an_array.py | linshaoyong/leetcode | ea052fad68a2fe0cbfa5469398508ec2b776654f | [
"MIT"
] | 1 | 2019-07-24T02:15:31.000Z | 2019-07-24T02:15:31.000Z | class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
d = {}
for i in range(len(nums)):
a, b, c = d.get(nums[i], (0, 0, 0))
a = a + 1
if a == 1:
b = i
els... | 28 | 71 | 0.396008 |
9326329a633881db2abbe4325e00371810503bcd | 8,591 | py | Python | st2common/st2common/bootstrap/base.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | st2common/st2common/bootstrap/base.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | st2common/st2common/bootstrap/base.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 38.873303 | 99 | 0.669189 |
93263c773d9902de249ddd41a33f2e3d376e3400 | 5,108 | py | Python | tests/datasets/test_processors.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | 2 | 2021-02-22T12:15:42.000Z | 2021-05-02T15:22:24.000Z | tests/datasets/test_processors.py | kmarathe10/mmf | 93cd2a7f333ad14e88fa6c2453a0f54b64b36210 | [
"BSD-3-Clause"
] | 7 | 2021-03-01T21:16:26.000Z | 2022-02-27T07:07:11.000Z | tests/datasets/test_processors.py | krantirk/MMF | 2e4acaad7ca8eee4319e1205a560eed81733a0be | [
"BSD-3-Clause"
] | 1 | 2022-03-04T14:19:43.000Z | 2022-03-04T14:19:43.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
import os
import unittest
import torch
from mmf.datasets.processors.processors import (
CaptionProcessor,
EvalAIAnswerProcessor,
MultiHotAnswerFromVocabProcessor,
)
from mmf.utils.configuration import load_yaml
from ..test_utils import compare_tensors
... | 38.69697 | 86 | 0.655247 |
93265b6b24f1801bb10ac98c2e398e57ee28df2f | 941 | py | Python | agent/indy_catalyst_agent/messaging/proofs/messages/proof.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/proofs/messages/proof.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | agent/indy_catalyst_agent/messaging/proofs/messages/proof.py | TelegramSam/indy-catalyst | 476f5a773d90d8b50960b49e63b823bd13325d4a | [
"Apache-2.0"
] | null | null | null | """
A proof content message.
"""
from marshmallow import Schema, fields, post_load
from ...agent_message import AgentMessage
from ...message_types import MessageTypes
class Proof(AgentMessage):
def __init__(self, proof_json: str, request_nonce: str):
self.proof_json = proof_json
self.request_non... | 24.128205 | 60 | 0.687566 |
93267d1adff17852e84d1fb976cc480f9b9ed0fa | 7,630 | py | Python | model/attention.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | model/attention.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | model/attention.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from typing import Optional, Dict, Any, Union, Tuple
import torch
from torch import nn
from torch.nn import MultiheadAttention, Linear
from .utils import masked_average
class EntityVectorEncoder(MultiheadAttention):
def __init__(self, embed_dim, num_heads, q_input_f... | 44.360465 | 134 | 0.673788 |
9326bcaf0d9c431582fd2f34148591926060629b | 7,233 | py | Python | scoreboard/controllers.py | M0x40/ctfscoreboard | f1e9b3cd98884e28d50459a4ab7efa778a809c27 | [
"Apache-2.0"
] | 181 | 2016-07-13T17:08:44.000Z | 2021-11-08T10:30:34.000Z | scoreboard/controllers.py | M0x40/ctfscoreboard | f1e9b3cd98884e28d50459a4ab7efa778a809c27 | [
"Apache-2.0"
] | 250 | 2016-06-02T18:11:46.000Z | 2021-06-30T16:34:03.000Z | scoreboard/controllers.py | M0x40/ctfscoreboard | f1e9b3cd98884e28d50459a4ab7efa778a809c27 | [
"Apache-2.0"
] | 78 | 2016-06-18T07:53:27.000Z | 2022-02-15T02:21:45.000Z | # Copyright 2016 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 required by applicable law or ag... | 34.942029 | 75 | 0.645099 |
9326c10df97512977963883d3a0673a96cfecf34 | 188 | py | Python | terrascript/gpg/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/gpg/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/gpg/d.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/gpg/d.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
| 20.888889 | 79 | 0.760638 |
9326ca0b1b957c7f0e1a33304afaf1a93a650038 | 2,957 | py | Python | populate_rango.py | farschmessivo/ranco | ce81e77a9c2a82c4475b3838c3eac48bf206206f | [
"MIT"
] | null | null | null | populate_rango.py | farschmessivo/ranco | ce81e77a9c2a82c4475b3838c3eac48bf206206f | [
"MIT"
] | null | null | null | populate_rango.py | farschmessivo/ranco | ce81e77a9c2a82c4475b3838c3eac48bf206206f | [
"MIT"
] | null | null | null | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE',
'tango_with_django_project.settings')
import django
django.setup()
from rango.models import Category, Page
def populate():
# First, we will create lists of dictionaries containing the pages
# we want to add into each category.
... | 38.907895 | 87 | 0.621238 |
9326d6fe37bed02db6b12de2fc58990c145ea90f | 3,755 | py | Python | velruse/providers/yahoo.py | hqman/velruse | 4f1549d07ce6ef250e75a764ddd615765dd54ce8 | [
"MIT"
] | null | null | null | velruse/providers/yahoo.py | hqman/velruse | 4f1549d07ce6ef250e75a764ddd615765dd54ce8 | [
"MIT"
] | null | null | null | velruse/providers/yahoo.py | hqman/velruse | 4f1549d07ce6ef250e75a764ddd615765dd54ce8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import logging
from urlparse import parse_qs
import oauth2 as oauth
from openid.extensions import ax
from pyramid.security import NO_PERMISSION_REQUIRED
from velruse.api import register_provider
from velruse.providers.oid_extensions import OAuthRequest
from velruse.providers.o... | 34.136364 | 79 | 0.644208 |
9326e13cf3712f3569c3a6cb7dea288bb4728603 | 5,582 | py | Python | torchreid/utils/reidtools.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | 1 | 2021-03-27T17:27:47.000Z | 2021-03-27T17:27:47.000Z | torchreid/utils/reidtools.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | null | null | null | torchreid/utils/reidtools.py | Arindam-1991/deep_reid | ab68d95c2229ef5b832a6a6b614a9b91e4984bd5 | [
"MIT"
] | null | null | null | from __future__ import print_function, absolute_import
import numpy as np
import shutil
import os.path as osp
import cv2
from .tools import mkdir_if_missing
__all__ = ['visualize_ranked_results']
GRID_SPACING = 10
QUERY_EXTRA_SPACING = 90
BW = 5 # border width
GREEN = (0, 255, 0)
RED = (0, 0, 255)
... | 36.012903 | 92 | 0.49785 |
9326f6fb953fa6b06141b31c5b802b5837537f56 | 6,962 | py | Python | durabledict/models.py | robertvaugh/durabledict | 3c7f8e88d8018aa29fd979cbfbb88e6f21ea27c3 | [
"Apache-2.0"
] | 42 | 2015-02-26T19:54:41.000Z | 2022-02-21T10:00:42.000Z | durabledict/models.py | robertvaugh/durabledict | 3c7f8e88d8018aa29fd979cbfbb88e6f21ea27c3 | [
"Apache-2.0"
] | 7 | 2015-03-27T13:43:04.000Z | 2021-12-02T21:18:38.000Z | durabledict/models.py | robertvaugh/durabledict | 3c7f8e88d8018aa29fd979cbfbb88e6f21ea27c3 | [
"Apache-2.0"
] | 14 | 2015-03-28T15:28:04.000Z | 2020-01-13T20:44:03.000Z | from durabledict.base import DurableDict
class ModelDict(DurableDict):
"""
Dictionary-style access to a model. Populates a cache and a local in-memory
to avoid multiple hits to the database.
# Given ``Model`` that has a primary key (``pk``) column that can be
# strings:
mydict =... | 41.195266 | 80 | 0.626544 |
93270054f073ad87dd070a95f502784501d8a00b | 25,955 | py | Python | IPython/core/magics/code.py | damianavila/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | 2 | 2020-11-30T14:04:30.000Z | 2021-11-08T11:29:05.000Z | IPython/core/magics/code.py | RuSHi2381/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | null | null | null | IPython/core/magics/code.py | RuSHi2381/ipython | 4481c323e0d261685ad350fc6f437494b889ab12 | [
"BSD-3-Clause-Clear"
] | 1 | 2020-11-19T05:18:41.000Z | 2020-11-19T05:18:41.000Z | """Implementation of code management magic functions.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with th... | 37.561505 | 111 | 0.551493 |
9327160d365832a3d9e8b5cbf8b96b7dff02a50c | 6,969 | py | Python | gftool/density.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 12 | 2020-10-09T10:05:44.000Z | 2022-02-22T14:04:19.000Z | gftool/density.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 20 | 2020-01-28T09:15:27.000Z | 2022-02-06T16:48:30.000Z | gftool/density.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 6 | 2021-03-09T19:10:37.000Z | 2022-02-02T14:29:06.000Z | """Calculate density from Green's function."""
import logging
from typing import Callable
import numpy as np
from scipy import optimize
from gftool._util import _gu_sum
from gftool.basis.pole import PoleGf
LOGGER = logging.getLogger(__name__)
def density_iw(iws, gf_iw, beta, weights=1., moments=(1.,), n_fit=0):
... | 37.467742 | 98 | 0.645286 |
93271b27a15cbb3a3ea982b341f7054903e308c7 | 11,574 | py | Python | collections/ansible_collections/redhat/satellite/plugins/modules/content_view.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/redhat/satellite/plugins/modules/content_view.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | null | null | null | collections/ansible_collections/redhat/satellite/plugins/modules/content_view.py | hindman-redhat/automated-smart-management-2 | 5450ccd71f2a4ba568a7f11b03466e1554ae0087 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Eric D Helms <ericdhelms@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | 41.188612 | 158 | 0.630724 |
932721d42ea64439f8ab5ceb8923aa2546456e38 | 1,189 | py | Python | LeetCode/others/57. Insert Interval/solution_1.py | vincent507cpu/Comprehensive-Algorithm-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | 4 | 2020-06-26T00:45:53.000Z | 2021-04-19T12:23:32.000Z | LeetCode/others/57. Insert Interval/solution_1.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | LeetCode/others/57. Insert Interval/solution_1.py | vincent507cpu/LeetCode-Comprehensive-Solution | 04e01e49622457f09af2e1133954f043c0c92cb9 | [
"MIT"
] | null | null | null | class Solution:
def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
res = []
i = 0
overlap = False
# new = []
while i < len(intervals) and not overlap:
if newInterval[0] < intervals[i][0]:
new = [newInt... | 34.970588 | 92 | 0.442389 |
93273447d4578f77d3fe316c8b44c7839b323081 | 542 | py | Python | manage.py | Dave360-crypto/LogWatcher | b655ab8b23567d0ff2b3fec2b9398122f19ccbfe | [
"MIT"
] | 33 | 2019-03-19T07:51:17.000Z | 2022-03-15T11:04:35.000Z | manage.py | Dave360-crypto/LogWatcher | b655ab8b23567d0ff2b3fec2b9398122f19ccbfe | [
"MIT"
] | 1 | 2019-11-09T18:08:21.000Z | 2019-11-09T18:08:21.000Z | manage.py | Dave360-crypto/LogWatcher | b655ab8b23567d0ff2b3fec2b9398122f19ccbfe | [
"MIT"
] | 13 | 2019-11-08T06:18:21.000Z | 2022-01-07T17:17:38.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'LogWatcher.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. A... | 33.875 | 74 | 0.688192 |
93273a33f6b69ce147ac81efb0e9126f2b714ffc | 54,210 | py | Python | ai4water/utils/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 12 | 2020-10-13T08:23:17.000Z | 2021-01-22T04:36:21.000Z | ai4water/utils/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 1 | 2020-10-15T02:42:52.000Z | 2020-10-15T02:51:07.000Z | ai4water/utils/utils.py | csiro-hydroinformatics/AI4Water | cdb18bd4bf298f77b381f1829045a1e790146985 | [
"MIT"
] | 2 | 2020-11-23T04:45:38.000Z | 2020-11-26T10:12:34.000Z | import os
import json
import pprint
import datetime
import warnings
from typing import Union
from shutil import rmtree
from copy import deepcopy
from typing import Any, Dict, Tuple
from collections import OrderedDict
import collections.abc as collections_abc
import scipy
import numpy as np
import pandas as pd
import m... | 36.578947 | 120 | 0.584689 |
93274627a6dd6e97bd95fbbf6f007b169f14dc16 | 57,479 | py | Python | python_modules/dagster/dagster/core/events/__init__.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/events/__init__.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster/core/events/__init__.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | """Structured representations of system events."""
import logging
import os
from enum import Enum
from typing import TYPE_CHECKING, AbstractSet, Any, Dict, List, NamedTuple, Optional, Union, cast
from dagster import check
from dagster.core.definitions import (
AssetKey,
AssetMaterialization,
AssetObservati... | 36.587524 | 120 | 0.653682 |
9327599d7bcb813092bdf409c635d31624c4f203 | 9,752 | py | Python | deepchem/models/tensorgraph/tests/test_tensor_graph.py | rbharath/deepchem | 8c3bcdd557abdbb380b64c2d460a73aff76fb303 | [
"MIT"
] | 3 | 2017-10-07T13:48:48.000Z | 2021-06-13T09:09:03.000Z | deepchem/models/tensorgraph/tests/test_tensor_graph.py | rbharath/deepchem | 8c3bcdd557abdbb380b64c2d460a73aff76fb303 | [
"MIT"
] | 1 | 2017-08-29T22:08:24.000Z | 2017-08-29T22:08:24.000Z | deepchem/models/tensorgraph/tests/test_tensor_graph.py | rbharath/deepchem | 8c3bcdd557abdbb380b64c2d460a73aff76fb303 | [
"MIT"
] | 5 | 2017-03-19T01:48:13.000Z | 2019-02-22T01:12:03.000Z | import unittest
import numpy as np
import os
from nose.tools import assert_true
from flaky import flaky
import tensorflow as tf
import deepchem as dc
from deepchem.data import NumpyDataset
from deepchem.data.datasets import Databag
from deepchem.models.tensorgraph.layers import Dense, SoftMaxCrossEntropy, ReduceMean,... | 33.861111 | 94 | 0.688269 |
9327b8b4984c9ee27012355fc6650a56f6770f64 | 12,063 | py | Python | antarest/launcher/adapters/slurm_launcher/slurm_launcher.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 2 | 2021-11-15T09:26:33.000Z | 2022-02-24T09:53:54.000Z | antarest/launcher/adapters/slurm_launcher/slurm_launcher.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 542 | 2021-01-11T13:23:47.000Z | 2022-03-31T15:38:10.000Z | antarest/launcher/adapters/slurm_launcher/slurm_launcher.py | AntaresSimulatorTeam/antaREST | d686d2a86a52737c211ae67f3cee591f559909f2 | [
"Apache-2.0"
] | 1 | 2020-10-01T12:18:15.000Z | 2020-10-01T12:18:15.000Z | import argparse
import logging
import os
import shutil
import threading
import time
from pathlib import Path
from typing import Callable, Optional, Dict
from uuid import UUID, uuid4
from antareslauncher.data_repo.data_repo_tinydb import DataRepoTinydb
from antareslauncher.main import MainParameters, run_with
from anta... | 36.225225 | 101 | 0.599934 |
9327d68f450e3b1dd827f0fc7064ccf2abd13e13 | 3,002 | py | Python | the-comet-that-shook-the-py/backend.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 15 | 2020-04-17T12:02:14.000Z | 2022-03-16T03:01:34.000Z | the-comet-that-shook-the-py/backend.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 9 | 2020-04-25T01:57:16.000Z | 2020-04-29T11:42:34.000Z | the-comet-that-shook-the-py/backend.py | markjoshua12/game-jam-2020 | 846dd052d649a609ab7a52ac0f4dcbeb71781c3b | [
"MIT"
] | 55 | 2020-04-17T12:01:11.000Z | 2021-12-28T10:14:02.000Z | """Backend API module."""
import random
import os
from pathlib import Path
from typing import List
def _get_count_files_starting_with(prefix: str, count=3) -> List[str]:
"""Retrieve 'count' random files starting with the given prefix.
:param prefix: the prefix to use to retrieve assets
:return: a list ... | 28.320755 | 76 | 0.672219 |
93281cde505e0be82edac64b1eafb08e3b4951e2 | 368 | py | Python | test/unittests/test_TotLAEU.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_TotLAEU.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_TotLAEU.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Input.Animals import TotLAEU
class TestTotLAEU(VariableUnitTest):
def test_TotLAEU(self):
z = self.z
np.testing.assert_array_almost_equal(
TotLAEU.TotLAEU_f(z.NumAnimals, z.AvgAnimalWt),
TotLAEU.T... | 26.285714 | 68 | 0.722826 |
9328224135c86ba266667a12fa01faee250cacab | 2,950 | py | Python | movie_trailer_website/media.py | hessler/udacity-movie-trailer-website | d63727e4dd945608234c42c02d320a28c5f29c87 | [
"MIT"
] | null | null | null | movie_trailer_website/media.py | hessler/udacity-movie-trailer-website | d63727e4dd945608234c42c02d320a28c5f29c87 | [
"MIT"
] | null | null | null | movie_trailer_website/media.py | hessler/udacity-movie-trailer-website | d63727e4dd945608234c42c02d320a28c5f29c87 | [
"MIT"
] | null | null | null | """
This module provides classes to store media-related information.
"""
#------------------------------------------------------------------------------
#
# Sources & References:
#
# Info on args and kwargs taken from:
# http://pythontips.com/2013/08/04/args-and-kwargs-in-python-explained/
#
# Pylint: http://www.pylin... | 38.815789 | 79 | 0.578983 |
932829755f743f15220d4aa3e361baf02c249e87 | 3,788 | py | Python | export_subnets.py | Tes3awy/subnetting | 6756ab1a5950b02c9b3f29118aaf13dee7988b0e | [
"MIT"
] | 1 | 2021-10-20T23:26:26.000Z | 2021-10-20T23:26:26.000Z | export_subnets.py | Tes3awy/subnetting | 6756ab1a5950b02c9b3f29118aaf13dee7988b0e | [
"MIT"
] | null | null | null | export_subnets.py | Tes3awy/subnetting | 6756ab1a5950b02c9b3f29118aaf13dee7988b0e | [
"MIT"
] | 1 | 2021-06-21T00:23:31.000Z | 2021-06-21T00:23:31.000Z | #!usr/bin/env python3
from datetime import date
from typing import AnyStr, Dict, List, Optional
from termcolor import colored, cprint
from xlsxwriter import Workbook
def export_subnets(
subnets: List[Dict],
workbook_name: Optional[AnyStr] = "New-Schema.xlsx",
):
"""Exports an Excel file of subnetting da... | 33.821429 | 86 | 0.528775 |
932836ec847e5422f244cefe35e78899ecb23795 | 3,876 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/openstack/common/threadgroup.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/openstack/common/threadgroup.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/daoliproxy/openstack/common/threadgroup.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Red Hat, 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
#
#... | 31.770492 | 79 | 0.617389 |
93283d0dbceff790ee828088647e865ea7f0cd0a | 14,302 | py | Python | photoshop/session.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 17 | 2019-03-01T12:09:37.000Z | 2020-04-09T14:14:59.000Z | photoshop/session.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 7 | 2019-04-28T15:20:27.000Z | 2020-04-07T19:14:47.000Z | photoshop/session.py | loonghao/photoshop_python_api | f6796134845fb2b41d023b2085e678aeef822692 | [
"MIT"
] | 3 | 2020-02-28T14:27:11.000Z | 2020-04-01T16:12:40.000Z | """Provides a public session class for Photoshop api.
Usually we only need to manipulate the currently active document of photoshop.
So as follows:
```python
from photoshop import Session
with Session(action="new_document") as ps:
doc = ps.active_document
text_color = ps.SolidColor()
text_color.rgb.gree... | 41.097701 | 113 | 0.702209 |
93283d1877b19c2cba2e3712e1d72b614aa34bfe | 871 | py | Python | python/src/aoc/year2016/day3.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | 1 | 2021-02-16T21:30:04.000Z | 2021-02-16T21:30:04.000Z | python/src/aoc/year2016/day3.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | python/src/aoc/year2016/day3.py | ocirne/adventofcode | ea9b5f1b48a04284521e85c96b420ed54adf55f0 | [
"Unlicense"
] | null | null | null | from itertools import islice
from aoc.util import load_input
def is_possible_triangle(triangle):
"""
>>> is_possible_triangle([3, 4, 5])
True
>>> is_possible_triangle([5, 10, 25])
False
"""
return 2 * max(triangle) < sum(triangle)
def horizontal_triangles(lines):
for line in lines:
... | 21.775 | 76 | 0.655568 |
932844b1a85c7e92d1be7b00aff7f308f296c65f | 4,611 | py | Python | avi_vantage/datadog_checks/avi_vantage/config_models/instance.py | gaffneyd4/integrations-core | 4c7725c9f1be4985381aad9740e7186f16a87976 | [
"BSD-3-Clause"
] | null | null | null | avi_vantage/datadog_checks/avi_vantage/config_models/instance.py | gaffneyd4/integrations-core | 4c7725c9f1be4985381aad9740e7186f16a87976 | [
"BSD-3-Clause"
] | null | null | null | avi_vantage/datadog_checks/avi_vantage/config_models/instance.py | gaffneyd4/integrations-core | 4c7725c9f1be4985381aad9740e7186f16a87976 | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
from typing import Any, Literal, Mapping, Optional, Sequence, Union
from pydantic import BaseModel, Extra, Field, root_validator, validator
from datadog_checks.base.ut... | 31.582192 | 110 | 0.721102 |
9328486682bdaa67fca3589f7f8c0fa10c14b00b | 2,873 | py | Python | multimodal_affinities/evaluation/analysis/ground_truth_generator.py | amzn/multimodal-affinities | 23045eb6a9387ce0c9c6f5a15227cf1cc4282626 | [
"CC-BY-4.0"
] | 6 | 2021-07-06T12:48:18.000Z | 2021-12-06T01:52:24.000Z | multimodal_affinities/evaluation/analysis/ground_truth_generator.py | amzn/multimodal-affinities | 23045eb6a9387ce0c9c6f5a15227cf1cc4282626 | [
"CC-BY-4.0"
] | null | null | null | multimodal_affinities/evaluation/analysis/ground_truth_generator.py | amzn/multimodal-affinities | 23045eb6a9387ce0c9c6f5a15227cf1cc4282626 | [
"CC-BY-4.0"
] | 5 | 2021-07-10T08:09:17.000Z | 2022-03-24T16:27:15.000Z | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: CC-BY-4.0
import itertools
from multimodal_affinities.blocks.document_entity import DocumentEntity
from multimodal_affinities.blocks.cluster import Cluster
from multimodal_affinities.clustering.clusteringsolver import Clust... | 36.833333 | 104 | 0.680125 |
93285f3654edb06632b5b15b6190e982873154ab | 6,346 | py | Python | hashicorp_vault_client/hashicorp_vault_client/models/body30.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | hashicorp_vault_client/hashicorp_vault_client/models/body30.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | 2 | 2019-09-30T20:56:41.000Z | 2019-10-02T00:22:07.000Z | hashicorp_vault_client/hashicorp_vault_client/models/body30.py | drewmullen/HAC | fb185804fd244366f8f8d01df22835b3d96e7512 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
HashiCorp Vault API
HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`. # noqa: E501
OpenAPI spec version: 1.2.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class... | 32.050505 | 172 | 0.608887 |
93289ad4fe7b02f317b2f3e722854805f46f50e3 | 1,756 | py | Python | plotter/plot_cycles.py | willjwon/isye6739-project-summer-2021 | 05b6621fb09fa55c5351482d145f196b57321351 | [
"MIT"
] | null | null | null | plotter/plot_cycles.py | willjwon/isye6739-project-summer-2021 | 05b6621fb09fa55c5351482d145f196b57321351 | [
"MIT"
] | null | null | null | plotter/plot_cycles.py | willjwon/isye6739-project-summer-2021 | 05b6621fb09fa55c5351482d145f196b57321351 | [
"MIT"
] | null | null | null | from typing import Dict
import pickle
import pandas as pd
import os
import matplotlib.pyplot as plt
import seaborn as sns
def load_simulation_data() -> (Dict, pd.DataFrame):
with open(file='../simulation_result/simulation_result.pickle', mode='rb') as file:
load_data = pickle.load(file=file)
configs ... | 29.762712 | 87 | 0.666287 |
9328cbd8bba053d5315d7a1a09e4ddd0ccae100b | 2,336 | py | Python | backend/wmg/data/ontology_labels.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | 2 | 2020-02-07T18:12:12.000Z | 2020-02-11T14:59:03.000Z | backend/wmg/data/ontology_labels.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | 173 | 2020-01-29T17:48:02.000Z | 2020-03-20T02:52:58.000Z | backend/wmg/data/ontology_labels.py | HumanCellAtlas/dcp-prototype | 44ca66a266004124f39d7d3e3dd75e9076012ff0 | [
"MIT"
] | null | null | null | import csv
import gzip
import json
import pathlib
from typing import IO, Dict, Optional
# TODO: Place this module into a common ontology util package with ontology_mapping.py and
# extract_ontology_terms_from_owl.py. https://app.zenhub.com/workspaces/single-cell-5e2a191dad828d52cc78b028/issues
# /chanzuckerberg/sing... | 32.901408 | 116 | 0.726027 |
9328e23e8d93546efc5261e03fba860e2483f556 | 1,505 | py | Python | submit_scripts/mizuRoute/mizuRoute_wrapper.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | submit_scripts/mizuRoute/mizuRoute_wrapper.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | null | null | null | submit_scripts/mizuRoute/mizuRoute_wrapper.py | BrisClimate/flood-cascade | 660c29275a87785153d0f107ed23104fcbcbddee | [
"MIT"
] | 3 | 2020-11-08T16:01:47.000Z | 2021-01-13T17:13:32.000Z | #!/cm/shared/languages/python-3.3.2/bin/python
# submit script for submission of mizuRoute simualtions
# Peter Uhe Oct 29 2019
#
# call this script from 'run_mizuRoute_templated_mswep050calib.py which creates a qsub job to submit to the HPC queue
# This script is actually called from 'call_pythonscript.sh' (which is n... | 35 | 120 | 0.765449 |
93291631f971e7bfa23c8bb7d6dca4646d1f4449 | 646 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_SC.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_SC.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_SC.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. SC metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SC = PhoneMetadata(id='SC', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[19]\\d{2,3}', possible_length=(3, ... | 71.777778 | 190 | 0.724458 |
93291fe3325e44ae2df0fe3cdd85ce078c8b3eaf | 9,912 | py | Python | redbrick/repo/learning.py | dereklukacs/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 1 | 2020-11-26T04:25:15.000Z | 2020-11-26T04:25:15.000Z | redbrick/repo/learning.py | redbrick-ai/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 33 | 2021-02-04T17:51:53.000Z | 2022-03-17T07:28:36.000Z | redbrick/repo/learning.py | dereklukacs/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 1 | 2021-06-09T10:06:35.000Z | 2021-06-09T10:06:35.000Z | """Abstract interface to active learning API."""
from typing import Optional, List, Dict, Tuple
import aiohttp
from redbrick.common.client import RBClient
from redbrick.common.learning import (
LearningControllerInterface,
LearningController2Interface,
)
from .shards import TAXONOMY_SHARD
class LearningR... | 29.58806 | 100 | 0.498184 |
932927ef67249ecb6204d96b7b00eafd77896407 | 4,297 | py | Python | swaplib/matrixTransfer/headTransfer.py | HCW0727/headswap-machine | 16423279a18e30db9d240fd03a9410b7fb213730 | [
"MIT"
] | null | null | null | swaplib/matrixTransfer/headTransfer.py | HCW0727/headswap-machine | 16423279a18e30db9d240fd03a9410b7fb213730 | [
"MIT"
] | null | null | null | swaplib/matrixTransfer/headTransfer.py | HCW0727/headswap-machine | 16423279a18e30db9d240fd03a9410b7fb213730 | [
"MIT"
] | null | null | null | from ..faceboxloc.facebox import makeFaceBox
from ..stylelib.doStyle import doStyle
from ..seglib.faceSegmentation import face2parsing_maps, parsing2mask
from cv2.ximgproc import guidedFilter
from PIL import Image
from .landmarks import *
from .swapLib import *
from pathlib import Path
route = f"{Path(__... | 36.109244 | 136 | 0.67838 |
93296793b00a1cd3f58d73632724ade0027d79fe | 476 | py | Python | utils/csv_to_html.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | null | null | null | utils/csv_to_html.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | 41 | 2021-01-01T14:01:30.000Z | 2021-01-27T20:17:21.000Z | utils/csv_to_html.py | hschilling/data-collection-and-prep | b70ab54fd887592bad05d5748f492fc2f9ef0f6f | [
"Unlicense"
] | 5 | 2021-02-08T14:19:35.000Z | 2021-10-19T12:10:55.000Z | import sys
import argparse
import pandas as pd
if __name__ == "__main__":
parser = argparse.ArgumentParser(prog=sys.argv[0],
description="convert csv file to html file.")
parser.add_argument('input_csv', type=str, help='input CSV file')
parser.add_argument('output_htm... | 25.052632 | 82 | 0.665966 |
9329d150e524b78f51abe065bc9fb7ef4c424fe8 | 4,665 | py | Python | tests/data/packages/fetchai/protocols/t_protocol/custom_types.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | tests/data/packages/fetchai/protocols/t_protocol/custom_types.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | tests/data/packages/fetchai/protocols/t_protocol/custom_types.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 fetchai
#
# 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
#
#... | 44.009434 | 157 | 0.679528 |
9329d6daec843d2daa93f5cf8608b14d1410c601 | 1,830 | py | Python | data/dimacs10/.benchmark_childrenidx.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | 3 | 2020-06-18T13:31:26.000Z | 2021-04-05T17:42:56.000Z | data/dimacs10/.benchmark_childrenidx.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | null | null | null | data/dimacs10/.benchmark_childrenidx.py | EQt/treelas | 24a5cebf101180822198806c0a4131b0efb7a36d | [
"MIT"
] | null | null | null | """
Benchmark ChildrenIndex creation
"""
import h5py
import numpy as np
from graphidx.idx import ChildrenIndex, groupby
from graphidx.py.children import PyChildrenIndex
from graphidx.timer import Timer
from treelas._treelas import _pointer
def benchmark(fname: str):
with Timer("load hdf5"):
with h5py.File... | 27.727273 | 65 | 0.6 |
9329ed99ce0b809a6aaf58787641652435664f1d | 120 | py | Python | servers/python/coweb/cowebpyoe/OperationEngineException.py | opencoweb/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 83 | 2015-01-05T19:02:57.000Z | 2021-11-19T02:48:09.000Z | servers/python/coweb/cowebpyoe/OperationEngineException.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 3 | 2015-12-16T13:49:33.000Z | 2019-06-17T13:38:50.000Z | servers/python/coweb/cowebpyoe/OperationEngineException.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 14 | 2015-04-29T22:36:53.000Z | 2021-11-18T03:24:29.000Z |
class OperationEngineException(Exception):
def __init__(self, message):
Exception.__init__(self, message)
| 20 | 42 | 0.733333 |
932a01a8b85baf3f560f5a5526a10389fd72ddbd | 11,553 | py | Python | padertorch/contrib/examples/source_separation/or_pit/train.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 62 | 2019-12-22T08:30:29.000Z | 2022-03-22T11:02:59.000Z | padertorch/contrib/examples/source_separation/or_pit/train.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 47 | 2020-01-06T09:23:47.000Z | 2022-01-24T16:55:06.000Z | padertorch/contrib/examples/source_separation/or_pit/train.py | sibange/padertorch | 494692d877f04c66847c2943795b23aea488217d | [
"MIT"
] | 13 | 2019-12-16T08:12:46.000Z | 2021-11-08T14:37:06.000Z | """
Example call on NT infrastructure:
export STORAGE_ROOT=<your desired storage root>
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
python -m padertorch.contrib.examples.source_separation.or_pit.train with database_jsons=${paths to your JSONs}
"""
import copy
import lazy_dataset
import torch
from paderbox.io imp... | 30.726064 | 111 | 0.640613 |
932a04de7e3b66a2981a594b1ebacf7e0ebd224a | 10,223 | py | Python | cloudmersive_validate_api_client/models/parse_address_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | null | null | null | cloudmersive_validate_api_client/models/parse_address_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | null | null | null | cloudmersive_validate_api_client/models/parse_address_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 32.557325 | 240 | 0.615377 |
932a291e2d82991d1a18845d7bfc4be2708c058d | 498 | py | Python | app/routers/apps_docs.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | 9 | 2021-06-22T01:00:12.000Z | 2022-03-16T08:57:37.000Z | app/routers/apps_docs.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | 63 | 2021-07-17T19:42:12.000Z | 2022-03-30T16:41:24.000Z | app/routers/apps_docs.py | geco91/blitz_api | 42538a77b3de6a032bb6fdb60249433a0ad5ec56 | [
"MIT"
] | 5 | 2021-07-13T18:52:23.000Z | 2022-03-25T10:43:10.000Z | get_app_status_response_docs = """
Returns a JSON list with the current status of all **installed** apps
```
[
{
id: 'specter',
name: 'Specter Desktop',
status: 'online'
},
{
id: 'sphinx',
name: 'Sphinx Chat',
status: 'online'
},
...
]
```
"""
get_app_... | 16.6 | 69 | 0.548193 |
932a9bac930d4fceb500b53dc667ffaa794d1576 | 1,601 | py | Python | sprint-challenge/acme_test.py | mljarman/DS-Unit-3-Sprint-1-Software-Engineering | aa96f9c260d78cb398a3a96c1e8739f43ca31dac | [
"MIT"
] | null | null | null | sprint-challenge/acme_test.py | mljarman/DS-Unit-3-Sprint-1-Software-Engineering | aa96f9c260d78cb398a3a96c1e8739f43ca31dac | [
"MIT"
] | null | null | null | sprint-challenge/acme_test.py | mljarman/DS-Unit-3-Sprint-1-Software-Engineering | aa96f9c260d78cb398a3a96c1e8739f43ca31dac | [
"MIT"
] | null | null | null | import unittest
from acme import Product
from acme_report import generate_products, ADJECTIVES, NOUNS
class AcmeProductTests(unittest.TestCase):
"""Making sure Acme products are the tops!"""
def test_default_product_price(self):
"""Test default product price being 10."""
prod = Product('Test P... | 28.589286 | 78 | 0.627108 |
932a9df34fbf1d7b227e1cfff05c69fc3c0860a8 | 779 | py | Python | orchestra/prompts/ask_overwrite.py | enihsyou/LeetCode | 230325d1dfd666ee53f304edf74c9c0f60f81d75 | [
"MIT"
] | null | null | null | orchestra/prompts/ask_overwrite.py | enihsyou/LeetCode | 230325d1dfd666ee53f304edf74c9c0f60f81d75 | [
"MIT"
] | null | null | null | orchestra/prompts/ask_overwrite.py | enihsyou/LeetCode | 230325d1dfd666ee53f304edf74c9c0f60f81d75 | [
"MIT"
] | null | null | null | # coding=utf-8
# promote user for question ordinal.
from prompt_toolkit.formatted_text import StyleAndTextTuples
from prompt_toolkit.styles import Style
from prompts import AskSession
async def question(session: AskSession):
"""
Ask user for his answer on which LeetCode problem
he whats to anticipate.
... | 23.606061 | 60 | 0.653402 |
932ab25feb767a29f8ff4e39df82e0e7bea4ccf5 | 4,779 | py | Python | mmaction/datasets/d3.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | null | null | null | mmaction/datasets/d3.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | null | null | null | mmaction/datasets/d3.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | 1 | 2020-07-22T18:11:54.000Z | 2020-07-22T18:11:54.000Z | # Weichao Qiu @ 2018
import numpy as np
def make_translation(X, Y, Z):
''' Make translation matrix '''
T = np.matrix(
[
[1, 0, 0, X],
[0, 1, 0, Y],
[0, 0, 1, Z],
[0, 0, 0, 1]
]
).transpose()
return T
def make_location(X, Y, Z):
T = np.matrix(
[
[... | 30.832258 | 130 | 0.559113 |
932b42b6d5b75ec36a2039856ebeab629660f182 | 929 | py | Python | configuration.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | 1 | 2021-01-08T12:43:14.000Z | 2021-01-08T12:43:14.000Z | configuration.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | 1 | 2021-04-30T21:08:55.000Z | 2021-04-30T21:08:55.000Z | configuration.py | ankile/reinforcement-trading | 849ba30d8be05abf1e9eae919463c4eebe812ce8 | [
"MIT"
] | null | null | null | BATCH_SIZE = 32
BARS_COUNT = 50
RESET_ON_CLOSE = True
RANDOM_OFS_ON_RESET = True
REWARD_ON_CLOSE = True
STATE_1D = True
TARGET_NET_SYNC = 1000
GAMMA = 0.99
REPLAY_SIZE = 100_000
REPLAY_INITIAL = 10_000
REWARD_STEPS = 2
LEARNING_RATE = 0.0001
STATES_TO_EVALUATE = 1000
EVAL_EVERY_STEP = 1000
EPSILON_START = 1.0
E... | 20.195652 | 39 | 0.673843 |
932b75b6e7de2cf394241a32e7d3d5982185f571 | 31,026 | py | Python | telethon_asyncpg/network/mtprotosender.py | ukinti/telethon_asyncpg | 12fdfba905b493ac2c677a5f65c72c2051f02eb9 | [
"MIT"
] | 7 | 2020-12-06T13:16:15.000Z | 2021-11-08T09:58:01.000Z | telethon_asyncpg/network/mtprotosender.py | ukinti/telethon_asyncpg | 12fdfba905b493ac2c677a5f65c72c2051f02eb9 | [
"MIT"
] | null | null | null | telethon_asyncpg/network/mtprotosender.py | ukinti/telethon_asyncpg | 12fdfba905b493ac2c677a5f65c72c2051f02eb9 | [
"MIT"
] | null | null | null | import asyncio
import collections
import inspect
import struct
from telethon.network import authenticator
from telethon.extensions.messagepacker import MessagePacker
from telethon.network.mtprotoplainsender import MTProtoPlainSender
from telethon.network.requeststate import RequestState
from telethon.network.mtprotost... | 40.609948 | 103 | 0.615774 |
932ba4ab2f1ff897e83cbf4363462adac88c83a2 | 7,114 | py | Python | models/resnet.py | mathpopo/sample_mobilenet_test | dcdc4cb318b86f1f2b00c6be7b674f1bc8ae1c53 | [
"MIT"
] | null | null | null | models/resnet.py | mathpopo/sample_mobilenet_test | dcdc4cb318b86f1f2b00c6be7b674f1bc8ae1c53 | [
"MIT"
] | null | null | null | models/resnet.py | mathpopo/sample_mobilenet_test | dcdc4cb318b86f1f2b00c6be7b674f1bc8ae1c53 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.utils.model_zoo as model_zoo
__all__ = ['ResNet', 'resnet50']
model_urls = {
'resnet18': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',
'resnet34': 'https://download.pytorch.org/models/resnet34-333f7ec4.pth',
'resnet50': 'https://download.pytorch.org/mode... | 32.78341 | 116 | 0.608378 |
932ba8852aea475f8196bcbfb76792c3e6b9531e | 14,215 | py | Python | thinspace/scripts/dereplicator/dereplicator.py | phiweger/thinspace | 87e6d74774f81a05960c6adec55ad2023d0eaa46 | [
"BSD-3-Clause"
] | 9 | 2019-11-26T11:38:58.000Z | 2020-11-17T19:05:30.000Z | thinspace/scripts/dereplicator/dereplicator.py | phiweger/thinspace | 87e6d74774f81a05960c6adec55ad2023d0eaa46 | [
"BSD-3-Clause"
] | 1 | 2020-01-08T06:34:07.000Z | 2020-01-08T06:34:07.000Z | thinspace/scripts/dereplicator/dereplicator.py | phiweger/thinspace | 87e6d74774f81a05960c6adec55ad2023d0eaa46 | [
"BSD-3-Clause"
] | 1 | 2019-12-16T02:57:32.000Z | 2019-12-16T02:57:32.000Z | #!/usr/bin/env python3
"""
Copyright 2019 Ryan Wick (rrwick@gmail.com)
https://github.com/rrwick/Assembly-dereplicator
This program is free software: you can redistribute it and/or modify it under the terms of the GNU
General Public License as published by the Free Software Foundation, either version 3 of the
License,... | 38.315364 | 100 | 0.629828 |
932bc978eb27b89129667f7222c7d82a158e8237 | 1,480 | py | Python | hdltools/vcd/mixins/__init__.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 2 | 2020-02-28T13:02:39.000Z | 2021-06-30T09:15:35.000Z | hdltools/vcd/mixins/__init__.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | 1 | 2020-03-22T17:32:45.000Z | 2020-03-23T15:43:39.000Z | hdltools/vcd/mixins/__init__.py | brunosmmm/hdltools | a98ca8c4d168740fa229c939a7b1f31ea73eec24 | [
"MIT"
] | null | null | null | """VCD Parser mixins."""
class ScopeMap:
"""Scope map."""
def __init__(self):
"""Initialize."""
self._map = {}
def __getitem__(self, index):
"""Get item."""
if not isinstance(index, tuple):
raise TypeError("index must be a tuple")
current_map = self._... | 25.517241 | 59 | 0.571622 |
932bd60ee93ff790aa8094f304c6fa1116d8cb1f | 1,360 | py | Python | mmdet/datasets/sensing.py | slothfulxtx/mmdetection | 59a9faa552220d5e25c5bc25c51a3dc678abfc81 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/sensing.py | slothfulxtx/mmdetection | 59a9faa552220d5e25c5bc25c51a3dc678abfc81 | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/sensing.py | slothfulxtx/mmdetection | 59a9faa552220d5e25c5bc25c51a3dc678abfc81 | [
"Apache-2.0"
] | null | null | null | from .custom import CustomDataset
from .builder import DATASETS
import numpy as np
import json
@DATASETS.register_module
class SensingDataset(CustomDataset):
CLASSES = ('bridge', 'oilcan', 'port','ship','plane')
def load_annotations(self, ann_file):
'''
load annotations from .json ann_file
... | 34 | 155 | 0.558824 |
932be5283be4e203c53abbbd040e1735a9d0a6ba | 205 | py | Python | python/ABC/161/a.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | python/ABC/161/a.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | python/ABC/161/a.py | KATO-Hiro/atcoder-1 | c2cbfcfd5c3d46ac9810ba330a37d437aa2839c2 | [
"MIT"
] | null | null | null | import sys
input = sys.stdin.readline
def main():
X, Y, Z = map(int, input().split())
X, Y = Y, X
X, Z = Z, X
print("{} {} {}".format(X, Y, Z))
if __name__ == "__main__":
main()
| 12.058824 | 39 | 0.487805 |
932c2c9d71bc6e795150e1978e7b79028bd10795 | 8,044 | py | Python | doc/ext/cli_reference.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | doc/ext/cli_reference.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | null | null | null | doc/ext/cli_reference.py | DeanHwd/rally | d284aa0746c54f1c375470e76dd206d19877a7fd | [
"Apache-2.0"
] | 1 | 2015-02-07T09:44:47.000Z | 2015-02-07T09:44:47.000Z | # Copyright 2016: Mirantis 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 b... | 38.488038 | 79 | 0.611014 |
932c5582a9ce2922bab974fb0a1e466f1925a108 | 3,622 | py | Python | MatrixInverseStepByStep.py | bkbncn/MatrixInverse | dcba9a22dc02404bdca5b103cf29656da6fc028f | [
"Unlicense"
] | 15 | 2018-11-01T04:01:22.000Z | 2022-01-16T08:01:57.000Z | MatrixInverseStepByStep.py | bkbncn/MatrixInverse | dcba9a22dc02404bdca5b103cf29656da6fc028f | [
"Unlicense"
] | 2 | 2020-01-27T16:11:53.000Z | 2021-04-27T18:47:52.000Z | MatrixInverseStepByStep.py | bkbncn/MatrixInverse | dcba9a22dc02404bdca5b103cf29656da6fc028f | [
"Unlicense"
] | 12 | 2019-07-23T13:43:46.000Z | 2021-08-28T13:08:24.000Z | #!/usr/bin/env python
# coding: utf-8
# # Matrix Inversion Step-by-Step Programming
# ## Helper Functions
# In[1]:
def print_matrix(Title, M):
print(Title)
for row in M:
print([round(x,3)+0 for x in row])
def print_matrices(Action, Title1, M1, Title2, M2):
print(Action)
print(Title... | 26.057554 | 103 | 0.544174 |
932c86d706879f6c8cc006d9009e893246c3c1c5 | 457 | py | Python | forceDAQ_GUI.py | lindemann09/pyForceDAQ | 5117e4274ebf3045f46f5df40276d25d2bfb0332 | [
"MIT"
] | 8 | 2016-06-27T12:07:14.000Z | 2022-03-29T08:59:44.000Z | forceDAQ_GUI.py | robot0102/pyForceDAQ | 5117e4274ebf3045f46f5df40276d25d2bfb0332 | [
"MIT"
] | 1 | 2020-01-15T20:29:53.000Z | 2020-07-31T17:35:34.000Z | forceDAQ_GUI.py | robot0102/pyForceDAQ | 5117e4274ebf3045f46f5df40276d25d2bfb0332 | [
"MIT"
] | 3 | 2020-01-14T18:31:39.000Z | 2022-03-25T05:56:40.000Z | __author__ = 'Oliver Lindemann'
import forceDAQ
forceDAQ.USE_DUMMY_SENSOR = True # <-- change for usage in lab to False
if __name__ == "__main__": # required because of threading
from forceDAQ.gui import run
tk_launcher = None
try:
from forceDAQ.gui import tk_launcher
except:
print("W... | 24.052632 | 71 | 0.676149 |
932d0750a73338fa88b4a5ed28caf5088a577b0c | 3,563 | py | Python | experiments/memory/mem_ddpg_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/memory/mem_ddpg_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/memory/mem_ddpg_exp.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | """
Check DDPG + memory states on OneCharMemory task.
"""
from rlkit.exploration_strategies.ou_strategy import OUStrategy
from rlkit.launchers.launcher_util import (
run_experiment,
set_seed,
)
from rlkit.qfunctions.memory.mlp_memory_qfunction import MlpMemoryQFunction
from rlkit.tf.policies.memory.action_aware... | 26.789474 | 78 | 0.573393 |
932d083d73ed5170a5142b5759219b73d0b79fa7 | 10,880 | py | Python | py/ssutils.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | py/ssutils.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | py/ssutils.py | NCEAS/metad | dcab3a79da9a9649714c09456c6231a4c417ffb4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import json
import xlsxwriter
from xlsxwriter.utility import xl_rowcol_to_cell
## write the header row in the worksheet.
def writeHeaders(sheet,rubric,style):
##print "adding header for rubric type="+rubric
col = 0
col = addTitle(sheet,"Data Center",col,style)
col = addTitle(sheet,"RecordName",c... | 37.647059 | 199 | 0.685938 |
932d0ae69a9f7bccaf9bdb13e15c32bb5c9bb9e7 | 1,650 | py | Python | install.py | gjelbrim/twittermirror | b88ce2d5f008ce953b6513468c7c43b0c12261d9 | [
"CC0-1.0"
] | null | null | null | install.py | gjelbrim/twittermirror | b88ce2d5f008ce953b6513468c7c43b0c12261d9 | [
"CC0-1.0"
] | null | null | null | install.py | gjelbrim/twittermirror | b88ce2d5f008ce953b6513468c7c43b0c12261d9 | [
"CC0-1.0"
] | null | null | null | """
installation process
"""
from configparser import ConfigParser
print("--------------------------------")
print("Keys of the account which will READ the tweets")
senderAPIKey = input("Enter API Key: ")
senderAPISecretKey = input("Enter API Secret Key: ")
senderAccessToken = input("Enter access token: ")
senderA... | 28.448276 | 68 | 0.651515 |
932d1692a55897bc8355b363bde83e5fe4a8893d | 770 | py | Python | deep_compression/utils/compressai/update_and_eval_model.py | YodaEmbedding/deep-compression | cc1ea691921fbe2e5cffeb30a02b777dadd08700 | [
"MIT"
] | null | null | null | deep_compression/utils/compressai/update_and_eval_model.py | YodaEmbedding/deep-compression | cc1ea691921fbe2e5cffeb30a02b777dadd08700 | [
"MIT"
] | null | null | null | deep_compression/utils/compressai/update_and_eval_model.py | YodaEmbedding/deep-compression | cc1ea691921fbe2e5cffeb30a02b777dadd08700 | [
"MIT"
] | null | null | null | import compressai.utils.eval_model.__main__ as eval_model_main
import torch
import torch.nn as nn
from compressai.zoo import load_state_dict
from compressai.zoo.image import model_architectures as architectures
def load_checkpoint(arch: str, checkpoint_path: str) -> nn.Module:
ckpt = torch.load(checkpoint_path)
... | 29.615385 | 69 | 0.733766 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.