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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c4ea9ca0dd24f392f89badf80159100650f0d8f | 483 | py | Python | Python-code-snippets-201-300/278-Refuse wrong OS.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/278-Refuse wrong OS.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/278-Refuse wrong OS.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | """Code snippets vol-56
278-Refuse wrong OS.
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
Blog: stevepython.wordpress.com
Requirements:
None
Origin:
Steve Shambles.
"""
import sys
from tkinter import messagebox, Tk
root = Tk()
root.withdraw()
if sys.platform != 'linux':
# Change 'linux' t... | 18.576923 | 74 | 0.656315 |
1c4eaaea9a2cf467a12fcedde5b250d0ddb653f6 | 5,734 | py | Python | tests/test_pydent/test_relationships.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 5 | 2019-01-21T11:12:05.000Z | 2020-03-05T20:52:14.000Z | tests/test_pydent/test_relationships.py | aquariumbio/pydent | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 28 | 2020-11-18T02:07:09.000Z | 2021-06-08T15:49:41.000Z | tests/test_pydent/test_relationships.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 2 | 2021-02-27T19:23:45.000Z | 2021-09-14T10:29:07.000Z | """Test for pydent.relationships.py."""
from pydent import ModelBase
from pydent.relationships import HasMany
from pydent.relationships import HasManyGeneric
from pydent.relationships import HasManyThrough
from pydent.relationships import HasOne
from pydent.relationships import Many
from pydent.relationships import One... | 29.106599 | 79 | 0.681723 |
1c4eb022e1b84e78b8b70ac1b9bd445e8617b725 | 7,224 | py | Python | src/gemini/models/bnn.py | aspuru-guzik-group/gemini | 441d0f6c8842d15d4f917423ab440c5d78433199 | [
"MIT"
] | 8 | 2021-04-04T15:23:05.000Z | 2022-02-20T06:33:57.000Z | src/gemini/models/bnn.py | aspuru-guzik-group/gemini | 441d0f6c8842d15d4f917423ab440c5d78433199 | [
"MIT"
] | null | null | null | src/gemini/models/bnn.py | aspuru-guzik-group/gemini | 441d0f6c8842d15d4f917423ab440c5d78433199 | [
"MIT"
] | 5 | 2021-04-04T15:23:27.000Z | 2022-01-25T07:55:43.000Z | #!/usr/bin/env python
import os
import time
import numpy as np
import tensorflow.compat.v1 as tf
import tensorflow_probability as tfp
tfd = tfp.distributions
#==============================================================================
from gemini.metrics import Metrics
from gemini.models import NetworkModel
from ... | 37.046154 | 149 | 0.694906 |
1c4ec53b225364a2197d394fd100e74e8b322502 | 9,941 | py | Python | scripts/dtriac-19d/lif.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | scripts/dtriac-19d/lif.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | 26 | 2019-09-16T16:17:52.000Z | 2020-02-21T18:19:26.000Z | scripts/dtriac-19d/lif.py | brandeis-llc/dtriac-pipeline | e9501bb814038c439738520a45aef950deac6084 | [
"Apache-2.0"
] | null | null | null | """lif.py
NOTE: this script was taken from the tarsqi toolkit (utilities/lif.py).
Interface to the LAPPS Interchance Format and to the LAPPS Data container.
Contains code to:
- Read JSON-LD strings for containers and LIF objects
- Export Containers and LIF objects to JSON-LD strings
To read and write a data contai... | 33.698305 | 91 | 0.600342 |
1c4ee67eaaf68f6348cba6a303fd7e687914dfe4 | 1,022 | py | Python | otrrentworker/etl/__init__.py | omza/otrrentworker | faa70884a29dd271a33346ed45b3f43e5d7a7a21 | [
"MIT"
] | null | null | null | otrrentworker/etl/__init__.py | omza/otrrentworker | faa70884a29dd271a33346ed45b3f43e5d7a7a21 | [
"MIT"
] | null | null | null | otrrentworker/etl/__init__.py | omza/otrrentworker | faa70884a29dd271a33346ed45b3f43e5d7a7a21 | [
"MIT"
] | null | null | null | """ imports & globals """
from datetime import datetime, date, timedelta
""" run worker etl """
from etl.etl import (
import_otrepg,
import_otrgenres,
update_toprecordings,
update_torrents,
housekeeping
)
def runetl(config, log):
""" run etl """
log.info('run ETL')
genres = ... | 24.926829 | 57 | 0.598826 |
1c4eea03b1ac395266b039934320fe8e373673f2 | 369 | py | Python | brian2/utils/environment.py | achilleas-k/brian2 | 906563b6b1321585b082f79f74f1b4ab386347ec | [
"BSD-2-Clause"
] | 2 | 2020-03-20T13:30:19.000Z | 2020-03-20T13:30:57.000Z | brian2/utils/environment.py | divyashivaram/brian2 | ac086e478efa50be772c6cee55b52b43018bc77a | [
"BSD-2-Clause"
] | 13 | 2015-10-05T15:33:42.000Z | 2015-11-18T08:31:42.000Z | brian2/utils/environment.py | moritzaugustin/brian2 | d98ea0cb4af0c9426e71c8ee7659ddb13aea8593 | [
"BSD-2-Clause"
] | null | null | null | '''
Utility functions to get information about the environment Brian is running in.
'''
import __builtin__ as builtins
def running_from_ipython():
'''
Check whether we are currently running under ipython.
Returns
-------
ipython : bool
Whether running under ipython or not.
'''
... | 20.5 | 79 | 0.672087 |
1c4effb6d489705a92254288db6025464e2b1844 | 6,269 | py | Python | elit/components/taggers/transformers/transformer_transform_tf.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/taggers/transformers/transformer_transform_tf.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/taggers/transformers/transformer_transform_tf.py | emorynlp/levi-graph-amr-parser | f71f1056c13181b8db31d6136451fb8d57114819 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-29 15:14
from typing import Union, Tuple, List, Iterable
import tensorflow as tf
from elit.common.structure import SerializableDict
from elit.common.transform_tf import Transform
from elit.common.vocab_tf import VocabTF
from elit.layers.transformers.utils_tf imp... | 47.492424 | 225 | 0.494656 |
1c4f1851268aa141f272d1469a1613931fc5c425 | 433 | py | Python | setup.py | NishchalSharma/virtualenv-manager | d4411dd991ed1dd4f877a83e7811f2232fd9f670 | [
"BSD-3-Clause"
] | 6 | 2018-07-11T19:56:40.000Z | 2022-01-12T18:31:20.000Z | setup.py | NishchalSharma/virtualenv-manager | d4411dd991ed1dd4f877a83e7811f2232fd9f670 | [
"BSD-3-Clause"
] | 5 | 2017-01-29T02:35:49.000Z | 2021-12-05T08:59:04.000Z | setup.py | NishchalSharma/virtualenv-manager | d4411dd991ed1dd4f877a83e7811f2232fd9f670 | [
"BSD-3-Clause"
] | 9 | 2018-07-11T19:56:42.000Z | 2022-01-12T18:38:44.000Z | from distutils.core import setup
setup(
name='virtualenv-manager',
version='1.0',
author="Joshua Coady",
author_email='',
url='https://github.com/jcoady9/virtualenv-manager',
scripts=['bin/virtualenv-manager.py'],
packages=['virtualenv_manager'],
install_requires=[
'virtualenv',... | 27.0625 | 102 | 0.683603 |
1c4f1f0acf7a2e1f01176db7272f52fa784e7dda | 1,204 | py | Python | myia/operations/prim_tuple_setitem.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/operations/prim_tuple_setitem.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/operations/prim_tuple_setitem.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Definitions for the primitive `tuple_setitem`."""
from .. import lib, xtype
from ..lib import standard_prim
from . import primitives as P
def pyimpl_tuple_setitem(data, item, value):
"""Implement `tuple_setitem`."""
return tuple(value if i == item else x for i, x in enumerate(data))
@standard_prim(P.tup... | 26.755556 | 78 | 0.693522 |
1c4f215d1a733d148a92feb233a41bb0a2b8ec19 | 2,182 | py | Python | src/tests/test_run.py | nasa/ML-airport-taxi-in | 49d9cb3b4f94320102146a2c12ff1c029cb98879 | [
"NASA-1.3"
] | 1 | 2021-10-11T06:08:59.000Z | 2021-10-11T06:08:59.000Z | src/tests/test_run.py | nasa/ML-airport-taxi-in | 49d9cb3b4f94320102146a2c12ff1c029cb98879 | [
"NASA-1.3"
] | null | null | null | src/tests/test_run.py | nasa/ML-airport-taxi-in | 49d9cb3b4f94320102146a2c12ff1c029cb98879 | [
"NASA-1.3"
] | null | null | null | # Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS ... | 38.964286 | 78 | 0.747938 |
1c4f24dbf69e9b1dcfae9ce30f0c9e617ff1bd65 | 3,759 | py | Python | test/vanilla/legacy/AcceptanceTests/test_media_types.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/legacy/AcceptanceTests/test_media_types.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/legacy/AcceptanceTests/test_media_types.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 1 | 2022-03-28T08:58:03.000Z | 2022-03-28T08:58:03.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 41.766667 | 142 | 0.710561 |
1c4f2c6d189f43e5745c75ac12524f62c3baa7ea | 25,713 | py | Python | azure-devops/azext_devops/vstsCompressed/work_item_tracking_process_definitions/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | azure-devops/azext_devops/vstsCompressed/work_item_tracking_process_definitions/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | 37 | 2020-04-27T07:45:19.000Z | 2021-04-05T07:27:15.000Z | azure-devops/azext_devops/vstsCompressed/work_item_tracking_process_definitions/v4_0/models/models.py | vijayraavi/azure-devops-cli-extension | 88f1420c5815cb09bea15b050f4c553e0f326dad | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 32.424968 | 223 | 0.60133 |
1c4f4e06d562e67b9985dee644ce151ca2f35112 | 1,524 | py | Python | text-convertor/text_recoginzer/models/transformer_util.py | saketkattu/Handwritting-to-Text-Converter | 854203eec564f4620aa9d8870d7e4bcd449c45c1 | [
"Apache-2.0"
] | null | null | null | text-convertor/text_recoginzer/models/transformer_util.py | saketkattu/Handwritting-to-Text-Converter | 854203eec564f4620aa9d8870d7e4bcd449c45c1 | [
"Apache-2.0"
] | null | null | null | text-convertor/text_recoginzer/models/transformer_util.py | saketkattu/Handwritting-to-Text-Converter | 854203eec564f4620aa9d8870d7e4bcd449c45c1 | [
"Apache-2.0"
] | null | null | null | """Position Encoding and other utilities for Tranformers"""
import math
import torch
import torch.nn as nn
from torch import Tensor
class PositionalEncoding(torch.nn.Module):
"""Classic Attention-is-all-you-need positional encoding."""
def __init__(self, d_model: int, dropout: float = 0.1, max_len: int = 5... | 38.1 | 98 | 0.632546 |
1c4f9119b59a7242e19b3d6447984e95f84a8d19 | 19,955 | py | Python | integration-tests/test/test_internal.py | guilhermehas/rchain | 3fd2a1924e828de18204ac100bff60a6090621e1 | [
"Apache-2.0"
] | null | null | null | integration-tests/test/test_internal.py | guilhermehas/rchain | 3fd2a1924e828de18204ac100bff60a6090621e1 | [
"Apache-2.0"
] | 7 | 2019-12-27T14:15:35.000Z | 2019-12-30T01:06:20.000Z | integration-tests/test/test_internal.py | woky/rchain | 76ba93f4349fa525eb08d0b3f1751c23e0de74e2 | [
"Apache-2.0"
] | null | null | null | """Tests for the testing code itself."""
from rchain.crypto import PrivateKey
from .conftest import (
make_wallets_file_lines,
)
from .utils import(
extract_block_hash_from_propose_output,
extract_block_count_from_show_blocks,
parse_show_blocks_output,
parse_show_block_output,
parse_mvdag_str... | 48.317191 | 169 | 0.829416 |
1c4f9fe70bbae573dcef74f0cf0c2e182cdc234d | 543 | py | Python | services/web/server/src/simcore_service_webserver/rest_config.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/rest_config.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | services/web/server/src/simcore_service_webserver/rest_config.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | """ rest subsystem's configuration
- config-file schema
- settings
"""
import trafaret as T
from servicelib.application_keys import APP_OPENAPI_SPECS_KEY
APP_OPENAPI_SPECS_KEY = APP_OPENAPI_SPECS_KEY
CONFIG_SECTION_NAME = 'rest'
schema = T.Dict({
"version": T.Enum("v0"),
"location": T.Or(T.String, ... | 27.15 | 105 | 0.705341 |
1c4fa0c654a157e2ca0eb4f27f5f73762b800dea | 1,679 | py | Python | unittests/unittest_helpers.py | imsb-uke/ecarenet | ffbf24e740d9154312d02b9f775816ed4b3d4691 | [
"MIT"
] | 1 | 2022-01-25T09:49:45.000Z | 2022-01-25T09:49:45.000Z | unittests/unittest_helpers.py | imsb-uke/ecarenet | ffbf24e740d9154312d02b9f775816ed4b3d4691 | [
"MIT"
] | null | null | null | unittests/unittest_helpers.py | imsb-uke/ecarenet | ffbf24e740d9154312d02b9f775816ed4b3d4691 | [
"MIT"
] | null | null | null | import tensorflow as tf
import os
def get_data_directory(examples='color'):
if 'color' in examples:
e = 'example_colors'
elif 'circle' in examples:
e = 'example_circles'
directory = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'unittest_data', e))
return direc... | 38.159091 | 141 | 0.690292 |
1c4fc40023f16f02e4cbc1940ce386805bca0e00 | 1,537 | py | Python | custom/optimizer.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | custom/optimizer.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | custom/optimizer.py | s-mizuki-nlp/semantic_specialization | 4d00a461f18828ee8ebaccf7c737a32ccc11809f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import math
from torch.optim import Adam
from torch.optim.lr_scheduler import _LRScheduler
class AdamWithWarmup(_LRScheduler):
"""
Optim wrapper that implements rate.
ref: The Annotated Transformer. https://nlp.seas.harvard.edu/2018/04/03/attention.html#optimiz... | 32.020833 | 126 | 0.621991 |
1c4fc949990c4f1c95d661205edd8999ae028bbc | 215 | py | Python | tests/crawl_checked_standings.py | ngocbh/codeforces-management-tools | 4064cf3cf4bd9ffabdab15e4243e3fbe80a824ad | [
"MIT"
] | 6 | 2020-03-24T16:57:31.000Z | 2020-09-19T13:34:14.000Z | tests/crawl_checked_standings.py | ngocjr7/codeforces-standings-crawler | 1bb8bf468299ea2c944a238627ee1516625cb91e | [
"MIT"
] | 1 | 2021-02-04T04:39:55.000Z | 2021-02-04T04:39:55.000Z | tests/crawl_checked_standings.py | ngocjr7/codeforces-standings-crawler | 1bb8bf468299ea2c944a238627ee1516625cb91e | [
"MIT"
] | 1 | 2020-04-26T11:25:55.000Z | 2020-04-26T11:25:55.000Z | import conmato
# Provide your contestID or your contest URL
contestID = '256575'
groupID = 'bveFK04PIR'
ss = conmato.CSession()
ss.login('74164707NgocBH','123456789')
conmato.crawl_checked_standings(ss, contestID) | 23.888889 | 46 | 0.786047 |
1c4ff3289d06f0075f1da3f858255f4338ece3c9 | 20,052 | py | Python | nova/tests/unit/api/openstack/compute/test_attach_interfaces.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_attach_interfaces.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/compute/test_attach_interfaces.py | badock/nova-tidb | 4c4591f2cd887fdc22828e12f0c297c051bbd912 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 SINA 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 app... | 40.839104 | 78 | 0.621833 |
1c4fffb3e7bdaa769ea3a1b7fe6c3d21fc6612e2 | 1,072 | py | Python | app/core/tests/test_commands.py | xylo99/IP-to-AWS-region-API | f2022b1fff46ece898ca64763604cdf7a5ee4f77 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | xylo99/IP-to-AWS-region-API | f2022b1fff46ece898ca64763604cdf7a5ee4f77 | [
"MIT"
] | null | null | null | app/core/tests/test_commands.py | xylo99/IP-to-AWS-region-API | f2022b1fff46ece898ca64763604cdf7a5ee4f77 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.core.management import call_command
from django.db.utils import OperationalError
from django.test import TestCase
class CommandsTestCase(TestCase):
def test_wait_for_db_ready(self):
"""Test waiting for PostgresDB after the instance is available"""
with ... | 39.703704 | 80 | 0.68097 |
1c501c109338ffa0833468e51858cd6d4fd4d691 | 915 | py | Python | atom/nucleus/python/test/test_page_mx_merchant_res.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_mx_merchant_res.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | null | null | null | atom/nucleus/python/test/test_page_mx_merchant_res.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... | 22.317073 | 91 | 0.712568 |
1c501dd5836d1920e6591f92832fbd2d098baebd | 782 | py | Python | dskc/clean/dtype.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | dskc/clean/dtype.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | dskc/clean/dtype.py | NovaSBE-DSKC/predict-campaing-sucess-rate | fec339aee7c883f55d64130eb69e490f765ee27d | [
"MIT"
] | null | null | null | import pandas as pd
def column_to_int(df, column):
values = []
for v in df[column]:
values.append(int(v))
df[column] = values
def column_to_date(df, column, format="%Y-%m-%d"):
try:
df[column] = pd.to_datetime(df[column])
except:
df[column] = pd.to_datetime(df[column], f... | 20.578947 | 69 | 0.589514 |
1c50a457c4ae979a3a92ed871419ff22d7e275c6 | 1,671 | py | Python | preprocess/find_folder.py | youngster-all/Unified-Gesture | 8d20e051f2b692244c38a4d016629f13fe81c200 | [
"MIT"
] | 1 | 2019-12-24T17:00:11.000Z | 2019-12-24T17:00:11.000Z | preprocess/find_folder.py | youngster-all/Unified-Gesture | 8d20e051f2b692244c38a4d016629f13fe81c200 | [
"MIT"
] | null | null | null | preprocess/find_folder.py | youngster-all/Unified-Gesture | 8d20e051f2b692244c38a4d016629f13fe81c200 | [
"MIT"
] | 1 | 2019-12-24T17:39:46.000Z | 2019-12-24T17:39:46.000Z | """ Finding the folder name from image name """
from preprocess.flag import Finger
def find_folder(image_name):
name = image_name.split('_')
if 'One' in name:
folder_name = 'SingleOne'
elif 'Two' in name:
folder_name = 'SingleTwo'
elif 'Three' in name:
folder_name = 'SingleThre... | 27.85 | 47 | 0.591263 |
1c50afb9a00bff4c5c074e93e92a47cb69389f5c | 249 | py | Python | django_learning/updates/forms.py | angelptli/django-learning | f0d25e4b85526c2c092c4e4d2f108e7602db7f0d | [
"MIT"
] | null | null | null | django_learning/updates/forms.py | angelptli/django-learning | f0d25e4b85526c2c092c4e4d2f108e7602db7f0d | [
"MIT"
] | null | null | null | django_learning/updates/forms.py | angelptli/django-learning | f0d25e4b85526c2c092c4e4d2f108e7602db7f0d | [
"MIT"
] | null | null | null | from django import forms
from .models import OwnerUpdate
class UpdateCreateForm(forms.ModelForm):
class Meta:
model = OwnerUpdate
fields = [
'update_title',
'content',
'update_type'
] | 20.75 | 40 | 0.578313 |
1c50bacc33238fe4f6381f286c1f1ae65451232e | 1,200 | py | Python | marqeta/response_models/authentication.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 21 | 2019-04-12T09:02:17.000Z | 2022-02-18T11:39:06.000Z | marqeta/response_models/authentication.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 1 | 2020-07-22T21:27:40.000Z | 2020-07-23T17:38:43.000Z | marqeta/response_models/authentication.py | marqeta/marqeta-python | 66fa690eb910825c510a391720b0fe717fac0234 | [
"MIT"
] | 10 | 2019-05-08T14:20:37.000Z | 2021-09-20T18:09:26.000Z | from datetime import datetime, date
from marqeta.response_models import datetime_object
import json
import re
class Authentication(object):
def __init__(self, json_response):
self.json_response = json_response
def __str__(self):
return json.dumps(self.json_response, default=self.json_serial)
... | 28.571429 | 90 | 0.7175 |
1c50d6a16749d172641367e4d87ddc654a3367e0 | 1,194 | py | Python | examples/misc/why_trio_is_not_suitable_for_handling_touch_events.py | gottadiveintopython/asynckivy | 0672310d6a44034bb2916590f1a90dae0b5807c7 | [
"MIT"
] | 49 | 2019-09-11T16:17:44.000Z | 2022-03-22T20:40:26.000Z | examples/misc/why_trio_is_not_suitable_for_handling_touch_events.py | gottadiveintopython/asynckivy | 0672310d6a44034bb2916590f1a90dae0b5807c7 | [
"MIT"
] | 9 | 2020-03-30T03:05:51.000Z | 2022-03-14T07:03:25.000Z | examples/misc/why_trio_is_not_suitable_for_handling_touch_events.py | gottadiveintopython/asynckivy | 0672310d6a44034bb2916590f1a90dae0b5807c7 | [
"MIT"
] | 6 | 2020-10-08T00:36:23.000Z | 2022-01-24T11:32:14.000Z | import trio
import kivy
from kivy.app import async_runTouchApp
from kivy.lang.builder import Builder
kivy.require('2.0.0')
KV_CODE = '''
BoxLayout:
Widget:
RelativeLayout:
Widget:
id: target
'''
async def kivy_event(ed, name):
def callback(*args, **kwargs):
nonlocal parameter... | 23.411765 | 61 | 0.645729 |
1c5127f34f416b7daf75b3948b58725e3a099156 | 827 | py | Python | models/p_tuning/label_embedder.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | models/p_tuning/label_embedder.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | models/p_tuning/label_embedder.py | 20000607-lxc/BERT-NER-Pytorch-master | 47f2e1291ab53674986eb91abdb72693eafe9b61 | [
"MIT"
] | null | null | null | import torch
class LabelEmbeder(torch.nn.Module):
def __init__(self, template, hidden_size, device):
super().__init__()
self.device = device
self.spell_length = sum(template)
self.hidden_size = hidden_size
# ent embedding
self.cloze_length = template[0]
self... | 33.08 | 102 | 0.659008 |
1c51431453311ddcda628ecb3db7c8efcfa74d63 | 5,128 | py | Python | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/params.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/params.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-lab/azure/cli/command_modules/lab/params.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.092437 | 100 | 0.669072 |
1c519a4b29eefa5c5ecf373221f13b9e6cf2c042 | 10,576 | py | Python | naucse_hooks.py | pyvec/naucse-hooks | 5c26266335037940cc30ec7c4f92beeec3bc83ca | [
"MIT"
] | 3 | 2018-06-07T15:41:58.000Z | 2019-03-20T22:13:01.000Z | naucse_hooks.py | Kobzol/naucse-hooks | 5c26266335037940cc30ec7c4f92beeec3bc83ca | [
"MIT"
] | 13 | 2018-06-07T15:42:05.000Z | 2022-01-18T14:02:53.000Z | naucse_hooks.py | Kobzol/naucse-hooks | 5c26266335037940cc30ec7c4f92beeec3bc83ca | [
"MIT"
] | 2 | 2019-03-20T12:41:37.000Z | 2019-09-19T20:01:48.000Z | import logging.handlers
import re
import urllib.parse
from collections import defaultdict
from pathlib import Path
from typing import Iterator, Dict, Optional
import requests
import yaml
import giturlparse
from arca import Arca, CurrentEnvironmentBackend
from flask import Flask, request, jsonify, session, flash, redir... | 32.243902 | 116 | 0.641169 |
1c51a95340441b8fddacfcfeb4645c614f852155 | 1,437 | py | Python | rl-toolkit/rlf/baselines/common/running_mean_std.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 4 | 2021-11-17T20:19:34.000Z | 2022-03-31T04:21:26.000Z | rl-toolkit/rlf/baselines/common/running_mean_std.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | rl-toolkit/rlf/baselines/common/running_mean_std.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | import numpy as np
class RunningMeanStd(object):
# https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm
def __init__(self, epsilon=1e-4, shape=()):
# Note: This was float64 earlier, but we changed it to float32
self.mean = np.zeros(shape, 'float32')
self.... | 39.916667 | 103 | 0.676409 |
1c51ca7ff1a52df226a3ab9741984ce743975158 | 987 | py | Python | rj_gameplay/stp/role/assignment/__init__.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | rj_gameplay/stp/role/assignment/__init__.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | rj_gameplay/stp/role/assignment/__init__.py | p-nayak11/robocup-software | 542292e5cbb317234620d241b9c476ab125ebdf3 | [
"Apache-2.0"
] | null | null | null | """This module contains the interface for role assignment."""
from abc import ABC, abstractmethod
from typing import Dict, Any
import stp.rc
import stp.role as role
import stp.tactic as tactic
# RoleId = Tuple[Type[tactic.ITactic], tactic.SkillEntry, int]
# TODO: delete once role assignment switched over entirely
Ro... | 28.2 | 62 | 0.704154 |
1c51d9f417476d2a13b1b5a8245d459b4d1aad38 | 29,644 | py | Python | tests/pyfunc/test_model_export_with_loader_module_and_data_path.py | YQ-Wang/mlflow | 5508e6784afe0442705471bf4c10cd1ca13bafe3 | [
"Apache-2.0"
] | 2 | 2021-07-30T21:29:41.000Z | 2021-07-30T21:29:48.000Z | tests/pyfunc/test_model_export_with_loader_module_and_data_path.py | takabayashi/mlflow | 5508e6784afe0442705471bf4c10cd1ca13bafe3 | [
"Apache-2.0"
] | null | null | null | tests/pyfunc/test_model_export_with_loader_module_and_data_path.py | takabayashi/mlflow | 5508e6784afe0442705471bf4c10cd1ca13bafe3 | [
"Apache-2.0"
] | null | null | null | import os
import pickle
import yaml
import numpy as np
import pandas as pd
import pytest
import sklearn.datasets
import sklearn.linear_model
import sklearn.neighbors
import mlflow
import mlflow.pyfunc
from mlflow.pyfunc import PyFuncModel
import mlflow.pyfunc.model
import mlflow.sklearn
from mlflow.exceptions import ... | 37.811224 | 100 | 0.655141 |
1c5224d89c3e3b8275bf14e26bccd58837cdfd1d | 16,299 | py | Python | tests/helpers/test_entity_component.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/helpers/test_entity_component.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/helpers/test_entity_component.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import asynctest
import pytest
import voluptuous as vol
from homeassistant.const import ENTITY_MATCH_ALL, ENTITY_M... | 32.927273 | 88 | 0.703417 |
1c524a7f1b3dcdae5fcd58a8d15c4bafe16be3a6 | 1,193 | py | Python | Plug-and-play module/ContextGating.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | Plug-and-play module/ContextGating.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | Plug-and-play module/ContextGating.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import torch
import torch.nn as nn
import math
'''
Learnable pooling with Context Gating for video classification
arXiv:1706.06905v2
source: https://github.com/ekingedik/loupe-pytorch/blob/master/loupe_pytorch.py
'''
class GatingContext(nn.Module):
def __init__(self, dim, add_batch_norm=True):
super(Gating... | 34.085714 | 79 | 0.631182 |
1c527e48c81e32470bb3386f565fcf20d9bfac69 | 37,227 | py | Python | galpy/actionAngle/actionAngleIsochroneApprox.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/actionAngle/actionAngleIsochroneApprox.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | galpy/actionAngle/actionAngleIsochroneApprox.py | turnergarrow/galpy | 7132eddbf2dab491fe137790e31eacdc604b0534 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# actionAngle: a Python module to calculate actions, angles, and frequencies
#
# class: actionAngleIsochroneApprox
#
# Calculate actions-angle coordinates for any potential by using
# an isochrone potential ... | 48.599217 | 270 | 0.491041 |
1c527e5a33e78ca98c2876e2ad3cae787d5a62f0 | 13,101 | py | Python | res/models/LONG_DECODER_COMBINED.py | GregoryEHunter/generalization_to_OOD_category_viewpoint_combinations | 52aacbb3420639cae64ce65085c17b245e5ef865 | [
"MIT"
] | 10 | 2022-02-21T17:15:18.000Z | 2022-03-19T16:06:40.000Z | res/models/LONG_DECODER_COMBINED.py | GregoryEHunter/generalization_to_OOD_category_viewpoint_combinations | 52aacbb3420639cae64ce65085c17b245e5ef865 | [
"MIT"
] | null | null | null | res/models/LONG_DECODER_COMBINED.py | GregoryEHunter/generalization_to_OOD_category_viewpoint_combinations | 52aacbb3420639cae64ce65085c17b245e5ef865 | [
"MIT"
] | 1 | 2021-12-29T16:23:46.000Z | 2021-12-29T16:23:46.000Z | import torch
import torch.nn as nn
def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1):
"""3x3 convolution with padding"""
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias=False, dilation=dilation)
def conv1x1(in_... | 36.594972 | 106 | 0.580108 |
1c52852dcb1dd4c9eba59dc296dd8bbfcd41f647 | 619 | py | Python | panda/models/activity_log.py | newsapps/panda | 7553fd8cbc9c9c92a1b8be2e073141ec1b2ef903 | [
"MIT"
] | 4 | 2015-07-28T19:01:03.000Z | 2018-12-21T01:57:03.000Z | panda/models/activity_log.py | NUKnightLab/panda | c8b81151cad9f23ecd439e4354e86cca1eb49bb1 | [
"MIT"
] | null | null | null | panda/models/activity_log.py | NUKnightLab/panda | c8b81151cad9f23ecd439e4354e86cca1eb49bb1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from django.db import models
from panda.models.user_proxy import UserProxy
class ActivityLog(models.Model):
"""
A daily log of activity by a users.
"""
user = models.ForeignKey(UserProxy, related_name='activity_logs',
help_text='The user who was active.')
when = mode... | 25.791667 | 69 | 0.655897 |
1c52b2c53876ef907a7b29e0669f9edec4aa6d02 | 352 | py | Python | models/dist_statesaving/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | 1 | 2018-09-19T14:42:28.000Z | 2018-09-19T14:42:28.000Z | models/dist_statesaving/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | null | null | null | models/dist_statesaving/experiment.py | MISTCARRYYOU/PythonPDEVS | 53cad29832b3c489ab037bdc487affcbf1e3f408 | [
"Apache-2.0"
] | 1 | 2021-01-14T12:21:35.000Z | 2021-01-14T12:21:35.000Z | import sys
sys.setrecursionlimit(20000)
import random
sys.path.append("../../src/")
from simulator import Simulator
from model import DEVStone
model = DEVStone(3, int(sys.argv[1]), False)
sim = Simulator(model)
sim.setMessageCopy('custom')
sim.setStateSaving(str(sys.argv[2]))
sim.setTerminationTime(1000)
sim.setSchedu... | 23.466667 | 44 | 0.775568 |
1c52c173b9d2a37d3cae79c48e5b05b2ab9529ee | 1,795 | py | Python | playground/fsdet/coco/retentive_rcnn/30shot/seed4/config.py | Megvii-BaseDetection/GFSD | 78c0a938d794584f44d60afab66debd43773d4f7 | [
"Apache-2.0"
] | 23 | 2021-06-25T05:34:31.000Z | 2022-02-08T03:32:00.000Z | playground/fsdet/coco/retentive_rcnn/30shot/seed4/config.py | Megvii-BaseDetection/GFSD | 78c0a938d794584f44d60afab66debd43773d4f7 | [
"Apache-2.0"
] | 6 | 2021-06-30T13:10:21.000Z | 2021-11-04T13:26:39.000Z | playground/fsdet/coco/retentive_rcnn/30shot/seed4/config.py | Megvii-BaseDetection/GFSD | 78c0a938d794584f44d60afab66debd43773d4f7 | [
"Apache-2.0"
] | 1 | 2021-10-12T11:58:14.000Z | 2021-10-12T11:58:14.000Z | import os.path as osp
from cvpods.configs.rcnn_fpn_config import RCNNFPNConfig
_config_dict = dict(
MODEL=dict(
WEIGHTS="/path/to/your/model.pth",
MASK_ON=False,
RESNETS=dict(DEPTH=101),
ROI_HEADS=dict(
NUM_CLASSES=80,
COSINE_ON=True,
COSINE_SCAL... | 27.615385 | 84 | 0.560446 |
1c52c3774db2bf3659ef583f8eed589738fd2bd2 | 1,102 | py | Python | cursoemvideoPy/Mundo3/ex093.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo3/ex093.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo3/ex093.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | aprov_jogador = {}
gols = list()
total_gols = 0
aprov_jogador['nome'] = str(input('Nome do Jogador: ')).strip()
aprov_jogador['partidas'] = int(input(f'Quantas partidas {aprov_jogador["nome"]} jogou: '))
num_partidas = aprov_jogador['partidas']
# Pegando cada gol feito nas partidas definidas pelo Usuario
for p in ra... | 28.25641 | 91 | 0.686933 |
1c52c7b7c8e2f283bca3c1d6885bdd18c1a9d847 | 3,712 | py | Python | src/tools/make_dataset_lib.py | google/autocjk | dbb7ec36f36c8e835a36561c520f0cbfc4e04458 | [
"Apache-2.0"
] | 10 | 2021-03-09T01:14:51.000Z | 2022-03-31T15:02:14.000Z | src/tools/make_dataset_lib.py | ambuc/autocjk | 3c4c3d4ee0a275e077ee5df5966279c2b139f83d | [
"Apache-2.0"
] | 10 | 2021-03-09T01:10:44.000Z | 2021-04-12T23:28:04.000Z | src/tools/make_dataset_lib.py | ambuc/autocjk | 3c4c3d4ee0a275e077ee5df5966279c2b139f83d | [
"Apache-2.0"
] | 1 | 2021-03-09T13:36:31.000Z | 2021-03-09T13:36:31.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, ... | 31.726496 | 76 | 0.644397 |
1c52d5574b9beef3bb497cef811372bc53d6f581 | 20,244 | py | Python | gitlab-ci/src/dependencies/inventory.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 941 | 2021-05-10T08:14:14.000Z | 2022-03-31T11:40:24.000Z | gitlab-ci/src/dependencies/inventory.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 4 | 2021-12-22T22:34:51.000Z | 2022-03-31T07:34:19.000Z | gitlab-ci/src/dependencies/inventory.py | 3cL1p5e7/ic | 2b6011291d900454cedcf86ec41c8c1994fdf7d9 | [
"Apache-2.0"
] | 122 | 2021-05-10T08:21:23.000Z | 2022-03-25T20:34:12.000Z | #!/usr/bin/env python3
"""Helper package for parsing dependency inventories."""
import abc
import collections
import dataclasses
import fnmatch
import logging
import os
import pathlib
import subprocess
import typing
import git
import gitlab
import json5
import jsonschema
import toml
import git_changes
PROJECT_ROOT =... | 36.541516 | 115 | 0.544408 |
1c52f75accbdcc443a697a063f98dde4f5399a9a | 1,886 | py | Python | alipay/aop/api/domain/AlipayOpenMiniAmpeRecommendDetectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniAmpeRecommendDetectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniAmpeRecommendDetectModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniAmpeRecommendDetectModel(object):
def __init__(self):
self._device_id = None
self._order_id = None
self._product_id = None
@property
def device_id(s... | 26.56338 | 71 | 0.587487 |
1c5306f25070e24cd88efd093326bd24adf8ee3a | 592 | py | Python | python/bob/bob.py | volcain-io/exercism.io | ff18518eced1b1c1ea5b54eaf334efb3b5b0a6ee | [
"MIT"
] | null | null | null | python/bob/bob.py | volcain-io/exercism.io | ff18518eced1b1c1ea5b54eaf334efb3b5b0a6ee | [
"MIT"
] | 19 | 2019-07-20T23:29:27.000Z | 2022-01-19T21:38:49.000Z | python/bob/bob.py | volcain-io/exercism.io | ff18518eced1b1c1ea5b54eaf334efb3b5b0a6ee | [
"MIT"
] | null | null | null | import re
def hey(phrase):
msg = phrase.strip()
if is_yelling_question(msg):
return "Calm down, I know what I'm doing!"
elif is_yelling(msg):
return "Whoa, chill out!"
elif is_question(msg):
return "Sure."
elif is_mute(msg):
return "Fine. Be that way!"
else:
... | 17.939394 | 53 | 0.643581 |
1c530a10ee05ab752f9b6230c970de3c6c436bd0 | 882 | py | Python | Stereo-Vision-System/farzad/twocams.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 12 | 2017-05-26T12:04:38.000Z | 2021-07-11T04:42:19.000Z | Stereo-Vision-System/farzad/twocams.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | null | null | null | Stereo-Vision-System/farzad/twocams.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 4 | 2017-05-09T08:26:44.000Z | 2018-04-23T03:16:01.000Z | import cv2
from numpy import *
def RecordVideoFromCamera(index):
cap = cv2.VideoCapture(0)
cap2 = cv2.VideoCapture(2)
f,I = cap.read()
f2,I2 = cap2.read()
print I.shape
H,W,Z=I.shape
fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
writer = cv2.VideoWriter('cameraLeft.mov', fourcc, ... | 25.2 | 78 | 0.528345 |
1c53155de15263a240e563c717eb05ae654362eb | 6,315 | py | Python | distributed/deploy/adaptive.py | willirath/distributed | 67fe8208a0a6edc18e02a4c5080d81fb11eab338 | [
"BSD-3-Clause"
] | 1 | 2020-12-07T14:35:09.000Z | 2020-12-07T14:35:09.000Z | distributed/deploy/adaptive.py | willirath/distributed | 67fe8208a0a6edc18e02a4c5080d81fb11eab338 | [
"BSD-3-Clause"
] | 2 | 2021-05-11T16:00:55.000Z | 2021-08-23T20:45:22.000Z | distributed/deploy/adaptive.py | willirath/distributed | 67fe8208a0a6edc18e02a4c5080d81fb11eab338 | [
"BSD-3-Clause"
] | 1 | 2020-12-16T05:38:10.000Z | 2020-12-16T05:38:10.000Z | from inspect import isawaitable
import logging
import dask.config
from .adaptive_core import AdaptiveCore
from ..utils import log_errors, parse_timedelta
from ..protocol import pickle
logger = logging.getLogger(__name__)
class Adaptive(AdaptiveCore):
'''
Adaptively allocate workers based on scheduler load. ... | 31.41791 | 86 | 0.640855 |
1c5331807a26b24452d9ae9e52637f5a73313b5d | 1,095 | py | Python | attic/2019/contributions-2019/open/mudaliar-yptu/PWAF/testcases/frames_test.py | Agriad/devops-course | 380aa43fa69efd71992933f013fb11a96ce16a74 | [
"MIT"
] | null | null | null | attic/2019/contributions-2019/open/mudaliar-yptu/PWAF/testcases/frames_test.py | Agriad/devops-course | 380aa43fa69efd71992933f013fb11a96ce16a74 | [
"MIT"
] | 51 | 2021-04-08T11:39:59.000Z | 2021-05-07T12:01:27.000Z | attic/2019/contributions-2019/open/mudaliar-yptu/PWAF/testcases/frames_test.py | Agriad/devops-course | 380aa43fa69efd71992933f013fb11a96ce16a74 | [
"MIT"
] | null | null | null | """
@author: Anuj Kumar
@email: cdac.anuj@gmail.com
@date: 05-June-18
"""
from pages.frames_page import FramesPage
from pages.multiple_window_page import MultipleWindowsPage
from pages.welcome_page import WelcomePage
from utility.drivermanager import DriverManagerFirefox, DriverManagerChrome
from nose.plugins.attrib im... | 34.21875 | 75 | 0.748858 |
1c535f8937b344a01ebf2685fb45337c1996a128 | 79 | py | Python | smrf/data/__init__.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | smrf/data/__init__.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | smrf/data/__init__.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
from . import loadData, loadGrid, loadTopo, mysql_data
| 26.333333 | 54 | 0.683544 |
1c5382e9f96a138b085d46967b1a6d332d422958 | 56,539 | py | Python | modules/s3/s3navigation.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | 1 | 2018-01-06T12:58:32.000Z | 2018-01-06T12:58:32.000Z | modules/s3/s3navigation.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | null | null | null | modules/s3/s3navigation.py | gurlinthewurld/eden | 726aea55c95ee33f48dace63f76496e22e529157 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
""" S3 Navigation Module
@copyright: 2011-13 (c) Sahana Software Foundation
@license: MIT
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
... | 32.419151 | 92 | 0.467677 |
1c539852c233ce1190429c4fa735360615c077a3 | 2,536 | py | Python | sdk/customproviders/azure-mgmt-customproviders/setup.py | jkeech/azure-sdk-for-python | ab2b0ea3ef7528900a2f2e27cc7deda440b53f70 | [
"MIT"
] | null | null | null | sdk/customproviders/azure-mgmt-customproviders/setup.py | jkeech/azure-sdk-for-python | ab2b0ea3ef7528900a2f2e27cc7deda440b53f70 | [
"MIT"
] | null | null | null | sdk/customproviders/azure-mgmt-customproviders/setup.py | jkeech/azure-sdk-for-python | ab2b0ea3ef7528900a2f2e27cc7deda440b53f70 | [
"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.
#----------------------------------------------------------------... | 34.27027 | 91 | 0.606861 |
1c53de76fd8eda366b869abb239bb8728064696a | 2,237 | py | Python | src/model/SparseNet.py | xiedidan/sparse-coding | 36fb106217382dedbbea9234b10e02b0505d9b50 | [
"MIT"
] | null | null | null | src/model/SparseNet.py | xiedidan/sparse-coding | 36fb106217382dedbbea9234b10e02b0505d9b50 | [
"MIT"
] | null | null | null | src/model/SparseNet.py | xiedidan/sparse-coding | 36fb106217382dedbbea9234b10e02b0505d9b50 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
class SparseNet(nn.Module):
def __init__(self, K:int, M:int, R_lr:float=0.1, lmda:float=5e-3, device=None):
super(SparseNet, self).__init__()
self.K = K
self.M = M
self.R_lr = R_lr
self.lmda = lmda
... | 26.317647 | 98 | 0.50827 |
1c54036f383689edf30d689b8f244e5be090dabe | 2,645 | py | Python | django_huey/config.py | henribru/django-huey | 4389fbb263f88d7a144e43fedd3234250f624eb7 | [
"MIT"
] | 27 | 2021-03-30T15:42:01.000Z | 2022-02-22T08:24:08.000Z | django_huey/config.py | henribru/django-huey | 4389fbb263f88d7a144e43fedd3234250f624eb7 | [
"MIT"
] | 4 | 2021-11-27T16:08:03.000Z | 2022-03-29T10:07:39.000Z | django_huey/config.py | henribru/django-huey | 4389fbb263f88d7a144e43fedd3234250f624eb7 | [
"MIT"
] | 2 | 2021-08-19T02:59:36.000Z | 2022-01-14T11:45:26.000Z | import sys
from importlib import import_module
from django.conf import settings
from django_huey.exceptions import ConfigurationError
from huey.contrib.djhuey import default_backend_path, get_backend
class DjangoHueySettingsReader:
def __init__(self, hueys_setting):
if not isinstance(hueys_setting, dict)... | 34.802632 | 122 | 0.682798 |
1c54134859a9d1273b342b21ade42c16b7a5cc6b | 1,422 | py | Python | setup.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | setup.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | setup.py | deepcoder42/python-lib | 249f456fdd41a6883206fea8e19c9e098cc969e5 | [
"MIT"
] | null | null | null | # Classification (U)
"""Program: setup.py
Description: A setuptools based setup module.
"""
# Libraries and Global Variables
# Standard
import os
import setuptools
# Third-party
# Local
import version
# Read in long description from README file.
here = os.path.abspath(os.path.dirname(__file__))
with ope... | 22.935484 | 71 | 0.604782 |
1c541f777757d2f4bc1cb3ab2610167370c7ba6c | 43,996 | py | Python | NBA Project/venv/Lib/site-packages/plotly/validators/mesh3d/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 3 | 2020-02-04T21:39:20.000Z | 2020-11-17T19:07:07.000Z | NBA Project/venv/Lib/site-packages/plotly/validators/mesh3d/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 12 | 2020-06-06T01:22:26.000Z | 2022-03-12T00:13:42.000Z | NBA Project/venv/Lib/site-packages/plotly/validators/mesh3d/__init__.py | EnriqueGambra/Most-Efficient-NBA-Players | ea67c28b5294dbc9713200a937deb9f4211ba754 | [
"MIT"
] | 17 | 2019-11-21T14:11:29.000Z | 2019-11-21T15:26:23.000Z | import _plotly_utils.basevalidators
class ZsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="zsrc", parent_name="mesh3d", **kwargs):
super(ZsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=k... | 35.452055 | 87 | 0.586917 |
1c542e450d0f94f29f8ca897e269556f0734156f | 1,227 | py | Python | superset/superset/migrations/versions/dd907ff5ac79_add_connection_id_to_query_model.py | warenlg/sourced-ui | c8ff53b369e182ee2b9715a67b00ac1688995732 | [
"Apache-2.0"
] | null | null | null | superset/superset/migrations/versions/dd907ff5ac79_add_connection_id_to_query_model.py | warenlg/sourced-ui | c8ff53b369e182ee2b9715a67b00ac1688995732 | [
"Apache-2.0"
] | null | null | null | superset/superset/migrations/versions/dd907ff5ac79_add_connection_id_to_query_model.py | warenlg/sourced-ui | c8ff53b369e182ee2b9715a67b00ac1688995732 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.461538 | 83 | 0.764466 |
1c54582c7525ea202b8d124a89c54db565728f80 | 17,818 | py | Python | heartFEM/lcleeHeart/vtk_py/addLocalFiberOrientation.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | 3 | 2021-04-13T07:05:20.000Z | 2021-10-02T13:41:09.000Z | heartFEM/lcleeHeart/vtk_py/addLocalFiberOrientation.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | null | null | null | heartFEM/lcleeHeart/vtk_py/addLocalFiberOrientation.py | WeiXuanChan/heartFEM | 7f26c71434919c3141fac600f08685e5383e7137 | [
"MIT"
] | 2 | 2021-09-06T13:13:41.000Z | 2022-03-11T18:59:02.000Z | ########################################################################
import sys
import math
import numpy
import vtk
from random import uniform as randuniform
from heartFEM.lcleeHeart.vtk_py.addLocalFiberOrientation import *
from heartFEM.lcleeHeart.vtk_py.addLocalProlateSpheroidalDirections import *
fro... | 58.419672 | 202 | 0.644797 |
1c54794f8aa7c5a47facd45410a744164d9147d1 | 530 | py | Python | gftool/tests/context.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 12 | 2020-10-09T10:05:44.000Z | 2022-02-22T14:04:19.000Z | gftool/tests/context.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 20 | 2020-01-28T09:15:27.000Z | 2022-02-06T16:48:30.000Z | gftool/tests/context.py | DerWeh/gftools | a123c3d2aa62bcf9c2c7fcc15121cf60d09df020 | [
"MIT"
] | 6 | 2021-03-09T19:10:37.000Z | 2022-02-02T14:29:06.000Z | """Provide top level module for tests."""
import os
from sys import path
from functools import lru_cache
PATH = os.path.abspath(os.path.dirname(__file__))
path.insert(0, os.path.join(PATH, os.pardir, os.pardir))
import gftool
import gftool.beb
import gftool.cpa
import gftool.matrix
import gftool.fourier
import gftoo... | 23.043478 | 96 | 0.80566 |
1c549bddf0743f5667042d84f4c6b9c418ee9d9d | 690 | py | Python | terrascript/provider/jeremmfr/lvsnetwork.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/provider/jeremmfr/lvsnetwork.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/provider/jeremmfr/lvsnetwork.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/provider/jeremmfr/lvsnetwork.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:21:28 UTC)
import terrascript
class lvsnetwork(terrascript.Provider):
"""Terraform's provider for setup network interface and keepalived vrrp_instance on two server (master/slave)"""
__description__ ... | 34.5 | 130 | 0.749275 |
1c54c24f46258bd0b4a4c81b56feefe54e31b4fc | 2,899 | py | Python | src/sdk/pynni/nni/nas/benchmarks/nasbench101/query.py | tblanchart/nni | bbb9137c323316d6de04e15d42cf6dc47a889fcc | [
"MIT"
] | 1 | 2020-11-15T20:11:23.000Z | 2020-11-15T20:11:23.000Z | src/sdk/pynni/nni/nas/benchmarks/nasbench101/query.py | ajeets1978/nni | 41312de5dcbe8ba1f59c08a7b62fd5207f623804 | [
"MIT"
] | 17 | 2020-11-13T19:01:15.000Z | 2022-02-27T09:34:49.000Z | src/sdk/pynni/nni/nas/benchmarks/nasbench101/query.py | johnarthur1/nni | 2d026a13f97612bc7961d5a55f5088a169de9ee9 | [
"MIT"
] | null | null | null | import functools
from peewee import fn
from playhouse.shortcuts import model_to_dict
from .model import Nb101TrialStats, Nb101TrialConfig
from .graph_util import hash_module, infer_num_vertices
def query_nb101_trial_stats(arch, num_epochs, isomorphism=True, reduction=None, include_intermediates=False):
"""
Q... | 40.830986 | 109 | 0.668851 |
1c54f31932fc8cd230e5bba8de20f7f30c253c63 | 759 | py | Python | userbot/plugins/alive.py | sethgld/userbotseth | 2994aa84be57aed8ab036ed6f59342d9ca2f3cb2 | [
"MIT"
] | null | null | null | userbot/plugins/alive.py | sethgld/userbotseth | 2994aa84be57aed8ab036ed6f59342d9ca2f3cb2 | [
"MIT"
] | null | null | null | userbot/plugins/alive.py | sethgld/userbotseth | 2994aa84be57aed8ab036ed6f59342d9ca2f3cb2 | [
"MIT"
] | null | null | null | """COMMAND : alive. """
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from platform import uname
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "I'M STUPID"
@command(outgoing=True, patt... | 39.947368 | 96 | 0.571805 |
1c54ff2aac84c1557b5ff34d7a84c59aede4d446 | 1,427 | py | Python | demos/main_timer.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 1 | 2020-04-17T07:15:14.000Z | 2020-04-17T07:15:14.000Z | demos/main_timer.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 14 | 2021-11-26T15:18:05.000Z | 2021-12-12T03:05:31.000Z | demos/main_timer.py | taskcontrols/py-taskcontrols | 0f3f8d64cafc77dfbf23e70b0c86a91fea858ce4 | [
"MIT"
] | 1 | 2021-11-26T15:05:52.000Z | 2021-11-26T15:05:52.000Z | from taskcontrol.lib import TimerBase
timer = TimerBase()
if timer:
pass
t = timer.timer_create({"name": "testtimer"})
print(t)
if t:
print("start", timer.start("testtimer"))
print("Test")
print("Test")
print("Test")
print("Test")
print("Test")
print("Test")
print... | 31.021739 | 73 | 0.644008 |
1c551780e49d9fda9dcdadb6a1128c670b087e8e | 11,572 | py | Python | python/domain/bio2019/content/ch11.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | 2 | 2021-01-09T17:00:51.000Z | 2021-02-19T09:35:26.000Z | python/domain/bio2019/content/ch11.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | null | null | null | python/domain/bio2019/content/ch11.py | ICTU/document-as-code | e65fddb94513e7c2f54f248b4ce69e9e10ce42f5 | [
"Apache-2.0"
] | 1 | 2020-02-24T15:50:05.000Z | 2020-02-24T15:50:05.000Z | # -*- coding: latin-1 -*-
"""
fragments - define text fragments in the document
"""
from domain.norm_document.model import Chapter, Section, Norm, Verifier
CH11S01 = Section(
identifier="11.01",
title="Beveiligde gebieden",
text="Doelstelling: Onbevoegde fysieke toegang tot, schade aan en interferenti... | 36.971246 | 119 | 0.488939 |
1c5518a2d4cf63740ea1879de13924ef5ecc70fa | 8,087 | py | Python | toontown/cogdominium/CogdoFlyingCameraManager.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/cogdominium/CogdoFlyingCameraManager.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/cogdominium/CogdoFlyingCameraManager.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | import math
from pandac.PandaModules import NodePath, Vec3
from pandac.PandaModules import CollisionTraverser, CollisionHandlerQueue
from pandac.PandaModules import CollisionRay, CollisionNode
from math import pi, sin, cos
from toontown.toonbase.ToonPythonUtil import bound as clamp
from otp.otpbase import OTPGlobals
fr... | 41.260204 | 185 | 0.612464 |
1c5522f288647e576ab90dc767edab575df4a10c | 6,700 | py | Python | utilities/gl_display_context.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | 5 | 2015-05-18T06:22:54.000Z | 2020-08-04T08:27:02.000Z | utilities/gl_display_context.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | null | null | null | utilities/gl_display_context.py | skinny121/MCEdit-TallWorlds | e43fe889fde0ce41652ab77d7887a2a680846312 | [
"0BSD"
] | null | null | null | from OpenGL import GL
from config import config
import pygame
from pygame import display, image, Surface
import logging
import release
import sys
import directories
import os
import mcplatform
import numpy
import pymclevel
from resource_packs import ResourcePackHandler
import glutils
import mceutils
import functools
D... | 35.638298 | 115 | 0.565522 |
1c554d3009fcd3c8ba86e91453294a0b483df725 | 1,264 | py | Python | WikimediaUtilities.py | alset333/PeopleLookerUpper | 1cfba01a2d553ca9121ff851e96c95d135a50eeb | [
"MIT"
] | 2 | 2021-09-20T20:28:04.000Z | 2022-03-09T18:23:44.000Z | WikimediaUtilities.py | alset333/PeopleLookerUpper | 1cfba01a2d553ca9121ff851e96c95d135a50eeb | [
"MIT"
] | null | null | null | WikimediaUtilities.py | alset333/PeopleLookerUpper | 1cfba01a2d553ca9121ff851e96c95d135a50eeb | [
"MIT"
] | null | null | null | from urllib.request import urlopen, quote
import Utilities
FILENAME_CUE = "File:"
IMAGE_LOCATION_CUE = '<div class="fullMedia"><a href="https://upload.wikimedia.org/wikipedia/commons/'
IMAGE_LOCATION_URL_START = 'https://upload.wikimedia.org/wikipedia/commons/'
def directUrlOfFile(mediaPageURL):
"""Returns (succe... | 46.814815 | 188 | 0.701741 |
1c5565484a37d0c57835a1fc07039abdff1cae25 | 12,260 | py | Python | tests/request_methods/test_reports.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | 1 | 2018-06-29T06:13:02.000Z | 2018-06-29T06:13:02.000Z | tests/request_methods/test_reports.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | null | null | null | tests/request_methods/test_reports.py | innotrade24/python-amazon-mws1 | 7e387b076bcab489cf024624fefaa0dd3b1bcb2a | [
"Unlicense"
] | null | null | null | """
Tests for the Reports API class.
"""
import datetime
import unittest
import mws
from .utils import CommonRequestTestTools, transform_date, transform_bool
class ReportsTestCase(unittest.TestCase, CommonRequestTestTools):
"""
Test cases for Reports.
"""
# TODO: Add remaining methods for Reports
... | 39.676375 | 95 | 0.646737 |
1c5588cdc13791bdc1099c8b1a64beaf0aca4b0a | 447 | py | Python | kadi/events/tests.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 1 | 2015-07-30T18:33:14.000Z | 2015-07-30T18:33:14.000Z | kadi/events/tests.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 104 | 2015-01-20T18:44:36.000Z | 2022-03-29T18:51:55.000Z | kadi/events/tests.py | jzuhone/kadi | de4885327d256e156cfe42b2b1700775f5b4d6cf | [
"BSD-3-Clause"
] | 2 | 2018-08-23T02:36:08.000Z | 2020-03-13T19:24:36.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
class SimpleTest(TestCase):
def t... | 24.833333 | 79 | 0.693512 |
1c55930ff5b166f11aeae1a2d2776e334646e20a | 1,153 | py | Python | masakari/conf/__init__.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | masakari/conf/__init__.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | masakari/conf/__init__.py | sampathP/openstack-masakari | 108d988165271b7bafd66d985ff1000537ef3183 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 NTT DATA
# 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 appl... | 31.162162 | 78 | 0.778838 |
1c559eaa38fd60f939cbe80b00936d3563d7c3b9 | 7,499 | py | Python | nicos_sinq/devices/s5_switch.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_sinq/devices/s5_switch.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_sinq/devices/s5_switch.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 39.057292 | 79 | 0.601147 |
1c55eb59f003a38bc1526650f844f873a59ce211 | 1,140 | py | Python | wagtail/wagtailsearch/signal_handlers.py | thenewguy/wagtail | ecd8d22c04c46486b3c09b8eaeef1d0c96b0b288 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailsearch/signal_handlers.py | thenewguy/wagtail | ecd8d22c04c46486b3c09b8eaeef1d0c96b0b288 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailsearch/signal_handlers.py | thenewguy/wagtail | ecd8d22c04c46486b3c09b8eaeef1d0c96b0b288 | [
"BSD-3-Clause"
] | null | null | null | from django.db.models.signals import post_save, post_delete
from django.db import models
from django.conf import settings
from wagtail.wagtailsearch.index import Indexed
from wagtail.wagtailsearch.backends import get_search_backend
def get_search_backends():
if hasattr(settings, 'WAGTAILSEARCH_BACKENDS'):
... | 32.571429 | 91 | 0.760526 |
1c56110e9776234f2581e5bfadb1360ab774ec31 | 8,901 | py | Python | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 44.064356 | 222 | 0.662622 |
1c5621ccf0b19b6cb6fdcadde7cf206944559933 | 20,335 | py | Python | caffe2/python/task.py | timyy/caffe2 | e3937e7cefe1fd75496720583d75aa6263b8cc8e | [
"MIT"
] | null | null | null | caffe2/python/task.py | timyy/caffe2 | e3937e7cefe1fd75496720583d75aa6263b8cc8e | [
"MIT"
] | null | null | null | caffe2/python/task.py | timyy/caffe2 | e3937e7cefe1fd75496720583d75aa6263b8cc8e | [
"MIT"
] | null | null | null | ## @package task
# Module caffe2.python.task
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core, context
from caffe2.python.schema import Field, from_blob_list
from collections import defaul... | 34.291737 | 79 | 0.60118 |
1c5654083154bfc28d524ccd620751c609962eb0 | 184 | py | Python | worker.py | marcolussetti/netinfo | 6fcab55eaeabfd005a9192ace0c2b04122ab3df4 | [
"MIT"
] | 67 | 2018-12-26T11:10:50.000Z | 2022-03-03T09:07:10.000Z | worker.py | marcolussetti/netinfo | 6fcab55eaeabfd005a9192ace0c2b04122ab3df4 | [
"MIT"
] | 4 | 2019-01-02T20:01:59.000Z | 2020-01-27T14:43:21.000Z | worker.py | marcolussetti/netinfo | 6fcab55eaeabfd005a9192ace0c2b04122ab3df4 | [
"MIT"
] | 16 | 2018-12-26T05:01:04.000Z | 2022-01-25T12:13:18.000Z | """Run the Celery jobs."""
import os
from app import celery, create_app
import app.tasks
flask_app = create_app(os.getenv('FLASK_CONFIG') or 'default')
flask_app.app_context().push()
| 23 | 62 | 0.755435 |
1c567cadb5538922cca7668f9b2872267153870e | 9,403 | py | Python | lib/roi_data_layer/minibatch.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 20 | 2017-10-16T18:12:51.000Z | 2021-12-23T02:34:20.000Z | lib/roi_data_layer/minibatch.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 1 | 2018-11-10T04:59:48.000Z | 2021-01-21T04:51:31.000Z | lib/roi_data_layer/minibatch.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 5 | 2017-10-17T00:54:42.000Z | 2018-04-08T15:09:40.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Compute minibatch blobs for training a Fast R-CNN network."""
impor... | 41.241228 | 115 | 0.624269 |
1c56d8ed7a2c3a53b36ec480271807b45f74d639 | 665 | py | Python | lib/imports.py | adbmd/explainx | bb8bd78bcb1b6fbf2de368e56de6300de98a413a | [
"MIT"
] | 1 | 2020-09-12T17:05:32.000Z | 2020-09-12T17:05:32.000Z | lib/imports.py | adbmd/explainx | bb8bd78bcb1b6fbf2de368e56de6300de98a413a | [
"MIT"
] | null | null | null | lib/imports.py | adbmd/explainx | bb8bd78bcb1b6fbf2de368e56de6300de98a413a | [
"MIT"
] | null | null | null |
from jupyter_dash import JupyterDash
import dash_bootstrap_components as dbc
import dash
import dash_core_components as dcc
import dash_core_components
import dash_html_components as html
from dash.dependencies import Input, Output, State
import plotly.express as px
import plotly.graph_objects as go
from plotly.grap... | 21.451613 | 50 | 0.86015 |
1c56e3e37c1ba7748c0a5489ce7744bbff750d4b | 19,031 | py | Python | src/zeit/content/cp/browser/tests/test_selenium.py | ZeitOnline/zeit.content.cp | ee1dbc34e385e47a5c52eabbe01cdae2df09bd76 | [
"BSD-3-Clause"
] | null | null | null | src/zeit/content/cp/browser/tests/test_selenium.py | ZeitOnline/zeit.content.cp | ee1dbc34e385e47a5c52eabbe01cdae2df09bd76 | [
"BSD-3-Clause"
] | 11 | 2015-04-16T14:15:08.000Z | 2019-02-01T13:23:17.000Z | src/zeit/content/cp/browser/tests/test_selenium.py | ZeitOnline/zeit.content.cp | ee1dbc34e385e47a5c52eabbe01cdae2df09bd76 | [
"BSD-3-Clause"
] | 1 | 2015-12-03T14:58:26.000Z | 2015-12-03T14:58:26.000Z | # coding: utf8
from gocept.selenium.wd_selenese import split_locator
import lxml.cssselect
import transaction
import zeit.content.cp.testing
import zeit.edit.interfaces
import zope.app.appsetup.product
import zope.component
def css_path(css):
return lxml.cssselect.CSSSelector(css).path
class TestDottedName(zeit... | 38.368952 | 79 | 0.621933 |
1c56ec42581a9df3a4019a943994d8a2862edfab | 418 | py | Python | production/pygsl-0.9.5/tests/multimin_test.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | null | null | null | production/pygsl-0.9.5/tests/multimin_test.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | null | null | null | production/pygsl-0.9.5/tests/multimin_test.py | juhnowski/FishingRod | 457e7afb5cab424296dff95e1acf10ebf70d32a9 | [
"MIT"
] | 1 | 2018-10-02T06:18:07.000Z | 2018-10-02T06:18:07.000Z | import unittest
import math
import pygsl.histogram
import warnings
import exceptions
import pygsl.errors
import tempfile
import os
import os.path
from pygsl.multimin import *
class multimin_tests(unittest.TestCase):
"""
"""
def test_alloc(self):
func=lambda x,y,z:x**2+y**2+z**2
m=mult... | 18.173913 | 44 | 0.641148 |
1c56f3272093b143d140c44d84f7a0a046882ae4 | 1,329 | py | Python | setup.py | lipidong/pydong | 5c61a69251f0912f7490f185b13a317ca62ad46e | [
"MIT"
] | null | null | null | setup.py | lipidong/pydong | 5c61a69251f0912f7490f185b13a317ca62ad46e | [
"MIT"
] | null | null | null | setup.py | lipidong/pydong | 5c61a69251f0912f7490f185b13a317ca62ad46e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [ ]
test_requirements = ['pytest>=3', ]
setup(
author="p... | 26.58 | 59 | 0.62152 |
1c5702129a1692fb5d94c007185b60c81197be4b | 644 | py | Python | terrascript/resource/mildred/sys.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/resource/mildred/sys.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/resource/mildred/sys.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/resource/mildred/sys.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:28:08 UTC)
import terrascript
class sys_dir(terrascript.Resource):
pass
class sys_file(terrascript.Resource):
pass
class sys_null(terrascript.Resource):
pass
class sys_package(terrascript.Resource):
... | 14.976744 | 73 | 0.717391 |
1c570f59443a333bad5c1259b7a99e6ccdb24fb0 | 10,123 | py | Python | alphafold/common/protein.py | bjornwallner/alphafoldv2.1.0 | d145e95d2f442578a2f5a60d816ee1742720b488 | [
"Apache-2.0"
] | null | null | null | alphafold/common/protein.py | bjornwallner/alphafoldv2.1.0 | d145e95d2f442578a2f5a60d816ee1742720b488 | [
"Apache-2.0"
] | null | null | null | alphafold/common/protein.py | bjornwallner/alphafoldv2.1.0 | d145e95d2f442578a2f5a60d816ee1742720b488 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 DeepMind Technologies Limited
#
# 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 agr... | 36.024911 | 113 | 0.695742 |
1c572f39db0fcc9bca380ff6d3dc8efd7f1204c8 | 5,710 | py | Python | SRMspinanalysis/solver.py | matthewdmorse/SRMspinanalysis | 4f1161a2fd418347caf9e61ae83b40869f8157b0 | [
"MIT"
] | null | null | null | SRMspinanalysis/solver.py | matthewdmorse/SRMspinanalysis | 4f1161a2fd418347caf9e61ae83b40869f8157b0 | [
"MIT"
] | null | null | null | SRMspinanalysis/solver.py | matthewdmorse/SRMspinanalysis | 4f1161a2fd418347caf9e61ae83b40869f8157b0 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.interpolate import interp1d
from scipy.integrate import odeint
def compute_moments(design_params, thrust_motor_1, thrust_motor_2):
"""Computes moment vector given thrust information from each motor and
specific design parameters.
Args:
design_params (np.array()): Arra... | 43.257576 | 93 | 0.65937 |
1c574a738dde8e2593a2dbc3f018948cf9c41e68 | 1,547 | py | Python | dpgs_sandbox/tests/test_signals.py | ktowen/django-pgschemas | 5487c82d7a44297e12b80ef899a9aee0b6879bc5 | [
"MIT"
] | 85 | 2019-01-03T02:22:03.000Z | 2022-03-09T23:15:56.000Z | dpgs_sandbox/tests/test_signals.py | ktowen/django-pgschemas | 5487c82d7a44297e12b80ef899a9aee0b6879bc5 | [
"MIT"
] | 52 | 2019-02-12T21:04:43.000Z | 2022-03-05T15:20:16.000Z | dpgs_sandbox/tests/test_signals.py | ktowen/django-pgschemas | 5487c82d7a44297e12b80ef899a9aee0b6879bc5 | [
"MIT"
] | 12 | 2019-01-31T02:36:06.000Z | 2021-06-15T22:06:12.000Z | from django.test import TestCase
from django_pgschemas.schema import SchemaDescriptor, activate
from django_pgschemas.signals import schema_activate
from django_pgschemas.utils import get_tenant_model, schema_exists
TenantModel = get_tenant_model()
class SignalTestCase(TestCase):
"""
Tests signals.
"""
... | 31.571429 | 97 | 0.685197 |
1c57770242343da76a5813936725cdd91a770170 | 5,673 | py | Python | Lib/test/test_dbm.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 164 | 2015-01-04T07:04:07.000Z | 2022-01-06T03:18:56.000Z | Lib/test/test_dbm.py | idobatter/cpython | c7b03e7b57cedccb77e37f65f9bbcb82050c2bb5 | [
"PSF-2.0"
] | 3 | 2015-08-27T07:35:26.000Z | 2016-04-07T16:35:39.000Z | Lib/test/test_dbm.py | bendmorris/static-python | 2e0f8c4d7ed5b359dc7d8a75b6fb37e6b6c5c473 | [
"PSF-2.0"
] | 35 | 2015-06-11T05:35:55.000Z | 2022-01-11T19:32:00.000Z | #! /usr/bin/env python3
"""Test script for the dbm.open function based on testdumbdbm.py"""
import os
import unittest
import glob
import test.support
# Skip tests if dbm module doesn't exist.
dbm = test.support.import_module('dbm')
try:
from dbm import ndbm
except ImportError:
ndbm = None
_fname = test.supp... | 29.092308 | 80 | 0.573065 |
1c579f28d824d1d0cdf4b06c4500b5774ec02019 | 2,986 | py | Python | deploy/determined_deploy/aws/deployment_types/simple.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | 1 | 2021-03-29T04:25:27.000Z | 2021-03-29T04:25:27.000Z | deploy/determined_deploy/aws/deployment_types/simple.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | deploy/determined_deploy/aws/deployment_types/simple.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | import boto3
from determined_deploy.aws import aws, constants
from determined_deploy.aws.deployment_types import base
class Simple(base.DeterminedDeployment):
ssh_command = "SSH to master Instance: ssh -i <pem-file> ubuntu@{master_ip}"
det_ui = (
"Configure the Determined CLI: export DET_MASTER={mast... | 42.056338 | 96 | 0.717013 |
1c57ab95744186efa61106881498f07764401f34 | 3,455 | py | Python | matrix_content_scanner/mcs.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | 1 | 2021-12-10T18:59:02.000Z | 2021-12-10T18:59:02.000Z | matrix_content_scanner/mcs.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | null | null | null | matrix_content_scanner/mcs.py | babolivier/matrix-content-scanner-python | 3a9fe707467a551d06fedb94921d057f9177728f | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The Matrix.org Foundation C.I.C.
#
# 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... | 28.791667 | 120 | 0.7178 |
1c57b54e8b70b2494c83b33b052cb6c5568cffdf | 671 | py | Python | tests/test_matlab.py | arodland/IRI2016 | ab9873e597cc78cec40f11e133b83efdbe61ae7c | [
"MIT"
] | 1 | 2020-12-18T11:49:18.000Z | 2020-12-18T11:49:18.000Z | tests/test_matlab.py | arodland/IRI2016 | ab9873e597cc78cec40f11e133b83efdbe61ae7c | [
"MIT"
] | null | null | null | tests/test_matlab.py | arodland/IRI2016 | ab9873e597cc78cec40f11e133b83efdbe61ae7c | [
"MIT"
] | 1 | 2020-12-18T11:49:20.000Z | 2020-12-18T11:49:20.000Z | #!/usr/bin/env python
from pathlib import Path
import subprocess
import pytest
import shutil
R = Path(__file__).parent
@pytest.mark.skipif(not shutil.which('matlab'), reason='matlab not found')
def test_matlab_api():
subprocess.check_call(['matlab', '-nojvm', '-r',
'r=runtests(); exit(... | 26.84 | 74 | 0.612519 |
1c57b5acff9a80ac33a4cb17c1d46a6cbc7e4771 | 7,472 | py | Python | imodels/util/evaluate/compare_models.py | jiayouwyhit/imodels | 2f3e3cd55b6ac1e6d0f21420bf9c4c29e4d39b06 | [
"MIT"
] | 1 | 2021-05-22T13:04:36.000Z | 2021-05-22T13:04:36.000Z | imodels/util/evaluate/compare_models.py | jiayouwyhit/imodels | 2f3e3cd55b6ac1e6d0f21420bf9c4c29e4d39b06 | [
"MIT"
] | null | null | null | imodels/util/evaluate/compare_models.py | jiayouwyhit/imodels | 2f3e3cd55b6ac1e6d0f21420bf9c4c29e4d39b06 | [
"MIT"
] | null | null | null | '''Compare different estimators on public datasets
Code modified from https://github.com/tmadl/sklearn-random-bits-forest
'''
import os
import time
import re, string
import pickle as pkl
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import GradientBoostingClassifier
from... | 35.079812 | 125 | 0.577757 |
1c582b4a5bec4ac0ee0a7165417792b2601e9089 | 3,504 | py | Python | graphpy/edge.py | tscizzle/pygraph | b6fe9e21bd30ae4249d02a1818b49351575fa98e | [
"MIT"
] | 1 | 2017-04-09T21:58:28.000Z | 2017-04-09T21:58:28.000Z | graphpy/edge.py | tscizzle/graphpy | b6fe9e21bd30ae4249d02a1818b49351575fa98e | [
"MIT"
] | null | null | null | graphpy/edge.py | tscizzle/graphpy | b6fe9e21bd30ae4249d02a1818b49351575fa98e | [
"MIT"
] | null | null | null | """
Implementation of an edge, as used in graphs
"""
################################################################################
# #
# Undirected #
# ... | 28.258065 | 80 | 0.454338 |
1c583056b971299200bb09c57593b5683249c47f | 11,270 | py | Python | ply2atti.py | endarthur/ply2atti-scanline | f284b806de1b37c69b8007c9fcefc4fb9e4319fd | [
"CC0-1.0"
] | 2 | 2015-07-07T20:41:43.000Z | 2019-04-26T16:32:32.000Z | ply2atti.py | endarthur/ply2atti-scanline | f284b806de1b37c69b8007c9fcefc4fb9e4319fd | [
"CC0-1.0"
] | null | null | null | ply2atti.py | endarthur/ply2atti-scanline | f284b806de1b37c69b8007c9fcefc4fb9e4319fd | [
"CC0-1.0"
] | 2 | 2016-10-31T23:39:12.000Z | 2019-07-12T13:15:32.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from math import sin, radians, degrees, atan2, copysign, sqrt
from colorsys import hsv_to_rgb
from itertools import izip, combinations
from tempfile import TemporaryFile as temp
import numpy as np
from networkx import Graph, connected_components
from IPython import em... | 45.443548 | 237 | 0.668146 |
1c584e516d383713d190c6e51b5959010b05a1d0 | 1,013 | py | Python | detectron_/modeling/backbone/build.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | detectron_/modeling/backbone/build.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | detectron_/modeling/backbone/build.py | TalhaUsuf/RetinaNet_W9_form | 2a66bba1de96bebd679775b841d95ac7dcfcbbbe | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
from detectron.layers import ShapeSpec
from detectron.utils.registry import Registry
from .backbone import Backbone
BACKBONE_REGISTRY = Registry("BACKBONE")
BACKBONE_REGISTRY.__doc__ = """
Registry for backbones, which extract feature maps from images
The registered... | 29.794118 | 88 | 0.751234 |
1c5867572527f52dc6c5134685489f0dd93c0914 | 7,454 | py | Python | nova/api/openstack/compute/contrib/keypairs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/api/openstack/compute/contrib/keypairs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/contrib/keypairs.py | rossella/nova | 9b1180d5a09227604a470cb9d0790b57daf1b6d7 | [
"Apache-2.0"
] | 1 | 2020-07-24T06:47:54.000Z | 2020-07-24T06:47:54.000Z | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 34.831776 | 79 | 0.635364 |
1c5867af9e6a6631aa3e7180a38f55199f24bc9e | 1,815 | py | Python | train_triplet_from_scratch.py | WesleyCh3n/few-shot-fine-grained | 131d4e0f0414259a79513036bd5d28b171a546c4 | [
"BSD-3-Clause"
] | 2 | 2021-09-02T07:50:01.000Z | 2021-09-02T08:24:31.000Z | train_triplet_from_scratch.py | WesleyCh3n/few-shot-fine-grained | 131d4e0f0414259a79513036bd5d28b171a546c4 | [
"BSD-3-Clause"
] | null | null | null | train_triplet_from_scratch.py | WesleyCh3n/few-shot-fine-grained | 131d4e0f0414259a79513036bd5d28b171a546c4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' #supress tensorflow info except error
import sys
import math
import pathlib
import datetime
import tensorflow as tf
from model.parse_params import parse_params
from model.input_fn import dataset_pipeline_balance_label
from ... | 29.754098 | 81 | 0.611019 |
1c58c3cf6389ff801ea87669d8aa95c94fba6767 | 693 | py | Python | gemd/entity/attribute/tests/test_base_attribute.py | CitrineInformatics/gemd-python | 4f80045c1b481269c7451f6a205755c22093eb74 | [
"Apache-2.0"
] | 7 | 2020-04-02T11:11:09.000Z | 2022-02-05T23:19:51.000Z | gemd/entity/attribute/tests/test_base_attribute.py | CitrineInformatics/gemd-python | 4f80045c1b481269c7451f6a205755c22093eb74 | [
"Apache-2.0"
] | 24 | 2020-04-22T16:55:09.000Z | 2022-03-30T20:44:39.000Z | gemd/entity/attribute/tests/test_base_attribute.py | CitrineInformatics/gemd-python | 4f80045c1b481269c7451f6a205755c22093eb74 | [
"Apache-2.0"
] | 3 | 2020-05-08T00:50:02.000Z | 2020-12-19T00:48:56.000Z | """Tests of the BaseAttribute class."""
import pytest
from gemd.entity.attribute.property import Property
from gemd.entity.template.process_template import ProcessTemplate
from gemd.entity.value.nominal_real import NominalReal
def test_invalid_assignment():
"""Test that invalid assignments throw the appropriate ... | 36.473684 | 85 | 0.743146 |
1c58e11cb5db978f347555b60b70995092cc3f07 | 5,941 | py | Python | cart_pole_obst_dirl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | cart_pole_obst_dirl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | cart_pole_obst_dirl.py | luigiberducci/dirl | 5f7997aea20dfb7347ebdee66de9bea4e6cd3c62 | [
"MIT"
] | null | null | null | import pathlib
import time
from gym.wrappers import FlattenObservation
from spectrl.envs.cp_continuousobstacle_env import CartPoleContObsEnv
from spectrl.hierarchy.construction import automaton_graph_from_spec
from spectrl.hierarchy.reachability import HierarchicalPolicy, ConstrainedEnv
from spectrl.rl.ars import Hyp... | 32.642857 | 105 | 0.654435 |
1c5913d300765b75371d0a942902638e9b7262b8 | 590 | py | Python | gwlfe/AFOS/nonGrazingAnimals/Loads/NGAppManN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | gwlfe/AFOS/nonGrazingAnimals/Loads/NGAppManN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | gwlfe/AFOS/nonGrazingAnimals/Loads/NGAppManN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | from numpy import zeros
from InitNgN import InitNgN
from InitNgN import InitNgN_f
from gwlfe.Memoization import memoize
def NGAppManN(NGPctManApp, GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN):
result = zeros((12,))
init_ng_n = InitNgN(GrazingAnimal_0, NumAnimals, AvgAnimalWt, AnimalDailyN)
for... | 31.052632 | 90 | 0.776271 |
1c591ff835e6d62497d960f66f61fe915c8a0042 | 9,476 | py | Python | packages/fetchai/connections/gym/connection.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/connections/gym/connection.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | packages/fetchai/connections/gym/connection.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 34.583942 | 86 | 0.625475 |
1c593324b979b2f49713698a4c36966623e060b0 | 4,088 | py | Python | vcspull/log.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | vcspull/log.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | vcspull/log.py | gitter-badger/vcspull | 9584c6d40fca8e9f36970894ce620a891723d9b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Log utilities for formatting CLI output.
vcspull.log
~~~~~~~~~~~
This module containers special formatters for processing the additional context
information from :class:`libvcs.base.RepoLoggingAdapter`.
Colorized formatters for generic logging inside the application is also
provded.
"""
f... | 23.494253 | 88 | 0.580235 |
1c5945a49cdd42e9994d3f0e02f8ad235b58148e | 1,188 | py | Python | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/nw_rule_set_ip_rules.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/eventhub/azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/nw_rule_set_ip_rules.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-eventhub/azure/mgmt/eventhub/v2017_04_01/models/nw_rule_set_ip_rules.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 33.942857 | 76 | 0.588384 |
1c5962dc3fc169d3ffcd3f71b775f0f3f9a957b7 | 2,412 | py | Python | energylossestimate/basenet.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 6 | 2020-01-29T07:24:14.000Z | 2022-03-16T10:05:25.000Z | energylossestimate/basenet.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 6 | 2020-07-03T00:31:10.000Z | 2021-09-10T07:45:01.000Z | energylossestimate/basenet.py | marivasq/gamma-ai | 735953e80901afea3e5cdeb2a7b27c9ab5725434 | [
"MIT"
] | 5 | 2019-02-27T22:56:49.000Z | 2019-08-24T19:01:41.000Z | import tensorflow as tf
import numpy as np
class NPZSaver(object):
def __init__(self, net):
self._net = net
def save(self, session, f):
np.savez_compressed(f, **dict((v.name, session.run(v)) for v in self._net.variables))
def restore(self, session, f):
kwds = np.load(f)
for v in self._net.variables:
... | 30.531646 | 95 | 0.671642 |
1c59696b88433b23eff873ee8a5b360d1af32921 | 1,510 | py | Python | src/segmentation/models/hover/configuration.py | prhuppertz/Burned_Area_Detection | 4091e8a5ba22c1db28b4accd71cf2994d544ffab | [
"Apache-2.0"
] | 5 | 2021-03-30T02:22:42.000Z | 2022-01-18T20:12:30.000Z | src/segmentation/models/hover/configuration.py | prhuppertz/Burned_Area_Detection | 4091e8a5ba22c1db28b4accd71cf2994d544ffab | [
"Apache-2.0"
] | null | null | null | src/segmentation/models/hover/configuration.py | prhuppertz/Burned_Area_Detection | 4091e8a5ba22c1db28b4accd71cf2994d544ffab | [
"Apache-2.0"
] | 3 | 2021-04-26T02:08:05.000Z | 2021-08-15T20:12:31.000Z | from segmentation.data.dataset import get_segmentation_dataset
from segmentation.data.augmentation import Augmentor, sequences
from segmentation.data.preprocessing.mask_functions import (
convert_to_tensors_float,
reduce_to_semantic_mask_add_xy,
append_semantic_mask_add_xy,
)
from segmentation.data.preproce... | 43.142857 | 86 | 0.844371 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.