hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c40cbc7fd9b303fec1f5022ec05b26f31b49f871 | 12,355 | py | Python | mef_tools/test/test_io.py | mselair/mef_tools | ef49df565e19751d9e95d2c2545b1983fcb43e46 | [
"Apache-2.0"
] | null | null | null | mef_tools/test/test_io.py | mselair/mef_tools | ef49df565e19751d9e95d2c2545b1983fcb43e46 | [
"Apache-2.0"
] | 2 | 2020-07-29T21:26:31.000Z | 2020-08-13T18:00:56.000Z | mef_tools/test/test_io.py | xmival00/MEF_Tools | ef49df565e19751d9e95d2c2545b1983fcb43e46 | [
"Apache-2.0"
] | null | null | null | import unittest
import os
basedir = os.path.abspath(os.path.dirname(__file__))
if __name__ == '__main__':
unittest.main()
| 40.641447 | 132 | 0.671064 | from shutil import rmtree
import unittest
from unittest import TestCase
from mef_tools.io import MefWriter, MefReader, create_pink_noise, check_data_integrity
import os
import numpy as np
import pandas as pd
basedir = os.path.abspath(os.path.dirname(__file__))
class TestMefWriter(TestCase):
def setUp(self):
... | 0 | 0 | 0 | 11,991 | 0 | 0 | 0 | 72 | 156 |
6d66656c9390b02806e2a86859644410dbd1221c | 205 | py | Python | app/utils/global_access_conditions.py | Vahatra/django | 3547ee56348235c741db4a0f229d250f9378ad96 | [
"MIT"
] | null | null | null | app/utils/global_access_conditions.py | Vahatra/django | 3547ee56348235c741db4a0f229d250f9378ad96 | [
"MIT"
] | null | null | null | app/utils/global_access_conditions.py | Vahatra/django | 3547ee56348235c741db4a0f229d250f9378ad96 | [
"MIT"
] | null | null | null | from .access_policy import has_some_perm
def some_perm(request, view, action) -> bool:
"""
A pointles global access condition to demonstrate usage.
"""
return has_some_perm(request.user)
| 22.777778 | 60 | 0.717073 | from .access_policy import has_some_perm
def some_perm(request, view, action) -> bool:
"""
A pointles global access condition to demonstrate usage.
"""
return has_some_perm(request.user)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
da3e4205bb37ae0c21d1d31d422c8823d5f40a39 | 958 | py | Python | src/Tools/wake_triggers.py | TrialAndErrror/TnE_Assistant | 1e63a86352e5b02f86579af46010cddb2b857d35 | [
"MIT"
] | 1 | 2021-01-27T23:52:25.000Z | 2021-01-27T23:52:25.000Z | src/Tools/wake_triggers.py | TrialAndErrror/TnE_Assistant | 1e63a86352e5b02f86579af46010cddb2b857d35 | [
"MIT"
] | null | null | null | src/Tools/wake_triggers.py | TrialAndErrror/TnE_Assistant | 1e63a86352e5b02f86579af46010cddb2b857d35 | [
"MIT"
] | null | null | null | import logging
from src.Settings import ASSISTANT_SETTINGS
def check_for_wake_word(command: str):
"""
Check if wake word is in param command.
:param command: str
:return: is_triggered: bool
"""
wake_word: str = ASSISTANT_SETTINGS.get('Wake Word')
logging.debug(f'Searching for wake word ... | 26.611111 | 82 | 0.700418 | import logging
from src.Settings import ASSISTANT_SETTINGS
def check_for_wake_word(command: str):
"""
Check if wake word is in param command.
:param command: str
:return: is_triggered: bool
"""
wake_word: str = ASSISTANT_SETTINGS.get('Wake Word')
logging.debug(f'Searching for wake word ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee15a8f4b3dfa6c57bb6bf058dec162fa25758a0 | 3,700 | py | Python | deprecated/atmosphere_effects/TP_profile_generator.py | zhuchangzhan/SEAS | d844ceecc54a475a5384925f45a2078eef3416ee | [
"MIT"
] | 1 | 2020-12-06T23:09:08.000Z | 2020-12-06T23:09:08.000Z | deprecated/atmosphere_effects/TP_profile_generator.py | azariven/SEAS | d844ceecc54a475a5384925f45a2078eef3416ee | [
"MIT"
] | null | null | null | deprecated/atmosphere_effects/TP_profile_generator.py | azariven/SEAS | d844ceecc54a475a5384925f45a2078eef3416ee | [
"MIT"
] | 1 | 2020-01-04T17:32:31.000Z | 2020-01-04T17:32:31.000Z | #!/usr/bin/env python
#
# Copyright (C) 2017 - Massachusetts Institute of Technology (MIT)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | 31.623932 | 103 | 0.571892 | #!/usr/bin/env python
#
# Copyright (C) 2017 - Massachusetts Institute of Technology (MIT)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | 0 | 0 | 0 | 2,404 | 0 | 0 | 0 | 44 | 134 |
2fd2b0b2837bc23671033ba452d42c5ff293dafc | 3,404 | py | Python | graph_constructor.py | Rin-The-QT-Bunny/Graph-Deduction | ba81b790f0ba8e432821e45ad77d75d546bf11f5 | [
"CC0-1.0"
] | null | null | null | graph_constructor.py | Rin-The-QT-Bunny/Graph-Deduction | ba81b790f0ba8e432821e45ad77d75d546bf11f5 | [
"CC0-1.0"
] | null | null | null | graph_constructor.py | Rin-The-QT-Bunny/Graph-Deduction | ba81b790f0ba8e432821e45ad77d75d546bf11f5 | [
"CC0-1.0"
] | null | null | null | import tensorflow.keras as keras
import tensorflow.keras.layers as layers
relation_pos = ['VERB']
entity_pos = ['NOUN','PRON','PROPN','ADJ','ADV']
# Input structure of the graph is the center ultimate prediction
| 35.092784 | 114 | 0.566099 | import tensorflow as tf
import tensorflow.keras as keras
import tensorflow.keras.layers as layers
import numpy as np
import matplotlib.pyplot as plt
import random
relation_pos = ['VERB']
entity_pos = ['NOUN','PRON','PROPN','ADJ','ADV']
# Input structure of the graph is the center ultimate prediction
... | 0 | 0 | 0 | 3,048 | 0 | 0 | 0 | 1 | 122 |
ae896dab1234adb869c9b850ecc894efb741a741 | 204 | py | Python | django_widgets/__init__.py | LeonLegion/django-widgets | 524b09b63ad4c122d3faed9e8cac353974bfe95e | [
"BSD-3-Clause"
] | null | null | null | django_widgets/__init__.py | LeonLegion/django-widgets | 524b09b63ad4c122d3faed9e8cac353974bfe95e | [
"BSD-3-Clause"
] | null | null | null | django_widgets/__init__.py | LeonLegion/django-widgets | 524b09b63ad4c122d3faed9e8cac353974bfe95e | [
"BSD-3-Clause"
] | null | null | null | from .mixin import MultiWidgetMixin
from .widget import MEDIA_TYPES, Media, MediaDefiningClass, Widget
__all__ = [
MEDIA_TYPES,
Media,
MediaDefiningClass,
Widget,
MultiWidgetMixin,
]
| 18.545455 | 66 | 0.735294 | from .mixin import MultiWidgetMixin
from .widget import MEDIA_TYPES, Media, MediaDefiningClass, Widget
__all__ = [
MEDIA_TYPES,
Media,
MediaDefiningClass,
Widget,
MultiWidgetMixin,
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f25ec839bcf98cfb7f8e8363f111f7ffc556e84c | 5,615 | py | Python | tests/test_client_transport.py | radiocosmology/alpenhorn | a91df899d864e04699b6f49c33f473383ee10cfc | [
"MIT"
] | 3 | 2017-03-10T00:51:01.000Z | 2018-04-25T16:50:13.000Z | tests/test_client_transport.py | radiocosmology/alpenhorn | a91df899d864e04699b6f49c33f473383ee10cfc | [
"MIT"
] | 106 | 2017-03-16T23:57:10.000Z | 2021-10-05T23:44:48.000Z | tests/test_client_transport.py | radiocosmology/alpenhorn | a91df899d864e04699b6f49c33f473383ee10cfc | [
"MIT"
] | 1 | 2018-07-26T23:32:13.000Z | 2018-07-26T23:32:13.000Z | """
test_client_transport
----------------------------------
Tests for `alpenhorn.client.transport` module.
"""
import re
from click.testing import CliRunner
try:
from unittest.mock import call, patch
except ImportError:
import alpenhorn.client as cli
import alpenhorn.db as db
import alpenhorn.storage as st
... | 30.851648 | 88 | 0.64114 | """
test_client_transport
----------------------------------
Tests for `alpenhorn.client.transport` module.
"""
import re
import pytest
from click.testing import CliRunner
try:
from unittest.mock import call, patch
except ImportError:
from mock import patch, call
import alpenhorn.client as cli
import alpen... | 0 | 4,365 | 0 | 0 | 0 | 0 | 0 | 2 | 186 |
0dd6ad287fd493110e97173aab0af10eb53d1cc8 | 18,616 | py | Python | heatmaps/heatmap_generator.py | TinkerBoard-Android/external-toolchain-utils | b75f321fc8978b92ce3db6886ccb966768f0c7a8 | [
"BSD-3-Clause"
] | null | null | null | heatmaps/heatmap_generator.py | TinkerBoard-Android/external-toolchain-utils | b75f321fc8978b92ce3db6886ccb966768f0c7a8 | [
"BSD-3-Clause"
] | null | null | null | heatmaps/heatmap_generator.py | TinkerBoard-Android/external-toolchain-utils | b75f321fc8978b92ce3db6886ccb966768f0c7a8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python module to draw heat map for Chrome
heat map is a histogram used to analyze the locality of function layout.
This modul... | 39.777778 | 80 | 0.638214 | # -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Python module to draw heat map for Chrome
heat map is a histogram used to analyze the locality of function layout.
This modul... | 0 | 0 | 0 | 17,773 | 0 | 0 | 0 | -15 | 158 |
5bf67501311317fa698a28a36995d50948ad77c9 | 1,922 | py | Python | packages/syft/src/syft/core/node/common/node_manager/request_manager.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | 2 | 2022-02-18T03:48:27.000Z | 2022-03-05T06:13:57.000Z | packages/syft/src/syft/core/node/common/node_manager/request_manager.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | 3 | 2021-11-17T15:34:03.000Z | 2021-12-08T14:39:10.000Z | packages/syft/src/syft/core/node/common/node_manager/request_manager.py | pculliton/PySyft | 23a0d1442d3d901b1139aeabe079ccf4177ebc0d | [
"Apache-2.0"
] | null | null | null | # stdlib
# third party
# relative
| 27.457143 | 83 | 0.630593 | # stdlib
from datetime import datetime
from typing import Any
from typing import List
from typing import Optional
# third party
from nacl.signing import VerifyKey
from sqlalchemy.engine import Engine
# relative
from ....common.uid import UID
from ..exceptions import RequestError
from ..node_service.request_receiver.r... | 0 | 0 | 0 | 1,445 | 0 | 0 | 0 | 175 | 265 |
156ce288e2b911b1ab31cbe9782d28cab05146f7 | 2,123 | py | Python | tulius/stories/edit_story_cataloging.py | kozzztik/tulius | 81b8f6484eefdc453047f62173a08f5e6f640cd6 | [
"MIT"
] | 1 | 2020-04-21T15:09:18.000Z | 2020-04-21T15:09:18.000Z | tulius/stories/edit_story_cataloging.py | kozzztik/tulius | 81b8f6484eefdc453047f62173a08f5e6f640cd6 | [
"MIT"
] | 70 | 2019-04-10T22:32:32.000Z | 2022-03-11T23:12:54.000Z | tulius/stories/edit_story_cataloging.py | kozzztik/tulius | 81b8f6484eefdc453047f62173a08f5e6f640cd6 | [
"MIT"
] | 1 | 2019-04-12T14:55:39.000Z | 2019-04-12T14:55:39.000Z | from django.utils.translation import gettext_lazy as _
EDIT_STORY_PAGES_MAIN = 'edit_story_main'
EDIT_STORY_PAGES_TEXTS = 'edit_story_texts'
EDIT_STORY_PAGES_USERS = 'edit_story_users'
EDIT_STORY_PAGES_GRAPHICS = 'edit_story_graphics'
EDIT_STORY_PAGES_VARIATIONS = 'edit_story_variations'
EDIT_STORY_PAGES_CHARACTERS =... | 33.171875 | 65 | 0.686293 | from django import urls
from django.utils.translation import gettext_lazy as _
from tulius.stories.catalog import stories_catalog_page
from djfw.cataloging.core import CatalogPage
EDIT_STORY_PAGES_MAIN = 'edit_story_main'
EDIT_STORY_PAGES_TEXTS = 'edit_story_texts'
EDIT_STORY_PAGES_USERS = 'edit_story_users'
EDIT_ST... | 0 | 0 | 0 | 912 | 0 | 0 | 0 | 59 | 113 |
e2977ba4fe267a8f9a3c850b1dbd64016e64f508 | 7,635 | py | Python | HW2/python/random_poke.py | RiaAggarwal/dsc291team4 | 65d55a2ff992e72b6837f569ec56490f4909f9c8 | [
"MIT"
] | null | null | null | HW2/python/random_poke.py | RiaAggarwal/dsc291team4 | 65d55a2ff992e72b6837f569ec56490f4909f9c8 | [
"MIT"
] | null | null | null | HW2/python/random_poke.py | RiaAggarwal/dsc291team4 | 65d55a2ff992e72b6837f569ec56490f4909f9c8 | [
"MIT"
] | 2 | 2020-04-16T16:46:00.000Z | 2020-04-19T00:01:41.000Z | #!/usr/bin/env python3
""" A module for collecting statistics about the performance of the memory Heirarchy
"""
import numpy as np
from time import time
from os.path import isdir
from os import mkdir, chdir, getcwd
import traceback, sys
from numpy.random import rand
def measureRandomAccess(size,filename='',k=1000):
... | 31.036585 | 129 | 0.543811 | #!/usr/bin/env python3
""" A module for collecting statistics about the performance of the memory Heirarchy
"""
import numpy as np
from time import time
from os.path import isdir
from os import mkdir,chdir,getcwd
import traceback,sys
import shutil, psutil
from numpy.random import rand
def measureRandomAccess(size,file... | 0 | 0 | 0 | 0 | 0 | 2,412 | 0 | -3 | 91 |
c17d98e4715f82b0fc3ab9e7610be42ebac98711 | 399 | py | Python | evaluation/aggregate.py | AlBi-HHU/longest-run-subsequence | 7f3c28400f3f1f50735b580f34c4c494be82fb74 | [
"MIT"
] | null | null | null | evaluation/aggregate.py | AlBi-HHU/longest-run-subsequence | 7f3c28400f3f1f50735b580f34c4c494be82fb74 | [
"MIT"
] | null | null | null | evaluation/aggregate.py | AlBi-HHU/longest-run-subsequence | 7f3c28400f3f1f50735b580f34c4c494be82fb74 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
collect_results() | 26.6 | 57 | 0.671679 | import os
def collect_results():
dir = "./results"
out = "./aggregate.csv"
with open(out, 'w') as all_results:
for filename in sorted(os.listdir(dir)):
with open(dir+'/'+filename, 'r') as partial_result:
lines = [line for line in partial_result.readlines()]
for line in lines:
all_results.write(line)... | 0 | 0 | 0 | 0 | 0 | 316 | 0 | -12 | 45 |
544e386a1da2077e9c9c45ab9d11972f40a9014f | 6,140 | py | Python | DCAL/DCAL_utils/dc_coastal_change.py | Neo916/deafrica-sandbox-notebooks | 5d7e4287d3536d75278ecf9c4850889ccc6fbcfd | [
"Apache-2.0"
] | null | null | null | DCAL/DCAL_utils/dc_coastal_change.py | Neo916/deafrica-sandbox-notebooks | 5d7e4287d3536d75278ecf9c4850889ccc6fbcfd | [
"Apache-2.0"
] | null | null | null | DCAL/DCAL_utils/dc_coastal_change.py | Neo916/deafrica-sandbox-notebooks | 5d7e4287d3536d75278ecf9c4850889ccc6fbcfd | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | 43.239437 | 108 | 0.716775 | # Copyright 2016 United States Government as represented by the Administrator
# of the National Aeronautics and Space Administration. All Rights Reserved.
#
# Portion of this code is Copyright Geoscience Australia, Licensed under the
# Apache License, Version 2.0 (the "License"); you may not use this file
# except in c... | 0 | 0 | 0 | 0 | 0 | 967 | 0 | 20 | 159 |
4a4aca4399c89bc5b365fbc63e3fb883a47feac9 | 216 | py | Python | backend/api/settings/development.py | vivekthoppil/InsuranceSuite | 700392ee71f4afeefb4f2fb768402d4839b992e2 | [
"MIT"
] | 2 | 2021-05-20T06:11:48.000Z | 2022-02-06T16:09:54.000Z | backend/api/settings/development.py | vivekthoppil/InsuranceSuite | 700392ee71f4afeefb4f2fb768402d4839b992e2 | [
"MIT"
] | 8 | 2021-03-10T03:57:49.000Z | 2022-01-22T10:12:43.000Z | backend/api/settings/development.py | vivekthoppil/InsuranceSuite | 700392ee71f4afeefb4f2fb768402d4839b992e2 | [
"MIT"
] | null | null | null |
# separated by space
ALLOWED_HOSTS = ('0.0.0.0', '127.0.0.1')
CORS_ORIGIN_WHITELIST = (
'http://localhost:3000',
'http://127.0.0.1:3000',
'http://0.0.0.0:3000',
)
| 19.636364 | 40 | 0.611111 | from api.settings.base import * # noqa
# separated by space
ALLOWED_HOSTS = ('0.0.0.0', '127.0.0.1')
CORS_ORIGIN_WHITELIST = (
'http://localhost:3000',
'http://127.0.0.1:3000',
'http://0.0.0.0:3000',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 29 |
36282236c0b4a2a17a88afa9403ebcca957be5d2 | 5,923 | py | Python | lib/googlecloudsdk/api_lib/workflows/codes.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/googlecloudsdk/api_lib/workflows/codes.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/api_lib/workflows/codes.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 40.568493 | 76 | 0.740672 | # -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 0 | 0 | 0 | 5,104 | 0 | 0 | 0 | -10 | 46 |
e6710c7cfc8ec651464226571e3156c03862a0ac | 1,420 | py | Python | index.py | ThomasZh/legend-club-portal | 87616b758a2937bc1d3a0b971f27811215cc6a53 | [
"Apache-2.0"
] | 1 | 2017-05-03T12:27:46.000Z | 2017-05-03T12:27:46.000Z | index.py | ThomasZh/legend-club-portal | 87616b758a2937bc1d3a0b971f27811215cc6a53 | [
"Apache-2.0"
] | null | null | null | index.py | ThomasZh/legend-club-portal | 87616b758a2937bc1d3a0b971f27811215cc6a53 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# --- refactored entry point for the application ---
# by lwz7512
# @2016/05/17
import tornado.ioloop
from tornado.options import define
# all the route config
define("port", default=8023, help="run on the given port", type=int)
define("debug", default=True, help="run i... | 28.979592 | 106 | 0.678873 | #!/usr/bin/env python
# _*_ coding: utf-8_*_
#
# --- refactored entry point for the application ---
# by lwz7512
# @2016/05/17
import os.path
import ssl
import tornado.ioloop
from tornado.options import define, options
import tornado.web
from foo.global_const import *
# all the route config
import router
define("po... | 45 | 0 | 0 | 0 | 0 | 906 | 0 | -11 | 134 |
8273ce4ecb3b54f919b241617a5d768c2a0683e9 | 142 | py | Python | diy_programs/diy_7_fns_p5.py | bhalajin/blueprints | 7ad1d7860aafbb4c333de9efbbb7e546ed43c569 | [
"MIT"
] | null | null | null | diy_programs/diy_7_fns_p5.py | bhalajin/blueprints | 7ad1d7860aafbb4c333de9efbbb7e546ed43c569 | [
"MIT"
] | null | null | null | diy_programs/diy_7_fns_p5.py | bhalajin/blueprints | 7ad1d7860aafbb4c333de9efbbb7e546ed43c569 | [
"MIT"
] | null | null | null |
print(factorial(5))
print(factorial(100)) | 17.75 | 35 | 0.605634 | def factorial(num):
if num == 1:
return 1
else:
return num*factorial(num-1)
print(factorial(5))
print(factorial(100)) | 0 | 0 | 0 | 0 | 0 | 78 | 0 | 0 | 22 |
24ef561224b9599fcb3667d44d21950bb59d33b6 | 287 | py | Python | python/mbn.py | matiasbn/SmartBikeParking | 13a1d00d063ff34b3d7994edf5c1ad9ec3310d0e | [
"MIT"
] | null | null | null | python/mbn.py | matiasbn/SmartBikeParking | 13a1d00d063ff34b3d7994edf5c1ad9ec3310d0e | [
"MIT"
] | null | null | null | python/mbn.py | matiasbn/SmartBikeParking | 13a1d00d063ff34b3d7994edf5c1ad9ec3310d0e | [
"MIT"
] | null | null | null |
b = 1
n = 8
mu = 7
p = 200
i = 10
j = 128
mensaje = 53
getcontext().prec = p
print Mbn(b, n, mu, i, j,p)*mensaje
| 15.105263 | 43 | 0.533101 | def Mbn(b, n, mu, i, j,p):
M = Decimal(b)/Decimal(10**n-mu)
SCF = int((10**p)*M)
RCF = (SCF%10**(i+j)-SCF%10**i)/10 ** i
return RCF
from decimal import *
b = 1
n = 8
mu = 7
p = 200
i = 10
j = 128
mensaje = 53
getcontext().prec = p
print Mbn(b, n, mu, i, j,p)*mensaje
| 0 | 0 | 0 | 0 | 0 | 126 | 0 | 0 | 45 |
dce6387a474ac4724e553e86775dc2166581e9ba | 1,944 | py | Python | geniepy/tests/unit/test_pcp_classifier.py | rdharjai/genie | 068a3695a6c95c8b8a22082d7653e3d4f70bbdc7 | [
"MIT"
] | null | null | null | geniepy/tests/unit/test_pcp_classifier.py | rdharjai/genie | 068a3695a6c95c8b8a22082d7653e3d4f70bbdc7 | [
"MIT"
] | null | null | null | geniepy/tests/unit/test_pcp_classifier.py | rdharjai/genie | 068a3695a6c95c8b8a22082d7653e3d4f70bbdc7 | [
"MIT"
] | null | null | null | """Test base classifier class."""
import pandas as pd
CLSFR_NAME = "pub_score"
SAMPLE_RECORD = pd.Series(["g", "e", "e", "k", "s"])
| 34.714286 | 77 | 0.686214 | """Test base classifier class."""
import pytest
import pandas as pd
import geniepy.classmgmt.classifiers as clsfr
from geniepy.errors import ClassifierError
CLSFR_NAME = "pub_score"
SAMPLE_RECORD = pd.Series(["g", "e", "e", "k", "s"])
class TestClassifier:
"""Base Classifier pytest class."""
classifier = c... | 0 | 0 | 0 | 1,683 | 0 | 0 | 0 | 37 | 89 |
ab5a3af94ad13d65ba593229df749ce9980186e6 | 2,279 | py | Python | scripts/north_somerset.py | LibrariesHacked/mobilelibraries-data | f14e891261a2d170326f92395f4a41867e8ceef7 | [
"MIT"
] | null | null | null | scripts/north_somerset.py | LibrariesHacked/mobilelibraries-data | f14e891261a2d170326f92395f4a41867e8ceef7 | [
"MIT"
] | 92 | 2019-04-13T21:59:34.000Z | 2020-11-27T22:58:28.000Z | scripts/north_somerset.py | LibrariesHacked/mobilelibraries-data | f14e891261a2d170326f92395f4a41867e8ceef7 | [
"MIT"
] | null | null | null | """Converts raw North Somerset data to standardised mobile library format"""
import csv
import geopandas
from shapely.geometry import Point
from _common import create_mobile_library_file
DATA_SOURCE = '../raw/north_somerset.csv'
def run():
"""Runs the main script"""
mobiles_ns = []
mobiles_sg = []
t... | 37.983333 | 124 | 0.591926 | """Converts raw North Somerset data to standardised mobile library format"""
import csv
import geopandas
from datetime import datetime
from shapely.geometry import Point
from _common import create_mobile_library_file
DATA_SOURCE = '../raw/north_somerset.csv'
def run():
"""Runs the main script"""
mobiles_ns ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 22 |
f28546dad995ae36b86b8cac98ae75d08fded3c1 | 808 | py | Python | exercises/composing-methods-more/calculate_area.py | GSPuniani/ACS-4931-Testing-and-Architecture | 49debf42c6422052d3b029f4fac0d88b40396b44 | [
"MIT"
] | null | null | null | exercises/composing-methods-more/calculate_area.py | GSPuniani/ACS-4931-Testing-and-Architecture | 49debf42c6422052d3b029f4fac0d88b40396b44 | [
"MIT"
] | null | null | null | exercises/composing-methods-more/calculate_area.py | GSPuniani/ACS-4931-Testing-and-Architecture | 49debf42c6422052d3b029f4fac0d88b40396b44 | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Rename Method
# Reference: https://parade.com/1039985/marynliles/pick-up-lines/
def calculate_area_under_graph(graph): # DONE: Rename this function to reflect what it's doing.
"""Calculate the area under the input graph."""
# bla bla bla.
pass
#####################
li = [5, -1, 43,... | 27.862069 | 97 | 0.632426 | # by Kami Bigdely
# Rename Method
# Reference: https://parade.com/1039985/marynliles/pick-up-lines/
def calculate_area_under_graph(graph): # DONE: Rename this function to reflect what it's doing.
"""Calculate the area under the input graph."""
# bla bla bla.
pass
#####################
def get_max_value... | 6 | 0 | 0 | 0 | 0 | 287 | 0 | 0 | 45 |
92d57d4f85789b0b3fe2529a456af38bbbada2fd | 8,298 | py | Python | classificationapp/post_process.py | Atlas200DKTest/sample-classification-python | 5a36bbc1eb2acea03e731ecc777382ed59d17af0 | [
"Apache-2.0"
] | 1 | 2020-05-31T01:31:05.000Z | 2020-05-31T01:31:05.000Z | classificationapp/post_process.py | Atlas200dk/sample-classification-python | 5a36bbc1eb2acea03e731ecc777382ed59d17af0 | [
"Apache-2.0"
] | null | null | null | classificationapp/post_process.py | Atlas200dk/sample-classification-python | 5a36bbc1eb2acea03e731ecc777382ed59d17af0 | [
"Apache-2.0"
] | null | null | null | #coding=utf-8
import numpy as np
# from atlasutil.presenteragent.presenter_types import *
def SSDPostProcess(inference_result, image_resolution, confidence_threshold, labels = []):
'''
processes SSD detection result, returns detection result
Args:
resultList: list, detection result
image... | 39.141509 | 131 | 0.628585 | #coding=utf-8
import numpy as np
import copy
# from atlasutil.presenteragent.presenter_types import *
import cv2 as cv
def SSDPostProcess(inference_result, image_resolution, confidence_threshold, labels = []):
'''
processes SSD detection result, returns detection result
Args:
resultList: list, d... | 387 | 0 | 0 | 0 | 0 | 2,624 | 0 | -15 | 157 |
b754fc9464880536f042ccb774c810245f550002 | 22,617 | py | Python | Bot.py | Xupix6/Xupixbot | f0ac5e5aaa622ac616329033bc7d2f61dc4598bf | [
"Apache-2.0"
] | null | null | null | Bot.py | Xupix6/Xupixbot | f0ac5e5aaa622ac616329033bc7d2f61dc4598bf | [
"Apache-2.0"
] | null | null | null | Bot.py | Xupix6/Xupixbot | f0ac5e5aaa622ac616329033bc7d2f61dc4598bf | [
"Apache-2.0"
] | null | null | null | import os
from discord.ext import commands
from itertools import cycle
client = commands.Bot(command_prefix = 'xb!')
client.remove_command('help')
Statut = cycle(['Version : Beta','Cre par Xupix#0369','Programmation en cours'])
monID = 446283752730263572
l = 0
safe = ["Xupix#0369","XeriosG#5321","XupixBot#6... | 47.415094 | 280 | 0.62117 | import time
import discord
import random
import os
from discord.ext import commands, tasks
from itertools import cycle
client = commands.Bot(command_prefix = 'xb!')
client.remove_command('help')
Statut = cycle(['Version : Beta','Crée par Xupix#0369','Programmation en cours'])
monID = 446283752730263572
l ... | 298 | 20,918 | 0 | 0 | 0 | 0 | 0 | -18 | 494 |
a4bf02f9dfb75afb6a0588984d4e8caa666ba8d7 | 509 | py | Python | eval/eval_by_avg_length.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | eval/eval_by_avg_length.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | eval/eval_by_avg_length.py | YangXuepei/ime-eval | e47d05e15aef9f10bf9e906f0622699fd1613db4 | [
"WTFPL"
] | null | null | null | # -*- coding:utf-8 -*-#
#
| 29.941176 | 64 | 0.611002 | # -*- coding:utf-8 -*-#
# 平均每个字敲击键盘次数
def eval_by_avg_length(code_table, character_frequency):
length = 0.0
sum = 0.0
# print chardet.detect(train_text)
for ch in dict.fromkeys(character_frequency, 0):
if ch in code_table:
num = int(character_frequency[ch])
length += le... | 33 | 0 | 0 | 0 | 0 | 447 | 0 | 0 | 23 |
96cbb1d41934602619319eadef7511c59498cbbd | 262 | py | Python | patch_tensorflow.py | thesamuel/ctrl | 13e0ab298e76faebfae7a26391f76f8aa8ad9100 | [
"BSD-3-Clause"
] | null | null | null | patch_tensorflow.py | thesamuel/ctrl | 13e0ab298e76faebfae7a26391f76f8aa8ad9100 | [
"BSD-3-Clause"
] | null | null | null | patch_tensorflow.py | thesamuel/ctrl | 13e0ab298e76faebfae7a26391f76f8aa8ad9100 | [
"BSD-3-Clause"
] | null | null | null | import site
from pathlib import Path
import subprocess
site_packages = Path(site.getsitepackages()[0])
patch_file = site_packages / 'tensorflow_estimator' / 'python' / 'estimator' / 'keras.py'
subprocess.run(['patch', '-b', str(patch_file), 'estimator.patch'])
| 32.75 | 89 | 0.744275 | import site
from pathlib import Path
import subprocess
site_packages = Path(site.getsitepackages()[0])
patch_file = site_packages / 'tensorflow_estimator' / 'python' / 'estimator' / 'keras.py'
subprocess.run(['patch', '-b', str(patch_file), 'estimator.patch'])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
363abadf001c9bfdecb8f8aa85204be513d39dbc | 3,233 | py | Python | gui.py | JacobPaulette/PyLife | ef87fd04a6d3eade58d154427123499705706f36 | [
"MIT"
] | null | null | null | gui.py | JacobPaulette/PyLife | ef87fd04a6d3eade58d154427123499705706f36 | [
"MIT"
] | null | null | null | gui.py | JacobPaulette/PyLife | ef87fd04a6d3eade58d154427123499705706f36 | [
"MIT"
] | null | null | null | import pygame
import numpy as np
import sys
def color_matrix(array):
"""Replace binary values with RGB black and white."""
size = array.shape + (3,)
color = np.full(size, [255,255,255], dtype=np.int)
color[array == 1] = [0,0,0]
return color
def scale(array, n):
"""Scale the array for blitti... | 32.009901 | 75 | 0.526755 | import pygame
import numpy as np
import sys
def color_matrix(array):
"""Replace binary values with RGB black and white."""
size = array.shape + (3,)
color = np.full(size, [255,255,255], dtype=np.int)
color[array == 1] = [0,0,0]
return color
def scale(array, n):
"""Scale the array for blitti... | 0 | 0 | 0 | 0 | 0 | 70 | 0 | 0 | 23 |
53c1a9110a98f66e8136c30abc0b0401ee8511cb | 7,709 | py | Python | paddlers/custom_models/cd/models/unet_siamdiff.py | Xiaracto/PaddleRS | 6e9b99a79fe740775daff310bd1ca3e6fbc86f80 | [
"Apache-2.0"
] | 1 | 2022-03-30T10:59:58.000Z | 2022-03-30T10:59:58.000Z | paddlers/custom_models/cd/models/unet_siamdiff.py | wondering516/PaddleRS | b6f7033f3c0ca7bc6952456c0a0f53eef6c1c07f | [
"Apache-2.0"
] | null | null | null | paddlers/custom_models/cd/models/unet_siamdiff.py | wondering516/PaddleRS | b6f7033f3c0ca7bc6952456c0a0f53eef6c1c07f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 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 applic... | 34.569507 | 123 | 0.595538 | # Copyright (c) 2022 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 applic... | 0 | 0 | 0 | 6,885 | 0 | 0 | 0 | 79 | 113 |
76cab34922f07561ef53f2d0199b9b2cb7806763 | 7,895 | py | Python | scrapers/nsw_2019/scrape.py | claudinec/demsausage | de94c13eef4b2ddf212cba75a90c062f338950c5 | [
"MIT"
] | 5 | 2019-03-15T11:53:18.000Z | 2021-05-02T03:50:26.000Z | scrapers/nsw_2019/scrape.py | keithamoss/demsausage | fa289ef38d4e9cac44639ff6c2f2f91605ff0fb9 | [
"MIT"
] | 312 | 2019-03-01T06:35:13.000Z | 2022-03-17T13:31:40.000Z | scrapers/nsw_2019/scrape.py | claudinec/demsausage | de94c13eef4b2ddf212cba75a90c062f338950c5 | [
"MIT"
] | 2 | 2018-11-21T04:40:28.000Z | 2018-11-23T00:08:14.000Z | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demsausage.settings")
django.setup()
scraper = scraper()
json_filepath = scraper.scrape_polling_places_json()
# json_filepath = os.path.join(scraper.base_dir, "nsw_polling_places_2019-02-17T175021.json")
scraper.save_to_csv()
print("Fin.")
| 40.076142 | 166 | 0.653578 | import os
import django
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demsausage.settings")
django.setup()
import json
from urllib.parse import parse_qs
import pytz
import time
import csv
from copy import deepcopy
import requests
from haralyzer import HarParser, HarPage
from bs4 import BeautifulSoup
from demsaus... | 0 | 0 | 0 | 7,090 | 0 | 0 | 0 | 154 | 334 |
9a312fa8cff5552aa99bb22bf58c54e4537cd262 | 658 | py | Python | scripts/archive/print_leadership_roles.py | DevPoetsSociety/congress-legislators | 14c497c8d04ad83d378b4bbea7f99f5b2cdcf69a | [
"CC0-1.0"
] | 1,629 | 2015-01-02T03:10:50.000Z | 2022-03-31T02:49:30.000Z | scripts/archive/print_leadership_roles.py | DevPoetsSociety/congress-legislators | 14c497c8d04ad83d378b4bbea7f99f5b2cdcf69a | [
"CC0-1.0"
] | 463 | 2015-01-03T19:17:53.000Z | 2022-03-26T03:18:50.000Z | scripts/archive/print_leadership_roles.py | DevPoetsSociety/congress-legislators | 14c497c8d04ad83d378b4bbea7f99f5b2cdcf69a | [
"CC0-1.0"
] | 468 | 2015-01-02T03:11:08.000Z | 2022-03-30T16:40:45.000Z | #print out leadership roles for manual review
import rtyaml
import utils
with open("legislators-current.yaml") as f:
legislators = rtyaml.load(f)
for legislator in legislators:
if 'leadership_roles' in legislator:
print("{}, {}".format(legislator["name"]["last"], legislator["name"]["first"]))
for role in le... | 34.631579 | 111 | 0.642857 | #print out leadership roles for manual review
import rtyaml
import utils
with open("legislators-current.yaml") as f:
legislators = rtyaml.load(f)
for legislator in legislators:
if 'leadership_roles' in legislator:
print("{}, {}".format(legislator["name"]["last"], legislator["name"]["first"]))
for role in le... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
325e03b57841e6ce690db8b7a73010c1927ed0dd | 1,854 | py | Python | counties.py | mhlr/covid-ai | e85122cc625e4017eff966550d2d9715ce05ae1e | [
"Apache-2.0"
] | null | null | null | counties.py | mhlr/covid-ai | e85122cc625e4017eff966550d2d9715ce05ae1e | [
"Apache-2.0"
] | 3 | 2021-05-20T23:19:05.000Z | 2022-02-26T10:27:58.000Z | counties.py | mhlr/covid-ai | e85122cc625e4017eff966550d2d9715ce05ae1e | [
"Apache-2.0"
] | null | null | null | import json, sys, os, re
import pandas as pd
import janitor
from toolz.curried import operator as op
import geopandas as gpd
import geoplot as gpl
import geoplot.crs as gcrs
cases = pd.read_csv('./data/covid_confirmed_usafacts.csv', parse_dates=True, infer_datetime_format=True, date_parses=pd.to_datetime),low_memor... | 46.35 | 218 | 0.780475 | from pylab import *
from builtins import *
import json, sys, os, re
import pandas as pd
import janitor
from toolz.curried import *
from toolz.curried import operator as op
import geopandas as gpd
import geoplot as gpl
import geoplot.crs as gcrs
cases = pd.read_csv('./data/covid_confirmed_usafacts.csv', parse_dates... | 0 | 0 | 0 | 0 | 0 | 51 | 0 | 5 | 89 |
31b1c64256ffa1e280f1968059a124a676de024e | 5,478 | py | Python | sa/profiles/EdgeCore/ES/get_inventory.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | sa/profiles/EdgeCore/ES/get_inventory.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | sa/profiles/EdgeCore/ES/get_inventory.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# EdgeCore.ES.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pytho... | 42.796875 | 87 | 0.36893 | # ---------------------------------------------------------------------
# EdgeCore.ES.get_inventory
# ---------------------------------------------------------------------
# Copyright (C) 2007-2021 The NOC Project
# See LICENSE for details
# ---------------------------------------------------------------------
# Pytho... | 0 | 0 | 0 | 4,997 | 0 | 0 | 0 | 46 | 89 |
13c3dff39d930065186231ffb8da29fac56e8d2d | 2,135 | py | Python | normals_eval.py | trigeorgis/normal_estimation_cvpr17 | 40804f4a2654e9728336d3fd481b11e4bc318e1a | [
"BSD-3-Clause"
] | 1 | 2019-08-28T18:51:51.000Z | 2019-08-28T18:51:51.000Z | normals_eval.py | trigeorgis/normal_estimation_cvpr17 | 40804f4a2654e9728336d3fd481b11e4bc318e1a | [
"BSD-3-Clause"
] | 1 | 2020-03-05T07:43:36.000Z | 2020-03-05T07:43:36.000Z | normals_eval.py | trigeorgis/normal_estimation_cvpr17 | 40804f4a2654e9728336d3fd481b11e4bc318e1a | [
"BSD-3-Clause"
] | 1 | 2021-07-17T02:10:02.000Z | 2021-07-17T02:10:02.000Z | import tensorflow as tf
slim = tf.contrib.slim
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('checkpoint_dir', 'ckpt/train',
'''Directory where to load the checkpoint''')
tf.app.flags.DEFINE_string('log_dir', 'ckpt/eval_ict',
'''Directory where to write ev... | 31.865672 | 97 | 0.663232 | import data_provider
import tensorflow as tf
import network
import math
slim = tf.contrib.slim
FLAGS = tf.app.flags.FLAGS
tf.app.flags.DEFINE_string('checkpoint_dir', 'ckpt/train',
'''Directory where to load the checkpoint''')
tf.app.flags.DEFINE_string('log_dir', 'ckpt/eval_ict',
... | 0 | 0 | 0 | 0 | 0 | 1,592 | 0 | -18 | 89 |
0766381fdf1935288008892159728c068fab5106 | 509 | py | Python | 097.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 097.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 097.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | #-*- encoding: utf-8 -*-
"""
Large non-Mersenne prime
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 269725931; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2p1, have been found which contain more digits.
How... | 36.357143 | 263 | 0.75835 | #-*- encoding: utf-8 -*-
"""
Large non-Mersenne prime
The first known prime found to exceed one million digits was discovered in 1999, and is a Mersenne prime of the form 26972593−1; it contains exactly 2,098,960 digits. Subsequently other Mersenne primes, of the form 2p−1, have been found which contain more digits.
H... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 23 |
52b1f1720304d699243f19069e92b0a158101bc5 | 387 | py | Python | setup.py | Weiming-Hu/PyPIOMAS | 7fcabe7df09240c8c25a5fab9ece9cc0b53a45f6 | [
"MIT"
] | 2 | 2021-04-23T10:12:00.000Z | 2021-06-03T20:13:31.000Z | setup.py | Weiming-Hu/PyPIOMAS | 7fcabe7df09240c8c25a5fab9ece9cc0b53a45f6 | [
"MIT"
] | null | null | null | setup.py | Weiming-Hu/PyPIOMAS | 7fcabe7df09240c8c25a5fab9ece9cc0b53a45f6 | [
"MIT"
] | 1 | 2021-07-15T08:01:50.000Z | 2021-07-15T08:01:50.000Z | import setuptools
setuptools.setup(
name='PyPIOMAS',
version='0.1.2',
author='Weiming Hu',
author_email='weiming@psu.edu',
url='https://github.com/Weiming-Hu/PyPIOMAS',
packages=['PyPIOMAS'],
license='LICENSE',
description='A package for downloading and converting the PIOMAS dataset',
... | 21.5 | 78 | 0.635659 | import setuptools
setuptools.setup(
name='PyPIOMAS',
version='0.1.2',
author='Weiming Hu',
author_email='weiming@psu.edu',
url='https://github.com/Weiming-Hu/PyPIOMAS',
packages=['PyPIOMAS'],
license='LICENSE',
description='A package for downloading and converting the PIOMAS dataset',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bb0eefaa7efb6716702d4f1c2a55324040c00607 | 442 | py | Python | organizational_area/migrations/0018_organizationalstructureoffice_slug.py | biotech2021/uniTicket | 8c441eac18e67a983e158326b1c4b82f00f1f1ef | [
"Apache-2.0"
] | 15 | 2019-09-06T06:47:08.000Z | 2022-01-17T06:39:54.000Z | organizational_area/migrations/0018_organizationalstructureoffice_slug.py | biotech2021/uniTicket | 8c441eac18e67a983e158326b1c4b82f00f1f1ef | [
"Apache-2.0"
] | 69 | 2019-09-06T12:03:19.000Z | 2022-03-26T14:30:53.000Z | organizational_area/migrations/0018_organizationalstructureoffice_slug.py | biotech2021/uniTicket | 8c441eac18e67a983e158326b1c4b82f00f1f1ef | [
"Apache-2.0"
] | 13 | 2019-09-11T10:54:20.000Z | 2021-11-23T09:09:19.000Z | # Generated by Django 2.1.7 on 2019-04-11 07:59
| 23.263158 | 69 | 0.638009 | # Generated by Django 2.1.7 on 2019-04-11 07:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizational_area', '0017_organizationalstructure_slug'),
]
operations = [
migrations.AddField(
model_name='organizationalstru... | 0 | 0 | 0 | 328 | 0 | 0 | 0 | 19 | 46 |
6b705b80ae29068fa04c256314281b4c59a227b2 | 8,072 | py | Python | py/HW3/option_models/sabr.py | cy-wang15/ASP | 68a512fbbe0a36feab7eaee5118ea815ec0444de | [
"MIT"
] | 1 | 2021-05-17T02:17:54.000Z | 2021-05-17T02:17:54.000Z | py/HW3/option_models/sabr.py | cy-wang15/ASP | 68a512fbbe0a36feab7eaee5118ea815ec0444de | [
"MIT"
] | null | null | null | py/HW3/option_models/sabr.py | cy-wang15/ASP | 68a512fbbe0a36feab7eaee5118ea815ec0444de | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
'''
MC model class for Beta=1
'''
'''
MC model class for Beta=0
'''
'''
Conditional MC model class for Beta=1
'''
'''
Conditional MC model class for Beta=0
''' | 31.40856 | 108 | 0.52837 | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
from . import normal
from . import bsm
import pyfeng as pf
'''
MC model class for Beta=1
'''
class ModelBsmMC:
beta = 1.0 # fixed (not used)
vov, rho = 0.0, 0... | 0 | 0 | 0 | 7,611 | 0 | 0 | 0 | 1 | 221 |
2df34a9f12438e1cb33bf08f9f1d60dac2539dfa | 117 | py | Python | soft_drf/routing/v1/routers.py | angellagunas/easy_django_rest_framework | 69ce5e45a9e4cbccad5a237066220130b61ff0a2 | [
"Apache-2.0"
] | null | null | null | soft_drf/routing/v1/routers.py | angellagunas/easy_django_rest_framework | 69ce5e45a9e4cbccad5a237066220130b61ff0a2 | [
"Apache-2.0"
] | 3 | 2020-02-11T21:31:15.000Z | 2021-03-19T21:42:46.000Z | soft_drf/routing/v1/routers.py | angellagunas/easy_django_rest_framework | 69ce5e45a9e4cbccad5a237066220130b61ff0a2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from soft_drf.api.routers import DefaultRouter
router = DefaultRouter(trailing_slash=False)
| 23.4 | 46 | 0.760684 | # -*- coding: utf-8 -*-
from soft_drf.api.routers import DefaultRouter
router = DefaultRouter(trailing_slash=False)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ef1e685c0ab8ac81a86e47d2a4308e6de414db20 | 296 | py | Python | Android/config/generate_app_key.py | Luc-netease/NEChatroom | 06f9d50e1696809ca4884d22e0249c156f2a01eb | [
"MIT"
] | 29 | 2020-10-20T09:05:50.000Z | 2021-03-17T11:25:18.000Z | Android/config/generate_app_key.py | Luc-netease/NEChatroom | 06f9d50e1696809ca4884d22e0249c156f2a01eb | [
"MIT"
] | 2 | 2021-04-01T08:50:55.000Z | 2021-12-28T07:55:51.000Z | Android/config/generate_app_key.py | Luc-netease/NEChatroom | 06f9d50e1696809ca4884d22e0249c156f2a01eb | [
"MIT"
] | 14 | 2020-08-31T06:09:13.000Z | 2021-02-23T09:27:13.000Z | import sys
appKey = "APP_KEY="
baseUrl = "BASE_URL="
APP_KEY_FILE_PATH = sys.argv[1]
APP_KEY = sys.argv[2]
BASE_URL = sys.argv[3]
properties = appKey + str(APP_KEY) + '\n' + baseUrl + str(BASE_URL) +'\n'
f = open(APP_KEY_FILE_PATH, mode="w", encoding='utf8')
f.write(properties)
f.close() | 21.142857 | 73 | 0.682432 | import sys, os
appKey = "APP_KEY="
baseUrl = "BASE_URL="
APP_KEY_FILE_PATH = sys.argv[1]
APP_KEY = sys.argv[2]
BASE_URL = sys.argv[3]
properties = appKey + str(APP_KEY) + '\n' + baseUrl + str(BASE_URL) +'\n'
f = open(APP_KEY_FILE_PATH, mode="w", encoding='utf8')
f.write(properties)
f.close() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 |
510206992b5771e539a6093286cb664fde6dad47 | 278 | py | Python | util/fliploss_exposure_calibration.py | wi1k1n/nrf-accelerations | 3075d63177e8ac04ee91784d5b0c56379335740f | [
"MIT"
] | null | null | null | util/fliploss_exposure_calibration.py | wi1k1n/nrf-accelerations | 3075d63177e8ac04ee91784d5b0c56379335740f | [
"MIT"
] | null | null | null | util/fliploss_exposure_calibration.py | wi1k1n/nrf-accelerations | 3075d63177e8ac04ee91784d5b0c56379335740f | [
"MIT"
] | null | null | null | import torch
from fairnr.data.data_utils import load_exr
from fairnr.criterions.flip_loss import HDRFLIPLoss
loss = HDRFLIPLoss()
dark = torch.Tensor(load_exr('data/blender/guitar_static_exr/rgb/0151.exr')).permute((2, 0, 1)).unsqueeze(0).cuda()
loss(dark, dark)
print(dark) | 25.272727 | 115 | 0.776978 | import torch
from fairnr.data.data_utils import load_exr
from fairnr.criterions.flip_loss import HDRFLIPLoss
loss = HDRFLIPLoss()
dark = torch.Tensor(load_exr('data/blender/guitar_static_exr/rgb/0151.exr')).permute((2, 0, 1)).unsqueeze(0).cuda()
loss(dark, dark)
print(dark) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ee2345228351d986941d149786f47a4522aba09 | 7,646 | py | Python | ctypesgen/parser/cparser.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 200 | 2015-05-12T03:02:39.000Z | 2021-08-10T23:24:44.000Z | ctypesgen/parser/cparser.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 88 | 2015-05-11T15:49:11.000Z | 2021-08-19T22:02:12.000Z | ctypesgen/parser/cparser.py | bingqingsuimeng/ctypesgen | 5ddc80e89abe8b02591a9baa1d857ce1f55bdee6 | [
"BSD-2-Clause"
] | 87 | 2015-05-11T19:09:51.000Z | 2021-08-19T17:11:07.000Z | """
Parse a C source file.
To use, subclass CParser and override its handle_* methods. Then instantiate
the class with a string to parse.
"""
__docformat__ = "restructuredtext"
import sys
# --------------------------------------------------------------------------
# Lexer
# -----------------------------------------... | 31.991632 | 93 | 0.542898 | """
Parse a C source file.
To use, subclass CParser and override its handle_* methods. Then instantiate
the class with a string to parse.
"""
__docformat__ = "restructuredtext"
import os.path
import sys
from ctypesgen.parser import cgrammar, preprocessor, yacc
# ---------------------------------------------------... | 0 | 0 | 0 | 6,901 | 0 | 0 | 0 | 29 | 115 |
13ab5b7ddd4729c758d1b81d13637569d7edc701 | 1,426 | py | Python | layers/pna_utils/aggregators.py | ChangminWu/ExpanderGNN | a88bea8ee15d902be2881ec59ec37a8b092a0cd8 | [
"MIT"
] | 2 | 2021-09-04T09:25:59.000Z | 2021-09-05T22:15:24.000Z | layers/pna_utils/aggregators.py | ChangminWu/ExpanderGNN | a88bea8ee15d902be2881ec59ec37a8b092a0cd8 | [
"MIT"
] | null | null | null | layers/pna_utils/aggregators.py | ChangminWu/ExpanderGNN | a88bea8ee15d902be2881ec59ec37a8b092a0cd8 | [
"MIT"
] | null | null | null |
EPS = 1e-5
AGGREGATORS = {"mean": aggregate_mean,
"sum": aggregate_sum,
"max": aggregate_max,
"min": aggregate_min,
"std": aggregate_std,
"var": aggregate_var,
"moment3": aggregate_moment_3,
"moment4": ... | 22.634921 | 74 | 0.622721 | import torch
EPS = 1e-5
def aggregate_mean(h):
return torch.mean(h, dim=1)
def aggregate_max(h):
return torch.max(h, dim=1)[0]
def aggregate_min(h):
return torch.min(h, dim=1)[0]
def aggregate_std(h):
return torch.sqrt(aggregate_var(h) + EPS)
def aggregate_var(h):
h_mean_squares = torch.m... | 0 | 0 | 0 | 0 | 0 | 798 | 0 | -9 | 252 |
c39f3efad5e21f7f5a98d7e4ffb249311b82d7ec | 6,734 | py | Python | zfused_maya/zfused_maya/tool/utility/publishwidget/publishwidget.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | 1 | 2022-01-14T11:40:35.000Z | 2022-01-14T11:40:35.000Z | zfused_maya/zfused_maya/tool/utility/publishwidget/publishwidget.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/tool/utility/publishwidget/publishwidget.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import logging
import maya.cmds as cmds
import zfused_maya.core.record as record
import zfused_maya.core.resource as resource
import zfused_maya.widgets.window as window
import zfused_maya.widgets.lineedit as lineedit
import zfused_maya.n... | 40.566265 | 89 | 0.693496 | # coding:utf-8
# --author-- lanhua.zhou
from __future__ import print_function
import logging
import maya.cmds as cmds
from qtpy import QtWidgets, QtGui, QtCore
import zfused_api
import zfused_maya.core.record as record
import zfused_maya.core.resource as resource
import zfused_maya.widgets.window as window
import ... | 33 | 0 | 0 | 6,198 | 0 | 0 | 0 | 18 | 92 |
c5c5a598b606788966662c951ee1599f7c6f8ab9 | 2,764 | py | Python | tune/android/tune/external/deap/tools/migration.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 17 | 2017-01-22T10:40:52.000Z | 2021-12-01T07:42:40.000Z | tune/android/tune/external/deap/tools/migration.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 3 | 2017-01-19T07:17:29.000Z | 2017-02-08T06:07:48.000Z | tune/android/tune/external/deap/tools/migration.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 13 | 2017-01-10T13:21:03.000Z | 2021-08-11T11:44:06.000Z | from __future__ import division
def migRing(populations, k, selection, replacement=None, migarray=None):
"""Perform a ring migration between the *populations*. The migration first
select *k* emigrants from each population using the specified *selection*
operator and then replace *k* individuals from the a... | 52.150943 | 80 | 0.686686 | from __future__ import division
def migRing(populations, k, selection, replacement=None, migarray=None):
"""Perform a ring migration between the *populations*. The migration first
select *k* emigrants from each population using the specified *selection*
operator and then replace *k* individuals from the a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2c59e729cfc0f57d55980af09c08e481d76cb5fe | 3,326 | py | Python | timeseries/sarima.py | robinvanemden/sensors | c74376e0a3a66d9713793a6b79cc065aaf09e7d1 | [
"MIT"
] | 3 | 2020-09-17T13:39:05.000Z | 2020-09-23T07:15:39.000Z | timeseries/sarima.py | ericlrf/sensors | 62ab79fe7a2999f585114294591f99f519076283 | [
"MIT"
] | null | null | null | timeseries/sarima.py | ericlrf/sensors | 62ab79fe7a2999f585114294591f99f519076283 | [
"MIT"
] | 2 | 2020-09-22T09:05:01.000Z | 2020-09-26T12:03:03.000Z | """
JADS 2020 Data-Driven Food Value Chain course
Introduction to Sensors
Basic Seasonal (S)ARIMA model on PAR Sensor (sunlight) data.
"""
from statsmodels.tsa.seasonal import seasonal_decompose
import matplotlib.pyplot as plt
from statsmodels.tsa.statespace.sarimax import SARIMAX
import pandas as pd
imp... | 28.921739 | 85 | 0.695129 | """
JADS 2020 Data-Driven Food Value Chain course
Introduction to Sensors
Basic Seasonal (S)ARIMA model on PAR Sensor (sunlight) data.
"""
from statsmodels.tsa.seasonal import seasonal_decompose
import matplotlib.pyplot as plt
from statsmodels.tsa.statespace.sarimax import SARIMAX
from pmdarima import au... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 22 |
3187babb0c9c4f1153a7bfed6032d867443ca630 | 274 | py | Python | tests/__init__.py | hsolbrig/funowl | 9345591e6c6cdf246fb8f4b0fcdae0b904c2a45d | [
"CC0-1.0"
] | 23 | 2019-05-24T05:27:25.000Z | 2022-02-18T16:37:17.000Z | tests/__init__.py | hsolbrig/funowl | 9345591e6c6cdf246fb8f4b0fcdae0b904c2a45d | [
"CC0-1.0"
] | 22 | 2019-11-04T21:03:33.000Z | 2022-03-11T19:38:15.000Z | tests/__init__.py | hsolbrig/funowl | 9345591e6c6cdf246fb8f4b0fcdae0b904c2a45d | [
"CC0-1.0"
] | 5 | 2019-10-07T13:28:14.000Z | 2021-12-20T08:28:58.000Z | import logging
# Set log level for debugging tests here
import os
LOGLEVEL = logging.INFO
cwd = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(cwd, 'data')
# Set this to False if you want to make sure some of the big inputs work
SKIP_LONG_TESTS = True
| 22.833333 | 72 | 0.755474 | import logging
# Set log level for debugging tests here
import os
LOGLEVEL = logging.INFO
cwd = os.path.abspath(os.path.dirname(__file__))
datadir = os.path.join(cwd, 'data')
# Set this to False if you want to make sure some of the big inputs work
SKIP_LONG_TESTS = True
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
472797309a79b63d917b603cdbc0263768640f47 | 1,313 | py | Python | create_user.py | luigisaetta/ocipy | aa6c757e50cccbbcdb46931dce96a212ee7554de | [
"MIT"
] | 2 | 2019-04-21T19:59:12.000Z | 2019-05-31T19:38:09.000Z | create_user.py | luigisaetta/ocipy | aa6c757e50cccbbcdb46931dce96a212ee7554de | [
"MIT"
] | null | null | null | create_user.py | luigisaetta/ocipy | aa6c757e50cccbbcdb46931dce96a212ee7554de | [
"MIT"
] | 3 | 2019-05-13T13:46:17.000Z | 2021-12-01T00:30:31.000Z | #
# Oracle SE Team Italy
# (L.S.)
#
import sys
from oci.config import validate_config
from oci.identity import IdentityClient
from oci.identity.models import CreateUserDetails
# configuration for connection to Oracle OCI
# for user, tenancy you have to specify the OCID
# the key is the key (PEM) you have uploaded to y... | 20.2 | 115 | 0.686976 | #
# Oracle SE Team Italy
# (L.S.)
#
import oci
import os
import io
import sys
from pathlib import Path
from oci.config import validate_config
from oci.identity import IdentityClient
from oci.identity.models import CreateUserDetails
# configuration for connection to Oracle OCI
# for user, tenancy you have to specify th... | 0 | 0 | 0 | 0 | 0 | 318 | 0 | -32 | 110 |
9edfd55f049144da1e6f112dab4c9e1911bad3f3 | 1,265 | py | Python | django/alumnos/Equipo 14/doorstep/geo/admin.py | R3SWebDevelopment/CeroUnoApprenticeshipProgramPython | b00b3dce329240889401627e99b72d3d9cadb7d9 | [
"MIT"
] | 1 | 2019-11-29T21:34:42.000Z | 2019-11-29T21:34:42.000Z | django/alumnos/Equipo 14/doorstep/geo/admin.py | R3SWebDevelopment/CeroUnoApprenticeshipProgramPython | b00b3dce329240889401627e99b72d3d9cadb7d9 | [
"MIT"
] | null | null | null | django/alumnos/Equipo 14/doorstep/geo/admin.py | R3SWebDevelopment/CeroUnoApprenticeshipProgramPython | b00b3dce329240889401627e99b72d3d9cadb7d9 | [
"MIT"
] | 1 | 2019-11-30T17:51:50.000Z | 2019-11-30T17:51:50.000Z | from django.contrib import admin
from doorstep.geo import models
admin.site.register(models.Country, CountryAdmin)
admin.site.register(models.State, StateAdmin)
admin.site.register(models.Address, AddressAdmin)
| 39.53125 | 116 | 0.698024 | from django.contrib import admin
from doorstep.geo import models
from doorstep.admin import ModelAdmin
class CountryAdmin(ModelAdmin):
list_display = ('name', 'iso_code2', 'iso_code3', 'iso_numeric', 'allow_billing',
'allow_shipping', 'subject_to_vat', 'display_order', 'is_active',)
list_... | 0 | 0 | 0 | 941 | 0 | 0 | 0 | 16 | 91 |
b2c9441883bae4ff068ab1f3f181d9051d036ab5 | 623 | py | Python | test/2021/test_2021_day12.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | 1 | 2020-11-30T19:17:50.000Z | 2020-11-30T19:17:50.000Z | test/2021/test_2021_day12.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null | test/2021/test_2021_day12.py | TedCassirer/advent-of-code | fb87dfdbb48b44f864337750aa58a809dcf72392 | [
"MIT"
] | null | null | null |
testData1 = """
start-A
start-b
A-c
A-b
b-d
A-end
b-end
""".strip()
testData2 = """
dc-end
HN-start
start-kj
dc-start
dc-HN
LN-dc
HN-end
kj-sa
kj-HN
kj-dc
""".strip()
testData3 = """
fs-end
he-DX
fs-he
start-DX
pj-DX
end-zg
zg-sl
zg-pj
pj-he
RW-he
fs-DX
pj-RW
zg-RW
start-pj
he-WI
zg-he
pj-fs
start-RW
""".strip()
| 10.741379 | 39 | 0.658106 | import aoc_cas.aoc2021.day12 as aoc
testData1 = """
start-A
start-b
A-c
A-b
b-d
A-end
b-end
""".strip()
testData2 = """
dc-end
HN-start
start-kj
dc-start
dc-HN
LN-dc
HN-end
kj-sa
kj-HN
kj-dc
""".strip()
testData3 = """
fs-end
he-DX
fs-he
start-DX
pj-DX
end-zg
zg-sl
zg-pj
pj-he
RW-he
fs-DX
pj-RW
zg-RW
start-pj
he-WI
... | 0 | 0 | 0 | 0 | 0 | 222 | 0 | 14 | 68 |
429c2297932ec24fd520e89cb2c44b18b09d44d0 | 1,349 | py | Python | httpie_token_auth.py | ChillarAnand/httpie-token-auth | 039268cc28358168005100cf3d90aa3435bd8977 | [
"MIT"
] | 3 | 2017-02-13T19:45:33.000Z | 2017-06-01T10:06:28.000Z | httpie_token_auth.py | ChillarAnand/httpie-token-auth | 039268cc28358168005100cf3d90aa3435bd8977 | [
"MIT"
] | 1 | 2017-06-01T10:06:01.000Z | 2017-06-01T11:33:26.000Z | httpie_token_auth.py | ChillarAnand/httpie-token-auth | 039268cc28358168005100cf3d90aa3435bd8977 | [
"MIT"
] | null | null | null | """
Token Auth plugin for HTTPie.
"""
import os
try:
from urllib.parse import urlsplit
except ImportError:
auth_endpoint = os.environ.get('HTTPIE_TOKEN_AUTH_URL', '/api/token/new.json')
| 25.942308 | 89 | 0.635285 | """
Token Auth plugin for HTTPie.
"""
import os
import sys
try:
from urllib.parse import urlsplit
except ImportError:
from urlparse import urlsplit
import requests
from httpie.plugins import AuthPlugin, builtin
auth_endpoint = os.environ.get('HTTPIE_TOKEN_AUTH_URL', '/api/token/new.json')
class TokenAuth(... | 0 | 0 | 0 | 999 | 0 | 0 | 0 | 16 | 139 |
df29030ec6239753d948d4d8567982a63a490ee6 | 3,198 | py | Python | python/10_state_pattern.py | Avinashgurugubelli/design_patterns | f5b8e3c7b6538d694eac7890c46520e0045b89d8 | [
"MIT"
] | 2 | 2021-09-01T16:27:03.000Z | 2021-09-10T16:14:21.000Z | python/10_state_pattern.py | Avinashgurugubelli/design_patterns | f5b8e3c7b6538d694eac7890c46520e0045b89d8 | [
"MIT"
] | null | null | null | python/10_state_pattern.py | Avinashgurugubelli/design_patterns | f5b8e3c7b6538d694eac7890c46520e0045b89d8 | [
"MIT"
] | 1 | 2022-02-26T03:04:26.000Z | 2022-02-26T03:04:26.000Z | """
The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes.
The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface.
RealTime Ana... | 34.76087 | 170 | 0.721701 | """
The state pattern is a behavioral software design pattern that allows an object to alter its behavior when its internal state changes.
The state pattern can be interpreted as a strategy pattern, which is able to switch a strategy through invocations of methods defined in the pattern's interface.
RealTime Ana... | 3 | 97 | 0 | 752 | 0 | 0 | 0 | 14 | 208 |
d231f04e91b5d136b7cdde574a5368b91a3aac81 | 20,929 | py | Python | lib/python3.9/site-packages/telethon/tl/functions/contacts.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | lib/python3.9/site-packages/telethon/tl/functions/contacts.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | lib/python3.9/site-packages/telethon/tl/functions/contacts.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | """File generated by TLObjects' generator. All changes will be ERASED"""
from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 30.553285 | 588 | 0.611353 | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
from datetime import datetime
if TYPE_CHECKING:
from ...tl.types import TypeInputContact, ... | 0 | 3,879 | 657 | 15,522 | 0 | 0 | 0 | 129 | 596 |
c598eb2e5d46402a0a01ebbb5a7bfb4112ae8643 | 859 | py | Python | amaranth_yosys/__main__.py | miek/amaranth-yosys | 04d6043a1e7326c2187a11d14b8e12fe5e44eddb | [
"ISC"
] | 16 | 2020-05-21T08:16:50.000Z | 2021-11-17T11:06:51.000Z | amaranth_yosys/__main__.py | miek/amaranth-yosys | 04d6043a1e7326c2187a11d14b8e12fe5e44eddb | [
"ISC"
] | 2 | 2021-12-11T06:08:23.000Z | 2022-02-19T16:15:52.000Z | amaranth_yosys/__main__.py | miek/amaranth-yosys | 04d6043a1e7326c2187a11d14b8e12fe5e44eddb | [
"ISC"
] | 2 | 2021-12-10T10:50:02.000Z | 2021-12-10T22:29:44.000Z | import sys
import wasmtime
try:
from importlib import resources as importlib_resources
importlib_resources.files # py3.9+ stdlib
except (ImportError, AttributeError):
import importlib_resources # py3.8- shim
wasm_cfg = wasmtime.Config()
wasm_cfg.cache = True
wasi_cfg = wasmtime.WasiConfig()
wasi_cfg.argv... | 26.84375 | 74 | 0.76135 | import os
import sys
import wasmtime
try:
from importlib import resources as importlib_resources
importlib_resources.files # py3.9+ stdlib
except (ImportError, AttributeError):
import importlib_resources # py3.8- shim
wasm_cfg = wasmtime.Config()
wasm_cfg.cache = True
wasi_cfg = wasmtime.WasiConfig()
was... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -12 | 22 |
9c309cd005fd2fa70f871176fb3bc40ab461647c | 64 | py | Python | mayan/apps/redactions/__init__.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/redactions/__init__.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/redactions/__init__.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 257 | 2019-05-14T10:26:37.000Z | 2022-03-30T03:37:36.000Z | default_app_config = 'mayan.apps.redactions.apps.RedactionsApp'
| 32 | 63 | 0.84375 | default_app_config = 'mayan.apps.redactions.apps.RedactionsApp'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73eaea711d23d6d7cffe5ba71f791b2f99b573c7 | 8,976 | py | Python | oyster/example/graphs.py | BrennanBarker/oyster | 37e487fbc8cc66081dcc939de8aa05bc96dee889 | [
"MIT"
] | null | null | null | oyster/example/graphs.py | BrennanBarker/oyster | 37e487fbc8cc66081dcc939de8aa05bc96dee889 | [
"MIT"
] | null | null | null | oyster/example/graphs.py | BrennanBarker/oyster | 37e487fbc8cc66081dcc939de8aa05bc96dee889 | [
"MIT"
] | null | null | null | """Example graphs from causal inference literature."""
import networkx as nx
from oyster.diagram import CausalDiagram
# Graphs
mit = nx.DiGraph([('A', 'C'), ('B', 'C'), ('C', 'D'),
('C', 'E'), ('D', 'F'), ('F', 'G'),])
# Causal Inference in Statistics: A Primer
primer = {
'fig1_8': CausalDiagra... | 60.241611 | 124 | 0.287099 | """Example graphs from causal inference literature."""
import networkx as nx
from oyster.diagram import CausalDiagram
# Graphs
mit = nx.DiGraph([('A', 'C'), ('B', 'C'), ('C', 'D'),
('C', 'E'), ('D', 'F'), ('F', 'G'),])
# Causal Inference in Statistics: A Primer
primer = {
'fig1_8': CausalDiagra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
48d5f4fe12733c73481d8df3d08132ed662fa3d5 | 537 | py | Python | pronebo_dj/main/migrations/0011_gallery.py | vlsh1n/pronebo | e9a12d0220d4e3d86c948b256e1ab38cc964dff9 | [
"MIT"
] | null | null | null | pronebo_dj/main/migrations/0011_gallery.py | vlsh1n/pronebo | e9a12d0220d4e3d86c948b256e1ab38cc964dff9 | [
"MIT"
] | null | null | null | pronebo_dj/main/migrations/0011_gallery.py | vlsh1n/pronebo | e9a12d0220d4e3d86c948b256e1ab38cc964dff9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-06-19 17:34
| 25.571429 | 117 | 0.590317 | # Generated by Django 3.2.4 on 2021-06-19 17:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0010_alter_testimonial_options'),
]
operations = [
migrations.CreateModel(
name='Gallery',
fields=[
... | 0 | 0 | 0 | 423 | 0 | 0 | 0 | 19 | 46 |
cbccbe182588b47c095362c861f5a3046609b120 | 870 | py | Python | ts/migrations/0002_auto_20210625_1050.py | adwalkz/DjangoDataAnalysis | 1a888fc3a5dc34651a3b25d476e985ff39d8e305 | [
"MIT"
] | 4 | 2021-08-04T17:02:56.000Z | 2021-09-30T07:07:04.000Z | ts/migrations/0002_auto_20210625_1050.py | adwalkz/DjangoDataAnalysis | 1a888fc3a5dc34651a3b25d476e985ff39d8e305 | [
"MIT"
] | null | null | null | ts/migrations/0002_auto_20210625_1050.py | adwalkz/DjangoDataAnalysis | 1a888fc3a5dc34651a3b25d476e985ff39d8e305 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2021-06-25 10:50
| 24.857143 | 84 | 0.547126 | # Generated by Django 3.1 on 2021-06-25 10:50
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ts', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='clients',
old_name='client_name',
... | 0 | 0 | 0 | 758 | 0 | 0 | 0 | 19 | 46 |
39f492137b0bea9b0576070b85ef3dcdd60cda18 | 27,522 | py | Python | src/model/HeGAN.py | BUPTDM/OpenHNE | 02130cec4a97bdfaddc29860d4544cf555c9b712 | [
"MIT"
] | 144 | 2020-08-06T07:07:15.000Z | 2022-03-24T12:42:48.000Z | src/model/HeGAN.py | liqugit/OpenHINE | aa879201bb9eea49cef49fa3736e676932e6dd2e | [
"MIT"
] | 17 | 2020-08-12T09:46:18.000Z | 2022-02-10T00:15:29.000Z | src/model/HeGAN.py | liqugit/OpenHINE | aa879201bb9eea49cef49fa3736e676932e6dd2e | [
"MIT"
] | 25 | 2020-08-01T14:50:06.000Z | 2022-03-05T12:36:04.000Z |
# from src.utils.evaluation import Aminer_evaluation
| 52.522901 | 227 | 0.58902 | import os
import tensorflow as tf
from src.utils.utils import read_embeddings_with_type,write_emd_file
from src.utils.sampler import Hegan_read_graph
import time
import numpy as np
from src.utils.evaluation import DBLP_evaluation
from src.utils.evaluation import ACM_evaluation
# from src.utils.evaluation import Amin... | 0 | 0 | 0 | 27,115 | 0 | 0 | 0 | 102 | 245 |
1788e6c0b0a5cb9fbbadab8c8861cf86195b8ba1 | 2,333 | py | Python | cryptosystems/primality_tests.py | farnswj1/CryptographyProject | 2f7c553011810c8939cd01e68d743e1a64f71200 | [
"MIT"
] | 1 | 2020-12-07T08:10:15.000Z | 2020-12-07T08:10:15.000Z | cryptosystems/primality_tests.py | farnswj1/CryptographyProject | 2f7c553011810c8939cd01e68d743e1a64f71200 | [
"MIT"
] | null | null | null | cryptosystems/primality_tests.py | farnswj1/CryptographyProject | 2f7c553011810c8939cd01e68d743e1a64f71200 | [
"MIT"
] | 1 | 2021-06-14T14:24:24.000Z | 2021-06-14T14:24:24.000Z |
# Primality Testing
# Returns a list of primes less than n using Sieve of Erathosthenes' algorithm
# Determines if n is a prime by using the Miller-Rabin primality test
# Uses 100 different bases for testing
# Uses a probabilistic method of determining if a number is prime
# List of primes under 1,000,000
SIEVE... | 27.447059 | 95 | 0.544363 | from math import sqrt
import numpy as np
# Primality Testing
# Returns a list of primes less than n using Sieve of Erathosthenes' algorithm
def sieve_of_erathosthenes(n):
# List of integers from 1 to n-1 (assume all are prime for now)
sieve = np.ones(n, dtype="bool")
# Zero and one are not prime
siev... | 0 | 0 | 0 | 0 | 0 | 1,865 | 0 | -3 | 110 |
bdf424a5d5b3c9f2dd9b4dce3474d58c4da50931 | 383 | py | Python | cloud function/Database.py | Med-ELOMARI/marocovid19-dashboard | 3b02a93bc617501a5d66e81fb8ca3722e0b76ad2 | [
"MIT"
] | null | null | null | cloud function/Database.py | Med-ELOMARI/marocovid19-dashboard | 3b02a93bc617501a5d66e81fb8ca3722e0b76ad2 | [
"MIT"
] | null | null | null | cloud function/Database.py | Med-ELOMARI/marocovid19-dashboard | 3b02a93bc617501a5d66e81fb8ca3722e0b76ad2 | [
"MIT"
] | null | null | null | import firebase_admin
from firebase_admin import credentials
# conf.json not included in the repo because it have write access to the database
cred = credentials.Certificate("conf.json")
firebase_admin.initialize_app(
cred, {"databaseURL": "https://covid19maroc-632de.firebaseio.com"}
)
# Import database module.
... | 27.357143 | 82 | 0.785901 | import firebase_admin
from firebase_admin import credentials
# conf.json not included in the repo because it have write access to the database
cred = credentials.Certificate("conf.json")
firebase_admin.initialize_app(
cred, {"databaseURL": "https://covid19maroc-632de.firebaseio.com"}
)
# Import database module.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
954824ac2092e776f593f0f7aa406e89d1893e0d | 2,301 | py | Python | python/oneflow/framework/blob_trait.py | Zhangchangh/oneflow | 4ea3935458cc83dcea0abd88dd613f09c57dc01a | [
"Apache-2.0"
] | 1 | 2021-09-13T02:34:53.000Z | 2021-09-13T02:34:53.000Z | python/oneflow/framework/blob_trait.py | Zhangchangh/oneflow | 4ea3935458cc83dcea0abd88dd613f09c57dc01a | [
"Apache-2.0"
] | null | null | null | python/oneflow/framework/blob_trait.py | Zhangchangh/oneflow | 4ea3935458cc83dcea0abd88dd613f09c57dc01a | [
"Apache-2.0"
] | 1 | 2021-01-17T03:34:39.000Z | 2021-01-17T03:34:39.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 23.01 | 72 | 0.73229 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 1,288 | 0 | -7 | 413 |
79b2309ae6e61c3e198e6ddc0297f33f77d9eee1 | 275 | py | Python | p2ptracker/tests/__init__.py | TMG-nl/p2ptracker | 0e6e77eac77de3fa4f15443920bc6f6886b129b4 | [
"MIT"
] | 5 | 2015-04-29T04:55:21.000Z | 2017-10-27T08:51:56.000Z | p2ptracker/tests/__init__.py | TMG-nl/p2ptracker | 0e6e77eac77de3fa4f15443920bc6f6886b129b4 | [
"MIT"
] | null | null | null | p2ptracker/tests/__init__.py | TMG-nl/p2ptracker | 0e6e77eac77de3fa4f15443920bc6f6886b129b4 | [
"MIT"
] | null | null | null | """
https://github.com/hyves-org/p2ptracker
Copyright (c) 2011, Ramon van Alteren
MIT license: http://www.opensource.org/licenses/MIT
"""
| 18.333333 | 51 | 0.738182 | """
https://github.com/hyves-org/p2ptracker
Copyright (c) 2011, Ramon van Alteren
MIT license: http://www.opensource.org/licenses/MIT
"""
from p2ptracker.tests.helpers import utils
def setUp():
utils.start_redis_server()
def tearDown():
utils.stop_redis_server()
| 0 | 0 | 0 | 0 | 0 | 46 | 0 | 21 | 69 |
494d6803c29e0ba29e6b2517232749489f02d6c8 | 8,294 | py | Python | pints/tests/test_mcmc_summary.py | lisaplag/pints | 3de6617e57ba5b395edaca48961bfc5a4b7209b3 | [
"RSA-MD"
] | null | null | null | pints/tests/test_mcmc_summary.py | lisaplag/pints | 3de6617e57ba5b395edaca48961bfc5a4b7209b3 | [
"RSA-MD"
] | null | null | null | pints/tests/test_mcmc_summary.py | lisaplag/pints | 3de6617e57ba5b395edaca48961bfc5a4b7209b3 | [
"RSA-MD"
] | null | null | null | #!/usr/bin/env python3
#
# Tests the basic methods of the adaptive covariance base class.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import print_... | 35.596567 | 76 | 0.601519 | #!/usr/bin/env python3
#
# Tests the basic methods of the adaptive covariance base class.
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import print_... | 0 | 1,725 | 0 | 6,064 | 0 | 0 | 0 | -22 | 90 |
24bdd6ab48ce6458731cd5e48b72f2da66286762 | 217 | py | Python | src/10.py | mmehas/advent_of_code_2020 | 945db49ead8595e32ec37515605cb14b9f2d21d8 | [
"MIT"
] | null | null | null | src/10.py | mmehas/advent_of_code_2020 | 945db49ead8595e32ec37515605cb14b9f2d21d8 | [
"MIT"
] | null | null | null | src/10.py | mmehas/advent_of_code_2020 | 945db49ead8595e32ec37515605cb14b9f2d21d8 | [
"MIT"
] | null | null | null | from sys import stdin
stdin = open("input.txt", "r")
a = sorted([int(v) for v in stdin.readlines()])
a.append(a[-1] + 3)
cur = 0
diff = [0] * 4
for v in a:
diff[v - cur] += 1
cur = v
print(diff[1] * diff[3]) | 18.083333 | 47 | 0.562212 | from sys import stdin
stdin = open("input.txt", "r")
a = sorted([int(v) for v in stdin.readlines()])
a.append(a[-1] + 3)
cur = 0
diff = [0] * 4
for v in a:
diff[v - cur] += 1
cur = v
print(diff[1] * diff[3]) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
475fa95d64868f00539eae458576e15f482bf5e7 | 5,326 | py | Python | notebooks/featured-70/a-keras-prototype-0-21174-on-pl.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null | notebooks/featured-70/a-keras-prototype-0-21174-on-pl.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null | notebooks/featured-70/a-keras-prototype-0-21174-on-pl.py | anonymous-authorss/DS-Pipeline | 8304adfe7c1b082ad2225d6d5abf16fd30278cd9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np # linear algebra
np.random.seed(666)
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.model_selection import train_test_split
from subprocess import check_output
print(check_output(["ls", "../input"]).decode("utf8"))... | 32.47561 | 121 | 0.68344 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np # linear algebra
np.random.seed(666)
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
from sklearn.model_selection import train_test_split
from subprocess import check_output
print(check_output(["ls", "../input"]).decode("utf8"))... | 0 | 0 | 0 | 0 | 0 | 2,108 | 0 | 260 | 271 |
ea52d7478f9fafa5891ed6db29d778eaeda8d60b | 2,282 | bzl | Python | packages/prisma/src/schema.bzl | marcus-sa/rules_common_nodejs | 79f7a58bb709788922b7e39e8bdfab884557da58 | [
"MIT"
] | 4 | 2019-12-17T17:29:25.000Z | 2019-12-18T09:25:14.000Z | packages/prisma/src/schema.bzl | marcus-sa/rules_common_nodejs | 79f7a58bb709788922b7e39e8bdfab884557da58 | [
"MIT"
] | 5 | 2019-12-19T07:41:10.000Z | 2019-12-19T07:43:09.000Z | packages/prisma/src/schema.bzl | marcus-sa/rules_common_nodejs | 79f7a58bb709788922b7e39e8bdfab884557da58 | [
"MIT"
] | null | null | null | load(
":providers.bzl",
"PrismaDataModel",
"PrismaDataSource",
"PrismaGenerator",
)
prisma_schema = rule(
implementation = _prisma_schema_impl,
attrs = {
"datamodels": attr.label_list(
doc = "prisma_datamodel targets to include",
mandatory = True,
all... | 26.229885 | 73 | 0.588519 | load(
":providers.bzl",
"PrismaDataModel",
"PrismaDataSource",
"PrismaGenerator",
)
def _collect_generator(ctx):
return ctx.attr.generator[PrismaGenerator]
def _collect_datasources(ctx):
return [
ds[PrismaDataSource].datasource
for ds in ctx.attr.datasources
]
def _collect... | 0 | 0 | 0 | 0 | 0 | 1,242 | 0 | 0 | 92 |
d9fae0abec57305c310b4444424d23ece35d2f97 | 2,568 | py | Python | code/classification/kd_trainer.py | kaushal-py/seg-degan | a74c506d5b1b67901a7e0663fba02ddb44f762a6 | [
"MIT"
] | 4 | 2020-11-03T19:47:26.000Z | 2021-07-14T07:01:21.000Z | code/classification/kd_trainer.py | kaushal-py/seg-degan | a74c506d5b1b67901a7e0663fba02ddb44f762a6 | [
"MIT"
] | null | null | null | code/classification/kd_trainer.py | kaushal-py/seg-degan | a74c506d5b1b67901a7e0663fba02ddb44f762a6 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
# temp_tuning()
# alpha_tuning()
| 30.211765 | 94 | 0.495327 | from types import SimpleNamespace
from code.classification.kd_system import KDSystem
def main():
hparams = SimpleNamespace(
batch_size = 128,
lr = 0,
max_lr = 0.2,
step_size_up = 50,
step_size_down = 150,
lr_scheduler = 'cyclic',
... | 0 | 0 | 0 | 0 | 0 | 2,334 | 0 | 41 | 113 |
83411dca972dc86a98227954707c8c2c4d6c9bb9 | 4,185 | py | Python | maml_rl/envs/subproc_vec_env.py | Guitaricet/pytorch-maml-rl | 66352b35221d4c0b0e218d5876b31352e13c6cb7 | [
"MIT"
] | 42 | 2019-01-22T19:44:31.000Z | 2022-03-22T10:48:50.000Z | maml_rl/envs/subproc_vec_env.py | Guitaricet/pytorch-maml-rl | 66352b35221d4c0b0e218d5876b31352e13c6cb7 | [
"MIT"
] | 2 | 2019-04-29T09:54:21.000Z | 2021-11-07T09:08:48.000Z | maml_rl/envs/subproc_vec_env.py | Guitaricet/pytorch-maml-rl | 66352b35221d4c0b0e218d5876b31352e13c6cb7 | [
"MIT"
] | 10 | 2019-05-05T07:17:07.000Z | 2022-01-11T09:15:58.000Z | import sys
is_py2 = (sys.version[0] == '2')
if is_py2:
import Queue as queue
else:
import queue as queue
| 35.168067 | 90 | 0.570131 | import numpy as np
import multiprocessing as mp
import gym
import sys
is_py2 = (sys.version[0] == '2')
if is_py2:
import Queue as queue
else:
import queue as queue
class EnvWorker(mp.Process):
def __init__(self, remote, env_fn, queue, lock):
super(EnvWorker, self).__init__()
self.remote = r... | 0 | 0 | 0 | 3,967 | 0 | 0 | 0 | -7 | 112 |
a755c8c4d4a0abcefcba2ee09e81c54548783ffc | 1,493 | py | Python | triangle.py | msklarek/Coursera-Learn-to-Program-The-Fundamentals | 83f5ffaae10fbd022a2dcb27218f4a1cb0c81263 | [
"MIT"
] | null | null | null | triangle.py | msklarek/Coursera-Learn-to-Program-The-Fundamentals | 83f5ffaae10fbd022a2dcb27218f4a1cb0c81263 | [
"MIT"
] | null | null | null | triangle.py | msklarek/Coursera-Learn-to-Program-The-Fundamentals | 83f5ffaae10fbd022a2dcb27218f4a1cb0c81263 | [
"MIT"
] | null | null | null | import math
def area(base,height):
"""Return the area of a triangle with dimension base
and height
>>>are(10,20)
100.0
>>>area(3.4, 7.5)
12.75
"""
return base * height/2
def perimeter(side1,side2,side3):
'''(number, number, number)-> number
... | 28.711538 | 76 | 0.553918 | import math
def area(base,height):
"""Return the area of a triangle with dimension base
and height
>>>are(10,20)
100.0
>>>area(3.4, 7.5)
12.75
"""
return base * height/2
def perimeter(side1,side2,side3):
'''(number, number, number)-> number
... | 0 | 0 | 0 | 0 | 0 | 154 | 0 | 0 | 23 |
47b2c10491966b13bd96b6efb842a680e33be48c | 1,810 | py | Python | vetting_samples/asyncio_compat.py | orionlee/pht_eb_stats | 382f3dcf80ee4dfc06e54b304630184cce3fa8a4 | [
"MIT"
] | 2 | 2020-08-24T07:18:09.000Z | 2020-10-12T00:59:46.000Z | vetting_samples/asyncio_compat.py | orionlee/pht_eb_stats | 382f3dcf80ee4dfc06e54b304630184cce3fa8a4 | [
"MIT"
] | 1 | 2020-11-09T18:41:39.000Z | 2020-11-09T20:57:57.000Z | asyncio_compat.py | orionlee/PH_TESS_I_LightCurveViewer | 5c556140718f6f7d388f82e39ffaec277456b2fe | [
"MIT"
] | null | null | null | import asyncio
def create_task(coro, *, name=None):
"""create_task that supports Python 3.6."""
if hasattr(asyncio, "create_task"):
task = asyncio.create_task(coro)
if name is not None and hasattr(task, "set_name"):
task.set_name(name)
return task
else:
return a... | 34.150943 | 86 | 0.68674 | import asyncio
import functools
def create_task(coro, *, name=None):
"""create_task that supports Python 3.6."""
if hasattr(asyncio, "create_task"):
task = asyncio.create_task(coro)
if name is not None and hasattr(task, "set_name"):
task.set_name(name)
return task
else:... | 0 | 0 | 873 | 0 | 0 | 0 | 0 | -5 | 44 |
8b7625b3720d9a32fa52c5dda0bde360831f2813 | 1,588 | py | Python | SIDUS/plot_metrology.py | ltaulell/HPC_toolset | 98a64aeb513fb9a99d0f085dab14b2b904c10545 | [
"BSD-2-Clause",
"CECILL-B"
] | null | null | null | SIDUS/plot_metrology.py | ltaulell/HPC_toolset | 98a64aeb513fb9a99d0f085dab14b2b904c10545 | [
"BSD-2-Clause",
"CECILL-B"
] | 3 | 2020-02-21T11:17:54.000Z | 2020-11-16T16:50:46.000Z | SIDUS/plot_metrology.py | ltaulell/HPC_toolset | 98a64aeb513fb9a99d0f085dab14b2b904c10545 | [
"BSD-2-Clause",
"CECILL-B"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
#
# $Id: plot_metrology.py 2937 2020-06-19 13:04:13Z ltaulell $
# SPDX-License-Identifier: BSD-2-Clause
#
"""
POC/training
graph metrology from CSV file (using test_ipmitool.py)
"""
import argparse
# import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import... | 24.8125 | 99 | 0.618388 | #!/usr/bin/env python3
# coding: utf-8
#
# $Id: plot_metrology.py 2937 2020-06-19 13:04:13Z ltaulell $
# SPDX-License-Identifier: BSD-2-Clause
#
"""
POC/training
graph metrology from CSV file (using test_ipmitool.py)
"""
import argparse
# import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
786b63f235b6c880b1df42dddebfc0d6861aaa8a | 1,200 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler067.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 5 | 2021-06-02T23:44:25.000Z | 2021-12-27T16:21:57.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler067.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 22 | 2021-05-31T01:33:25.000Z | 2021-10-18T18:32:39.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/projecteuler/euler067.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 3 | 2021-06-19T03:37:47.000Z | 2021-08-31T00:49:51.000Z | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
"""
Solution to Project Euler Problem 67
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
By starting at the top of the triangle below and moving to adjacent numbers on
the row below, the... | 26.086957 | 78 | 0.721667 | #!/usr/bin/env python
# -*- encoding:utf-8 -*-
"""
Solution to Project Euler Problem 67
http://projecteuler.net/
by Apalala <apalala@gmail.com>
(cc) Attribution-ShareAlike
http://creativecommons.org/licenses/by-sa/3.0/
By starting at the top of the triangle below and moving to adjacent numbers on
the row below, the... | 0 | 0 | 0 | 0 | 0 | 10 | 0 | 0 | 23 |
84f1020eb1307e6295ae89e337934a6be6b93af8 | 1,151 | py | Python | csgm/mnist_vae/src/data_input.py | zbaoye/progressive_growing_of_gans_tensorflow | 7eefe325e40c7af4462d53836d0cf11511c58c41 | [
"MIT"
] | null | null | null | csgm/mnist_vae/src/data_input.py | zbaoye/progressive_growing_of_gans_tensorflow | 7eefe325e40c7af4462d53836d0cf11511c58c41 | [
"MIT"
] | null | null | null | csgm/mnist_vae/src/data_input.py | zbaoye/progressive_growing_of_gans_tensorflow | 7eefe325e40c7af4462d53836d0cf11511c58c41 | [
"MIT"
] | null | null | null | # Get input
| 41.107143 | 80 | 0.728931 | # Get input
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
def mnist_data_iteratior():
mnist = input_data.read_data_sets('./data/mnist', one_hot=True)
def iterator(hparams, num_batches):
for _ in range(num_batches):
yield mnist.train.next_batch(hparams.ba... | 0 | 0 | 0 | 0 | 232 | 776 | 0 | 39 | 90 |
848c3c4a87fdc3eb5ab21320b58250e49e002066 | 1,619 | py | Python | djsapo/bin/email_test.py | carthage-college/django-djsapo | 10bfec5974bca9ebb70aeb7e4e122ae31a328e7e | [
"MIT"
] | null | null | null | djsapo/bin/email_test.py | carthage-college/django-djsapo | 10bfec5974bca9ebb70aeb7e4e122ae31a328e7e | [
"MIT"
] | 9 | 2019-12-05T16:32:08.000Z | 2021-06-18T20:51:19.000Z | djsapo/bin/email_test.py | carthage-college/django-djsapo | 10bfec5974bca9ebb70aeb7e4e122ae31a328e7e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os, sys
# env
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djsapo.settings.shell')
# required if using django models
import django
django.setup()
from django.conf import settings
from django.contrib.auth.models import User
from djsapo.core.models import Alert
import argparse
'''
... | 19.987654 | 72 | 0.644842 | # -*- coding: utf-8 -*-
import os, sys
# env
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djsapo.settings.shell')
# required if using django models
import django
django.setup()
from django.conf import settings
from django.contrib.auth.models import Group, User
from djsapo.core.models import Alert
import argpars... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 |
102131255362b6e0fe997debf07791f2550f3d08 | 204 | py | Python | Strings/RecursiveReversion.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 12 | 2021-06-18T16:24:27.000Z | 2021-11-04T03:30:00.000Z | Strings/RecursiveReversion.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 32 | 2021-10-01T07:15:00.000Z | 2021-11-05T15:35:53.000Z | Strings/RecursiveReversion.py | Saicharan67/Interview-Coding-Questions | b28cccd41e380f15b833039d687931570908adfb | [
"MIT"
] | 21 | 2021-09-29T09:16:31.000Z | 2021-10-30T10:06:21.000Z | """
Given an string print the reverse of the string using recursion
"""
print(recurr('saicharan'))
| 13.6 | 63 | 0.573529 | """
Given an string print the reverse of the string using recursion
"""
def recurr(s):
if len(s) == 1:
return s
else:
return s[-1] + recurr(s[:-1])
print(recurr('saicharan'))
| 0 | 0 | 0 | 0 | 0 | 78 | 0 | 0 | 23 |
7c9397f35596cb83395a3b0dbdd756b45283c642 | 3,657 | py | Python | test/main_util_test.py | bgruening/pulsar | 272812e88606e7e3e4cab2d0a82c9d2e1e693f05 | [
"Apache-2.0"
] | 1 | 2021-05-18T02:27:00.000Z | 2021-05-18T02:27:00.000Z | test/main_util_test.py | bgruening/pulsar | 272812e88606e7e3e4cab2d0a82c9d2e1e693f05 | [
"Apache-2.0"
] | null | null | null | test/main_util_test.py | bgruening/pulsar | 272812e88606e7e3e4cab2d0a82c9d2e1e693f05 | [
"Apache-2.0"
] | null | null | null | """ Test utilities in pulsar.main """
| 35.852941 | 127 | 0.684167 | """ Test utilities in pulsar.main """
from os.path import join
from .test_utils import temp_directory
from pulsar import main
def test_pulsar_config_builder_defaults():
with temp_directory() as mock_root:
__write_mock_ini(join(mock_root, "server.ini"))
config = main.PulsarConfigBuilder(config_dir=... | 0 | 0 | 0 | 160 | 0 | 3,083 | 0 | 22 | 342 |
3f7557e5944d673e825fed2ae509834f825f0cca | 240 | py | Python | abstar/assigners/__init__.py | gfinak/abstar | dde92f8cd8ddda84e98b53062fc39a7d103d9fba | [
"MIT"
] | 30 | 2016-05-20T13:45:15.000Z | 2022-03-29T08:16:03.000Z | abstar/assigners/__init__.py | shulp2211/abstar | 9641ccfb792f72cc8cdd8a59ae2d43bc3620d38a | [
"MIT"
] | 14 | 2016-02-26T03:38:40.000Z | 2021-01-27T16:59:57.000Z | abstar/assigners/__init__.py | shulp2211/abstar | 9641ccfb792f72cc8cdd8a59ae2d43bc3620d38a | [
"MIT"
] | 13 | 2017-02-25T06:38:51.000Z | 2022-01-27T21:28:18.000Z | from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__) + "/*.py")
modules = [basename(f)[:-3] for f in modules if all([isfile(f), f not in ['__init__', 'assigner', 'registry']])]
__all__ = modules
| 30 | 112 | 0.6875 | from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__) + "/*.py")
modules = [basename(f)[:-3] for f in modules if all([isfile(f), f not in ['__init__', 'assigner', 'registry']])]
__all__ = modules
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
995d3f92ed6d221cd13a66953fc427f2efd7e679 | 6,258 | py | Python | officeslotbooking/settings.py | penghouho/officeslotbooking | 4df19e70a827109909664819c619cd6b9c767466 | [
"MIT"
] | null | null | null | officeslotbooking/settings.py | penghouho/officeslotbooking | 4df19e70a827109909664819c619cd6b9c767466 | [
"MIT"
] | 1 | 2021-11-08T04:39:47.000Z | 2021-11-08T05:38:40.000Z | officeslotbooking/settings.py | penghouho/officeslotbooking | 4df19e70a827109909664819c619cd6b9c767466 | [
"MIT"
] | null | null | null | """
Django settings for officeslotbooking project.
Generated by 'django-admin startproject' using Django 3.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
im... | 28.972222 | 106 | 0.669863 | """
Django settings for officeslotbooking project.
Generated by 'django-admin startproject' using Django 3.2.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
im... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77f215dbaa5a8c066017acfe18fa20d51b10d5ad | 668 | py | Python | Fast Speedy/long_fast_speedy.py | killua4564/2019-Crypto-CTF | f465601f3088222822d27f8135da39cd930c98bb | [
"MIT"
] | 2 | 2020-10-30T13:45:11.000Z | 2020-11-05T22:34:19.000Z | Fast Speedy/long_fast_speedy.py | killua4564/2019-Crypto-CTF | f465601f3088222822d27f8135da39cd930c98bb | [
"MIT"
] | 3 | 2021-05-20T22:29:47.000Z | 2022-01-13T10:03:41.000Z | Fast Speedy/long_fast_speedy.py | killua4564/2019-Crypto-CTF | f465601f3088222822d27f8135da39cd930c98bb | [
"MIT"
] | 3 | 2021-08-14T07:15:51.000Z | 2021-11-08T08:34:51.000Z | #!/usr/bin/env python
import random
flag = open('flag.png', 'r').read()
flag = bin(int(flag.encode('hex'), 16))[2:]
r = random.randint(7, 128)
s = random.randint(2, r)
R = [random.randint(0, 1) for _ in xrange(r)]
B = [i for i in xrange(s)]
random.shuffle(B)
A, enc = [], []
for i in range(len(flag)):
ans, R = d... | 20.875 | 45 | 0.549401 | #!/usr/bin/env python
import random
from Crypto.Util.number import *
def drift(R, B):
n = len(B)
ans, ini = R[-1], 0
for i in B:
ini ^= R[i-1]
R = [ini] + R[:-1]
return ans, R
flag = open('flag.png', 'r').read()
flag = bin(int(flag.encode('hex'), 16))[2:]
r = random.randint(7, 128)
s = r... | 0 | 0 | 0 | 0 | 0 | 113 | 0 | 11 | 45 |
c044851dfdbedf98e304f66576a299f352901e15 | 1,358 | py | Python | app/provider/base.py | antrix/oohembed | 9a44bdd073707f1aeb005c483d1a4fb48aed3c04 | [
"BSD-3-Clause"
] | 7 | 2016-05-08T22:32:57.000Z | 2019-07-16T09:54:45.000Z | app/provider/base.py | antrix/oohembed | 9a44bdd073707f1aeb005c483d1a4fb48aed3c04 | [
"BSD-3-Clause"
] | null | null | null | app/provider/base.py | antrix/oohembed | 9a44bdd073707f1aeb005c483d1a4fb48aed3c04 | [
"BSD-3-Clause"
] | 2 | 2017-01-22T14:43:33.000Z | 2020-11-02T14:35:19.000Z |
"""Plugin infrastructure based on Marty Alchin's post at
http://gulopine.gamemusic.org/2008/jan/10/simple-plugin-framework/
"""
| 37.722222 | 85 | 0.627393 | import re
from google.appengine.api import urlfetch
"""Plugin infrastructure based on Marty Alchin's post at
http://gulopine.gamemusic.org/2008/jan/10/simple-plugin-framework/
"""
class ProviderMount(type):
def __init__(cls, name, bases, attrs):
if not hasattr(cls, 'plugins'):
cls.plugins = []
... | 0 | 0 | 0 | 1,131 | 0 | 0 | 0 | 8 | 89 |
ac22f7961f7d41c0e7eed864fc289f7d9a486a59 | 2,016 | py | Python | luupsmap/cli/data.py | Team-LANS/luups-map | f9d5dddee86d9141dd6e2ae071c8e6fa37f376f2 | [
"MIT"
] | 1 | 2019-07-30T17:13:41.000Z | 2019-07-30T17:13:41.000Z | luupsmap/cli/data.py | Team-LANS/luups-map | f9d5dddee86d9141dd6e2ae071c8e6fa37f376f2 | [
"MIT"
] | 15 | 2019-02-09T13:27:18.000Z | 2019-04-01T21:18:52.000Z | luupsmap/cli/data.py | Team-LANS/luups-map | f9d5dddee86d9141dd6e2ae071c8e6fa37f376f2 | [
"MIT"
] | null | null | null |
from flask.cli import AppGroup
from luupsmap import app
LINE_LENGTH = 25
data = AppGroup('data')
# noinspection SqlWithoutWhere
app.cli.add_command(data)
| 27.243243 | 86 | 0.689484 | import os
from flask.cli import AppGroup, with_appcontext
from luupsmap.cli.commands import SeedCommand, UpdateCommand
from luupsmap import app, db
from luupsmap.model import Venue, Location, Voucher, VoucherType, VoucherTag, Interval
LINE_LENGTH = 25
data = AppGroup('data')
@data.command('seed')
@with_appcontext... | 0 | 775 | 0 | 0 | 0 | 759 | 0 | 113 | 204 |
73ad935350e2ef2fc665e894630fff7671d00a20 | 304 | py | Python | yapftests/huawei/huaweistyle/non_standard_resourses/paragraph_2/2_2_a_function_description_incorrect_.py | akuleshov7/huawei-yapf | 72c188257e2bafa4da9e553ba0ee9b86831c51b8 | [
"Apache-2.0"
] | 12 | 2020-04-24T18:12:08.000Z | 2021-06-09T16:53:10.000Z | yapftests/huawei/huaweistyle/non_standard_resourses/paragraph_2/2_2_a_function_description_incorrect_.py | akuleshov7/h-yapf | 72c188257e2bafa4da9e553ba0ee9b86831c51b8 | [
"Apache-2.0"
] | 1 | 2020-09-09T19:55:35.000Z | 2020-09-14T00:07:29.000Z | yapftests/huawei/huaweistyle/non_standard_resourses/paragraph_2/2_2_a_function_description_incorrect_.py | akuleshov7/h-yapf | 72c188257e2bafa4da9e553ba0ee9b86831c51b8 | [
"Apache-2.0"
] | null | null | null | # these fields should be described in function
# Function Description:
# Parameter:
# Return
# Value:
# Exception Description:
# Change History:
def some_method(some):
"""
This is some incorrect description, but it does not have 3 proper fields, we should raise warning for this method
"""
| 21.714286 | 117 | 0.723684 | # these fields should be described in function
# Function Description:
# Parameter:
# Return
# Value:
# Exception Description:
# Change History:
def some_method(some):
"""
This is some incorrect description, but it does not have 3 proper fields, we should raise warning for this method
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c399796d871ea7e135a82952eaea2addc76e5c2d | 449 | py | Python | config/wsgi.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 5 | 2017-05-05T12:52:58.000Z | 2021-03-04T20:39:30.000Z | config/wsgi.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 4 | 2020-01-31T09:02:57.000Z | 2021-04-20T14:04:35.000Z | config/wsgi.py | ISI-MIP/isimip | c2a78c727337e38f3695031e00afd607da7d6dcb | [
"MIT"
] | 4 | 2017-10-12T01:48:55.000Z | 2020-04-29T13:50:03.000Z | import os
from django.core.wsgi import get_wsgi_application
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
application = get_wsgi_application()
# if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settin... | 37.416667 | 79 | 0.792873 | import os
from django.core.wsgi import get_wsgi_application
if os.environ.get("DJANGO_SETTINGS_MODULE") == "config.settings.production":
from raven.contrib.django.raven_compat.middleware.wsgi import Sentry
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production")
application = get_wsgi_appli... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 47 | 26 |
4d639cac8375e225165044bed5b27738f8208633 | 2,386 | py | Python | django_dbfs/migrations/0001_initial.py | misli/django-dbfs | 068a38d1844edaad9d524c9f084ff60c667549de | [
"BSD-3-Clause"
] | 1 | 2018-07-31T02:26:28.000Z | 2018-07-31T02:26:28.000Z | django_dbfs/migrations/0001_initial.py | misli/django-dbfs | 068a38d1844edaad9d524c9f084ff60c667549de | [
"BSD-3-Clause"
] | null | null | null | django_dbfs/migrations/0001_initial.py | misli/django-dbfs | 068a38d1844edaad9d524c9f084ff60c667549de | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-11 11:59
from __future__ import unicode_literals
| 38.483871 | 154 | 0.566639 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-11 11:59
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Create... | 0 | 0 | 0 | 2,176 | 0 | 0 | 0 | 30 | 68 |
7278526d7812157c333ec5bd2be99fe477a2b220 | 1,584 | py | Python | src/sima/simo/blueprints/positioningelement.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/blueprints/positioningelement.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | src/sima/simo/blueprints/positioningelement.py | SINTEF/simapy | 650b8c2f15503dad98e2bfc0d0788509593822c7 | [
"MIT"
] | null | null | null | #
# Generated with PositioningElementBlueprint | 68.869565 | 294 | 0.758838 | #
# Generated with PositioningElementBlueprint
from dmt.blueprint import Blueprint
from dmt.dimension import Dimension
from dmt.attribute import Attribute
from dmt.enum_attribute import EnumAttribute
from dmt.blueprint_attribute import BlueprintAttribute
from sima.sima.blueprints.namedobject import NamedObjectBlueprin... | 0 | 0 | 0 | 1,240 | 0 | 0 | 0 | 142 | 155 |
8837532c41c987f6dcb59bd47e50590c508634f3 | 4,441 | py | Python | tests/test_axis.py | drizztguen77/PTHat | f46d05054875599e80b396f74bc5a348cfcefbfb | [
"Apache-2.0"
] | 5 | 2021-01-28T13:26:08.000Z | 2022-02-24T08:15:44.000Z | tests/test_axis.py | drizztguen77/PTHat | f46d05054875599e80b396f74bc5a348cfcefbfb | [
"Apache-2.0"
] | null | null | null | tests/test_axis.py | drizztguen77/PTHat | f46d05054875599e80b396f74bc5a348cfcefbfb | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 38.617391 | 107 | 0.721234 | import unittest
from pthat.pthat import Axis
class TestAxis(unittest.TestCase):
def setUp(self):
self.axis = Axis("X", command_type="I", command_id=0, test_mode=True)
self.axis.debug = True
self.axis.frequency = 125000.0
self.axis.pulse_count = 4294967295
self.axis.directi... | 0 | 0 | 0 | 4,323 | 0 | 0 | 0 | 7 | 45 |
9f347ca3adef938f3b3139329577bc81a82316d6 | 17,836 | py | Python | termrss.py | JustADataConstruct/TermRSS | 24f14f20c599f4cc77b52f53b040a96317b985f1 | [
"MIT"
] | 1 | 2021-11-10T10:54:43.000Z | 2021-11-10T10:54:43.000Z | termrss.py | JustADataConstruct/TermRSS | 24f14f20c599f4cc77b52f53b040a96317b985f1 | [
"MIT"
] | null | null | null | termrss.py | JustADataConstruct/TermRSS | 24f14f20c599f4cc77b52f53b040a96317b985f1 | [
"MIT"
] | null | null | null |
TermRSS() | 44.59 | 216 | 0.565822 | import feedparser
import listparser
import json
import argparse
from bs4 import BeautifulSoup
from datetime import datetime
import subprocess as sp
import time
import schedule
import os
import tempfile
from output_helper import OutputHelper
from cache_helper import CacheHelper
class TermRSS():
def __init__(sel... | 0 | 0 | 0 | 17,523 | 0 | 0 | 0 | -8 | 310 |
3e0c660a16f5cea89d214aab4c91f2c01f910a43 | 1,266 | py | Python | bulk_freq_timeline/rgmo_detector.py | nagasudhirpulla/python_freq_analysis | 187dc59f077a1b89a5318b00089e2d20289f15fb | [
"MIT"
] | null | null | null | bulk_freq_timeline/rgmo_detector.py | nagasudhirpulla/python_freq_analysis | 187dc59f077a1b89a5318b00089e2d20289f15fb | [
"MIT"
] | null | null | null | bulk_freq_timeline/rgmo_detector.py | nagasudhirpulla/python_freq_analysis | 187dc59f077a1b89a5318b00089e2d20289f15fb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 30 19:45:21 2018
@author: Nagasudhir
https://stackoverflow.com/questions/10138085/python-pylab-plot-normal-distribution
We are going to create a timeline with x axis as date and
y axis as the scatter plot of the timestamps where the change in freq is greater than a thre... | 35.166667 | 103 | 0.700632 | # -*- coding: utf-8 -*-
"""
Created on Sat Jun 30 19:45:21 2018
@author: Nagasudhir
https://stackoverflow.com/questions/10138085/python-pylab-plot-normal-distribution
We are going to create a timeline with x axis as date and
y axis as the scatter plot of the timestamps where the change in freq is greater than a thre... | 0 | 0 | 0 | 0 | 0 | 822 | 0 | -3 | 44 |
12f33c51386b18317ece5051749dc136e2beaf1e | 2,230 | py | Python | scripts/v3_12_2_fid_noiseless.py | adiraju21s/deep_dss | 360a08f5da38fdb7af9a8534702cc711b66a4343 | [
"MIT"
] | null | null | null | scripts/v3_12_2_fid_noiseless.py | adiraju21s/deep_dss | 360a08f5da38fdb7af9a8534702cc711b66a4343 | [
"MIT"
] | 1 | 2020-07-12T00:58:25.000Z | 2020-07-12T03:16:34.000Z | scripts/v3_12_2_fid_noiseless.py | adiraju21s/deep_dss | 360a08f5da38fdb7af9a8534702cc711b66a4343 | [
"MIT"
] | null | null | null | import os
import sys
# Run on GPU.
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
config = sys.argv[1]
channels = total_channels(config)
order = 2
lr = float(sys.argv[2])
num_epochs = int(sys.argv[3])
gaussian = sys.argv[4]
train_on_dataset("Q1")
train_on_dataset("Q2", reload=True)
train_on_dataset("Q3", reload=True)
... | 35.396825 | 110 | 0.589238 | import os
import sys
from deep_dss.helpers import *
from deep_dss.models import *
import numpy as np
from deepsphere.data import LabeledDataset
# Run on GPU.
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def total_channels(c):
if c[0] == "c":
return 1 + lensing_channels(c[1:])
return lensing_channels(c)... | 0 | 0 | 0 | 0 | 0 | 1,703 | 0 | 35 | 136 |
cabc04fde0f9b8ca5a581d45a7b737805c18d3de | 1,677 | py | Python | test_version.py | DocSavage/clio-store-py | 9019adc9b008c7f94e4bcf7e832eb9fe93e0d925 | [
"Apache-2.0"
] | null | null | null | test_version.py | DocSavage/clio-store-py | 9019adc9b008c7f94e4bcf7e832eb9fe93e0d925 | [
"Apache-2.0"
] | null | null | null | test_version.py | DocSavage/clio-store-py | 9019adc9b008c7f94e4bcf7e832eb9fe93e0d925 | [
"Apache-2.0"
] | null | null | null | data = [
{'v': 'v0.1', 't': 1391},
{'v': 'v0.1', 't': 1394},
{'v': 'v0.1', 't': 1300},
{'v': 'v0.1', 't': 1321},
{'v': 'v0.1.3', 't': 1491},
{'v': 'v0.1.3', 't': 1494},
{'v': 'v0.1.3', 't': 1400},
{'v': 'v0.1.3', 't': 1421},
{'v': 'v0.1.2', 't': 1291},
{'v': 'v0.1.2', 't': 1294},... | 29.946429 | 113 | 0.444842 | data = [
{'v': 'v0.1', 't': 1391},
{'v': 'v0.1', 't': 1394},
{'v': 'v0.1', 't': 1300},
{'v': 'v0.1', 't': 1321},
{'v': 'v0.1.3', 't': 1491},
{'v': 'v0.1.3', 't': 1494},
{'v': 'v0.1.3', 't': 1400},
{'v': 'v0.1.3', 't': 1421},
{'v': 'v0.1.2', 't': 1291},
{'v': 'v0.1.2', 't': 1294},... | 0 | 0 | 0 | 0 | 0 | 791 | 0 | 0 | 23 |
9f0149379e19026be2239442d7f7b964d2e0df97 | 2,372 | py | Python | learning_journal/views/default.py | nosrac77/pyramid-learning-journal | 2e158ab01a7f4b6b978ac0d3f0695df73570dd2f | [
"MIT"
] | null | null | null | learning_journal/views/default.py | nosrac77/pyramid-learning-journal | 2e158ab01a7f4b6b978ac0d3f0695df73570dd2f | [
"MIT"
] | 3 | 2019-12-26T16:38:52.000Z | 2021-06-01T21:52:31.000Z | learning_journal/views/default.py | nosrac77/pyramid-learning-journal | 2e158ab01a7f4b6b978ac0d3f0695df73570dd2f | [
"MIT"
] | null | null | null | """Module that contains callable server functions."""
| 32.944444 | 93 | 0.645025 | """Module that contains callable server functions."""
from pyramid.view import view_config
from learning_journal.models.mymodel import Entry
@view_config(route_name="home", renderer="learning_journal:templates/journal_entries.jinja2")
def list_view(request):
"""Function that generates list of journal entries."""
... | 0 | 2,135 | 0 | 0 | 0 | 0 | 0 | 43 | 136 |
961a6d0fc35b5775ed5a3d3cc7a87b7e082f7f5a | 5,636 | py | Python | utils/network/delete_overlap_network_detections.py | claraeyoon/FAST | 2c3c427b03b138cebe062ca90a6000e8d5c726c7 | [
"Apache-2.0"
] | 126 | 2018-06-01T00:56:06.000Z | 2022-03-22T19:42:11.000Z | utils/network/delete_overlap_network_detections.py | stanford-futuredata/quake | 2c3c427b03b138cebe062ca90a6000e8d5c726c7 | [
"Apache-2.0"
] | 15 | 2020-02-16T14:02:55.000Z | 2022-02-17T21:41:39.000Z | utils/network/delete_overlap_network_detections.py | vishalbelsare/FAST | 2c3c427b03b138cebe062ca90a6000e8d5c726c7 | [
"Apache-2.0"
] | 53 | 2018-06-14T16:42:06.000Z | 2022-02-17T21:02:19.000Z |
# ---------------------------------------------------INPUTS --------------------------------------------
input_dir = '../../data/network_detection/'
allfile_name = input_dir+'uniquestart_sorted_no_duplicates.txt'
outfile_name = input_dir+'7sta_2stathresh_FinalUniqueNetworkDetectionTimes.txt'
n_sta = 7
#input_dir = '/... | 45.821138 | 152 | 0.678141 | import numpy as np
# ---------------------------------------------------INPUTS --------------------------------------------
input_dir = '../../data/network_detection/'
allfile_name = input_dir+'uniquestart_sorted_no_duplicates.txt'
outfile_name = input_dir+'7sta_2stathresh_FinalUniqueNetworkDetectionTimes.txt'
n_sta =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
8e050776e4f764a50279ba086eb6740e4e08aabb | 2,216 | py | Python | python/leetcode/101. Symmetric Tree.py | yandong2023/The-sword-pointing-to-offer-code | bb7b43222c8f0dac72a31dae8484eb333aca72c1 | [
"Apache-2.0"
] | 2 | 2021-07-05T23:00:12.000Z | 2021-07-07T02:37:23.000Z | python/leetcode/101. Symmetric Tree.py | yandong2023/leetcode-Top | 0df7974e073a39a88898431ac6fd873c6d04804f | [
"Apache-2.0"
] | null | null | null | python/leetcode/101. Symmetric Tree.py | yandong2023/leetcode-Top | 0df7974e073a39a88898431ac6fd873c6d04804f | [
"Apache-2.0"
] | null | null | null | '''
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1
/ \
2 2
/ \ / \
3 4 4 3
But the following [1,2,2,null,3,null,3] is not:
1
/ \
2 2
\ \
3 3
'''
| 29.157895 | 115 | 0.498646 | '''
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).
For example, this binary tree [1,2,2,3,4,4,3] is symmetric:
1
/ \
2 2
/ \ / \
3 4 4 3
But the following [1,2,2,null,3,null,3] is not:
1
/ \
2 2
\ \
3 3
'''
class TreeNode(object):
... | 0 | 0 | 0 | 1,876 | 0 | 0 | 0 | 0 | 46 |
4ad08a3aa1d84a5353034303135ba6c87a8596bf | 3,215 | py | Python | implicit/datasets/lastfm.py | bingxu01/implicit | 91215f1c278dd8ed455dd0dcff707af86f59371f | [
"MIT"
] | 2,824 | 2016-04-17T16:21:59.000Z | 2022-03-31T17:58:10.000Z | implicit/datasets/lastfm.py | bingxu01/implicit | 91215f1c278dd8ed455dd0dcff707af86f59371f | [
"MIT"
] | 448 | 2016-06-20T14:28:00.000Z | 2022-03-29T23:07:25.000Z | implicit/datasets/lastfm.py | bingxu01/implicit | 91215f1c278dd8ed455dd0dcff707af86f59371f | [
"MIT"
] | 614 | 2016-05-03T18:35:32.000Z | 2022-03-27T20:00:01.000Z | import logging
import os
import time
import h5py
import numpy as np
from scipy.sparse import csr_matrix
from implicit.datasets import _download
log = logging.getLogger("implicit")
URL = "https://github.com/benfred/recommender_data/releases/download/v1.0/lastfm_360k.hdf5"
def get_lastfm():
"""Returns the last... | 33.842105 | 91 | 0.671229 | import logging
import os
import time
import h5py
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from implicit.datasets import _download
log = logging.getLogger("implicit")
URL = "https://github.com/benfred/recommender_data/releases/download/v1.0/lastfm_360k.hdf5"
def get_lastfm():
"""Retu... | 0 | 0 | 0 | 0 | 0 | 841 | 0 | 12 | 23 |
6a5f2161da7b4ece426a661b7764a51b782e2dea | 27,375 | py | Python | tests/unit/task/processing/test_charts.py | amit0701/rally | 1da36daea703d05fa1227c2e3675e08663e83726 | [
"Apache-2.0"
] | null | null | null | tests/unit/task/processing/test_charts.py | amit0701/rally | 1da36daea703d05fa1227c2e3675e08663e83726 | [
"Apache-2.0"
] | null | null | null | tests/unit/task/processing/test_charts.py | amit0701/rally | 1da36daea703d05fa1227c2e3675e08663e83726 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 43.314873 | 79 | 0.490119 | # Copyright 2015: Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 0 | 10,871 | 0 | 14,901 | 0 | 153 | 0 | 34 | 525 |
3719d1515231b23b202e7dbedbe2377708be7c19 | 3,868 | py | Python | bot.py | rihp/boteki | bc66e89202d8e17b8f1f1bacfb6173c7f9c1a72c | [
"MIT"
] | 1 | 2021-03-05T11:58:27.000Z | 2021-03-05T11:58:27.000Z | bot.py | rihp/boteki | bc66e89202d8e17b8f1f1bacfb6173c7f9c1a72c | [
"MIT"
] | null | null | null | bot.py | rihp/boteki | bc66e89202d8e17b8f1f1bacfb6173c7f9c1a72c | [
"MIT"
] | 1 | 2021-03-05T14:58:25.000Z | 2021-03-05T14:58:25.000Z | import os
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
bot = commands.Bot(command_prefix='!')
bot.run(TOKEN) | 37.192308 | 182 | 0.666494 | import os, asyncio
import config, mongo, tweetClient, democratic
import discord
from discord.ext import commands
from dotenv import load_dotenv
from datetime import datetime
load_dotenv()
TOKEN = os.getenv('DISCORD_TOKEN')
bot = commands.Bot(command_prefix='!')
@bot.command(name='plznuke')
async def validateTweets(c... | 14 | 3,503 | 0 | 0 | 0 | 0 | 0 | 34 | 139 |
51e986c7b69e205f52c16ebb9e3239fa0145fd0e | 454 | py | Python | utility.py | xiphmont/rd_tool | 829bd1f59fe2256e7df84073c0911aea92061e53 | [
"BSD-2-Clause"
] | 8 | 2016-05-09T11:22:32.000Z | 2019-05-24T04:23:14.000Z | utility.py | xiphmont/rd_tool | 829bd1f59fe2256e7df84073c0911aea92061e53 | [
"BSD-2-Clause"
] | 19 | 2020-03-27T18:44:00.000Z | 2022-01-31T20:56:36.000Z | utility.py | xiphmont/rd_tool | 829bd1f59fe2256e7df84073c0911aea92061e53 | [
"BSD-2-Clause"
] | 17 | 2015-02-05T22:02:59.000Z | 2019-07-21T04:40:19.000Z | #!/usr/bin/env python3
#our timestamping function, accurate to milliseconds
#(remove [:-3] to display microseconds)
| 25.222222 | 68 | 0.618943 | #!/usr/bin/env python3
from datetime import datetime
import sys
#our timestamping function, accurate to milliseconds
#(remove [:-3] to display microseconds)
def get_time():
return datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
def rd_print(log, *args, **kwargs):
print(get_time(), *args, flush=True, **k... | 0 | 0 | 0 | 0 | 0 | 250 | 0 | -3 | 90 |
0ff58aa5638eed1c736fbbad2273b0906b11a83c | 217 | py | Python | frappe/website/doctype/blog_post/test_blog_post.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | null | null | null | frappe/website/doctype/blog_post/test_blog_post.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | 7 | 2020-03-24T17:07:47.000Z | 2022-03-11T23:49:25.000Z | frappe/website/doctype/blog_post/test_blog_post.py | khatrijitendra/lumalock-frappe | b3864278dad21dde5c53604be65aa56c79e5d909 | [
"MIT"
] | 5 | 2016-11-12T12:14:58.000Z | 2018-03-21T15:45:45.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
| 21.7 | 68 | 0.806452 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestBlogPost(unittest.TestCase):
pass
| 0 | 0 | 0 | 23 | 0 | 0 | 0 | -14 | 67 |
01dc9bd4833cecc37503b24642c91d1c92bd4981 | 7,175 | py | Python | LinModel/LinSVM.py | L-F-A/Machine-Learning | b9472544e06fc91606c0d1a609c23e22ba30cf18 | [
"MIT"
] | null | null | null | LinModel/LinSVM.py | L-F-A/Machine-Learning | b9472544e06fc91606c0d1a609c23e22ba30cf18 | [
"MIT"
] | null | null | null | LinModel/LinSVM.py | L-F-A/Machine-Learning | b9472544e06fc91606c0d1a609c23e22ba30cf18 | [
"MIT"
] | null | null | null | #The svm class uses the package CVXOPT, Python Software for Convex Optimization, that is not part of the standard python,
#but is included in Anaconda for example.
#Everything else is imported locally when needed
#########################################################################################################... | 46.590909 | 122 | 0.51108 | #The svm class uses the package CVXOPT, Python Software for Convex Optimization, that is not part of the standard python,
#but is included in Anaconda for example.
import numpy as np
import warnings
#Everything else is imported locally when needed
class SVMClass:
#####################################################... | 0 | 0 | 0 | 6,779 | 0 | 0 | 0 | -9 | 67 |
cd20ee059549230f5f7ea23b36d332bf4b62be05 | 220 | py | Python | exercicios/Lista3/Q5.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista3/Q5.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | exercicios/Lista3/Q5.py | AlexandrePeBrito/CursoUdemyPython | 3de58cb30c9f333b32078309847179ff3f9d7e22 | [
"MIT"
] | null | null | null | #Faa um programa que pea ao usurio para digitar 10
#valores e some-os.
valores=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
valores.append(n)
print(f"A somas dos valores eh {sum(valores)}") | 22 | 54 | 0.681818 | #Faça um programa que peça ao usuário para digitar 10
#valores e some-os.
valores=[]
for c in range(0,10):
n=int(input("Informe um numero: "))
valores.append(n)
print(f"A somas dos valores eh {sum(valores)}") | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
539fb97b9f9d47048ae21ac62faac2c26ea51c4b | 1,363 | py | Python | sdss/sdss_name.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 460 | 2015-01-06T13:20:04.000Z | 2022-03-29T00:37:55.000Z | sdss/sdss_name.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 208 | 2015-01-08T20:26:38.000Z | 2022-03-25T15:21:34.000Z | sdss/sdss_name.py | juandesant/astrometry.net | 47849f0443b890c4a875360f881d2e60d1cba630 | [
"Net-SNMP",
"Xnet"
] | 173 | 2015-01-08T18:01:54.000Z | 2022-03-27T07:27:04.000Z | from starutil_numpy import ra2hms, dec2dms
# RA,Dec in degrees
def sdss_name(ra, dec):
'''
Returns the SDSS name, JHHMMSS.ss+DDMMSS.s
>>> print sdss_name(15, 1)
J010000.00+010000.0
>>> print sdss_name(0, 0)
J000000.00+000000.0
>>> print sdss_name(0, 1./3600)
J000000.00+000001.0
... | 22.344262 | 60 | 0.589142 | from starutil_numpy import ra2hms, dec2dms
# RA,Dec in degrees
def sdss_name(ra, dec):
'''
Returns the SDSS name, JHHMMSS.ss+DDMMSS.s
>>> print sdss_name(15, 1)
J010000.00+010000.0
>>> print sdss_name(0, 0)
J000000.00+000000.0
>>> print sdss_name(0, 1./3600)
J000000.00+000001.0
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |