hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
808b83cd4a03ada23ba7b0d19c7fdff35b5b8ea3 | 978 | py | Python | models_test.py | bmritz/spend-tracker | 093ace1a3ec20b0d9e0d918ca9e074ecfd03734c | [
"Apache-2.0"
] | 1 | 2019-01-20T17:09:50.000Z | 2019-01-20T17:09:50.000Z | models_test.py | bmritz/spend-tracker | 093ace1a3ec20b0d9e0d918ca9e074ecfd03734c | [
"Apache-2.0"
] | null | null | null | models_test.py | bmritz/spend-tracker | 093ace1a3ec20b0d9e0d918ca9e074ecfd03734c | [
"Apache-2.0"
] | null | null | null | """Tests."""
from models import Message
def test_msg_to_sections():
msg_content = """---------- Forwarded message ---------
From: Personal Capital <support@personalcapital.com>
Date: Sat, Jan 12, 2019 at 9:28 AM
Subject: Your Personal Capital Daily Monitor Email
To: bmritz@indiana.edu <bmritz@ind... | 21.733333 | 104 | 0.643149 |
c5cf133fb6229e37733476f874a7adca4849c3bd | 4,845 | py | Python | framework/communication/aiocoap/util/prettyprint.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | 1 | 2021-02-13T07:42:04.000Z | 2021-02-13T07:42:04.000Z | framework/communication/aiocoap/util/prettyprint.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | null | null | null | framework/communication/aiocoap/util/prettyprint.py | nidiascampos/smartgreen | d574d90918702ac3bd383ed77d673f871576c5b0 | [
"Apache-2.0"
] | null | null | null | # This file is part of the Python aiocoap library project.
#
# Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>,
# 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at>
#
# aiocoap is free software, this file is published under the MIT license as
# described in the accompany... | 36.704545 | 103 | 0.62807 |
a28f9571e669dd85d7d84017dcdb5dfd0a03f0af | 129 | py | Python | oktacli/exceptions.py | bousquf/okta-cli | 8073ee171bd0ae690f087fa8f3260cbd24cefbda | [
"MIT"
] | 28 | 2019-02-10T00:10:36.000Z | 2022-03-02T14:33:36.000Z | oktacli/exceptions.py | bousquf/okta-cli | 8073ee171bd0ae690f087fa8f3260cbd24cefbda | [
"MIT"
] | 9 | 2020-03-27T03:39:08.000Z | 2021-12-03T21:09:57.000Z | oktacli/exceptions.py | bousquf/okta-cli | 8073ee171bd0ae690f087fa8f3260cbd24cefbda | [
"MIT"
] | 11 | 2019-04-30T06:26:41.000Z | 2022-02-06T03:41:31.000Z | # OktaException is defined in okta.py :)
class CLIException(Exception):
pass
class ExitException(CLIException):
pass
| 12.9 | 40 | 0.728682 |
015a22c4577c9e770eee669f9a35b646e30e1397 | 7,274 | py | Python | benchmarks/test_utils.py | tbeatty/edgetpu | 14237f65ba07b7b1d8287e9f60dd20c88562871a | [
"Apache-2.0"
] | 1 | 2020-02-05T15:12:53.000Z | 2020-02-05T15:12:53.000Z | benchmarks/test_utils.py | tbeatty/edgetpu | 14237f65ba07b7b1d8287e9f60dd20c88562871a | [
"Apache-2.0"
] | null | null | null | benchmarks/test_utils.py | tbeatty/edgetpu | 14237f65ba07b7b1d8287e9f60dd20c88562871a | [
"Apache-2.0"
] | 1 | 2020-01-08T05:55:58.000Z | 2020-01-08T05:55:58.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 32.328889 | 80 | 0.659747 |
e785c76ea0b95dd944a0359055ea67b92fd0e617 | 3,427 | py | Python | ElevatorBot/commands/destiny/weapon.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 3 | 2019-10-19T11:24:50.000Z | 2021-01-29T12:02:17.000Z | ElevatorBot/commands/destiny/weapon.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 29 | 2019-10-14T12:26:10.000Z | 2021-07-28T20:50:29.000Z | ElevatorBot/commands/destiny/weapon.py | LukasSchmid97/destinyBloodoakStats | 1420802ce01c3435ad5c283f44eb4531d9b22c38 | [
"MIT"
] | 2 | 2019-10-13T17:11:09.000Z | 2020-05-13T15:29:04.000Z | # from discord.ext.commands import Cog
# from discord_slash import cog_ext
# from discord_slash import SlashContext
# from discord_slash.utils.manage_commands import create_choice
# from discord_slash.utils.manage_commands import create_option
#
# from ElevatorBot.commandHelpers.optionTemplates import default_user_opti... | 39.390805 | 123 | 0.520572 |
98f3acd2ee3e29a26696c320111aba7876c64021 | 1,138 | py | Python | setup.py | aprendizaje-de-maquinas/addict | 54f00e3e3d32446571996f2050b831b5fe6f9a52 | [
"MIT"
] | 1 | 2019-12-14T15:35:10.000Z | 2019-12-14T15:35:10.000Z | setup.py | mbenhaddou/addict | cf29d47eab24a7d935cb6841d13eac686dcd6e86 | [
"MIT"
] | null | null | null | setup.py | mbenhaddou/addict | cf29d47eab24a7d935cb6841d13eac686dcd6e86 | [
"MIT"
] | null | null | null | from setuptools import setup
import addict
SHORT='Addict is a dictionary whose items can be set using both attribute and item syntax.'
LONG=('Addict is a module that exposes a dictionary subclass that allows items to be set like attributes. '
'Values are gettable and settable using both attribute and item syntax.... | 36.709677 | 107 | 0.666081 |
764e7d831f594f8fd48a09d869bad37feb65fb1b | 19,987 | py | Python | fireworks/core/message_test.py | kellylab/Fireworks | ff027cd8d1b8ce5eec6a37d786e7de675d8c0849 | [
"MIT"
] | 9 | 2019-05-01T01:22:10.000Z | 2020-12-08T15:41:13.000Z | fireworks/core/message_test.py | smk508/Fireworks | ff027cd8d1b8ce5eec6a37d786e7de675d8c0849 | [
"MIT"
] | 53 | 2019-01-20T17:02:38.000Z | 2019-03-24T18:00:08.000Z | fireworks/core/message_test.py | smk508/Fireworks | ff027cd8d1b8ce5eec6a37d786e7de675d8c0849 | [
"MIT"
] | 4 | 2019-07-04T15:39:46.000Z | 2021-08-17T04:59:25.000Z | from fireworks import message as messi
from fireworks import Message, TensorMessage
import torch
import os
import numpy as np
from itertools import product
import pandas as pd
from itertools import count
from io import BytesIO
import pickle
tensors = {
'a': torch.Tensor([1,2,3]),
'b': torch.Tensor([4,5,6]),
... | 30.100904 | 161 | 0.551609 |
014443d27280436fa9155d28fe25026c95ccd13f | 4,361 | py | Python | Spyder/newsSpyder-.py | Ironstarboy/DataSciBasic | 6fb5af851388a3d6dfab7c3bcc6916f3e19ba654 | [
"MIT"
] | 1 | 2021-04-30T12:53:03.000Z | 2021-04-30T12:53:03.000Z | Spyder/newsSpyder-.py | Ironstarboy/DataSciBasic | 6fb5af851388a3d6dfab7c3bcc6916f3e19ba654 | [
"MIT"
] | null | null | null | Spyder/newsSpyder-.py | Ironstarboy/DataSciBasic | 6fb5af851388a3d6dfab7c3bcc6916f3e19ba654 | [
"MIT"
] | 3 | 2021-03-06T07:55:26.000Z | 2021-04-30T12:52:58.000Z | import datetime
from fake_useragent import UserAgent
import requests
import re
import os
from bs4 import BeautifulSoup as bs
import time
import random
def show_time(seconds):
m, s = divmod(seconds, 60)
h, m = divmod(m, 60)
return "%d:%02d:%02d" % (h, m, s)
def get_random_header():#随机头
ua = UserAgent()... | 31.601449 | 387 | 0.649163 |
6497c3c632d6649abc1604de6e48ee44ba18552d | 598 | py | Python | outros-codigos/beautiful.py | Exterminus/WebScrapingSecomp | 18a8a079dcb995f965e6a346724f4bbb585ce706 | [
"MIT"
] | 1 | 2018-09-14T04:14:43.000Z | 2018-09-14T04:14:43.000Z | outros-codigos/beautiful.py | Exterminus/WebScrapingSecomp | 18a8a079dcb995f965e6a346724f4bbb585ce706 | [
"MIT"
] | null | null | null | outros-codigos/beautiful.py | Exterminus/WebScrapingSecomp | 18a8a079dcb995f965e6a346724f4bbb585ce706 | [
"MIT"
] | 1 | 2018-09-14T04:14:45.000Z | 2018-09-14T04:14:45.000Z | from bs4 import BeautifulSoup
html_doc = """
<!DOCTYPE html>
<html lang='pt' dir="ltr">
<head>
<meta charset="utf-8">
<title>Título</title>
</head>
<body>
<div id= 'msg_1' class= 'mensagens'>
<p>Meu nome é Thrawn</p>
<div>
<div id= 'msg_2' class= 'mensagens' >
<p>Olá meu nome é Vader</p>
<... | 22.148148 | 45 | 0.628763 |
98071f646a1fe2d1ea33a6d4c995d73bfc35f6b3 | 5,600 | py | Python | prob_mbrl/envs/pendulum/env.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 108 | 2018-10-24T07:59:14.000Z | 2021-11-28T05:29:35.000Z | prob_mbrl/envs/pendulum/env.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 8 | 2019-08-14T00:20:13.000Z | 2019-10-18T01:45:29.000Z | prob_mbrl/envs/pendulum/env.py | Praneethsv/prob_mbrl | 7b1adee6bff742b6f90e9b96ea243f12c9153b9b | [
"MIT"
] | 14 | 2019-06-27T10:10:08.000Z | 2020-08-31T03:16:22.000Z | # Copyright (C) 2018, Anass Al
#
# 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) any later version.
#
# This program is distributed in the ... | 36.842105 | 79 | 0.565179 |
0f9be3ddba8c0711e6374e85d5c57523c385c80d | 2,276 | py | Python | src/plotting/bin/modules/decodingPotential.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | src/plotting/bin/modules/decodingPotential.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | src/plotting/bin/modules/decodingPotential.py | WoutDavid/ST-nextflow-pipeline | 8de3da218ec4f10f183e1163fe782c19fd8dd841 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
def plotDecodingPotential(decoded_genes: str, codebook: str):
decoded_genes = pd.read_csv(decoded_genes)
codebook = pd.read_csv(codebook)
# First extracts all possible "good" barcodes
true_barcode_list = [str(i) for i in list(code... | 48.425532 | 139 | 0.696397 |
57fc0e4cfad715e917a9be463b7f1ab954225f82 | 3,956 | py | Python | users/management/commands/load_sighting_data.py | maverick-labs-pune/wikirumours | 51651aae651fd88468b54d08abb8ec28a93e65fa | [
"MIT"
] | null | null | null | users/management/commands/load_sighting_data.py | maverick-labs-pune/wikirumours | 51651aae651fd88468b54d08abb8ec28a93e65fa | [
"MIT"
] | null | null | null | users/management/commands/load_sighting_data.py | maverick-labs-pune/wikirumours | 51651aae651fd88468b54d08abb8ec28a93e65fa | [
"MIT"
] | null | null | null | import csv
import datetime
import os
from django.contrib.gis.geos import Point
from django.core.management import BaseCommand, CommandError
from django.db import transaction
from geopy import Nominatim
from countries.models import Country
from report.models import Report, Sighting, ReportedViaChoice
from users.models... | 40.783505 | 112 | 0.476239 |
c38111916dbe94a58306d0cd5340e5b1aa38cb46 | 229 | py | Python | app/core/tests/test_simple_function.py | mmansuri8701/recipe-app-api | ac587d203fd09dadc06f83e5419f034bcdbc93c7 | [
"MIT"
] | null | null | null | app/core/tests/test_simple_function.py | mmansuri8701/recipe-app-api | ac587d203fd09dadc06f83e5419f034bcdbc93c7 | [
"MIT"
] | null | null | null | app/core/tests/test_simple_function.py | mmansuri8701/recipe-app-api | ac587d203fd09dadc06f83e5419f034bcdbc93c7 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from core import simple
from django.test import TestCase
class SimpleTest(TestCase):
def test_use_simple_function(self):
#result = simple.simple_function()
print(simple.simple_function()) | 22.9 | 36 | 0.79476 |
f5cd9bb57ce575298429e24c25dba42bc85929eb | 441 | py | Python | backend/work/migrations/0005_auto_20200504_0153.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 3 | 2020-03-23T19:18:00.000Z | 2021-04-12T04:01:17.000Z | backend/work/migrations/0005_auto_20200504_0153.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 95 | 2020-03-07T12:29:38.000Z | 2022-02-17T22:44:07.000Z | backend/work/migrations/0005_auto_20200504_0153.py | ecto0310/groupware | e1c9f76b19e6d1f6782f8e2b287ff75d1351fa83 | [
"MIT"
] | 2 | 2021-12-27T16:50:36.000Z | 2021-12-27T16:53:12.000Z | # Generated by Django 3.0.3 on 2020-05-03 16:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tool', '0006_delete_usertool'),
('work', '0004_auto_20200501_1600'),
]
operations = [
migrations.AlterField(
model_name=... | 22.05 | 69 | 0.594104 |
300d53333d50a06f1156024e4729e6af9b3b655d | 4,521 | py | Python | tests/test_sklearn_feature_union.py | MaxNoe/sklearn-onnx | 698c9347e7c70cbb1a2c5bba1657e6548ff5897d | [
"MIT"
] | null | null | null | tests/test_sklearn_feature_union.py | MaxNoe/sklearn-onnx | 698c9347e7c70cbb1a2c5bba1657e6548ff5897d | [
"MIT"
] | null | null | null | tests/test_sklearn_feature_union.py | MaxNoe/sklearn-onnx | 698c9347e7c70cbb1a2c5bba1657e6548ff5897d | [
"MIT"
] | 1 | 2020-10-01T09:26:27.000Z | 2020-10-01T09:26:27.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import un... | 42.252336 | 78 | 0.538376 |
86c7fb53ec475248fd25329584e82d21855e3b7a | 2,931 | py | Python | project/code/analysis/bayes.py | cycomachead/info290 | 694361cfa755daec24c773e15d5bc965411d4caf | [
"BSD-2-Clause"
] | 2 | 2015-05-12T01:21:56.000Z | 2015-07-04T21:14:06.000Z | project/code/analysis/bayes.py | cycomachead/info290 | 694361cfa755daec24c773e15d5bc965411d4caf | [
"BSD-2-Clause"
] | 1 | 2015-02-19T12:26:34.000Z | 2015-05-14T12:42:56.000Z | project/code/analysis/bayes.py | cycomachead/info290 | 694361cfa755daec24c773e15d5bc965411d4caf | [
"BSD-2-Clause"
] | null | null | null | #! /usr/bin/env python3
from pandas import *
import sklearn
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import MultinomialNB
from sklearn.grid_search import GridSearchCV
import numpy as np
import random
STYLE = "American_IPA"
""" Performs cross validation on data using a given method
Retur... | 28.182692 | 83 | 0.635278 |
bbd3d4f2166ef1066e6b144eae94c534f44e9065 | 7,696 | py | Python | cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IETF_ATM2_PVCTRAP_MIB.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IETF_ATM2_PVCTRAP_MIB.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | cisco-ios-xe/ydk/models/cisco_ios_xe/CISCO_IETF_ATM2_PVCTRAP_MIB.py | bopopescu/ACI | dd717bc74739eeed4747b3ea9e36b239580df5e1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-07-22T04:04:44.000Z | 2020-07-22T04:04:44.000Z | """ CISCO_IETF_ATM2_PVCTRAP_MIB
This MIB Module is a supplement to the
ATM\-MIB.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YLeafList, YList, LeafDataList, Bits, Empty, Decimal64
from ydk.filters import YFilter
from ydk.errors import YError, YMode... | 43.480226 | 244 | 0.633966 |
621137bd4a03944c4a8c965f6881cb12180e6a53 | 385 | py | Python | conf/wsgi.py | almazkun/dup | f188d771c02e5b4da96131c09c74ad981280e7a5 | [
"MIT"
] | null | null | null | conf/wsgi.py | almazkun/dup | f188d771c02e5b4da96131c09c74ad981280e7a5 | [
"MIT"
] | 1 | 2021-12-22T02:45:00.000Z | 2021-12-22T02:45:00.000Z | conf/wsgi.py | almazkun/dup | f188d771c02e5b4da96131c09c74ad981280e7a5 | [
"MIT"
] | null | null | null | """
WSGI config for conf project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | 22.647059 | 78 | 0.781818 |
6f8606d67bd82cc3cd92aebceaf4c27e6769369e | 12,805 | py | Python | tests/test_nat.py | abanu-ms/sonic-swss | 2cab51d11f26fa673ab08210c9422b6a31168ac3 | [
"Apache-2.0"
] | null | null | null | tests/test_nat.py | abanu-ms/sonic-swss | 2cab51d11f26fa673ab08210c9422b6a31168ac3 | [
"Apache-2.0"
] | null | null | null | tests/test_nat.py | abanu-ms/sonic-swss | 2cab51d11f26fa673ab08210c9422b6a31168ac3 | [
"Apache-2.0"
] | 1 | 2020-12-04T10:35:38.000Z | 2020-12-04T10:35:38.000Z | import time
from dvslib.dvs_common import wait_for_result
class TestNat(object):
def setup_db(self, dvs):
self.app_db = dvs.get_app_db()
self.asic_db = dvs.get_asic_db()
self.config_db = dvs.get_config_db()
def set_interfaces(self, dvs):
fvs = {"NULL": "NULL"}
self.co... | 39.039634 | 182 | 0.620773 |
e6a5916da8516ca978c7505bb56075d47bacaa77 | 826 | py | Python | tools/webcam/webcam_apis/nodes/__init__.py | ivmtorres/mmpose | 662cb50c639653ae2fc19d3421ce10bd02246b85 | [
"Apache-2.0"
] | 1 | 2022-02-13T12:27:40.000Z | 2022-02-13T12:27:40.000Z | tools/webcam/webcam_apis/nodes/__init__.py | ivmtorres/mmpose | 662cb50c639653ae2fc19d3421ce10bd02246b85 | [
"Apache-2.0"
] | null | null | null | tools/webcam/webcam_apis/nodes/__init__.py | ivmtorres/mmpose | 662cb50c639653ae2fc19d3421ce10bd02246b85 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
from .builder import NODES
from .faceswap_nodes import FaceSwapNode
from .frame_effect_nodes import (BackgroundNode, BugEyeNode, MoustacheNode,
NoticeBoardNode, PoseVisualizerNode,
SaiyanNode, SunglassesNod... | 45.888889 | 78 | 0.74092 |
c9be5f2f7eab533dd99ab06dfcdb9543e8e88a5d | 5,558 | py | Python | models/SSCNet.py | reinforcementdriving/JS3C-Net | 40326fdbebc688c10a6247f46ed08463de0db206 | [
"MIT"
] | 136 | 2020-12-07T16:05:13.000Z | 2022-03-28T11:42:23.000Z | models/SSCNet.py | reinforcementdriving/JS3C-Net | 40326fdbebc688c10a6247f46ed08463de0db206 | [
"MIT"
] | 14 | 2021-01-14T13:06:06.000Z | 2022-03-19T07:20:16.000Z | models/SSCNet.py | reinforcementdriving/JS3C-Net | 40326fdbebc688c10a6247f46ed08463de0db206 | [
"MIT"
] | 23 | 2020-12-26T12:01:12.000Z | 2022-01-20T01:24:23.000Z | # *_*coding:utf-8 *_*
"""
Author: Jiantao Gao
File: complt_sscnet.py
Date: 2020/4/27 17:46
"""
import torch
import torch.nn as nn
from models import model_utils
import spconv
def get_model(config):
return SSCNet(config)
class SSCNet_Decoder(nn.Module):
def __init__(self, input_dim, nPlanes, classes):
... | 44.111111 | 137 | 0.56765 |
1d73005832a418da8ae44cce561d109cbe46c10e | 7,765 | py | Python | GraphDefinitions.py | MojaveTom/HomeGraphing | d8e4e296f71bd153f86ce41432df2e41ce8b58c4 | [
"MIT"
] | null | null | null | GraphDefinitions.py | MojaveTom/HomeGraphing | d8e4e296f71bd153f86ce41432df2e41ce8b58c4 | [
"MIT"
] | 1 | 2019-05-25T17:17:57.000Z | 2019-05-25T17:17:57.000Z | GraphDefinitions.py | MojaveTom/HomeGraphing | d8e4e296f71bd153f86ce41432df2e41ce8b58c4 | [
"MIT"
] | null | null | null | '''
Define the schema for graph definition dictionary.
'''
import os # https://docs.python.org/3/library/os.html
import sys # https://docs.python.org/3/library/sys.html
import json # https://docs.python.org/3/library/json.html
import toml # https://github.com/... | 49.775641 | 132 | 0.61056 |
02c385d0079dcd89765916768fc7d57338c3f284 | 918 | py | Python | Pacote Dowload/CursoemVideo/ex 069.py | AMF1971/Cursoemvideo-Python | 814ce748ab72e2d6b09a4e15f943bd72b0922f8c | [
"MIT"
] | null | null | null | Pacote Dowload/CursoemVideo/ex 069.py | AMF1971/Cursoemvideo-Python | 814ce748ab72e2d6b09a4e15f943bd72b0922f8c | [
"MIT"
] | null | null | null | Pacote Dowload/CursoemVideo/ex 069.py | AMF1971/Cursoemvideo-Python | 814ce748ab72e2d6b09a4e15f943bd72b0922f8c | [
"MIT"
] | null | null | null | # Crie um programa que leia a idade e o sexo de várias pessoas. A cada pessoa cadastrada,
# o programa deverá perguntar se o usuário quer ou não continuar. No final, mostre:
#A) quantas pessoas tem mais de 18 anos.
#B) quantos homens foram cadastrados.
#C) quantas mulheres tem menos de 20 anos.
tot18 = totH = totM2... | 27.818182 | 89 | 0.608932 |
9d30dc0dbd2a639c06078643dae38c5fa0392ef7 | 11,672 | py | Python | tools/engine/tester.py | jameslong95/FasterSeg | 872e04964ea46494a6018d9915cee5476e361c27 | [
"MIT"
] | 1 | 2020-05-11T00:41:43.000Z | 2020-05-11T00:41:43.000Z | tools/engine/tester.py | jameslong95/FasterSeg | 872e04964ea46494a6018d9915cee5476e361c27 | [
"MIT"
] | null | null | null | tools/engine/tester.py | jameslong95/FasterSeg | 872e04964ea46494a6018d9915cee5476e361c27 | [
"MIT"
] | null | null | null | import os
import os.path as osp
import cv2
import numpy as np
import time
from tqdm import tqdm
import torch
import torch.nn.functional as F
import torch.multiprocessing as mp
from engine.logger import get_logger
from utils.pyt_utils import load_model, link_file, ensure_dir
from utils.img_utils import pad_image_to_sh... | 37.290735 | 97 | 0.558687 |
b58c882560a3be07791b4f51026b4399d6951a77 | 304 | py | Python | gde/models/mnist/_convnet.py | MIPT-Oulu/greedy_ensembles_training | de72d8f84f151a0398c49aaf56c1cc9c709f79b7 | [
"Apache-2.0"
] | 10 | 2021-06-01T05:15:18.000Z | 2021-12-26T03:59:53.000Z | gde/models/mnist/_convnet.py | Oulu-IMEDS/greedy_ensembles_training | de72d8f84f151a0398c49aaf56c1cc9c709f79b7 | [
"Apache-2.0"
] | null | null | null | gde/models/mnist/_convnet.py | Oulu-IMEDS/greedy_ensembles_training | de72d8f84f151a0398c49aaf56c1cc9c709f79b7 | [
"Apache-2.0"
] | 1 | 2021-06-06T07:08:43.000Z | 2021-06-06T07:08:43.000Z | from torch import nn
from gde.models.cifar import PreResNet as PreResNetMeta
class PreResNet8(PreResNetMeta):
def __init__(self, num_classes=10):
super(PreResNet8, self).__init__(
num_classes=num_classes, depth=8, dropout_rate=0
)
self.avgpool = nn.AvgPool2d(7) | 27.636364 | 60 | 0.697368 |
5f70a15b5073cda988a72f44b044dbddf9dd8331 | 13,330 | py | Python | ndcube/tests/test_ndcube.py | DanRyanIrish/ndcube | f98f97ad9e65a8ddd79f047d76c596599cf94882 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ndcube/tests/test_ndcube.py | DanRyanIrish/ndcube | f98f97ad9e65a8ddd79f047d76c596599cf94882 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | ndcube/tests/test_ndcube.py | DanRyanIrish/ndcube | f98f97ad9e65a8ddd79f047d76c596599cf94882 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import astropy.units as u
import numpy as np
import pytest
from astropy.coordinates import SkyCoord, SpectralCoord
from astropy.wcs.wcsapi import BaseHighLevelWCS, BaseLowLevelWCS
from astropy.wcs.wcsapi.wrappers import SlicedLowLevelWCS
from ndcube.tests import helpers
def generate_data(shape):
data = np.arange... | 43.562092 | 99 | 0.597299 |
d4454778c9bc57cff49a6951be433982bb587624 | 31 | py | Python | applied/encoders/__init__.py | ndoll1998/AppliedTransformers | 76cbdef6fdd765b2178af71038a61e3e71e0cec9 | [
"MIT"
] | 3 | 2020-09-02T03:51:49.000Z | 2020-09-18T14:09:48.000Z | applied/encoders/__init__.py | ndoll1998/AppliedTransformers | 76cbdef6fdd765b2178af71038a61e3e71e0cec9 | [
"MIT"
] | null | null | null | applied/encoders/__init__.py | ndoll1998/AppliedTransformers | 76cbdef6fdd765b2178af71038a61e3e71e0cec9 | [
"MIT"
] | 2 | 2021-01-30T12:37:43.000Z | 2021-05-19T06:29:31.000Z | from .huggingface import BERT
| 15.5 | 30 | 0.806452 |
4d7ab152eb8554d25021a280124e4dc0b6d9eaf0 | 3,120 | py | Python | athene/minigames/move_to_beacon/agent.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | 3 | 2018-08-27T10:49:41.000Z | 2019-01-29T14:55:45.000Z | athene/minigames/move_to_beacon/agent.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | null | null | null | athene/minigames/move_to_beacon/agent.py | alkurbatov/athene | 867797f7f7888ffab73a041eb17ec1b3753199bc | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2017-2018 Alexander Kurbatov
"""A simple agent to play in the MoveToBeacon minigame.
There is not much of machine learning inside because the purpose is
to set up a very simple agent and test that everything works on a very simple
task.
Here we use a very simple state machine... | 35.454545 | 95 | 0.651923 |
0f5f04aef3b858789498988c0576b66c0b681a12 | 1,505 | py | Python | nci-checker.py | kdruken/nci-checker-v2 | e37d24e401c01f1bad348ab64160455020828810 | [
"MIT"
] | null | null | null | nci-checker.py | kdruken/nci-checker-v2 | e37d24e401c01f1bad348ab64160455020828810 | [
"MIT"
] | null | null | null | nci-checker.py | kdruken/nci-checker-v2 | e37d24e401c01f1bad348ab64160455020828810 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
Usage: python nci-checker.py <file> [--check <options>]
Options:
--help Print this usage message and exit
--check Specify specific checkers (optional, default is all)
'''
import checkers
import sys, os
from datetime import datetime
from output import Output
def main():
star... | 19.294872 | 64 | 0.566777 |
84ba0fb7c6372e6bce7468e3c56e97d9619af051 | 1,303 | py | Python | src/random_facts.py | tehwalris/open-data-backend | 265dab05bdca16a3997e570db5ab99b5edfc04c7 | [
"MIT"
] | null | null | null | src/random_facts.py | tehwalris/open-data-backend | 265dab05bdca16a3997e570db5ab99b5edfc04c7 | [
"MIT"
] | null | null | null | src/random_facts.py | tehwalris/open-data-backend | 265dab05bdca16a3997e570db5ab99b5edfc04c7 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import json
from .path import get_path_from_root
from .memoize import memoize
from .response import json_from_df
source = {
"src_url": "https://data.stadt-zuerich.ch/dataset/prd_ssz_gang-dur-zueri_od1005",
"src_label": "Schul- und Sportdepartement, Stadt Zürich",
}
def... | 25.057692 | 85 | 0.576362 |
1a3613dff1cdfc6a420222a030f7083c34976694 | 864 | py | Python | Code Challenges/python/checkPalindrome_codesignal.py | lineality/Coding-Challenges-Study-Practice | 76d868b11b42b3bd3634f9a62abecb2e1eaac76d | [
"MIT"
] | null | null | null | Code Challenges/python/checkPalindrome_codesignal.py | lineality/Coding-Challenges-Study-Practice | 76d868b11b42b3bd3634f9a62abecb2e1eaac76d | [
"MIT"
] | 1 | 2021-06-24T17:39:48.000Z | 2021-06-24T17:39:48.000Z | Code Challenges/python/checkPalindrome_codesignal.py | lineality/Coding-Study | 76d868b11b42b3bd3634f9a62abecb2e1eaac76d | [
"MIT"
] | null | null | null | # not working, not sure why (as parts work separately
# outside of function)
# (User's) Problem
# We have:
# a string
# We need:
# is that string a paindrome? yes/no
# We must:
# boolean output
# name of function is
# checkPalindrome
# Solution (Product)
# Strategy 1:
# turn string into a list... | 24 | 66 | 0.664352 |
9d9a3f2dd8b1444db250b6addc9aec5fd940f3ca | 7,724 | py | Python | elegantrl/vrepdoggo/ddpg_steplength_difference.py | lotharelvin/ElegantRL | 602b1cf8019bef107a5e0c0d6f655f4f5a42f3ce | [
"Apache-2.0"
] | null | null | null | elegantrl/vrepdoggo/ddpg_steplength_difference.py | lotharelvin/ElegantRL | 602b1cf8019bef107a5e0c0d6f655f4f5a42f3ce | [
"Apache-2.0"
] | null | null | null | elegantrl/vrepdoggo/ddpg_steplength_difference.py | lotharelvin/ElegantRL | 602b1cf8019bef107a5e0c0d6f655f4f5a42f3ce | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
import numpy.random as rd
from collections import deque
import random
import os
import doggo_env
class ActorDPG(nn.Module):
def __init__(self, state_dim, action_dim, mid_dim):
super(ActorDPG, self).__init__()
self.device = torch.device("cuda" ... | 36.262911 | 100 | 0.611212 |
794dbd8fd6bd42e6b27c901deb0aafa877641475 | 584 | py | Python | blousebrothers/confs/management/commands/clean_conf_images.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 1 | 2022-01-27T11:58:10.000Z | 2022-01-27T11:58:10.000Z | blousebrothers/confs/management/commands/clean_conf_images.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | 5 | 2021-03-19T00:01:54.000Z | 2022-03-11T23:46:21.000Z | blousebrothers/confs/management/commands/clean_conf_images.py | sladinji/blousebrothers | 461de3ba011c0aaed3f0014136c4497b6890d086 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from blousebrothers.confs.models import Conference
class Command(BaseCommand):
help = 'Check conference images given his conference slug'
def add_arguments(self, parser):
# This is an optional argument
parser.add_argument('slug', nargs='+', ty... | 34.352941 | 62 | 0.666096 |
7ba86d8b37e0b4faac555e045f40c36f91a577d9 | 2,364 | py | Python | retrieval/biencoder/sbert_scripts/generate_sbert_predictions_biencoder.py | viswavi/dataset-recommendation | 8193e5ad5f4bad25852b565e96d943530d307422 | [
"Apache-2.0"
] | null | null | null | retrieval/biencoder/sbert_scripts/generate_sbert_predictions_biencoder.py | viswavi/dataset-recommendation | 8193e5ad5f4bad25852b565e96d943530d307422 | [
"Apache-2.0"
] | null | null | null | retrieval/biencoder/sbert_scripts/generate_sbert_predictions_biencoder.py | viswavi/dataset-recommendation | 8193e5ad5f4bad25852b565e96d943530d307422 | [
"Apache-2.0"
] | null | null | null | '''
python sbert_scripts/generate_sbert_predictions_biencoder.py \
--model-directory sbert_models/bert_hard_negatives\
--search-collection dataset_search_collection.jsonl \
--test-queries tevatron_data/test_queries.jsonl \
--output-file sbert_models/bert_hard_negatives/sbert.trec \
--results-limit ... | 41.473684 | 144 | 0.77242 |
58e0377456773f63ec9668c7d5f74eb5ab13b1e6 | 1,122 | py | Python | test/optim/test.py | wxwoods/mctorch | 7cd6eb51fdd01fa75ed9245039a4f145ba342de2 | [
"BSD-3-Clause"
] | 1 | 2019-07-23T11:20:58.000Z | 2019-07-23T11:20:58.000Z | test/optim/test.py | wxwoods/mctorch | 7cd6eb51fdd01fa75ed9245039a4f145ba342de2 | [
"BSD-3-Clause"
] | null | null | null | test/optim/test.py | wxwoods/mctorch | 7cd6eb51fdd01fa75ed9245039a4f145ba342de2 | [
"BSD-3-Clause"
] | null | null | null | import json
import torch
import torch.legacy.optim as optim
def rosenbrock(tensor):
x, y = tensor
return (1 - x) ** 2 + 100 * (y - x ** 2) ** 2
def drosenbrock(tensor):
x, y = tensor
return torch.DoubleTensor((-400 * x * (y - x ** 2) - 2 * (1 - x), 200 * (y - x ** 2)))
algorithms = {
'adadelta'... | 27.365854 | 99 | 0.524064 |
a693d1b5b602c466a43d111ceb99a4bed86dea0e | 6,142 | py | Python | tests/test_dataset.py | whn09/deepar | 7430057eb2de8c0f9b48983123e646fadadd92ce | [
"MIT"
] | null | null | null | tests/test_dataset.py | whn09/deepar | 7430057eb2de8c0f9b48983123e646fadadd92ce | [
"MIT"
] | null | null | null | tests/test_dataset.py | whn09/deepar | 7430057eb2de8c0f9b48983123e646fadadd92ce | [
"MIT"
] | null | null | null | import pandas as pd
import unittest
from deepar.dataset.time_series import MockTs, TimeSeries
class TestRecurrentTs(unittest.TestCase):
def setUp(self):
self.data_to_pad = pd.DataFrame({'feature_1': [i for i in range(6)],
'feature_2': [i for i in range(6)],
... | 47.246154 | 102 | 0.569196 |
2a7873e0d060947c9b7b9499ca082294a5dfe49b | 1,297 | py | Python | setup.py | adeo/iwc-tfc-client | f2606d8d6f6d5499e41553abb53594ca830396e5 | [
"MIT"
] | 9 | 2019-11-18T13:38:10.000Z | 2021-09-24T21:59:10.000Z | setup.py | adeo/iwc-tfc-client | f2606d8d6f6d5499e41553abb53594ca830396e5 | [
"MIT"
] | 10 | 2019-11-10T23:46:54.000Z | 2022-03-30T15:46:56.000Z | setup.py | adeo/iwc-tfc-client | f2606d8d6f6d5499e41553abb53594ca830396e5 | [
"MIT"
] | 4 | 2019-11-18T14:06:04.000Z | 2021-11-09T15:42:44.000Z | import setuptools
from tfc_client import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="tfc_client",
version=__version__,
author="Alexandre Dath for ADEO",
author_email="alex.dath@gmail.com",
license="MIT",
keywords="API Terraform TFC"... | 28.822222 | 66 | 0.607556 |
1c0fa696533ffa9356f96de6451ad369c0cc5bec | 37,870 | py | Python | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | 1 | 2020-02-17T08:18:29.000Z | 2020-02-17T08:18:29.000Z | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | src/webpy1/src/spider/ganji.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | #coding=UTF-8
'''
Created on 2011-7-6
@author: Administrator
'''
from urlparse import urlparse
import cookielib
from pyquery.pyquery import PyQuery #@UnresolvedImport
import re
import datetime #@UnusedImport
import urllib2
from lxml import etree #@UnresolvedImport
from lxml.cssselect import CSSSelector #@Unresolv... | 40.287234 | 154 | 0.528439 |
083d0746bfb5439520db3aa4334f131bb14eb840 | 504 | py | Python | tests/test_class_oelint_file_nospaces.py | QuakeSaver/oelint-adv | e03617b51c7ebdeb8ea245eb61da3e3e03195b37 | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_file_nospaces.py | QuakeSaver/oelint-adv | e03617b51c7ebdeb8ea245eb61da3e3e03195b37 | [
"BSD-2-Clause"
] | null | null | null | tests/test_class_oelint_file_nospaces.py | QuakeSaver/oelint-adv | e03617b51c7ebdeb8ea245eb61da3e3e03195b37 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from base import TestBaseClass
class TestClassOelintFileNoSpaces(TestBaseClass):
@pytest.mark.parametrize('id', ['oelint.file.nospaces'])
@pytest.mark.parametrize('occurrence', [1])
@pytest.mark.parametrize('input',
[
{
'oelint adv-test.bb':
'''
... | 24 | 67 | 0.561508 |
c02048790bdcc79c365d23bbf2b8933b8ef39f8a | 221 | py | Python | timm/loss/__init__.py | chilung/dvit_repo | e2d51717c131048b860b5dfa61b85f2a9d3438db | [
"MIT"
] | 90 | 2021-03-28T17:33:03.000Z | 2022-03-26T01:44:20.000Z | timm/loss/__init__.py | chilung/dvit_repo | e2d51717c131048b860b5dfa61b85f2a9d3438db | [
"MIT"
] | 7 | 2021-03-30T10:57:59.000Z | 2021-12-19T13:40:12.000Z | timm/loss/__init__.py | chilung/dvit_repo | e2d51717c131048b860b5dfa61b85f2a9d3438db | [
"MIT"
] | 19 | 2021-04-09T06:27:50.000Z | 2022-02-11T14:24:25.000Z | from .cross_entropy import LabelSmoothingCrossEntropy, SoftTargetCrossEntropy, SoftTargetCrossEntropyCosReg
from .jsd import JsdCrossEntropy
from .asymmetric_loss import AsymmetricLossMultiLabel, AsymmetricLossSingleLabel | 73.666667 | 107 | 0.909502 |
ed9108a60b1d5a6e468201edaa763c1004a18f0a | 55,690 | py | Python | tensorflow/c01/t9/retrain.py | tomsnail/opencv_tf_py | cf9aa7fa250546564cff56aa33b5a39991b0d8f1 | [
"Apache-2.0"
] | null | null | null | tensorflow/c01/t9/retrain.py | tomsnail/opencv_tf_py | cf9aa7fa250546564cff56aa33b5a39991b0d8f1 | [
"Apache-2.0"
] | null | null | null | tensorflow/c01/t9/retrain.py | tomsnail/opencv_tf_py | cf9aa7fa250546564cff56aa33b5a39991b0d8f1 | [
"Apache-2.0"
] | 1 | 2020-05-22T09:19:56.000Z | 2020-05-22T09:19:56.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.374443 | 99 | 0.697109 |
067fc185730d21a25cacf5ffb7e51c038af68d6e | 16,606 | py | Python | qiskit/opflow/state_fns/state_fn.py | ewinston/qiskit-sdk-py | 4d64125aba4ff31f15d0054b90437bcef352782e | [
"Apache-2.0"
] | null | null | null | qiskit/opflow/state_fns/state_fn.py | ewinston/qiskit-sdk-py | 4d64125aba4ff31f15d0054b90437bcef352782e | [
"Apache-2.0"
] | 1 | 2018-06-15T08:15:47.000Z | 2018-06-15T14:38:19.000Z | qiskit/opflow/state_fns/state_fn.py | ewinston/qiskit-sdk-py | 4d64125aba4ff31f15d0054b90437bcef352782e | [
"Apache-2.0"
] | null | null | null | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 41.10396 | 99 | 0.630917 |
1db4b1283512372db71b73b4beb3fb5090923aa3 | 12,897 | py | Python | qt_widgets/slider.py | marl0ny/grids-on-the-complex-plane | 7dfc635baad2c7cb13caf2b71055da18a57ea642 | [
"MIT"
] | null | null | null | qt_widgets/slider.py | marl0ny/grids-on-the-complex-plane | 7dfc635baad2c7cb13caf2b71055da18a57ea642 | [
"MIT"
] | null | null | null | qt_widgets/slider.py | marl0ny/grids-on-the-complex-plane | 7dfc635baad2c7cb13caf2b71055da18a57ea642 | [
"MIT"
] | null | null | null | """
Slider widgets.
"""
from . import QtWidgets, QtCore, QtGui
from .labelled_line_edit import LabelWithLineEdit
from .editable_label import EditableLabel
from typing import Any, List
class Slider(QtWidgets.QSlider):
"""
Slider class
"""
def __init__(self, slider_id: Any,
orientation... | 32.568182 | 79 | 0.593781 |
8bbb539954a8fd14a57150a79423cf45c7c0a58c | 2,660 | py | Python | src/dlqmc/mplext.py | noegroup/dlqmc-project | ed7561ec0156df6d6309e49c1276646173ec8641 | [
"MIT"
] | 3 | 2020-12-22T16:26:36.000Z | 2021-08-11T16:54:46.000Z | src/dlqmc/mplext.py | noegroup/dlqmc-project | ed7561ec0156df6d6309e49c1276646173ec8641 | [
"MIT"
] | 5 | 2020-07-26T23:13:16.000Z | 2020-07-26T23:13:45.000Z | src/dlqmc/mplext.py | noegroup/dlqmc-project | ed7561ec0156df6d6309e49c1276646173ec8641 | [
"MIT"
] | 1 | 2021-06-18T05:00:39.000Z | 2021-06-18T05:00:39.000Z | import matplotlib as mpl
import matplotlib.scale
import matplotlib.ticker
import matplotlib.transforms
import numpy as np
def corr_ene_tf(a):
with np.errstate(divide='ignore', invalid='ignore'):
out = -np.log10(1 - a)
out = np.where(a >= 1, 10, out)
return out
def corr_ene_inv_tf(a):
... | 27.142857 | 82 | 0.649248 |
890d458c330348b158dace8db272ca96bf6d74d5 | 520 | py | Python | scvi/model/__init__.py | SarahND97/scvi-tools | fbb4acf72b09cef6e4a9465255a7f95caf3f3eb5 | [
"BSD-3-Clause"
] | null | null | null | scvi/model/__init__.py | SarahND97/scvi-tools | fbb4acf72b09cef6e4a9465255a7f95caf3f3eb5 | [
"BSD-3-Clause"
] | null | null | null | scvi/model/__init__.py | SarahND97/scvi-tools | fbb4acf72b09cef6e4a9465255a7f95caf3f3eb5 | [
"BSD-3-Clause"
] | null | null | null | from ._amortizedlda import AmortizedLDA
from ._autozi import AUTOZI
from ._condscvi import CondSCVI
from ._destvi import DestVI
from ._hybridvi import HYBRIDVI
from ._linear_scvi import LinearSCVI
from ._multivi import MULTIVI
from ._peakvi import PEAKVI
from ._scanvi import SCANVI
from ._scvi import SCVI
from ._totalv... | 19.259259 | 39 | 0.709615 |
ec70417fd415953004a86eb97ef2732c6d1a1ee8 | 466 | py | Python | src/computeCentroid.py | CANGA/MIRA | 2f1214d34b884790fa8660b5208cd12495800f92 | [
"BSD-3-Clause"
] | 2 | 2019-04-23T20:28:50.000Z | 2021-08-12T15:09:49.000Z | src/computeCentroid.py | CANGA/Remapping-Intercomparison | 2f1214d34b884790fa8660b5208cd12495800f92 | [
"BSD-3-Clause"
] | 10 | 2020-03-18T17:08:39.000Z | 2021-08-15T21:09:25.000Z | src/computeCentroid.py | CANGA/Remapping-Intercomparison | 2f1214d34b884790fa8660b5208cd12495800f92 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 25 16:28:19 2019
@author: TempestGuerra
"""
import numpy as np
def computeCentroid(NP, cell):
# Centroid by averaging corner sphere-center vectors
centroid = np.mat([0.0, 0.0, 0.0])
for pp in range(NP):
centroid += cell[:, pp]... | 18.64 | 56 | 0.622318 |
ad176f8936e9c20e41422f4eeb588e62d513965d | 4,542 | py | Python | grand/backends/backend.py | aplbrain/grand | d85669df17a40834a13478ae200e984e13b41650 | [
"Apache-2.0"
] | 31 | 2020-10-16T16:46:02.000Z | 2022-03-04T20:45:05.000Z | grand/backends/backend.py | aplbrain/grand | d85669df17a40834a13478ae200e984e13b41650 | [
"Apache-2.0"
] | 15 | 2020-10-15T16:28:49.000Z | 2022-02-10T16:41:32.000Z | grand/backends/backend.py | aplbrain/grand | d85669df17a40834a13478ae200e984e13b41650 | [
"Apache-2.0"
] | null | null | null | from typing import Hashable, Iterable
import abc
import pandas as pd
class Backend(abc.ABC):
"""
Abstract base class for the management of persisted graph structure.
Do not use this class directly.
"""
def __init__(self, directed: bool = False):
"""
Create a new Backend instanc... | 23.292308 | 80 | 0.551299 |
f899e885a5bd42f51ccaf91875bccedc713efb56 | 1,181 | py | Python | setup.py | teresam856/jbrowse-jupyter | 977038e160cb6cb876aa6eb4467ed199c40c8807 | [
"Apache-2.0"
] | 2 | 2021-11-10T23:07:51.000Z | 2022-01-26T09:14:33.000Z | setup.py | teresam856/jbrowse-jupyter | 977038e160cb6cb876aa6eb4467ed199c40c8807 | [
"Apache-2.0"
] | 10 | 2021-11-08T22:28:01.000Z | 2021-12-07T08:09:13.000Z | setup.py | teresam856/jbrowse-jupyter | 977038e160cb6cb876aa6eb4467ed199c40c8807 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import setuptools
with open('requirements.txt') as f:
requires = f.read().splitlines()
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
# TODO: figure out install requires vs requirements.txt and look up classifiers
setuptools.setup(
name="jbrowse-j... | 32.805556 | 79 | 0.690093 |
280648b2a97664e8026a1eaefd6f52e3dcf1bd56 | 5,415 | py | Python | data/p3BR/R2/benchmark/startQiskit_noisy64.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy64.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit_noisy64.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=10
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 29.112903 | 140 | 0.628624 |
64b03d7997f13938552987c62ce5a666a2801b1f | 167 | py | Python | test/python/input_readlines/wsgi.py | afxcn/unit | a336928e1027af92d0c9bb2ccb369a3f9b53abae | [
"Apache-2.0"
] | 2,633 | 2017-09-06T16:10:12.000Z | 2022-03-24T07:18:45.000Z | test/python/input_readlines/wsgi.py | afxcn/unit | a336928e1027af92d0c9bb2ccb369a3f9b53abae | [
"Apache-2.0"
] | 637 | 2017-09-06T23:43:11.000Z | 2022-03-31T19:28:46.000Z | test/python/input_readlines/wsgi.py | afxcn/unit | a336928e1027af92d0c9bb2ccb369a3f9b53abae | [
"Apache-2.0"
] | 365 | 2017-09-06T22:39:55.000Z | 2022-03-29T13:06:38.000Z | def application(environ, start_response):
body = environ['wsgi.input'].readlines()
start_response('200', [('X-Lines-Count', str(len(body)))])
return body
| 27.833333 | 62 | 0.670659 |
255da472decf04a2e37315aca01e6a74140fae99 | 647 | py | Python | custom_metrics.py | ivanlen/time_series_classification_and_ensembles | 0a1d814927257a8c60fba332e7be339d46c40e00 | [
"MIT"
] | 19 | 2018-12-05T20:34:27.000Z | 2022-03-26T09:28:36.000Z | custom_metrics.py | ivanlen/time_series_classification_and_ensembles | 0a1d814927257a8c60fba332e7be339d46c40e00 | [
"MIT"
] | null | null | null | custom_metrics.py | ivanlen/time_series_classification_and_ensembles | 0a1d814927257a8c60fba332e7be339d46c40e00 | [
"MIT"
] | 12 | 2019-01-21T07:33:04.000Z | 2021-11-28T21:14:35.000Z | import tensorflow as tf
def as_keras_metric(method):
import functools
from keras import backend as K
import tensorflow as tf
@functools.wraps(method)
def wrapper(self, args, **kwargs):
""" Wrapper for turning tensorflow metrics into keras metrics """
value, update_op = method(self, ... | 30.809524 | 73 | 0.684699 |
c1c61db90c59e1732d29c608351ecc801bc95791 | 1,702 | py | Python | ooobuild/lo/ucb/x_property_set_registry_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/x_property_set_registry_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/lo/ucb/x_property_set_registry_factory.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 36.212766 | 156 | 0.758519 |
2f33e381b3a5049bc342f8772b167fe36bf9654f | 998 | gyp | Python | gpu/command_buffer/command_buffer_nacl.gyp | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | gpu/command_buffer/command_buffer_nacl.gyp | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | gpu/command_buffer/command_buffer_nacl.gyp | JasonEric/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'includes': [
'../../build/common_untrusted.gypi',
'command_buffer.gypi',
],
'conditions': ... | 26.972973 | 72 | 0.532064 |
b495b6699b5d02ca8c466c984820be5c497d626e | 679 | py | Python | python/paddle/fluid/trainer.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 2 | 2019-04-03T05:36:17.000Z | 2020-04-29T03:38:54.000Z | python/paddle/fluid/trainer.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 1 | 2016-12-22T10:52:40.000Z | 2016-12-22T13:28:20.000Z | python/paddle/fluid/trainer.py | xuezhong/Paddle | be9ec5208160bfed02e767bdb23db5aba9cf5eb0 | [
"Apache-2.0"
] | 3 | 2019-01-07T06:50:29.000Z | 2019-03-13T08:48:23.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 39.941176 | 74 | 0.756996 |
2ba293c5dfc3783f449b8bc6e0b060a90a4d0c3e | 1,708 | py | Python | examples/demo_meta_codepy.py | developmentseed/pyopencl | a36176cda33d125fe9cfb2b3221cbdee4cd81b03 | [
"Apache-2.0"
] | null | null | null | examples/demo_meta_codepy.py | developmentseed/pyopencl | a36176cda33d125fe9cfb2b3221cbdee4cd81b03 | [
"Apache-2.0"
] | null | null | null | examples/demo_meta_codepy.py | developmentseed/pyopencl | a36176cda33d125fe9cfb2b3221cbdee4cd81b03 | [
"Apache-2.0"
] | null | null | null | import pyopencl as cl
import numpy
import numpy.linalg as la
local_size = 256
thread_strides = 32
macroblock_count = 33
dtype = numpy.float32
total_size = local_size*thread_strides*macroblock_count
ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
a = numpy.random.randn(total_size).astype(dtype)
b = numpy.... | 29.964912 | 66 | 0.622365 |
cd642e316f035785758dd38ced43b59535bda9fe | 398 | py | Python | codango/userprofile/migrations/0003_auto_20151118_1454.py | andela-ooshodi/codango-debug | fa68f4305586c2d7f28307f10204c3b50f731fef | [
"MIT"
] | null | null | null | codango/userprofile/migrations/0003_auto_20151118_1454.py | andela-ooshodi/codango-debug | fa68f4305586c2d7f28307f10204c3b50f731fef | [
"MIT"
] | null | null | null | codango/userprofile/migrations/0003_auto_20151118_1454.py | andela-ooshodi/codango-debug | fa68f4305586c2d7f28307f10204c3b50f731fef | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('userprofile', '0002_auto_20151118_1451'),
]
operations = [
migrations.RenameField(
model_name='userprofile',
... | 19.9 | 51 | 0.605528 |
9fbce803ce7c6a336c7f168b5116921d65f42ad3 | 2,557 | py | Python | tests/test_parser.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | 3 | 2018-02-16T13:10:31.000Z | 2021-03-09T15:51:19.000Z | tests/test_parser.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | null | null | null | tests/test_parser.py | ninoNinkovic/python-edl | c7f5cbb524194a070d892137a46902f7a89a930a | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Module EDL
unit test suite
"""
import unittest
from edl import Parser
class ParserTestCase(unittest.TestCase):
"""tests the Parser
"""
def runTest(self):
print "Running Parser Tests"
self.test_pal()
self.test_ntsc()
self.test_24fps()
self.tes... | 36.528571 | 69 | 0.558467 |
77fafa8a5f21ae33c7c956b171e9430478fe08bd | 14,711 | py | Python | mmseg/models/decode_heads/point_head.py | shuaizzZ/mmsegmentation | a6c6b348dbf8c4a0a39ffbdb832a1e82309c533c | [
"Apache-2.0"
] | null | null | null | mmseg/models/decode_heads/point_head.py | shuaizzZ/mmsegmentation | a6c6b348dbf8c4a0a39ffbdb832a1e82309c533c | [
"Apache-2.0"
] | null | null | null | mmseg/models/decode_heads/point_head.py | shuaizzZ/mmsegmentation | a6c6b348dbf8c4a0a39ffbdb832a1e82309c533c | [
"Apache-2.0"
] | null | null | null | # Modified from https://github.com/facebookresearch/detectron2/tree/master/projects/PointRend/point_head/point_head.py # noqa
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, normal_init
# TODO win10 not support, 2020.11.26
from mmcv.ops import point_sample
from mmseg.models.builder import HEADS
f... | 41.911681 | 126 | 0.622935 |
be4484265a8d370098164d367f72475375f5aadb | 953 | py | Python | REST/delete-Interface-IOS_XE-restconf.py | AnkitDeshwal89/NETMIKO | 81c164e9cff46d11b56612f6adc343b6bcdfe87a | [
"Apache-2.0"
] | null | null | null | REST/delete-Interface-IOS_XE-restconf.py | AnkitDeshwal89/NETMIKO | 81c164e9cff46d11b56612f6adc343b6bcdfe87a | [
"Apache-2.0"
] | null | null | null | REST/delete-Interface-IOS_XE-restconf.py | AnkitDeshwal89/NETMIKO | 81c164e9cff46d11b56612f6adc343b6bcdfe87a | [
"Apache-2.0"
] | null | null | null | import requests
from pprint import pprint
from urllib3.exceptions import InsecureRequestWarning
import json
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)
#Set up connection parameters
intf = input("Enter the Interface Name :")
router = {
"ip":"192.168.129.139",
"port":443... | 29.78125 | 124 | 0.693599 |
b20509c492cbc6d0a3b28e1f17d1b64138e7c6a4 | 3,715 | py | Python | alfred/nn/enc_lang.py | arjunakula/amazon_alfred_latest | e50c8572064f597b0a9f3c99ea12af3c52e3f820 | [
"MIT"
] | 44 | 2021-04-28T08:32:01.000Z | 2022-03-20T02:35:21.000Z | alfred/nn/enc_lang.py | arjunakula/amazon_alfred_latest | e50c8572064f597b0a9f3c99ea12af3c52e3f820 | [
"MIT"
] | 6 | 2021-05-15T13:17:14.000Z | 2021-11-18T01:27:31.000Z | alfred/nn/enc_lang.py | arjunakula/amazon_alfred_latest | e50c8572064f597b0a9f3c99ea12af3c52e3f820 | [
"MIT"
] | 6 | 2021-06-08T19:01:38.000Z | 2021-11-10T17:56:28.000Z | import os
import torch
import numpy as np
from torch import nn
from torch.nn import functional as F
from torch.nn.utils.rnn import pad_sequence
from alfred.gen import constants
from alfred.nn.encodings import PosLangEncoding, InstrLangEncoding
class EncoderLang(nn.Module):
def __init__(self, num_layers, args, em... | 38.298969 | 97 | 0.632301 |
85a9995946a3562a57d8cc336ab34a603fd2978a | 146 | py | Python | maskrcnn_benchmark/data/__init__.py | meryusha/seeds_faster | a80cd144c2826cdee5dd929087005f57567ae367 | [
"MIT"
] | 1 | 2021-12-06T10:47:31.000Z | 2021-12-06T10:47:31.000Z | maskrcnn_benchmark/data/__init__.py | SilvioGiancola/seeds_faster | 4c6a1f1fa71beff7c9d0722d134eb1291f57983e | [
"MIT"
] | null | null | null | maskrcnn_benchmark/data/__init__.py | SilvioGiancola/seeds_faster | 4c6a1f1fa71beff7c9d0722d134eb1291f57983e | [
"MIT"
] | 1 | 2019-07-18T13:57:07.000Z | 2019-07-18T13:57:07.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
from .build import make_data_loader
from .build import make_data_loader_AL | 48.666667 | 71 | 0.815068 |
4e56115382190d567432d61e445964b433d04681 | 3,020 | py | Python | tests/test_sequential.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | 1 | 2019-08-15T16:22:20.000Z | 2019-08-15T16:22:20.000Z | tests/test_sequential.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | null | null | null | tests/test_sequential.py | ethereon/merlin | 0babfed51e65197086d74479a1ca9150259b4f7f | [
"BSD-3-Clause"
] | null | null | null | import pytest
import tensorflow as tf
from merlin.modules.module import Module
from merlin.modules.util import Sequential
from merlin.util.testing import private_context
class ConstantAdder(Module):
def __init__(self, value, name=None):
super().__init__(name=name)
self.value = value
self... | 26.491228 | 65 | 0.636093 |
54fdf15515eaa75f85d5b36df61b5c9cf0ed709f | 7,094 | py | Python | venv/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/nn/__init__.py | JIANG-CX/data_labeling | 8d2470bbb537dfc09ed2f7027ed8ee7de6447248 | [
"MIT"
] | 1 | 2021-05-24T10:08:51.000Z | 2021-05-24T10:08:51.000Z | venv/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/nn/__init__.py | JIANG-CX/data_labeling | 8d2470bbb537dfc09ed2f7027ed8ee7de6447248 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/tensorflow/_api/v2/compat/v1/nn/__init__.py | JIANG-CX/data_labeling | 8d2470bbb537dfc09ed2f7027ed8ee7de6447248 | [
"MIT"
] | null | null | null | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Wrappers for primitive Neural Net (NN) Operations.
"""
from __future__ import print_function as _print_function
import sys as _sys
from . import rnn_cell
from tensorflow.python.ops.arr... | 58.147541 | 124 | 0.880603 |
50ff78a395e011f6f4c2d0adc2687de1f076e9d1 | 5,593 | py | Python | style_transfer/sub_networks/Vgg.py | haonguyen1107/style_transfer | 8df9b20ce8ebc446cf2c0a67393001b3cf318fed | [
"MIT"
] | null | null | null | style_transfer/sub_networks/Vgg.py | haonguyen1107/style_transfer | 8df9b20ce8ebc446cf2c0a67393001b3cf318fed | [
"MIT"
] | 6 | 2021-05-21T16:38:24.000Z | 2022-02-10T02:01:14.000Z | style_transfer/sub_networks/Vgg.py | haonguyen1107/style_transfer | 8df9b20ce8ebc446cf2c0a67393001b3cf318fed | [
"MIT"
] | null | null | null | from style_transfer.sub_networks.Sub_network import Sub_network
import tensorflow as tf
from style_transfer.layer import upsample_nearest
class VGG(Sub_network):
_VGG19 = [
('prep', 'prep', {}),
('conv', 'conv1_1', {'filters': 64}),
('conv', 'conv1_2', {'filters': 64}),
('pool', 'p... | 44.388889 | 127 | 0.495441 |
856496f4ff906d563584c3d40dc096c27dd8ddac | 2,784 | py | Python | core/funcoes.py | bruno-zaccariello/sgeheroku | c3d1a0292a33ffc3296746838dc8324c1496ff7e | [
"Apache-2.0"
] | null | null | null | core/funcoes.py | bruno-zaccariello/sgeheroku | c3d1a0292a33ffc3296746838dc8324c1496ff7e | [
"Apache-2.0"
] | 4 | 2020-02-11T23:12:36.000Z | 2021-11-15T17:47:44.000Z | core/funcoes.py | bruno-zaccariello/sgeheroku | c3d1a0292a33ffc3296746838dc8324c1496ff7e | [
"Apache-2.0"
] | null | null | null | """
Módulo auxiliar com funções para views e outros
"""
from django.core.serializers import serialize
# from xml.etree import ElementTree
# import requests
from django.db.models import Q
from core.models import Produto, Pessoa
__all__ = ['filtra_produtos', 'filtra_pessoas',
'paginar', 'arruma_url_pag... | 27.294118 | 86 | 0.613865 |
39bdc2fa3a09d6639107c22d13ef5363d40756d2 | 2,811 | py | Python | tests/unit/test_music_handler.py | rbaltrusch/bach_generator | a5de2d55c982b94d22c62d2cbc8adecd25456069 | [
"MIT"
] | null | null | null | tests/unit/test_music_handler.py | rbaltrusch/bach_generator | a5de2d55c982b94d22c62d2cbc8adecd25456069 | [
"MIT"
] | null | null | null | tests/unit/test_music_handler.py | rbaltrusch/bach_generator | a5de2d55c982b94d22c62d2cbc8adecd25456069 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Tests for the music_handler module"""
from typing import Type
import music21
import pytest
from bach_generator.src import music_handler
SIXTEENTH = "16th"
EIGHT = "8th"
@pytest.mark.usefixtures("midi_file")
def test_extract_notes_from_part(midi_file):
score = music21.stream.Score()
... | 33.86747 | 86 | 0.73248 |
2fc29fa77d05da4b27a84e4ca3486451e1a411e0 | 727 | py | Python | leetcode/python/208_implement_trie_prefix_tree.py | VVKot/leetcode-solutions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | 4 | 2019-04-22T11:57:36.000Z | 2019-10-29T09:12:56.000Z | leetcode/python/208_implement_trie_prefix_tree.py | VVKot/coding-competitions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | null | null | null | leetcode/python/208_implement_trie_prefix_tree.py | VVKot/coding-competitions | 7d6e599b223d89a7861929190be715d3b3604fa4 | [
"MIT"
] | null | null | null | class Trie:
WORD_MARK = '*'
def __init__(self):
self.trie = {}
def insert(self, word: str) -> None:
trie = self.trie
for ch in word:
trie = trie.setdefault(ch, {})
trie[self.WORD_MARK] = self.WORD_MARK
def search(self, word: str) -> bool:
trie = se... | 23.451613 | 46 | 0.480055 |
8a69407669d3d0a09192eb6e02c5528a4af944f4 | 4,280 | py | Python | setup.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | setup.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | setup.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
dependencies = [
"blspy==1.0.2", # Signature library
"chiavdf==1.0.1", # timelord and vdf verification
"chiabip158==1.0", # bip158-style wallet filters
"chiapos==1.0.2", # proof of space
"clvm==0.9.6",
"clvm_rs==0.1.7",
"clvm_tools==0.4.3",
"aiohttp==3.7... | 35.966387 | 90 | 0.63014 |
985d59217598a6a84899984137a64db1fd9a8050 | 359 | py | Python | adminapp/migrations/0010_alter_exhibit_options.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | null | null | null | adminapp/migrations/0010_alter_exhibit_options.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | 1 | 2021-07-19T14:27:28.000Z | 2021-07-19T14:27:28.000Z | adminapp/migrations/0010_alter_exhibit_options.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | 2 | 2021-07-14T21:56:46.000Z | 2021-07-15T16:11:41.000Z | # Generated by Django 3.2.4 on 2021-07-10 20:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('adminapp', '0009_auto_20210709_0156'),
]
operations = [
migrations.AlterModelOptions(
name='exhibit',
options={'verbose_name... | 19.944444 | 55 | 0.610028 |
4d8be3344c3be84c10da9ee8a613a7f1d460d285 | 9,831 | py | Python | Student Registration Project Files/realtimedetector.py | mastadict/automated-student-register | 43ea2f9cced1129a0a6cec88d791894d0a0c9a20 | [
"MIT"
] | 1 | 2020-12-09T15:12:24.000Z | 2020-12-09T15:12:24.000Z | Student Registration Project Files/realtimedetector.py | mastadict/automated-student-register | 43ea2f9cced1129a0a6cec88d791894d0a0c9a20 | [
"MIT"
] | 4 | 2021-06-08T19:44:04.000Z | 2022-03-11T23:44:05.000Z | Student Registration Project Files/realtimedetector.py | khoisan25/automated-student-register | 43ea2f9cced1129a0a6cec88d791894d0a0c9a20 | [
"MIT"
] | null | null | null | #!/usr/bin/python
'''
Author: Guido Diepen <gdiepen@deloitte.nl>
'''
#Import the OpenCV and dlib libraries
import cv2
import dlib
import threading
import time
#Initialize a face cascade using the frontal face haar cascade provided with
#the OpenCV library
#Make sure that you copy this file from the opencv proje... | 35.490975 | 79 | 0.522327 |
3930d034e0fae17ed3c63b0c3517864718c8f781 | 466 | py | Python | sources/malshare.py | asrabon/MalFind | ca3fcf59b335f3bd0e1d4596f545a917c4a0e613 | [
"MIT"
] | 1 | 2021-12-13T17:19:09.000Z | 2021-12-13T17:19:09.000Z | sources/malshare.py | asrabon/MalFind | ca3fcf59b335f3bd0e1d4596f545a917c4a0e613 | [
"MIT"
] | null | null | null | sources/malshare.py | asrabon/MalFind | ca3fcf59b335f3bd0e1d4596f545a917c4a0e613 | [
"MIT"
] | null | null | null | import requests
SEARCH_URL = "https://malshare.com/api.php?api_key={}&action=search&query={}"
SAMPLE_URL = "https://malshare.com/sample.php?action=detail&hash={}"
def search(file_hash, api_key):
r = requests.get(
SEARCH_URL.format(api_key, file_hash),
timeout=30
)
search_submissions = r.... | 23.3 | 77 | 0.656652 |
4a7227c2fd3b323e97ab507ad9797313ca6afa00 | 1,085 | py | Python | MangAdventure/urls.py | fossabot/MangAdventure | 20e1f27056b8c4b9cb58ce6e815a5bb93739fe11 | [
"MIT"
] | null | null | null | MangAdventure/urls.py | fossabot/MangAdventure | 20e1f27056b8c4b9cb58ce6e815a5bb93739fe11 | [
"MIT"
] | null | null | null | MangAdventure/urls.py | fossabot/MangAdventure | 20e1f27056b8c4b9cb58ce6e815a5bb93739fe11 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.conf import settings
from .views import index, search, opensearch, contribute, robots
try:
from django.urls import include, re_path as url
except ImportError:
from django.conf.urls import include, url
urlpatterns = [
url(r'^$', index, name='index'),
url(r'^... | 31.911765 | 64 | 0.682028 |
33bdfb784d6a50ee474514775db5e5496b3f4c5b | 1,700 | py | Python | python/ecs/fargate-service-with-autoscaling/app.py | damshenas/aws-cdk-examples | 85d247df404444cde6ef913aae31aaa47cd93daa | [
"Apache-2.0"
] | 1 | 2022-02-02T20:23:28.000Z | 2022-02-02T20:23:28.000Z | python/ecs/fargate-service-with-autoscaling/app.py | damshenas/aws-cdk-examples | 85d247df404444cde6ef913aae31aaa47cd93daa | [
"Apache-2.0"
] | null | null | null | python/ecs/fargate-service-with-autoscaling/app.py | damshenas/aws-cdk-examples | 85d247df404444cde6ef913aae31aaa47cd93daa | [
"Apache-2.0"
] | null | null | null | from aws_cdk import (
aws_ec2 as ec2,
aws_ecs as ecs,
aws_ecs_patterns as ecs_patterns,
App, CfnOutput, Duration, Stack
)
from constructs import Construct
class AutoScalingFargateService(Stack):
def __init__(self, scope: Construct, id: str, **kwargs) -> None:
super().__init__(scope, id, *... | 28.333333 | 85 | 0.608235 |
38a2f8504722c74ebe7ae9c3e50877c9fd820c79 | 342 | py | Python | bets/views.py | mattchere/letsmakebets | d34ffbc98022250eb9352ccddb63a5f25a92ab6a | [
"MIT"
] | null | null | null | bets/views.py | mattchere/letsmakebets | d34ffbc98022250eb9352ccddb63a5f25a92ab6a | [
"MIT"
] | null | null | null | bets/views.py | mattchere/letsmakebets | d34ffbc98022250eb9352ccddb63a5f25a92ab6a | [
"MIT"
] | null | null | null | from .models import Bet, Bettor, Taker
from django.shortcuts import render
from django.views import generic
def index(request):
"""
View function for homepage of site.
"""
return render(request, 'index.html')
class BetListView(generic.ListView):
model = Bet
class BetDetailView(generic.DetailV... | 17.1 | 40 | 0.710526 |
f640e87a9d13f9f365aef5d920bd1b7f59e0a591 | 22,038 | py | Python | flink-python/pyflink/table/tests/test_table_environment_api.py | sundargates/flink | aa489269a1429f25136765af94b05d10ef5b7fd3 | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/table/tests/test_table_environment_api.py | sundargates/flink | aa489269a1429f25136765af94b05d10ef5b7fd3 | [
"Apache-2.0"
] | null | null | null | flink-python/pyflink/table/tests/test_table_environment_api.py | sundargates/flink | aa489269a1429f25136765af94b05d10ef5b7fd3 | [
"Apache-2.0"
] | null | null | null | ################################################################################
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this... | 42.299424 | 100 | 0.637308 |
129c94f17fa4fe205481d0cdc728c2124db88cb2 | 256 | py | Python | aioTelegramLogs/utils.py | AniWaffl/aioTelegramLogs | 47819de02f8e7c1012fae8e274f7d1fac06d8603 | [
"MIT"
] | 2 | 2020-11-28T19:47:01.000Z | 2021-12-29T21:35:19.000Z | aioTelegramLogs/utils.py | AniWaffl/aioTelegramLogs | 47819de02f8e7c1012fae8e274f7d1fac06d8603 | [
"MIT"
] | null | null | null | aioTelegramLogs/utils.py | AniWaffl/aioTelegramLogs | 47819de02f8e7c1012fae8e274f7d1fac06d8603 | [
"MIT"
] | null | null | null |
# А это шобы библиотека делала нормальные запросы на сервер
def escape_html(text):
"""
Escapes all html characters in text
:param str text:
:rtype: str
"""
return text.replace('&', '&').replace('<', '<').replace('>', '>') | 28.444444 | 79 | 0.605469 |
ffc37db1565f151250b189480f8eaa35db64d8ae | 811 | py | Python | server/problem_sets/static/static_problem_set.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null | server/problem_sets/static/static_problem_set.py | iiridescent/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | 5 | 2021-03-09T10:36:59.000Z | 2022-02-26T14:36:08.000Z | server/problem_sets/static/static_problem_set.py | vinhowe/problem-sets | e906fe7509cd158ecdb5920853636339d4d531c3 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from problem_sets.serialization import serialize_recursive
from problem_sets.static.data.static_problem_set_entity import StaticProblemSetEntity
from problem_sets.static.static_problem import static_content_list_to_widget_list
@dataclass
class StaticProblemSet(StaticProblemSetEntity... | 33.791667 | 110 | 0.771887 |
b0ba7fd83fe7ba1a58f2737fbcdf7b27fed32730 | 2,676 | py | Python | egs/librispeech/ASR/transducer_stateless/joiner.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | null | null | null | egs/librispeech/ASR/transducer_stateless/joiner.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | null | null | null | egs/librispeech/ASR/transducer_stateless/joiner.py | TIFOSI528/icefall | 6f7860a0a60b53026216fa4ba19048955951333e | [
"Apache-2.0"
] | 1 | 2022-03-23T02:39:34.000Z | 2022-03-23T02:39:34.000Z | # Copyright 2021 Xiaomi Corp. (authors: Fangjun Kuang)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# 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
#
# ... | 32.634146 | 74 | 0.627055 |
66259119fa6c0a2f85a8e25f238fd108c2c5ae8b | 422 | py | Python | src/models/face_detection.py | monim67/openvino-computer-pointer-controller | 5ea50b33ae37ee29f52252eb0db2cafd36fc6df4 | [
"MIT"
] | null | null | null | src/models/face_detection.py | monim67/openvino-computer-pointer-controller | 5ea50b33ae37ee29f52252eb0db2cafd36fc6df4 | [
"MIT"
] | null | null | null | src/models/face_detection.py | monim67/openvino-computer-pointer-controller | 5ea50b33ae37ee29f52252eb0db2cafd36fc6df4 | [
"MIT"
] | null | null | null | """
model: face-detection-adas-binary-0001
input: BxCxHxW
input shape: (1, 3, 384, 672)
output: (image_id, label, conf, x_min, y_min, x_max, y_max)
output shape: (1, 1, N, 7)
"""
from .base_model import BaseModel
class FaceDetect(BaseModel):
model_name = "face-detection-adas-binary-0001"
precision_directory_... | 22.210526 | 59 | 0.63981 |
e17bd98a135f31645ae528d7aa4882ad6711b460 | 1,659 | py | Python | accounts/urls.py | SolomonMbak/3_a | d5d7656091e866efa2cd5dcc7bd5bc54627ac62a | [
"Apache-2.0"
] | 2 | 2019-08-07T05:50:25.000Z | 2020-05-19T17:28:05.000Z | accounts/urls.py | SolomonMbak/3_a | d5d7656091e866efa2cd5dcc7bd5bc54627ac62a | [
"Apache-2.0"
] | 11 | 2020-02-12T01:19:56.000Z | 2022-03-11T23:55:28.000Z | accounts/urls.py | SolomonMbak/3_a | d5d7656091e866efa2cd5dcc7bd5bc54627ac62a | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
from django.contrib.auth import views as auth_views
app_name = "accounts"
urlpatterns = [
path("register/", views.register, name="register"),
path("account/", views.account, name="account"),
path("logout/", views.logout_request, name="logout"),
path("lo... | 40.463415 | 91 | 0.694394 |
2f96e2c6fd00231ad1221ec9869bf4db9125ac49 | 954 | py | Python | doc/gauss/listings/generators/gauss.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | doc/gauss/listings/generators/gauss.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | doc/gauss/listings/generators/gauss.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
def gauss():
"""
The driver for the generator based implementation
"""
from Disk import Disk
from Mersenne import Mersenne
# inputs
N = 10**5
box = [(0,1), (0,1)]... | 18.705882 | 60 | 0.606918 |
59c14eddfd03c5b034cb37c57da65e7575577d50 | 3,121 | py | Python | example.py | boxblox/gdxtools | 8d440a85f54c5a290be2cbe6d96c3d05a3f2ea44 | [
"MIT"
] | 2 | 2019-11-01T01:05:36.000Z | 2020-02-08T01:42:41.000Z | example.py | boxblox/gdxtools | 8d440a85f54c5a290be2cbe6d96c3d05a3f2ea44 | [
"MIT"
] | null | null | null | example.py | boxblox/gdxtools | 8d440a85f54c5a290be2cbe6d96c3d05a3f2ea44 | [
"MIT"
] | null | null | null | import pandas as pd
import gdxtools as gt
if __name__ == '__main__':
# create instance of gams gdx data
gdxin = gt.gdxrw.gdxReader('trnsport_output.gdx')
# get all symbols inside a GDX
gdxin.symbols
# get symbol types from a GDX file
gdxin.symbolType
# get symbol dimensions from a GDX ... | 38.060976 | 104 | 0.585069 |
c6193867a749b05d40016b87bbe8334564844a24 | 37 | py | Python | examples/list_folder.py | mohan3d/PyOpenload | 83222bd0c55b474c1bb3c27732a79d95455c5d28 | [
"MIT"
] | 35 | 2016-09-13T21:29:00.000Z | 2019-10-25T07:55:15.000Z | examples/list_folder.py | mohan3d/PyOpenload | 83222bd0c55b474c1bb3c27732a79d95455c5d28 | [
"MIT"
] | 15 | 2017-05-14T20:20:59.000Z | 2019-09-22T11:10:44.000Z | examples/list_folder.py | mohan3d/PyOpenload | 83222bd0c55b474c1bb3c27732a79d95455c5d28 | [
"MIT"
] | 12 | 2017-01-28T17:45:54.000Z | 2019-07-20T07:45:27.000Z | resp = ol.list_folder()
print(resp)
| 9.25 | 23 | 0.702703 |
02dc1cfdd69bd6f884580c7338cbb3a281976a68 | 43,762 | py | Python | src/sage/algebras/free_algebra.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/algebras/free_algebra.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | src/sage/algebras/free_algebra.py | fredstro/sage | c936d2cda81ec7ec3552a3bdb29c994b40d1bb24 | [
"BSL-1.0"
] | null | null | null | """
Free algebras
AUTHORS:
- David Kohel (2005-09)
- William Stein (2006-11-01): add all doctests; implemented many
things.
- Simon King (2011-04): Put free algebras into the category framework.
Reimplement free algebra constructor, using a
:class:`~sage.structure.factory.UniqueFactory` for handling
differe... | 33.329779 | 352 | 0.534939 |
599b33e35c1a23e92d28d82efc52732675fab326 | 5,687 | py | Python | publ/cli.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 27 | 2018-11-30T21:32:26.000Z | 2022-03-20T19:46:25.000Z | publ/cli.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 249 | 2018-09-30T07:04:37.000Z | 2022-03-29T04:31:00.000Z | publ/cli.py | PlaidWeb/Publ | 67efc5e32bf25dbac72a83d1167de038b79db5a7 | [
"MIT"
] | 4 | 2019-03-01T06:46:13.000Z | 2019-06-30T17:45:46.000Z | """ CLI utilities for Publ """
# pylint:disable=too-many-arguments
import itertools
import logging
import os.path
import re
import time
import arrow
import click
import slugify
from flask.cli import AppGroup, with_appcontext
from pony import orm
from . import queries
from .config import config
LOGGER = logging.getL... | 33.452941 | 99 | 0.629506 |
599318540b498896b040f8b56f2ba355b4ec70f6 | 161 | py | Python | python/Journal.LinesByBlock.py | BIMpraxis/Journalysis | af0c042b28d01ba5e44dafc2bbe9556434e897b8 | [
"MIT"
] | 26 | 2017-11-23T19:30:03.000Z | 2022-02-09T10:35:10.000Z | python/Journal.LinesByBlock.py | BIMpraxis/Journalysis | af0c042b28d01ba5e44dafc2bbe9556434e897b8 | [
"MIT"
] | 51 | 2017-11-16T15:02:32.000Z | 2022-03-01T13:51:58.000Z | python/Journal.LinesByBlock.py | BIMpraxis/Journalysis | af0c042b28d01ba5e44dafc2bbe9556434e897b8 | [
"MIT"
] | 9 | 2017-11-20T09:20:01.000Z | 2021-09-15T13:08:30.000Z | import clr
OUT = []
if IN[0].__repr__() == 'Journal':
if isinstance(IN[1], list): OUT = IN[0].GetLinesByBlocks(IN[1])
else: OUT = IN[0].GetLinesByBlock(IN[1]) | 26.833333 | 64 | 0.645963 |
75ff7101b226381d3bdb98df021396de19fd09e6 | 1,901 | py | Python | backend/path-slice.py | marborkowski/nasa-space-apps-challenge | b8d1a57e7274de8dbecff1073ad56e80988c6593 | [
"MIT"
] | null | null | null | backend/path-slice.py | marborkowski/nasa-space-apps-challenge | b8d1a57e7274de8dbecff1073ad56e80988c6593 | [
"MIT"
] | null | null | null | backend/path-slice.py | marborkowski/nasa-space-apps-challenge | b8d1a57e7274de8dbecff1073ad56e80988c6593 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 - Piotr Skonieczka
#
import Image
import pylab
def get_polygon(list_of_points):
return [(list_of_points[idx], list_of_points[idx+1]) for idx in xrange(len(list_of_points)-1)]
def get_track(x1, y1, x2, y2):
# Bresengham algorithm
list_... | 22.364706 | 98 | 0.642294 |
07132933343aa219a87da459baa1bf7e849944b1 | 5,450 | py | Python | aispace/utils/str_utils.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 32 | 2020-01-16T07:59:03.000Z | 2022-03-31T09:24:00.000Z | aispace/utils/str_utils.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 9 | 2020-06-05T03:27:06.000Z | 2022-03-12T01:00:17.000Z | aispace/utils/str_utils.py | SmileGoat/AiSpace | 35fc120667e4263c99b300815e0bf018f5064a40 | [
"Apache-2.0"
] | 3 | 2020-06-09T02:22:50.000Z | 2021-07-19T06:07:07.000Z | # -*- coding: utf-8 -*-
# @Time : 2019-11-04 11:08
# @Author : yingyuankai
# @Email : yingyuankai@aliyun.com
# @File : str_utils.py
from typing import Union, List
import unicodedata
import six
import nltk
from nltk.util import ngrams
import re
from random import randint
from datetime import datetime
import ha... | 29.144385 | 85 | 0.535413 |
b65e923175e2be6b22dd2fa993f2b5ae7e9babba | 39,856 | py | Python | paprika/setup.py | jeff231li/pAPRika | babd0ec7cf7e9a982e814d44cbe3e0e1dd8f31a8 | [
"BSD-3-Clause"
] | 3 | 2019-11-02T18:21:46.000Z | 2019-12-03T22:47:41.000Z | paprika/setup.py | jeff231li/pAPRika | babd0ec7cf7e9a982e814d44cbe3e0e1dd8f31a8 | [
"BSD-3-Clause"
] | null | null | null | paprika/setup.py | jeff231li/pAPRika | babd0ec7cf7e9a982e814d44cbe3e0e1dd8f31a8 | [
"BSD-3-Clause"
] | null | null | null | """
This class contains a simulation setup wrapper for use with the OpenFF Evaluator.
"""
import logging
import os
import shutil
import subprocess as sp
from pathlib import Path
import numpy as np
import parmed as pmd
import pkg_resources
import pytraj as pt
import simtk.openmm as openmm
import simtk.unit as unit
fr... | 42.948276 | 169 | 0.580465 |
9ebcb89749c04f152ab414d6e4c940e06282b368 | 1,761 | py | Python | reinforcement_learning/rl_network_compression_ray_custom/src/tensorflow_resnet/compressor/train.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,610 | 2020-10-01T14:14:53.000Z | 2022-03-31T18:02:31.000Z | reinforcement_learning/rl_network_compression_ray_custom/src/tensorflow_resnet/compressor/train.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 1,959 | 2020-09-30T20:22:42.000Z | 2022-03-31T23:58:37.000Z | reinforcement_learning/rl_network_compression_ray_custom/src/tensorflow_resnet/compressor/train.py | jerrypeng7773/amazon-sagemaker-examples | c5ddecce1f739a345465b9a38b064983a129141d | [
"Apache-2.0"
] | 2,052 | 2020-09-30T22:11:46.000Z | 2022-03-31T23:02:51.000Z | import logging
import math
import tensorflow as tf
def tensorflow_train(
estimator, data_dir, batch_size, input_function, epochs=None, epochs_between_evals=1
):
"""
This method will train a tensorflow model.
Args:
estimator: `tf.estimator.Estimator` object.
data_dir: Directory where ... | 29.847458 | 89 | 0.645656 |
fc7fb926a4dd771ec9a2a88f5f589ac18145ffb1 | 753 | py | Python | cloudmesh-exercises/e-cloudmesh-common-2.py | cybertraining-dsc/sp20-516-223 | 2e7188579a63e0cebf51880cd7c82307ae1b919c | [
"Apache-2.0"
] | 1 | 2020-04-05T17:53:51.000Z | 2020-04-05T17:53:51.000Z | cloudmesh-exercises/e-cloudmesh-common-2.py | iumsds/sp20-516-223 | c67f0a966d10387d51575d097fad663791b47a00 | [
"Apache-2.0"
] | 1 | 2020-01-20T17:41:57.000Z | 2020-01-20T17:41:57.000Z | cloudmesh-exercises/e-cloudmesh-common-2.py | iumsds/sp20-516-223 | c67f0a966d10387d51575d097fad663791b47a00 | [
"Apache-2.0"
] | 8 | 2020-02-02T23:18:26.000Z | 2020-04-05T06:17:24.000Z | # fa20-516-223 E.Cloudmesh.Common.2
from cloudmesh.common.Shell import Shell
from cloudmesh.common.debug import VERBOSE
from cloudmesh.common.dotdict import dotdict
dist = Shell.distribution()
VERBOSE(dist)
# Convert the dict to dotdict.
dist = dotdict(dist)
print(f"Platform is {dist.platform}")
if dist.platform =... | 26.892857 | 73 | 0.656042 |
98877642ce5b60c2f78e398ff84ec6fa125d5c01 | 1,521 | py | Python | open_catalyst/ocpmodels/common/relaxation/ml_relaxation.py | henrique/hpc | b796e7aec0339b8a2d33e7af3c875ebe74f038aa | [
"Apache-2.0"
] | 16 | 2020-10-26T15:35:20.000Z | 2022-03-16T08:10:35.000Z | ocpmodels/common/relaxation/ml_relaxation.py | jg8610/ocp | 5f16b64911e0dac3001d4cc7427d60469a967370 | [
"MIT",
"BSD-3-Clause"
] | 23 | 2021-06-09T08:23:41.000Z | 2022-03-14T17:37:24.000Z | ocpmodels/common/relaxation/ml_relaxation.py | jg8610/ocp | 5f16b64911e0dac3001d4cc7427d60469a967370 | [
"MIT",
"BSD-3-Clause"
] | 5 | 2021-01-11T22:17:54.000Z | 2022-02-01T21:23:27.000Z | """
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
from pathlib import Path
import torch
from ocpmodels.common.meter import mae, mae_ratio, mean_l2_distance
from ocpmodels.common.registry im... | 25.35 | 88 | 0.650888 |
e48a5aae4ecb69ead0115561c4bf64574b667bdd | 7,657 | py | Python | game_board.py | jeff012345/clue-part-duo | bd9ccd2ccdbc2fe358a696b31644b93e70ff874b | [
"MIT"
] | null | null | null | game_board.py | jeff012345/clue-part-duo | bd9ccd2ccdbc2fe358a696b31644b93e70ff874b | [
"MIT"
] | null | null | null | game_board.py | jeff012345/clue-part-duo | bd9ccd2ccdbc2fe358a696b31644b93e70ff874b | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import List, Set, Dict, Tuple, Optional
import pygame
import pygame_gui
from player import *
from definitions import Room
from ai_players import RLPlayer
from Clue import Director, GameStatus
from threading import Lock, Condition, Barrier
from log_book_ui import LogBookPa... | 35.780374 | 121 | 0.642027 |
af53f01f0bd1e029b9942ba5a1f6d783de18f93f | 556 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testtemplateapp1234-23630 | c3a1684aac0feca1ed5fbb9735f19aa05345d96e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testtemplateapp1234-23630 | c3a1684aac0feca1ed5fbb9735f19aa05345d96e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-dev/testtemplateapp1234-23630 | c3a1684aac0feca1ed5fbb9735f19aa05345d96e | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "testtemplateapp1234-23630.botics.co"
site_params = {
"name": "TesttemplateApp1234",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.ob... | 21.384615 | 61 | 0.669065 |
4854068268530eebecd0e9b87979ab494154ca4e | 668 | py | Python | home/migrations/0001_initial.py | d-shaktiranjan/E_Note_Book | 2746392bc88f11ce5fb0d4bb3a1a911b3d2bc766 | [
"Apache-2.0"
] | null | null | null | home/migrations/0001_initial.py | d-shaktiranjan/E_Note_Book | 2746392bc88f11ce5fb0d4bb3a1a911b3d2bc766 | [
"Apache-2.0"
] | 1 | 2022-01-27T18:56:50.000Z | 2022-01-27T18:56:50.000Z | home/migrations/0001_initial.py | d-shaktiranjan/E_Note_Book | 2746392bc88f11ce5fb0d4bb3a1a911b3d2bc766 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-03 15:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='NoteBook',
fields=[
('id', models.AutoField... | 26.72 | 114 | 0.565868 |
d513d5aa8b9dcde68465fe954ffc5ac47706b888 | 378 | py | Python | azkm/__main__.py | frogrammer/azure-knowledgemining-cli | 15ffded9ebb6edc0009c6b77ddee64757be6fc7d | [
"Apache-2.0"
] | null | null | null | azkm/__main__.py | frogrammer/azure-knowledgemining-cli | 15ffded9ebb6edc0009c6b77ddee64757be6fc7d | [
"Apache-2.0"
] | null | null | null | azkm/__main__.py | frogrammer/azure-knowledgemining-cli | 15ffded9ebb6edc0009c6b77ddee64757be6fc7d | [
"Apache-2.0"
] | null | null | null | """azkm CLI entry point."""
from azkm.flight_checks import prereqs
import firehelper
import sys
from azkm.commands import * # noqa
def main():
"""azkm CLI.
"""
if len(sys.argv) == 1:
prereqs.confirm_cmd()
else:
prereqs.check_cmd()
start_cli()
def start_cli():
firehelper.star... | 16.434783 | 38 | 0.62963 |
dbc5545f33eccd1c63a3a0100dfc2adab717810d | 2,098 | py | Python | main.py | daniel4lee/PSO-car-simulator | b4aebca0fed614e33acc3e7d665085d55a67b82a | [
"MIT"
] | 1 | 2022-03-23T21:51:59.000Z | 2022-03-23T21:51:59.000Z | main.py | daniel4lee/PSO-car-simulator | b4aebca0fed614e33acc3e7d665085d55a67b82a | [
"MIT"
] | 1 | 2018-10-08T12:53:42.000Z | 2018-10-08T13:46:13.000Z | main.py | daniel4lee/PSO-car-simulator | b4aebca0fed614e33acc3e7d665085d55a67b82a | [
"MIT"
] | 2 | 2020-04-26T08:22:53.000Z | 2021-05-18T09:51:24.000Z | """
the main excution file
"""
import os
from os.path import join, isfile
from collections import namedtuple
import sys
from PyQt5.QtWidgets import QApplication
from PSO_system.GUI.gui_root import GuiRoot
import numpy as np
def main():
"""Read data as dictionary"""
sys.argv += ['--style', 'fusion']
app = QA... | 39.584906 | 108 | 0.608198 |
992348a73e9b9b5ff6df854b9656ee3f11ca9d77 | 9,030 | py | Python | interactive.py | vliu15/dialogue-seq2seq | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 27 | 2019-04-17T11:02:39.000Z | 2021-12-16T09:42:41.000Z | interactive.py | lixinyu-up/dialogue-seq2seq | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 1 | 2019-03-01T09:21:09.000Z | 2019-03-02T22:49:48.000Z | interactive.py | vliu15/transformer-rnn-pytorch | d78354cdb568963f8e85fce1202e85690535f01c | [
"MIT"
] | 13 | 2019-03-31T05:16:49.000Z | 2021-07-09T13:08:14.000Z | ''' This script handles local interactive inference '''
import torch
import torch.nn as nn
import torch.nn.functional as F
import argparse
import numpy as np
import spacy
from seq2seq.Models import Seq2Seq
from seq2seq.Translator import Translator
from seq2seq.Beam import Beam
from seq2seq import Constants
class Int... | 45.15 | 117 | 0.653378 |
a44232881d599052a397795e687023a6bf1adc0a | 2,503 | py | Python | src/test/tinc/tincrepo/mpp/lib/regress/regress_gpdbverify.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 9 | 2018-04-20T03:31:01.000Z | 2020-05-13T14:10:53.000Z | src/test/tinc/tincrepo/mpp/lib/regress/regress_gpdbverify.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 36 | 2017-09-21T09:12:27.000Z | 2020-06-17T16:40:48.000Z | src/test/tinc/tincrepo/mpp/lib/regress/regress_gpdbverify.py | rodel-talampas/gpdb | 9c955e350334abbd922102f289f782697eb52069 | [
"PostgreSQL",
"Apache-2.0"
] | 32 | 2017-08-31T12:50:52.000Z | 2022-03-01T07:34:53.000Z | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... | 35.253521 | 88 | 0.704754 |
88a868d18117582e3d77dc88677ec1a63e6b23e0 | 49,602 | py | Python | application.py | Has3ong/KaKao_Suwon | ddba8ea5623f84893d0f62ad8afc985bb4bd786f | [
"MIT"
] | 1 | 2019-07-10T03:57:54.000Z | 2019-07-10T03:57:54.000Z | application.py | Has3ong/KaKao_Suwon | ddba8ea5623f84893d0f62ad8afc985bb4bd786f | [
"MIT"
] | 2 | 2020-10-27T22:00:15.000Z | 2021-06-02T00:36:00.000Z | application.py | Has3ong/KaKao_Suwon | ddba8ea5623f84893d0f62ad8afc985bb4bd786f | [
"MIT"
] | null | null | null | # -- coding: utf-8 --
import os
import json
from flask import Flask, request, jsonify
from datetime import datetime
import requests
import time
import threading
import pymongo
ip = 'localhost'
port = 27017
connection = pymongo.MongoClient(ip, port)
database = connection.get_database('Suwon')
mongo = database.get_colle... | 40.19611 | 828 | 0.283799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.