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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
734996c3c4fa38e46c8277795733a35761ac0b7e | 22,024 | py | Python | test/quantization/eager/test_numeric_suite_eager.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 183 | 2018-04-06T21:10:36.000Z | 2022-03-30T15:05:24.000Z | test/quantization/eager/test_numeric_suite_eager.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 631 | 2018-06-05T16:59:11.000Z | 2022-03-31T16:26:57.000Z | test/quantization/eager/test_numeric_suite_eager.py | ZIZUN/pytorch | f565167fbdf607f3b0b95f077b11f2f78716c217 | [
"Intel"
] | 58 | 2018-06-05T16:40:18.000Z | 2022-03-16T15:37:29.000Z | # Owner(s): ["oncall: quantization"]
import torch
import torch.nn as nn
import torch.nn.quantized as nnq
from torch.ao.quantization import (
DeQuantStub,
QuantStub,
convert,
default_qconfig,
prepare,
quantize,
quantize_dynamic,
)
from torch.ao.ns._numeric_suite import (
OutputLogger,
... | 41.013035 | 101 | 0.62559 |
7349ac82c3fb1bb269f573b85a541251a717e1ff | 543 | py | Python | zcore/action/executor_service.py | razaibi/autocode | 765fa947d9c6a1b559fc8b7e2e40e1914455fbd4 | [
"Apache-2.0"
] | null | null | null | zcore/action/executor_service.py | razaibi/autocode | 765fa947d9c6a1b559fc8b7e2e40e1914455fbd4 | [
"Apache-2.0"
] | 1 | 2021-09-20T22:14:03.000Z | 2021-09-20T22:14:03.000Z | zcore/action/executor_service.py | razaibi/zaunic | 765fa947d9c6a1b559fc8b7e2e40e1914455fbd4 | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from zcore.action.service import ActionService
import os
from zcore import logger
from typing import List, Tuple
from zcore.common import FileManager
from zcore.template.manager import Factory as TemplateFactory
import CONFIGS
class ExecutorActionService(ActionService):
def __in... | 30.166667 | 61 | 0.745856 |
7349c53fd92953b8d955cdae915da3d6fd5959f0 | 5,850 | py | Python | python/ray/rllib/offline/json_reader.py | bmorier/ray | 0aadf11c10e11245229023eeee15019866bf33ec | [
"Apache-2.0"
] | 1 | 2020-12-07T14:55:45.000Z | 2020-12-07T14:55:45.000Z | python/ray/rllib/offline/json_reader.py | mengjin001/ray | 0aa74fb1fd387ee5840e060f615b26f20788eee6 | [
"Apache-2.0"
] | null | null | null | python/ray/rllib/offline/json_reader.py | mengjin001/ray | 0aa74fb1fd387ee5840e060f615b26f20788eee6 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import glob
import json
import logging
import os
import random
import six
from six.moves.urllib.parse import urlparse
try:
from smart_open import smart_open
except ImportError:
smart_open = None
from ... | 35.240964 | 79 | 0.591624 |
734a1d9c201a2495e13fc8be54416e685e46f4ae | 193 | py | Python | setup.py | tomoima525/tomomisaweddingapp | 0d42341ee2e67c764407b6e005150782276f1780 | [
"Apache-2.0"
] | 27 | 2017-10-16T11:29:42.000Z | 2019-01-07T02:17:39.000Z | setup.py | tomoima525/tomomisaweddingapp | 0d42341ee2e67c764407b6e005150782276f1780 | [
"Apache-2.0"
] | 15 | 2017-09-10T20:36:44.000Z | 2019-02-03T14:57:31.000Z | setup.py | tomoima525/pipi | 0d42341ee2e67c764407b6e005150782276f1780 | [
"Apache-2.0"
] | 3 | 2019-08-20T09:07:34.000Z | 2021-04-20T08:15:56.000Z | from setuptools import setup
setup(
name='pipi', # Name can be anything
packages=['pipi'],
include_package_data=True,
install_requires=[
'flask','cloudinary'
],
)
| 17.545455 | 40 | 0.632124 |
734a4c1888e8b593c99179bbb96535e4a3554a07 | 1,331 | py | Python | alipay/aop/api/response/ZhimaMerchantZmgoCumulateSyncResponse.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/response/ZhimaMerchantZmgoCumulateSyncResponse.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/response/ZhimaMerchantZmgoCumulateSyncResponse.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.response.AlipayResponse import AlipayResponse
class ZhimaMerchantZmgoCumulateSyncResponse(AlipayResponse):
def __init__(self):
super(ZhimaMerchantZmgoCumulateSyncResponse, self).__init__()
self._agreement_id = None
... | 28.934783 | 110 | 0.68595 |
734a8dbf0b035923652d093029021e2cc1f560fe | 78,169 | py | Python | gslib/commands/rsync.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | null | null | null | gslib/commands/rsync.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | null | null | null | gslib/commands/rsync.py | stanhu/gsutil | e8403ed5e07caed3027455c7b883fef733612360 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Google 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 require... | 43.523942 | 99 | 0.686129 |
734a91859441d68f4e395d3010ffdd6c5d7176be | 262 | py | Python | cp-book/ch1/supereasy/1124_CelebrityJeopardy.py | andrey-yemelyanov/competitive-programming | f5c5fc9a5951a81dbae1250e17cd3d51a96b7a47 | [
"MIT"
] | null | null | null | cp-book/ch1/supereasy/1124_CelebrityJeopardy.py | andrey-yemelyanov/competitive-programming | f5c5fc9a5951a81dbae1250e17cd3d51a96b7a47 | [
"MIT"
] | null | null | null | cp-book/ch1/supereasy/1124_CelebrityJeopardy.py | andrey-yemelyanov/competitive-programming | f5c5fc9a5951a81dbae1250e17cd3d51a96b7a47 | [
"MIT"
] | null | null | null |
# Problem name: 1124 Celebrity jeopardy
# Problem url: https://uva.onlinejudge.org/external/11/1124.pdf
# Author: Andrey Yemelyanov
import sys
import math
def main():
for line in sys.stdin:
print(line.strip())
if __name__=="__main__":
main()
| 17.466667 | 63 | 0.694656 |
734aad97a7f57be5172e2489c71a776646856092 | 2,258 | py | Python | Q/questionnaire/views/services/views_services_customization_delete.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | Q/questionnaire/views/services/views_services_customization_delete.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | 477 | 2015-01-07T18:22:27.000Z | 2017-07-17T15:05:48.000Z | Q/questionnaire/views/services/views_services_customization_delete.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2016 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
from djan... | 38.931034 | 115 | 0.721435 |
734abd4d74179fa811cfe3d80c3152e4128a9283 | 24 | py | Python | btd6_memory_info/generated/Assets/Scripts/Simulation/Towers/Behaviors/MonkeyTemple/monkey_temple.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Simulation/Towers/Behaviors/MonkeyTemple/monkey_temple.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Simulation/Towers/Behaviors/MonkeyTemple/monkey_temple.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class MonkeyTemple: pass | 24 | 24 | 0.875 |
734ae2c6ed4a7aab2fa451f22ad543083479ca94 | 5,640 | py | Python | VocabularyTest/VocabularyTest.py | vcedgar/VocabularySetGenerationPipeline | 795abae0f58e5b6adb5b5fc0f6cb1926ff624039 | [
"Apache-2.0"
] | null | null | null | VocabularyTest/VocabularyTest.py | vcedgar/VocabularySetGenerationPipeline | 795abae0f58e5b6adb5b5fc0f6cb1926ff624039 | [
"Apache-2.0"
] | null | null | null | VocabularyTest/VocabularyTest.py | vcedgar/VocabularySetGenerationPipeline | 795abae0f58e5b6adb5b5fc0f6cb1926ff624039 | [
"Apache-2.0"
] | null | null | null | import math
import random
def makeQuartileTest(vocab):
count = len(vocab)
wordsIn5Percent = math.ceil(count/20) - 1
index = 0
testList = []
while index <= count - wordsIn5Percent:
# find how what words are in the 1st, 2nd, etc 20%
percent = vocab[index: index+wordsIn5Percent]
... | 36.862745 | 123 | 0.642553 |
734af1d3790d7c09a30eeaae720938d5bd5271b2 | 16,763 | py | Python | alipay/aop/api/domain/AntMerchantExpandShopModifyModel.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/AntMerchantExpandShopModifyModel.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/AntMerchantExpandShopModifyModel.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 *
from alipay.aop.api.domain.SettleCardInfo import SettleCardInfo
from alipay.aop.api.domain.AddressInfo import AddressInfo
from alipay.aop.api.domain.ShopBusinessTime import ShopBusinessTime
from alipay.aop.ap... | 36.049462 | 101 | 0.595717 |
734af4f00403e6ea465f2d3dff837ee2753ca9b8 | 2,890 | py | Python | alipay/aop/api/domain/AlipayMerchantOrderSecuritydigestConsumerBatchqueryModel.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/AlipayMerchantOrderSecuritydigestConsumerBatchqueryModel.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/AlipayMerchantOrderSecuritydigestConsumerBatchqueryModel.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 AlipayMerchantOrderSecuritydigestConsumerBatchqueryModel(object):
def __init__(self):
self._buyer_id = None
self._end_time = None
self._merchant_app_id = None
self... | 28.613861 | 81 | 0.586851 |
734b220f8006338770444291a4790f74ba915d8c | 2,629 | py | Python | examples/anime_names.py | jmuddappa/DeepClassificationBot | 70aaa6787cf02e8a6b49a913af6496bc0f288b35 | [
"MIT"
] | null | null | null | examples/anime_names.py | jmuddappa/DeepClassificationBot | 70aaa6787cf02e8a6b49a913af6496bc0f288b35 | [
"MIT"
] | null | null | null | examples/anime_names.py | jmuddappa/DeepClassificationBot | 70aaa6787cf02e8a6b49a913af6496bc0f288b35 | [
"MIT"
] | null | null | null | '''
Scrapes anime names from various sources.
'''
from __future__ import absolute_import
import sys
import codecs
import re
from backports import csv
import xml.etree.ElementTree as ElementTree
import requests
ANN_REPORTS_URL = 'http://www.animenewsnetwork.com/encyclopedia/reports.xml'
ANN_DETAILS_URL = 'http://cdn.a... | 32.060976 | 105 | 0.646634 |
734b3228855b533509efd8336118a08650c5dcda | 10,924 | py | Python | test/f5_cccl/resource/ltm/monitor/test_fn_monitor.py | michaeldayreads/f5-cccl | 5aaa584f9fc77742eb9d976954e6dad805e6f4ff | [
"Apache-2.0"
] | null | null | null | test/f5_cccl/resource/ltm/monitor/test_fn_monitor.py | michaeldayreads/f5-cccl | 5aaa584f9fc77742eb9d976954e6dad805e6f4ff | [
"Apache-2.0"
] | null | null | null | test/f5_cccl/resource/ltm/monitor/test_fn_monitor.py | michaeldayreads/f5-cccl | 5aaa584f9fc77742eb9d976954e6dad805e6f4ff | [
"Apache-2.0"
] | 1 | 2019-11-02T05:22:48.000Z | 2019-11-02T05:22:48.000Z | #!/usr/bin/env python
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 36.905405 | 83 | 0.650494 |
734b4d70a0f1774ea1348f83af0e24f9ea6ff2a6 | 1,268 | py | Python | margin_call/margin_classification.py | hichamhadji/parse3.0 | 281e8c7399b88cf623d9e1e53d3b60ae17ede09e | [
"Apache-2.0"
] | null | null | null | margin_call/margin_classification.py | hichamhadji/parse3.0 | 281e8c7399b88cf623d9e1e53d3b60ae17ede09e | [
"Apache-2.0"
] | null | null | null | margin_call/margin_classification.py | hichamhadji/parse3.0 | 281e8c7399b88cf623d9e1e53d3b60ae17ede09e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Feb 14 12:15:11 2020
@author: vibhanshuv
"""
import json
import glob2
import re
import os
import pandas as pd
import subprocess
jar_path=''
def run_command(command):
p = subprocess.Popen(command,
stdout=subprocess.PIPE,
... | 30.190476 | 235 | 0.646688 |
734b65766acd2f9e4a84f1007991405bdb118570 | 2,903 | py | Python | src/rayoptics/mpl/interactivediagram.py | JakeWags/ray-optics | c64baf0a77df249477ec5b54265a1cd16b3cbb7a | [
"BSD-3-Clause"
] | null | null | null | src/rayoptics/mpl/interactivediagram.py | JakeWags/ray-optics | c64baf0a77df249477ec5b54265a1cd16b3cbb7a | [
"BSD-3-Clause"
] | null | null | null | src/rayoptics/mpl/interactivediagram.py | JakeWags/ray-optics | c64baf0a77df249477ec5b54265a1cd16b3cbb7a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 Michael J. Hayford
"""
.. Created on Thu Oct 10 22:02:44 2019
.. codeauthor: Michael J. Hayford
"""
from rayoptics.parax.diagram import Diagram
from rayoptics.mpl.interactivefigure import InteractiveFigure
class InteractiveDiagram(InteractiveFigure)... | 35.402439 | 78 | 0.635205 |
734b7c182dc3cd3f4a7a0379743bc1afc49509b2 | 479 | py | Python | test_database.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | null | null | null | test_database.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | null | null | null | test_database.py | saguilarDevel/schc-sigfox | 27e14edc0e350f027e6d7b300ec79b6aa92dc06d | [
"MIT"
] | 2 | 2021-02-19T03:35:42.000Z | 2021-08-20T15:30:50.000Z | from database import Database
import config.config as config
# Init database with the bucket name
Database.initialize(config.BUCKET_NAME)
# Save some example to the database
Database.save(config.BUCKET_NAME, "some example text", 'test-database')
# Read from database
example = Database.read(config.BUCKET_NAME, 'test... | 22.809524 | 71 | 0.795407 |
734b8ccd242f159ff35b601e27d697a45c16b83d | 2,574 | py | Python | tests/common/test_run/cumprod_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/common/test_run/cumprod_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/common/test_run/cumprod_run.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.8 | 115 | 0.711733 |
734b92faf2632c66baf8417231d793506535f633 | 1,990 | py | Python | examples/modern_data_stack_assets/modern_data_stack_assets/assets.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/modern_data_stack_assets/modern_data_stack_assets/assets.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/modern_data_stack_assets/modern_data_stack_assets/assets.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=redefined-outer-name
from typing import Any, Tuple
import numpy as np
import pandas as pd
from dagster_airbyte import airbyte_resource, build_airbyte_assets
from dagster_dbt import dbt_cli_resource, load_assets_from_dbt_project
from scipy import optimize
from dagster import AssetGroup, asset
from .... | 36.181818 | 97 | 0.762312 |
734bb0eed8ccd8b7111bc65c27ba9debb0303ffd | 4,611 | py | Python | xd_xd/aa/cresi/net/pytorch_utils/eval.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 27 | 2020-03-04T05:54:48.000Z | 2022-01-05T07:07:44.000Z | xd_xd/aa/cresi/net/pytorch_utils/eval.py | CosmiQ/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 1 | 2020-07-14T10:35:50.000Z | 2020-07-14T10:35:50.000Z | xd_xd/aa/cresi/net/pytorch_utils/eval.py | SpaceNetChallenge/SpaceNet_Optimized_Routing_Solutions | 3fbc215de6b05904a5b54b2c7cde7e61074ae38d | [
"Apache-2.0"
] | 7 | 2020-03-07T21:42:57.000Z | 2022-01-07T10:49:50.000Z | import os
import sys
import cv2
cv2.setNumThreads(0)
cv2.ocl.setUseOpenCL(False)
import numpy as np
import torch
import torch.nn.functional as F
# torch.backends.cudnn.benchmark = True
import tqdm
from torch.serialization import SourceChangeWarning
import warnings
# import torchsummary
from torch.utils.data.dataloader ... | 35.469231 | 137 | 0.66363 |
734bd85da0555a83af2c90b72ff06d0ce03153d8 | 853 | py | Python | myia/operations/prim_Jinv.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 222 | 2019-02-13T07:56:28.000Z | 2022-03-28T07:07:54.000Z | myia/operations/prim_Jinv.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 107 | 2019-02-12T21:56:39.000Z | 2022-03-12T01:08:03.000Z | myia/operations/prim_Jinv.py | strint/myia | 3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a | [
"MIT"
] | 27 | 2017-11-14T17:58:15.000Z | 2019-01-14T01:36:09.000Z | """Definitions for the primitive `Jinv`."""
from ..abstract.infer import compute_jinv_type
from ..lib import bprop_to_grad_transform, standard_prim
from ..operations import J
from . import primitives as P
@standard_prim(P.Jinv)
async def infer_Jinv(self, engine, x):
"""Infer the return type of primitive `Jinv`."... | 23.054054 | 56 | 0.692849 |
734bd86b5d877d07d68847d31c2d526d344f77ea | 3,161 | py | Python | blog/tests/test_models.py | andywar65/projetc_repo | a318b36d601a15a1d5e4a9bbc65d7bcbb5ac02ef | [
"BSD-2-Clause"
] | null | null | null | blog/tests/test_models.py | andywar65/projetc_repo | a318b36d601a15a1d5e4a9bbc65d7bcbb5ac02ef | [
"BSD-2-Clause"
] | 2 | 2021-03-19T17:12:07.000Z | 2021-03-19T17:12:08.000Z | blog/tests/test_models.py | andywar65/projetc_repo | a318b36d601a15a1d5e4a9bbc65d7bcbb5ac02ef | [
"BSD-2-Clause"
] | null | null | null | from django.test import TestCase
from django.urls import reverse
from django.utils.translation import gettext as _
from users.models import User, Profile
from pages.models import GalleryImage
from blog.models import Article, UserUpload
class ArticleModelTest(TestCase):
@classmethod
def setUpTestData(cls):
... | 41.051948 | 94 | 0.670357 |
734bee73ab7b00a572e993641fbb80ab34bd6e3d | 7,676 | py | Python | run.py | Jianfei2333/pytorch-GAN | 41db886b9220b74769b9786c3770dc1ce8dd407e | [
"MIT"
] | null | null | null | run.py | Jianfei2333/pytorch-GAN | 41db886b9220b74769b9786c3770dc1ce8dd407e | [
"MIT"
] | null | null | null | run.py | Jianfei2333/pytorch-GAN | 41db886b9220b74769b9786c3770dc1ce8dd407e | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from torchvision import utils as vutils
from tqdm.auto import tqdm
import matplotlib.pyplot as plt
from model import DCGAN
from dataset import CelebA
class GANTrainer():
def __init__(self, id, bone, real_datal... | 39.979167 | 160 | 0.60852 |
734c234c9fc35138805428d79d248aa644453c42 | 129 | py | Python | pmaf/sequence/_multiple/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-07-02T06:24:17.000Z | 2021-07-02T06:24:17.000Z | pmaf/sequence/_multiple/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | 1 | 2021-06-28T12:02:46.000Z | 2021-06-28T12:02:46.000Z | pmaf/sequence/_multiple/__init__.py | mmtechslv/PhyloMAF | bab43dd4a4d2812951b1fdf4f1abb83edb79ea88 | [
"BSD-3-Clause"
] | null | null | null | from ._multiple import MultiSequence
from ._stream import MultiSequenceStream
__all__ = ['MultiSequence', 'MultiSequenceStream'] | 32.25 | 50 | 0.829457 |
734c496ab91586873e5925c60f25d9bf3def2bb7 | 26 | py | Python | btd6_memory_info/generated/System/Xml/Schema/XmlAtomicValue/xml_atomic_value.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Xml/Schema/XmlAtomicValue/xml_atomic_value.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Xml/Schema/XmlAtomicValue/xml_atomic_value.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class XmlAtomicValue: pass | 26 | 26 | 0.884615 |
734c57a5a3ee2d9007394582fab44096d0da3625 | 17,891 | py | Python | grit/node/misc.py | MIPS/external-chromium_org-tools-grit | 646f47f4f3b103f878faabfa7f8a4cd2860822a5 | [
"BSD-2-Clause"
] | 1 | 2017-08-06T01:12:23.000Z | 2017-08-06T01:12:23.000Z | tools/grit/grit/node/misc.py | ufologist/qx | a2d64a337ecb2cd5752bd848afb2315c93e0fabe | [
"MIT"
] | null | null | null | tools/grit/grit/node/misc.py | ufologist/qx | a2d64a337ecb2cd5752bd848afb2315c93e0fabe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Miscellaneous node types.
"""
import os.path
import re
import sys
from grit import constants
from grit import exception
from g... | 34.405769 | 80 | 0.669051 |
734c60a2233ed1822caf03a5e61ad7a7b16e1b77 | 1,351 | py | Python | tests/test_name.py | sansbacon/namematcher | 0f6c3327784d3db5be0f59853d11604fd802a7a0 | [
"MIT"
] | 1 | 2019-05-01T04:47:29.000Z | 2019-05-01T04:47:29.000Z | tests/test_name.py | sansbacon/playermatcher | 0f6c3327784d3db5be0f59853d11604fd802a7a0 | [
"MIT"
] | null | null | null | tests/test_name.py | sansbacon/playermatcher | 0f6c3327784d3db5be0f59853d11604fd802a7a0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# test_name_mflxref.py
import logging
import random
import sys
import unittest
from namematcher.name import *
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
class Name_test(unittest.TestCase):
def setUp(self):
self.logger = logging.getLogger()
self.names = [... | 26.490196 | 70 | 0.600296 |
734c75c72ee03dbcaa0e96870b9ef712b8e41652 | 225 | py | Python | src/empirical_fire_modelling/exceptions.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | src/empirical_fire_modelling/exceptions.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | src/empirical_fire_modelling/exceptions.py | akuhnregnier/empirical-fire-modelling | 4187f5bfce0595d98361a9264793c25607043047 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
class NoCX1Error(ValueError):
"""Raised when running on CX1 was requested but not allowed."""
class EmptyUnitSpecError(ValueError):
"""Raised when an empty units spec is found in a label."""
| 28.125 | 67 | 0.693333 |
734ca03c78544995f2cff6037c1323fe9c0b1cc0 | 1,945 | py | Python | examples/GridWorld/script_train_simple.py | Li-Ming-Fan/zhiqiang | f3454c0132e407848039b83ebb66a25e39f10ec7 | [
"Apache-2.0"
] | 3 | 2020-04-16T06:32:57.000Z | 2022-03-08T09:46:03.000Z | examples/GridWorld/script_train_simple.py | Li-Ming-Fan/zhiqiang | f3454c0132e407848039b83ebb66a25e39f10ec7 | [
"Apache-2.0"
] | null | null | null | examples/GridWorld/script_train_simple.py | Li-Ming-Fan/zhiqiang | f3454c0132e407848039b83ebb66a25e39f10ec7 | [
"Apache-2.0"
] | null | null | null |
# define an env
from grid_world import GridWorld as Env
# define a qnet, in PyTorch
from gridworld_qnet import GridWorldQNet as QNet
# pick an agent
from zhiqiang.agents.dqn_vanila import VanilaDQN as Agent
# from zhiqiang.agents.dqn_double import DoubleDQN as Agent
# from zhiqiang.agents.dqn_mstep import MStepDQN ... | 28.602941 | 85 | 0.779434 |
734ca4a7280440ed0e9f9322f69ac9a2e66f2042 | 499 | py | Python | examples/cities.py | NumberAI/python-bandwidth-iris | 0e05f79d68b244812afb97e00fd65b3f46d00aa3 | [
"MIT"
] | 2 | 2020-04-13T13:47:59.000Z | 2022-02-23T20:32:41.000Z | examples/cities.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2020-09-18T20:59:24.000Z | 2021-08-25T16:51:42.000Z | examples/cities.py | bandwidthcom/python-bandwidth-iris | dbcb30569631395041b92917252d913166f7d3c9 | [
"MIT"
] | 5 | 2018-12-12T14:39:50.000Z | 2020-11-17T21:42:29.000Z | import sys
from iris_sdk import Cities, Client, RestError
if len(sys.argv) < 2:
sys.exit("usage: python cities.py [state], e.g.:\n python cities.py NJ")
cities = Cities(client=Client(filename="config.cfg"))
print("\n")
try:
cities_list = cities.list({"state": sys.argv[1]})
except RestError as error:
sy... | 24.95 | 76 | 0.661323 |
734cb8389152ccd27424cec6e972d3090bbd4e5f | 151 | py | Python | scripts/run.py | hawkrives/cuddly-doodle | 7680991070a2266c9efc60b7fef85770d50c283e | [
"MIT"
] | null | null | null | scripts/run.py | hawkrives/cuddly-doodle | 7680991070a2266c9efc60b7fef85770d50c283e | [
"MIT"
] | null | null | null | scripts/run.py | hawkrives/cuddly-doodle | 7680991070a2266c9efc60b7fef85770d50c283e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import subprocess
os.environ['FLASK_APP'] = 'referee.server.flask'
subprocess.run(['python', '-m', 'flask', 'run'])
| 18.875 | 48 | 0.688742 |
734cbfd81bf2a3ff6c0b897d3a3fe11793668b3f | 3,701 | py | Python | ibmsecurity/isam/web/authorization_server/configuration/stanza.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/web/authorization_server/configuration/stanza.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/web/authorization_server/configuration/stanza.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
uri = "/isam/authzserver"
def get(isamAppliance, id, check_mode=False, force=False):
"""
Retrieving a list of stanzas - Authorization Server
"""
return isamAppliance.invoke_get(description="Retrieving a list of sta... | 37.383838 | 119 | 0.626858 |
734ce6377ca65d1288c7dbb5ef868cb70d3d9d7f | 1,157 | py | Python | scripts/plotting-script.py | AbigailMcGovern/platelet-segmentation | 46cd87b81fc44473b07a2bebed1e6134b2582348 | [
"BSD-3-Clause"
] | 1 | 2022-02-01T23:40:38.000Z | 2022-02-01T23:40:38.000Z | scripts/plotting-script.py | AbigailMcGovern/platelet-segmentation | 46cd87b81fc44473b07a2bebed1e6134b2582348 | [
"BSD-3-Clause"
] | 3 | 2021-03-12T02:03:15.000Z | 2021-03-31T00:39:05.000Z | scripts/plotting-script.py | AbigailMcGovern/platelet-segmentation | 46cd87b81fc44473b07a2bebed1e6134b2582348 | [
"BSD-3-Clause"
] | 1 | 2021-04-06T23:23:32.000Z | 2021-04-06T23:23:32.000Z | from training_experiments import seed_exp, cirriculum_exp_0, affinities_exp_2, \
thresh_exp_0, lr_exp, loss_exp
from compare_output import segmentation_plots, get_experiment_seg_info
data_dir = '/Users/amcg0011/Data/pia-tracking/dl-results'
# Get info with which to find files
seed_info = get_experiment_seg_info... | 52.590909 | 88 | 0.826275 |
734ceebd2b4e736f0caeacf31add4d68484cab55 | 3,496 | py | Python | src/esm/models/service_instance.py | elastest/elastest-service-manager | e0adbe383eada746a5ac103ee7938791c8656633 | [
"Apache-2.0"
] | 2 | 2017-06-15T21:32:07.000Z | 2020-01-08T09:08:33.000Z | src/esm/models/service_instance.py | elastest/elastest-service-manager | e0adbe383eada746a5ac103ee7938791c8656633 | [
"Apache-2.0"
] | 20 | 2017-06-12T10:57:45.000Z | 2020-01-08T08:22:31.000Z | src/esm/models/service_instance.py | elastest/elastest-service-manager | e0adbe383eada746a5ac103ee7938791c8656633 | [
"Apache-2.0"
] | 8 | 2017-06-07T10:05:47.000Z | 2017-12-12T15:31:41.000Z | # coding: utf-8
from __future__ import absolute_import
#
from esm.models.last_operation import LastOperation
from esm.models.service_type import ServiceType
from .base_model_ import Model
from ..util import deserialize_model
class ServiceInstance(Model):
"""
NOTE: This class is auto generated by the swagger... | 27.968 | 104 | 0.627002 |
734cfffb297b9cd1a5b3a954b809540a1c501b6e | 514 | py | Python | ara/classes/serializers/meta_data.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 19 | 2017-09-13T07:51:58.000Z | 2022-03-28T11:04:03.000Z | ara/classes/serializers/meta_data.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 147 | 2017-09-14T13:45:30.000Z | 2022-03-14T15:54:09.000Z | ara/classes/serializers/meta_data.py | sparcs-kaist/new-ara-api | 63998da575cb148347708199fe1345c4e7ee3e1b | [
"MIT"
] | 5 | 2019-08-31T13:13:30.000Z | 2021-03-26T15:46:38.000Z | from rest_framework import serializers
class MetaDataModelSerializer(serializers.ModelSerializer):
def get_extra_kwargs(self):
read_only_fields = list(getattr(self.Meta, 'read_only_fields', []))
for meta_data_field in ('created_at', 'updated_at', 'deleted_at'):
if meta_data_field not ... | 34.266667 | 75 | 0.714008 |
734d0f69451c629f52524473f52fd9437c29b0d1 | 14,269 | py | Python | finds/graph.py | terence-lim/investment-data-science | 22c1cf7b1d9c012f0e2c586a0c5bda64e6f59471 | [
"MIT"
] | 2 | 2020-04-18T00:00:15.000Z | 2020-08-17T14:24:49.000Z | finds/graph.py | terence-lim/investment-data-science | 22c1cf7b1d9c012f0e2c586a0c5bda64e6f59471 | [
"MIT"
] | null | null | null | finds/graph.py | terence-lim/investment-data-science | 22c1cf7b1d9c012f0e2c586a0c5bda64e6f59471 | [
"MIT"
] | 2 | 2021-06-18T23:26:44.000Z | 2021-10-04T08:03:01.000Z | """Convenience methods for igraph and networkx modules
- Network science, community detection, centrality, modularity
- igraph, networkx
Author: Terence Lim
License: MIT
"""
import os
import numpy as np
import pandas as pd
from pandas import DataFrame, Series
import matplotlib.pyplot as plt
import networkx as nx
impo... | 40.536932 | 129 | 0.639989 |
734d12649ac34a24d15caa1b8a09baebdeceaa93 | 3,728 | py | Python | src/evaluation/classification.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 24 | 2018-12-12T08:54:52.000Z | 2021-12-07T08:45:13.000Z | src/evaluation/classification.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 3 | 2019-07-18T20:14:41.000Z | 2022-03-12T01:03:28.000Z | src/evaluation/classification.py | niall-twomey/har_datasets | 68f142ba613ce26f67cdd6b871117f4c24ea603f | [
"MIT"
] | 9 | 2018-12-12T16:18:39.000Z | 2022-03-30T16:25:47.000Z | from collections import Counter
import numpy as np
from loguru import logger
from scipy.special import logsumexp
from sklearn import metrics
__all__ = ["evaluate_data_split"]
def evaluate_data_split(split, targets, estimator, prob_predictions):
res = dict()
predictions = estimator.classes_[prob_predictions... | 38.040816 | 116 | 0.633047 |
734d35417e1d4db853b8d721c16e8acc6687d1af | 1,594 | py | Python | openpharmacophore/algorithms/bisection.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 14 | 2021-11-12T10:09:25.000Z | 2022-03-18T08:24:16.000Z | openpharmacophore/algorithms/bisection.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 7 | 2021-11-05T01:37:57.000Z | 2022-01-18T06:03:39.000Z | openpharmacophore/algorithms/bisection.py | uibcdf/openpharmacophore | 4f563fa206f6e7c081502acab97bb795d27bdeb9 | [
"MIT"
] | 3 | 2021-11-05T01:22:47.000Z | 2021-12-12T03:57:09.000Z | ## Bisection algorihtm to insert to a list and kkeping it sorted
## The code was taken from python 3.10 as it accepts a key argument.
def insort_right(a, x, lo=0, hi=None, *, key=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the righ... | 33.914894 | 79 | 0.555834 |
734d37b76edd0340421303e9186fc21583e84996 | 2,132 | py | Python | res/src/JsonFunction.py | gr4ph0s/RefractiveIndex-Importer | 476d5f87646a1202f28f6c634ded2e6a46b5d747 | [
"MIT"
] | 9 | 2017-06-11T09:24:48.000Z | 2021-02-20T23:56:56.000Z | res/src/JsonFunction.py | gr4ph0s/RefractiveIndex-Importer | 476d5f87646a1202f28f6c634ded2e6a46b5d747 | [
"MIT"
] | null | null | null | res/src/JsonFunction.py | gr4ph0s/RefractiveIndex-Importer | 476d5f87646a1202f28f6c634ded2e6a46b5d747 | [
"MIT"
] | 2 | 2018-09-19T05:54:18.000Z | 2021-06-27T15:39:58.000Z | import os
import json
class JsonFunction():
"""
class for handling json I/O
TODO: better file hanlding
"""
def __init__(self):
self.fileContent = str()
self.file = os.path.join(os.path.dirname(os.path.dirname(os.path.split(__file__)[0])),"index.json") #The full path of the json f... | 28.810811 | 139 | 0.583959 |
734d514087de49fc8677ae250c7268e6b4418108 | 6,331 | py | Python | dashboard/src/unit_tests.py | cnulenka/fabric8-analytics-common | 570bfa69d885543944f90decc23397f546385f69 | [
"Apache-2.0"
] | null | null | null | dashboard/src/unit_tests.py | cnulenka/fabric8-analytics-common | 570bfa69d885543944f90decc23397f546385f69 | [
"Apache-2.0"
] | null | null | null | dashboard/src/unit_tests.py | cnulenka/fabric8-analytics-common | 570bfa69d885543944f90decc23397f546385f69 | [
"Apache-2.0"
] | null | null | null | """Test coverage parsing and computing."""
import re
import requests
from progress_bar import progress_bar_class, progress_bar_width
from jacoco_to_codecov import ProjectCoverageReport
from fastlog import log
# default code coverage threshold used when no threshold is specified
# in the configuration file
CODE_COVER... | 39.81761 | 95 | 0.652346 |
734db466960b3bca616efa2de220850f9fc735cb | 36,224 | py | Python | utils/modelhandler.py | sogno-platform/proloaf | 2c9350a291056e7a56c115ccbda3aaa019f12bbe | [
"Apache-2.0"
] | 4 | 2021-06-08T20:43:08.000Z | 2021-09-22T00:25:26.000Z | utils/modelhandler.py | sogno-platform/proloaf | 2c9350a291056e7a56c115ccbda3aaa019f12bbe | [
"Apache-2.0"
] | null | null | null | utils/modelhandler.py | sogno-platform/proloaf | 2c9350a291056e7a56c115ccbda3aaa019f12bbe | [
"Apache-2.0"
] | 2 | 2021-07-08T17:41:54.000Z | 2021-07-14T09:57:25.000Z | # Copyright 2021 The ProLoaF Authors. All Rights Reserved.
#
# 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... | 34.335545 | 141 | 0.622543 |
734dd6bab356d999506b26b11991b84728e7491a | 5,570 | py | Python | src/robot/output/listenerarguments.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/output/listenerarguments.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/output/listenerarguments.py | bradyarthur/RobotFramework | f45747dfec1095359379ba0088cecd955a83e576 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... | 36.168831 | 88 | 0.628007 |
734deaa88877efa0ae95d0b66a1ed638bd1a196d | 4,010 | py | Python | alipay/aop/api/request/AlipayOverseasTaxNeworderStatusSyncRequest.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/request/AlipayOverseasTaxNeworderStatusSyncRequest.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/request/AlipayOverseasTaxNeworderStatusSyncRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayOverseasTaxNeworderStatusSyncModel import AlipayOverseasTaxNeworderStatusSyncModel
class AlipayOverseasTaxNeworderStatusSyncRe... | 27.655172 | 148 | 0.64788 |
734debe6f7a187d2f67e7bb3eb271e79f3c1d089 | 595 | py | Python | stdplugins/shoot.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 6 | 2020-04-21T04:52:42.000Z | 2020-06-19T09:33:02.000Z | stdplugins/shoot.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 2 | 2020-05-22T14:59:05.000Z | 2020-05-28T12:04:02.000Z | stdplugins/shoot.py | dqanshi/alluka | f1ac5b227f4e12a4363c6e06b8acc0fd5aac6f1c | [
"Apache-2.0"
] | 12 | 2019-10-25T18:48:16.000Z | 2020-04-26T11:31:21.000Z | """Reply to any message (.shoot) to kill that fuking user.Created by @NeoMatrix90 .Don't fucking edit this, Otherwise u r geyyy."""
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="shoot$ ?(.*)", allow_sudo=True)) # pylint:disable=E0602
async def killing (killed):
""" Dont Kill Too much -_-"""
... | 39.666667 | 131 | 0.610084 |
734df10bc1ab2e43c635e24f30f4f0ee0bce23ad | 3,941 | py | Python | sandbox/settings/base.py | sveetch/django-icomoon | 327b70e5509811db7b46f2baa8d301a49e626167 | [
"MIT"
] | 3 | 2015-09-19T11:46:52.000Z | 2016-07-16T13:12:33.000Z | sandbox/settings/base.py | sveetch/django-icomoon | 327b70e5509811db7b46f2baa8d301a49e626167 | [
"MIT"
] | 15 | 2015-09-19T21:30:06.000Z | 2021-12-22T00:24:57.000Z | sandbox/settings/base.py | sveetch/django-icomoon | 327b70e5509811db7b46f2baa8d301a49e626167 | [
"MIT"
] | null | null | null | """
Base Django settings for sandbox
WARNING: Keep file "docs/dummy_settings.py" synchronized with this one.
"""
import os
BASE_DIR = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"..",
)
DATA_DIR = os.path.join(BASE_DIR, "..", "data")
# SECURITY WARNING: keep the secret key used in production ... | 26.273333 | 95 | 0.691195 |
734e4558d63629b6427b46c85b95823baacdde0e | 1,413 | py | Python | kb_learning/envs/_env_wrapper.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | kb_learning/envs/_env_wrapper.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | kb_learning/envs/_env_wrapper.py | gregorgebhardt/kb_learning | 41e18c1238e0ea891d48aff63588366dae64e4c8 | [
"BSD-3-Clause"
] | null | null | null | from gym import ActionWrapper
from gym.spaces import Box
import numpy as np
class NormalizeActionWrapper(ActionWrapper):
def __init__(self, env):
super().__init__(env)
assert isinstance(self.action_space, Box)
# assert len(self.action_space.shape) == 1
self.mean = (self.action_s... | 32.860465 | 87 | 0.593064 |
734e46491927aa92511dd617834180ac4bae245d | 5,174 | py | Python | mayiutils/finance/tushare_wrapper.py | mayi140611/mayiutils_n1 | 22a1178fc5d86df53fa9769145c64ef4aa8ffeff | [
"Apache-2.0"
] | null | null | null | mayiutils/finance/tushare_wrapper.py | mayi140611/mayiutils_n1 | 22a1178fc5d86df53fa9769145c64ef4aa8ffeff | [
"Apache-2.0"
] | null | null | null | mayiutils/finance/tushare_wrapper.py | mayi140611/mayiutils_n1 | 22a1178fc5d86df53fa9769145c64ef4aa8ffeff | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# encoding: utf-8
"""
@author: Ian
@file: stock_wrapper.py
@time: 2019-08-11 22:57
"""
from datetime import datetime, timedelta
import pandas as pd
import tushare as ts
def getColnames(s):
"""
常见的copy网页上的表格时,处理利用
s = \"""ts_code str TS股票代码
trade_date str 交易日期
close float 当日收盘价
... | 31.742331 | 156 | 0.512756 |
734e4ba3feea446a11bc2a202cde8aa87861096d | 2,626 | py | Python | tests/test_auth.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | 1 | 2021-10-17T13:28:51.000Z | 2021-10-17T13:28:51.000Z | tests/test_auth.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | null | null | null | tests/test_auth.py | Simple2B/cortex-backend | 9cf6802b0eff9254875bcbe553517500ccfc9082 | [
"MIT"
] | null | null | null | import pytest
from typing import Generator
from fastapi.testclient import TestClient
import tests.setup # noqa: F401
from app.database import engine, Base
from app.setup import create_app
from app.models import Doctor
@pytest.fixture()
def client() -> Generator:
app = create_app()
Base.metadata.drop_all(bi... | 29.505618 | 82 | 0.667555 |
734e790cd33196c8ee13d4b6b12b5921de56cb3a | 1,012 | py | Python | CS/CSC148/lectures/week5/Wed.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/lectures/week5/Wed.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/lectures/week5/Wed.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | # Concatenate strings in a (nested) list
# 1. concatenate strings in a non-nested list
# 2. list are themselves lists
def concat_str(string_list):
"""
Concatenate all the strings in a possibly-nested list of strings
@param str|list(str|list(...)) string_list: this string list.
@rtype: str
>>> lis... | 28.111111 | 98 | 0.601779 |
734e97d92a8467c92d3e8253b1d748767b8797c4 | 2,680 | py | Python | rllib/agents/ddpg/td3.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | rllib/agents/ddpg/td3.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | rllib/agents/ddpg/td3.py | naijoaix/ray | 5a43b075bcc346fb95f1d30c85dbcb79a7fa5769 | [
"Apache-2.0"
] | null | null | null | """A more stable successor to TD3.
By default, this uses a near-identical configuration to that reported in the
TD3 paper.
"""
from ray.rllib.agents.ddpg.ddpg import DDPGTrainer, DEFAULT_CONFIG as DDPG_CONFIG
from ray.rllib.utils.annotations import override
from ray.rllib.utils.typing import TrainerConfigDict
from ray... | 36.712329 | 81 | 0.619403 |
734edfe556deac34e884157cc328d7864ac03d4d | 37,548 | py | Python | src/gevent/hub.py | snjypl/gevent | 0e524d8143646d3a9dde33a94a035b30d08a1793 | [
"MIT"
] | 1 | 2019-05-09T08:59:55.000Z | 2019-05-09T08:59:55.000Z | src/gevent/hub.py | snjypl/gevent | 0e524d8143646d3a9dde33a94a035b30d08a1793 | [
"MIT"
] | null | null | null | src/gevent/hub.py | snjypl/gevent | 0e524d8143646d3a9dde33a94a035b30d08a1793 | [
"MIT"
] | null | null | null | # Copyright (c) 2009-2015 Denis Bilenko. See LICENSE for details.
"""
Event-loop hub.
"""
from __future__ import absolute_import
# XXX: FIXME: Refactor to make this smaller
# pylint:disable=too-many-lines
from functools import partial as _functools_partial
import os
import sys
import traceback
from greenlet import gre... | 35.65812 | 117 | 0.632098 |
734ee21a69b32fb13e9fcfe149bf06923a060db8 | 8,174 | py | Python | docs/conf.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | 11 | 2016-09-14T21:59:55.000Z | 2019-01-28T21:58:31.000Z | docs/conf.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | 1 | 2021-03-26T12:01:22.000Z | 2021-03-26T20:40:46.000Z | docs/conf.py | jd/sqlalchemy-utils | fa78e45f9bd38b46d5aface41914dad022c0099b | [
"BSD-3-Clause"
] | 3 | 2021-03-22T14:24:40.000Z | 2021-04-02T08:05:27.000Z | # -*- coding: utf-8 -*-
#
# SQLAlchemy-Utils documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 19 11:16:09 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | 32.959677 | 171 | 0.719843 |
734eec8006b7caba45ecd4691d6501126bbf2bdd | 129 | py | Python | Exercicios do curso em video/pythonProject/pythonexercicios/ex021.py | HiCosta/Exercicios-de-Python | 1dabbe8764f6742aba1d62a9ea14705534aaf6f7 | [
"MIT"
] | null | null | null | Exercicios do curso em video/pythonProject/pythonexercicios/ex021.py | HiCosta/Exercicios-de-Python | 1dabbe8764f6742aba1d62a9ea14705534aaf6f7 | [
"MIT"
] | null | null | null | Exercicios do curso em video/pythonProject/pythonexercicios/ex021.py | HiCosta/Exercicios-de-Python | 1dabbe8764f6742aba1d62a9ea14705534aaf6f7 | [
"MIT"
] | null | null | null | from pygame import mixer
mixer.init()
mixer.music.load('ex021.wav')
mixer.music.play()
enc = input('Tecle algo para encerrar: ')
| 21.5 | 41 | 0.736434 |
734f026bb58aa942921bee1872ed87168ae4754e | 3,534 | py | Python | kuryr/lib/binding/__init__.py | openstack/kuryr | 5b38e84ef8a0a62ee44d53ddd1cda377b0d9d934 | [
"Apache-2.0"
] | 207 | 2015-07-15T01:46:02.000Z | 2022-03-24T10:06:53.000Z | kuryr/lib/binding/__init__.py | MaysaMacedo/kuryr | 34439895e3c17e5b7de9a72cafc411bb97230853 | [
"Apache-2.0"
] | 1 | 2015-10-29T14:59:06.000Z | 2015-10-29T14:59:06.000Z | kuryr/lib/binding/__init__.py | MaysaMacedo/kuryr | 34439895e3c17e5b7de9a72cafc411bb97230853 | [
"Apache-2.0"
] | 58 | 2015-07-22T08:29:32.000Z | 2021-08-11T08:56:11.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 46.5 | 78 | 0.690153 |
734f109a44db5c0b137f7c744dca014a48adf47b | 231 | py | Python | pili/ctrl/__init__.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 2 | 2019-12-22T13:05:08.000Z | 2020-02-02T13:05:31.000Z | pili/ctrl/__init__.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | 71 | 2016-10-31T15:41:10.000Z | 2022-03-21T14:26:22.000Z | pili/ctrl/__init__.py | pilosus/pili | 8eb51e79420b7a2e4148f3b819e787cf6711e8cd | [
"MIT"
] | null | null | null | from flask import Blueprint
ctrl = Blueprint('ctrl', __name__)
from pili.ctrl import views, errors
from pili.models import Permission
@ctrl.app_context_processor
def inject_permissions():
return dict(Permission=Permission)
| 19.25 | 38 | 0.796537 |
734f45cce7010c43405acec1381fe05328a109b9 | 6,186 | py | Python | tests/gpuarray/test_type.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | 1 | 2021-08-10T20:20:22.000Z | 2021-08-10T20:20:22.000Z | tests/gpuarray/test_type.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | tests/gpuarray/test_type.py | anirudhacharya/Theano-PyMC | 55f54243cf88397b032ebc7121d1090ee91aea7d | [
"BSD-3-Clause"
] | null | null | null | import os
from pickle import Unpickler
import numpy as np
import pytest
import aesara
from aesara.compile.ops import DeepCopyOp, ViewOp
from aesara.configdefaults import config
from aesara.gpuarray.type import GpuArrayType, gpuarray_shared_constructor
from aesara.tensor.basic import Rebroadcast
from aesara.tensor.sha... | 33.619565 | 88 | 0.682671 |
734f9e7e5a492e1c826f8c440f755a2915d044a0 | 9,589 | py | Python | fairseq/data/audio/data_cfg.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | 1 | 2021-12-16T13:20:41.000Z | 2021-12-16T13:20:41.000Z | fairseq/data/audio/data_cfg.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | fairseq/data/audio/data_cfg.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | 1 | 2019-09-05T02:28:49.000Z | 2019-09-05T02:28:49.000Z | # 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 argparse import Namespace
from pathlib import Path
from typing import Dict, Optional
from fairseq.data import Dictionary
def get_config... | 34.003546 | 88 | 0.636146 |
734fadd2711b28bde67e8afdc5cd66510b3ad8c3 | 777 | py | Python | task_attach/utils.py | alkim0/task-attach | e446ac0b0553cbcaf13e87e602aea546a0443ca7 | [
"MIT"
] | 9 | 2020-08-31T12:26:05.000Z | 2022-01-26T21:12:43.000Z | task_attach/utils.py | a-t-0/task-attach | e446ac0b0553cbcaf13e87e602aea546a0443ca7 | [
"MIT"
] | null | null | null | task_attach/utils.py | a-t-0/task-attach | e446ac0b0553cbcaf13e87e602aea546a0443ca7 | [
"MIT"
] | 1 | 2020-08-31T12:25:55.000Z | 2020-08-31T12:25:55.000Z | from .menu import Menu
FILE = "file"
MAIL = "mail"
URL = "url"
# def quote_spec(spec):
# if re.search(r"\s", spec):
# if '"' in spec and "'" in spec:
# quoted_spec = spec
# elif '"' in spec:
# quoted_spec = "'{}'".format(spec)
# else:
# quoted_spec = '"{... | 22.2 | 55 | 0.527671 |
734fd47c59213e23a11d13620f0a247aab1e88c3 | 331,020 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_03_01/models/_models_py3.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 40.294583 | 152 | 0.648181 |
7350395a6ec2bfe2c70b7009ae8460610bdb68f3 | 12,433 | py | Python | alipay/aop/api/domain/AlipayOverseasSecondmerchantOnlineMaintainModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOverseasSecondmerchantOnlineMaintainModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayOverseasSecondmerchantOnlineMaintainModel.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.constant.ParamConstants import *
from alipay.aop.api.domain.MerchantSiteInfo import MerchantSiteInfo
class AlipayOverseasSecondmerchantOnlineMaintainModel(object):
def __init__(self):
self._contact_email = None
self._c... | 38.49226 | 105 | 0.64739 |
735044bc1b492bb3dfb0b580b4b7f75f81605415 | 2,716 | py | Python | sandboxmgt/app/forms.py | alphagov/sandbox-mgt | 6fa2681c84b509ab65fe86de32f78cd2abf064a6 | [
"MIT"
] | 2 | 2017-07-24T17:00:58.000Z | 2017-12-20T18:01:31.000Z | sandboxmgt/app/forms.py | alphagov/sandbox-mgt | 6fa2681c84b509ab65fe86de32f78cd2abf064a6 | [
"MIT"
] | 7 | 2017-06-21T10:19:01.000Z | 2017-09-27T16:16:26.000Z | sandboxmgt/app/forms.py | alphagov/sandbox-mgt | 6fa2681c84b509ab65fe86de32f78cd2abf064a6 | [
"MIT"
] | 2 | 2019-08-29T11:53:53.000Z | 2021-04-10T19:53:28.000Z | import re
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from .models import Request
def validate_gov_email(value):
if value.endswith('.gov.uk') is False:
raise ValidationError(
_('%(value)s is not a valid go... | 33.121951 | 148 | 0.616716 |
73506838ecea1486e57a9f53138190921344e13d | 1,072 | py | Python | runners/conditional/base_runner.py | MaxASchwarzer/TDVAE-RL-Project | 55e7c7761be7772b51e01d43bedb387544f6f1ef | [
"MIT"
] | 3 | 2019-05-30T08:21:53.000Z | 2021-01-13T13:46:11.000Z | runners/conditional/base_runner.py | MaxASchwarzer/TDVAE-RL-Project | 55e7c7761be7772b51e01d43bedb387544f6f1ef | [
"MIT"
] | null | null | null | runners/conditional/base_runner.py | MaxASchwarzer/TDVAE-RL-Project | 55e7c7761be7772b51e01d43bedb387544f6f1ef | [
"MIT"
] | null | null | null | import importlib
from readers.gym_reader import GymReader
from pylego import misc, runner
class BaseRunner(runner.Runner):
def __init__(self, flags, model_class, log_keys, *args, **kwargs):
self.flags = flags
reader = GymReader(flags.env, flags.seq_len, flags.batch_size, flags.threads, flags.ite... | 51.047619 | 117 | 0.681903 |
735084fea31c9f986c55b36df1b9a46353fbea80 | 7,624 | py | Python | fluids/optional/irradiance.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | fluids/optional/irradiance.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | fluids/optional/irradiance.py | volpatto/fluids | 693268d0fd7c9e2f276ebdf14353cb9d7dbac195 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
irradiance.py from pvlib
========================
Extremely stripped down, reimplementation/vendorized version from:
https://github.com/pvlib/pvlib-python/
The rational for not including this library as a strict dependency is to avoid
including a dependency on pandas, keeping load time low,... | 36.132701 | 87 | 0.676941 |
73509fb60246e966f4d1b59bd2d26e62716c092a | 4,626 | py | Python | archive/nexus-api-v2/Calendar/Imports.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Calendar/Imports.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | null | null | null | archive/nexus-api-v2/Calendar/Imports.py | cloud-hybrid/delta | 402b00ed5aaa32ccef628361e9635879b7ace44f | [
"BSD-3-Clause"
] | 1 | 2022-01-03T05:33:15.000Z | 2022-01-03T05:33:15.000Z | #!/usr/bin/env python3
# -*- Coding: UTF-8 -*- #
# -*- System: Linux -*- #
# -*- Usage: *.py -*- #
# Owner: Jacob B. Sanders
# Source: gitlab.cloud-technology.io
# License: BSD 3-Clause License
"""
...
"""
# =============================================================================
# Standard Library
# =... | 22.028571 | 80 | 0.52032 |
7350b57cffbef8adb3ea3bfe33fdd98b3517bd83 | 7,427 | py | Python | nova/tests/unit/objects/test_instance_numa_topology.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2016-04-28T16:20:38.000Z | 2021-04-25T11:19:03.000Z | nova/tests/unit/objects/test_instance_numa_topology.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/objects/test_instance_numa_topology.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 5 | 2020-04-08T20:24:45.000Z | 2020-10-05T19:02:13.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 39.930108 | 78 | 0.676855 |
7350d21b2260e1c5699be0fcbd6fa6ac2ccbd6c8 | 79,434 | py | Python | salt/config.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | 1 | 2020-09-16T21:31:02.000Z | 2020-09-16T21:31:02.000Z | salt/config.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | null | null | null | salt/config.py | jbq/pkg-salt | b6742e03cbbfb82f4ce7db2e21a3ff31b270cdb3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
All salt configuration loading and defaults should be in this module
'''
from __future__ import absolute_import
# Import python libs
from __future__ import generators
import glob
import os
import re
import logging
from copy import deepcopy
import time
import codecs
# import third party li... | 35.351135 | 102 | 0.594342 |
7350eee08660a5c7b347ecb816e4ecf214c637cf | 8,560 | py | Python | server/server/organizations/management/commands/fetch_orgs.py | connectiveproject/connective | 8866082b2147feef0e5254ac4215987b9d881396 | [
"MIT"
] | 4 | 2021-07-05T10:49:26.000Z | 2021-11-24T11:34:43.000Z | server/server/organizations/management/commands/fetch_orgs.py | connectiveproject/connective | 8866082b2147feef0e5254ac4215987b9d881396 | [
"MIT"
] | 39 | 2021-06-21T15:02:37.000Z | 2022-02-28T15:07:42.000Z | server/server/organizations/management/commands/fetch_orgs.py | Eyal-VR/connective | 46857dd79dc58f63c3afb9791ecf8adf853a6c57 | [
"MIT"
] | 17 | 2021-06-16T08:59:45.000Z | 2021-09-29T11:35:38.000Z | import csv
import json
import logging
import re
import requests
from django.core.management.base import BaseCommand
import server.organizations.management.commands.config as config
from server.organizations.models import ImportedOrganization
logger = logging.getLogger(__name__)
ajax_data = {
"Content-Type": "ap... | 34.938776 | 111 | 0.595327 |
73510d0c0277b8d6ae05e0dde821bba49e3c84f2 | 714 | py | Python | tofu/tests/tests01_geom/test_02_compute.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 56 | 2017-07-09T10:29:45.000Z | 2022-03-31T02:44:50.000Z | tofu/tests/tests01_geom/test_02_compute.py | WinstonLHS/tofu | c95b2eb6aedcf4bac5676752b9635b78f31af6ca | [
"MIT"
] | 522 | 2017-07-02T21:06:07.000Z | 2022-03-02T08:07:57.000Z | tofu/tests/tests01_geom/test_02_compute.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | 9 | 2017-07-02T20:38:53.000Z | 2021-12-04T00:12:30.000Z | """
This module contains tests for tofu.geom in its structured version
"""
# External modules
import os
import numpy as np
import matplotlib.pyplot as plt
#######################################################
#
# Setup and Teardown
#
#######################################################
def setup_module(mo... | 25.5 | 66 | 0.585434 |
73511231acaa6a4ba905680b1a0bc2ec7cbc3701 | 1,240 | py | Python | userbot/plugins/weebify.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/weebify.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/weebify.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """ Weebify a text,
Ported from Saitama Bot.
By :- @PhycoNinja13b
Modified by :- @kirito6969
.weeb <text> """
from uniborg.util import lightning_cmd
normiefont = [
"a",
"b",
"c",
"d",
"e",
"f",
"g",
"h",
"i",
"j",
"k",
"l",
"m",
"n",
"o",
"p",
"q",
... | 14.939759 | 73 | 0.452419 |
73511a033bf52dd1c9079350d9449766849a79d7 | 4,710 | py | Python | src/update.py | Hurricane-Chen/CUG-Immediately | 1e261e8d9a947d304444d63945d7edb2ac5481b5 | [
"Apache-2.0"
] | 1 | 2021-01-16T15:45:15.000Z | 2021-01-16T15:45:15.000Z | src/update.py | chenlx0/CUG-Immediately | 1e261e8d9a947d304444d63945d7edb2ac5481b5 | [
"Apache-2.0"
] | null | null | null | src/update.py | chenlx0/CUG-Immediately | 1e261e8d9a947d304444d63945d7edb2ac5481b5 | [
"Apache-2.0"
] | 2 | 2017-03-01T13:00:16.000Z | 2017-03-18T13:50:45.000Z | # -*- coding: utf-8 -*-
import os
import pymysql
import datetime
import configparser
import requests
from bs4 import BeautifulSoup
from time import sleep
def get_mysql_info():
"""
Get MySQL configure information from "spider.conf"
return a dict contains host, password, user and database name(dbname)
... | 34.632353 | 107 | 0.556051 |
73516d73e22c403a899d2b96afe31d58b7106f63 | 261 | py | Python | examples/manage.py | rudeb0t/tornadio2go | ad618717c6b185fee533928d378c086e273685a9 | [
"BSD-3-Clause"
] | 1 | 2015-02-13T06:36:03.000Z | 2015-02-13T06:36:03.000Z | examples/manage.py | rudeb0t/tornadio2go | ad618717c6b185fee533928d378c086e273685a9 | [
"BSD-3-Clause"
] | 1 | 2016-03-24T16:00:38.000Z | 2016-03-24T16:00:38.000Z | examples/manage.py | rudeb0t/tornadio2go | ad618717c6b185fee533928d378c086e273685a9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tornadio2go_sample.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 23.727273 | 82 | 0.781609 |
73516ddb6330b95c88515d5dd8eebdf0d0b5eb09 | 8,501 | py | Python | influxdb_client/domain/dbrp.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | influxdb_client/domain/dbrp.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | influxdb_client/domain/dbrp.py | timbeccue/influxdb-client-python | ff136c7990527a87dcf5f8ff39f6f686ce218c98 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class DBRP... | 27.073248 | 149 | 0.561816 |
73518df13efe6ef495069e286431d35ec071aed9 | 47,100 | py | Python | management_layer/tests/test_integration.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | null | null | null | management_layer/tests/test_integration.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | 90 | 2018-01-23T10:30:01.000Z | 2019-01-31T10:53:42.000Z | management_layer/tests/test_integration.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | 1 | 2021-08-17T14:16:23.000Z | 2021-08-17T14:16:23.000Z | import calendar
import json
import aioredis
import jsonschema
import logging
import os
import socket
import subprocess
import time
import uuid
import jwt
from aiohttp import web, ClientSession
from aiohttp.test_utils import AioHTTPTestCase, unittest_run_loop, \
TestClient as Client # Rename TestClient so that it... | 40.429185 | 131 | 0.635223 |
7351bd2f36376ecf0285fe3f944672299d39e849 | 1,973 | py | Python | plugins/aea-cli-benchmark/aea_cli_benchmark/case_messages_memory_usage/command.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-benchmark/aea_cli_benchmark/case_messages_memory_usage/command.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | plugins/aea-cli-benchmark/aea_cli_benchmark/case_messages_memory_usage/command.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- 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... | 30.353846 | 80 | 0.62595 |
7351defe61a1601a4fd78c0f86fad2f081ba8d19 | 382 | py | Python | Python-code-snippets-201-300/230-get windows desktop folder.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/230-get windows desktop folder.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-201-300/230-get windows desktop folder.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | """Code snippets vol-46-snippet-230
Get Windows desktop folder
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
Blog: stevepython.wordpress.com
Requirements:pip3 install pywin32
Source:
http://timgolden.me.uk/python/win32_how_do_i/get-the-desktop-folder.html
"""
from win32com.shell import shell, shellcon
pri... | 22.470588 | 72 | 0.793194 |
7351e2495bbd9731ef463ef78c842a9710ba151d | 738 | py | Python | eip_bridge/scripts/eip_bridge_simulator_node.py | k-okada/eip_bridge | 4499a1937a68660b496485c73e2adf279dd4fda6 | [
"Apache-2.0"
] | null | null | null | eip_bridge/scripts/eip_bridge_simulator_node.py | k-okada/eip_bridge | 4499a1937a68660b496485c73e2adf279dd4fda6 | [
"Apache-2.0"
] | null | null | null | eip_bridge/scripts/eip_bridge_simulator_node.py | k-okada/eip_bridge | 4499a1937a68660b496485c73e2adf279dd4fda6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from eip_bridge.eip_bridge import EIPBridge
from eip_bridge.plc_simulator import PLCSimulator
import rospy
def main():
rospy.init_node('eip_bridge_node', anonymous=True)
# Get the parameters
try:
config = rospy.get_param('~config')
except:
rospy.logfatal('Failed... | 19.421053 | 58 | 0.655827 |
7351e7625a3ed67550fa6b9e0118a72b4da92ee0 | 473 | py | Python | (1)Text/re_groups_match.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (1)Text/re_groups_match.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | (1)Text/re_groups_match.py | mass9/Python | 66499164e36a4fe9630029d34b292ab06f849b2f | [
"MIT"
] | null | null | null | import re
text = 'This is some text -- with punctuation.'
print(text)
print()
patterns = [
(r'^(\w+)', 'word at start of string'),
(r'(\w+)\S*$', 'word at end, with optional punctuation'),
(r'(\bt\w+)\W+(\w+)', 'word starting with t, another word'),
(r'(\w+t)\b', 'word ending with t'),
]
for pattern, desc in patterns:
... | 27.823529 | 60 | 0.59408 |
7351ef1f1bfa0b335526dac95d12a6b98236fe31 | 10,206 | py | Python | alipay/aop/api/domain/AlipayEbppMerchantExternalbillCreateModel.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/AlipayEbppMerchantExternalbillCreateModel.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/AlipayEbppMerchantExternalbillCreateModel.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 AlipayEbppMerchantExternalbillCreateModel(object):
def __init__(self):
self._bill_amount = None
self._bill_date_desc = None
self._bill_date_end = None
self._bill_d... | 32.81672 | 81 | 0.597688 |
73521cab6c9f5421bbdf490e4fbbbfffeb357dd0 | 1,454 | py | Python | tests/utils/test_download.py | 19valentin99/pykale | 4bfc7d49b255d00dbcba39dd9aaf787a8ae0b4ad | [
"MIT"
] | 324 | 2020-11-05T19:07:11.000Z | 2022-03-16T21:31:39.000Z | tests/utils/test_download.py | 19valentin99/pykale | 4bfc7d49b255d00dbcba39dd9aaf787a8ae0b4ad | [
"MIT"
] | 212 | 2020-10-31T15:18:59.000Z | 2022-03-25T14:13:09.000Z | tests/utils/test_download.py | sz144/pykale | 1f5cce57a50f7772520a482e8135a391eb0517f5 | [
"MIT"
] | 52 | 2020-10-28T15:43:48.000Z | 2022-02-24T02:29:52.000Z | import os
from pathlib import Path
import pytest
from kale.utils.download import download_file_by_url, download_file_gdrive
output_directory = Path().absolute().parent.joinpath("test_data/download")
PARAM = [
"https://github.com/pykale/data/raw/main/videos/video_test_data/ADL/annotations/labels_train_test/adl_P_... | 36.35 | 132 | 0.786795 |
73522d5557ab251d1d2efe100135e8bcb6c7d728 | 5,957 | py | Python | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2-beta/async_samples/sample_analyze_general_documents_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2-beta/async_samples/sample_analyze_general_documents_async.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2-beta/async_samples/sample_analyze_general_documents_async.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.
# --------------------------------------------------------------------... | 35.670659 | 136 | 0.543059 |
735235aa3bfeeb46004fcb0a58757431cf013343 | 1,710 | py | Python | data_preprocessing/utils/load_and_save.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | null | null | null | data_preprocessing/utils/load_and_save.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | 4 | 2020-04-30T07:57:42.000Z | 2020-09-27T06:52:00.000Z | data_preprocessing/utils/load_and_save.py | rovo98/model-unkown-dfa-diagnosis-based-on-running-logs | f80c838dea6a8313165fbf10d64d5dc935cc036c | [
"Apache-2.0"
] | null | null | null | # utils functions for saving and loading sparse matrix
# author rovo98
# since 2019.12.24
from scipy.sparse import csr_matrix
import numpy as np
import pickle
def save_sparse_csr(filename, array):
"""compressed and save the given np.array (csr sparse matrix) into a npz file.
:type filename: str
:type ar... | 26.71875 | 99 | 0.669591 |
735246a8003a60330f2d7e01850ed5d4fe7d082a | 892 | py | Python | src/pynwb/legacy/io/epoch.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/legacy/io/epoch.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-06-01T22:25:36.000Z | 2021-06-01T22:25:36.000Z | src/pynwb/legacy/io/epoch.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from pynwb.epoch import Epoch, EpochTimeSeries
from .. import ObjectMapper, register_map
@register_map(Epoch)
class EpochMap(ObjectMapper):
def __init__(self, spec):
super(EpochMap, self).__init__(spec)
start_spec = self.spec.get_dataset('start_time')
stop_spec = self.spec.get_dataset('s... | 29.733333 | 67 | 0.704036 |
735272d3dd9dd35206e3c72d1db1375e1d12d2fe | 2,113 | py | Python | google-cloud-sdk/lib/surface/genomics/variantsets/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/genomics/variantsets/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/genomics/variantsets/list.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.015152 | 80 | 0.713204 |
7352754210993109bb2f022c19d9565ae1aca263 | 6,857 | py | Python | spyder/plugins/ipythonconsole/utils/kernelspec.py | Nicztin/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | 1 | 2019-09-25T15:08:24.000Z | 2019-09-25T15:08:24.000Z | spyder/plugins/ipythonconsole/utils/kernelspec.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | spyder/plugins/ipythonconsole/utils/kernelspec.py | jorgeps86/spyder | 1c7b2232d2abbf1e101a1e2ab0552b32e8472bd6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Kernel spec for Spyder kernels
"""
import os
import os.path as osp
from jupyter_client.kernelspec import KernelSpec
from spyder.config.base import SAFE_MODE, r... | 41.307229 | 80 | 0.569929 |
73527a8cd1298a2c4aa4f271131dc863777e0cd1 | 956 | py | Python | ruia_shell/config.py | python-ruia/ruia-shell | b0488434dd11fd794178d46ef37924be52e6d08b | [
"Apache-2.0"
] | 1 | 2021-01-07T15:44:39.000Z | 2021-01-07T15:44:39.000Z | ruia_shell/config.py | python-ruia/ruia-shell | b0488434dd11fd794178d46ef37924be52e6d08b | [
"Apache-2.0"
] | null | null | null | ruia_shell/config.py | python-ruia/ruia-shell | b0488434dd11fd794178d46ef37924be52e6d08b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Created by howie.hu at 2021/1/6.
"""
import ruia
BANNER = f"""
✨ Write less, run faster({ruia.__version__}).
__________ .__ .__ .__ .__
\______ \__ __|__|____ _____| |__ ____ | | | |
| _/ | \ \__ \ / ___/ | \_/ __ ... | 35.407407 | 85 | 0.452929 |
7352842849739d85ff416ccd118157dd640611a8 | 5,446 | py | Python | src/linakdeskapp/gui/device_control_widget.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/linakdeskapp/gui/device_control_widget.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/linakdeskapp/gui/device_control_widget.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | # MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# t... | 32.416667 | 80 | 0.655527 |
7352a94f291455f541b42adb4c23812b0eba04b4 | 2,603 | py | Python | image_processor.py | korrawat/athack-susan | 6cbe32d8ccac0726279739f6cdb276310afbad6d | [
"MIT"
] | null | null | null | image_processor.py | korrawat/athack-susan | 6cbe32d8ccac0726279739f6cdb276310afbad6d | [
"MIT"
] | null | null | null | image_processor.py | korrawat/athack-susan | 6cbe32d8ccac0726279739f6cdb276310afbad6d | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from camera import Camera
from processor_properties import ProcessorProperties
class ProcessedStream:
def __init__(self, camera, properties):
''' properties is a dictionary of properties '''
self.camera = camera
self.properties = properties
def read(self... | 35.657534 | 138 | 0.696888 |
7352c08c3df705bbb0de6ece15eaa02958efb3e7 | 1,436 | py | Python | test/test_bad_request_source.py | hypostulate/mbta-api-client | f18903b6269c523c733a31574ff4579349fed3f8 | [
"MIT"
] | null | null | null | test/test_bad_request_source.py | hypostulate/mbta-api-client | f18903b6269c523c733a31574ff4579349fed3f8 | [
"MIT"
] | null | null | null | test/test_bad_request_source.py | hypostulate/mbta-api-client | f18903b6269c523c733a31574ff4579349fed3f8 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
MBTA
MBTA service API. https://www.mbta.com Source code: https://github.com/mbta/api # noqa: E501
The version of the OpenAPI document: 3.0
Contact: developer@mbta.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
im... | 26.592593 | 97 | 0.676184 |
7352d98955555dc7fa092983bf8f5597abefe491 | 3,305 | py | Python | code.py | dhawalchaudhari/olympics-data-analysis | b1b5c7ae02e5c4513bc79effce29ed3acc42b03c | [
"MIT"
] | null | null | null | code.py | dhawalchaudhari/olympics-data-analysis | b1b5c7ae02e5c4513bc79effce29ed3acc42b03c | [
"MIT"
] | null | null | null | code.py | dhawalchaudhari/olympics-data-analysis | b1b5c7ae02e5c4513bc79effce29ed3acc42b03c | [
"MIT"
] | null | null | null | # --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file is stored in the variable path
#Code starts here
# Data Loading
data = pd.read_csv(path)
data.rename(columns = {'Total' : 'Total_Medals'}, inplace = True)
data.head(10)
# Summer or Wint... | 31.778846 | 155 | 0.73767 |
7352db07f804eaf4e57ccdde7d9f3ffa19fc02ba | 1,083 | py | Python | tests/test_provider_kradalby_opnsense.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | tests/test_provider_kradalby_opnsense.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | tests/test_provider_kradalby_opnsense.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # tests/test_provider_kradalby_opnsense.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:23:52 UTC)
def test_provider_import():
import terrascript.provider.kradalby.opnsense
def test_resource_import():
from terrascript.resource.kradalby.opnsense import opnsense_firewall_alias
from terr... | 30.942857 | 83 | 0.784857 |
7352dba916e3ec4cb9b30ed027d7675091286620 | 429 | py | Python | deploy/csv2db.py | workforce-data-initiative/etp-api | 9ad4c377f06d42b186661038dad4b026ca60584b | [
"MIT"
] | 2 | 2017-06-23T22:55:13.000Z | 2017-08-08T14:57:39.000Z | deploy/csv2db.py | workforce-data-initiative/tpot-api | 9ad4c377f06d42b186661038dad4b026ca60584b | [
"MIT"
] | 12 | 2017-03-29T21:47:04.000Z | 2018-06-27T12:05:48.000Z | deploy/csv2db.py | workforce-data-initiative/etp-api | 9ad4c377f06d42b186661038dad4b026ca60584b | [
"MIT"
] | 3 | 2017-08-08T02:03:46.000Z | 2017-08-10T19:04:20.000Z | import json
import pandas as pd
import subprocess
import os
from sqlalchemy import create_engine
configobj = json.load(open("config/config.json"))
CSVPATH = configobj['dbpath']
command = 'heroku config:get DATABASE_URL'
heroku_pg = subprocess.check_output(command.split()).decode('utf-8')
engine = create_engine(her... | 22.578947 | 73 | 0.773893 |
7352f73f6f1bcd0465933e9e9a6bf084a17aa6f1 | 849 | py | Python | common/updates_app.py | pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | 11 | 2020-01-15T14:25:48.000Z | 2021-11-25T04:21:18.000Z | common/updates_app.py | Pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | 8 | 2021-02-04T16:41:57.000Z | 2022-03-29T21:57:15.000Z | common/updates_app.py | pythings/PythingsOS | 276b41a32af7fa0d5395b2bb308e611f784f9711 | [
"Apache-2.0"
] | null | null | null | import env
import logger
from utils import mv
from api import apost,download
from platform import platform
def update_app(version):
files = apost(api='/apps/get/', data={'version':version, 'list':True})['content']
# First of all remove /app.py to say that there is no valid App yet (download is in progress)
... | 40.428571 | 131 | 0.663133 |
7353183cf580213c32bbfc94e2782eaa68c52bdd | 6,172 | py | Python | napari/_vispy/vispy_camera.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_camera.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | napari/_vispy/vispy_camera.py | pranathivemuri/napari | 7a7f824b686a276dc6cdc8013d8f437e3c3b03e1 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from vispy.scene import ArcballCamera, PanZoomCamera
from .quaternion import quaternion2euler
class VispyCamera:
"""Vipsy camera for both 2D and 3D rendering.
Parameters
----------
view : vispy.scene.widgets.viewbox.ViewBox
Viewbox for current scene.
camera : napari.co... | 33.726776 | 101 | 0.623299 |
735349407f88fbc3118194696b2c65c4e6aa489b | 4,698 | py | Python | ebml/tests/test_core.py | yomguy/python-ebml | 5981ca259e9c586411fd3cbce472ba741dc5dd0d | [
"0BSD"
] | 1 | 2019-10-17T18:21:31.000Z | 2019-10-17T18:21:31.000Z | ebml/tests/test_core.py | yomguy/python-ebml | 5981ca259e9c586411fd3cbce472ba741dc5dd0d | [
"0BSD"
] | null | null | null | ebml/tests/test_core.py | yomguy/python-ebml | 5981ca259e9c586411fd3cbce472ba741dc5dd0d | [
"0BSD"
] | null | null | null | import unittest
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
import random
import sys
from ..core import *
class ElementSizeTests(unittest.TestCase):
def assert_roundtrip(self, value, length=None):
encoded = encode_element_size(value, length=length)
if length is not Non... | 28.472727 | 111 | 0.730736 |
73534daba21ee211f7b706814e95f2abf33aedb8 | 86,028 | py | Python | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-01-24T08:54:57.000Z | 2022-01-24T08:54:57.000Z | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from collections import defaultdict
import os
import pytest
import platform
import functools
import itertools
import datetime
import json
from unittest import mock
from... | 46.754348 | 353 | 0.626877 |
73535538ddb43cc900a6b20840269de46e616610 | 761 | py | Python | env_flag/__init__.py | metabolize/env-flag | 72067035b28c54162cf07b0103033ff90819ab72 | [
"BSD-2-Clause"
] | 2 | 2020-02-27T13:40:10.000Z | 2021-05-15T22:06:35.000Z | env_flag/__init__.py | bodylabs/env-flag | 72067035b28c54162cf07b0103033ff90819ab72 | [
"BSD-2-Clause"
] | 23 | 2019-08-19T11:44:40.000Z | 2021-08-01T05:27:33.000Z | env_flag/__init__.py | bodylabs/env-flag | 72067035b28c54162cf07b0103033ff90819ab72 | [
"BSD-2-Clause"
] | 2 | 2017-10-24T23:25:22.000Z | 2019-02-16T11:27:41.000Z | __version__ = "2.1.0"
def env_flag(env_var: str, default: bool = False) -> bool:
"""
Return the specified environment variable coerced to a bool, as follows:
- When the variable is unset, or set to the empty string, return `default`.
- When the variable is set to a truthy value, returns `True`.
... | 30.44 | 79 | 0.620237 |
73536eb59aaefe2805d41f9cc2baf0609714fa73 | 353 | py | Python | eth/rlp/sedes.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 137 | 2017-03-17T11:37:51.000Z | 2022-03-07T07:51:28.000Z | eth/rlp/sedes.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 102 | 2017-04-07T10:43:03.000Z | 2018-11-11T18:01:56.000Z | eth/rlp/sedes.py | jin10086/py-evm | da04e8de42fdbf3bc5ca596f5f6b3d810c1afea8 | [
"MIT"
] | 39 | 2017-03-17T11:38:52.000Z | 2021-02-18T23:05:17.000Z | from rlp.sedes import (
BigEndianInt,
Binary,
)
from eth.constants import (
COLLATION_SIZE,
)
address = Binary.fixed_length(20, allow_empty=True)
collation_body = Binary.fixed_length(COLLATION_SIZE)
hash32 = Binary.fixed_length(32)
int32 = BigEndianInt(32)
int256 = BigEndianInt(256)
trie_root = Binary.fi... | 20.764706 | 53 | 0.764873 |
73537e6ec1e9611f968776bf7979dad10bf3c294 | 8,242 | py | Python | printing/PSFont.py | notatallshaw/Grail-0.6 | 2b850a4a3dcfcb6cb4cf891f2c2f9ee0509c7b43 | [
"CNRI-Jython"
] | 22 | 2021-05-17T07:01:04.000Z | 2021-10-31T09:03:29.000Z | printing/PSFont.py | SimiCode/Grail-Web-Browser | 16b86d3215068d334eacf6153b71a748eed53d3d | [
"CNRI-Jython"
] | 17 | 2021-05-17T04:39:49.000Z | 2021-09-06T14:50:39.000Z | printing/PSFont.py | SimiCode/Grail-Web-Browser | 16b86d3215068d334eacf6153b71a748eed53d3d | [
"CNRI-Jython"
] | 6 | 2021-05-17T07:37:01.000Z | 2022-01-09T10:26:24.000Z | """Access to font metrics and PostScript name mappings.
All access is through the PSFont class.
"""
__version__ = '$Revision: 1.4 $'
import fonts # package
import utils
# This dictionary maps PostScript font names to the normal, bold and
# italic suffixes for the font. Key is the short n... | 39.625 | 74 | 0.614535 |
73538794a725e5d2608b0caf726658231149a8f4 | 2,885 | py | Python | src/ggrc/models/hooks/custom_attribute_definition.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | src/ggrc/models/hooks/custom_attribute_definition.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/hooks/custom_attribute_definition.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Custom Attribute Definition hooks"""
from ggrc import models, views
from ggrc.services import signals
from ggrc.models import custom_attribute_definition as cad
def invalidate_cache(sender, obj, src=No... | 37.467532 | 78 | 0.737262 |
73538ede5f6a57faba0e9c6da91618c2cdd6f9fb | 15,331 | py | Python | reg.py | VITA-Group/Diverse-ViT | 8116a7df7cbba246e0d7531d37a8328421a4fd77 | [
"MIT"
] | 8 | 2022-03-09T00:58:51.000Z | 2022-03-30T21:03:30.000Z | reg.py | VITA-Group/Diverse-ViT | 8116a7df7cbba246e0d7531d37a8328421a4fd77 | [
"MIT"
] | null | null | null | reg.py | VITA-Group/Diverse-ViT | 8116a7df7cbba246e0d7531d37a8328421a4fd77 | [
"MIT"
] | null | null | null | import torch
import numpy as np
from timm.loss import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy
__all__ = ['Loss_mixing', 'Loss_cosine', 'Loss_contrastive',
'Loss_cosine_attn', 'Loss_condition_orth_weight']
# Embedding Level Size: (Batch-size, Tokens, Dims * Heads)
# Attention Level Size: (B... | 35.08238 | 115 | 0.667015 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.