hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 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 3 972 | max_forks_repo_name stringlengths 6 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bf4d1f70dca0eb371cea11ced7ad5e9c8cf764c4 | 1,731 | py | Python | app/user/serializers.py | Mwangik/recipe-app-api | 115b694fc358b183bfac6c6cb2f90a5a41cf8976 | [
"MIT"
] | null | null | null | app/user/serializers.py | Mwangik/recipe-app-api | 115b694fc358b183bfac6c6cb2f90a5a41cf8976 | [
"MIT"
] | null | null | null | app/user/serializers.py | Mwangik/recipe-app-api | 115b694fc358b183bfac6c6cb2f90a5a41cf8976 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model, authenticate
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
class UserSerializer(serializers.ModelSerializer):
"""serializers for the users objects """
class Meta:
model = get_user_model()
fields ... | 31.472727 | 74 | 0.646447 |
2351eb2890d9588f40a2c5f9b7e9be7f5f958c6e | 3,029 | py | Python | examples/tsm/infer.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | examples/tsm/infer.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | examples/tsm/infer.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.226804 | 78 | 0.685375 |
bd4c3f8153da3cf2dec931cdfc48e890723c24b7 | 1,966 | py | Python | app2.py | Ruslion/Predicting-loan-eligibility | abed6de78352dd2206c95b0c9d40e745a6509538 | [
"MIT"
] | null | null | null | app2.py | Ruslion/Predicting-loan-eligibility | abed6de78352dd2206c95b0c9d40e745a6509538 | [
"MIT"
] | null | null | null | app2.py | Ruslion/Predicting-loan-eligibility | abed6de78352dd2206c95b0c9d40e745a6509538 | [
"MIT"
] | null | null | null | # import Flask and jsonify
from flask import render_template, Flask, jsonify, request, make_response
# import Resource, Api and reqparser
from flask_restful import Resource, Api, reqparse
import pandas as pd
import numpy as np
import pickle
app = Flask(__name__)
api = Api(app)
with open('myfile.pickle', 'rb') as fi... | 33.322034 | 146 | 0.608342 |
67e591b60a85134872438e2cbf7259cab05524a2 | 638 | py | Python | layerindex/migrations/0039_comparison_sha256sum.py | ebrent8/clear-linux-dissector-web | 45f1f9b5a5753ab8b14ed3c99f1c9e68bb97a47c | [
"MIT"
] | 3 | 2019-05-12T21:11:53.000Z | 2019-09-15T18:11:21.000Z | layerindex/migrations/0039_comparison_sha256sum.py | ebrent8/clear-linux-dissector-web | 45f1f9b5a5753ab8b14ed3c99f1c9e68bb97a47c | [
"MIT"
] | 21 | 2019-06-26T05:01:01.000Z | 2022-03-11T23:47:21.000Z | layerindex/migrations/0039_comparison_sha256sum.py | ebrent8/clear-linux-dissector-web | 45f1f9b5a5753ab8b14ed3c99f1c9e68bb97a47c | [
"MIT"
] | 8 | 2019-06-13T08:51:12.000Z | 2021-02-17T11:14:46.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2019-04-03 12:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('layerindex', '0038_patch_striplevel'),
]
operations = [
migrations.AddFiel... | 24.538462 | 62 | 0.601881 |
5347ba5bc15420f957d7542bb3e5dc14d513e22b | 27,668 | py | Python | ocs_ci/ocs/cluster.py | mykaul/ocs-ci | fcce03d1062a3565733fcf304c2caa6073181376 | [
"MIT"
] | null | null | null | ocs_ci/ocs/cluster.py | mykaul/ocs-ci | fcce03d1062a3565733fcf304c2caa6073181376 | [
"MIT"
] | null | null | null | ocs_ci/ocs/cluster.py | mykaul/ocs-ci | fcce03d1062a3565733fcf304c2caa6073181376 | [
"MIT"
] | null | null | null | """
A module for all rook functionalities and abstractions.
This module has rook related classes, support for functionalities to work with
rook cluster. This works with assumptions that an OCP cluster is already
functional and proper configurations are made for interaction.
"""
import base64
import logging
import ran... | 33.135329 | 99 | 0.612296 |
4ac8b85ae9895e91df48bfb342da53c9745f1964 | 4,483 | py | Python | tests/util/test_ruamel_yaml.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2019-01-24T20:32:14.000Z | 2022-03-22T14:25:48.000Z | tests/util/test_ruamel_yaml.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 6 | 2021-02-08T21:02:40.000Z | 2022-03-12T00:52:16.000Z | tests/util/test_ruamel_yaml.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2016-08-26T12:32:49.000Z | 2020-02-26T21:01:35.000Z | """Test Home Assistant ruamel.yaml loader."""
import os
import unittest
from tempfile import mkdtemp
import pytest
from ruamel.yaml import YAML
from homeassistant.exceptions import HomeAssistantError
import homeassistant.util.ruamel_yaml as util_yaml
TEST_YAML_A = """\
title: My Awesome Home
# Include external reso... | 28.194969 | 74 | 0.627705 |
a6a9d7b90eb535e6e829e828cc2e02093a7a6c47 | 147 | py | Python | conjur/util/ssl_utils/__init__.py | cyberark/cyberark-conjur-cli | 2507e8769808643d89efa7e2496cfc14f505bd7e | [
"Apache-2.0"
] | null | null | null | conjur/util/ssl_utils/__init__.py | cyberark/cyberark-conjur-cli | 2507e8769808643d89efa7e2496cfc14f505bd7e | [
"Apache-2.0"
] | 2 | 2022-03-09T11:56:10.000Z | 2022-03-14T14:53:15.000Z | conjur/util/ssl_utils/__init__.py | cyberark/cyberark-conjur-cli | 2507e8769808643d89efa7e2496cfc14f505bd7e | [
"Apache-2.0"
] | null | null | null | """
Module holds the SSL utils of this project
"""
from conjur.util.ssl_utils.ssl_client import SSLClient
from conjur.util.ssl_utils import errors
| 24.5 | 54 | 0.802721 |
6f40082c43300d4b684d558d100407a894e940b0 | 614 | py | Python | scripts/auth_tool.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | scripts/auth_tool.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | scripts/auth_tool.py | shogo82148/JO_RI_bot | 653008faf8356a6c6e2b44f0154f646774aff79b | [
"MIT"
] | null | null | null | #!/usr/local/bin/python
# -*- coding: utf-8 -*-
import tweepy
if __name__ == "__main__":
consumer_key = raw_input('Your Consumer Key:')
consumer_secret = raw_input('Your Consumer Secret')
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
# ユーザにアプリケーションの許可を求めるためのURLを表示
print 'Please access this URL:... | 26.695652 | 77 | 0.713355 |
f63913853b67339f55a10be7ee00a42a23275d99 | 11,827 | py | Python | lisa/tests/staging/sched_android.py | Binse-Park/lisa_ARM | aa7767654c95bb2cc0a2dddecd5b82a7fcf5c746 | [
"Apache-2.0"
] | null | null | null | lisa/tests/staging/sched_android.py | Binse-Park/lisa_ARM | aa7767654c95bb2cc0a2dddecd5b82a7fcf5c746 | [
"Apache-2.0"
] | null | null | null | lisa/tests/staging/sched_android.py | Binse-Park/lisa_ARM | aa7767654c95bb2cc0a2dddecd5b82a7fcf5c746 | [
"Apache-2.0"
] | null | null | null | # SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019, Arm Limited and contributors.
#
# 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
#
# ... | 37.665605 | 130 | 0.660523 |
7b3a568bf35fe2a3e0d80d4ce97584d98f9d7b40 | 1,992 | py | Python | pytest_splunk_env/splunk/helmut/util/basefileutils.py | splunk/pytest-splunk-env | 63ce423446f54869e4530627ff7463ea3e26c38a | [
"Apache-2.0"
] | 1 | 2021-03-18T23:35:08.000Z | 2021-03-18T23:35:08.000Z | pytest_splunk_env/splunk/helmut/util/basefileutils.py | splunk/pytest-splunk-env | 63ce423446f54869e4530627ff7463ea3e26c38a | [
"Apache-2.0"
] | null | null | null | pytest_splunk_env/splunk/helmut/util/basefileutils.py | splunk/pytest-splunk-env | 63ce423446f54869e4530627ff7463ea3e26c38a | [
"Apache-2.0"
] | 1 | 2022-03-27T16:55:33.000Z | 2022-03-27T16:55:33.000Z | # SPDX-FileCopyrightText: 2020 Splunk Inc.
#
# SPDX-License-Identifier: Apache-2.0
from pytest_splunk_env.splunk.helmut.log import Logging
class BaseFileUtils(Logging):
def isfile(self, path):
raise NotImplementedError("Function not implemented")
def isdir(self, path):
raise NotImplementedEr... | 33.762712 | 61 | 0.728414 |
cc02386383b1887637d54999fd2ccb2df646cb4d | 644 | py | Python | setup.py | fanzeyi/typestruct | 947e458e865ecf58c4c0848a05f53e9da3d9e686 | [
"MIT"
] | 3 | 2018-09-13T06:54:49.000Z | 2018-09-13T09:47:08.000Z | setup.py | fanzeyi/typestruct | 947e458e865ecf58c4c0848a05f53e9da3d9e686 | [
"MIT"
] | null | null | null | setup.py | fanzeyi/typestruct | 947e458e865ecf58c4c0848a05f53e9da3d9e686 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="typestruct",
version="0.1.1",
author="Zeyi Fan",
author_email="i@zr.is",
description="struct serialization/deserialization with typing",
long_description=long_... | 26.833333 | 67 | 0.658385 |
374e71e4d04a6cd145d1dd571539f663a719189d | 3,902 | py | Python | code/python/third_party/Deadline/DeadlineConnect.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | 10 | 2020-11-17T00:33:42.000Z | 2022-02-16T23:31:58.000Z | code/python/third_party/Deadline/DeadlineConnect.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | null | null | null | code/python/third_party/Deadline/DeadlineConnect.py | mikeroberts3000/ml-hypersim | 75b363ee52fbdbd0cc9b554c34c1aadea404183e | [
"AML"
] | null | null | null | import sys
import subprocess
import os
import json
import traceback
from . import Jobs
from . import SlavesRenderingJob
from . import JobReports
from . import TaskReports
from . import Limits
from . import Tasks
from . import Pulse
from . import Repository
from . import MappedPaths
from . import MaximumPriority
from . ... | 47.012048 | 179 | 0.717837 |
140e9a7a95f6f4ecd0d02ea38bdcc88d9bc9c9a0 | 54 | py | Python | fastai/version.py | zhanlliu/fastai_study | 0b136a2fd40cbcea4d51a33efc7e7fee24b5bc08 | [
"Apache-2.0"
] | null | null | null | fastai/version.py | zhanlliu/fastai_study | 0b136a2fd40cbcea4d51a33efc7e7fee24b5bc08 | [
"Apache-2.0"
] | null | null | null | fastai/version.py | zhanlliu/fastai_study | 0b136a2fd40cbcea4d51a33efc7e7fee24b5bc08 | [
"Apache-2.0"
] | null | null | null | __all__ = ['__version__']
__version__ = '1.0.30.dev0'
| 18 | 27 | 0.685185 |
f702829a908f8235e9093bc97a9d0edce1997f1f | 379 | py | Python | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | 1 | 2019-03-11T04:12:50.000Z | 2019-03-11T04:12:50.000Z | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | null | null | null | pokemon/permissions.py | pessman/pokemon_utils | cbe06ebe323cb38a35846274d812bdbe8d0ae8ca | [
"MIT"
] | 2 | 2019-03-13T03:17:29.000Z | 2019-04-04T20:06:50.000Z | from rest_framework.permissions import SAFE_METHODS, BasePermission
class IsAdminOrReadOnly(BasePermission):
"""
The request is authenticated as an Admin user or is Read Only
"""
def has_permission(self, request, view):
return bool(
request.method in SAFE_METHODS or
re... | 25.266667 | 67 | 0.662269 |
2ee193365add316a39099213870c2518c80ab4af | 3,272 | py | Python | examples/rdf_star_recursive.py | pragya16067/Sweb_Project_RDF- | 92506cc78e6f5d78ae5f784f818310174635a6af | [
"BSD-3-Clause"
] | null | null | null | examples/rdf_star_recursive.py | pragya16067/Sweb_Project_RDF- | 92506cc78e6f5d78ae5f784f818310174635a6af | [
"BSD-3-Clause"
] | null | null | null | examples/rdf_star_recursive.py | pragya16067/Sweb_Project_RDF- | 92506cc78e6f5d78ae5f784f818310174635a6af | [
"BSD-3-Clause"
] | null | null | null | from rdflib import Graph
from rdflib.namespace import RDF, Namespace
from pyparsing import ParseException
# For graphs with multiple rdf reification/* statements
rdf_graph = """
PREFIX ex:<http://example.org/>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf:<http://xmlns.com/foaf/0.1/... | 27.965812 | 103 | 0.619193 |
d708dd0d19d0b303d001ce5350f035020caa6db8 | 25,603 | py | Python | telegram-bot.py | 0x5eba/RecommendationBot | e65916a8273f1d4c25021a1e1f13eaae431d4cb4 | [
"MIT"
] | null | null | null | telegram-bot.py | 0x5eba/RecommendationBot | e65916a8273f1d4c25021a1e1f13eaae431d4cb4 | [
"MIT"
] | null | null | null | telegram-bot.py | 0x5eba/RecommendationBot | e65916a8273f1d4c25021a1e1f13eaae431d4cb4 | [
"MIT"
] | null | null | null | import logging
import telegram
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, InlineQueryResultArticle, InputTextMessageContent
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, Filters, MessageHandler, InlineQueryHandler
from telegram.ext.dispatcher import run_async
import nump... | 45.075704 | 174 | 0.638949 |
975cbc2f996fec5197090cc81bc5a29f36bbda5b | 3,745 | py | Python | cogwheels/helpers/tests/test_deprecation_warning_stacklevel.py | ababic/django-app-utils | 7a5f423498854dbec936b06bbaf88f7106259144 | [
"MIT"
] | 4 | 2018-06-27T22:44:34.000Z | 2021-02-03T16:55:54.000Z | cogwheels/helpers/tests/test_deprecation_warning_stacklevel.py | ababic/django-app-utils | 7a5f423498854dbec936b06bbaf88f7106259144 | [
"MIT"
] | 15 | 2018-07-15T10:01:40.000Z | 2019-10-30T08:15:14.000Z | cogwheels/helpers/tests/test_deprecation_warning_stacklevel.py | ababic/django-cogwheels | 7a5f423498854dbec936b06bbaf88f7106259144 | [
"MIT"
] | null | null | null | import warnings
from django.test import override_settings
from cogwheels.tests.base import AppSettingTestCase
class TestDeprecationWarningStackLevelSetting(AppSettingTestCase):
def assert_this_file_appears_as_cause_of_warning(self, warning):
self.assertIn(
'/cogwheels/helpers/tests/test_depr... | 46.8125 | 107 | 0.75247 |
5b788877bc1f86a70651f1de28a2ccd7b959652e | 2,269 | py | Python | venv/Lib/site-packages/pyrogram/methods/users/get_common_chats.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/methods/users/get_common_chats.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/methods/users/get_common_chats.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 36.015873 | 107 | 0.639489 |
4b66e00a3ff62ecd6675a263ada22aa5fb1aca25 | 1,696 | py | Python | figthesis/fignoise.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/fignoise.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/fignoise.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import figlatex
import toy
import num2si
import textbox
config = [
# label, noisefile, time [ns], timebase [ns]
('LNGS noise' , 'noises/nuvhd_lf_3x_tile57_77K_64V_6VoV_1-noise.npz', 150, [1, 8, 16, 32]),
('Proto0 noise', 'noises/merged_000886-adc_W2... | 29.241379 | 126 | 0.596698 |
a545a27f6826a1a4610bd47c7a45d7c5e8b4e388 | 31,025 | py | Python | darr/tests/test_array.py | gjlbeckers-uu/dArray | e156495fd48b10085f5ddadf4890b626a78f5100 | [
"BSD-3-Clause"
] | null | null | null | darr/tests/test_array.py | gjlbeckers-uu/dArray | e156495fd48b10085f5ddadf4890b626a78f5100 | [
"BSD-3-Clause"
] | null | null | null | darr/tests/test_array.py | gjlbeckers-uu/dArray | e156495fd48b10085f5ddadf4890b626a78f5100 | [
"BSD-3-Clause"
] | null | null | null | import os
import unittest
import tempfile
import shutil
import numpy as np
from darr.array import asarray, create_array, create_datadir, Array, \
numtypesdescr, truncate_array, delete_array, AppendDataError, \
numtypedescriptiontxt
from darr.utils import tempdir, tempdirfile
# TODO clean up overwrite paramet... | 40.930079 | 87 | 0.586527 |
c788baa25c69287c0e6b27d2fcdbd48e1f127df8 | 284 | py | Python | fern/items/urls.py | Eslamhathout/Fern | ddcdb7318689f41ccfc6914175e5ccac9b1fb2fa | [
"MIT"
] | null | null | null | fern/items/urls.py | Eslamhathout/Fern | ddcdb7318689f41ccfc6914175e5ccac9b1fb2fa | [
"MIT"
] | null | null | null | fern/items/urls.py | Eslamhathout/Fern | ddcdb7318689f41ccfc6914175e5ccac9b1fb2fa | [
"MIT"
] | 1 | 2020-06-20T23:50:59.000Z | 2020-06-20T23:50:59.000Z | from django.urls import path
from rest_framework.urlpatterns import format_suffix_patterns
from . import views
urlpatterns = [
path('items/', views.ItemList.as_view()),
path('items/<int:pk>', views.ItemDetail.as_view()),
]
urlpatterns = format_suffix_patterns(urlpatterns)
| 23.666667 | 61 | 0.760563 |
31331baa0be9758fc5a43e34ec130d4c98791411 | 7,147 | py | Python | translation/fairseq/data/iterators.py | houshengyuan/MAN | 03912e80b21e0fc40c36515b6893d4244b82e6b6 | [
"MIT"
] | 140 | 2019-06-10T04:02:07.000Z | 2022-03-22T11:08:27.000Z | translation/fairseq/data/iterators.py | houshengyuan/MAN | 03912e80b21e0fc40c36515b6893d4244b82e6b6 | [
"MIT"
] | 6 | 2019-06-10T07:36:44.000Z | 2020-05-15T03:33:39.000Z | translation/fairseq/data/iterators.py | houshengyuan/MAN | 03912e80b21e0fc40c36515b6893d4244b82e6b6 | [
"MIT"
] | 11 | 2019-06-21T05:31:17.000Z | 2022-01-04T02:20:46.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import itertools
import math
impo... | 32.935484 | 98 | 0.634392 |
7907c353fe7228172d12dfe2ebf9d989531d716e | 583 | py | Python | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 9 | 2017-02-13T18:17:13.000Z | 2020-11-21T20:15:54.000Z | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 2 | 2021-05-20T14:26:47.000Z | 2021-05-20T14:26:48.000Z | ecs/meetings/migrations/0010_meeting_documents_zip.py | programmierfabrik/ecs | 2389a19453e21b2ea4e40b272552bcbd42b926a9 | [
"Apache-2.0"
] | 4 | 2017-04-02T18:48:59.000Z | 2021-11-23T15:40:35.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('documents', '0004_uuidfield'),
('meetings', '0009_auto_20170106_1414'),
]
operations = [
... | 26.5 | 150 | 0.656947 |
98b2ba7b0fabe7d26db09f5936abb0bbcbafcc8b | 3,139 | py | Python | src/plotmanx/_tests/manager_test.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | src/plotmanx/_tests/manager_test.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | src/plotmanx/_tests/manager_test.py | tokenchain/plotman | 666e4e34eecda90aa94004ff042fefebfbf3fead | [
"Apache-2.0"
] | null | null | null | # TODO: migrate away from unittest patch
from unittest.mock import patch
import pytest
from plotmanx import configuration, manager
@pytest.fixture
def sched_cfg():
return configuration.Scheduling(
global_max_jobs=1,
global_stagger_m=2,
polling_time_s=2,
tmpdir_stagger_phase_major=... | 30.475728 | 84 | 0.621854 |
8aa610b0cdb50c578ef100939ebdbcb07450ba72 | 12,282 | py | Python | tests/test_util.py | EpicWink/sfini | 6bb09d6a59f940947bc2739d24ed05611ebba933 | [
"MIT"
] | 3 | 2019-09-09T23:24:18.000Z | 2020-03-30T02:07:37.000Z | tests/test_util.py | EpicWink/sfini | 6bb09d6a59f940947bc2739d24ed05611ebba933 | [
"MIT"
] | 26 | 2019-05-26T07:51:17.000Z | 2020-09-08T12:40:26.000Z | tests/test_util.py | EpicWink/sfini | 6bb09d6a59f940947bc2739d24ed05611ebba933 | [
"MIT"
] | 1 | 2020-04-10T20:26:18.000Z | 2020-04-10T20:26:18.000Z | """Test ``sfini._util``."""
from sfini import _util as tscr
import pytest
from unittest import mock
import logging as lg
import boto3
class TestDefaultParameter:
"""Test `sfini._util.DefaultParameter``."""
@pytest.fixture
def default(self):
"""A DefaultParameter instance."""
return tscr.D... | 29.242857 | 77 | 0.52638 |
9f8af2bc36ab026a3c45c85493fd75b1c82e65c0 | 2,799 | py | Python | test/test_appscale_get_property.py | NeolithEra/appscale-tools | bf02462645ba08975e0e4cfcc25f3ff4e0ec1545 | [
"Apache-2.0"
] | 21 | 2015-04-22T02:46:22.000Z | 2021-11-14T20:05:18.000Z | test/test_appscale_get_property.py | NeolithEra/appscale-tools | bf02462645ba08975e0e4cfcc25f3ff4e0ec1545 | [
"Apache-2.0"
] | 244 | 2015-01-02T22:43:58.000Z | 2020-01-29T17:52:43.000Z | test/test_appscale_get_property.py | NeolithEra/appscale-tools | bf02462645ba08975e0e4cfcc25f3ff4e0ec1545 | [
"Apache-2.0"
] | 32 | 2015-03-12T14:49:49.000Z | 2021-06-08T09:43:36.000Z | #!/usr/bin/env python
# General-purpose Python library imports
import json
import os
import sys
import time
import unittest
# Third party libraries
from flexmock import flexmock
import SOAPpy
# AppScale import, the library that we're testing here
from appscale.tools.appscale_logger import AppScaleLogger
from apps... | 31.449438 | 79 | 0.728832 |
09357f8d9e666a631d42ded9fa15c4a84c45d1dc | 108,636 | py | Python | tests/unit/forklift/test_legacy.py | lala7573/warehouse | 56938af14d0337724873f4e9024be7aa0adcda1e | [
"Apache-2.0"
] | 1 | 2019-06-23T14:37:33.000Z | 2019-06-23T14:37:33.000Z | tests/unit/forklift/test_legacy.py | Matthelonianxl/warehouse | a08fdb85c523be2c6d5fe29e0c333e1664566cc2 | [
"Apache-2.0"
] | null | null | null | tests/unit/forklift/test_legacy.py | Matthelonianxl/warehouse | a08fdb85c523be2c6d5fe29e0c333e1664566cc2 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 35.571709 | 88 | 0.551245 |
de6cb412b2141ba59528962dab382c194281dd29 | 1,492 | py | Python | mars/dataframe/datastore/tests/test_datastore.py | tomzhang/mars-1 | 6f1d85e37eb1b383251314cb0ba13e06288af03d | [
"Apache-2.0"
] | 2 | 2019-03-29T04:11:10.000Z | 2020-07-08T10:19:54.000Z | mars/dataframe/datastore/tests/test_datastore.py | tomzhang/mars-1 | 6f1d85e37eb1b383251314cb0ba13e06288af03d | [
"Apache-2.0"
] | null | null | null | mars/dataframe/datastore/tests/test_datastore.py | tomzhang/mars-1 | 6f1d85e37eb1b383251314cb0ba13e06288af03d | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.155556 | 81 | 0.66555 |
6741de9b684be3a2e568402bafa66b7dcb630b41 | 1,160 | py | Python | tools/cellml/CellML_Edit.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2021-02-05T13:19:58.000Z | 2021-02-05T13:19:58.000Z | tools/cellml/CellML_Edit.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | null | null | null | tools/cellml/CellML_Edit.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python
"""
Runs CellML simulation.
"""
import sys
import cgrspy.bootstrap
output_file = sys.argv[1]
input_file = sys.argv[2]
cgrspy.bootstrap.loadGenericModule('cgrs_cellml')
cellmlBootstrap = cgrspy.bootstrap.fetch('CreateCellMLBootstrap')
model = cellmlBootstrap.modelLoader.loadFromURL(input_file)
... | 30.526316 | 132 | 0.705172 |
6a73b289e1bd60f35737bd93340d5cdcf1608a80 | 2,995 | py | Python | Products/CMFCore/exportimport/cookieauth.py | MatthewWilkes/Products.CMFCore | 22cba1e66040053762e57ac3597409038898a65f | [
"ZPL-2.1"
] | null | null | null | Products/CMFCore/exportimport/cookieauth.py | MatthewWilkes/Products.CMFCore | 22cba1e66040053762e57ac3597409038898a65f | [
"ZPL-2.1"
] | null | null | null | Products/CMFCore/exportimport/cookieauth.py | MatthewWilkes/Products.CMFCore | 22cba1e66040053762e57ac3597409038898a65f | [
"ZPL-2.1"
] | null | null | null | ##############################################################################
#
# Copyright (c) 2005 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 31.861702 | 78 | 0.64374 |
9cb4eb938e0953aabe16b845d327e1c8f85b7ffa | 16,244 | py | Python | test/functional/mempool_accept.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | 1 | 2021-08-29T13:37:38.000Z | 2021-08-29T13:37:38.000Z | test/functional/mempool_accept.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | null | null | null | test/functional/mempool_accept.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool acceptance of raw transactions."""
from decimal import Decimal
from io import BytesIO
imp... | 48.059172 | 154 | 0.63445 |
b2567887807922397d50aa73e133271d00be77e8 | 5,049 | py | Python | avatar_field/widget.py | ZFCon/django-avatarfield | a618de63f04228db9b2ee20275789ca5fee78e1a | [
"MIT"
] | 3 | 2021-02-20T04:51:00.000Z | 2021-05-06T14:56:23.000Z | avatar_field/widget.py | bharathjinka09/django-avatarfield | c6e6e68ab4dd33fa688a9bfcb4b6312e5cfae2aa | [
"MIT"
] | null | null | null | avatar_field/widget.py | bharathjinka09/django-avatarfield | c6e6e68ab4dd33fa688a9bfcb4b6312e5cfae2aa | [
"MIT"
] | 1 | 2021-02-20T04:51:52.000Z | 2021-02-20T04:51:52.000Z | from django.forms import ModelChoiceField, Select
from django.forms.models import ModelChoiceIterator, ModelChoiceIteratorValue
from django.forms.fields import Field
from django.forms.widgets import RadioSelect
class AvatarModelChoiceIterator(ModelChoiceIterator):
def __init__(self, field):
self.field = f... | 36.854015 | 106 | 0.585859 |
4db3ed1aa0929ae05bb636d2d672e5546fb32224 | 2,997 | py | Python | train/intermimic/Packet.py | eniac/MimicNet | c0790679f8c220c75c33ace67e2735816aac6815 | [
"MIT"
] | 15 | 2021-08-20T08:10:01.000Z | 2022-03-24T21:24:50.000Z | train/intermimic/Packet.py | eniac/MimicNet | c0790679f8c220c75c33ace67e2735816aac6815 | [
"MIT"
] | 1 | 2022-03-30T09:03:39.000Z | 2022-03-30T09:03:39.000Z | train/intermimic/Packet.py | eniac/MimicNet | c0790679f8c220c75c33ace67e2735816aac6815 | [
"MIT"
] | 3 | 2021-08-20T08:10:34.000Z | 2021-12-02T06:15:02.000Z | #!/usr/bin/env python3
import socket
import struct
"""
Convert an IP string to long
Taken from https://stackoverflow.com/questions/9590965/convert-an-ip-string-to-
a-number-and-vice-versa/22272197
"""
def ip2long(ip):
packed_ip = socket.inet_aton(ip)
return struct.unpack("!L", packed_ip)[... | 30.581633 | 79 | 0.508509 |
1da33e3d29da8aa12b13db870d58812cd47a361f | 11,901 | py | Python | src/Fig04_repo.py | takumihonda/lightning_da_ideal | 8c79004487a95674de9ad2fe40bcad760e867877 | [
"MIT"
] | null | null | null | src/Fig04_repo.py | takumihonda/lightning_da_ideal | 8c79004487a95674de9ad2fe40bcad760e867877 | [
"MIT"
] | null | null | null | src/Fig04_repo.py | takumihonda/lightning_da_ideal | 8c79004487a95674de9ad2fe40bcad760e867877 | [
"MIT"
] | null | null | null | import numpy as np
from netCDF4 import Dataset
from datetime import datetime
from datetime import timedelta
import os
import sys
import matplotlib.pyplot as plt
from matplotlib import gridspec
import matplotlib.colors as mcolors
import matplotlib.patches as patches
from tools_LT import read_evar_only
quick = True
#... | 29.604478 | 125 | 0.510881 |
abde790973a1a14fe2d2615e10dbf677f2bfb49d | 3,623 | py | Python | onlinexam/urls.py | DeepakDarkiee/exam | 59c832d2107b8cf9fc08fb1d78d1046ee29204f6 | [
"MIT"
] | null | null | null | onlinexam/urls.py | DeepakDarkiee/exam | 59c832d2107b8cf9fc08fb1d78d1046ee29204f6 | [
"MIT"
] | null | null | null | onlinexam/urls.py | DeepakDarkiee/exam | 59c832d2107b8cf9fc08fb1d78d1046ee29204f6 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import LoginView, LogoutView
from django.urls import include, path
from exam import views
def trigger_error(request):
division_by_zero = 1 / 0
urlpatterns = [
path("sen... | 38.542553 | 86 | 0.676787 |
96ffbecf5d5ff03a411e05619197c470e0479f66 | 6,531 | py | Python | _deprecated/driver.py | m3d/osgar_archive_2020 | 556b534e59f8aa9b6c8055e2785c8ae75a1a0a0e | [
"MIT"
] | 12 | 2017-02-16T10:22:59.000Z | 2022-03-20T05:48:06.000Z | _deprecated/driver.py | m3d/osgar_archive_2020 | 556b534e59f8aa9b6c8055e2785c8ae75a1a0a0e | [
"MIT"
] | 618 | 2016-08-30T04:46:12.000Z | 2022-03-25T16:03:10.000Z | _deprecated/driver.py | robotika/osgar | 6f4f584d5553ab62c08a1c7bb493fefdc9033173 | [
"MIT"
] | 11 | 2016-08-27T20:02:55.000Z | 2022-03-07T08:53:53.000Z | #!/usr/bin/python
"""
Driver for John Deere
usage:
./driver.py <notes> | [<metalog> [<F>]]
"""
import sys
import math
from apyros.metalog import MetaLog, disableAsserts
from apyros.sourcelogger import SourceLogger
from can import CAN, DummyMemoryLog, ReplayLogInputsOnly, ReplayLog
from johndeere import Jo... | 34.373684 | 171 | 0.645384 |
836dbd812961e03caa7eade8d261dc152d96f23e | 1,243 | py | Python | toolbox/course-1/week-6-dynamic-programming-2/task-3-maximum-value-of-an-arithmetic-expression.py | ichko/DataStructures | 550c696ef57ab42b0ff4079fb45d417a8ccb58af | [
"MIT"
] | 3 | 2018-02-21T20:22:23.000Z | 2022-02-08T04:23:07.000Z | toolbox/course-1/week-6-dynamic-programming-2/task-3-maximum-value-of-an-arithmetic-expression.py | ichko/algo-playground | 550c696ef57ab42b0ff4079fb45d417a8ccb58af | [
"MIT"
] | null | null | null | toolbox/course-1/week-6-dynamic-programming-2/task-3-maximum-value-of-an-arithmetic-expression.py | ichko/algo-playground | 550c696ef57ab42b0ff4079fb45d417a8ccb58af | [
"MIT"
] | null | null | null | # python3
import math
def max_val_expr(numbers, operations, ops_map):
min_vals = {(i, i): n for i, n in enumerate(numbers)}
max_vals = {(i, i): n for i, n in enumerate(numbers)}
def minMax(i, j):
min_val, max_val = math.inf, -math.inf
for t in range(i, j):
op = ops_map[operat... | 27.021739 | 73 | 0.497184 |
98e69c900a9d4fe9bb718a5cf256962e4efdc62c | 9,013 | py | Python | ropgenerator/Load.py | sailay1996/ropgenerator | 7ae5b952ad0b6cb2e37e911230168c647de5a889 | [
"MIT"
] | null | null | null | ropgenerator/Load.py | sailay1996/ropgenerator | 7ae5b952ad0b6cb2e37e911230168c647de5a889 | [
"MIT"
] | null | null | null | ropgenerator/Load.py | sailay1996/ropgenerator | 7ae5b952ad0b6cb2e37e911230168c647de5a889 | [
"MIT"
] | 2 | 2019-04-07T04:15:45.000Z | 2019-08-15T14:17:53.000Z | # -*- coding:utf-8 -*-
# Load module: load a binary and extract gadgets from it
import sys
import os
import subprocess
from ropgenerator.Database import build, initDB
from ropgenerator.semantic.Engine import initEngine
from ropgenerator.exploit.Scanner import initScanner
import ropgenerator.Architecture as Arch
from... | 34.665385 | 164 | 0.547875 |
9e5a4181932a365fd56a4b38119548c9cc975369 | 793 | py | Python | chapter_6/ex_6-1.py | akshaymoharir/PythonCrashCourse | 742b9841cff61d36567e8706efc69c5f5d5435ff | [
"MIT"
] | null | null | null | chapter_6/ex_6-1.py | akshaymoharir/PythonCrashCourse | 742b9841cff61d36567e8706efc69c5f5d5435ff | [
"MIT"
] | null | null | null | chapter_6/ex_6-1.py | akshaymoharir/PythonCrashCourse | 742b9841cff61d36567e8706efc69c5f5d5435ff | [
"MIT"
] | null | null | null |
## Python Crash Course
# Exercise 6.1: Person:
# Use a dictionary to store information about a person you know.
# Store their first name, last name, age, and the city in which they live.
# You should have keys such as first_name, last_name, age, and city.
# ... | 24.030303 | 89 | 0.534678 |
154477a463cfa3ea8c424f4964d215b13f67f309 | 5,313 | py | Python | allennlp/training/metrics/auc.py | alle-pawols/allennlp | 7d4a67263d7a210aca22d4f2b03e8568d3c34a48 | [
"Apache-2.0"
] | 11,433 | 2017-06-27T03:08:46.000Z | 2022-03-31T18:14:33.000Z | allennlp/training/metrics/auc.py | alle-pawols/allennlp | 7d4a67263d7a210aca22d4f2b03e8568d3c34a48 | [
"Apache-2.0"
] | 4,006 | 2017-06-26T21:45:43.000Z | 2022-03-31T02:11:10.000Z | allennlp/training/metrics/auc.py | alle-pawols/allennlp | 7d4a67263d7a210aca22d4f2b03e8568d3c34a48 | [
"Apache-2.0"
] | 2,560 | 2017-06-26T21:16:53.000Z | 2022-03-30T07:55:46.000Z | from typing import Optional
from overrides import overrides
import torch
import torch.distributed as dist
from sklearn import metrics
from allennlp.common.util import is_distributed
from allennlp.common.checks import ConfigurationError
from allennlp.training.metrics.metric import Metric
@Metric.register("auc")
clas... | 39.066176 | 111 | 0.632035 |
cd9a47fe1143a0f7c88a9c102c6b6576161c1f18 | 257 | py | Python | 5-23.py | infintyol2/William | 432676e0fd25b02af2d2fa49f105b98f9cc98c08 | [
"MIT"
] | null | null | null | 5-23.py | infintyol2/William | 432676e0fd25b02af2d2fa49f105b98f9cc98c08 | [
"MIT"
] | null | null | null | 5-23.py | infintyol2/William | 432676e0fd25b02af2d2fa49f105b98f9cc98c08 | [
"MIT"
] | null | null | null | num = int(input("enter a number "))
num1 = int(input("enter a numer "))
small = 0
g = 0
if num > num1:
small = num1
else:
small = num
for x in range(1, num+1):
if (num % x == 0) and (num1 % x ==0):
g = x
print((g*(num/g))*(num1/g))
| 18.357143 | 41 | 0.51751 |
6b241c46c79f35e0ebc52d433d23ca7306722000 | 1,069 | py | Python | var/spack/repos/builtin/packages/xcb-util-cursor/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/xcb-util-cursor/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/xcb-util-cursor/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class XcbUtilCursor(AutotoolsPackage):
"""The XCB util modules provides a number of libraries wh... | 39.592593 | 95 | 0.745557 |
b12013c44a913bdefba7c7fd2ec22726a76fac2b | 24,741 | py | Python | grr/server/grr_response_server/artifact_registry.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/artifact_registry.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | grr/server/grr_response_server/artifact_registry.py | BA7JCM/grr | c6f3b19e73e1d76a195d3c9a63e894ace6ea2508 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Central registry for artifacts."""
import io
import logging
import os
import threading
from grr_response_core import config
from grr_response_core.lib import artifact_utils
from grr_response_core.lib import objectfilter
from grr_response_core.lib import parsers
from grr_response_core.lib impo... | 34.846479 | 80 | 0.697506 |
c7d3528c0d1bf91af1c30efa7ad6ddaeccc24703 | 203 | py | Python | Python/Kivy/Kivy Testing 2/main.py | vaibhavkrkm/Mini-Projects | 13cc3c6ee551aff5af48a8e9000816fc8767580f | [
"MIT"
] | null | null | null | Python/Kivy/Kivy Testing 2/main.py | vaibhavkrkm/Mini-Projects | 13cc3c6ee551aff5af48a8e9000816fc8767580f | [
"MIT"
] | null | null | null | Python/Kivy/Kivy Testing 2/main.py | vaibhavkrkm/Mini-Projects | 13cc3c6ee551aff5af48a8e9000816fc8767580f | [
"MIT"
] | null | null | null | # float layout
import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
class MyApp(App):
def build(self):
return FloatLayout()
if __name__ == '__main__':
MyApp().run()
| 13.533333 | 44 | 0.729064 |
57fcdf88320482f81c108e0bd02b2d133a550005 | 4,814 | py | Python | test/scripts/test_strands.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_strands.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_strands.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# not... | 32.308725 | 88 | 0.680723 |
32e97e6384e6419f473ef60d96011dea1a2b8d8f | 2,563 | py | Python | evennia/server/portal/mccp.py | meistermuka/evennia | 45e0785c8e3a10e99ea97c8b26648ea3b01c656a | [
"BSD-3-Clause"
] | null | null | null | evennia/server/portal/mccp.py | meistermuka/evennia | 45e0785c8e3a10e99ea97c8b26648ea3b01c656a | [
"BSD-3-Clause"
] | null | null | null | evennia/server/portal/mccp.py | meistermuka/evennia | 45e0785c8e3a10e99ea97c8b26648ea3b01c656a | [
"BSD-3-Clause"
] | null | null | null | """
MCCP - Mud Client Compression Protocol
This implements the MCCP v2 telnet protocol as per
http://tintin.sourceforge.net/mccp/. MCCP allows for the server to
compress data when sending to supporting clients, reducing bandwidth
by 70-90%.. The compression is done using Python's builtin zlib
library. If the client d... | 28.477778 | 73 | 0.663675 |
495987829a3fad4072dd34a453dff579d375810d | 837 | py | Python | build/scripts/gen_py_reg.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 33 | 2016-12-15T21:47:13.000Z | 2020-10-27T23:53:59.000Z | build/scripts/gen_py_reg.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | null | null | null | build/scripts/gen_py_reg.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 14 | 2016-12-28T17:00:33.000Z | 2022-01-16T20:15:27.000Z | import sys
template = '''
extern "C" void RegisterPythonModule(const char* name, void (*fn)(void));
extern "C" void {1}();
namespace {
struct TRegistrar {
inline TRegistrar() {
RegisterPythonModule("{0}", {1});
}
} REG;
}
'''
def mangle(name):
if '.' not in name:
retu... | 25.363636 | 95 | 0.55914 |
76bf69a181ad6b3393ba197a4aa15d17084c4be1 | 9,863 | py | Python | torch/fx/experimental/fx2trt/example/fx2trt_example.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 3 | 2020-11-06T22:02:36.000Z | 2021-06-25T13:50:47.000Z | torch/fx/experimental/fx2trt/example/fx2trt_example.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 1 | 2021-04-22T18:37:42.000Z | 2021-04-28T00:53:25.000Z | torch/fx/experimental/fx2trt/example/fx2trt_example.py | Hacky-DH/pytorch | 80dc4be615854570aa39a7e36495897d8a040ecc | [
"Intel"
] | 1 | 2021-10-05T07:05:26.000Z | 2021-10-05T07:05:26.000Z | from typing import Tuple, Dict, Callable, Any
import torch
import torch.fx
import torchvision.models as models
import torch.fx.passes.splitter_base as splitter_base
import torch.fx.passes.operator_support as op_support
import torch.fx.passes.net_min_base as net_min_base
from torch.fx.experimental.fx2trt.fx2trt import ... | 37.218868 | 126 | 0.671297 |
21167b6c2b3e140f98510021c7bbdc16854e9fe7 | 4,064 | py | Python | recognize.py | alper111/affordance-learning | 21b70f689a8299c6af7cd4ed763fc3133cf1681f | [
"MIT"
] | 3 | 2020-12-15T07:10:15.000Z | 2021-06-10T20:15:33.000Z | recognize.py | alper111/DeepSym | 21b70f689a8299c6af7cd4ed763fc3133cf1681f | [
"MIT"
] | 1 | 2020-06-10T09:51:44.000Z | 2020-06-10T09:51:44.000Z | recognize.py | alper111/affordance-learning | 21b70f689a8299c6af7cd4ed763fc3133cf1681f | [
"MIT"
] | 1 | 2020-04-02T08:20:21.000Z | 2020-04-02T08:20:21.000Z | import os
import argparse
import rospy
import yaml
import numpy as np
import torch
from models import EffectRegressorMLP
import data
import utils
from simtools.rosutils import RosNode
parser = argparse.ArgumentParser("Make plan.")
parser.add_argument("-opts", help="option file", type=str, required=True)
parser.add_ar... | 34.735043 | 134 | 0.634104 |
ee53779c161f78215c22846fdcff7510460a9125 | 910 | py | Python | venv/lib/python3.7/site-packages/zope/contentprovider/tests.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 1 | 2018-11-08T15:04:13.000Z | 2018-11-08T15:04:13.000Z | venv/lib/python3.7/site-packages/zope/contentprovider/tests.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 6 | 2016-03-24T07:50:43.000Z | 2018-11-08T15:24:09.000Z | venv/lib/python3.7/site-packages/zope/contentprovider/tests.py | leanhvu86/matrix-server | 6e16fc53dfebaeaf222ff5a371ccffcc65de3818 | [
"Apache-2.0"
] | 1 | 2015-04-03T08:29:58.000Z | 2015-04-03T08:29:58.000Z | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | 32.5 | 78 | 0.610989 |
74c2f2ed976dcb38aa087b982c6205ac77a628c1 | 27,174 | py | Python | data_neural_fuzz_pdf_obj.py | GordonShinozaki/iust_deep_fuzz | 9a244839f4028ba70cb4e18e8db8e3e9ce81e6af | [
"MIT"
] | 33 | 2018-07-13T13:09:08.000Z | 2022-03-17T14:18:12.000Z | data_neural_fuzz_pdf_obj.py | yasinbakhtiar/iust_deep_fuzz | 191e7bdf31840bd7d5052885029189bb6ffb262d | [
"MIT"
] | null | null | null | data_neural_fuzz_pdf_obj.py | yasinbakhtiar/iust_deep_fuzz | 191e7bdf31840bd7d5052885029189bb6ffb262d | [
"MIT"
] | 10 | 2019-04-17T10:30:03.000Z | 2022-03-18T12:10:12.000Z | """
PDF OBJ 9
- New in version 9 data fuzz
-- Create test data for data fuzzing (i.e p_t = 0.50) and prefix update.
-- Date: 1397-04-17
- New in version 8
-- Fuzzing back to generate_and_fuzz method.
-- Perplexity and cross entropy add to metrics list.
-- Use some Keras backend to reset model graph and state.
-- Lets p... | 42.996835 | 134 | 0.569478 |
fc182fb99873e2c7e6bc8c75d8fbc02ee836a6e3 | 771 | py | Python | tests/data.py | HumanCellAtlas/fusilllade | 5634b77440bb71aa075b6ca442baccbdd436dfd7 | [
"MIT"
] | 7 | 2018-01-15T15:35:50.000Z | 2021-03-11T23:08:16.000Z | tests/data.py | HumanCellAtlas/fusilllade | 5634b77440bb71aa075b6ca442baccbdd436dfd7 | [
"MIT"
] | 339 | 2018-02-08T23:53:58.000Z | 2021-04-30T20:46:14.000Z | tests/data.py | HumanCellAtlas/fusilllade | 5634b77440bb71aa075b6ca442baccbdd436dfd7 | [
"MIT"
] | 1 | 2018-02-08T21:47:47.000Z | 2018-02-08T21:47:47.000Z | TEST_NAMES_POS = [('helloworl12345', "alpha numerica characters"),
('hello@world.com', "email format"),
('hello-world=_@.,ZDc', "special characters"),
('HellOWoRLd', "different cases"),
('ABCDEF0123456789ABCDEF0123456789ABCDEF0123456789ABCDEF012345... | 48.1875 | 108 | 0.636835 |
5d869b8f7499437ef522dbff677755928ada15c0 | 6,698 | py | Python | bindings/python/ensmallen_graph/datasets/string/xenorhabdusnematophila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/xenorhabdusnematophila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/xenorhabdusnematophila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Xenorhabdus nematophila.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... | 35.439153 | 223 | 0.70424 |
22f166b10151506e6ad9231666d8b0dab98bf591 | 2,963 | py | Python | server/py/runurlopen.py | sreyas/Attendance-management-system | eeb57bcc942f407151b71bfab528e817c6806c74 | [
"MIT"
] | null | null | null | server/py/runurlopen.py | sreyas/Attendance-management-system | eeb57bcc942f407151b71bfab528e817c6806c74 | [
"MIT"
] | null | null | null | server/py/runurlopen.py | sreyas/Attendance-management-system | eeb57bcc942f407151b71bfab528e817c6806c74 | [
"MIT"
] | null | null | null | import face_recognition
import cv2
import urllib
import sys,json,numpy as np
import glob,os
from pathlib import Path
import numpy as np
home = str(os.path.dirname(os.path.abspath(__file__))) + "/../../"
file_names = glob.glob(home + "/known_people/*.jp*g")
def read_in():
lines = sys.stdin.readline()
return lin... | 37.506329 | 92 | 0.580493 |
1ff40cf0b7bf16f736946d5ffe94fd6cb374d85a | 1,439 | py | Python | Achive/rpyc_NI-SWITCH_NI-DCPower_NI-DMM.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | 1 | 2021-08-30T14:22:15.000Z | 2021-08-30T14:22:15.000Z | Achive/rpyc_NI-SWITCH_NI-DCPower_NI-DMM.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | Achive/rpyc_NI-SWITCH_NI-DCPower_NI-DMM.py | rscd27p/DockerTest | aee56356f7cdaded1c6ef787e6cdf8415308c8c3 | [
"MIT"
] | null | null | null | # Import libraries
import rpyc # python3 -m pip install rpyc
import nidcpower # python3 -m pip install dcpower
import niswitch # python3 -m pip install niswitch
import nidmm # python3 -m pip install nidmm
# Import rpyc thread server
from rpyc.utils.server import ThreadedServer
# Declare NI-SWITCH rpyc servi... | 35.097561 | 130 | 0.734538 |
9fb0003a238037f220821726e92caf5ce3446b72 | 1,799 | py | Python | notes/algo-ds-practice/problems/array/match_pattern.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/array/match_pattern.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/array/match_pattern.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | '''
Find all strings that match specific pattern in a dictionary
Given a dictionary of words, find all strings that matches the given pattern where every character in the pattern is uniquely mapped to a character in the dictionary.
Examples:
Input:
dict = ["abb", "abc", "xyz", "xyy"];
pattern = "foo"
Output: [xyy ab... | 29.491803 | 166 | 0.738744 |
bbbda27e168aae1bbb00d9e2a657de841e9fd86b | 5,175 | py | Python | contrib/seeds/makeseeds.py | bhok/PurePosCoin2.7 | f7c4a066c860ed1ef4ceae7e992f8edeeb4b199f | [
"MIT"
] | 18 | 2017-04-01T01:45:43.000Z | 2021-11-24T03:28:36.000Z | contrib/seeds/makeseeds.py | bhok/PurePosCoin2.7 | f7c4a066c860ed1ef4ceae7e992f8edeeb4b199f | [
"MIT"
] | 7 | 2017-06-26T17:52:34.000Z | 2019-03-07T16:58:24.000Z | contrib/seeds/makeseeds.py | bhok/PurePosCoin2.7 | f7c4a066c860ed1ef4ceae7e992f8edeeb4b199f | [
"MIT"
] | 15 | 2017-04-20T23:56:18.000Z | 2022-02-28T07:11:29.000Z | #!/usr/bin/env python
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 500000
im... | 32.142857 | 186 | 0.564251 |
a0d3031eb59b9a3112cad5ba5a75233f9a11c20f | 5,569 | py | Python | neo3/network/payloads/verification.py | CityOfZion/neo3-python | db4cd53041ce7a2c1d32bee18214fb31bb9f52be | [
"MIT"
] | null | null | null | neo3/network/payloads/verification.py | CityOfZion/neo3-python | db4cd53041ce7a2c1d32bee18214fb31bb9f52be | [
"MIT"
] | 23 | 2020-05-12T15:01:12.000Z | 2020-07-15T09:26:05.000Z | neo3/network/payloads/verification.py | CityOfZion/neo3-python | db4cd53041ce7a2c1d32bee18214fb31bb9f52be | [
"MIT"
] | 1 | 2020-07-01T09:32:46.000Z | 2020-07-01T09:32:46.000Z | from __future__ import annotations
import hashlib
from enum import IntFlag
from neo3.core import serialization, utils, types, cryptography, Size as s
from neo3.network import payloads
from typing import List
class Cosigner(serialization.ISerializable):
"""
A class that specifies who can pass CheckWitness() ve... | 42.838462 | 116 | 0.69815 |
3157265ec18f19d2828baa0bec2147a8a546df7e | 11,520 | py | Python | experiment.py | radidd/CausalMediationAnalysis | 6fe0d75ddd301b82e9e0cb0228e43ec74c0670de | [
"MIT"
] | null | null | null | experiment.py | radidd/CausalMediationAnalysis | 6fe0d75ddd301b82e9e0cb0228e43ec74c0670de | [
"MIT"
] | null | null | null | experiment.py | radidd/CausalMediationAnalysis | 6fe0d75ddd301b82e9e0cb0228e43ec74c0670de | [
"MIT"
] | null | null | null |
import math
import statistics
from functools import partial
import numpy as np
import torch
import torch.nn.functional as F
from tqdm import tqdm
from utils_cma import batch, convert_results_to_pd
from UNITER.model.nlvr2 import UniterForNlvr2Triplet
from UNITER.utils.const import IMG_DIM
from apex import amp
np.... | 40.56338 | 120 | 0.526476 |
f96eb2a13d97bc3c3ba06ae1689120e98344ef90 | 4,224 | py | Python | LeetCode-All-Solution/Python3/LC-0206-Reverse-Linked-List.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | LeetCode-All-Solution/Python3/LC-0206-Reverse-Linked-List.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | LeetCode-All-Solution/Python3/LC-0206-Reverse-Linked-List.py | YuweiYin/Algorithm_YuweiYin | 28648fac59c5a4e3c907978cbd1b3e662ba18fd5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""=================================================================
@Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3
@File : LC-0206-Reverse-Linked-List.py
@Author : [YuweiYin](https://github.com/YuweiYin)
@Date : 2022-01-10
===============================... | 31.522388 | 94 | 0.605587 |
661b79206b3ba4eef31cdffc5690efe9625228be | 2,770 | py | Python | tests/h/presenters/annotation_searchindex_test.py | hmstepanek/h | 92e567005c474f3ce3095f9a8bf37548ca2c9621 | [
"MIT"
] | null | null | null | tests/h/presenters/annotation_searchindex_test.py | hmstepanek/h | 92e567005c474f3ce3095f9a8bf37548ca2c9621 | [
"MIT"
] | 5 | 2017-12-26T14:22:20.000Z | 2018-04-02T02:56:38.000Z | tests/h/presenters/annotation_searchindex_test.py | SenseTW/h | dae2dfa8ab064ddb696e5657d48459114b2642d2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import mock
import pytest
from h.presenters.annotation_searchindex import AnnotationSearchIndexPresenter
@pytest.mark.usefixtures('DocumentSearchIndexPresenter')
class TestAnnotationSearchIndexPresenter(object):
def test_asdict(s... | 37.945205 | 90 | 0.586643 |
d2facb6ddb1111eeae5b72834db16459f78a44ee | 4,548 | py | Python | python/sparktk/frame/ops/timeseries_from_observations.py | lewisc/spark-tk | 5548fc925b5c278263cbdebbd9e8c7593320c2f4 | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-05-20T22:26:05.000Z | 2022-01-21T12:55:13.000Z | python/sparktk/frame/ops/timeseries_from_observations.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 70 | 2016-06-28T01:11:21.000Z | 2021-03-15T21:40:01.000Z | python/sparktk/frame/ops/timeseries_from_observations.py | aayushidwivedi01/spark-tk-old | fcf25f86498ac416cce77de0db4cf0aa503d20ac | [
"ECL-2.0",
"Apache-2.0"
] | 34 | 2016-04-21T22:25:22.000Z | 2020-10-06T09:23:43.000Z | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 46.886598 | 329 | 0.638083 |
936ccb2bbdc303b44f32c0f49b569cae86bdea8a | 6,069 | py | Python | js-axe-selenium/ansible/a11y/lib/python3.8/site-packages/ansible/modules/cloud/openstack/os_user_role.py | dalsontws/accessibility-axe-selenium | ca0b54d550c9763902bd22bbc48562b9b211dd42 | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | js-axe-selenium/ansible/a11y/lib/python3.8/site-packages/ansible/modules/cloud/openstack/os_user_role.py | dalsontws/accessibility-axe-selenium | ca0b54d550c9763902bd22bbc48562b9b211dd42 | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | env/lib/python3.9/site-packages/ansible/modules/cloud/openstack/os_user_role.py | unbounce/aws-name-asg-instances | e0379442e3ce71bf66ba9b8975b2cc57a2c7648d | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# Copyright (c) 2016 IBM
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | 30.19403 | 125 | 0.604712 |
bb0d899ac66b950eb544b80f8b8523fbcc6adab9 | 391 | py | Python | Action/action_enum.py | zonghan0904/Online-Realtime-Action-Recognition-based-on-OpenPose | 7d81a84a46ab3a0f6aafc4734cd24e2bbc164a97 | [
"Apache-2.0"
] | null | null | null | Action/action_enum.py | zonghan0904/Online-Realtime-Action-Recognition-based-on-OpenPose | 7d81a84a46ab3a0f6aafc4734cd24e2bbc164a97 | [
"Apache-2.0"
] | null | null | null | Action/action_enum.py | zonghan0904/Online-Realtime-Action-Recognition-based-on-OpenPose | 7d81a84a46ab3a0f6aafc4734cd24e2bbc164a97 | [
"Apache-2.0"
] | null | null | null | from enum import Enum
class Actions(Enum):
"""
Actions enum
"""
# framewise_recognition.h5
# squat = 0
# stand = 1
# walk = 2
# wave = 3
# framewise_recognition_under_scene.h5
# stand = 0
# walk = 1
# operate = 2
# fall_down = 3
# run = 4
# ncrl_framewise_... | 15.038462 | 42 | 0.537084 |
1a0a292f9e4fd56a18019f6bb6182cea627b037f | 1,890 | py | Python | test/functional_requirements/fault_tolerance/REBUILD_TWICE_IN_RAID10_ARRAY.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | 1 | 2022-02-07T23:30:50.000Z | 2022-02-07T23:30:50.000Z | test/functional_requirements/fault_tolerance/REBUILD_TWICE_IN_RAID10_ARRAY.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | test/functional_requirements/fault_tolerance/REBUILD_TWICE_IN_RAID10_ARRAY.py | so931/poseidonos | 2aa82f26bfbd0d0aee21cd0574779a655634f08c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import os
import sys
sys.path.append("../")
sys.path.append("../../system/lib/")
sys.path.append("../volume/")
sys.path.append("../array/")
import json_parser
import pos
import pos_util
import cli
import api
import json
import MOUNT_VOL_ON_RAID10_ARRAY
import fio
import time
DE... | 30.983607 | 78 | 0.670899 |
72227b2adb4d9549090c42c63365bf12654b8416 | 3,913 | py | Python | ludwig/run.py | phueb/LudwigCluster | 1c1f8cdb26031a9ed78232482cfa1e4fe9e36256 | [
"MIT"
] | null | null | null | ludwig/run.py | phueb/LudwigCluster | 1c1f8cdb26031a9ed78232482cfa1e4fe9e36256 | [
"MIT"
] | 1 | 2022-03-30T14:07:13.000Z | 2022-03-30T14:07:13.000Z | ludwig/run.py | phueb/LudwigCluster | 1c1f8cdb26031a9ed78232482cfa1e4fe9e36256 | [
"MIT"
] | 2 | 2020-06-15T13:06:53.000Z | 2021-02-12T00:33:29.000Z | import pickle
import socket
import yaml
import pandas as pd
import importlib
from pathlib import Path
import sys
from typing import Dict, Any
import shutil
# do not import ludwig here - this file is run on Ludwig workers
def save_job_files(param2val: Dict[str, Any],
series_list: list,
... | 36.570093 | 119 | 0.677741 |
511121e4661f8690ee3845332c4254173acb15a6 | 3,170 | py | Python | math_helpers/time_systems.py | sonstarr/astralib | af99e5437add14d2e5a8528cf001c3f12a39690b | [
"MIT"
] | null | null | null | math_helpers/time_systems.py | sonstarr/astralib | af99e5437add14d2e5a8528cf001c3f12a39690b | [
"MIT"
] | null | null | null | math_helpers/time_systems.py | sonstarr/astralib | af99e5437add14d2e5a8528cf001c3f12a39690b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def get_JD(year=None, month=None, day=None, hour=None, min=None, sec=None,
string=None, format='yyyy-mm-dd hh:mm:ss', rtn='jd'):
"""compute the current Julian Date based on the given time input
:param year: given year between 1901 and 2099
:param month: month 1-12
:p... | 29.90566 | 75 | 0.53123 |
805369623fd166376f4eecba8d4aa178969c9d21 | 15,663 | py | Python | learning/tests.py | skyfather/Masomo-Quiz-App | 585b50514134094303d8821b2c594b5c3f4def8a | [
"MIT"
] | 1 | 2020-07-20T17:13:40.000Z | 2020-07-20T17:13:40.000Z | learning/tests.py | skyfather/Masomo-Quiz-App | 585b50514134094303d8821b2c594b5c3f4def8a | [
"MIT"
] | 7 | 2021-04-08T21:16:26.000Z | 2022-03-12T00:39:13.000Z | learning/tests.py | skyfather/Masomo-Quiz-App | 585b50514134094303d8821b2c594b5c3f4def8a | [
"MIT"
] | null | null | null | from django.test import TestCase,TransactionTestCase,RequestFactory
from django.test import Client
from django.urls import reverse
from django.contrib.auth import get_user_model
from django.core.paginator import Paginator,Page, PageNotAnInteger, EmptyPage
from .views.quiz import QuizList,CreateQuizView,QuizDetailView,Q... | 53.457338 | 140 | 0.726681 |
7c67de3590e90789ffdfe35ca3ff78ea03a2c4f3 | 73 | py | Python | python/testData/formatter/comment_after.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | python/testData/formatter/comment_after.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | python/testData/formatter/comment_after.py | 06needhamt/intellij-community | 63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b | [
"Apache-2.0"
] | null | null | null | def foo(a):
if a == 5:
# a is 5
print('no')
foo(5)
| 9.125 | 19 | 0.356164 |
3dc1a64c6a1e771c82e850542d15e10bf91050f9 | 1,271 | py | Python | non_abundant_terms.py | wjma98/project-euler | 301ca8ede66906f0d1723c64c37feb97322c2596 | [
"MIT"
] | null | null | null | non_abundant_terms.py | wjma98/project-euler | 301ca8ede66906f0d1723c64c37feb97322c2596 | [
"MIT"
] | null | null | null | non_abundant_terms.py | wjma98/project-euler | 301ca8ede66906f0d1723c64c37feb97322c2596 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Jan 5 12:05:17 2021
@author: William
"""
def factors(n):
results = set()
for i in range(1, int(n**0.5) + 1):
if n % i == 0:
results.update([i,int(n/i)])
#delete last element since we dont want n in factor list
divisors = sorted(list(... | 27.630435 | 141 | 0.66247 |
2a0a34a3953cc9c10995f6d7fe9b95fc3c7d732a | 1,560 | py | Python | docs/examples/desktop_app_authorization_code.py | janLuke/spotipie | a902c6cda9a3e61bbcfd4915e5102479a68ef3cb | [
"MIT"
] | 1 | 2021-05-02T10:32:38.000Z | 2021-05-02T10:32:38.000Z | docs/examples/desktop_app_authorization_code.py | janLuke/spotipie | a902c6cda9a3e61bbcfd4915e5102479a68ef3cb | [
"MIT"
] | null | null | null | docs/examples/desktop_app_authorization_code.py | janLuke/spotipie | a902c6cda9a3e61bbcfd4915e5102479a68ef3cb | [
"MIT"
] | null | null | null | from spotipie import Credentials, AuthorizationCodeSession, Spotify
from spotipie.auth import get_user_authorization
from spotipie.utils import (
get_default_http_adapter,
pretty
)
# Load OAuth2 credentials from environment variables:
# {prefix}_CLIENT_ID, {prefix}_CLIENT_SECRET, {prefix}_REDIRECT_URI,
# The d... | 38.04878 | 83 | 0.79359 |
75e51f0d0fc0ddab452ce083326bab0046acae4e | 271 | py | Python | examples/arkham.py | lucasmsa/arkham-theme- | 5f8892728bf776482412a5d9da308dc9a586a56e | [
"MIT"
] | 32 | 2020-06-15T15:40:08.000Z | 2022-01-24T01:53:17.000Z | examples/arkham.py | lucasmsa/arkham-theme- | 5f8892728bf776482412a5d9da308dc9a586a56e | [
"MIT"
] | 3 | 2020-06-22T03:42:05.000Z | 2021-11-29T03:48:15.000Z | examples/arkham.py | lucasmsa/arkham-theme- | 5f8892728bf776482412a5d9da308dc9a586a56e | [
"MIT"
] | 2 | 2021-04-27T20:02:51.000Z | 2021-12-11T09:33:49.000Z | class Arkham_Asylum():
def __init__(self, enemy, weapon):
self.enemy = enemy
self.weapon = weapon
def attack(self):
return f"{self.enemy} attacked using a {self.weapon}"
joker = Arkham_Asylum('Joker', 'Knife')
joker.attack() | 24.636364 | 61 | 0.612546 |
94cfb69ff60e2554b9e5b2ba289c36b0b67fda39 | 9,778 | py | Python | notebooks/pre_production_runs/run_solver_kern_opt.py | Joshuaalbert/bayes_tec | 655c4ec29427c7bb0616d5752c34207714a0151c | [
"Apache-2.0"
] | null | null | null | notebooks/pre_production_runs/run_solver_kern_opt.py | Joshuaalbert/bayes_tec | 655c4ec29427c7bb0616d5752c34207714a0151c | [
"Apache-2.0"
] | null | null | null | notebooks/pre_production_runs/run_solver_kern_opt.py | Joshuaalbert/bayes_tec | 655c4ec29427c7bb0616d5752c34207714a0151c | [
"Apache-2.0"
] | null | null | null | from bayes_tec.solvers.phase_only_solver import PhaseOnlySolver
from bayes_tec.utils.data_utils import define_equal_subsets
from bayes_tec.logging import logging
import numpy as np
from timeit import default_timer
import gpflow as gp
from bayes_tec.utils.stat_utils import log_normal_solve, log_normal_solve_fwhm
from gp... | 56.195402 | 377 | 0.703723 |
0c1ed814d7601cb720f27ab7ce9ec216496e14a5 | 628 | py | Python | olwi/hw/system.py | molkoback/olwi | 449874a1de1a9addaaefe74010d49ca0fa2f9ce3 | [
"MIT"
] | null | null | null | olwi/hw/system.py | molkoback/olwi | 449874a1de1a9addaaefe74010d49ca0fa2f9ce3 | [
"MIT"
] | null | null | null | olwi/hw/system.py | molkoback/olwi | 449874a1de1a9addaaefe74010d49ca0fa2f9ce3 | [
"MIT"
] | 1 | 2021-11-23T07:19:00.000Z | 2021-11-23T07:19:00.000Z | import psutil
import time
def _cpu():
return psutil.getloadavg()
def _uptime():
tmp = int(time.time() - psutil.boot_time())
s = tmp % 60
tmp //= 60
m = tmp % 60
tmp //= 60
h = tmp % 24
tmp //= 24
return tmp, h, m, s
def _memory():
mem = psutil.virtual_memory()
return {
"total": round(mem.total/(1024**3... | 16.102564 | 44 | 0.585987 |
13bb01e466c735f27fe0a613acc049813ea2ed45 | 180 | py | Python | 02-19-Cuma/tryExcept.py | cihatdev/misha-staj | d0ee95d5e77a7d7a1f16611d49c87be429a25b31 | [
"MIT"
] | 9 | 2021-03-16T20:21:54.000Z | 2022-01-08T09:15:10.000Z | 02-19-Cuma/tryExcept.py | cihatdev/misha-staj | d0ee95d5e77a7d7a1f16611d49c87be429a25b31 | [
"MIT"
] | 1 | 2021-02-28T21:27:17.000Z | 2021-02-28T21:27:17.000Z | 02-19-Cuma/tryExcept.py | cihatdev/misha-staj | d0ee95d5e77a7d7a1f16611d49c87be429a25b31 | [
"MIT"
] | 1 | 2021-05-24T11:34:48.000Z | 2021-05-24T11:34:48.000Z | try:
answer = 10 / 0
number = int(input("Enter a number: "))
print(number)
except ZeroDivisionError as err:
print(err)
except ValueError:
print("invalid input") | 22.5 | 43 | 0.655556 |
bb272776e6b7d9e5ad4294a1474079895d8768fc | 2,861 | py | Python | scripts/cloud_results.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | 35 | 2020-12-30T19:31:30.000Z | 2022-03-28T11:10:00.000Z | scripts/cloud_results.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | 24 | 2021-01-04T15:37:05.000Z | 2022-03-14T00:45:20.000Z | scripts/cloud_results.py | mcopik/serverless-benchmarks | 3b57688873853a1ea74e10b02a9d89f3a4d679ac | [
"BSD-3-Clause"
] | 10 | 2021-06-13T13:13:39.000Z | 2021-12-20T22:05:50.000Z | #!python3
import argparse
import datetime
import json
import os
from experiments_utils import *
from cache import cache
sys.path.append(PROJECT_DIR)
parser = argparse.ArgumentParser(description='Run cloud experiments.')
parser.add_argument('experiment_json', type=str, help='Path to JSON summarizing experiment.')
pa... | 35.7625 | 97 | 0.74065 |
9206634b3029debb11e97fbb67d50890d57fd67a | 430 | py | Python | management/pycom_functions/data_formatting/format_data_raw.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | 2 | 2021-04-03T13:19:32.000Z | 2022-01-03T00:38:55.000Z | management/pycom_functions/data_formatting/format_data_raw.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | null | null | null | management/pycom_functions/data_formatting/format_data_raw.py | AaltoIIC/OSEMA | 38740e3dcfeb72a6d87e25190e6a73f6c60b199b | [
"MIT"
] | null | null | null | def format_data(header_ts, data):
data_string = "Begin:{}\n".format(convert_to_epoch(header_ts))
data_string += "Variables:{"
for variable in VARIABLE_NAMES:
data_string += str(variable) + ", "
data_string += "time }\n"
data_string += "Data:"
for value_pair in data:
ts_packed = u... | 35.833333 | 66 | 0.644186 |
6a9eee86e04553bbb971a8153bb2615a43144c4b | 4,427 | py | Python | model.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 6 | 2019-08-27T16:12:51.000Z | 2020-04-18T04:38:45.000Z | model.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 4 | 2019-09-15T07:44:58.000Z | 2020-04-21T06:33:55.000Z | model.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 1 | 2019-12-10T14:37:38.000Z | 2019-12-10T14:37:38.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from nets import resnet_v2
slim = tf.contrib.slim
batch_norm_params = {
'decay': 0.997, # batch_norm_decay
'epsilon': 1e-5, # batch_norm_epsilon
'scale': True, # batch_... | 35.416 | 102 | 0.574881 |
bd4beedb8c92897ed42a35c601c600a6d6c925d5 | 65,611 | py | Python | andriller/windows.py | pshem/andriller | c1e2d9e05f3630a7499907190552089be18563c5 | [
"MIT"
] | 2 | 2021-11-22T03:38:06.000Z | 2022-01-12T23:07:15.000Z | andriller/windows.py | pshem/andriller | c1e2d9e05f3630a7499907190552089be18563c5 | [
"MIT"
] | null | null | null | andriller/windows.py | pshem/andriller | c1e2d9e05f3630a7499907190552089be18563c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
import json
import glob
import struct
import string
import shutil
import os.path
import pathlib
import logging
import binascii
import datetime
import functools
import itertools
import contextlib
import webbrowser
import tkinter as tk
from tkinter import ttk, font, filedialog, messageb... | 43.740667 | 142 | 0.594199 |
1b3dd669ba387413c8881d7450738bd57338f7cd | 2,022 | py | Python | src/hanko_sdk/models/authentication_finalization.py | teamhanko/hanko-python | 2455861b6edc3c393dde7ed62635f96c88b1350f | [
"Apache-2.0"
] | 1 | 2022-03-08T06:38:22.000Z | 2022-03-08T06:38:22.000Z | src/hanko_sdk/models/authentication_finalization.py | teamhanko/hanko-python | 2455861b6edc3c393dde7ed62635f96c88b1350f | [
"Apache-2.0"
] | null | null | null | src/hanko_sdk/models/authentication_finalization.py | teamhanko/hanko-python | 2455861b6edc3c393dde7ed62635f96c88b1350f | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import ClassVar
from enforce_typing import enforce_types
from .assertion import CredentialAssertionResponse, AuthenticatorAssertionResponse
from .base64_entities import UrlEncodedBase64
from .base_model import BaseModel
from .core import Credential
from .options import Cr... | 37.444444 | 161 | 0.757666 |
cfa9c02ead1642db9cf3d74e5c76ae8034f12ef1 | 35,563 | py | Python | pkgs/tools/yasm/src/tools/python-yasm/pyxelator/ir.py | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | pkgs/tools/yasm/src/tools/python-yasm/pyxelator/ir.py | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | pkgs/tools/yasm/src/tools/python-yasm/pyxelator/ir.py | manggoguy/parsec-modified | d14edfb62795805c84a4280d67b50cca175b95af | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
""" ir.py - parse c declarations
(c) 2002, 2003, 2004, 2005 Simon Burton <simon@arrowtheory.com>
Released under GNU LGPL license.
version 0.xx
"""
import sys
#import cPickle as pickle
import pickle
#from lexer import Lexer
from parse_core import Symbols #, Parser
import node as node_module
im... | 30.552405 | 117 | 0.534404 |
0d434e05acfff2841e27613c15863c99e20abe10 | 659 | py | Python | util/bus.py | krisgesling/mycroft-timer | e4db07688d72a398223d43225be2f1b63d7500cd | [
"Apache-2.0"
] | null | null | null | util/bus.py | krisgesling/mycroft-timer | e4db07688d72a398223d43225be2f1b63d7500cd | [
"Apache-2.0"
] | null | null | null | util/bus.py | krisgesling/mycroft-timer | e4db07688d72a398223d43225be2f1b63d7500cd | [
"Apache-2.0"
] | null | null | null | from time import sleep
# TODO remove this in v20.8 when it should be available in mycroft-core
def wait_for_message(bus, message_type, timeout=8):
"""Wait for specified Message type on the bus.
Arguments:
bus: an instance of the message bus to listen on
message_type: the Message type to wait ... | 29.954545 | 71 | 0.705615 |
d3cde04f8f1cf49f6ec0f2fd31f38e16f1f37107 | 6,887 | py | Python | tests/plugins/trackers/kinozal/test_kinozalplugin.py | mortifactor/monitorrent | 2388ec5b82af5d078fa7e37930d3b66b4a797954 | [
"WTFPL"
] | 465 | 2015-08-31T09:16:41.000Z | 2022-03-12T10:33:04.000Z | tests/plugins/trackers/kinozal/test_kinozalplugin.py | mortifactor/monitorrent | 2388ec5b82af5d078fa7e37930d3b66b4a797954 | [
"WTFPL"
] | 340 | 2015-07-18T17:31:54.000Z | 2022-03-30T15:16:25.000Z | tests/plugins/trackers/kinozal/test_kinozalplugin.py | mortifactor/monitorrent | 2388ec5b82af5d078fa7e37930d3b66b4a797954 | [
"WTFPL"
] | 87 | 2015-07-18T10:52:24.000Z | 2022-03-27T09:52:35.000Z | # coding=utf-8
import pytz
from datetime import datetime
from mock import patch
from monitorrent.plugins.trackers import LoginResult, TrackerSettings
from monitorrent.plugins.trackers.kinozal import KinozalPlugin, KinozalLoginFailedException, KinozalTopic
from monitorrent.plugins.trackers.kinozal import KinozalDatePars... | 45.309211 | 111 | 0.706113 |
0d7586a8298a739e7d2abb6b72a7b0ad6e0ddb93 | 1,367 | py | Python | test/jpypetest/test_charSequence.py | yinhejianke/jpype | 257f2b010b32bb0f18d971e0e915849642c3cf1a | [
"Apache-2.0"
] | 1 | 2020-01-03T06:03:14.000Z | 2020-01-03T06:03:14.000Z | test/jpypetest/test_charSequence.py | yinhejianke/jpype | 257f2b010b32bb0f18d971e0e915849642c3cf1a | [
"Apache-2.0"
] | null | null | null | test/jpypetest/test_charSequence.py | yinhejianke/jpype | 257f2b010b32bb0f18d971e0e915849642c3cf1a | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# Copyright 2019 Karl Einar Nelson
#
# 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://... | 36.945946 | 79 | 0.623263 |
6a5f8ce74a376c0f86860d25ec0f5653a63d149a | 3,490 | py | Python | notebooks/a2/sgd.py | cicorias/scpd-xcs224n-general | 783c4ed127fc06ea2cc92f05c0bb47debb73928e | [
"Apache-2.0"
] | null | null | null | notebooks/a2/sgd.py | cicorias/scpd-xcs224n-general | 783c4ed127fc06ea2cc92f05c0bb47debb73928e | [
"Apache-2.0"
] | null | null | null | notebooks/a2/sgd.py | cicorias/scpd-xcs224n-general | 783c4ed127fc06ea2cc92f05c0bb47debb73928e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Save parameters every a few SGD iterations as fail-safe
SAVE_PARAMS_EVERY = 5000
import pickle
import glob
import random
import numpy as np
import os.path as op
def load_saved_params():
"""
A helper function that loads previously saved parameters and resets
iteration start.
""... | 26.439394 | 75 | 0.595129 |
40aea50e166c5ac2781c41ab41e42b8eda87d50e | 1,508 | py | Python | packages/pyre/framework/Dashboard.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 25 | 2018-04-23T01:45:39.000Z | 2021-12-10T06:01:23.000Z | packages/pyre/framework/Dashboard.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 53 | 2018-05-31T04:55:00.000Z | 2021-10-07T21:41:32.000Z | packages/pyre/framework/Dashboard.py | avalentino/pyre | 7e1f0287eb7eba1c6d1ef385e5160079283ac363 | [
"BSD-3-Clause"
] | 12 | 2018-04-23T22:50:40.000Z | 2022-02-20T17:27:23.000Z | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2021 all rights reserved
#
# declaration
class Dashboard:
"""
Mix-in class that provides access to the pyre executive and its managers
"""
# grab the base of all pyre exceptions
from .exceptions import PyreError
# publ... | 25.559322 | 76 | 0.637931 |
6e84a1a991f5d28ae363947ccea1b1c89f1f97db | 2,657 | py | Python | hydra/_internal/grammar/functions.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | 5,847 | 2019-10-03T04:20:44.000Z | 2022-03-31T17:07:46.000Z | hydra/_internal/grammar/functions.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | 1,393 | 2019-10-04T01:03:38.000Z | 2022-03-31T20:29:35.000Z | hydra/_internal/grammar/functions.py | sara-nl/hydra | 8fd0d23d71cf528528ca5eda26e0c1f0c1e973d7 | [
"MIT"
] | 505 | 2019-10-03T19:41:42.000Z | 2022-03-31T11:40:16.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import inspect
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, List
from omegaconf._utils import type_str
from hydra._internal.grammar.utils import is_type_matching
from hydra.core.override_parser.types import Quot... | 34.960526 | 98 | 0.587505 |
bc6a1fd5b133043c991687da49f403d764a91033 | 6,915 | py | Python | SleepEDF/tensorflow_net/deep_cnn_baseline_1to3/equaldatagenerator_from_list_v2.py | sajjadkarimi91/MultitaskSleepNet | 80c45e30467fde0f8303e5deabacd4988ab387b0 | [
"MIT"
] | 29 | 2018-10-24T09:42:50.000Z | 2022-03-18T07:03:21.000Z | SleepEDF/tensorflow_net/deep_cnn_baseline_1to3/equaldatagenerator_from_list_v2.py | sajjadkarimi91/MultitaskSleepNet | 80c45e30467fde0f8303e5deabacd4988ab387b0 | [
"MIT"
] | 3 | 2018-09-25T08:53:44.000Z | 2020-08-16T12:37:15.000Z | SleepEDF/tensorflow_net/deep_cnn_baseline_1to3/equaldatagenerator_from_list_v2.py | sajjadkarimi91/MultitaskSleepNet | 80c45e30467fde0f8303e5deabacd4988ab387b0 | [
"MIT"
] | 17 | 2018-09-25T15:12:31.000Z | 2022-02-23T09:38:39.000Z | # load data from mat files and generate batch-by-batch with equal sampling for different classes
# This is used when balancing data between different classes in a data batch for training
import numpy as np
from scipy.io import loadmat
import h5py
class EqualDataGenerator:
def __init__(self, filelist, data_shape=np... | 36.97861 | 127 | 0.586985 |
a8813799a0c0c565a262533d989f36568740e542 | 4,120 | py | Python | workspace_tools/export/uvision5.py | OmarValdez/mbed | bd78f98496fab2f02162521d7e279d7bd0f0840e | [
"Apache-2.0"
] | null | null | null | workspace_tools/export/uvision5.py | OmarValdez/mbed | bd78f98496fab2f02162521d7e279d7bd0f0840e | [
"Apache-2.0"
] | null | null | null | workspace_tools/export/uvision5.py | OmarValdez/mbed | bd78f98496fab2f02162521d7e279d7bd0f0840e | [
"Apache-2.0"
] | null | null | null | """
mbed SDK
Copyright (c) 2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing... | 45.777778 | 144 | 0.673301 |
e92bb226c43a5e3e4520c9c4ba92e52ace04d4e6 | 1,002 | py | Python | kubernetes_asyncio/test/test_v1_local_volume_source.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_local_volume_source.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_local_volume_source.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 25.05 | 124 | 0.735529 |
104dd58ba1eb3de188d2d739e59cc6e16d17428d | 6,442 | py | Python | sdk/python/pulumi_azure_native/network/v20190801/get_route_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/get_route_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20190801/get_route_table.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 34.449198 | 183 | 0.638777 |
b71e2c5fdccbcfa58acb8ebdc0803e4557887ab4 | 8,086 | py | Python | scripts/kernelBinaryClassifDemo.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 2 | 2021-04-10T18:12:19.000Z | 2021-05-11T12:07:40.000Z | scripts/kernelBinaryClassifDemo.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 1 | 2021-04-19T12:25:26.000Z | 2021-04-19T12:25:26.000Z | scripts/kernelBinaryClassifDemo.py | always-newbie161/pyprobml | eb70c84f9618d68235ef9ba7da147c009b2e4a80 | [
"MIT"
] | 1 | 2021-01-17T08:46:00.000Z | 2021-01-17T08:46:00.000Z | import numpy as np
import h5py
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
from sklearn.kernel_approximation import RBFSampler
# Relevance Vector Machine Classifier using EM algorithm by Michael E. ... | 39.062802 | 165 | 0.593371 |
ef1cce3d6eef4dd0221050bfd6d3909a6597e76d | 26,948 | py | Python | Climate_v1.1.py | gschivley/co-fire | b364063fe36b733aee2a903b7d570d2ab11b9096 | [
"MIT"
] | 2 | 2015-10-28T15:49:10.000Z | 2019-09-15T06:08:10.000Z | Climate_v1.1.py | gschivley/co-fire | b364063fe36b733aee2a903b7d570d2ab11b9096 | [
"MIT"
] | null | null | null | Climate_v1.1.py | gschivley/co-fire | b364063fe36b733aee2a903b7d570d2ab11b9096 | [
"MIT"
] | 2 | 2016-12-06T10:16:24.000Z | 2021-05-18T12:51:21.000Z |
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 18 16:09:30 2014
@author: Greg
"""
import numpy as np
from scipy.interpolate import interp1d
from scipy.signal import fftconvolve
from scipy.integrate import cumtrapz
# Radiative efficiencies of each gas, calculated from AR5 & AR5 SM
co2_re, ch4_re, n2o_re, sf6_re = ... | 41.016743 | 89 | 0.639417 |
dccba77e47dd5c2a8f9b631a6c099d0742c65293 | 7,802 | py | Python | third_party/python/Lib/test/libregrtest/runtest_mp.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | third_party/python/Lib/test/libregrtest/runtest_mp.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | third_party/python/Lib/test/libregrtest/runtest_mp.py | appotry/cosmopolitan | af4687cc3f2331a23dc336183ab58fe001cda082 | [
"ISC"
] | null | null | null | import faulthandler
import json
import os
import queue
import sys
import time
import traceback
import types
from test import support
try:
import _thread
import threading
except ImportError:
print("Multiprocess option requires thread support")
sys.exit(2)
from test.libregrtest.runtest import (
runte... | 31.333333 | 79 | 0.59536 |
b863adacf420596c7df16c370c5b4fbce57208ad | 429 | py | Python | server/src/schemas/userfile.py | Sheerabth/blob-system | 808f1591247fecace4cbd121053d79205096ced3 | [
"MIT"
] | null | null | null | server/src/schemas/userfile.py | Sheerabth/blob-system | 808f1591247fecace4cbd121053d79205096ced3 | [
"MIT"
] | null | null | null | server/src/schemas/userfile.py | Sheerabth/blob-system | 808f1591247fecace4cbd121053d79205096ced3 | [
"MIT"
] | null | null | null | from typing import Optional
from pydantic import BaseModel
from src.db.models import Permissions
class UserFileBaseSchema(BaseModel):
user_id: str
access_type: Permissions
class Config:
orm_mode = True
class UserFileSchema(UserFileBaseSchema):
file_id: str
class UserFileInfoSchema(UserFi... | 17.16 | 41 | 0.762238 |
87c40e3638021744a10188b745babc8fa206ce8d | 562 | py | Python | backend/src/local_settings.py | oopaze/portifolio-josepedro | 6f8f84290f81ee3bef4556da690e64fbcc8f8893 | [
"MIT"
] | 1 | 2021-12-30T12:07:43.000Z | 2021-12-30T12:07:43.000Z | backend/src/local_settings.py | oopaze/portifolio-josepedro-backend | 6f8f84290f81ee3bef4556da690e64fbcc8f8893 | [
"MIT"
] | 1 | 2021-11-04T04:50:31.000Z | 2021-11-04T04:50:31.000Z | backend/src/local_settings.py | oopaze/portifolio-josepedro | 6f8f84290f81ee3bef4556da690e64fbcc8f8893 | [
"MIT"
] | null | null | null |
import os
from pathlib import Path
from dotenv import load_dotenv
BASE_DIR = Path(__file__).resolve().parent.parent
dotenv_path = BASE_DIR / '.env.dev'
load_dotenv(dotenv_path)
SITE_URL = os.getenv("SITE_URL", default='http://localhost:8000')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.p... | 23.416667 | 65 | 0.642349 |
64cd8696d555e2600dc9d27d40cfcc53faef2066 | 5,263 | py | Python | src/cfnlint/rules/parameters/Default.py | sthagen/aws-cloudformation-cfn-lint | 8628b2bab208acb2ac7843d2cadf7b56252058f7 | [
"MIT-0"
] | 445 | 2018-04-19T14:43:33.000Z | 2019-03-01T11:00:21.000Z | src/cfnlint/rules/parameters/Default.py | sthagen/cfn-lint | 80c8211eb028b374fdf547f21a8e218248dedc89 | [
"MIT-0"
] | 464 | 2018-04-19T17:29:50.000Z | 2019-03-01T14:20:19.000Z | src/cfnlint/rules/parameters/Default.py | sthagen/cfn-lint | 80c8211eb028b374fdf547f21a8e218248dedc89 | [
"MIT-0"
] | 93 | 2018-04-19T14:55:35.000Z | 2019-03-01T03:26:47.000Z | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import re
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class Default(CloudFormationLintRule):
"""Check if Parameters are configured correctly"""
id = 'E2015'
sh... | 36.548611 | 124 | 0.551777 |
4944d4ae9771e03d4307d4fd90963f258c099ab8 | 8,044 | py | Python | cacheTraceAnalysis/core/traceStat.py | Thesys-lab/cacheWorkloadAnalysisOSDI20 | cfc5bbb5c8d909571546c78c247561c9db449469 | [
"Apache-2.0"
] | 6 | 2020-11-12T07:51:02.000Z | 2022-03-27T20:20:01.000Z | cacheTraceAnalysis/core/traceStat.py | Thesys-lab/InMemoryCachingWorkloadAnalysis | 5f6f9f7e29a164478f3fc28eb64c170bbbafdec7 | [
"Apache-2.0"
] | null | null | null | cacheTraceAnalysis/core/traceStat.py | Thesys-lab/InMemoryCachingWorkloadAnalysis | 5f6f9f7e29a164478f3fc28eb64c170bbbafdec7 | [
"Apache-2.0"
] | 1 | 2021-12-31T01:16:09.000Z | 2021-12-31T01:16:09.000Z | # coding=utf-8
"""
this module calculates the stat of the trace
"""
from pprint import pformat
from collections import defaultdict
class TraceStat:
"""
this class provides statistics calculation of a given trace
"""
def __init__(self, reader, top_N_popular=8):
self.reader = reader
... | 38.304762 | 172 | 0.570985 |
663ed3c36ba367852d899279a7e335bb7dad02fc | 3,133 | py | Python | copula/bayes_birth_only_frank.py | PetropoulakisPanagiotis/copula | d6ff9751539e948f88dd529f4f4fe8f2d86c05bd | [
"MIT"
] | 8 | 2020-04-09T14:20:49.000Z | 2021-12-24T19:17:58.000Z | copula/bayes_birth_only_frank.py | PetropoulakisPanagiotis/copula | d6ff9751539e948f88dd529f4f4fe8f2d86c05bd | [
"MIT"
] | null | null | null | copula/bayes_birth_only_frank.py | PetropoulakisPanagiotis/copula | d6ff9751539e948f88dd529f4f4fe8f2d86c05bd | [
"MIT"
] | 1 | 2020-04-09T13:59:32.000Z | 2020-04-09T13:59:32.000Z | from __future__ import division
from allclayton import allclayton
from allgumbel import allgumbel
from allfrank import allfrank
from pandas import read_excel
from bayes_birth_frank import *
import numpy as np
def bayes_birth_only_frank(currentModel, newModel, kn, u, v, s, q, Q, zita, chain):
current = np.sort(cu... | 29.009259 | 95 | 0.487392 |
fc90fb47e1d78ff00bce415c2679c28db7839f64 | 10,277 | py | Python | bw2io/strategies/ecospold2.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/ecospold2.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | bw2io/strategies/ecospold2.py | mfastudillo/brightway2-io | dc383ddb6003a46e78259aeb7f87b9d80965d689 | [
"BSD-3-Clause"
] | null | null | null | from .migrations import migrate_exchanges, migrations
from ..utils import format_for_logging, es2_activity_hash
from bw2data import Database
from bw2data.logs import get_io_logger, close_log
from stats_arrays import (
LognormalUncertainty,
UndefinedUncertainty,
)
import math
import warnings
def link_biosphere... | 33.366883 | 287 | 0.5776 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.