hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
38409af830d185e6db60580d4fce6581028fc750 | 1,247 | py | Python | dowsing/tests/maturin.py | bgerrity/dowsing | 87172e2a26bf3704b2fee256be4600e1925b257e | [
"MIT"
] | 1 | 2022-03-21T22:41:58.000Z | 2022-03-21T22:41:58.000Z | dowsing/tests/maturin.py | bgerrity/dowsing | 87172e2a26bf3704b2fee256be4600e1925b257e | [
"MIT"
] | 47 | 2020-10-02T20:33:58.000Z | 2022-03-31T19:10:18.000Z | dowsing/tests/maturin.py | jreese/dowsing | f2ad1becb10fab631dc5143ba9547eb478cbf90e | [
"MIT"
] | 4 | 2020-05-25T04:50:51.000Z | 2022-02-04T15:20:28.000Z | import unittest
from pathlib import Path
import volatile
from dowsing.maturin import MaturinReader
class MaturinReaderTest(unittest.TestCase):
def test_orjson(self) -> None:
# This is a simplified version of orjson 3.4.0
with volatile.dir() as d:
dp = Path(d)
(dp / "pypro... | 23.980769 | 57 | 0.589415 |
7dbf62e153a2bf51fa48d5b7841557dfcd8dffc1 | 1,738 | py | Python | Infra_2022_update/Userfee_per_FTE.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | Infra_2022_update/Userfee_per_FTE.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | Infra_2022_update/Userfee_per_FTE.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | # generates barplot with units on y-axis and user income per FTE on x-axis
import pandas as pd
import plotly.graph_objects as go
import os
from colour_science_2022 import (
SCILIFE_COLOURS,
)
# Add data
Userfee_FTE = pd.read_excel(
"data/Total User Fee per FTE 2021.xlsx",
sheet_name="Single Data",
hea... | 24.478873 | 112 | 0.663982 |
e72fbdd54b2576424af6cd808db7226ca4bf2682 | 3,935 | py | Python | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_show_server_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_show_server_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-ecs/huaweicloudsdkecs/v2/model/nova_show_server_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class NovaShowServerRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The ... | 27.907801 | 96 | 0.587294 |
0b1291d4045f4223f61fd07043b24ba34909e1bd | 11,331 | py | Python | homeassistant/components/group/light.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:51.000Z | 2019-09-28T07:06:51.000Z | homeassistant/components/group/light.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 19 | 2020-01-29T23:21:07.000Z | 2021-07-23T23:26:51.000Z | homeassistant/components/group/light.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 1 | 2020-06-19T02:47:19.000Z | 2020-06-19T02:47:19.000Z | """This platform allows several lights to be grouped into one light."""
import asyncio
from collections import Counter
import itertools
import logging
from typing import Any, Callable, Iterator, List, Optional, Tuple
import voluptuous as vol
from homeassistant.components import light
from homeassistant.const import (... | 32.748555 | 88 | 0.655988 |
e4dafd9df3c6da4ef9f816a45574016007aae2b4 | 5,000 | py | Python | pyinfra/api/connectors/chroot.py | yggdr/pyinfra | f21315e8b19a59a033e214464a2ca22914856199 | [
"MIT"
] | 1,532 | 2015-06-13T19:48:52.000Z | 2022-03-26T15:32:45.000Z | pyinfra/api/connectors/chroot.py | yggdr/pyinfra | f21315e8b19a59a033e214464a2ca22914856199 | [
"MIT"
] | 729 | 2015-09-24T08:42:39.000Z | 2022-03-31T07:15:44.000Z | pyinfra/api/connectors/chroot.py | yggdr/pyinfra | f21315e8b19a59a033e214464a2ca22914856199 | [
"MIT"
] | 419 | 2015-12-16T21:00:34.000Z | 2022-03-05T21:05:07.000Z | import os
from tempfile import mkstemp
import click
import six
from pyinfra import local, logger
from pyinfra.api import QuoteString, StringCommand
from pyinfra.api.exceptions import ConnectError, InventoryError, PyinfraError
from pyinfra.api.util import get_file_io, memoize
from pyinfra.progress import progress_spi... | 24.038462 | 77 | 0.611 |
af58637a41a3cc1ac5b0b6d037689457b3054bd3 | 17,058 | py | Python | rsnapsim/defunct/generalized_cpp/test_translation_ssa_generic.py | MunskyGroup/rSNAPsim | af3e496d5252e1d2e1da061277123233a5d609b4 | [
"MIT"
] | 1 | 2022-01-28T18:17:37.000Z | 2022-01-28T18:17:37.000Z | rsnapsim/defunct/generalized_cpp/test_translation_ssa_generic.py | MunskyGroup/rSNAPsim | af3e496d5252e1d2e1da061277123233a5d609b4 | [
"MIT"
] | null | null | null | rsnapsim/defunct/generalized_cpp/test_translation_ssa_generic.py | MunskyGroup/rSNAPsim | af3e496d5252e1d2e1da061277123233a5d609b4 | [
"MIT"
] | 1 | 2020-12-02T06:36:17.000Z | 2020-12-02T06:36:17.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Apr 6 18:17:09 2020
@author: willi
"""
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 27 18:07:30 2020
@author: willi
"""
#Test file for generalized SSA
#import rSNAPsim as rss
import numpy as np
import time
import matplotlib.pyplot as plt
import ssa_translation_generic... | 28.862944 | 222 | 0.661391 |
1c0f41127792580391a5ca5c77468f1bd9bec693 | 989 | py | Python | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 14 | 2020-10-15T21:47:18.000Z | 2021-12-01T06:06:51.000Z | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | null | null | null | BubbleSort.py | vanigupta20024/Programming-Challenges | 578dba33e9f6b04052a503bcb5de9b32f33494a5 | [
"MIT"
] | 4 | 2020-06-15T14:40:45.000Z | 2021-06-15T06:22:03.000Z | # GHC Codepath - Module SE101
# Sandbox 10
#!/bin/python3
import math
import os
import random
import re
import sys
# The function is expected to return an INTEGER.
# The function accepts INTEGER_ARRAY nums as parameter.
# Implement bubble sort to sort nums and return the
# number of swaps it took to sort nums.
de... | 20.604167 | 55 | 0.619818 |
2268eafdbd08cd0d6a175d19cedd79b7b984289b | 3,077 | py | Python | python/paddle/fluid/tests/unittests/test_lrn_op.py | mozga-intel/Paddle | e027eb40d7dcb970888a87209af2b3e7393cf25b | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_lrn_op.py | mozga-intel/Paddle | e027eb40d7dcb970888a87209af2b3e7393cf25b | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_lrn_op.py | mozga-intel/Paddle | e027eb40d7dcb970888a87209af2b3e7393cf25b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 30.166667 | 76 | 0.529737 |
6b201e0ebcf484cb1aaced0890e1473662effdb8 | 1,899 | py | Python | OP_ui_list_chapter.py | Tilapiatsu/blender-lineup_maker | b020a791645b08328287e932aa2e9287d222dc4c | [
"MIT"
] | 1 | 2019-07-16T13:11:29.000Z | 2019-07-16T13:11:29.000Z | OP_ui_list_chapter.py | Tilapiatsu/blender-lineup_maker | b020a791645b08328287e932aa2e9287d222dc4c | [
"MIT"
] | null | null | null | OP_ui_list_chapter.py | Tilapiatsu/blender-lineup_maker | b020a791645b08328287e932aa2e9287d222dc4c | [
"MIT"
] | null | null | null | import bpy, re
from . import logger as L
def add_keyword(context, naming_convention, keyword):
if len(naming_convention):
return '{}{}{}{}{}'.format(naming_convention, context.scene.lm_separator, '<', keyword, '>')
else:
return '{}{}{}{}'.format(naming_convention, '<', keyword, '>')
def slic... | 33.315789 | 139 | 0.674566 |
e85cc9c585511309e4279c49ae21a57ef1d7fac2 | 717 | py | Python | web/transiq/restapi/dynamo/config.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | web/transiq/restapi/dynamo/config.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | 14 | 2020-06-05T23:06:45.000Z | 2022-03-12T00:00:18.000Z | web/transiq/restapi/dynamo/config.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from restapi.dynamo.models import DEV_GPS_LOCATION, STAGE_GPS_LOCATION, PROD_GPS_LOCATION, LOCAL_GPS_LOCATION, DEV_User, \
STAGE_User, PROD_User, LOCAL_User
class DynamoTablesEnvConfiguration:
def __init__(self):
if settings.ENV == 'dev':
self.GPS_LOCATION ... | 35.85 | 122 | 0.658298 |
928e349987bf4c2d71fc7819c3b51470956f99bf | 7,788 | py | Python | src/iaqualink/device.py | frenck/iaqualink-py | c75d693225556ec59e32088479be9c0fd84f6e9c | [
"BSD-3-Clause"
] | null | null | null | src/iaqualink/device.py | frenck/iaqualink-py | c75d693225556ec59e32088479be9c0fd84f6e9c | [
"BSD-3-Clause"
] | null | null | null | src/iaqualink/device.py | frenck/iaqualink-py | c75d693225556ec59e32088479be9c0fd84f6e9c | [
"BSD-3-Clause"
] | null | null | null | from enum import Enum, auto, unique
import logging
from typing import Optional
from iaqualink.typing import DeviceData
from iaqualink.const import (
AQUALINK_TEMP_CELSIUS_LOW,
AQUALINK_TEMP_CELSIUS_HIGH,
AQUALINK_TEMP_FAHRENHEIT_LOW,
AQUALINK_TEMP_FAHRENHEIT_HIGH,
)
@unique
class AqualinkState(Enum):... | 27.519435 | 87 | 0.611325 |
d35fa68092f3d5dcaaa8e981ed6c58219c7fca6d | 2,581 | py | Python | tests/acceptance/helpers/todomvc.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | null | null | null | tests/acceptance/helpers/todomvc.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | null | null | null | tests/acceptance/helpers/todomvc.py | pupsikpic/selene | 225796dbd58782c1d4baee85fd6e22eac3a9912f | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2015-2021 Iakiv Kramarenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modif... | 30.72619 | 112 | 0.722201 |
8ee849c873327d32f20185758efb728f272ef445 | 1,001 | py | Python | IPython/utils/tests/test_pycolorize.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2018-09-24T13:45:40.000Z | 2018-09-24T13:45:40.000Z | IPython/utils/tests/test_pycolorize.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 3 | 2015-04-01T13:14:57.000Z | 2015-05-26T16:01:37.000Z | IPython/utils/tests/test_pycolorize.py | dchichkov/ipython | 8096bb8640ee7e7c5ebdf3f428fe69cd390e1cd4 | [
"BSD-3-Clause-Clear"
] | 1 | 2015-05-17T14:14:26.000Z | 2015-05-17T14:14:26.000Z | """Test suite for our color utilities.
Authors
-------
* Min RK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as pa... | 28.6 | 78 | 0.356643 |
2638834f4f35f97a5a909b3d626eab099d81d416 | 59 | py | Python | atmPy/data_archives/noaa_gml/__init__.py | hagne/atm-py | 3d928a537948866fd78ff9d78b79469e6b7e1de1 | [
"MIT"
] | 5 | 2015-09-09T20:06:59.000Z | 2021-03-17T17:41:40.000Z | atmPy/data_archives/noaa_gml/__init__.py | hagne/atm-py | 3d928a537948866fd78ff9d78b79469e6b7e1de1 | [
"MIT"
] | 9 | 2016-02-22T18:15:21.000Z | 2020-01-09T15:56:30.000Z | atmPy/data_archives/noaa_gml/__init__.py | hagne/atm-py | 3d928a537948866fd78ff9d78b79469e6b7e1de1 | [
"MIT"
] | 3 | 2016-04-19T16:19:35.000Z | 2017-08-18T16:01:40.000Z | # -*- coding: utf-8 -*-
from .gml_lab import get_all_sites
| 19.666667 | 34 | 0.677966 |
9348ec62986bb140b019905801724df663b7ee04 | 89 | py | Python | faceweb/faceapp/apps.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | faceweb/faceapp/apps.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | faceweb/faceapp/apps.py | Dheeraj2407/Face-web | e73696e0ff12fc19a8d88ccaf2a830db4fcbb102 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class FaceappConfig(AppConfig):
name = 'faceapp'
| 14.833333 | 33 | 0.752809 |
f43166246af4b769a0a32b268ad523e766f29d89 | 31,121 | py | Python | kanaconv/converter.py | msikma/kanaconv | 194f142e616ab5dd6d13a687b96b9f8abd1b4ea8 | [
"MIT"
] | 7 | 2015-09-17T14:44:04.000Z | 2018-06-28T07:55:59.000Z | kanaconv/converter.py | msikma/kanaconv | 194f142e616ab5dd6d13a687b96b9f8abd1b4ea8 | [
"MIT"
] | null | null | null | kanaconv/converter.py | msikma/kanaconv | 194f142e616ab5dd6d13a687b96b9f8abd1b4ea8 | [
"MIT"
] | null | null | null | # coding=utf8
#
# (C) 2015-2016, MIT License
'''
Finite state machine that converts hiragana and katakana strings to rōmaji
according to Modified Hepburn transliteration rules.
Only kana and rōmaji is usable; kanji can't be used as input.
Aside from the usual kana, the following are supported:
* The wi/we kana c... | 35.853687 | 79 | 0.613476 |
e560095578c4b4875967f12a2a1b9fbd717145e5 | 1,676 | py | Python | btcmarketsapi/tests/package-test.py | SigmaAdvancedAnalytics/python-btcmarkets | 7ae6bd79707d45a78ac4ebaba1fe6585aa8e7089 | [
"MIT"
] | null | null | null | btcmarketsapi/tests/package-test.py | SigmaAdvancedAnalytics/python-btcmarkets | 7ae6bd79707d45a78ac4ebaba1fe6585aa8e7089 | [
"MIT"
] | 4 | 2018-02-12T23:18:20.000Z | 2018-02-12T23:21:27.000Z | btcmarketsapi/tests/package-test.py | SigmaAdvancedAnalytics/btcmarketsapi | 7ae6bd79707d45a78ac4ebaba1fe6585aa8e7089 | [
"MIT"
] | null | null | null | # Dependent packages
import sys
import pprint as pp
#Local packages for testing
sys.path.append("../")
import config
from api import Client
api_key = config.api_key
private_key = config.private_key
client = Client(api_key, private_key)
instrument = 'ETH'
currency = 'AUD'
limit = 200
since_order = 0
... | 22.346667 | 71 | 0.713604 |
2bc709a8fb406b4661a0c30ff26e29cc90a877ec | 5,346 | py | Python | tests/core/contracts/test_implicit_contract.py | 99Kies/web3.py | b62f678f530dc5ea4aab4111f436ab479f63829c | [
"MIT"
] | 1 | 2021-03-25T11:14:57.000Z | 2021-03-25T11:14:57.000Z | tests/core/contracts/test_implicit_contract.py | 99Kies/web3.py | b62f678f530dc5ea4aab4111f436ab479f63829c | [
"MIT"
] | null | null | null | tests/core/contracts/test_implicit_contract.py | 99Kies/web3.py | b62f678f530dc5ea4aab4111f436ab479f63829c | [
"MIT"
] | null | null | null | import pytest
from eth_utils import (
is_integer,
)
from web3.contract import (
ImplicitContract,
)
@pytest.fixture()
def math_contract(web3, MATH_ABI, MATH_CODE, MATH_RUNTIME, address_conversion_func):
# Deploy math contract
# NOTE Must use non-specialized contract factory or else deploy() doesn't ... | 44.55 | 98 | 0.728021 |
efdd3d05e7e2fb2da584cc82d5558dc5dbc8dbd6 | 889 | py | Python | dds_web/web/root.py | zishanmirza/dds_web | dbcb92176951cf7589a558833e2c870e9e47e9df | [
"BSD-3-Clause"
] | null | null | null | dds_web/web/root.py | zishanmirza/dds_web | dbcb92176951cf7589a558833e2c870e9e47e9df | [
"BSD-3-Clause"
] | 47 | 2020-02-04T15:20:12.000Z | 2020-06-01T06:25:21.000Z | dds_web/web/root.py | zishanmirza/dds_web | dbcb92176951cf7589a558833e2c870e9e47e9df | [
"BSD-3-Clause"
] | null | null | null | """Global application routes.
Most of the app routes are in `dds_web/web/user.py`.
Here we have the routes that are not specific to a user.
"""
from flask import Blueprint, render_template, jsonify
from flask import current_app as app
from dds_web import forms
pages = Blueprint("pages", __name__)
@pages.route("/",... | 24.027027 | 77 | 0.697413 |
68b8197e3267bb31fbfa6630d1f818518039f036 | 2,140 | py | Python | composer/models/gpt2/model.py | jbloxham/composer | 6dd0a0f297cafb404333d6280a5344bcb7f3bee6 | [
"Apache-2.0"
] | 2 | 2022-03-17T04:48:04.000Z | 2022-03-20T09:06:19.000Z | composer/models/gpt2/model.py | Averylamp/composer | 1afc56e9c207734aee75ff8c5b046fb55d928fb5 | [
"Apache-2.0"
] | null | null | null | composer/models/gpt2/model.py | Averylamp/composer | 1afc56e9c207734aee75ff8c5b046fb55d928fb5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
from __future__ import annotations
from typing import TYPE_CHECKING, Mapping
import transformers
from torchmetrics.collections import MetricCollection
from composer.models.nlp_metrics import Perplexity
from composer.models.transformer_shared import MosaicTransformer
... | 40.377358 | 117 | 0.71729 |
2dc757d1bf787a0def80127421f75a6593868d2a | 961 | py | Python | src/dictionary.py | potatoTVnet/Cryptography_lab | 703139540c4f7f4463fc0af641e1a7f0f477d6b3 | [
"MIT"
] | null | null | null | src/dictionary.py | potatoTVnet/Cryptography_lab | 703139540c4f7f4463fc0af641e1a7f0f477d6b3 | [
"MIT"
] | null | null | null | src/dictionary.py | potatoTVnet/Cryptography_lab | 703139540c4f7f4463fc0af641e1a7f0f477d6b3 | [
"MIT"
] | null | null | null | from random import randint
# def read_file():
# f = open("files/words.txt", "r")
# return f.readlines()
#
#
# def random_word():
# words = read_file()
# random = randint(0, len(words))
# return words[random].replace("\n", "").lower()
# random_word()
class Dictionary:
wordarray = []
def... | 23.439024 | 59 | 0.57128 |
32e8cfc9ff26d6cd8fd260a8960bf6abb716c1a2 | 7,040 | py | Python | tool/utils.py | allenwu5/pytorch-YOLOv4 | d0faa44ae563c835c59f0180707f6b946b4a97ac | [
"Apache-2.0"
] | null | null | null | tool/utils.py | allenwu5/pytorch-YOLOv4 | d0faa44ae563c835c59f0180707f6b946b4a97ac | [
"Apache-2.0"
] | null | null | null | tool/utils.py | allenwu5/pytorch-YOLOv4 | d0faa44ae563c835c59f0180707f6b946b4a97ac | [
"Apache-2.0"
] | null | null | null | import sys
import os
import time
import math
import numpy as np
import itertools
import struct # get_image_size
import imghdr # get_image_size
def sigmoid(x):
return 1.0 / (np.exp(-x) + 1.)
def softmax(x):
x = np.exp(x - np.expand_dims(np.max(x, axis=1), axis=1))
x = x / np.expand_dims(x.sum(axis=1),... | 28.971193 | 161 | 0.520597 |
e765fc1d9a78feb9e5ca4f3504ca4933e01f31f0 | 4,661 | py | Python | train.py | vvvm23/denoising-diffusion-pytorch | 50755ca523ae1e9a5238e2de86bccb983c52378e | [
"MIT"
] | 102 | 2020-06-25T06:25:54.000Z | 2022-03-31T13:47:18.000Z | train.py | vvvm23/denoising-diffusion-pytorch | 50755ca523ae1e9a5238e2de86bccb983c52378e | [
"MIT"
] | 6 | 2020-08-09T18:48:55.000Z | 2022-03-12T01:36:06.000Z | train.py | vvvm23/denoising-diffusion-pytorch | 50755ca523ae1e9a5238e2de86bccb983c52378e | [
"MIT"
] | 17 | 2020-07-17T07:16:26.000Z | 2022-03-24T13:19:50.000Z | import os
import torch
from torch import nn, optim
from torch.utils import data
from torchvision import transforms
from tensorfn import load_arg_config, load_wandb
from tensorfn import distributed as dist
from tensorfn.optim import lr_scheduler
from tqdm import tqdm
from model import UNet
from diffusion import Gaussi... | 28.420732 | 88 | 0.596224 |
9dac6135000923d949d78dac072bbe3c8cbdba17 | 728 | py | Python | python/runScript/main.py | sourabharvikar3/samplePrograms | d78278a45fcd20d966d2e7da6db2888f3681e93b | [
"MIT"
] | null | null | null | python/runScript/main.py | sourabharvikar3/samplePrograms | d78278a45fcd20d966d2e7da6db2888f3681e93b | [
"MIT"
] | null | null | null | python/runScript/main.py | sourabharvikar3/samplePrograms | d78278a45fcd20d966d2e7da6db2888f3681e93b | [
"MIT"
] | null | null | null | import os
import subprocess, sys
target_path = r"C:\Users\sarvikar\Documents\fileSet\script"
def RunScript(script_file):
p = subprocess.Popen("cmd.exe Unblock-File " + script_file)
p = subprocess.Popen("powershell.exe -ExecutionPolicy UnRestricted " + script_file, stdout=sys.stdout)
p.communicate()
def E... | 29.12 | 106 | 0.668956 |
bb3ad746fb7ac15a5518e094b81daf1d22f369fb | 1,606 | py | Python | purity_fb/purity_fb_1dot1/__init__.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 5 | 2017-09-08T20:47:22.000Z | 2021-06-29T02:11:05.000Z | purity_fb/purity_fb_1dot1/__init__.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 16 | 2017-11-27T20:57:48.000Z | 2021-11-23T18:46:43.000Z | purity_fb/purity_fb_1dot1/__init__.py | tlewis-ps/purity_fb_python_client | 652835cbd485c95a86da27f8b661679727ec6ea0 | [
"Apache-2.0"
] | 22 | 2017-10-13T15:33:05.000Z | 2021-11-08T19:56:21.000Z | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.1 Python SDK
Pure Storage FlashBlade REST 1.1 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.1
Contact: i... | 35.688889 | 204 | 0.828767 |
2bfcb1ad3f7385fb96dedb0add23f1ca0b60ad54 | 9,308 | py | Python | lbry/wallet/bip32.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 2 | 2021-12-24T18:29:49.000Z | 2021-12-26T02:04:57.000Z | lbry/wallet/bip32.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | null | null | null | lbry/wallet/bip32.py | nishp77/lbry-sdk | 7531401623a393a1491e3b65de0e2a65f8e45020 | [
"MIT"
] | 1 | 2022-03-10T20:37:31.000Z | 2022-03-10T20:37:31.000Z | from coincurve import PublicKey, PrivateKey as _PrivateKey
from lbry.crypto.hash import hmac_sha512, hash160, double_sha256
from lbry.crypto.base58 import Base58
from .util import cachedproperty
class DerivationError(Exception):
""" Raised when an invalid derivation occurs. """
class _KeyBase:
""" A BIP32 ... | 36.359375 | 100 | 0.639772 |
a03e9e0cafda730a96001181d8ede841ed12e78d | 4,246 | py | Python | plcapi.py | dreibh/planetlab-lxc-nodemanager | e3b9608c2e4184851f1fd2be7e449e62153789cf | [
"BSD-3-Clause"
] | null | null | null | plcapi.py | dreibh/planetlab-lxc-nodemanager | e3b9608c2e4184851f1fd2be7e449e62153789cf | [
"BSD-3-Clause"
] | null | null | null | plcapi.py | dreibh/planetlab-lxc-nodemanager | e3b9608c2e4184851f1fd2be7e449e62153789cf | [
"BSD-3-Clause"
] | null | null | null | import safexmlrpc
import hmac
try:
from hashlib import sha1 as sha
except ImportError:
import sha
import logger
class PLCAPI:
"""
Wrapper around safexmlrpc.ServerProxy to automagically add an Auth
struct as the first argument to every XML-RPC call. Initialize
auth with either:
(node_id, ke... | 32.914729 | 109 | 0.545219 |
faf3a3b3fdc10a23c0c0612e6804ba0f7690b7a0 | 16,468 | py | Python | lxml/tests/test_threading.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 28 | 2017-10-26T12:01:35.000Z | 2021-01-01T09:32:46.000Z | lxml/tests/test_threading.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 1 | 2018-02-04T03:33:48.000Z | 2018-05-08T22:30:01.000Z | lxml/tests/test_threading.py | 2502302255/al789 | 20828306da7a301f4b287ec9c72eb2eae9273188 | [
"MIT"
] | 1 | 2018-12-02T07:47:34.000Z | 2018-12-02T07:47:34.000Z | # -*- coding: utf-8 -*-
"""
Tests for thread usage in lxml.etree.
"""
import re
import sys
import os.path
import unittest
import threading
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, HelperTestCase, BytesIO, _b... | 31.669231 | 91 | 0.549733 |
474642ad4496451cf9ae669774eaebc199db44c9 | 152 | py | Python | hello_args.py | pdebuyl/cli01 | 6f8118806338aee6cfae6fc699614ee01b8f3436 | [
"CC-BY-4.0"
] | null | null | null | hello_args.py | pdebuyl/cli01 | 6f8118806338aee6cfae6fc699614ee01b8f3436 | [
"CC-BY-4.0"
] | null | null | null | hello_args.py | pdebuyl/cli01 | 6f8118806338aee6cfae6fc699614ee01b8f3436 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function, division
import sys
print("Number of arguments:", len(sys.argv)-1)
print(*sys.argv[1:])
| 19 | 47 | 0.743421 |
db4872eb67556477b793bc928b673070796989dc | 1,409 | py | Python | env/Lib/site-packages/OpenGL/GLES2/ARM/shader_framebuffer_fetch.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GLES2/ARM/shader_framebuffer_fetch.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GLES2/ARM/shader_framebuffer_fetch.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension ARM.shader_framebuffer_fetch
This module customises the behaviour of the
OpenGL.raw.GLES2.ARM.shader_framebuffer_fetch to provide a more
Python-friendly API
Overview (from the spec)
This extension enables fragment shaders to read existing framebuffer
data as input. This permits use-cases suc... | 38.081081 | 73 | 0.814762 |
811af6f0010c700be17a5009d0dc946325f52353 | 477 | py | Python | Python Crash Course by Eric Matthes/testing_code.py | Debo-Republic/Books-Exercises | d8d5971437fce77b3bbf15d340f5933b1826ccf0 | [
"MIT"
] | null | null | null | Python Crash Course by Eric Matthes/testing_code.py | Debo-Republic/Books-Exercises | d8d5971437fce77b3bbf15d340f5933b1826ccf0 | [
"MIT"
] | null | null | null | Python Crash Course by Eric Matthes/testing_code.py | Debo-Republic/Books-Exercises | d8d5971437fce77b3bbf15d340f5933b1826ccf0 | [
"MIT"
] | null | null | null | # Testing a name_function.py
from name_function import get_formatted_name
import unittest
class NameTestCase(unittest.TestCase):
"""Test to check the functioning of name_function.py"""
def test_first_last_name(self):
"""Do names like Debopriyo Bhowmick work ?"""
formatted_name = get... | 29.8125 | 69 | 0.706499 |
95e1c2c1cf16c43accf03026a8f7973a2a4583b2 | 4,862 | py | Python | chrome/test/functional/webrtc_audio_call.py | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-03-10T13:08:49.000Z | 2018-03-10T13:08:49.000Z | chrome/test/functional/webrtc_audio_call.py | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/test/functional/webrtc_audio_call.py | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:19:31.000Z | 2020-11-04T07:19:31.000Z | #!/usr/bin/env python
# Copyright (c) 2013 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.
import os
import tempfile
import time
import media.audio_tools as audio_tools
# Note: pyauto_functional must come before pyauto.
... | 37.984375 | 80 | 0.687783 |
8a79786df968187d21a7e3714fa454233a012122 | 748 | py | Python | var/spack/repos/builtin/packages/r-teachingdemos/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-teachingdemos/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-teachingdemos/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RTeachingdemos(RPackage):
"""Demonstrations for Teaching and Learning.
Demonstration ... | 34 | 94 | 0.762032 |
698c87179b3fe6ae062f392938caacbde14c19eb | 524 | py | Python | Arrays/108. Convert Sorted Array to Binary Search Tree.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | 1 | 2021-06-30T17:51:56.000Z | 2021-06-30T17:51:56.000Z | Arrays/108. Convert Sorted Array to Binary Search Tree.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | null | null | null | Arrays/108. Convert Sorted Array to Binary Search Tree.py | thewires2/Leetcode | a37ff81d60dd9195ba637b970b40aabbea5f4680 | [
"Unlicense"
] | null | null | null | class Solution:
def sortedArrayToBST(self, nums: List[int]) -> TreeNode:
def helper(left, right):
if left > right:
return None
# always choose left middle node as a root
p = (left + right) // 2
# preorder traversal: node -> left -> ri... | 30.823529 | 68 | 0.492366 |
41f0d0fc6445bf07e42649ccab688b570767a215 | 17 | py | Python | testsuite/crlf.py | Zac-HD/pycodestyle | aa3417b6a51f5912e32d9c8c879e1b9dd660d5f8 | [
"MIT"
] | 3,594 | 2016-02-23T07:13:52.000Z | 2022-03-31T21:15:06.000Z | testsuite/crlf.py | Zac-HD/pycodestyle | aa3417b6a51f5912e32d9c8c879e1b9dd660d5f8 | [
"MIT"
] | 581 | 2016-02-23T15:19:11.000Z | 2022-03-31T23:47:20.000Z | testsuite/crlf.py | Zac-HD/pycodestyle | aa3417b6a51f5912e32d9c8c879e1b9dd660d5f8 | [
"MIT"
] | 476 | 2016-02-25T01:27:27.000Z | 2022-03-26T23:58:31.000Z | '''\
test
'''
| 4.25 | 5 | 0.235294 |
1063267f8f890f0b4cc14252148ee1dc90504beb | 2,055 | py | Python | docs/source/conf.py | DIYCharles/nanoleafapi | c1a71e1710f50280d4e18035a1f7d80bf24b26c9 | [
"MIT"
] | null | null | null | docs/source/conf.py | DIYCharles/nanoleafapi | c1a71e1710f50280d4e18035a1f7d80bf24b26c9 | [
"MIT"
] | null | null | null | docs/source/conf.py | DIYCharles/nanoleafapi | c1a71e1710f50280d4e18035a1f7d80bf24b26c9 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 33.688525 | 79 | 0.675426 |
ce78b179be82885a76eaa774694b07264522353b | 92 | py | Python | tests/test_nightwalker.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | 1 | 2020-10-13T02:55:26.000Z | 2020-10-13T02:55:26.000Z | tests/test_nightwalker.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | null | null | null | tests/test_nightwalker.py | chineseluo/nightwalker | c7e9fb40401d632241b501d9c90f2e33522db51b | [
"Apache-2.0"
] | null | null | null | from nightwalker import __version__
def test_version():
assert __version__ == '0.1.0'
| 15.333333 | 35 | 0.728261 |
3dcf72672915cef1c60c9e6c6eb7181dc7273578 | 2,514 | py | Python | tests/test_functionality.py | amogorkon/fuzzy | 07779ea36c979224dbb6ebd87d19b57fd8e3ed9b | [
"MIT"
] | 47 | 2019-11-06T13:01:22.000Z | 2022-03-24T07:48:48.000Z | tests/test_functionality.py | amogorkon/fuzzy | 07779ea36c979224dbb6ebd87d19b57fd8e3ed9b | [
"MIT"
] | 19 | 2019-11-26T17:45:55.000Z | 2022-02-28T08:44:01.000Z | tests/test_functionality.py | amogorkon/fuzzy | 07779ea36c979224dbb6ebd87d19b57fd8e3ed9b | [
"MIT"
] | 16 | 2020-02-13T23:33:49.000Z | 2022-03-20T13:13:04.000Z | """
Functional test of the fuzzylogic lib 'fuzzy'.
"""
import os
import sys
here = os.path.split(os.path.abspath(os.path.dirname(__file__)))
src = os.path.join(here[0], "src")
sys.path.insert(0, src)
print(sys.path)
import unittest
from fuzzylogic.classes import Domain, Set
from fuzzylogic.functions import R, S, bo... | 29.928571 | 82 | 0.6607 |
8c960b29559773bfc7aaec1d020785b165c665dd | 1,559 | py | Python | Alignment/APEEstimation/python/TrackRefitter_38T_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | Alignment/APEEstimation/python/TrackRefitter_38T_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | Alignment/APEEstimation/python/TrackRefitter_38T_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
from Configuration.Geometry.GeometryRecoDB_cff import *
from Configuration.AlCa.GlobalTag_condDBv2 import GlobalTag
from Configuration.StandardSequences.MagneticField_cff import *
from RecoVertex.BeamSpotProducer.BeamSpot_cfi import *
from RecoLocalTracker.SiStripRecHitConvert... | 31.816327 | 95 | 0.831944 |
07eecc9bf26d33f704ede95b7d019cecd9dc295a | 3,127 | py | Python | tests/models/validators/v2_2_1/jsd_d49f82923bc5dfda63adfd224e1a22f.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 32 | 2019-09-05T05:16:56.000Z | 2022-03-22T09:50:38.000Z | tests/models/validators/v2_2_1/jsd_d49f82923bc5dfda63adfd224e1a22f.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 35 | 2019-09-07T18:58:54.000Z | 2022-03-24T19:29:36.000Z | tests/models/validators/v2_2_1/jsd_d49f82923bc5dfda63adfd224e1a22f.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 18 | 2019-09-09T11:07:21.000Z | 2022-03-25T08:49:59.000Z | # -*- coding: utf-8 -*-
"""Cisco DNA Center GetTemplateVersions data model.
Copyright (c) 2019-2021 Cisco Systems.
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 w... | 32.572917 | 82 | 0.554845 |
5d25524bc5f42fa46cc57013f72121ec3e73d780 | 731 | py | Python | setup.py | akaihola/ipython_pytest | dcb0a78892b2dc94001c0abe5f176cdeada3b2f6 | [
"BSD-3-Clause-Clear"
] | 35 | 2016-12-28T23:46:38.000Z | 2022-02-09T22:48:37.000Z | setup.py | akaihola/ipython_pytest | dcb0a78892b2dc94001c0abe5f176cdeada3b2f6 | [
"BSD-3-Clause-Clear"
] | 3 | 2017-01-30T10:01:05.000Z | 2022-01-19T16:59:33.000Z | setup.py | akaihola/ipython_pytest | dcb0a78892b2dc94001c0abe5f176cdeada3b2f6 | [
"BSD-3-Clause-Clear"
] | 8 | 2017-09-17T22:55:55.000Z | 2021-01-02T15:24:36.000Z | from distutils.core import setup
with open('README.rst') as f:
long_description = f.read()
setup(
name='ipython_pytest',
version='0.0.1',
author='Antti Kaihola',
author_email='antti.kaihola@eniram.fi',
py_modules=['ipython_pytest'],
url='https://github.com/akaihola/ipython_pytest',
c... | 30.458333 | 72 | 0.629275 |
8bdbe0653c7f14df9229b1f75521bc1b11f1bfde | 48,969 | py | Python | azurelinuxagent/ga/exthandlers.py | matkin-msft/jit_walinuxagent | ccd52807ab2c43548a4ef13d86ababeb7e3f8c1f | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/ga/exthandlers.py | matkin-msft/jit_walinuxagent | ccd52807ab2c43548a4ef13d86ababeb7e3f8c1f | [
"Apache-2.0"
] | null | null | null | azurelinuxagent/ga/exthandlers.py | matkin-msft/jit_walinuxagent | ccd52807ab2c43548a4ef13d86ababeb7e3f8c1f | [
"Apache-2.0"
] | null | null | null | # Microsoft Azure Linux Agent
#
# Copyright Microsoft Corporation
#
# 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.909774 | 116 | 0.616124 |
67edb04a08649649f8922b353eff0fe098f88269 | 18,722 | py | Python | dstn_int_att.py | awesome-archive/dstn | edeef7bccee68a1b3756bb895bcdb982253c96d3 | [
"MIT"
] | 1 | 2019-07-03T01:29:14.000Z | 2019-07-03T01:29:14.000Z | dstn_int_att.py | 1oscar/dstn | edeef7bccee68a1b3756bb895bcdb982253c96d3 | [
"MIT"
] | null | null | null | dstn_int_att.py | 1oscar/dstn | edeef7bccee68a1b3756bb895bcdb982253c96d3 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import datetime
import ctr_funcs as func
import config_dstn as cfg
import os
import shutil
# config
str_txt = cfg.output_file_name
base_path = './tmp'
model_saving_addr = base_path + '/dstn_i_' + str_txt + '/'
output_file_name = base_path + '/dstn_i_' + str_txt + '.txt'
num_c... | 41.977578 | 116 | 0.647687 |
7a86f530de6e2d6277130c9f4af543da8b573863 | 1,382 | py | Python | experta/deffacts.py | Kirito56/ExpertaMadman | e14ab93e6e86ef942be3ee5487425a6f483f0dad | [
"MIT"
] | null | null | null | experta/deffacts.py | Kirito56/ExpertaMadman | e14ab93e6e86ef942be3ee5487425a6f483f0dad | [
"MIT"
] | null | null | null | experta/deffacts.py | Kirito56/ExpertaMadman | e14ab93e6e86ef942be3ee5487425a6f483f0dad | [
"MIT"
] | null | null | null | from functools import update_wrapper
import inspect
class DefFacts:
def __new__(cls, nonexpected=None, order=0):
obj = super(DefFacts, cls).__new__(cls)
if nonexpected is not None:
raise SyntaxError("DefFacts must be instanced to allow decoration")
obj.__wrapped = None
... | 28.204082 | 79 | 0.59479 |
6b06a4b3ff264ec1e90d9e815afc8765ae80063d | 6,280 | py | Python | lib/tests/streamlit/caching_test.py | domoritz/streamlit | 5e8e0ec1b46ac0b322dc48d27494be674ad238fa | [
"Apache-2.0"
] | 1 | 2020-04-01T19:53:28.000Z | 2020-04-01T19:53:28.000Z | lib/tests/streamlit/caching_test.py | sudachen/streamlit | f5326d68eb914eb5bb49da01b7f406ba4f5845d0 | [
"Apache-2.0"
] | null | null | null | lib/tests/streamlit/caching_test.py | sudachen/streamlit | f5326d68eb914eb5bb49da01b7f406ba4f5845d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018-2020 Streamlit 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 applicabl... | 24.53125 | 85 | 0.587739 |
e63a84e3a6de7c5441de25474a0a797c5ae70898 | 17,069 | py | Python | sure_tosca-flask-server/sure_tosca/test/test_default_controller.py | QCDIS/CONF | 6ddb37b691754bbba97c85228d266ac050c4baa4 | [
"Apache-2.0"
] | null | null | null | sure_tosca-flask-server/sure_tosca/test/test_default_controller.py | QCDIS/CONF | 6ddb37b691754bbba97c85228d266ac050c4baa4 | [
"Apache-2.0"
] | null | null | null | sure_tosca-flask-server/sure_tosca/test/test_default_controller.py | QCDIS/CONF | 6ddb37b691754bbba97c85228d266ac050c4baa4 | [
"Apache-2.0"
] | 1 | 2021-04-05T09:49:03.000Z | 2021-04-05T09:49:03.000Z | # coding: utf-8
from __future__ import absolute_import
from flask import json
from six import BytesIO
import os
from sure_tosca.models.node_template import NodeTemplateModel # noqa: E501
from sure_tosca.models.topology_template import TopologyTemplateModel # noqa: E501
from sure_tosca.models.tosca_template import ... | 41.329298 | 144 | 0.615443 |
73ac822f1bfb70eeee2c3e3bff157291549a14bc | 102 | py | Python | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | __init__.py | singh-yashwant/mayplotlib | 373b45f410d66ed771a35b4d2b241122454b5afe | [
"MIT"
] | null | null | null | def print1():
print("code for first program")
def print2():
print("code for second program")
| 17 | 36 | 0.656863 |
34d7af3a42ef55a1e98319f0432807be1c179db5 | 1,328 | py | Python | contacts/migrations/0001_initial.py | liviamendes/agenda-django-project | d602bb5e762ea477c3c97b5a475ad79036c0c93d | [
"MIT"
] | null | null | null | contacts/migrations/0001_initial.py | liviamendes/agenda-django-project | d602bb5e762ea477c3c97b5a475ad79036c0c93d | [
"MIT"
] | null | null | null | contacts/migrations/0001_initial.py | liviamendes/agenda-django-project | d602bb5e762ea477c3c97b5a475ad79036c0c93d | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-30 14:35
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Categoria... | 35.891892 | 122 | 0.594127 |
079c71f90ac88efbed9f9c72b160b78ee55577e7 | 1,704 | py | Python | game/tests/betabraintest.py | hyde777/betabrain | 3d95ffcf49e33f0cce97bd0ad272ba9d500b77d4 | [
"MIT"
] | 1 | 2018-09-08T07:13:16.000Z | 2018-09-08T07:13:16.000Z | game/tests/betabraintest.py | hyde777/betabrain | 3d95ffcf49e33f0cce97bd0ad272ba9d500b77d4 | [
"MIT"
] | null | null | null | game/tests/betabraintest.py | hyde777/betabrain | 3d95ffcf49e33f0cce97bd0ad272ba9d500b77d4 | [
"MIT"
] | null | null | null | import unittest
import betabrain
class TestBetaBrainGame(unittest.TestCase):
def setUp(self):
betabrain.tries = list()
def test_generate_solution(self):
solution = betabrain.generateProblem()
self.assertEqual(len(solution), 5)
def test_problem_content(self):
solution = bet... | 29.894737 | 97 | 0.551056 |
71e1ce707e0766472d8aeed55173fe68d9059b84 | 11,795 | py | Python | ethereum/tools/tester.py | BreezeRo/pyethereum | 440af8f4ebf26d837d5c633ef09ef0e2338df43e | [
"MIT"
] | 1 | 2021-01-27T04:35:52.000Z | 2021-01-27T04:35:52.000Z | ethereum/tools/tester.py | BreezeRo/pyethereum | 440af8f4ebf26d837d5c633ef09ef0e2338df43e | [
"MIT"
] | null | null | null | ethereum/tools/tester.py | BreezeRo/pyethereum | 440af8f4ebf26d837d5c633ef09ef0e2338df43e | [
"MIT"
] | null | null | null | from ethereum.utils import sha3, privtoaddr, int_to_addr, to_string, big_endian_to_int, checksum_encode, int_to_big_endian, encode_hex
from ethereum.genesis_helpers import mk_basic_state
from ethereum.pow import chain as pow_chain
from ethereum.transactions import Transaction
from ethereum.consensus_strategy import get... | 35.42042 | 134 | 0.623315 |
4d4d2cc69b0eec34b626a84ee237c1c4c4c540a2 | 2,986 | py | Python | paddlespeech/cli/base_commands.py | Honei/PaddleSpeech | 83b941fc439696b1dd8fc0d044a5b29309574c3b | [
"Apache-2.0"
] | 1 | 2021-12-23T01:04:00.000Z | 2021-12-23T01:04:00.000Z | paddlespeech/cli/base_commands.py | catcat0921/PaddleSpeech | 775c4befbd4253eab9440c996f267683e7a2a4f0 | [
"Apache-2.0"
] | null | null | null | paddlespeech/cli/base_commands.py | catcat0921/PaddleSpeech | 775c4befbd4253eab9440c996f267683e7a2a4f0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.765957 | 78 | 0.626256 |
2508a1b9fb6ce788f0b7b5e240da62b33e0fee76 | 52,639 | py | Python | mergify_engine/tests/functional/test_engine.py | eladb/mergify-engine | ca2eb9926be29d38feaf029caaa63cbb4c74659e | [
"Apache-2.0"
] | null | null | null | mergify_engine/tests/functional/test_engine.py | eladb/mergify-engine | ca2eb9926be29d38feaf029caaa63cbb4c74659e | [
"Apache-2.0"
] | null | null | null | mergify_engine/tests/functional/test_engine.py | eladb/mergify-engine | ca2eb9926be29d38feaf029caaa63cbb4c74659e | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2018 Mehdi Abaakouk <sileht@sileht.net>
#
# 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
#
# Unles... | 34.676548 | 101 | 0.525998 |
27ba746ab024eac4b16cb4d67d5d79f3eae74167 | 6,527 | py | Python | views.py | dirkbo/django_factory | 252adf3ed46dc9f230210f53632fb7c767814475 | [
"Apache-2.0"
] | 1 | 2015-12-19T11:42:48.000Z | 2015-12-19T11:42:48.000Z | views.py | dirkbo/django_factory | 252adf3ed46dc9f230210f53632fb7c767814475 | [
"Apache-2.0"
] | null | null | null | views.py | dirkbo/django_factory | 252adf3ed46dc9f230210f53632fb7c767814475 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
import logging
import csv
import json
# Django imports
from django.http import HttpResponseBadRequest, HttpResponse, JsonResponse
from django.shortcuts import render
from django.conf import settings
from django.utils import timezone
from django.views.decorators.gzip import gzip_page
from django.... | 35.862637 | 93 | 0.598131 |
86a9fc011d9780283a9981df4728c37b64d0461d | 3,859 | py | Python | nlqa.py | johl/nlqa | 6ed3f753523664caab2830775e34c24e1ba30766 | [
"MIT"
] | 4 | 2018-06-09T20:45:33.000Z | 2019-12-10T15:42:43.000Z | nlqa.py | johl/nlqa | 6ed3f753523664caab2830775e34c24e1ba30766 | [
"MIT"
] | 1 | 2018-06-09T20:47:29.000Z | 2018-06-09T20:57:30.000Z | nlqa.py | johl/nlqa | 6ed3f753523664caab2830775e34c24e1ba30766 | [
"MIT"
] | null | null | null | import spacy
import requests
import json
def extract_entities(question, language="en"):
"""
Extract item and property out of question.
Process question. We assume the token with part of speech marker 'NOUN'
to be the property and token with pos marker 'PROPN' to be the item of
the query.
Par... | 35.081818 | 77 | 0.623996 |
4c19bbab219baf866cb91348a551bdfaedff0ff7 | 1,158 | py | Python | Lib/distutils/tests/test_bdist_wininst.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | Lib/distutils/tests/test_bdist_wininst.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | Lib/distutils/tests/test_bdist_wininst.py | livioso/cpython | 077061a7b24917aaf31057885c69919c5a553c88 | [
"PSF-2.0"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | """Tests for distutils.command.bdist_wininst."""
import unittest
from test.support import run_unittest
from distutils.command.bdist_wininst import bdist_wininst
from distutils.tests import support
@unittest.skipIf(getattr(bdist_wininst, '_unsupported', False),
'bdist_wininst is not supported in this install')
cla... | 34.058824 | 67 | 0.690846 |
23ebe2e7f0d2764d31c846c4fe4c8e56c28a4c83 | 11,145 | py | Python | kaggle_runner/logs.py | pennz/kaggle_runner | 19b979ae86f1fcaff5d17f55f4d8bc3d3f2a4ced | [
"MIT"
] | 1 | 2020-08-06T09:07:49.000Z | 2020-08-06T09:07:49.000Z | kaggle_runner/logs.py | pennz/kaggle_runner | 19b979ae86f1fcaff5d17f55f4d8bc3d3f2a4ced | [
"MIT"
] | 1 | 2020-05-13T10:49:42.000Z | 2020-05-15T22:52:37.000Z | kaggle_runner/logs.py | pennz/kaggle_runner | 19b979ae86f1fcaff5d17f55f4d8bc3d3f2a4ced | [
"MIT"
] | null | null | null | import datetime
import time
from collections import defaultdict, deque
import numpy as np
import tensorflow as tf
import fastai
import torch
import torch.distributed as dist
from fastai.callbacks import csv_logger
from kaggle_runner.utils.kernel_utils import is_dist_avail_and_initialized
def metric_get_log(phase, e... | 31.483051 | 181 | 0.549035 |
c9ab529dd78fc04a47a7b02c3b7691c43fc7a4a4 | 4,339 | py | Python | designateclient/functionaltests/v2/test_recordsets.py | mail2nsrajesh/python-designateclient | 3bb401758c00a9d66383484c60933421d9a21d63 | [
"Apache-2.0"
] | 34 | 2015-01-16T21:45:17.000Z | 2021-11-15T09:38:53.000Z | designateclient/functionaltests/v2/test_recordsets.py | mail2nsrajesh/python-designateclient | 3bb401758c00a9d66383484c60933421d9a21d63 | [
"Apache-2.0"
] | null | null | null | designateclient/functionaltests/v2/test_recordsets.py | mail2nsrajesh/python-designateclient | 3bb401758c00a9d66383484c60933421d9a21d63 | [
"Apache-2.0"
] | 15 | 2015-01-16T21:45:27.000Z | 2020-05-26T05:07:29.000Z | """
Copyright 2015 Rackspace
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
dist... | 38.741071 | 77 | 0.690943 |
314e5a51340ba9090366d07155079bff43f64ce4 | 1,322 | py | Python | nipype/interfaces/afni/tests/test_auto_Resample.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_Resample.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/afni/tests/test_auto_Resample.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.afni.preprocess import Resample
def test_Resample_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=... | 26.44 | 78 | 0.644478 |
8b8fdc690785f418945adbb1a6a999f7129e826c | 10,516 | py | Python | src/recommender.py | ghazaltariri/Movie_Recommender_System | 8e5be133e4c6073f22c380cb40c121d201b967c4 | [
"Apache-2.0"
] | null | null | null | src/recommender.py | ghazaltariri/Movie_Recommender_System | 8e5be133e4c6073f22c380cb40c121d201b967c4 | [
"Apache-2.0"
] | null | null | null | src/recommender.py | ghazaltariri/Movie_Recommender_System | 8e5be133e4c6073f22c380cb40c121d201b967c4 | [
"Apache-2.0"
] | null | null | null | import logging
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
from time import time
import pyspark as ps
from pyspark.sql.types import *
from pyspark.ml.tuning import TrainValidationSplit, ParamGridBuilder
from pyspark.ml.recommendation import ALS
from pyspark.ml.evaluat... | 38.520147 | 115 | 0.599087 |
89d760b4a170f582add6fb82c8201bea320d0dfc | 665 | py | Python | tools/tensorflow_model_freezer/sample/__init__.py | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 255 | 2020-05-22T07:45:29.000Z | 2022-03-29T23:58:22.000Z | tools/tensorflow_model_freezer/sample/__init__.py | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 5,102 | 2020-05-22T07:48:33.000Z | 2022-03-31T23:43:39.000Z | tools/tensorflow_model_freezer/sample/__init__.py | periannath/ONE | 61e0bdf2bcd0bc146faef42b85d469440e162886 | [
"Apache-2.0"
] | 120 | 2020-05-22T07:51:08.000Z | 2022-02-16T19:08:05.000Z | # Copyright (c) 2018 Samsung Electronics Co., Ltd. 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... | 41.5625 | 74 | 0.765414 |
9cc6fad45911b98c9c1e189693539c8c95fa5f86 | 6,034 | py | Python | x_layer/hypoxic_volume.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 4 | 2015-06-09T18:53:11.000Z | 2021-08-19T01:39:38.000Z | x_layer/hypoxic_volume.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | null | null | null | x_layer/hypoxic_volume.py | parkermac/LiveOcean | bef3e1e729ada1069853dd4f57f79f452b54f4fa | [
"MIT"
] | 1 | 2017-03-07T01:28:49.000Z | 2017-03-07T01:28:49.000Z | """
This calculates hypoxic volume.
"""
# imports
import os, sys
sys.path.append(os.path.abspath('../alpha'))
import Lfun
import zrfun
import zfun
import numpy as np
import netCDF4 as nc
import argparse
from datetime import datetime, timedelta
start_time = datetime.now()
# Command line arguments
def boolean_strin... | 30.629442 | 95 | 0.651309 |
e942d9d78a2a7f8e401f2121cd8c8d74f79db875 | 1,876 | py | Python | droidlet/tools/crowdsourcing/vision_annotation_task/run_labeling_with_qual.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | null | null | null | droidlet/tools/crowdsourcing/vision_annotation_task/run_labeling_with_qual.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | null | null | null | droidlet/tools/crowdsourcing/vision_annotation_task/run_labeling_with_qual.py | colesbury/fairo | 9e50a3aa7369c68c80e84d80abd5fcdee8a9277a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# 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.
import os
from mephisto.operations.operator import Operator
from mephisto.tools.scripts import load_db_and_process_confi... | 29.3125 | 98 | 0.776119 |
a54572e9e70524adba07a51ebeda0a4681ba339d | 232 | py | Python | Python-Programing-Basics/Nested Loops/Nested Loops - Lab/05_travelling/travelling.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/Nested Loops/Nested Loops - Lab/05_travelling/travelling.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | Python-Programing-Basics/Nested Loops/Nested Loops - Lab/05_travelling/travelling.py | alexanderivanov2/Softuni-Software-Engineering | 8adb96f445f1da17dbb6eded9e9594319154c7e7 | [
"MIT"
] | null | null | null | destination = input()
savings = 0
while destination != "End":
price = float(input())
while savings < price:
savings += float(input())
print(f"Going to {destination}!")
savings = 0
destination = input()
| 19.333333 | 37 | 0.603448 |
4bf95f7c3ea89643748e00f48cf85e85ad2d957c | 23,643 | py | Python | keras/distribute/keras_utils_test.py | ahmedopolis/keras | 4c87dc9685eea2ed20111f9604b10d627b17f032 | [
"Apache-2.0"
] | null | null | null | keras/distribute/keras_utils_test.py | ahmedopolis/keras | 4c87dc9685eea2ed20111f9604b10d627b17f032 | [
"Apache-2.0"
] | null | null | null | keras/distribute/keras_utils_test.py | ahmedopolis/keras | 4c87dc9685eea2ed20111f9604b10d627b17f032 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 37.889423 | 114 | 0.652624 |
5ef906c79830f8e6ec961326015c50567253b119 | 15,672 | py | Python | lambda/lambda_function.py | aktarinaakhi/python-alexa-audio-streaming-example-skill | ccc467be1b4586b3531853eaf0597628d4777ae6 | [
"MIT"
] | null | null | null | lambda/lambda_function.py | aktarinaakhi/python-alexa-audio-streaming-example-skill | ccc467be1b4586b3531853eaf0597628d4777ae6 | [
"MIT"
] | null | null | null | lambda/lambda_function.py | aktarinaakhi/python-alexa-audio-streaming-example-skill | ccc467be1b4586b3531853eaf0597628d4777ae6 | [
"MIT"
] | null | null | null |
import logging
import json
import random
from ask_sdk_core.utils import is_request_type, is_intent_name
from ask_sdk_core.dispatch_components import (AbstractRequestHandler, AbstractExceptionHandler, AbstractRequestInterceptor, AbstractResponseInterceptor)
from ask_sdk_core.skill_builder import SkillBuilder
from ask_... | 41.242105 | 160 | 0.636549 |
0a314446b6341d143d4b4d7f983537019704b933 | 5,333 | py | Python | src/cryptoadvance/specter/server.py | romanz/specter-desktop | 68ef655ed03f1631bd7284085a38c404c59e755a | [
"MIT"
] | null | null | null | src/cryptoadvance/specter/server.py | romanz/specter-desktop | 68ef655ed03f1631bd7284085a38c404c59e755a | [
"MIT"
] | null | null | null | src/cryptoadvance/specter/server.py | romanz/specter-desktop | 68ef655ed03f1631bd7284085a38c404c59e755a | [
"MIT"
] | null | null | null | import logging
import os
import sys
import secrets
from pathlib import Path
from dotenv import load_dotenv
from flask import Flask, redirect, url_for
from flask_login import LoginManager, login_user
from flask_wtf.csrf import CSRFProtect
from .helpers import hwi_get_config
from .specter import Specter
from .hwi_serve... | 33.968153 | 115 | 0.677667 |
0e44cd6ee0a7812f64acff9c529b350ce44c4bf3 | 3,406 | py | Python | tests/adapters/test_tf_tensor_input.py | henrywu2019/BentoML | d3665f052374a1a419b2a3912b1986334fdae2ac | [
"Apache-2.0"
] | 3,451 | 2019-04-02T01:47:42.000Z | 2022-03-31T16:20:49.000Z | tests/adapters/test_tf_tensor_input.py | henrywu2019/BentoML | d3665f052374a1a419b2a3912b1986334fdae2ac | [
"Apache-2.0"
] | 1,925 | 2019-04-03T00:19:05.000Z | 2022-03-31T22:41:54.000Z | tests/adapters/test_tf_tensor_input.py | henrywu2019/BentoML | d3665f052374a1a419b2a3912b1986334fdae2ac | [
"Apache-2.0"
] | 451 | 2019-04-02T01:53:41.000Z | 2022-03-29T08:49:06.000Z | # pylint: disable=redefined-outer-name
import sys
import json
import base64
import math
import numbers
import pytest
import numpy as np
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock
from bentoml.types import HTTPRequest, BATCH_HEADER
def mock_tensorflow_module():
... | 25.609023 | 73 | 0.658837 |
02aac2a81ae488e5836d70740bbeb641eccdea02 | 2,459 | py | Python | sahara/tests/unit/service/api/v2/test_images.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 161 | 2015-01-05T11:46:42.000Z | 2022-01-05T07:41:39.000Z | sahara/tests/unit/service/api/v2/test_images.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 1 | 2021-01-28T06:06:41.000Z | 2021-01-28T06:06:43.000Z | sahara/tests/unit/service/api/v2/test_images.py | openstack/sahara | c4f4d29847d5bcca83d49ef7e9a3378458462a79 | [
"Apache-2.0"
] | 118 | 2015-01-29T06:34:35.000Z | 2021-12-06T07:30:09.000Z | # Copyright (c) 2017 EasyStack 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 or agreed to in wri... | 35.637681 | 77 | 0.666531 |
60914a027b2002f3d2bb23f454edcd8e9d8b1f7d | 1,499 | py | Python | PyInstaller/isolated/__init__.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | PyInstaller/isolated/__init__.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | PyInstaller/isolated/__init__.py | BearerPipelineTest/pyinstaller | 0de9d6cf1701689c53161610acdab143a76d40b5 | [
"Apache-2.0"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) 2021-2022, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.tx... | 46.84375 | 114 | 0.682455 |
be7d415573882e988c15dddbdccf497e26c425da | 897 | py | Python | misc.py | RSkinderowicz/PTACO | 7cc38eb4a74480c71d561c63086902514fef849b | [
"MIT"
] | null | null | null | misc.py | RSkinderowicz/PTACO | 7cc38eb4a74480c71d561c63086902514fef849b | [
"MIT"
] | null | null | null | misc.py | RSkinderowicz/PTACO | 7cc38eb4a74480c71d561c63086902514fef849b | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Miscellaneous utility functions.
"""
from array import array
def array_double(values):
"""
Returns a compact array-like representation of double values.
"""
return array('d', values)
def array_int(values):
"""
Returns a compact array-like representation of int... | 19.085106 | 70 | 0.627648 |
064a5c8966f6e0ac38b4b20d12329d83b202864e | 2,086 | py | Python | skil/workspaces.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | skil/workspaces.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | skil/workspaces.py | bpark738/skil-python | 6721b17788a13bf17bc2a50ead63f591f0edb47e | [
"Apache-2.0"
] | null | null | null | import skil_client
from skil_client.rest import ApiException as api_exception
class WorkSpace:
"""WorkSpace
Workspaces are a collection of features that enable different tasks such as
conducting experiments, training models, and test different dataset transforms.
Workspaces are distinct from Deploym... | 31.606061 | 101 | 0.654362 |
bb4a3eb738556a95ebf8ea29dc3c8328466d59a4 | 3,325 | py | Python | awa_extractor.py | kartik727/vocab_practice | e5deba65aac81c801c3e87cafc8aa22311b3e482 | [
"MIT"
] | null | null | null | awa_extractor.py | kartik727/vocab_practice | e5deba65aac81c801c3e87cafc8aa22311b3e482 | [
"MIT"
] | 1 | 2021-09-11T23:04:28.000Z | 2021-09-12T23:37:26.000Z | awa_extractor.py | kartik727/vocab_practice | e5deba65aac81c801c3e87cafc8aa22311b3e482 | [
"MIT"
] | null | null | null | import argparse
import enum
import random
from termcolor import colored
class TopicStatus(enum.Enum):
statement = 1
instruction = 2
class LineType(enum.Enum):
para = 1
div = 2
_div = 3
other = 4
class Topic:
def __init__(self):
self.statement = []
self.instruction = None
... | 29.954955 | 145 | 0.579549 |
8be4d40233aa0cc3eb83cc55c54584eb46631de4 | 19,138 | py | Python | pyftdi/bits.py | larsch/pyftdi | c77136fe4000f36842bc996ff1d5a5a0e05c1be4 | [
"BSD-3-Clause"
] | 1 | 2020-09-27T20:08:57.000Z | 2020-09-27T20:08:57.000Z | pyftdi/bits.py | larsch/pyftdi | c77136fe4000f36842bc996ff1d5a5a0e05c1be4 | [
"BSD-3-Clause"
] | null | null | null | pyftdi/bits.py | larsch/pyftdi | c77136fe4000f36842bc996ff1d5a5a0e05c1be4 | [
"BSD-3-Clause"
] | 1 | 2020-09-03T16:21:38.000Z | 2020-09-03T16:21:38.000Z | # Copyright (c) 2010-2019 Emmanuel Blot <emmanuel.blot@free.fr>
# Copyright (c) 2008-2016, Neotion
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retai... | 34.67029 | 79 | 0.560717 |
2b1e2df93e792cc6dc00bad680fe6aa24639e1a4 | 1,629 | py | Python | app.py | AndrewManHayChiu/dota_dashboard | d0c99ae2cb63e2e88046573c294258104dbfdfc4 | [
"MIT"
] | null | null | null | app.py | AndrewManHayChiu/dota_dashboard | d0c99ae2cb63e2e88046573c294258104dbfdfc4 | [
"MIT"
] | 2 | 2021-08-17T00:54:18.000Z | 2021-08-17T04:21:04.000Z | app.py | AndrewManHayChiu/dota_dashboard | d0c99ae2cb63e2e88046573c294258104dbfdfc4 | [
"MIT"
] | 1 | 2021-08-13T07:21:01.000Z | 2021-08-13T07:21:01.000Z | import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.express as px
import pandas as pd
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
# Can also define in css
colours = {
'backg... | 22.943662 | 70 | 0.556169 |
9065f4608aca742f800a1ccc3528b1bbc3081ea6 | 1,428 | py | Python | etldjango/etldata/management/commands/utils/urllibmod.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | 5 | 2021-05-21T20:02:34.000Z | 2021-08-04T21:06:19.000Z | etldjango/etldata/management/commands/utils/urllibmod.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | 1 | 2021-06-04T06:17:17.000Z | 2021-06-04T06:17:17.000Z | etldjango/etldata/management/commands/utils/urllibmod.py | DavidCastilloAlvarado/opencovid_ETL | 0cd7afcb0e7e6247a01c0aced9aab02b8ad1edaf | [
"MIT"
] | null | null | null | import contextlib
import requests
from tqdm import tqdm
from etldjango.settings import PROXI, PORT_PROXI, IP_PROXI_EXT
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
session = requests.Session()
retry = Retry(connect=5, backoff_factor=3.0)
adapter = HTTPAdapter(max_ret... | 36.615385 | 106 | 0.659664 |
a8bddcbdabc5fd3afd85d3a094ff6efd1ffccf09 | 9,691 | py | Python | cassandra/concurrent.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 1,163 | 2015-01-01T03:02:05.000Z | 2022-03-22T13:04:00.000Z | cassandra/concurrent.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 556 | 2015-01-05T16:39:29.000Z | 2022-03-26T20:51:36.000Z | cassandra/concurrent.py | clohfink/python-driver | 30a0e27cd1b8999267c146f0a93adf962a50790b | [
"Apache-2.0"
] | 449 | 2015-01-05T10:28:59.000Z | 2022-03-14T23:15:32.000Z | # Copyright DataStax, 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 or agreed to in writing, softwa... | 40.548117 | 171 | 0.663193 |
4a84e10b032741fc8ea536543a2b52b88f983ea4 | 3,508 | py | Python | realbrowserlocusts/locusts.py | liveteched/realbrowserlocusts | a02ea672e122266d8f3fb8954c5c0db634295cb8 | [
"MIT"
] | null | null | null | realbrowserlocusts/locusts.py | liveteched/realbrowserlocusts | a02ea672e122266d8f3fb8954c5c0db634295cb8 | [
"MIT"
] | null | null | null | realbrowserlocusts/locusts.py | liveteched/realbrowserlocusts | a02ea672e122266d8f3fb8954c5c0db634295cb8 | [
"MIT"
] | null | null | null | # pylint:disable=too-few-public-methods
""" Combine Locust with Selenium Web Driver """
import logging
from os import getenv as os_getenv
from locust import User
from locust.exception import LocustError
from selenium import webdriver
from realbrowserlocusts.core import RealBrowserClient
_LOGGER = logging.getLogger(__n... | 32.785047 | 77 | 0.633409 |
b9d1cbdd643ba76659f4169993e188320ff08dc6 | 19,111 | py | Python | c_model.py | LonglifeHyun/GANda_text-to-image | 095ded617e4df7d7ff7f4954381dde77db6d6883 | [
"MIT"
] | null | null | null | c_model.py | LonglifeHyun/GANda_text-to-image | 095ded617e4df7d7ff7f4954381dde77db6d6883 | [
"MIT"
] | null | null | null | c_model.py | LonglifeHyun/GANda_text-to-image | 095ded617e4df7d7ff7f4954381dde77db6d6883 | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
import torch.nn as nn
from layer import *
## 네트워크 구축하기
# CycleGAN
# https://arxiv.org/pdf/1703.10593.pdf
class CycleGAN(nn.Module):
def __init__(self, in_channels, out_channels, nker=64, norm='bnorm', nblk=6):
super(CycleGAN, self).__init__()
self.in_ch... | 35.522305 | 141 | 0.578358 |
10884a87b2933940dbef93d6b5e3f9a3af997e0a | 24,578 | py | Python | components/spiffs/spiffsgen.py | hasiflo/esp-idf | 1ca2afd982230e4cbf021c58137f3141c1870572 | [
"Apache-2.0"
] | 1 | 2021-05-24T07:39:12.000Z | 2021-05-24T07:39:12.000Z | components/spiffs/spiffsgen.py | hasiflo/esp-idf | 1ca2afd982230e4cbf021c58137f3141c1870572 | [
"Apache-2.0"
] | null | null | null | components/spiffs/spiffsgen.py | hasiflo/esp-idf | 1ca2afd982230e4cbf021c58137f3141c1870572 | [
"Apache-2.0"
] | 1 | 2021-05-29T06:35:09.000Z | 2021-05-29T06:35:09.000Z | #!/usr/bin/env python
#
# spiffsgen is a tool used to generate a spiffs image from a directory
#
# Copyright 2019 Espressif Systems (Shanghai) PTE 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 Lic... | 40.291803 | 147 | 0.610953 |
ff414bd63f7e7b6fdc808bced26bccb1a01dc84a | 23 | py | Python | tests/test-extensions/hello_extension/__init__.py | Tonow/cookiecutter | d6037b7dee5756e35a6ecd5b522899a9061c2c79 | [
"BSD-3-Clause"
] | 8,822 | 2015-01-01T19:27:19.000Z | 2019-07-01T15:49:43.000Z | tests/test-extensions/hello_extension/__init__.py | Tonow/cookiecutter | d6037b7dee5756e35a6ecd5b522899a9061c2c79 | [
"BSD-3-Clause"
] | 859 | 2015-01-07T21:46:12.000Z | 2019-07-01T17:36:24.000Z | tests/test-extensions/hello_extension/__init__.py | Tonow/cookiecutter | d6037b7dee5756e35a6ecd5b522899a9061c2c79 | [
"BSD-3-Clause"
] | 1,144 | 2015-01-14T09:29:41.000Z | 2019-07-01T09:39:24.000Z | """Hello Extension."""
| 11.5 | 22 | 0.608696 |
37d2f480689f472289a6e595e8c97b660151b24f | 3,988 | py | Python | datastructures/hashTableOpenAddressing.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | datastructures/hashTableOpenAddressing.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | datastructures/hashTableOpenAddressing.py | maxotar/datastructures | ba6c499e0bd894ff9b01557048e7a93d91774d39 | [
"MIT"
] | null | null | null | class HashTableOpenAddressing:
TOMBSTONE = 'RIP'
MINSIZE = 8
def __init__(self, **initial_values):
self._buckets = [() for _ in range(self.MINSIZE)]
for k, v in initial_values.items():
self.insert(k, v)
def get(self, key):
_, myid = self._computeHash(key)
b... | 32.688525 | 80 | 0.557673 |
9c4f7cce4451579415a1dca2181a46e28217418c | 3,047 | py | Python | tests/unit/test_modular.py | anurag-gandhi/pandas-profiling | 2373f3a299264f7b312dbe4b92edc14d36e8140e | [
"MIT"
] | 8 | 2020-07-09T15:28:18.000Z | 2021-05-08T16:35:15.000Z | tests/unit/test_modular.py | anurag-gandhi/pandas-profiling | 2373f3a299264f7b312dbe4b92edc14d36e8140e | [
"MIT"
] | null | null | null | tests/unit/test_modular.py | anurag-gandhi/pandas-profiling | 2373f3a299264f7b312dbe4b92edc14d36e8140e | [
"MIT"
] | 1 | 2021-10-03T07:39:04.000Z | 2021-10-03T07:39:04.000Z | import numpy as np
import pandas as pd
import pytest
import pandas_profiling
@pytest.fixture
def tdf(get_data_file):
file_name = get_data_file(
"meteorites.csv",
"https://data.nasa.gov/api/views/gh4g-9sfh/rows.csv?accessType=DOWNLOAD",
)
df = pd.read_csv(file_name)
# Note: Pandas do... | 28.212963 | 91 | 0.573351 |
12edd340b5e7fb3d32008bcf910ef0bae9b9bd02 | 7,128 | py | Python | tools/eval_utils/eval_utils_evaluate_cpp_result.py | neolixcn/OpenPCDet | 32bae37db13711a4fb35ad2980068470bb6cee1c | [
"Apache-2.0"
] | null | null | null | tools/eval_utils/eval_utils_evaluate_cpp_result.py | neolixcn/OpenPCDet | 32bae37db13711a4fb35ad2980068470bb6cee1c | [
"Apache-2.0"
] | null | null | null | tools/eval_utils/eval_utils_evaluate_cpp_result.py | neolixcn/OpenPCDet | 32bae37db13711a4fb35ad2980068470bb6cee1c | [
"Apache-2.0"
] | null | null | null | import pickle
import time
import numpy as np
import torch
import tqdm
from pcdet.models import load_data_to_gpu
from pcdet.utils import common_utils
# ============ added by huxi =============
import eval_utils.cpp_result_load_utils as cpp_result_load
# added by huxi, load rpn config
from pcdet.pointpillar_quantize_... | 40.271186 | 163 | 0.628086 |
39428daac2eabfc7e202dc490a5dcf671ed26e2d | 260,054 | py | Python | simonsc/object/wind_table.py | KunxiongWang/simonsc | 48969ff81cc7c256d3bd51ce1446d1fb4ad5825b | [
"Apache-2.0"
] | 2 | 2020-12-09T01:55:42.000Z | 2021-06-30T18:28:25.000Z | simonsc/object/wind_table.py | KunxiongWang/simonsc | 48969ff81cc7c256d3bd51ce1446d1fb4ad5825b | [
"Apache-2.0"
] | 1 | 2020-12-31T06:09:56.000Z | 2020-12-31T06:09:56.000Z | simonsc/object/wind_table.py | KunxiongWang/simonsc | 48969ff81cc7c256d3bd51ce1446d1fb4ad5825b | [
"Apache-2.0"
] | 10 | 2020-10-16T07:36:04.000Z | 2021-01-25T08:57:47.000Z | from sqlalchemy import Column, String, DECIMAL, DateTime, BIGINT, SMALLINT, INTEGER, LargeBinary
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.dialects.mysql import LONGTEXT
wind_tables = ['AEQUFROPLEINFOREPPEREND', 'AINDEXCSI500WEIGHT', 'AINDEXDESCRIPTION', 'AINDEXEODPRICES', 'AINDEXFINANCIAL... | 46.881918 | 4,793 | 0.692083 |
c368d0ebed7950d44f296a0d56e04e47f46bbed6 | 3,937 | py | Python | qmcpy/integrand/european_option.py | jungtaekkim/QMCSoftware | 4518d26b06ef737797d5e522cb61d9f7b516d74e | [
"Apache-2.0"
] | null | null | null | qmcpy/integrand/european_option.py | jungtaekkim/QMCSoftware | 4518d26b06ef737797d5e522cb61d9f7b516d74e | [
"Apache-2.0"
] | null | null | null | qmcpy/integrand/european_option.py | jungtaekkim/QMCSoftware | 4518d26b06ef737797d5e522cb61d9f7b516d74e | [
"Apache-2.0"
] | null | null | null | from ._integrand import Integrand
from ..true_measure import BrownianMotion
from ..discrete_distribution import Sobol
from ..util import ParameterError
from numpy import *
from scipy.stats import norm
class EuropeanOption(Integrand):
"""
European financial option.
>>> eo = EuropeanOption(Sobol(4,seed=7... | 41.442105 | 91 | 0.589789 |
d8e87ea321023c2b703febb9df20368457e875bf | 595 | py | Python | API/Webinar-Dec-2015/st1.py | VIRL-Open/virl-utils | 4de6c8237a7b1b6d0af4280f95ec9439b9b6d831 | [
"0BSD"
] | 56 | 2015-01-05T22:38:13.000Z | 2020-06-09T05:37:59.000Z | API/Webinar-Dec-2015/st1.py | VIRL-Open/virl-utils | 4de6c8237a7b1b6d0af4280f95ec9439b9b6d831 | [
"0BSD"
] | 6 | 2016-01-11T22:32:20.000Z | 2016-08-02T01:56:01.000Z | API/Webinar-Dec-2015/st1.py | VIRL-Open/virl-utils | 4de6c8237a7b1b6d0af4280f95ec9439b9b6d831 | [
"0BSD"
] | 45 | 2015-03-24T20:17:11.000Z | 2021-08-20T01:36:05.000Z | #!/usr/bin/env python
import os, requests, sys
def stop_topo(toponame):
virl_host = "10.87.94.20"
username = password = "guest"
url = "http://%s:19399/simengine/rest/stop/%s" % (virl_host, toponame)
headers = {'content-type': 'text/xml'}
result = requests.get(url, auth=(username, password), headers=hea... | 22.037037 | 77 | 0.636975 |
6191d65a193fdca18404dba061e86f2102224dab | 3,443 | py | Python | sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py | dubiety/azure-sdk-for-python | 62ffa839f5d753594cf0fe63668f454a9d87a346 | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | sdk/ml/azure-ai-ml/azure/ai/ml/_local_endpoints/validators/model_validator.py | ellhe-blaster/azure-sdk-for-python | 82193ba5e81cc5e5e5a5239bba58abe62e86f469 | [
"MIT"
] | null | null | null | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
from pathlib import Path
from azure.ai.ml.entities import OnlineDeployment
from azure.ai.ml.entities._assets import Model
from azure.ai.m... | 45.302632 | 117 | 0.67964 |
91e67e1f2cedac674a356d3e467ef9755fa0decb | 1,471 | py | Python | python/python3-100-examples/example71.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | 1 | 2021-01-27T09:01:33.000Z | 2021-01-27T09:01:33.000Z | python/python3-100-examples/example71.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | null | null | null | python/python3-100-examples/example71.py | ii6uu99/ipynb | d924a6926838ca5e563620cd324368a07d2c2521 | [
"MIT"
] | 1 | 2021-01-26T13:22:21.000Z | 2021-01-26T13:22:21.000Z | #!/usr/bin/python3
__author__ = "yang.dd"
"""
example 071
"""
class Student(object):
def __init__(self):
self.__num = 0
self.__name = ""
self.__score = [0, 0, 0, 0]
def get_num(self):
return self.__num
def get_name(self):
return self.__nam... | 23.725806 | 112 | 0.538409 |
e5157b7ca98582f888575c2eb13cc57c78577b4a | 2,454 | py | Python | reaction_completer/periodic_table.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | reaction_completer/periodic_table.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | reaction_completer/periodic_table.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | import json
import operator
import os
import warnings
from functools import reduce
__author__ = 'Haoyan Huo'
__maintainer__ = 'Haoyan Huo'
__email__ = 'haoyan.huo@lbl.gov'
__all__ = ['NON_VOLATILE_ELEMENTS', 'ELEMENTS', 'PT', 'PT_LIST']
NON_VOLATILE_ELEMENTS = {
'Li', 'Be',
'Na', 'Mg', 'Al', 'Si', 'P', 'S', ... | 35.057143 | 116 | 0.548085 |
042eb8abe4bae6af9db73a79c531612a55759cad | 3,485 | py | Python | bindings/python/ensmallen/datasets/string/lysinibacillusspac3.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/lysinibacillusspac3.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/lysinibacillusspac3.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Lysinibacillus sp. AC-3.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... | 33.190476 | 223 | 0.676327 |
de120862941b4442c01b5c2dfea2a42f10294c8f | 2,106 | py | Python | torchvision/ops/stochastic_depth.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | 3 | 2021-10-30T10:13:40.000Z | 2021-12-12T10:26:14.000Z | torchvision/ops/stochastic_depth.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | null | null | null | torchvision/ops/stochastic_depth.py | ZJUGuoShuai/vision | a9940fe4b2b63bd82a2f853616e00fd0bd112f9a | [
"BSD-3-Clause"
] | 1 | 2020-01-10T12:50:14.000Z | 2020-01-10T12:50:14.000Z | import torch
import torch.fx
from torch import nn, Tensor
def stochastic_depth(input: Tensor, p: float, mode: str, training: bool = True) -> Tensor:
"""
Implements the Stochastic Depth from `"Deep Networks with Stochastic Depth"
<https://arxiv.org/abs/1603.09382>`_ used for randomly dropping residual
... | 33.428571 | 92 | 0.597341 |
1599e37754b91f84732a7d9b9ebd879f27daa749 | 125 | py | Python | conf/__init__.py | LuoxinY/v2ray_subscribe | 438863ec944f30fae29d159ebc0d1c14021c0887 | [
"MIT"
] | 4 | 2020-04-11T12:52:13.000Z | 2020-07-08T06:38:08.000Z | conf/__init__.py | LuoxinY/v2ray_subscribe | 438863ec944f30fae29d159ebc0d1c14021c0887 | [
"MIT"
] | null | null | null | conf/__init__.py | LuoxinY/v2ray_subscribe | 438863ec944f30fae29d159ebc0d1c14021c0887 | [
"MIT"
] | 2 | 2020-07-27T13:27:24.000Z | 2020-10-01T04:11:31.000Z | from .global_variable import VariableManager
from .global_variable import GlobalVariable
global_variable = GlobalVariable()
| 25 | 44 | 0.864 |
ded6b033f807e17649e169db514645ba8e36708e | 6,463 | py | Python | engineauth/middleware.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | null | null | null | engineauth/middleware.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | null | null | null | engineauth/middleware.py | alecdotico/engineauth | def523f6c0d48f346e552b6638e6f3a6a1717733 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from engineauth import models
from engineauth import utils
from engineauth.config import load_config
import re
import traceback
from webob import Response
from webob import Request
class EngineAuthResponse(Response):
def _save_session(self):
session = self.request.se... | 37.795322 | 107 | 0.604673 |
3f0236fae82ed9057af8aa36a56648c3573010d9 | 902 | py | Python | src/posts/urls.py | edgarbs1998/partesanato-server | 1b01f75f94dca85ff5b963c49c237fb758b27b43 | [
"MIT"
] | null | null | null | src/posts/urls.py | edgarbs1998/partesanato-server | 1b01f75f94dca85ff5b963c49c237fb758b27b43 | [
"MIT"
] | 1 | 2020-06-05T22:09:06.000Z | 2020-06-05T22:09:06.000Z | src/posts/urls.py | edgarbs1998/partesanato-server | 1b01f75f94dca85ff5b963c49c237fb758b27b43 | [
"MIT"
] | null | null | null | # posts/urls.py
from django.urls import path, include
from rest_framework.routers import SimpleRouter
from rest_framework_nested.routers import NestedSimpleRouter
from posts.views import UserViewSet, PostViewSet, CommentViewSet, ImageViewSet, UserPostViewSet
router = SimpleRouter()
router.register('users', ... | 36.08 | 96 | 0.757206 |
80c754ebc3bf20fd80661e590d326ee6a0494c9e | 93 | py | Python | plugins/slack_alert/__init__.py | pkropf/mqttAlerts | 757ae286adeea90d39e3cc1c5be5027f43aa4a40 | [
"MIT"
] | null | null | null | plugins/slack_alert/__init__.py | pkropf/mqttAlerts | 757ae286adeea90d39e3cc1c5be5027f43aa4a40 | [
"MIT"
] | null | null | null | plugins/slack_alert/__init__.py | pkropf/mqttAlerts | 757ae286adeea90d39e3cc1c5be5027f43aa4a40 | [
"MIT"
] | null | null | null | name = 'slack_alert'
def setup(self):
pass
def alert(self, topic, condition):
pass
| 11.625 | 34 | 0.655914 |
f0d64947e6bfb3dcf67f179346b1378454574772 | 658 | py | Python | examples/allow-and-deny/allow-and-deny.py | kylelaker/iam-floyd | cf71cd3cad556b1c2b831bf22ed3d9e8ba892569 | [
"Apache-2.0"
] | 360 | 2020-06-03T03:29:18.000Z | 2022-03-31T04:58:13.000Z | examples/allow-and-deny/allow-and-deny.py | kylelaker/iam-floyd | cf71cd3cad556b1c2b831bf22ed3d9e8ba892569 | [
"Apache-2.0"
] | 75 | 2020-06-21T08:15:58.000Z | 2022-03-25T15:03:04.000Z | examples/allow-and-deny/allow-and-deny.py | kylelaker/iam-floyd | cf71cd3cad556b1c2b831bf22ed3d9e8ba892569 | [
"Apache-2.0"
] | 13 | 2020-06-03T16:12:45.000Z | 2022-03-31T05:05:48.000Z | import iam_floyd as statement
import importlib
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(
inspect.getfile(inspect.currentframe())))
helperDir = '%s/../../helper/python' % currentdir
sys.path.insert(0, helperDir)
test = importlib.import_module('python_test')
out = getattr(tes... | 19.939394 | 49 | 0.621581 |
2e5f75d128d780e22e7420a3b5de672c0b2af509 | 133 | py | Python | enthought/numerical_modeling/numeric_context/a_numeric_context.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 3 | 2016-12-09T06:05:18.000Z | 2018-03-01T13:00:29.000Z | enthought/numerical_modeling/numeric_context/a_numeric_context.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | 1 | 2020-12-02T00:51:32.000Z | 2020-12-02T08:48:55.000Z | enthought/numerical_modeling/numeric_context/a_numeric_context.py | enthought/etsproxy | 4aafd628611ebf7fe8311c9d1a0abcf7f7bb5347 | [
"BSD-3-Clause"
] | null | null | null | # proxy module
from __future__ import absolute_import
from blockcanvas.numerical_modeling.numeric_context.a_numeric_context import *
| 33.25 | 78 | 0.879699 |
759220a193bd3e42fd6b8e4e3af61699264159ea | 1,449 | py | Python | BasicOperations/04_Matplotlib/08_mouseEvent_Drag.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | 1 | 2018-07-02T13:54:49.000Z | 2018-07-02T13:54:49.000Z | BasicOperations/04_Matplotlib/08_mouseEvent_Drag.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | null | null | null | BasicOperations/04_Matplotlib/08_mouseEvent_Drag.py | UpSea/midProjects | ed6086e74f68b1b89f725abe0b270e67cf8993a8 | [
"MIT"
] | 3 | 2016-05-28T15:13:02.000Z | 2021-04-10T06:04:25.000Z | from numpy.random import rand, randint
from matplotlib.patches import RegularPolygon
import matplotlib.pyplot as plt
import numpy as np
class PatchMover(object):
def __init__(self, ax):
self.ax = ax
self.selected_patch = None
self.start_mouse_pos = None
self.start_patch_pos = None
... | 32.931818 | 87 | 0.650104 |
fe2e1da0c5d3020d1f674adfb4224c0fd8da5a1a | 419 | py | Python | src/napari_labeller/__init__.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | null | null | null | src/napari_labeller/__init__.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | 1 | 2021-12-03T21:26:27.000Z | 2021-12-03T21:26:27.000Z | src/napari_labeller/__init__.py | Hekstra-Lab/napari-labeller | 74913dce72c773df2ec94e1cb3798dd40fedf219 | [
"BSD-3-Clause"
] | null | null | null | try:
from ._version import version as __version__
except ImportError:
__version__ = "unknown"
__author__ = "Ian Hunt-Isaak and John Russell"
from ._dock_widget import napari_experimental_provide_dock_widget
from ._function import napari_experimental_provide_function
__all__ = [
"__version__",
"__autho... | 26.1875 | 65 | 0.789976 |
e39c8a90b485ee434bde0e8bd1cf95738cfe5468 | 1,981 | py | Python | sandbox/dokmaraton_list.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | sandbox/dokmaraton_list.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | sandbox/dokmaraton_list.py | thejoltjoker/python | 4517065e64d83947648e2aad206ac4ec786b166e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
script_name.py
Description of script_name.py.
"""
import requests
from bs4 import BeautifulSoup
import string
import math
import csv
import pandas
def main():
"""docstring for main"""
list_url = "https://www.imdb.com/list/ls054856346/"
response = requests.... | 29.132353 | 104 | 0.557294 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.