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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7153d3e5f303fac4afc1dc66b303035bd382d50 | 969 | py | Python | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | 1 | 2020-10-29T12:01:38.000Z | 2022-03-21T02:39:59.000Z | doc/api/epydoc/build.py | swamper123/pymodbus | 7dfac6f19c60d3aa50a168ff82db88204dfb3a30 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
'''
Epydoc API Runner
------------------
Using pkg_resources, we attempt to see if epydoc is installed,
if so, we use its cli program to compile the documents
'''
try:
import sys, os, shutil
import pkg_resources
pkg_resources.require("epydoc")
from epydoc.cli import cli
sys.... | 24.846154 | 62 | 0.603715 |
f71573d18019e66119ed0720c4b4edddc4c1a5eb | 987 | py | Python | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_order_reconcile_return_object.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Hydrogen Nucleus API
The Hydrogen Nucleus API # noqa: E501
OpenAPI spec version: 1.9.5
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import nucleus_api
from nu... | 24.073171 | 109 | 0.733536 |
f715b38795d175d33576ab05dea9a3fe41688f13 | 1,863 | py | Python | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null | samples/snippets/detect/label-products.py | glaswasser/python-vision | 706c314a86b8f35c313bb3e907ae84317dca1a0b | [
"Apache-2.0"
] | null | null | null |
from detect import (detect_logos, detect_text)
import pandas as pd
import re
import os
#from __future__ import print_function
from google.cloud import vision
images_path = "C:\\Users\\heinz\\Yagora GmbH\\Ievgen Kyrda - Crawler\\images\\foodnewsgermany_images/"
file_names = os.listdir(os.path.dirname(images_path))
f... | 26.239437 | 102 | 0.688137 |
f715e2b4af325720c565d744e3e3558d6ec968b2 | 11,243 | py | Python | bookworm/annotation/annotation_gui.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 18 | 2019-07-19T22:12:15.000Z | 2020-08-26T17:45:19.000Z | bookworm/annotation/annotation_gui.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 44 | 2019-07-15T10:17:00.000Z | 2020-07-26T11:22:53.000Z | bookworm/annotation/annotation_gui.py | mush42/bookworm | a4bdd89363137a89a1bed1e9e072de4fb55576fd | [
"MIT"
] | 9 | 2019-09-03T13:13:31.000Z | 2020-08-25T13:55:27.000Z | # coding: utf-8
import wx
from enum import IntEnum
from bookworm import speech
from bookworm.gui.settings import SettingsPanel
from bookworm.structured_text import TextRange
from bookworm.logger import logger
from .annotator import Bookmarker, NoteTaker, Quoter
from .annotation_dialogs import (
BookmarksViewer,
... | 37.228477 | 88 | 0.592102 |
f71617895efc3dfd23246121c700461891099a24 | 6,196 | py | Python | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | null | null | null | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | 14 | 2017-08-14T02:25:42.000Z | 2018-11-16T19:15:52.000Z | docs/conf.py | EVEprosper/ProsperDatareader | 31f0d77074c21222161774f4d653326925611167 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ProsperDatareader documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 31 09:30:33 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | 29.788462 | 80 | 0.675274 |
f71669f5529851928377789218c8de2abda6eaf6 | 5,513 | py | Python | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | 测试/tensorflow_hello/2.practices_on_nlp.py | shayxu-ai/A-Repository-for-Machine-Learning | 4b4cea15bb005d1c58f4395fde97cadf44fb0186 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time: 2020/2/5,005 22:02
# @Last Update: 2020/2/5,005 22:02
# @Author: 徐缘
# @FileName: 2.practices_on_nlp.py
# @Software: PyCharm
from __future__ import absolute_import, division, print_function, unicode_literals # 导入一些熟悉的陌生人
# 绝对引入,精确除法,print,unicode类型字符串。都是为了适配python2,不加也罢
import nu... | 29.169312 | 108 | 0.643751 |
f71684275afc20018793ca67d49712a2693a0850 | 10,212 | py | Python | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | 1 | 2020-12-15T17:19:33.000Z | 2020-12-15T17:19:33.000Z | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | a3c_master_sewak.py | sebtac/MLxE | 93baa6b7c9fd14e54abd7199e868fb828e9a7c52 | [
"Apache-2.0"
] | null | null | null | """ A3C in Code - Centralized/ Gobal Network Parameter Server/ Controller
Based On:
A3C Code as in the book Deep Reinforcement Learning, Chapter 12.
Runtime: Python 3.6.5
Dependencies: numpy, matplotlib, tensorflow (/ tensorflow-gpu), gym
DocStrings: GoogleStyle
Author : Mohit Sewak (p20150023@goa-bits-pilani.a... | 39.890625 | 158 | 0.665785 |
f7168f6333b407972ae83a3eb73553f078b2cd44 | 7,304 | py | Python | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/kazhdan_lusztig.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | r"""
Kazhdan-Lusztig Polynomials
AUTHORS:
- Daniel Bump (2008): initial version
- Alan J.X. Guo (2014-03-18): ``R_tilde()`` method.
"""
#*****************************************************************************
# Copyright (C) 2008 Daniel Bump <bump at match.stanford.edu>
#
# This program is free softwar... | 32.035088 | 92 | 0.529299 |
f716cea90be05811860d24af0a9d540d7d2e2e6c | 4,451 | py | Python | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | code/distributeHI.py | modichirag/21cmhod | 0807a7b0b880f4ba5bc7161b843d500ddcece5a7 | [
"MIT"
] | null | null | null | import numpy as np
import re, os
from pmesh.pm import ParticleMesh
from nbodykit.lab import BigFileCatalog, BigFileMesh, MultipleSpeciesCatalog, FFTPower
from nbodykit import setup_logging
from mpi4py import MPI
import HImodels
# enable logging, we have some clue what's going on.
setup_logging('info')
#... | 34.238462 | 106 | 0.625927 |
f716fe49497e0fa092b298e9bf377c75b13a12bf | 1,247 | py | Python | servers/python/coweb/auth/public.py | opencoweb/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 83 | 2015-01-05T19:02:57.000Z | 2021-11-19T02:48:09.000Z | servers/python/coweb/auth/public.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 3 | 2015-12-16T13:49:33.000Z | 2019-06-17T13:38:50.000Z | servers/python/coweb/auth/public.py | xuelingxiao/coweb | 7b3a87ee9eda735a859447d404ee16edde1c5671 | [
"AFL-2.1"
] | 14 | 2015-04-29T22:36:53.000Z | 2021-11-18T03:24:29.000Z | '''
Copyright (c) The Dojo Foundation 2011. All Rights Reserved.
Copyright (c) IBM Corporation 2008, 2011. All Rights Reserved.
'''
from .base import AuthBase
class PublicAuth(AuthBase):
cookieName = 'coweb.auth.public.username'
_userId = 0
def requires_login(self):
'''Does not require login. Usern... | 34.638889 | 80 | 0.642342 |
f716fffcedc3cbaba6d963cd4a7e2061ef83cc34 | 4,109 | py | Python | mdeepctr/models/xdeepfm.py | TS-SE-GROUP/icme2019 | 7eefdb7de6a7ff3bec1721fafb822d80d80dbba3 | [
"MIT"
] | 78 | 2019-02-21T12:44:11.000Z | 2022-03-30T11:42:33.000Z | mdeepctr/models/xdeepfm.py | rightnowandholdon/icme2019 | fe9b31db7bf19b08d5e5d41a259f0a297eb21766 | [
"MIT"
] | 6 | 2019-04-11T13:14:46.000Z | 2021-05-19T14:36:07.000Z | mdeepctr/models/xdeepfm.py | rightnowandholdon/icme2019 | fe9b31db7bf19b08d5e5d41a259f0a297eb21766 | [
"MIT"
] | 22 | 2019-02-21T02:51:54.000Z | 2021-12-10T02:04:28.000Z | # -*- coding:utf-8 -*-
"""
Author:
Weichen Shen,wcshen1994@163.com
Reference:
[1] Lian J, Zhou X, Zhang F, et al. xDeepFM: Combining Explicit and Implicit Feature Interactions for Recommender Systems[J]. arXiv preprint arXiv:1803.05170, 2018.(https://arxiv.org/pdf/1803.05170.pdf)
"""
import tensorflow as tf
fr... | 54.065789 | 325 | 0.690436 |
f717181beb4c4046a045a44b6d0f4db857d85911 | 4,211 | py | Python | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | 2 | 2021-01-01T12:07:27.000Z | 2021-09-10T03:57:18.000Z | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | forte/processors/stanfordnlp_processor.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Forte 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 ... | 35.091667 | 74 | 0.566611 |
f71722c909f61d25a111b3cedd33fb84627eb888 | 29,871 | py | Python | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | msp430backend/msp430_ws/server_protocol.py | zlalanne/msp430-webcontrol | a4e8f84942c3e16fa447907d2cfff4587013d6b3 | [
"BSD-3-Clause"
] | null | null | null | import requests
import json
import sys
import re
from twisted.internet.error import ConnectionDone
from twisted.internet import protocol, threads, reactor
from twisted.protocols.basic import LineReceiver
from twisted.python import log
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol, Http... | 35.773653 | 132 | 0.614174 |
f717282762e91799ab097381b849786ec18cef78 | 213 | py | Python | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | tensorbay/opendataset/SegTrack2/__init__.py | Hoteryoung/tensorbay-python-sdk | 53c34dd529c20ec69b34ddd348b5c8e74f4094d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copytright 2021 Graviti. Licensed under MIT License.
#
# pylint: disable=invalid-name
"""Dataloader of the SegTrack2 dataset."""
from .loader import SegTrack2
__all__ = ["SegTrack2"]
| 17.75 | 54 | 0.732394 |
f7172919cb32b1bce840769389a548df78d2e786 | 3,420 | py | Python | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/compute/admin/test_fixed_ips_negative.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 NEC Corporation. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 39.767442 | 78 | 0.635965 |
f7173966ea1c7e65d2e1a2dd36186f075d2562fc | 5,614 | py | Python | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | examples/Cliner/CliNER/code/feature_extraction/umls_dir/create_sqliteDB.py | swapnull7/forte | 737a72afd440d40c3826c3a7c5e4e44235c0f701 | [
"Apache-2.0"
] | null | null | null | # database.py creates a .db file for performing umls searches.
import atexit
import os
import sqlite3
import sys
from read_config import enabled_modules
features_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if features_dir not in sys.path:
sys.path.append(features_dir)
# find where umls tabl... | 27.385366 | 79 | 0.612576 |
f717576ebe1b232b2fdba0695ea262b2ae5063cc | 2,568 | py | Python | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | 2 | 2019-05-12T16:11:20.000Z | 2020-04-10T22:39:57.000Z | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | src/base/base_train.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | import tensorflow as tf
class BaseTrain:
"""Standard base_train-class for easy multiple-inheritance.
It is responsible for defining the functions to be implemented with any child.
Attributes:
sess: Tensorflow session to use.
model: Model to be trained.
data: Data_loader object... | 36.169014 | 115 | 0.640576 |
f7177676b64b016a2006776e619b093446b0ff41 | 5,353 | py | Python | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | 2 | 2019-02-06T17:50:24.000Z | 2019-11-20T16:51:34.000Z | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | 1 | 2019-11-25T16:25:51.000Z | 2019-11-25T18:09:39.000Z | test/language/choice_types/python/UInt64ParamChoiceTest.py | PeachOS/zserio | ea01f6906c125a6baab7e8ed865eeb08cd46c37c | [
"BSD-3-Clause"
] | null | null | null | import unittest
import zserio
from testutils import getZserioApi
class UInt64ParamChoiceTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.api = getZserioApi(__file__, "choice_types.zs").uint64_param_choice
def testSelectorConstructor(self):
uint64ParamChoice = self.api.UInt64... | 40.862595 | 86 | 0.721838 |
f7178a5f0eaaff23bb2efef24ecd4ae204c5ee9e | 638 | py | Python | src/django_backend_api/manage.py | Adityaraj1711/django-backend-architecture | 7f3c270af0cb5dd2ebc097c7436a4958cd48ff7c | [
"MIT"
] | 25 | 2020-04-28T19:25:28.000Z | 2021-07-04T17:24:35.000Z | src/django_backend_api/manage.py | Adityaraj1711/django-backend-architecture | 7f3c270af0cb5dd2ebc097c7436a4958cd48ff7c | [
"MIT"
] | 13 | 2020-08-05T22:40:37.000Z | 2022-03-12T00:24:36.000Z | src/django_backend_api/manage.py | Adityaraj1711/django-backend-architecture | 7f3c270af0cb5dd2ebc097c7436a4958cd48ff7c | [
"MIT"
] | 2 | 2020-10-29T13:10:01.000Z | 2021-11-22T01:55:14.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_backend_api.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
r... | 29 | 82 | 0.688088 |
f717ba6db19fac8fe6c6bc3c5388211b577e2db4 | 871 | py | Python | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-containerd-2/charm/hooks/relations/untrusted-container-runtime/requires.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 6 | 2021-10-01T19:46:14.000Z | 2022-03-31T17:05:08.000Z | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-containerd-2/charm/hooks/relations/untrusted-container-runtime/requires.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 111 | 2021-10-01T18:18:17.000Z | 2022-03-29T12:23:20.000Z | tests/unit/fake_data_root/kubernetes/var/lib/juju/agents/unit-containerd-2/charm/hooks/relations/untrusted-container-runtime/requires.py | KellenRenshaw/hotsos | e3fc51ab7f8af606a5846a3486a7fda23d761583 | [
"Apache-2.0"
] | 10 | 2021-09-29T14:47:54.000Z | 2022-03-18T14:52:16.000Z | from charms.reactive import (
Endpoint,
set_flag,
clear_flag
)
from charms.reactive import (
when,
when_not
)
class ContainerRuntimeRequires(Endpoint):
@when('endpoint.{endpoint_name}.changed')
def changed(self):
set_flag(self.expand_name('endpoint.{endpoint_name}.available'))
... | 24.885714 | 74 | 0.626866 |
f717ba7e0a6e1a58c6c5756909c027da10c010bb | 878 | py | Python | read_exif.py | kiyoon/camera-tools | 2e269141597dd27ec7d41e49285e01ef566cb54c | [
"MIT"
] | 1 | 2021-11-14T23:30:47.000Z | 2021-11-14T23:30:47.000Z | read_exif.py | kiyoon/camera-tools | 2e269141597dd27ec7d41e49285e01ef566cb54c | [
"MIT"
] | null | null | null | read_exif.py | kiyoon/camera-tools | 2e269141597dd27ec7d41e49285e01ef566cb54c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
class Formatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescriptionHelpFormatter):
pass
parser = argparse.ArgumentParser(
description='''Read EXIF data
Author: Kiyoon Kim (yoonkr33@gmail.com)''',
formatter_class=Formatter)
parser.add_argument('i... | 24.388889 | 94 | 0.671982 |
f717bdb31e80489aaefa7fbd595c263379b27f37 | 15,376 | py | Python | src/hub/dataload/sources/chembl/chembl_upload.py | ravila4/mychem.info | 9b63b5f0957b5e7b252ca8122734a363905036b3 | [
"Apache-2.0"
] | null | null | null | src/hub/dataload/sources/chembl/chembl_upload.py | ravila4/mychem.info | 9b63b5f0957b5e7b252ca8122734a363905036b3 | [
"Apache-2.0"
] | null | null | null | src/hub/dataload/sources/chembl/chembl_upload.py | ravila4/mychem.info | 9b63b5f0957b5e7b252ca8122734a363905036b3 | [
"Apache-2.0"
] | null | null | null | """
Chembl uploader
"""
# pylint: disable=E0401, E0611
import os
import glob
import pymongo
import biothings.hub.dataload.storage as storage
from biothings.hub.dataload.uploader import ParallelizedSourceUploader
from hub.dataload.uploader import BaseDrugUploader
from hub.datatransform.keylookup import MyChemKeyLookup
f... | 40.569921 | 95 | 0.280437 |
f717c2aceaf306d0f7eae56f9df7f70d7fb7e56b | 2,488 | py | Python | usort/util.py | thatch/usort | 2ca1ff63d6cfc79e76ea95b69d162f4579c3fa3c | [
"MIT"
] | null | null | null | usort/util.py | thatch/usort | 2ca1ff63d6cfc79e76ea95b69d162f4579c3fa3c | [
"MIT"
] | null | null | null | usort/util.py | thatch/usort | 2ca1ff63d6cfc79e76ea95b69d162f4579c3fa3c | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from contextlib import contextmanager
from contextvars import ContextVar
from pathlib import Path
from time import monotonic
from typing impor... | 30.716049 | 86 | 0.658762 |
f717c597ce99c986760a12c223c014567cf34f38 | 96,886 | py | Python | ThirdParty/ZopeInterface/zope/interface/tests/test_registry.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 3 | 2016-02-01T02:29:51.000Z | 2020-09-04T17:19:24.000Z | ThirdParty/ZopeInterface/zope/interface/tests/test_registry.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | ThirdParty/ZopeInterface/zope/interface/tests/test_registry.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 6 | 2017-02-13T09:11:02.000Z | 2021-06-29T11:22:18.000Z | ##############################################################################
#
# Copyright (c) 2001, 2002, 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution... | 39.464766 | 80 | 0.630783 |
f71806245033ff31b7f8e029e27f81e487b11834 | 20,468 | py | Python | cadnano/views/pathview/tools/pathselection.py | sherwoodyao/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 69 | 2015-01-13T02:54:40.000Z | 2022-03-27T14:25:51.000Z | cadnano/views/pathview/tools/pathselection.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 127 | 2015-01-01T06:26:34.000Z | 2022-03-02T12:48:05.000Z | cadnano/views/pathview/tools/pathselection.py | scholer/cadnano2.5 | ce6ff019b88ee7728de947bd86b35861cf57848d | [
"BSD-3-Clause"
] | 48 | 2015-01-22T19:57:49.000Z | 2022-03-27T14:27:53.000Z | # -*- coding: utf-8 -*-
import logging
from math import floor
from PyQt5.QtCore import (
QPointF,
QRectF,
Qt
)
from PyQt5.QtGui import (
QPainterPath,
QKeyEvent,
QMouseEvent
)
from PyQt5.QtWidgets import (
QGraphicsItem,
QGraphicsItemGroup,
QGraphicsPathItem,
QGraphicsSceneMouse... | 28.467316 | 109 | 0.569572 |
f7180a3e45377a91711d6c8fa67895d8d860641f | 1,780 | py | Python | mlprocessors/consolecapture.py | flatironinstitute/mountaintools | d5680599381e0810c4aa5b309b9ef9ec7f2d1b25 | [
"Apache-2.0"
] | 2 | 2019-11-07T14:09:02.000Z | 2021-09-23T01:09:04.000Z | mountaintools/mlprocessors/consolecapture.py | flatironinstitute/spikeforest_old | d9470194dc906b949178b9c44d14aea57a1f6c27 | [
"Apache-2.0"
] | 13 | 2019-05-04T09:34:53.000Z | 2019-06-23T07:05:58.000Z | mountaintools/mlprocessors/consolecapture.py | flatironinstitute/spikeforest_old | d9470194dc906b949178b9c44d14aea57a1f6c27 | [
"Apache-2.0"
] | 1 | 2021-09-23T01:07:21.000Z | 2021-09-23T01:07:21.000Z | from typing import Any
import sys
import time
import os
import tempfile
class Logger2():
def __init__(self, file1: Any, file2: Any):
self.file1 = file1
self.file2 = file2
def write(self, data: str) -> None:
self.file1.write(data)
self.file2.write(data)
def flush(self) -> ... | 28.709677 | 70 | 0.626404 |
f718393cecda836a590a6dc97b77a13ca4ce20f5 | 70,177 | py | Python | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | cathpy/core/align.py | shouldsee/cathpy | 5f7fa1322434b2d254f0158c5840f029b12dbafe | [
"MIT"
] | null | null | null | """
Manipulate protein sequences and alignments
"""
# core
import io
import gzip
import logging
import re
import functools
# pip
import dendropy
# local
from cathpy.core import error as err
from cathpy.core.tests import is_valid_domain_id
from cathpy.core.models import AminoAcid, AminoAcids, Residue, Segment
LOG = ... | 38.139674 | 134 | 0.561281 |
f71854cf216fd9c15655470c36650db459061d05 | 28,170 | py | Python | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfdtimeseries.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | """
MPI-aware read and write PETSc Vec to HDF5
The goal of this module is to save snapshots of a PETSc Vec to HDF5
files, and obviously to read them again later. The obvious way to do
this is parallel HDF5. Unfortunately, distributions of HDF5 and h5py
may be built without support for parallel operation. (In particula... | 33.939759 | 80 | 0.540469 |
f71859cec54c2858e6e96dfaa122fa325313a2ed | 5,325 | py | Python | artellapipe/core/assetfile.py | ArtellaPipe/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | 7 | 2019-10-28T05:18:30.000Z | 2020-08-21T05:36:52.000Z | artellapipe/core/assetfile.py | tpoveda/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | 4 | 2020-01-22T02:41:54.000Z | 2020-03-17T10:49:12.000Z | artellapipe/core/assetfile.py | tpoveda/artellapipe | 3400f6a55f124f639143fe01c559059eaba23b22 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""
Module that contains implementations for asset files
"""
from __future__ import print_function, division, absolute_import
__author__ = "Tomas Poveda"
__license__ = "MIT"
__maintainer__ = "Tomas Poveda"
__email__ = "tpovedatd@gmail.com"
import os
import logging
imp... | 29.583333 | 116 | 0.624977 |
f71860515aa0c48a7527206271305a67a617026e | 5,375 | py | Python | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | entropylab/instruments/tests/test_qcodes_dummy.py | IgorQM/entropy | 8cbd3da356d8196e89eb9d810e643c80d6608481 | [
"BSD-3-Clause"
] | null | null | null | from typing import Optional, Dict, Any
import pytest
@pytest.mark.skip()
def test_qcodes_dummy():
from qcodes.instrument.base import InstrumentBase as qcodes_InstrumentBase
from entropylab.instruments.qcodes_adapter import QcodesAdapter
class MockQcodesDriver(qcodes_InstrumentBase):
d... | 33.59375 | 85 | 0.616744 |
f7188fdf67798b6b524e83b8873542b335c4a5b4 | 8,649 | py | Python | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | acq4/devices/PatchStar/patchstar.py | tropp/ACQ4 | 792e05e99cedfc175593d200aeabecd6fa6304ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
import numpy as np
from PyQt4 import QtGui, QtCore
from ..Stage import Stage, MoveFuture, StageInterface
from acq4.drivers.PatchStar import PatchStar as PatchStarDriver
from acq4.util.Mutex import Mutex
from acq4.util.Thread import Thread
from acq4.pyqtgraph import debug, ptime, Spin... | 33.01145 | 122 | 0.575327 |
f71898c3ed083524faabeea56c687bae2ca86d8e | 807 | py | Python | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/python/rules/setup_py_util_test.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pants.backend.python.rules.setup_py_util import distutils_repr
testdata = {
'foo': 'bar',
'baz': {
'qux': [123, 456],
'quux': ('abc', b'xyz'),
'corge': {1, 2, 3}
}... | 16.469388 | 67 | 0.448575 |
f718a3bfab465e69af8eecdfc4731de81a8437f6 | 3,893 | py | Python | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | null | null | null | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | null | null | null | deletionwatcher.py | Floern/SmokeDetector | 2818bbd23af15440836c61c4023d063264433c66 | [
"Apache-2.0",
"MIT"
] | 1 | 2018-10-11T13:41:49.000Z | 2018-10-11T13:41:49.000Z | # coding=utf-8
import json
import requests
import time
# noinspection PyPackageRequirements
import websocket
# noinspection PyPackageRequirements
from bs4 import BeautifulSoup
from threading import Thread
from urllib.parse import urlparse
import metasmoke
from globalvars import GlobalVars
import datahandling
# noinsp... | 40.552083 | 120 | 0.599281 |
f718be3ab1e8857e704777f735842ba57cdcf3f2 | 27,925 | py | Python | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/communication/azure-communication-chat/tests/test_chat_thread_client_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE.txt in the project root for
# license information.
# -------------------------------------------------------------------------
from azure.... | 37.134309 | 126 | 0.582775 |
f718d25705647be878e1d7696bde13ea0e8f11b5 | 138 | py | Python | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 6 | 2015-09-03T09:01:46.000Z | 2021-01-28T20:15:18.000Z | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 7 | 2015-06-04T14:48:20.000Z | 2018-02-28T09:53:03.000Z | testproj/testproj/testapp/admin.py | Polyconseil/django-select2-rocks | 0cc29af55cdd7bec7da773966bec0da84fa7aa6c | [
"BSD-2-Clause"
] | 3 | 2015-04-05T14:20:10.000Z | 2016-09-30T17:02:01.000Z | from django.contrib import admin
from .models import Beach, SelectedBeach
admin.site.register(Beach)
admin.site.register(SelectedBeach)
| 19.714286 | 40 | 0.826087 |
f718ea668f086785a2ecdd071fd77637573089f4 | 53,142 | py | Python | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | discretisedfield/field.py | minrk/discretisedfield | 251584f8d976a7fafdff5402d16327489407c4dd | [
"BSD-3-Clause"
] | null | null | null | import pyvtk
import struct
import matplotlib
import numpy as np
import mpl_toolkits.axes_grid1
import discretisedfield as df
import ubermagutil.typesystem as ts
import discretisedfield.util as dfu
import matplotlib.pyplot as plt
@ts.typesystem(mesh=ts.Typed(expected_type=df.Mesh),
dim=ts.Scalar(expecte... | 35.333777 | 79 | 0.527003 |
f7190ba74292947809c2128ff0aaecac93157a21 | 815 | py | Python | src/configs/model_id_opts.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | src/configs/model_id_opts.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | src/configs/model_id_opts.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | """
Author : Raquel G. Alhama
Desc:
"""
def strid_to_opts(strid):
"""
Given model id as string, extract parameter dictionary.
Reverse of config_loader.opts2strid
:param strid:
:return:
"""
raise NotImplementedError
#Method not finished
parts = strid.split("_")
param_keys=",".s... | 22.638889 | 76 | 0.516564 |
f71916c16a3387a714ba74da62f20782e4f9fe3d | 7,539 | py | Python | core/views.py | ICFL-UP/Yrden | 88c421f1b391e9a6943455b05b8f397e9023187b | [
"MIT"
] | null | null | null | core/views.py | ICFL-UP/Yrden | 88c421f1b391e9a6943455b05b8f397e9023187b | [
"MIT"
] | 6 | 2022-02-16T06:08:43.000Z | 2022-02-16T06:08:55.000Z | core/views.py | ICFL-UP/Yrden | 88c421f1b391e9a6943455b05b8f397e9023187b | [
"MIT"
] | null | null | null | import logging
import os
import json
import shutil
import threading
from typing import Any, List
from django.contrib.auth import login
from django.forms.models import BaseModelForm
from django.http.request import HttpRequest
from django.http.response import HttpResponse
from django.views.generic import ListView, Detai... | 38.464286 | 110 | 0.67635 |
f71918615f3a215dc0bc915794b798facde5f6a8 | 22,397 | py | Python | qnarre/models/ibert_quant_modules.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/ibert_quant_modules.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/models/ibert_quant_modules.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | import decimal
import numpy as np
import torch
from torch import nn
from torch.autograd import Function
from ...utils import logging
logger = logging.get_logger(__name__)
class QuantEmbedding(qc.Module):
def __init__(
self,
num_embeddings,
embedding_dim,
padding_idx=None,
... | 33.934848 | 105 | 0.603831 |
f7191a9344d5198ccde86f8f184716fe9107a381 | 5,646 | py | Python | textacy/text_utils.py | tbsexton/textacy | 964614213c7261f91f09c106334269388d45f790 | [
"Apache-2.0"
] | null | null | null | textacy/text_utils.py | tbsexton/textacy | 964614213c7261f91f09c106334269388d45f790 | [
"Apache-2.0"
] | null | null | null | textacy/text_utils.py | tbsexton/textacy | 964614213c7261f91f09c106334269388d45f790 | [
"Apache-2.0"
] | null | null | null | """
Text Utils
----------
Set of small utility functions that take text strings as input.
"""
import logging
import re
from typing import Iterable, Optional, Set, Tuple
from . import constants
LOGGER = logging.getLogger(__name__)
def is_acronym(token: str, exclude: Optional[Set[str]] = None) -> bool:
"""
P... | 35.734177 | 90 | 0.626993 |
f7192d36362e57de19098cfbb44d604a21beea70 | 27 | py | Python | src/user/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/user/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | src/user/__init__.py | aleksandrgordienko/melissa-quiz | 49b165acc9aae0ad84cf751cbeb4f6a27dd5ab0f | [
"MIT"
] | null | null | null | from user.user import User
| 13.5 | 26 | 0.814815 |
f7194f875486f67d1eadb26fc5e87f6bfaed4596 | 6,237 | py | Python | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 13 | 2017-11-08T07:09:13.000Z | 2022-03-28T07:09:47.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 3 | 2018-03-08T04:30:19.000Z | 2019-01-03T15:47:24.000Z | detect/image_detector.py | Prasad9/Detect-Flags-SSD | c0d662bde99ed8df33d72bd06d61d5eb869d31a5 | [
"MIT"
] | 5 | 2018-01-15T15:26:44.000Z | 2021-08-18T08:02:51.000Z | from __future__ import print_function
import mxnet as mx
import numpy as np
from timeit import default_timer as timer
from dataset.iterator import DetTestImageIter
import cv2
class ImageDetector(object):
"""
SSD detector which hold a detection network and wraps detection API
Parameters:
----------
symbol : mx.Sy... | 29.842105 | 137 | 0.674683 |
f7194fe7656b09b6c529b0342d12157fb1da984f | 710 | py | Python | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | tests/apps/minimal2/application.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | from os import path
from blazeutils import prependsitedir
from blazeweb.application import WSGIApp
from blazeweb.middleware import full_wsgi_stack
from minimal2.config import settings as settingsmod
from blazeweb.scripting import application_entry
# make sure our base module gets put on the path
try:
import minima... | 25.357143 | 61 | 0.773239 |
f71950d1cafe3ade67ae0b9180b0da8119152a85 | 4,293 | py | Python | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/steven/disentanglement/pointmass/disentanglement_rig.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import os.path as osp
import torch.nn.functional as F
import multiworld.envs.mujoco as mwmj
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.launchers.experiments.disentanglement.launcher import \
disentangled_grill_her_twin_sac_experiment
from rlkit.t... | 32.278195 | 127 | 0.575355 |
f719631ce5568ca0573b1aff26b681add708c145 | 5,186 | py | Python | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/backends/qt_compat.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | """ A Qt API selector that can be used to switch between PyQt and PySide.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import os
from matplotlib import rcParams, verbose
# Available APIs.
QT_API_PYQT = 'PyQt4' # API is not set here;... | 33.895425 | 79 | 0.642885 |
f7196801f8fa58470aa03ad73efa1012011af858 | 28,195 | py | Python | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | sacla/scripts/backups/sacla3_Chip_Manager_v7BAK.py | beamline-i24/DiamondChips | 02fb58a95ad2c1712c41b641eb5f197d688c54c3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import pv, os, re, sys
import math, time, string
import numpy as np
from time import sleep
from ca import caput, caget
import logging as lg
import sacla3_Chip_StartUp_v7 as startup
import sacla3_Chip_Mapping_v7 as mapping
lg.basicConfig(format='%(asctime)s %(levelname)s: \t%(message)s',level=lg.DEB... | 36.952818 | 171 | 0.563043 |
f71968c2bfbb4980fde3dad9d2991f5150aef9eb | 2,841 | py | Python | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | null | null | null | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 6 | 2016-11-01T18:42:34.000Z | 2020-11-16T16:52:14.000Z | setup.py | blazelibs/blazeweb | b120a6a2e38c8b53da2b73443ff242e2d1438053 | [
"BSD-3-Clause"
] | 1 | 2020-01-22T18:20:46.000Z | 2020-01-22T18:20:46.000Z | import os
try:
from setuptools import setup, find_packages
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup, find_packages
# pip install -e .[develop]
develop_requires = [
'WebTest',
'ScriptTest',
'coverage',
'docutils',
'minimoc... | 28.128713 | 78 | 0.67793 |
f719a60077cb4b23bbe3c54efafc1d30bc3f8163 | 3,252 | py | Python | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | 1 | 2019-03-13T16:05:11.000Z | 2019-03-13T16:05:11.000Z | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | null | null | null | config.py | LongKt7/Face_Recognize_Pytorch | baa02e633d379abe1001c8b8acb942617177329c | [
"MIT"
] | 1 | 2019-03-15T09:09:08.000Z | 2019-03-15T09:09:08.000Z | from easydict import EasyDict as edict
# from pathlib import Path
import torch
import os
from torchvision import transforms as trans
from utils.constants import *
list_model = ['wget https://www.dropbox.com/s/akktsgxp0n8cwn2/model_mobilefacenet.pth?dl=0 -O model_mobilefacenet.pth',
'wget https://www.dropbox.com/s/kzo52... | 47.823529 | 119 | 0.634071 |
f719a616152547d0300a25992cdb6dbefb41b0a6 | 16,599 | py | Python | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | utils/tests/test_util.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | # Copyright 2019 Graphcore Ltd.
from statistics import mean
import numpy as np
import os
import re
import subprocess
import sys
import time
"""Library of utility functions common between frameworks"""
def parse_results_for_speed(output, iter_tolerance, speed_tolerance):
"""Look for <iter number> sec/itr. <speed... | 34.36646 | 85 | 0.636123 |
f719bd0e61d8fc8ee4756b2db46ad0dfa8dfa39d | 6,499 | py | Python | twisted/test/test_text.py | sxamit/twisted | 30f6966329c857c3631c60aeb420d84d7828e01e | [
"MIT",
"Unlicense"
] | 1 | 2017-08-07T14:52:02.000Z | 2017-08-07T14:52:02.000Z | Lib/site-packages/twisted/test/test_text.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/twisted/test/test_text.py | adzhou/Python27 | a7113b69d54a04cc780143241c2f1fe81939ad3a | [
"bzip2-1.0.6"
] | 1 | 2018-11-07T12:52:07.000Z | 2018-11-07T12:52:07.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.text}.
"""
from cStringIO import StringIO
from twisted.trial import unittest
from twisted.python import text
sampleText = \
"""Every attempt to employ mathematical methods in the study of chemical
questions must ... | 26.744856 | 103 | 0.59086 |
f719f0bd0810de624991f194db2d5e2731bca1d7 | 2,976 | py | Python | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | etcd/setup.py | dvanderveer/integrations-core | 41dd9950296455457c9b7342584153678503d5aa | [
"BSD-3-Clause"
] | null | null | null | # Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
import re
here = path.abspath(path.dirname(__file__))
# get the long description from the readme file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
l... | 29.176471 | 70 | 0.612231 |
f719f96e68fd7b17d73ed6b9460ebade8987ebf6 | 4,908 | py | Python | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | 3 | 2021-02-02T22:38:50.000Z | 2021-08-23T20:41:10.000Z | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | import html2text
import pandas as pd
from wasabi import Printer
from parseepo import validate
from parseepo.exception import SingleAttrException
from parseepo.utils import prepare_name
h = html2text.HTML2Text()
msg = Printer()
NAMES = ["EP", "Num", "Ext", "publication_date", "language", "attr", "text"]
NESTED_ATTR = ... | 36.355556 | 92 | 0.581296 |
f71a0da9d68a3d4c9024e6fcb718688385715211 | 83 | py | Python | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | 1 | 2021-06-04T05:51:39.000Z | 2021-06-04T05:51:39.000Z | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | null | null | null | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | null | null | null | from buttonlist.app import main
if __name__ == '__main__':
main().main_loop()
| 16.6 | 31 | 0.698795 |
f71a1e9ab3b466d5a052c9eb0a36e082154d5dbc | 1,747 | py | Python | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import gym
import numpy as np
from igibson.robots.robot_locomotor import LocomotorRobot
class JR2(LocomotorRobot):
"""
JR2 robot (no arm)
Reference: https://cvgl.stanford.edu/projects/jackrabbot/
Uses joint velocity control
"""
def __init__(self, config):
self.config = config
... | 31.196429 | 106 | 0.566113 |
f71a1fb42d65587e922d09e984061b07a1aaed3f | 122 | py | Python | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 3 | 2019-11-21T09:04:36.000Z | 2019-11-23T13:29:43.000Z | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 13 | 2019-11-21T20:28:23.000Z | 2019-11-26T19:34:22.000Z | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | null | null | null | AUTHENTICATION_BACKENDS = (
"django_pam.auth.backends.PAMBackend",
"django.contrib.auth.backends.ModelBackend",
)
| 24.4 | 48 | 0.754098 |
f71a3354afd52b38a1b508cdd629a00d472d8746 | 2,651 | py | Python | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 3 | 2017-06-05T15:46:22.000Z | 2019-05-22T21:26:54.000Z | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 93 | 2016-06-22T18:57:47.000Z | 2022-02-14T10:50:27.000Z | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | null | null | null | import unittest
import unittest.mock
import os
from py_compile import compile
import sys
import random
import time
import tempfile
from filecmp import cmp
def make_random_string(length=25, lower=0, upper=255):
return "".join(chr(random.randint(lower,upper)) for i in range(length))
def tempname():
(handle, nam... | 32.728395 | 102 | 0.590343 |
f71a3706a5e1e09a9b5ac6542d63281e2cb4bab7 | 1,370 | py | Python | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 16 | 2021-02-15T13:49:29.000Z | 2022-03-29T10:34:43.000Z | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 8 | 2021-02-27T18:40:46.000Z | 2021-10-03T15:49:27.000Z | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 11 | 2021-02-16T04:58:08.000Z | 2022-02-21T20:51:55.000Z | # Copyright (C) 2019-2021 HERE Europe B.V.
# SPDX-License-Identifier: Apache-2.0
"""This module will test platform api module."""
import pytest
from requests_oauthlib import OAuth1
from here_location_services.platform.apis.aaa_oauth2_api import AAAOauth2Api
from here_location_services.platform.apis.api import Api as P... | 34.25 | 97 | 0.750365 |
f71a703f2090876a8e79cf5a51d2bb5e3344842c | 153,793 | py | Python | spyke/sort.py | spyke/spyke | 20934521de9c557924911cf6190690ac1c6f8e80 | [
"CNRI-Python"
] | 22 | 2015-06-01T03:31:00.000Z | 2022-03-18T09:12:28.000Z | spyke/sort.py | spyke/spyke | 20934521de9c557924911cf6190690ac1c6f8e80 | [
"CNRI-Python"
] | 3 | 2017-03-24T19:16:02.000Z | 2021-01-27T14:34:30.000Z | spyke/sort.py | spyke/spyke | 20934521de9c557924911cf6190690ac1c6f8e80 | [
"CNRI-Python"
] | 6 | 2015-07-10T15:28:08.000Z | 2022-03-17T19:30:45.000Z | """Spike sorting classes and window"""
from __future__ import division
from __future__ import print_function
__authors__ = ['Martin Spacek', 'Reza Lotun']
import os
import sys
import time
import datetime
from copy import copy
import operator
import random
import shutil
import hashlib
import multiprocessing as mp
fr... | 47.437693 | 98 | 0.600495 |
f71a7085403e8ce0a19e0672e598aeec15a4a023 | 899 | py | Python | examples/show_debug.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 2 | 2019-01-23T19:11:53.000Z | 2019-04-05T17:45:49.000Z | examples/show_debug.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | null | null | null | examples/show_debug.py | Matuiss2/python-sc2 | dd93215d8b09b7ddacfd5c3cc4e9f43641d3f953 | [
"MIT"
] | 1 | 2019-04-24T13:31:20.000Z | 2019-04-24T13:31:20.000Z | import sc2
from sc2 import run_game, maps, Race, Difficulty
from sc2.player import Bot, Computer
class MyBot(sc2.BotAI):
async def on_step(self, iteration):
for structure in self.structures:
self._client.debug_text_world(
"\n".join([
f"{structure.type_id.name... | 31 | 79 | 0.558398 |
f71a71c02c39541a49fbe5ad95d204ca99999495 | 1,129 | py | Python | migrations/versions/0076_add_intl_flag_to_provider.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | migrations/versions/0076_add_intl_flag_to_provider.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | migrations/versions/0076_add_intl_flag_to_provider.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | """empty message
Revision ID: 0076_add_intl_flag_to_provider
Revises: 0075_create_rates_table
Create Date: 2017-04-25 09:44:13.194164
"""
# revision identifiers, used by Alembic.
revision = "0076_add_intl_flag_to_provider"
down_revision = "0075_create_rates_table"
import sqlalchemy as sa
from alembic import op
de... | 25.659091 | 104 | 0.675819 |
f71aa357327a98795cb190e3909dda5f261e7b6a | 25,206 | py | Python | acore/classifier_cov_pow_toy_pvalue.py | zhao-david/ACORE-LFI | 91de88b77f0be110e42ed91bbb7a50b7ca83319a | [
"MIT"
] | null | null | null | acore/classifier_cov_pow_toy_pvalue.py | zhao-david/ACORE-LFI | 91de88b77f0be110e42ed91bbb7a50b7ca83319a | [
"MIT"
] | null | null | null | acore/classifier_cov_pow_toy_pvalue.py | zhao-david/ACORE-LFI | 91de88b77f0be110e42ed91bbb7a50b7ca83319a | [
"MIT"
] | null | null | null | from warnings import simplefilter
simplefilter(action='ignore', category=FutureWarning)
import numpy as np
import argparse
import pandas as pd
from tqdm.auto import tqdm
from datetime import datetime
from sklearn.metrics import log_loss
import seaborn as sns
import matplotlib.pyplot as plt
from utils.functions import... | 63.491184 | 134 | 0.519281 |
f71aa8d7c382bafc56b06793ddb3976f1a195ca1 | 11,480 | py | Python | StructVBERT/tasks/vqa.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 1 | 2021-08-05T05:41:50.000Z | 2021-08-05T05:41:50.000Z | StructVBERT/tasks/vqa.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | null | null | null | StructVBERT/tasks/vqa.py | onlyrico/AliceMind | a6a070b1610e4c4bfe84ee6c4195b2bc4f725ded | [
"Apache-2.0"
] | 1 | 2021-07-10T09:50:47.000Z | 2021-07-10T09:50:47.000Z | # coding=utf-8
# Copyleft 2019 project LXRT.
import os
import collections
import torch
import torch.nn as nn
import logging
from torch.utils.data.dataloader import DataLoader
from tqdm import tqdm
from param import args
from lxrt.qa_answer_table import load_lxmert_qa
from tasks.vqa_model import VQAModel
from tasks.v... | 38.394649 | 129 | 0.567334 |
f71aa988a5098b28bbada6d39c5173f2c7f1034c | 1,683 | py | Python | python/ctci/1_arrays_strings/6_Compression.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | python/ctci/1_arrays_strings/6_Compression.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | python/ctci/1_arrays_strings/6_Compression.py | othonreyes/code_problems | 6e65b26120b0b9d6e5ac7342a4d964696b7bd5bf | [
"MIT"
] | null | null | null | # Create a function that implements a basic compression algorithm by counting the chars
# thtat are present in a string, if the result string is longer than input
# then return original input.
#
# Examples:
# aaabcccccaaa: a3b1c5a3
# abcdef: abcdef
# aaaaaaaaaaba: a10b1a1
### Note: Don't use extra space
import unit... | 25.892308 | 87 | 0.618538 |
f71aad03581521af34e46f4263fc80abdb4a99c3 | 6,135 | py | Python | asposewordscloud/models/requests/insert_list_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | asposewordscloud/models/requests/insert_list_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | asposewordscloud/models/requests/insert_list_online_request.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | # coding: utf-8
# -----------------------------------------------------------------------------------
# <copyright company="Aspose" file="insert_list_online_request.py">
# Copyright (c) 2021 Aspose.Words for Cloud
# </copyright>
# <summary>
# Permission is hereby granted, free of charge, to any person obtaining a c... | 49.08 | 255 | 0.669927 |
f71ad0e03a1f64c0b8808cee586a271e9c91b997 | 950 | py | Python | clif/testing/python/non_raising_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 966 | 2017-04-18T04:14:04.000Z | 2022-03-03T21:22:44.000Z | clif/testing/python/non_raising_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 48 | 2017-05-02T23:51:29.000Z | 2021-12-06T19:10:11.000Z | clif/testing/python/non_raising_test.py | wangxf123456/clif | 9bff8a28f5d266d6ea4f4bb0dc1d9c9a0c9ee5b1 | [
"Apache-2.0"
] | 135 | 2017-04-26T06:15:30.000Z | 2022-01-07T02:17:20.000Z | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 28.787879 | 74 | 0.753684 |
f71b00645a1360df4f8b7496608b98342bb43f7f | 8,243 | py | Python | gym_acnportal/gym_acnsim/envs/tests/test_action_spaces.py | caltech-netlab/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | null | null | null | gym_acnportal/gym_acnsim/envs/tests/test_action_spaces.py | caltech-netlab/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | 3 | 2021-04-28T14:43:32.000Z | 2021-04-28T14:58:04.000Z | gym_acnportal/gym_acnsim/envs/tests/test_action_spaces.py | sunash/gym-acnportal | cacd2e4aa9159a3bf7f0b8e3db2dbb0832d76e46 | [
"BSD-3-Clause"
] | 1 | 2020-05-12T19:13:51.000Z | 2020-05-12T19:13:51.000Z | # coding=utf-8
""" Tests for SimAction and action space functions. """
import unittest
from typing import Callable, Dict, List, Any
from unittest.mock import create_autospec
import numpy as np
from gym import Space
from ..action_spaces import (
SimAction,
single_charging_schedule,
zero_centered_single_cha... | 37.298643 | 86 | 0.626592 |
f71b2aad75e30594e61025ad33be2a2c17932235 | 2,792 | py | Python | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/-reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | 1 | 2022-03-07T12:18:00.000Z | 2022-03-07T12:18:00.000Z | reinvent_models/link_invent/networks/encoder_decoder.py | GT4SD/reinvent_models | e1cf00d1b24fe5f39354e34829adc25460da84e2 | [
"MIT"
] | null | null | null | """
Implementation of a network using an Encoder-Decoder architecture.
"""
import torch.nn as tnn
from torch import Tensor
from reinvent_models.link_invent.networks.decoder import Decoder
from reinvent_models.link_invent.networks.encoder import Encoder
class EncoderDecoder(tnn.Module):
"""
An e... | 42.30303 | 115 | 0.666189 |
f71b2b58505f1a73cc43c49801a8cae13c3f8a26 | 43 | py | Python | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | 1 | 2018-04-02T15:38:10.000Z | 2018-04-02T15:38:10.000Z | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | null | null | null | src/Application/PythonScriptModule/proto/state_2.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | 1 | 2021-09-04T12:37:34.000Z | 2021-09-04T12:37:34.000Z | import state
def change():
state.x = 2 | 10.75 | 15 | 0.627907 |
f71b2ed9253b60e916abe7efa50cc6715f2d213c | 2,044 | py | Python | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 3 | 2020-02-12T01:24:46.000Z | 2020-02-13T00:50:46.000Z | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 32 | 2020-02-20T10:20:56.000Z | 2022-02-10T01:42:46.000Z | test/crawler/testICrawler.py | AutoDash/AutoDash | 3924795a04159f80ea3b65b2172747babd15f35f | [
"Apache-2.0"
] | 1 | 2020-02-22T02:47:19.000Z | 2020-02-22T02:47:19.000Z | #!/usr/bin/env python3
import unittest
from src.crawler.iCrawler import iCrawler, UndefinedDatabaseException
from src.data.MetaDataItem import MetaDataItem
from test.mock.MockDataAccessor import MockDataAccessor
class MockCrawler(iCrawler):
def __init__(self):
super().__init__()
def next_downloadabl... | 29.623188 | 86 | 0.675147 |
f71b315d6312d73a4f7581bd22785f23c8cb7785 | 5,935 | py | Python | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | dstoup/kwiver | a3a36317b446baf0feb6274235ab1ac6b4329ead | [
"BSD-3-Clause"
] | 1 | 2017-07-31T07:07:32.000Z | 2017-07-31T07:07:32.000Z | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | dstoup/kwiver | a3a36317b446baf0feb6274235ab1ac6b4329ead | [
"BSD-3-Clause"
] | 3 | 2021-03-19T15:39:43.000Z | 2021-09-08T02:47:15.000Z | sprokit/tests/bindings/python/sprokit/pipeline/test-scheduler_registry.py | acidburn0zzz/kwiver | 6e4205f1c46df04759c57c040f01cc804b27e00d | [
"BSD-3-Clause"
] | null | null | null | #!@PYTHON_EXECUTABLE@
#ckwg +28
# Copyright 2011-2013 by Kitware, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,... | 29.824121 | 85 | 0.694356 |
f71b4bb600bb418ed1ef7e86a5615b6ad8bfabf3 | 2,753 | py | Python | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 2 | 2020-07-24T19:26:51.000Z | 2021-08-21T21:04:11.000Z | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | null | null | null | python/dgl/nn/mxnet/conv/agnnconv.py | jinghuix/dgl | fae26dd15caac92458a08ad34889086e1e333ddd | [
"Apache-2.0"
] | 1 | 2021-03-09T12:42:46.000Z | 2021-03-09T12:42:46.000Z | """MXNet Module for Attention-based Graph Neural Network layer"""
# pylint: disable= no-member, arguments-differ, invalid-name
import mxnet as mx
from mxnet.gluon import nn
from .... import function as fn
from ..softmax import edge_softmax
from ..utils import normalize
from ....utils import expand_as_pair
class AGNN... | 36.706667 | 91 | 0.553578 |
f71b5dd3b2f1f6ba21eafc9f59670a50d9efc222 | 207 | py | Python | sciencer/expanders/__init__.py | SciencerIO/sciencer-toolkit | f17c4a5dfb6cc5dbabefe03b13eb1e5345f7b1b9 | [
"MIT"
] | 2 | 2022-03-28T17:27:21.000Z | 2022-03-29T22:27:15.000Z | sciencer/expanders/__init__.py | SciencerIO/sciencer-toolkit | f17c4a5dfb6cc5dbabefe03b13eb1e5345f7b1b9 | [
"MIT"
] | null | null | null | sciencer/expanders/__init__.py | SciencerIO/sciencer-toolkit | f17c4a5dfb6cc5dbabefe03b13eb1e5345f7b1b9 | [
"MIT"
] | 1 | 2022-03-28T14:47:53.000Z | 2022-03-28T14:47:53.000Z | """Sciencer Expanders"""
from .expander import Expander
from .expand_by_authors import ExpandByAuthors
from .expand_by_references import ExpandByReferences
from .expand_by_citations import ExpandByCitations
| 34.5 | 52 | 0.864734 |
f71b632bb314545ed7732ce47684f88d027b19e7 | 78 | py | Python | xpring/proto/__init__.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | 6 | 2019-12-11T00:54:56.000Z | 2021-03-11T19:44:44.000Z | xpring/proto/__init__.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | null | null | null | xpring/proto/__init__.py | mvadari/xpring-py | b837420127d1c1e5051ed305ed4f19fe9910a4f6 | [
"0BSD"
] | 9 | 2020-02-28T18:40:46.000Z | 2022-02-28T23:01:09.000Z | # The rest of this package, but not this __init__.py, is generated by protoc.
| 39 | 77 | 0.75641 |
f71b65b3b003148f57d2ed310d5f76f0d067c474 | 933 | py | Python | violas_client/canoser/bool_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/bool_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/canoser/bool_t.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from violas_client.canoser.base import Base
class BoolT(Base):
@classmethod
def encode(self, value):
if value:
return b'\1'
else:
return b'\0'
@classmethod
def decode_bytes(self, value):
if value == b'\0':
return False
e... | 23.923077 | 66 | 0.543408 |
f71b9e37908dd5da30752301903bfc85504aa496 | 728 | py | Python | Examples/AcceptAllRevisions.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 14 | 2018-07-15T17:01:52.000Z | 2018-11-29T06:15:33.000Z | Examples/AcceptAllRevisions.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 1 | 2018-09-28T12:59:34.000Z | 2019-10-08T08:42:59.000Z | Examples/AcceptAllRevisions.py | aspose-words-cloud/aspose-words-cloud-python | 65c7b55fa4aac69b60d41e7f54aed231df285479 | [
"MIT"
] | 2 | 2020-12-21T07:59:17.000Z | 2022-02-16T21:41:25.000Z | import os
import asposewordscloud
import asposewordscloud.models.requests
from asposewordscloud.rest import ApiException
from shutil import copyfile
words_api = WordsApi(client_id = '####-####-####-####-####', client_secret = '##################')
file_name = 'test_doc.docx'
# Upload original document to cloud stora... | 38.315789 | 108 | 0.787088 |
f71b9fe025bede004ce7e9ec58b828318f04188f | 15,536 | py | Python | src/api/block.py | BluCodeGH/Amulet-Map-Editor | 7d1d2243fc29095b3cffe8aa4979235444ba6738 | [
"MIT"
] | 1 | 2020-08-26T22:42:16.000Z | 2020-08-26T22:42:16.000Z | src/api/block.py | BluCodeGH/Amulet-Map-Editor | 7d1d2243fc29095b3cffe8aa4979235444ba6738 | [
"MIT"
] | null | null | null | src/api/block.py | BluCodeGH/Amulet-Map-Editor | 7d1d2243fc29095b3cffe8aa4979235444ba6738 | [
"MIT"
] | null | null | null | from __future__ import annotations
import copy
from sys import getsizeof
import re
from typing import Dict, Iterable, List, Tuple, Union, overload
from api.errors import InvalidBlockException
from utils import Int
class Block:
"""
Class to handle data about various blockstates and allow for extra blocks to ... | 35.149321 | 159 | 0.613092 |
f71bc619e7d4702a0d959637f7bce8d52e79debf | 3,636 | py | Python | LaserCommandConstants.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | LaserCommandConstants.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | LaserCommandConstants.py | jaredly/meerk40t | 446427e29104cb89fd2ee17ad824fc801d44afe0 | [
"MIT"
] | null | null | null | """
Laser Commands are a middle language of commands for spooling and interpreting.
NOTE: Never use the integer value, only the command name. The integer values are
permitted to change.
COMMAND_PLOT: takes a plot object to generate simple plot commands.
COMMAND_RASTER: takes a raster plot object which generate... | 52.695652 | 117 | 0.764851 |
f71bcbceeb060b7a31ed8e3353c036d8c37f27b4 | 621 | py | Python | supriya/ugens/BRF.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/BRF.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/ugens/BRF.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import collections
from supriya import CalculationRate
from supriya.ugens.Filter import Filter
class BRF(Filter):
"""
A 2nd order Butterworth band-reject filter.
::
>>> source = supriya.ugens.In.ar(bus=0)
>>> b_r_f =supriya.ugens.BRF.ar(source=source)
>>> b_r_f
BRF.ar()
... | 21.413793 | 79 | 0.645733 |
f71bf52008d28c422bd88b5ecd34e9e1fab1fa11 | 2,202 | py | Python | models/ModelUtil/util.py | Easonyesheng/StereoCameraToolk | 660e43019d0687e96e6da3aca48c1c423ae5abff | [
"MIT"
] | 27 | 2020-10-16T07:21:35.000Z | 2022-03-11T02:56:13.000Z | models/ModelUtil/util.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | null | null | null | models/ModelUtil/util.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | 6 | 2021-02-01T09:54:40.000Z | 2022-03-11T03:16:39.000Z | """Utility """
import numpy as np
import cv2
import os
import logging
def check_string_is_empty(string):
"""name
check string empty or not
Args:
Returns:
"""
if string == '':
return True
return False
def check_numpy_array(array):
"""name
check array empty or no... | 18.504202 | 108 | 0.583106 |
f71c071affad74a0e7aea1a05a898c897c918ab8 | 691 | py | Python | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | 16 | 2021-12-02T18:59:56.000Z | 2022-03-31T11:42:12.000Z | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | null | null | null | emtract/model_inference.py | dvamossy/EmTract | 68a00e3d63fbc2c401b0d2b297bf96ffb75940e8 | [
"MIT"
] | 1 | 2021-12-09T06:05:22.000Z | 2021-12-09T06:05:22.000Z | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
from emtract.model import Model, ModelType
import pandas as pd
class ModelInference:
MODEL_BASE_PATH = 'build/models/'
DATA_BASE_PATH = './emtract/data/'
def __init__(self, model_type):
if model_type == 'twitter':
self.model = Model(... | 27.64 | 62 | 0.662808 |
f71c111b67dac5359468b1d2de3970e43bfa4ea3 | 5,551 | py | Python | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/longest-arithmetic-subsequence.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
1027. Longest Arithmetic Subsequence
Medium
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
Recall that a subsequence of an array nums is a list nums[i1], nums[i2], ..., nums[ik] with 0 <= i1 < i2 < ... < ik <= nums.length - 1, and that a sequence seq is arithmet... | 31.361582 | 248 | 0.503513 |
f71c43a114c10204ad2b5ff2693265ff01dc5894 | 64 | py | Python | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 7 | 2019-06-09T13:03:18.000Z | 2022-02-19T08:50:51.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 1 | 2019-07-12T23:59:46.000Z | 2021-11-21T04:09:09.000Z | dr/__init__.py | jigangkim/domain_randomization | 07a309a9e824b5332219871abe8f0f657694b292 | [
"MIT"
] | 3 | 2020-05-01T13:18:25.000Z | 2021-03-30T11:52:33.000Z | import dr.dist
import dr.experiment
import dr.gym
import dr.ppo
| 12.8 | 20 | 0.8125 |
f71c525adccaf762f27c3b40fe128ecd416463bd | 6,309 | py | Python | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 37 | 2021-08-23T00:16:42.000Z | 2022-02-22T23:19:47.000Z | dico/base/model.py | dico-api/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 14 | 2021-08-07T09:01:29.000Z | 2022-02-27T15:19:36.000Z | dico/base/model.py | eunwoo1104/dico | 0bb80e2bb8dd66bb5078e52c9e37c180b7c80319 | [
"MIT"
] | 9 | 2021-08-25T04:14:05.000Z | 2022-02-27T15:08:49.000Z | import copy
import typing
from ..model.snowflake import Snowflake
if typing.TYPE_CHECKING:
from ..api import APIClient
class CopyableObject:
def copy(self):
return copy.deepcopy(self)
class EventBase:
def __init__(self, client: "APIClient", resp: dict):
self.raw: dict = resp
se... | 31.232673 | 87 | 0.579648 |
f71c54fd629fe7b2eed4f7bb9d796bb0a3a708f2 | 17,077 | py | Python | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | 1 | 2020-11-08T16:27:24.000Z | 2020-11-08T16:27:24.000Z | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | ignite/contrib/engines/common.py | VinhLoiIT/ignite | 3b2b9655ea9f80ce49b8a9f1c2d72f80e2a95f56 | [
"BSD-3-Clause"
] | null | null | null | from functools import partial
import warnings
import numbers
from collections.abc import Sequence, Mapping
import torch
import torch.distributed as dist
from ignite.engine import Engine, Events
from ignite.metrics import RunningAverage
from ignite.handlers import TerminateOnNan, ModelCheckpoint, EarlyStopping
from i... | 42.061576 | 119 | 0.701997 |
f71c77d1c0f627d4c0d8120689ae89c7e1a43d86 | 2,577 | py | Python | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-12-07T21:02:20.000Z | 2019-02-22T14:36:31.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 43 | 2018-11-30T11:31:43.000Z | 2019-04-03T16:09:06.000Z | agogosml_cli/cli/templates/{{cookiecutter.PROJECT_NAME_SLUG}}/e2e/testgen/main.py | cicorias/agogosml | 60e0b52c2fc721bdd965aadaf8c1afd1ddb9b7d1 | [
"MIT"
] | 13 | 2018-11-29T00:31:29.000Z | 2019-02-22T18:50:28.000Z | import json
import os
import sys
import time
from agogosml.common.abstract_streaming_client import find_streaming_clients
from agogosml.tools.sender import send
from agogosml.tools.receiver import receive
eh_base_config = {
"EVENT_HUB_NAMESPACE": os.getenv("EVENT_HUB_NAMESPACE"),
"EVENT_HUB_NAME": os.getenv("... | 28.955056 | 109 | 0.73962 |
f71c8d37ae326e29cdf957282fbbe1c51cf54ac4 | 1,004 | py | Python | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | null | null | null | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | 4 | 2020-10-09T15:59:09.000Z | 2020-11-18T08:34:44.000Z | src/slack.py | villoro/airflow_tasks | 81bd892744a9bbbf6e01903649b6c3786a955a5a | [
"MIT"
] | null | null | null | import json
import requests
from utils import get_secret
from utils import is_pro
def send_slack(text="", channel="test", blocks=None):
assert channel in ["test", "events", "general"]
webhook = get_secret(f"SLACK_WEBHOOK_{channel.upper()}")
data = {"text": text}
if blocks:
data["blocks"] ... | 21.361702 | 84 | 0.644422 |
f71c8f6aa2a62ab271f35e5e3080e58ef457c6cb | 782 | py | Python | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | examples/kmeansHeightWeight.py | Duane321/pyprobml | 6d0ba29f22dc7fec9dfc73788bc5520e97663bdb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import matplotlib.pyplot as pl
import numpy as np
from utils import util
from sklearn.cluster import KMeans
from utils.util import save_fig
data = util.load_mat('heightWeight/heightWeight')
data = data['heightWeightData']
markers = 'Dox'
colors = 'rgb'
for i in range(3):
KM_model = KMeans(i... | 28.962963 | 56 | 0.644501 |
f71d2652af9afa17cad4beb33592ed002af1f665 | 4,040 | py | Python | alipay/aop/api/request/AlipayCommerceEducateCampusBiztaskFinishRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceEducateCampusBiztaskFinishRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayCommerceEducateCampusBiztaskFinishRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayCommerceEducateCampusBiztaskFinishModel import AlipayCommerceEducateCampusBiztaskFinishModel
class AlipayCommerceEducateCampus... | 27.862069 | 148 | 0.650495 |
f71d6f2d262c160937a5abfacbcec8080a0ea116 | 228 | py | Python | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 9 | 2019-07-16T15:28:00.000Z | 2022-02-08T00:53:39.000Z | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 2 | 2020-01-09T15:27:58.000Z | 2020-09-23T18:04:41.000Z | algorithms/tree_diameter.py | nazaruka/Catan-AI | d7c91c7011ac82ad41d3b80a29c73c23ab7b579e | [
"MIT"
] | 5 | 2019-08-07T16:51:38.000Z | 2021-05-06T04:01:32.000Z | import networkx
from algorithms.dfs import dfs
def tree_diameter(t: networkx.Graph):
if __debug__:
assert networkx.is_tree(t)
v, _ = dfs(t)
_, longest_path_length = dfs(t, v)
return longest_path_length
| 20.727273 | 38 | 0.697368 |
f71d7ff644e054571c43b78fa96b7e2e5f88fb9d | 22,213 | py | Python | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 2 | 2020-08-01T18:19:05.000Z | 2021-06-30T06:37:23.000Z | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | null | null | null | sacred_mis/_sources/pomis2_57be95a71b575624c33c6ffe64e50d6e.py | T3p/baselines | 5623c9160d1e86ebca3e673f142fe6b14a1db06c | [
"MIT"
] | 5 | 2018-11-24T16:29:39.000Z | 2021-12-10T03:07:07.000Z | import numpy as np
import warnings
import baselines.common.tf_util as U
import tensorflow as tf
import time
from baselines.common import zipsame, colorize
from contextlib import contextmanager
from collections import deque
from baselines import logger
from baselines.common.cg import cg
from baselines.pomis2.memory impo... | 41.597378 | 183 | 0.620267 |
f71d84bd199bff2d65b7447164541e907a3f533b | 3,063 | py | Python | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 111 | 2016-05-18T04:18:18.000Z | 2021-11-03T02:05:19.000Z | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 1,103 | 2016-05-29T05:17:53.000Z | 2022-03-31T18:12:40.000Z | weasyl/blocktag.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 47 | 2016-05-29T20:48:37.000Z | 2021-11-12T09:40:40.000Z | from libweasyl import ratings
from libweasyl.cache import region
from weasyl import define as d
from weasyl import profile
from weasyl import searchtag
# For blocked tags, `rating` refers to the lowest rating for which that tag is
# blocked; for example, (X, Y, 10) would block tag Y for all ratings, whereas
# (X, Y, ... | 31.57732 | 119 | 0.627163 |
f71d86f566cba857829800b557598795af8fd8ab | 1,145 | py | Python | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 19 | 2016-01-26T18:36:38.000Z | 2022-03-12T02:32:01.000Z | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 3 | 2016-01-29T19:43:25.000Z | 2019-03-11T20:21:11.000Z | irc_hooky/base_object.py | byorgey/irc-hooky | e78942b7e13ce273c40815863d0384dddfa52243 | [
"MIT"
] | 2 | 2016-03-01T09:23:07.000Z | 2020-04-01T21:53:51.000Z | from abc import ABCMeta
import logging
import json
class BaseObject(object):
__metaclass__ = ABCMeta
def __init__(self, **kwargs):
self.log = logging.getLogger("irchooky")
for prop in self.properties:
setattr(self, prop, kwargs.get(prop, ""))
def load(self, object_dict):
... | 29.358974 | 67 | 0.567686 |
f71d9d0a976dd2d6fab7c86d11a2c85c733baff5 | 11,274 | py | Python | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | 2 | 2019-07-08T20:56:13.000Z | 2020-08-04T17:07:26.000Z | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/kubeflow/executor_wrappers.py | HassanDayoub/tfx | dc9221abbb8dad991d1ae22fb91876da1290efae | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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 a... | 35.23125 | 90 | 0.699219 |
f71dbea28c6bb0f66e8170b73a2d179586fc3668 | 8,203 | py | Python | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/identity/azure-identity/azure/identity/aio/_credentials/default.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import logging
import os
from typing import TYPE_CHECKING
from ..._constants import EnvironmentVariables
from ..._internal import get_default_authority, normalize_autho... | 55.802721 | 120 | 0.737413 |
f71dfbaeac1fbc882ae16f2bdf6a603281da54bd | 498 | py | Python | Florence/Base/FlorenceExceptions.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 65 | 2017-08-04T10:21:13.000Z | 2022-02-21T21:45:09.000Z | Florence/Base/FlorenceExceptions.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 6 | 2018-06-03T02:29:20.000Z | 2022-01-18T02:30:22.000Z | Florence/Base/FlorenceExceptions.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 10 | 2018-05-30T09:44:10.000Z | 2021-05-18T08:06:51.000Z |
class JacobianError(ArithmeticError):
def __init__(self,value=None):
self.value = value
def __str__(self):
if self.value is None:
self.value = 'Jacobian of mapping is close to zero'
return repr(self.value)
class IllConditionedError(ArithmeticError):
def __init__(self,... | 29.294118 | 63 | 0.638554 |
f71e08a94e9f047dfa54cd7ce41c674a5cd1f8bd | 15,999 | py | Python | game.py | theDrinkMD/twibbage | c0aba60bd2df50f0a5688db4a01048ea1efd1a45 | [
"MIT"
] | null | null | null | game.py | theDrinkMD/twibbage | c0aba60bd2df50f0a5688db4a01048ea1efd1a45 | [
"MIT"
] | null | null | null | game.py | theDrinkMD/twibbage | c0aba60bd2df50f0a5688db4a01048ea1efd1a45 | [
"MIT"
] | null | null | null | from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse
from gameIdGenerator import createNewGameId
from models import Game, Player, Player_Answers, Question
from flask_sqlalchemy import SQLAlchemy
from datetime import datetime
import dbManager
import logging
import gameManager
im... | 59.475836 | 198 | 0.586349 |
f71e33bd084310d0aeba71a25aac58cd5fcf8bbb | 1,082 | py | Python | line.py | kavach-feature/Advanced_lane_finding | 12e4e330e338734fdb35655c7581b98ba1eb490b | [
"MIT"
] | null | null | null | line.py | kavach-feature/Advanced_lane_finding | 12e4e330e338734fdb35655c7581b98ba1eb490b | [
"MIT"
] | null | null | null | line.py | kavach-feature/Advanced_lane_finding | 12e4e330e338734fdb35655c7581b98ba1eb490b | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import pickle
class Line():
def __init__(self,n):
self.n=n
self.detected =False
#Polynomial coefficients of the lines
self.A=[]
self.B=[]
self.C=[]
#Running average of coefficients
sel... | 18.655172 | 106 | 0.660813 |
f71e3bf6b5a4e1db0bd1e025dcf8b861aeb828af | 922 | py | Python | test/test_steps.py | jladdjr/ansible-builder | 7520396f8921b98a033a8f25248dbadb9cd83901 | [
"Apache-2.0"
] | null | null | null | test/test_steps.py | jladdjr/ansible-builder | 7520396f8921b98a033a8f25248dbadb9cd83901 | [
"Apache-2.0"
] | null | null | null | test/test_steps.py | jladdjr/ansible-builder | 7520396f8921b98a033a8f25248dbadb9cd83901 | [
"Apache-2.0"
] | null | null | null | import pytest
import textwrap
from ansible_builder.steps import AdditionalBuildSteps, PipSteps, BindepSteps
def test_steps_for_collection_dependencies():
assert list(PipSteps('requirements.txt')) == [
'ADD requirements.txt /build/',
'RUN pip3 install --upgrade -r /build/requirements.txt'
]
... | 27.939394 | 77 | 0.667028 |
f71e69d9aaba3771528b04fae2b24551b321c43d | 25,996 | py | Python | homeassistant/components/simplisafe/__init__.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/simplisafe/__init__.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/simplisafe/__init__.py | stravinci/AIS-home-assistant | ead4dafd3f801ebeb32860bd34443ed24a4f4167 | [
"Apache-2.0"
] | null | null | null | """Support for SimpliSafe alarm systems."""
import asyncio
from uuid import UUID
from simplipy import API
from simplipy.entity import EntityTypes
from simplipy.errors import EndpointUnavailable, InvalidCredentialsError, SimplipyError
from simplipy.websocket import (
EVENT_CAMERA_MOTION_DETECTED,
EVENT_CONNECTI... | 34.52324 | 88 | 0.637021 |
f71e69e86ee5de49d09df8256001723a4356642b | 4,280 | py | Python | parsing/tracking_logs/generate_course_tracking_logs.py | andyzsf/edx_data_research | 07a587edb1dc4797f116bfeb60ffecbf4ce5bd7a | [
"MIT"
] | null | null | null | parsing/tracking_logs/generate_course_tracking_logs.py | andyzsf/edx_data_research | 07a587edb1dc4797f116bfeb60ffecbf4ce5bd7a | [
"MIT"
] | null | null | null | parsing/tracking_logs/generate_course_tracking_logs.py | andyzsf/edx_data_research | 07a587edb1dc4797f116bfeb60ffecbf4ce5bd7a | [
"MIT"
] | null | null | null | '''
This module will extract tracking logs for a given course and date range
between when course enrollment start and when the course ended. For each log,
the parent_data and meta_data from the course_structure collection will be
appended to the log based on the event key in the log
'''
import pymongo
import sys
fr... | 40 | 132 | 0.642991 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.