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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a0bb574f0e4781b788963a98f37cef41eee9a100 | 639 | py | Python | cla_backend/apps/legalaid/migrations/0008_eod_data_migration.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 3 | 2019-10-02T15:31:03.000Z | 2022-01-13T10:15:53.000Z | cla_backend/apps/legalaid/migrations/0008_eod_data_migration.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 206 | 2015-01-02T16:50:11.000Z | 2022-02-16T20:16:05.000Z | cla_backend/apps/legalaid/migrations/0008_eod_data_migration.py | uk-gov-mirror/ministryofjustice.cla_backend | 4d524c10e7bd31f085d9c5f7bf6e08a6bb39c0a6 | [
"MIT"
] | 6 | 2015-03-23T23:08:42.000Z | 2022-02-15T17:04:44.000Z | # coding=utf-8
from __future__ import unicode_literals
from django.db import migrations
def copy_relation(apps, schema_editor):
Case = apps.get_model("legalaid", "Case")
EODDetails = apps.get_model("legalaid", "EODDetails")
for eod in EODDetails.objects.all():
try:
eod.case = eod.old_c... | 30.428571 | 75 | 0.672926 |
9b2c748b83442ac5d7b7d4782851605586400a87 | 7,004 | py | Python | tests/app/main/test_users.py | ArenaNetworks/dto-digitalmarketplace-supplier-frontend | bca2c5915a3935b92ebe0af23febc190a5f751d6 | [
"MIT"
] | null | null | null | tests/app/main/test_users.py | ArenaNetworks/dto-digitalmarketplace-supplier-frontend | bca2c5915a3935b92ebe0af23febc190a5f751d6 | [
"MIT"
] | null | null | null | tests/app/main/test_users.py | ArenaNetworks/dto-digitalmarketplace-supplier-frontend | bca2c5915a3935b92ebe0af23febc190a5f751d6 | [
"MIT"
] | 1 | 2021-08-23T06:05:57.000Z | 2021-08-23T06:05:57.000Z | import mock
from nose.tools import assert_equal, assert_in, assert_not_in
from tests.app.helpers import BaseApplicationTest, csrf_only_request
def get_users(additional_users=None, index=None):
users = [
{
'id': 123,
'name': "User Name",
'emailAddres... | 37.058201 | 119 | 0.530411 |
ce237abcbf8f699503c58f87ce0b69adc264352d | 5,761 | py | Python | st2common/tests/unit/test_service_setup.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 2 | 2021-08-04T01:04:06.000Z | 2021-08-04T01:04:08.000Z | st2common/tests/unit/test_service_setup.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2022-03-31T03:53:22.000Z | 2022-03-31T03:53:22.000Z | st2common/tests/unit/test_service_setup.py | saucetray/st2 | 8f507d6c8d9483c8371e386fe2b7998596856fd7 | [
"Apache-2.0"
] | 1 | 2019-10-11T14:42:28.000Z | 2019-10-11T14:42:28.000Z | # Copyright 2019 Extreme Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.409091 | 97 | 0.657872 |
16498a4ed4492b947247fc7d45e7c361649f6fcd | 666 | py | Python | django/vermillion/manage.py | cultbepis/vermillion | 9ff537bc3ed5bd06d41fe8b4b2a5455821efea4a | [
"MIT"
] | 1 | 2021-05-28T01:34:45.000Z | 2021-05-28T01:34:45.000Z | django/vermillion/manage.py | cultbepis/vermillion | 9ff537bc3ed5bd06d41fe8b4b2a5455821efea4a | [
"MIT"
] | 9 | 2021-05-28T05:38:12.000Z | 2022-02-10T10:05:56.000Z | django/vermillion/manage.py | cultbepis/vermillion | 9ff537bc3ed5bd06d41fe8b4b2a5455821efea4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'vermillion.settings')
try:
from django.core.management import execute_from_command_line
except I... | 28.956522 | 74 | 0.68018 |
0a4ca4a618224a206e34d0b6fa7cf1046eaa0712 | 2,242 | py | Python | app/db/__init__.py | ChaosSmith/alchemy-template | 8dc003a868bc08f76284b5070de012b5e68b5506 | [
"MIT"
] | null | null | null | app/db/__init__.py | ChaosSmith/alchemy-template | 8dc003a868bc08f76284b5070de012b5e68b5506 | [
"MIT"
] | null | null | null | app/db/__init__.py | ChaosSmith/alchemy-template | 8dc003a868bc08f76284b5070de012b5e68b5506 | [
"MIT"
] | null | null | null | # imports
import os
from sqlalchemy import create_engine, exc
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.engine.url import URL
from app.db.config import DATABASE
from app.models import *
from sqlalchemy.ext.declarative import declarative_base
def parse_url(database):
"""
Converts a... | 27.012048 | 92 | 0.678412 |
273564706e7481be7123f0e6634631447f03b626 | 1,147 | py | Python | hermit/cli.py | hiway/freebsd-hermit | 5a4889ad40391302884429049e251f9211cabf08 | [
"BSD-2-Clause"
] | null | null | null | hermit/cli.py | hiway/freebsd-hermit | 5a4889ad40391302884429049e251f9211cabf08 | [
"BSD-2-Clause"
] | null | null | null | hermit/cli.py | hiway/freebsd-hermit | 5a4889ad40391302884429049e251f9211cabf08 | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
import click
import readline
base_dir = os.path.dirname(os.path.abspath(__file__))
data_dir = os.path.join(base_dir, "data")
def hermit(debug=False):
from .bot import HermitBot
args = list(sys.argv)
message = ' '.join(args[1:])
bot = HermitBot(data_dir, debug=debug)
reply = b... | 19.775862 | 64 | 0.627724 |
a2e92515b6939c4c5bbd7f15c05244a20d444897 | 41,870 | py | Python | fhir/resources/tests/test_medicationrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 144 | 2019-05-08T14:24:43.000Z | 2022-03-30T02:37:11.000Z | fhir/resources/tests/test_medicationrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 82 | 2019-05-13T17:43:13.000Z | 2022-03-30T16:45:17.000Z | fhir/resources/tests/test_medicationrequest.py | cstoltze/fhir.resources | 52f99738935b7313089d89daf94d73ce7d167c9d | [
"BSD-3-Clause"
] | 48 | 2019-04-04T14:14:53.000Z | 2022-03-30T06:07:31.000Z | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/MedicationRequest
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from .. import fhirtypes # noqa: F401
from .. import medicationre... | 44.780749 | 88 | 0.703439 |
56e4981693e4ea6afa23183cc78e18595934757b | 5,757 | py | Python | types.py | AIandSocialGoodLab/securitygamewithinformants | 8f9ab63796541faf1e51e944d34d8c64c4df6344 | [
"Apache-2.0"
] | null | null | null | types.py | AIandSocialGoodLab/securitygamewithinformants | 8f9ab63796541faf1e51e944d34d8c64c4df6344 | [
"Apache-2.0"
] | null | null | null | types.py | AIandSocialGoodLab/securitygamewithinformants | 8f9ab63796541faf1e51e944d34d8c64c4df6344 | [
"Apache-2.0"
] | 1 | 2021-11-24T00:17:14.000Z | 2021-11-24T00:17:14.000Z | # This is the code used to generate the data for Figure 3 in the paper.
import gurobipy as gp
from gurobipy import GRB
import numpy as np
import pandas
# from scipy.special import softmaxscipy
import matplotlib.pyplot as plt
import seaborn as sns
import datetime
def printGraph(X, Y, name):
plt.figure('Draw')
# p... | 28.359606 | 132 | 0.545597 |
1752f94fae40cd43b9ac514ceb6b86fb5c6200e6 | 5,248 | py | Python | Engine/Render/rpcore/gui/fps_chart.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | 3 | 2019-09-17T15:26:42.000Z | 2021-12-09T00:42:32.000Z | Engine/Render/rpcore/gui/fps_chart.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | null | null | null | Engine/Render/rpcore/gui/fps_chart.py | kergalym/Korlan | cc3141969d21898842a008b49f8b42492d2cf6e4 | [
"MIT"
] | 1 | 2019-09-17T13:21:31.000Z | 2019-09-17T13:21:31.000Z | """
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 39.164179 | 90 | 0.690168 |
e933342011d7af21a37cf989f9a8197f42e954f7 | 10,273 | py | Python | fastai/text/models/awd_lstm.py | agemagician/fastai | bd2b0acc8891fa942c66dfa4a02fa64328182ef0 | [
"Apache-2.0"
] | null | null | null | fastai/text/models/awd_lstm.py | agemagician/fastai | bd2b0acc8891fa942c66dfa4a02fa64328182ef0 | [
"Apache-2.0"
] | null | null | null | fastai/text/models/awd_lstm.py | agemagician/fastai | bd2b0acc8891fa942c66dfa4a02fa64328182ef0 | [
"Apache-2.0"
] | null | null | null | from ...torch_core import *
from ...layers import *
from ...train import ClassificationInterpretation
from ...basic_train import *
from ...basic_data import *
from ..data import TextClasDataBunch
import matplotlib.cm as cm
__all__ = ['EmbeddingDropout', 'LinearDecoder', 'AWD_LSTM', 'RNNDropout',
'Sequential... | 48.457547 | 126 | 0.645965 |
2e3fd722422e102894066499123d5ebeae8c4e70 | 5,166 | py | Python | jwthenticator/api.py | petersmiddy/jwthenticator | 52ef8950f6be250bd27b5273861ac6c91f643f4c | [
"Apache-2.0"
] | null | null | null | jwthenticator/api.py | petersmiddy/jwthenticator | 52ef8950f6be250bd27b5273861ac6c91f643f4c | [
"Apache-2.0"
] | null | null | null | jwthenticator/api.py | petersmiddy/jwthenticator | 52ef8950f6be250bd27b5273861ac6c91f643f4c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from base64 import b64encode
from hashlib import sha512
from typing import Optional, Tuple, List
from Cryptodome.PublicKey import RSA
from jwt.utils import to_base64url_uint
from jwthenticator import schemas
from jwthenticator.tokens import TokenManager
from jwthenticator.keys ... | 40.046512 | 154 | 0.692025 |
e78fd484061894b99f2088d59733bdd5ac54954d | 1,598 | py | Python | tests/testcase.py | CallumJHays/pyngrok | e1a28948d1d8cf42f8eed1b166a2caf6b2a68066 | [
"MIT"
] | null | null | null | tests/testcase.py | CallumJHays/pyngrok | e1a28948d1d8cf42f8eed1b166a2caf6b2a68066 | [
"MIT"
] | null | null | null | tests/testcase.py | CallumJHays/pyngrok | e1a28948d1d8cf42f8eed1b166a2caf6b2a68066 | [
"MIT"
] | null | null | null | import os
import shutil
import unittest
import yaml
from pyngrok import ngrok
from pyngrok import process
__author__ = "Alex Laird"
__copyright__ = "Copyright 2019, Alex Laird"
__version__ = "1.3.7"
class NgrokTestCase(unittest.TestCase):
def setUp(self):
self.config_dir = os.path.normpath(os.path.join... | 29.054545 | 111 | 0.633917 |
2dd909c24d4c6463208c374fc60a174cd891613a | 4,471 | py | Python | app.py | amfchef/binance-trading-bot | af582f7d9e3114ede523907b36e4c7a9b80147c3 | [
"MIT"
] | 5 | 2021-08-29T11:01:29.000Z | 2021-09-24T05:22:11.000Z | app.py | amfchef/binance-trading-bot | af582f7d9e3114ede523907b36e4c7a9b80147c3 | [
"MIT"
] | null | null | null | app.py | amfchef/binance-trading-bot | af582f7d9e3114ede523907b36e4c7a9b80147c3 | [
"MIT"
] | 9 | 2021-08-29T11:34:11.000Z | 2021-10-03T07:48:40.000Z | from calculate import Calculate
import json, config
from werkzeug.utils import redirect
from flask import Flask, request, render_template
import datetime
from binance.client import Client
calculate = Calculate()
client = Client(config.API_KEY, config.API_SECRET)
app = Flask(__name__)
@app.route('/', methods=['GET',... | 34.658915 | 109 | 0.586446 |
c5c7a8469f4309fdc34d15ec761001165b985a9c | 4,522 | py | Python | neutron/db/address_scope_db.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | neutron/db/address_scope_db.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | neutron/db/address_scope_db.py | mihaibroc/neutron | dfb7c826d0846970bac00003cea98c9f6bd8f0b8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Huawei Technologies Co.,LTD.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 42.660377 | 78 | 0.644626 |
906ccc02d8963b09de3c5bd9918bc908f1c788f0 | 13,496 | py | Python | src/farmer/farmer_api.py | Quexington/chia-blockchain | d3ea1f119004749d8a65d292214e7856de1539c3 | [
"Apache-2.0"
] | null | null | null | src/farmer/farmer_api.py | Quexington/chia-blockchain | d3ea1f119004749d8a65d292214e7856de1539c3 | [
"Apache-2.0"
] | 75 | 2020-07-24T23:03:34.000Z | 2022-03-22T14:01:18.000Z | src/farmer/farmer_api.py | jespino/chia-blockchain | 6518b2bf42d03b29e83d1701900dfb0ede52d5b0 | [
"Apache-2.0"
] | 1 | 2020-07-20T01:58:15.000Z | 2020-07-20T01:58:15.000Z | import time
from typing import Callable, Optional
from blspy import AugSchemeMPL, G2Element
import src.server.ws_connection as ws
from src.consensus.pot_iterations import (
calculate_iterations_quality,
calculate_sp_interval_iters,
)
from src.farmer.farmer import Farmer
from src.protocols import harvester_pro... | 46.378007 | 120 | 0.621147 |
8c3267d5554ddde7d3d15a51ce175673f67b7352 | 1,393 | py | Python | app/util.py | LiquidZulu/GDN | 54fcc66db3422a7911344de165e34a57ef0c4df3 | [
"CC0-1.0"
] | null | null | null | app/util.py | LiquidZulu/GDN | 54fcc66db3422a7911344de165e34a57ef0c4df3 | [
"CC0-1.0"
] | null | null | null | app/util.py | LiquidZulu/GDN | 54fcc66db3422a7911344de165e34a57ef0c4df3 | [
"CC0-1.0"
] | null | null | null | from ENV import *
from typing import Optional
from fastapi import FastAPI
import requests
async def iimages(year: int, month: int, day:int):
ymd = [int(str(year)[2:]),month,day]
ymd_str = ['00','00','00']
for i in range(len(ymd)):
if ymd[i] < 10:
ymd_str[i] = f'''0{ymd[i]}'''
... | 31.659091 | 253 | 0.567839 |
a5dd0a2329c15102cc244a1877dbd81b3b4599de | 11,271 | py | Python | Python_MiniGame_Fighter/venv/Lib/site-packages/pynput/keyboard/_darwin.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_MiniGame_Fighter/venv/Lib/site-packages/pynput/keyboard/_darwin.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | Python_MiniGame_Fighter/venv/Lib/site-packages/pynput/keyboard/_darwin.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | # coding=utf-8
# pynput
# Copyright (C) 2015-2021 Moses Palmér
#
# This program 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
# Software Foundation, either version 3 of the License, or (at your option) any
# later ve... | 33.445104 | 80 | 0.600302 |
b25455a7d88386aa3c34799b57a700095566c2d2 | 16,738 | py | Python | tests/test_functions.py | tellor-io/algorandTellorV2 | fe23e76a4a5df4af80fe5a932cc48410f3e3fdb5 | [
"MIT"
] | null | null | null | tests/test_functions.py | tellor-io/algorandTellorV2 | fe23e76a4a5df4af80fe5a932cc48410f3e3fdb5 | [
"MIT"
] | 14 | 2022-03-16T16:52:44.000Z | 2022-03-31T13:23:10.000Z | tests/test_functions.py | tellor-io/algorandTellorV2 | fe23e76a4a5df4af80fe5a932cc48410f3e3fdb5 | [
"MIT"
] | null | null | null | from time import time
import pytest
from algosdk import constants
from algosdk import encoding
from algosdk.algod import AlgodClient
from algosdk.error import AlgodHTTPError
from algosdk.future import transaction
from algosdk.logic import get_application_address
from conftest import App
from src.scripts.scripts impor... | 36.545852 | 117 | 0.702115 |
c0a0727a199ff332ee6c07dd9639991da1dc7ad8 | 16,133 | py | Python | spyder/plugins/editor/utils/autosave.py | StefRe/spyder | 210495f5b691cc2986a437c237cce8de4ab06b79 | [
"MIT"
] | null | null | null | spyder/plugins/editor/utils/autosave.py | StefRe/spyder | 210495f5b691cc2986a437c237cce8de4ab06b79 | [
"MIT"
] | null | null | null | spyder/plugins/editor/utils/autosave.py | StefRe/spyder | 210495f5b691cc2986a437c237cce8de4ab06b79 | [
"MIT"
] | 1 | 2020-06-25T02:06:59.000Z | 2020-06-25T02:06:59.000Z | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Autosave components for the Editor plugin and the EditorStack widget
The autosave system regularly checks the contents of all opened files and saves
a copy in th... | 37.693925 | 79 | 0.628587 |
7ec46c82b7e6b2ac5a26df8822777b1bee6e83e7 | 70 | py | Python | biosimulators_utils/__init__.py | virtualcell/Biosimulators_utils | 1b34e1e0a9ace706d245e9d515d0fae1e55a248d | [
"MIT"
] | 5 | 2020-10-06T12:00:09.000Z | 2021-09-09T17:07:41.000Z | biosimulators_utils/__init__.py | virtualcell/Biosimulators_utils | 1b34e1e0a9ace706d245e9d515d0fae1e55a248d | [
"MIT"
] | 102 | 2020-12-06T19:47:43.000Z | 2022-03-31T12:56:17.000Z | biosimulators_test_suite/__init__.py | reproducible-biomedical-modeling/OMEX_Archives | 3129d5bfd1275577b1f85b1e7efb7a32ecdb8b61 | [
"CC0-1.0",
"MIT"
] | 4 | 2021-01-27T19:56:34.000Z | 2022-02-03T21:08:20.000Z | from ._version import __version__ # noqa: F401
# :obj:`str`: version
| 23.333333 | 47 | 0.714286 |
2372d463ba297692c372cf8098bca9d35bd3c988 | 347 | py | Python | utils/DI.py | Wanket/RnD-py | 20ffe47adf96b32272304a9f6b1f1a98598f721f | [
"MIT"
] | null | null | null | utils/DI.py | Wanket/RnD-py | 20ffe47adf96b32272304a9f6b1f1a98598f721f | [
"MIT"
] | null | null | null | utils/DI.py | Wanket/RnD-py | 20ffe47adf96b32272304a9f6b1f1a98598f721f | [
"MIT"
] | null | null | null | import inject
from flask import Flask
from inject import Binder
from db.Connection import Connection
class DI:
@staticmethod
def configure() -> None:
inject.configure(DI.__config)
@staticmethod
def __config(binder: Binder) -> None:
binder.bind(Flask, Flask("res"))
binder.bind... | 20.411765 | 45 | 0.685879 |
96f78dbfb291eda3fbe10f4bcf51ad011881b0b2 | 478 | py | Python | tests/workflow/test_workflow_ingest_article_zip.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 17 | 2015-02-10T07:10:29.000Z | 2021-05-14T22:24:45.000Z | tests/workflow/test_workflow_ingest_article_zip.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 459 | 2015-03-31T18:24:23.000Z | 2022-03-30T19:44:40.000Z | tests/workflow/test_workflow_ingest_article_zip.py | elifesciences/elife-bot | d3a102c8030e4b7ec83cbd45e5f839dba4f9ffd9 | [
"MIT"
] | 9 | 2015-04-18T16:57:31.000Z | 2020-10-30T11:49:13.000Z | import unittest
import tests.settings_mock as settings_mock
from tests.activity.classes_mock import FakeLogger
from workflow.workflow_IngestArticleZip import workflow_IngestArticleZip
class TestWorkflowIngestArticleZip(unittest.TestCase):
def setUp(self):
self.workflow = workflow_IngestArticleZip(
... | 31.866667 | 72 | 0.76569 |
78559180e37c3310244cb3a9b3e5b85be18fa62f | 18,166 | py | Python | tests/nn/data_parallel/test_fsdp_offload.py | aazzolini/fairscale | e34146bf8a83caa233e5c2167c521b11d982735d | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | 1 | 2022-01-07T01:46:37.000Z | 2022-01-07T01:46:37.000Z | tests/nn/data_parallel/test_fsdp_offload.py | aazzolini/fairscale | e34146bf8a83caa233e5c2167c521b11d982735d | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | null | null | null | tests/nn/data_parallel/test_fsdp_offload.py | aazzolini/fairscale | e34146bf8a83caa233e5c2167c521b11d982735d | [
"Apache-2.0",
"BSD-3-Clause",
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
import functools
import itertools
import sys
import tempfile
import time
import unittest
from parameterized import param... | 39.577342 | 113 | 0.647638 |
b10e1ab183213890b93e336e9d8839a491814b1c | 487 | py | Python | smorest_sfs/modules/projects/models.py | ssfdust/smorest-sfs | 139f6817989ab041c81761d183169de20a26597e | [
"Apache-2.0"
] | 8 | 2020-05-11T07:11:03.000Z | 2022-03-25T01:58:18.000Z | smorest_sfs/modules/projects/models.py | ssfdust/smorest-sfs | 139f6817989ab041c81761d183169de20a26597e | [
"Apache-2.0"
] | null | null | null | smorest_sfs/modules/projects/models.py | ssfdust/smorest-sfs | 139f6817989ab041c81761d183169de20a26597e | [
"Apache-2.0"
] | 2 | 2020-05-11T03:53:38.000Z | 2021-03-25T01:11:15.000Z | """
smorest_sfs.modules.projects.models
~~~~~~~~~~~~~~~~~~~~~~~~~
项目的ORM模块
"""
from smorest_sfs.extensions.marshal import not_empty
from smorest_sfs.extensions.sqla import Model, SurrogatePK, db
class Project(Model, SurrogatePK):
"""
项目
Attribute:
name (str): 项目名称,禁止非空,非值,最大长度128
... | 19.48 | 71 | 0.626283 |
0682b5f3273eb9d5ed562ad6074716ce806c1251 | 33,772 | py | Python | tests/test_ops.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | tests/test_ops.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | tests/test_ops.py | sourcery-ai-bot/pystiche | 57bc6cfd074d47e8ad98a4f6e570b92ce37131bc | [
"BSD-3-Clause"
] | null | null | null | import itertools
import torch
from torch import nn
from torch.nn.functional import mse_loss
import pystiche
from pystiche import ops
from pystiche.enc import MultiLayerEncoder, SequentialEncoder, SingleLayerEncoder
from pystiche.image.transforms.functional import transform_motif_affinely
from pystiche.ops import func... | 33.975855 | 88 | 0.619389 |
37af1b548ed831057fb07991db198658e5ddb12f | 1,769 | py | Python | shells/generic_terraform_service/src/driver.py | oleksandr-r-q/CloudShell-Terraform-Shell | 8d331cf8eebeae794e4e73a3c70af8064bafa434 | [
"Apache-2.0"
] | 4 | 2021-11-26T05:41:05.000Z | 2022-03-11T20:01:40.000Z | shells/generic_terraform_service/src/driver.py | oleksandr-r-q/CloudShell-Terraform-Shell | 8d331cf8eebeae794e4e73a3c70af8064bafa434 | [
"Apache-2.0"
] | 10 | 2021-07-14T05:19:54.000Z | 2021-11-02T05:37:48.000Z | shells/generic_terraform_service/src/driver.py | oleksandr-r-q/CloudShell-Terraform-Shell | 8d331cf8eebeae794e4e73a3c70af8064bafa434 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:46:59.000Z | 2021-11-01T07:46:59.000Z | from cloudshell.shell.core.driver_context import ResourceCommandContext
from cloudshell.shell.core.resource_driver_interface import ResourceDriverInterface
from cloudshell.shell.core.session.logging_session import LoggingSessionContext
from cloudshell.iac.terraform import TerraformShell, TerraformShellConfig
class G... | 41.139535 | 112 | 0.724138 |
0d724f5741c618afb03935550baf32cca9078a99 | 347 | py | Python | scaleformer/version.py | ScalableTransformer/Scaleformer | 57e65deb7ba5fdda88a21bdaf71092a0101cf8c3 | [
"MIT"
] | null | null | null | scaleformer/version.py | ScalableTransformer/Scaleformer | 57e65deb7ba5fdda88a21bdaf71092a0101cf8c3 | [
"MIT"
] | null | null | null | scaleformer/version.py | ScalableTransformer/Scaleformer | 57e65deb7ba5fdda88a21bdaf71092a0101cf8c3 | [
"MIT"
] | 1 | 2022-03-01T06:24:31.000Z | 2022-03-01T06:24:31.000Z | # -*- coding: utf-8 -*-
author = 'Benoit Favier'
author_email = 'scalabletransformer@gmail.com'
version = '0.1.0'
name = 'scaleformer'
description = 'General utilities for Python'
keywords = ['Utilities', 'Data Science', 'Machine Learning']
install_requires = [
'matplotlib==3.3.4',
'torch==1.9.0a0+df837d0'
]
... | 21.6875 | 60 | 0.67147 |
a68c3a20d9bed8a144103c1fae8920393f9c5ab7 | 116,370 | py | Python | main.py | badawiki/openNAMU | 347c7244a9638380da083216f201b9b91b9049be | [
"BSD-3-Clause"
] | null | null | null | main.py | badawiki/openNAMU | 347c7244a9638380da083216f201b9b91b9049be | [
"BSD-3-Clause"
] | null | null | null | main.py | badawiki/openNAMU | 347c7244a9638380da083216f201b9b91b9049be | [
"BSD-3-Clause"
] | null | null | null | from flask import Flask, request, session, render_template, send_file
app = Flask(__name__)
import bcrypt
import os
import difflib
import hashlib
import json
import pymysql
json_data = open('set.json').read()
set_data = json.loads(json_data)
if(not set_data['log'] == "O"):
import logging
log = logging.getLo... | 48.447127 | 638 | 0.43861 |
ba9d54ae669737413912d1f11f63825687f7389d | 11,189 | py | Python | Sketches/JL/Slideshows/Chooser_jlei.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/JL/Slideshows/Chooser_jlei.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/JL/Slideshows/Chooser_jlei.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | 31.429775 | 111 | 0.602645 |
fae7d620f7d2aa16c529ea896763775407cbc5b7 | 2,996 | py | Python | tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py | AdamHillier/tensorflow | 6780ebf4858a56fd0745f03fa5a61b249559f3cd | [
"Apache-2.0"
] | 4 | 2016-07-14T15:15:05.000Z | 2017-03-02T15:17:22.000Z | tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py | AdamHillier/tensorflow | 6780ebf4858a56fd0745f03fa5a61b249559f3cd | [
"Apache-2.0"
] | 1 | 2021-03-23T03:25:15.000Z | 2021-03-23T03:25:15.000Z | tensorflow/python/keras/layers/preprocessing/index_lookup_distribution_test.py | AdamHillier/tensorflow | 6780ebf4858a56fd0745f03fa5a61b249559f3cd | [
"Apache-2.0"
] | 5 | 2016-11-07T21:17:45.000Z | 2020-05-31T00:16:59.000Z | # Copyright 2019 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... | 39.421053 | 83 | 0.720294 |
a9f6388fd4bcc90b482454ef34c29f02e4890027 | 2,121 | py | Python | diofant/tests/matrices/test_interactions.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | 1 | 2021-08-22T09:34:15.000Z | 2021-08-22T09:34:15.000Z | diofant/tests/matrices/test_interactions.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | null | null | null | diofant/tests/matrices/test_interactions.py | project-kotinos/diofant___diofant | 882549ac3a4dac238695aa620c02fce6ca33f9d3 | [
"BSD-3-Clause"
] | null | null | null | """
We have a few different kind of Matrices
Matrix, ImmutableMatrix, MatrixExpr
Here we test the extent to which they cooperate
"""
import pytest
from diofant.abc import a
from diofant.matrices import (Identity, ImmutableMatrix, Matrix, MatrixSymbol,
eye)
from diofant.matrices.expressi... | 25.554217 | 78 | 0.604903 |
6cf9d457ffa2a01f8692b41751fd00a2d0899361 | 3,276 | py | Python | triple_gaussian.py | colmcoughlan/scripts | 27aaf83fa7c063344e726c81fbe72af76b2ef913 | [
"BSD-2-Clause"
] | null | null | null | triple_gaussian.py | colmcoughlan/scripts | 27aaf83fa7c063344e726c81fbe72af76b2ef913 | [
"BSD-2-Clause"
] | null | null | null | triple_gaussian.py | colmcoughlan/scripts | 27aaf83fa7c063344e726c81fbe72af76b2ef913 | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014, Colm Coughlan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the ... | 32.76 | 129 | 0.692613 |
b45d854b0fbbcfe516e6c13580882cb669b14242 | 19,624 | py | Python | acq4/devices/Microscope/Microscope.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/devices/Microscope/Microscope.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | acq4/devices/Microscope/Microscope.py | ablot/acq4 | ba7cd340d9d0282640adb501d3788f8c0837e4c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from acq4.devices.OptomechDevice import *
from acq4.devices.LightSource import LightSource
from acq4.devices.Stage import Stage
from deviceTemplate import Ui_Form
from acq4.util.Mutex import Mutex
from acq4.modules.Camera import CameraModuleInterface
import acq4.pyqtgraph as pg
import collection... | 38.031008 | 157 | 0.62077 |
0482cc7050f17ee4191c1f574bf5b4c7de426ff1 | 2,655 | py | Python | python/solution.py | noahlozevski/TUP_coding_project | 525b68e2ec48955db78ca6244022b96465a27cc7 | [
"MIT"
] | null | null | null | python/solution.py | noahlozevski/TUP_coding_project | 525b68e2ec48955db78ca6244022b96465a27cc7 | [
"MIT"
] | null | null | null | python/solution.py | noahlozevski/TUP_coding_project | 525b68e2ec48955db78ca6244022b96465a27cc7 | [
"MIT"
] | null | null | null |
"""
This function replaces a substring with another substring and deletes the default value everywhere it appears in a function.
Modify it to replace the default value contained in double square brackets any time
it replaces a substring
def ireplace(old, new, text):
idx = 0
while idx < len(text):
ind... | 40.846154 | 153 | 0.685876 |
156b0938688ec46f0d3b0083fd3cdcefd45466b6 | 1,542 | py | Python | allauth/socialaccount/providers/vk_provider/provider.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/vk_provider/provider.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/vk_provider/provider.py | Fuzzwah/django-allauth | 071cbef1388bb61a563d3e41197bd5b7c26664d2 | [
"MIT"
] | null | null | null | from allauth.socialaccount import app_settings
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2_provider.provider import OAuth2Provider
class VKAccount(ProviderAccount):
def get_profile_url(self):
return "https://vk.com/id%s" % self.account.extra... | 29.653846 | 83 | 0.645914 |
8c848d317ffaa3ac0b00a301072e131cc5c1f04a | 2,808 | py | Python | logic/game_board_object.py | photonic-bit/PyNorts | 6030294da18849316d7a599003eaf2f6e3a06d78 | [
"BSD-2-Clause"
] | null | null | null | logic/game_board_object.py | photonic-bit/PyNorts | 6030294da18849316d7a599003eaf2f6e3a06d78 | [
"BSD-2-Clause"
] | null | null | null | logic/game_board_object.py | photonic-bit/PyNorts | 6030294da18849316d7a599003eaf2f6e3a06d78 | [
"BSD-2-Clause"
] | null | null | null | '''
Author: Photonic
Module: GameBoard_object
Date: 3/1/2020
Description: Class and Methods for dealing with a norts and crosses game board
Date: 3/1/2020
TODO:
'''
import copy
class Board:
'''
Abstract base class for Game Boards.
'''
def __init__(self):
self._board = [
['.', '.', '.']... | 26.742857 | 109 | 0.546652 |
1e2220574a4d66fad3aefc148c34852cdf2c1d0c | 343 | py | Python | share/gdb/python/sched/__init__.py | jcbaillie/libport | b8192b177ae0ae63979c17ea7685a8617b03e11f | [
"BSD-3-Clause"
] | 3 | 2015-05-29T09:35:32.000Z | 2021-02-23T07:45:01.000Z | share/gdb/python/sched/__init__.py | jcbaillie/libport | b8192b177ae0ae63979c17ea7685a8617b03e11f | [
"BSD-3-Clause"
] | 2 | 2019-01-31T10:23:47.000Z | 2019-01-31T10:35:06.000Z | share/gdb/python/sched/__init__.py | jcbaillie/libport | b8192b177ae0ae63979c17ea7685a8617b03e11f | [
"BSD-3-Clause"
] | 7 | 2015-01-29T20:49:06.000Z | 2019-04-24T04:06:22.000Z | # Copyright (C) 2011, Gostai S.A.S.
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
"""This file define the libport gdb module"""
... | 28.583333 | 65 | 0.752187 |
532c7cdea36e00ed5844e36106911f8880b639e9 | 63,575 | py | Python | proto_final.py | Taeksu-Kim/Project_Jalseomgige | 50ba78085a9daeb9fc86c66abc98038ecd0bfd89 | [
"MIT"
] | null | null | null | proto_final.py | Taeksu-Kim/Project_Jalseomgige | 50ba78085a9daeb9fc86c66abc98038ecd0bfd89 | [
"MIT"
] | null | null | null | proto_final.py | Taeksu-Kim/Project_Jalseomgige | 50ba78085a9daeb9fc86c66abc98038ecd0bfd89 | [
"MIT"
] | null | null | null | import cv2
from data import COCODetection, get_label_map, MEANS, COLORS
from yolact import Yolact
from utils.augmentations import BaseTransform, FastBaseTransform, Resize
from utils.functions import MovingAverage, ProgressBar
from layers.box_utils import jaccard, center_size, mask_iou
from utils import timer
from utils... | 41.963696 | 159 | 0.574361 |
aabcdd5d95ce4281c6b1c5ed37a009f57b5a7a6d | 678 | py | Python | all/policies/softmax.py | gordon-frost-hwu/autonomous-learning-library | 76bc1b31e6b5cca326a9d868ddbb3d7f55fc8cc4 | [
"MIT"
] | 1 | 2020-04-11T23:45:59.000Z | 2020-04-11T23:45:59.000Z | all/policies/softmax.py | benwaldner/autonomous-learning-library | 42f25149277a13d325587f1f7d579da8392fcc38 | [
"MIT"
] | 1 | 2020-02-26T08:53:10.000Z | 2020-02-26T08:53:10.000Z | all/policies/softmax.py | syuntoku14/autonomous-learning-library | 42f25149277a13d325587f1f7d579da8392fcc38 | [
"MIT"
] | 1 | 2020-04-11T23:45:14.000Z | 2020-04-11T23:45:14.000Z | import torch
from torch.nn import functional
from all.nn import RLNetwork
from all.approximation import Approximation
class SoftmaxPolicy(Approximation):
def __init__(
self,
model,
optimizer,
name='policy',
**kwargs
):
model = SoftmaxPolicyNe... | 26.076923 | 63 | 0.643068 |
ed8bab6cbac80d93f9be47144bead6d525940f57 | 1,016 | py | Python | web/backend/app/controller/qa_controller.py | atesbilgin/ENELPI---Soru-Cevap-Sistemi | ac839d0445863ac4735d05d03d4e8bea78f51c5b | [
"MIT"
] | 31 | 2020-12-05T15:56:48.000Z | 2022-03-01T15:47:00.000Z | web/backend/app/controller/qa_controller.py | atesbilgin/ENELPI---Soru-Cevap-Sistemi | ac839d0445863ac4735d05d03d4e8bea78f51c5b | [
"MIT"
] | null | null | null | web/backend/app/controller/qa_controller.py | atesbilgin/ENELPI---Soru-Cevap-Sistemi | ac839d0445863ac4735d05d03d4e8bea78f51c5b | [
"MIT"
] | 7 | 2020-07-02T07:51:18.000Z | 2020-10-15T14:01:23.000Z | from flask import Blueprint, request
from flask import jsonify
from app.services.BertService import BertQAService
from app.services.ElectraService import ElectraQAService
qa_app = Blueprint('qa_app', __name__)
bert_service = BertQAService()
electra_service = ElectraQAService()
@qa_app.route('/qa_bert', methods=['PO... | 30.787879 | 80 | 0.689961 |
f7ea5eff2a766e85687f7f09308bd548e287bde2 | 9,011 | py | Python | resan/resa.py | taoshen58/ReSAN | f65f3fe656907be0ec14ddf18cd7d2608e7ef905 | [
"Apache-2.0"
] | 30 | 2018-03-31T12:10:43.000Z | 2021-11-18T06:27:58.000Z | resan/resa.py | taoshen58/ReSAN | f65f3fe656907be0ec14ddf18cd7d2608e7ef905 | [
"Apache-2.0"
] | 3 | 2018-03-31T12:41:25.000Z | 2018-04-08T07:59:37.000Z | resan/resa.py | taoshen58/ReSAN | f65f3fe656907be0ec14ddf18cd7d2608e7ef905 | [
"Apache-2.0"
] | 8 | 2018-04-20T13:00:28.000Z | 2020-06-16T17:10:25.000Z | import tensorflow as tf
from resan.utils.nn import bn_dense_layer, dropout, linear
from resan.utils.general import exp_mask_for_high_rank, mask_for_high_rank
from resan.rl_nn import reduce_data_rep_max_len
def reinforced_self_attention(
rep_tensor, rep_mask, dep_selection, head_selection,
hn=None, ke... | 49.240437 | 115 | 0.639885 |
2259f9fcb909453da702774418056c525a1eb6ee | 389 | py | Python | test_main.py | flkapes/countdown-game | 4c7270748f18903b7c7bf87164a22a1e0fe5aa85 | [
"MIT"
] | null | null | null | test_main.py | flkapes/countdown-game | 4c7270748f18903b7c7bf87164a22a1e0fe5aa85 | [
"MIT"
] | null | null | null | test_main.py | flkapes/countdown-game | 4c7270748f18903b7c7bf87164a22a1e0fe5aa85 | [
"MIT"
] | null | null | null | from main import *
def test_select_characters():
assert type(select_characters()) == type('l')
assert len(select_characters()) == 9
def test_dictionary_reader():
assert type(dictionary_reader()) == type(['hi'])
def test_word_lookup():
y, x = word_lookup(dictionary_reader(), select_characters())
... | 21.611111 | 64 | 0.658098 |
305889d2c2541e5e118f205ffebc74b080132851 | 415 | py | Python | test_calculate.py | missKatiaPunter/numpy-starter | 0110057852b53cc9bec8f96cc599a9cc4f32fe7f | [
"MIT"
] | null | null | null | test_calculate.py | missKatiaPunter/numpy-starter | 0110057852b53cc9bec8f96cc599a9cc4f32fe7f | [
"MIT"
] | null | null | null | test_calculate.py | missKatiaPunter/numpy-starter | 0110057852b53cc9bec8f96cc599a9cc4f32fe7f | [
"MIT"
] | 1 | 2021-08-18T10:49:06.000Z | 2021-08-18T10:49:06.000Z | import pytest
import calculate as c
def test_add():
assert c.add_arrays([2,2],[3,3]) == [5,5]
def test_multiply():
all([a == b for a, b in zip(c.multiply_two_arrays([2,2],[2,2]), [4,4])])
def test_subtract_two_arrays():
all([a == b for a, b in zip(c.subtract_two_arrays([2,2],[1,1]), [1,1])])
def test_... | 25.9375 | 76 | 0.609639 |
d5fde750f239d0adeec7d3f5d3ee7564d0fddca0 | 3,719 | py | Python | constellation_forms/models/formSubmission.py | ConstellationApps/Forms | 5d2bacf589c1a473cf619f34d569d33191b11285 | [
"ISC"
] | 2 | 2017-04-18T02:41:00.000Z | 2017-04-18T02:51:39.000Z | constellation_forms/models/formSubmission.py | ConstellationApps/Forms | 5d2bacf589c1a473cf619f34d569d33191b11285 | [
"ISC"
] | 33 | 2017-03-03T06:16:44.000Z | 2019-08-20T23:06:21.000Z | constellation_forms/models/formSubmission.py | ConstellationApps/Forms | 5d2bacf589c1a473cf619f34d569d33191b11285 | [
"ISC"
] | 1 | 2017-02-22T18:48:04.000Z | 2017-02-22T18:48:04.000Z | from .form import Form
from django.contrib.auth.models import User
from django.contrib.postgres.fields import JSONField
from django.core.exceptions import ValidationError
from django.db import models
import re
class FormSubmission(models.Model):
"""
Form Submission Database Model
A Form Submission instan... | 39.56383 | 78 | 0.598279 |
6364816b9ab2d491681158f025c7724936a1344c | 29,750 | py | Python | pandas/core/internals/construction.py | fathomer/pandas | 5baccd46441e94fca4b40f25da70a563f642fae3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/construction.py | fathomer/pandas | 5baccd46441e94fca4b40f25da70a563f642fae3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/internals/construction.py | fathomer/pandas | 5baccd46441e94fca4b40f25da70a563f642fae3 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | """
Functions for preparing various inputs passed to the DataFrame or Series
constructors before passing them to a BlockManager.
"""
from __future__ import annotations
from collections import abc
from typing import (
TYPE_CHECKING,
Any,
Dict,
Hashable,
List,
Optional,
Sequence,
Tuple,
... | 30.925156 | 88 | 0.603664 |
4a0d2c027a02f66ccf562f74d79f925acb5bdf83 | 354 | py | Python | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | yacman/exceptions.py | vreuter/yacman | 2cd07351e4f0d418a5cd092d256cbfe476ccc5b5 | [
"BSD-2-Clause"
] | null | null | null | """ Package exception types """
__all__ = ["FileFormatError", "AliasError", "UndefinedAliasError"]
class FileFormatError(Exception):
""" Exception for invalid file format. """
pass
class AliasError(Exception):
""" Alias related error. """
pass
class UndefinedAliasError(AliasError):
""" Alias ... | 16.857143 | 66 | 0.666667 |
81282a61cf2bbbecefcedc556d5c8399c187f378 | 19,067 | py | Python | scicast/significance_testing.py | iandriver/scicast | 5c391a20e063fbb4a540e69704208f8309afc484 | [
"MIT"
] | 5 | 2016-11-05T00:01:15.000Z | 2020-11-19T13:54:30.000Z | scicast/significance_testing.py | iandriver/SCICAST | 5c391a20e063fbb4a540e69704208f8309afc484 | [
"MIT"
] | null | null | null | scicast/significance_testing.py | iandriver/SCICAST | 5c391a20e063fbb4a540e69704208f8309afc484 | [
"MIT"
] | 1 | 2017-08-29T02:33:49.000Z | 2017-08-29T02:33:49.000Z |
import pandas as pd
import os
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import scipy
import seaborn as sns
import itertools
import matplotlib.patches as patches
import warnings
import numpy as np
from collections import Counter
import statsmodels.stats.multitest as smm
def group_gene... | 53.259777 | 347 | 0.602664 |
5b5dc9bae97de202485059cd61000f78a4f8818d | 16,675 | py | Python | Python_Gst_Webrtc_Client/gstwebrtc_caller_callee.py | remmius/GstWebRTC_Python | 1c938cc03f84c9cdedde24f5b8a6ebaec4f78761 | [
"BSD-2-Clause",
"MIT"
] | null | null | null | Python_Gst_Webrtc_Client/gstwebrtc_caller_callee.py | remmius/GstWebRTC_Python | 1c938cc03f84c9cdedde24f5b8a6ebaec4f78761 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2021-01-04T19:08:52.000Z | 2021-01-04T19:08:52.000Z | Python_Gst_Webrtc_Client/gstwebrtc_caller_callee.py | remmius/GstWebRTC_Python | 1c938cc03f84c9cdedde24f5b8a6ebaec4f78761 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2021-09-30T17:08:28.000Z | 2021-09-30T17:08:28.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 22 11:38:18 2020
#GST_DEBUG=3 gst-launch-1.0 -v videotestsrc is-live=true ! video/x-raw,width=120,height=80 ! videoconvert ! omxh264enc ! capsfilter caps="video/x-h264,profile=(string)baseline" ! rtph264pay name=videopay ! fakesink
GST_DEBUG=3 gst-... | 49.33432 | 247 | 0.629625 |
bf5fe0b2d199b4f9ef8082baca88332b3bdfab5a | 4,714 | py | Python | fuzz.py | blockchainhelppro/Crypto-Python-Script | 9c18a5329a256e356d6c44e07c923564b306b2b2 | [
"MIT"
] | null | null | null | fuzz.py | blockchainhelppro/Crypto-Python-Script | 9c18a5329a256e356d6c44e07c923564b306b2b2 | [
"MIT"
] | null | null | null | fuzz.py | blockchainhelppro/Crypto-Python-Script | 9c18a5329a256e356d6c44e07c923564b306b2b2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under both the Apache 2.0 license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the root directory of this source tree)... | 31.013158 | 79 | 0.612855 |
52b4dc417eaa9b6e30ba43c7d43edce92ae6c55c | 1,091 | py | Python | setup.py | mattfenwick/NMRPyStar | fd8b1059f85d95295ddd674eb613d5f4a0d4f1f6 | [
"MIT"
] | 5 | 2015-06-16T12:23:14.000Z | 2017-02-27T13:23:08.000Z | setup.py | mattfenwick/NMRPyStar | fd8b1059f85d95295ddd674eb613d5f4a0d4f1f6 | [
"MIT"
] | 6 | 2015-08-25T20:34:57.000Z | 2020-08-05T19:29:51.000Z | setup.py | mattfenwick/NMRPyStar | fd8b1059f85d95295ddd674eb613d5f4a0d4f1f6 | [
"MIT"
] | 4 | 2015-06-16T12:23:17.000Z | 2019-03-07T12:11:31.000Z | import setuptools
with open('README.txt') as f:
README = f.read()
setuptools.setup(
name='NMRPyStar',
version='1.0.0',
python_requires=">=3.5",
# install_requires=[''],
# packages=setuptools.find_packages(),
packages=[
'nmrpystar',
'nmrpystar.unparse'
],
license='M... | 30.305556 | 72 | 0.614115 |
707b2c5a31a97cd30d9715d63e068569f7cf01e0 | 26,525 | py | Python | data/prepare_data.py | lyn1874/raman_spectra_matching_with_contrastive_learning | eb163998e15fb380d39fe60975bbe3d20f2618ce | [
"MIT"
] | null | null | null | data/prepare_data.py | lyn1874/raman_spectra_matching_with_contrastive_learning | eb163998e15fb380d39fe60975bbe3d20f2618ce | [
"MIT"
] | null | null | null | data/prepare_data.py | lyn1874/raman_spectra_matching_with_contrastive_learning | eb163998e15fb380d39fe60975bbe3d20f2618ce | [
"MIT"
] | null | null | null | """
Created on 11:47 at 09/07/2021
@author: bo
"""
import numpy as np
import os
import pickle
import torch
from torch.utils.data import Dataset
import torchvision.transforms as transforms
import data.rruff as rruff
import data.organic as organic
import data.bacteria as bacteria
def read_dataset(raman_type, model_dir... | 50.141777 | 119 | 0.596381 |
030172f74a611e1b7120dc5cbdbf6afcceab0443 | 59,592 | py | Python | axiom/test/test_query.py | twisted/axiom | 28191ede99287e9a87c1ff561b831f7d80aaa2fe | [
"MIT"
] | 23 | 2015-01-08T07:29:32.000Z | 2021-11-03T11:27:48.000Z | axiom/test/test_query.py | twisted/axiom | 28191ede99287e9a87c1ff561b831f7d80aaa2fe | [
"MIT"
] | 109 | 2015-01-08T05:54:56.000Z | 2022-03-02T04:06:40.000Z | axiom/test/test_query.py | twisted/axiom | 28191ede99287e9a87c1ff561b831f7d80aaa2fe | [
"MIT"
] | 16 | 2015-01-08T07:08:43.000Z | 2021-07-28T02:53:17.000Z |
import operator, random
from twisted.trial.unittest import TestCase
from axiom.iaxiom import IComparison, IColumn
from axiom.store import Store, ItemQuery, MultipleItemQuery
from axiom.item import Item, Placeholder
from axiom import errors
from axiom.attributes import (
reference, text, bytes, integer, AND, OR,... | 32.869277 | 114 | 0.560092 |
2620b1b437d8ef6e3a7b0c0217788fae3218dc91 | 285 | py | Python | white_matter/wm_recipe/writers/connection_mapping_writer.py | alex4200/Long-range-micro-connectome | 833aad78bc71e49a5059b276e65d3fef21686f9d | [
"BSD-3-Clause"
] | 9 | 2019-05-01T13:12:17.000Z | 2021-11-23T10:34:56.000Z | white_matter/wm_recipe/writers/connection_mapping_writer.py | alex4200/Long-range-micro-connectome | 833aad78bc71e49a5059b276e65d3fef21686f9d | [
"BSD-3-Clause"
] | 2 | 2022-02-03T13:56:22.000Z | 2022-02-04T07:16:37.000Z | white_matter/wm_recipe/writers/connection_mapping_writer.py | alex4200/Long-range-micro-connectome | 833aad78bc71e49a5059b276e65d3fef21686f9d | [
"BSD-3-Clause"
] | 1 | 2022-02-03T12:05:12.000Z | 2022-02-03T12:05:12.000Z | from .copy_writer import CopyWriter
class ConnectionMappingWriter(CopyWriter):
def __init__(self):
import os
fn = os.path.join(os.path.split(__file__)[0],
'../yaml/mapping.yaml')
super(ConnectionMappingWriter, self).__init__(fn)
| 28.5 | 57 | 0.635088 |
45bec722faa6ef7ae56c88ff31eb86ecc771cb86 | 831 | py | Python | aws_costs_cli/TerminalFormatter.py | danilocgsilva/aws-costs-cli | d5a20119854d08c3a6e02e074e296417eea3430d | [
"MIT"
] | 1 | 2021-12-10T14:08:50.000Z | 2021-12-10T14:08:50.000Z | aws_costs_cli/TerminalFormatter.py | danilocgsilva/aws-costs-cli | d5a20119854d08c3a6e02e074e296417eea3430d | [
"MIT"
] | null | null | null | aws_costs_cli/TerminalFormatter.py | danilocgsilva/aws-costs-cli | d5a20119854d08c3a6e02e074e296417eea3430d | [
"MIT"
] | null | null | null | from aws_costs_cli.FormatSingle import FormatSingle
class TerminalFormatter:
def get(self, results: dict):
amount = 0
for result in results["ResultsByTime"]:
formatSingle = FormatSingle(result)
amount += formatSingle.getAmount()
self.__showData(formatSingle)
... | 28.655172 | 72 | 0.586041 |
d2abc7712a4f45ea99b81a57d4cc6da5e0cf87b3 | 3,270 | py | Python | openprocurement/auctions/swiftsure/views/question.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/swiftsure/views/question.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | openprocurement/auctions/swiftsure/views/question.py | bdmbdsm/openprocurement.auctions.swiftsure | f5b93555eb12212c69c8168f861376eae85f4648 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from openprocurement.auctions.core.utils import (
apply_patch,
context_unpack,
get_now,
json_view,
opresource,
save_auction,
)
from openprocurement.auctions.core.validation import (
validate_question_data,
validate_patch_question_data,
)
from openprocurement.aucti... | 51.09375 | 141 | 0.665138 |
9617e863528a83040cda36e8bf152174271b424b | 454 | py | Python | chas/server/personality/IDIntel1.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | chas/server/personality/IDIntel1.py | Owen-Cochell/chas | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | 1 | 2018-08-09T18:51:43.000Z | 2020-08-31T20:54:00.000Z | chas/server/personality/IDIntel1.py | Owen-Cochell/C.H.A.S | 303bf090e6db19a326888f3e31268f8035576255 | [
"Apache-2.0"
] | null | null | null | from chaslib.resptools import BasePersonality
class IDIntell1(BasePersonality):
"""
CHAS Ideal intelligence 1.
This personality is trianed on a dataset located here:
https://www.kaggle.com/eibriel/rdany-conversations/data
This is an attempt to create an ideal CHAS personality.
"""
def _... | 22.7 | 81 | 0.709251 |
7030401a9a15cf2314cd929d683da7f9a9f410ad | 2,034 | py | Python | examples/reporting/image_reporting.py | noklam/trains | 70536544ed5e2b9aac8576ef2eaaef31c99ca670 | [
"Apache-2.0"
] | 1 | 2020-11-19T14:00:40.000Z | 2020-11-19T14:00:40.000Z | examples/reporting/image_reporting.py | aliceUnhinged613/trains | 8ec6bba4d91104a2bdd2e537bec21078529540e0 | [
"Apache-2.0"
] | 2 | 2020-07-05T08:28:40.000Z | 2020-08-11T13:32:49.000Z | examples/reporting/image_reporting.py | aliceUnhinged613/trains | 8ec6bba4d91104a2bdd2e537bec21078529540e0 | [
"Apache-2.0"
] | null | null | null | # TRAINS - Example of manual graphs and statistics reporting
#
import os
import numpy as np
from PIL import Image
from trains import Task, Logger
def report_debug_images(logger, iteration=0):
# type: (Logger, int) -> ()
"""
reporting images to debug samples section
:param logger: The task.logger to... | 29.911765 | 92 | 0.677974 |
a949b84de2c3744223a93d14f85887f106408058 | 455 | py | Python | metrics/EmpiricalCorrelaionCoefficient.py | privateos/ConvGRU-TSNet | 0953d9f0e742cac253046e61af6f39ec446766eb | [
"MIT"
] | null | null | null | metrics/EmpiricalCorrelaionCoefficient.py | privateos/ConvGRU-TSNet | 0953d9f0e742cac253046e61af6f39ec446766eb | [
"MIT"
] | null | null | null | metrics/EmpiricalCorrelaionCoefficient.py | privateos/ConvGRU-TSNet | 0953d9f0e742cac253046e61af6f39ec446766eb | [
"MIT"
] | null | null | null | import numpy as np
def CORR(y, y_pred):
m = np.mean(y, 0)
mp = np.mean(y_pred, 0)
s0 = y - m
s1 = y_pred - mp
A = np.sum(s0*s1, 0)
B = np.sum(np.square(s0), 0)
C = np.sum(np.square(s1), 0)
D = np.sqrt(B*C)
t = D!=0
E = A[t]/D[t]
F = np.mean(E, 0)
return F
if __name__ =... | 18.958333 | 38 | 0.518681 |
80e7bdfbac137e203acff7bc14368d450814fd7c | 1,756 | py | Python | script.py | PrakashPirate/Autofilterbotmh | 6d64437998f051d3b19340a434460f41293aac19 | [
"MIT"
] | null | null | null | script.py | PrakashPirate/Autofilterbotmh | 6d64437998f051d3b19340a434460f41293aac19 | [
"MIT"
] | null | null | null | script.py | PrakashPirate/Autofilterbotmh | 6d64437998f051d3b19340a434460f41293aac19 | [
"MIT"
] | null | null | null | class script(object):
START_MSG = """ <b>Hi {}
You can call this as an Auto Filter Bot if you like :D
This is Version 2 of Auto Filter Bot
Bot gives button link to files in connected channels on query !
No need to add filters for your files or movies from now on!
For more click <i>help</i></b>"""
HELP_... | 24.388889 | 88 | 0.681663 |
28ee7eb3dec1e1ef706647ae490f81fc8082e2f7 | 2,498 | py | Python | accounts/migrations/0001_initial.py | mathemartins/talisaHMO | 411c995049524f548706e9b99049ee3ef0d0a2d8 | [
"PostgreSQL",
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | mathemartins/talisaHMO | 411c995049524f548706e9b99049ee3ef0d0a2d8 | [
"PostgreSQL",
"MIT"
] | null | null | null | accounts/migrations/0001_initial.py | mathemartins/talisaHMO | 411c995049524f548706e9b99049ee3ef0d0a2d8 | [
"PostgreSQL",
"MIT"
] | 1 | 2020-12-14T19:57:25.000Z | 2020-12-14T19:57:25.000Z | # Generated by Django 3.1.2 on 2021-06-27 19:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='User'... | 43.068966 | 118 | 0.578062 |
94457ce4b7ad6aa4f5729096cf8276d632011ab4 | 11,136 | py | Python | redash/handlers/users.py | wings-xue/redash_chi | 243df22b5d55f12702cff21b69fa48e478d9ca11 | [
"BSD-2-Clause"
] | null | null | null | redash/handlers/users.py | wings-xue/redash_chi | 243df22b5d55f12702cff21b69fa48e478d9ca11 | [
"BSD-2-Clause"
] | null | null | null | redash/handlers/users.py | wings-xue/redash_chi | 243df22b5d55f12702cff21b69fa48e478d9ca11 | [
"BSD-2-Clause"
] | 1 | 2021-02-01T08:26:08.000Z | 2021-02-01T08:26:08.000Z | import re
import time
from flask import request
from flask_restful import abort
from flask_login import current_user, login_user
from funcy import project
from sqlalchemy.orm.exc import NoResultFound
from sqlalchemy.exc import IntegrityError
from disposable_email_domains import blacklist
from funcy import partial
from... | 31.726496 | 117 | 0.60731 |
1bec5c2403ace71788167a4d2f563a562e220e80 | 6,386 | py | Python | server/helpers/cthulhu.py | carlosgprado/BrundleFuzz | 0850879e55f87b9db1c6b1df6dba1cb930c47a63 | [
"MIT"
] | 90 | 2016-09-12T10:02:38.000Z | 2022-01-04T08:08:26.000Z | server/helpers/cthulhu.py | carlosgprado/BrundleFuzz | 0850879e55f87b9db1c6b1df6dba1cb930c47a63 | [
"MIT"
] | null | null | null | server/helpers/cthulhu.py | carlosgprado/BrundleFuzz | 0850879e55f87b9db1c6b1df6dba1cb930c47a63 | [
"MIT"
] | 38 | 2016-09-11T03:33:44.000Z | 2020-02-18T11:00:08.000Z | #
# Generate test cases, either via
# mutation or generation
#
import os
from helpers.common import MutationObject
from helpers.mutations.dumb_mutations import DumbMutationEngine
from helpers.mutations.generation import IntelligentMutationEngine
################################################################
# CTH... | 30.701923 | 78 | 0.608049 |
01b7020a105b71e7379def3148e8b6cf80eef70e | 196 | py | Python | fib.py | craigmaloney/intro_debugging_python | 3de8603d222f417ad40a7f0c548c2ce0c1d922c6 | [
"MIT"
] | 4 | 2017-09-12T18:54:45.000Z | 2021-01-16T00:59:03.000Z | fib.py | craigmaloney/intro_debugging_python | 3de8603d222f417ad40a7f0c548c2ce0c1d922c6 | [
"MIT"
] | null | null | null | fib.py | craigmaloney/intro_debugging_python | 3de8603d222f417ad40a7f0c548c2ce0c1d922c6 | [
"MIT"
] | null | null | null | def fib(n):
if n == 1:
return 1
elif n == 0:
return 0
else:
return fib(n-1) + fib(n-2)
def main():
print(fib(10))
if __name__ == '__main__':
main()
| 12.25 | 34 | 0.459184 |
306e2ef252a52e52f4daf2f7286148da01451d67 | 2,899 | py | Python | oggm/tasks.py | ehultee/oggm | 4a0310bc9e181c207be9933a9283faa3b8021f53 | [
"BSD-3-Clause"
] | null | null | null | oggm/tasks.py | ehultee/oggm | 4a0310bc9e181c207be9933a9283faa3b8021f53 | [
"BSD-3-Clause"
] | null | null | null | oggm/tasks.py | ehultee/oggm | 4a0310bc9e181c207be9933a9283faa3b8021f53 | [
"BSD-3-Clause"
] | null | null | null | """OGGM tasks.
This module is simply a shortcut to the core functions
"""
# flake8: noqa
# Entity tasks
from oggm.core.gis import define_glacier_region
from oggm.core.gis import process_dem
from oggm.core.gis import glacier_masks
from oggm.core.gis import simple_glacier_masks
from oggm.core.gis import rasterio_glacier... | 48.316667 | 66 | 0.880648 |
8569c6f3aaa9e8675da7c4276670136cdefcc4ad | 3,711 | py | Python | evalpro_utils.py | WuJie1010/Fine-Grained-Image-Captioning | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | 9 | 2019-10-31T05:39:39.000Z | 2021-08-18T02:30:17.000Z | evalpro_utils.py | WuJie1010/Concrete-Image-Captioning.Pytorch | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | null | null | null | evalpro_utils.py | WuJie1010/Concrete-Image-Captioning.Pytorch | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | 5 | 2018-10-08T07:55:01.000Z | 2019-09-09T12:32:52.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
import torch.nn as nn
from torch.autograd import Variable
import numpy as np
import json
from json import encoder
import random
import string
import time
import os
import sys
import misc.utils as ... | 33.736364 | 102 | 0.656157 |
86d0b9b7110f6f23b93e6237d22287d1c45329e4 | 154,438 | py | Python | controllers/gis.py | AlexanderLaughlin/eden | 8f7bc2dfd2fe221fc98b0b80d67f796d66a3673c | [
"MIT"
] | null | null | null | controllers/gis.py | AlexanderLaughlin/eden | 8f7bc2dfd2fe221fc98b0b80d67f796d66a3673c | [
"MIT"
] | null | null | null | controllers/gis.py | AlexanderLaughlin/eden | 8f7bc2dfd2fe221fc98b0b80d67f796d66a3673c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
GIS Controllers
"""
module = request.controller
resourcename = request.function
# Compact JSON encoding
SEPARATORS = (",", ":")
# -----------------------------------------------------------------------------
def index():
"""
Module's Home Page: Show the Main map
"""
... | 39.337239 | 326 | 0.469444 |
0e5096f812b3df638df1dc01b7ab7720053e7520 | 12,181 | py | Python | src/opendr/perception/speech_recognition/matchboxnet/matchboxnet_learner.py | daoran/opendr | bca25f6a43244fe9c219a24576181f94a0726923 | [
"Apache-2.0"
] | null | null | null | src/opendr/perception/speech_recognition/matchboxnet/matchboxnet_learner.py | daoran/opendr | bca25f6a43244fe9c219a24576181f94a0726923 | [
"Apache-2.0"
] | null | null | null | src/opendr/perception/speech_recognition/matchboxnet/matchboxnet_learner.py | daoran/opendr | bca25f6a43244fe9c219a24576181f94a0726923 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2022 OpenDR European Project
#
# 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 ... | 41.431973 | 119 | 0.606354 |
1527b6aa244d1be677acf774c41c9e0f38811a21 | 7,940 | py | Python | test/base.py | AltimateAI/pyconcrete | ae222327c729c382caa2d9d62b4ca2b6a866d440 | [
"Apache-2.0"
] | 515 | 2015-05-29T20:47:38.000Z | 2022-03-29T05:40:32.000Z | test/base.py | AltimateAI/pyconcrete | ae222327c729c382caa2d9d62b4ca2b6a866d440 | [
"Apache-2.0"
] | 81 | 2016-08-26T14:16:04.000Z | 2022-03-14T21:27:53.000Z | test/base.py | AltimateAI/pyconcrete | ae222327c729c382caa2d9d62b4ca2b6a866d440 | [
"Apache-2.0"
] | 120 | 2015-12-25T11:07:00.000Z | 2022-02-16T07:17:19.000Z | #!/usr/bin/env python
#
# Copyright 2015 Falldog Hsieh <falldog7@gmail.com>
#
# 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 requi... | 31.633466 | 183 | 0.632116 |
fcff96e218676de8bfc827608303146ead96e1e1 | 18,362 | py | Python | direct/src/distributed/DoCollectionManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | direct/src/distributed/DoCollectionManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | null | null | null | direct/src/distributed/DoCollectionManager.py | cmarshall108/panda3d-python3 | 8bea2c0c120b03ec1c9fd179701fdeb7510bb97b | [
"PHP-3.0",
"PHP-3.01"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | from direct.distributed import DoHierarchy
import re
#hack:
BAD_DO_ID = BAD_ZONE_ID = 0 # 0xFFFFFFFF
BAD_CHANNEL_ID = 0 # 0xFFFFFFFFFFFFFFFF
class DoCollectionManager:
def __init__(self):
# Dict of {DistributedObject ids: DistributedObjects}
self.doId2do = {}
# (parentId, zoneId) to dict o... | 37.859794 | 103 | 0.582181 |
61f59d1fa8b185656f25b8dda1c48d8353ccf158 | 3,353 | py | Python | observations/r/bomregions2011.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 199 | 2017-07-24T01:34:27.000Z | 2022-01-29T00:50:55.000Z | observations/r/bomregions2011.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 46 | 2017-09-05T19:27:20.000Z | 2019-01-07T09:47:26.000Z | observations/r/bomregions2011.py | hajime9652/observations | 2c8b1ac31025938cb17762e540f2f592e302d5de | [
"Apache-2.0"
] | 45 | 2017-07-26T00:10:44.000Z | 2022-03-16T20:44:59.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import csv
import numpy as np
import os
import sys
from observations.util import maybe_download_and_extract
def bomregions2011(path):
"""Australian and Related Historical Annual Cli... | 24.837037 | 77 | 0.716373 |
a4fd393346c6e34b534b092b1428869ec1638655 | 3,422 | py | Python | homeassistant/components/huawei_lte/switch.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/huawei_lte/switch.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 87 | 2020-07-15T13:43:35.000Z | 2022-03-23T07:43:10.000Z | homeassistant/components/huawei_lte/switch.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Support for Huawei LTE switches."""
from __future__ import annotations
import logging
from typing import Any
import attr
from homeassistant.components.switch import (
DEVICE_CLASS_SWITCH,
DOMAIN as SWITCH_DOMAIN,
SwitchEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.c... | 29 | 82 | 0.669784 |
0c0bc75625b3280353ecd6012d13c852cd1f560d | 1,082 | py | Python | crawler/ziwu/misc/middleware.py | Geodesigner/ziwuquan | c5fc2b7354821e0a45a8eff76523b163ed2d633d | [
"BSD-2-Clause"
] | null | null | null | crawler/ziwu/misc/middleware.py | Geodesigner/ziwuquan | c5fc2b7354821e0a45a8eff76523b163ed2d633d | [
"BSD-2-Clause"
] | null | null | null | crawler/ziwu/misc/middleware.py | Geodesigner/ziwuquan | c5fc2b7354821e0a45a8eff76523b163ed2d633d | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from scrapy import log
from proxy import PROXIES
from agents import AGENTS
import random
class CustomHttpProxyMiddleware(object):
def process_request(self, request, spider):
# TODO implement complex proxy providing algorithm
if self.use_proxy(request)... | 30.055556 | 71 | 0.595194 |
d3470ed9ad50618024a46f1c787d570bd870ba96 | 1,767 | py | Python | machine_learning_action/ch10/kMeans.py | daigouwei/TensorFlow | 3716b1cdf79f9203adfc2bc77eb3a367a153cc22 | [
"Apache-2.0"
] | null | null | null | machine_learning_action/ch10/kMeans.py | daigouwei/TensorFlow | 3716b1cdf79f9203adfc2bc77eb3a367a153cc22 | [
"Apache-2.0"
] | null | null | null | machine_learning_action/ch10/kMeans.py | daigouwei/TensorFlow | 3716b1cdf79f9203adfc2bc77eb3a367a153cc22 | [
"Apache-2.0"
] | null | null | null | import numpy as np
def loadDataSet(fileName):
dataMat = []
fr = open(fileName)
for line in fr.readlines():
curLine = line.strip().split('\t')
fltLine = list(map(float, curLine))
dataMat.append(fltLine)
return dataMat
def distEclud(vecA, vecB):
return np.sqrt(np.sum(np.pow... | 30.465517 | 77 | 0.572722 |
635401bb5c78b39c4e900b9b8c3ca48ce5936ec2 | 1,763 | py | Python | tests/test_parse/test_tinyseq.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | tests/test_parse/test_tinyseq.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | tests/test_parse/test_tinyseq.py | rahulghangas/cogent3 | f00cf822efce5f3141b3c7dafac81cb94a311e22 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import xml.dom.minidom
from io import StringIO
from unittest import TestCase, main
from cogent3.parse.tinyseq import TinyseqParser
__author__ = "Matthew Wakefield"
__copyright__ = "Copyright 2007-2019, The Cogent Project"
__credits__ = ["Matthew Wakefield"]
__license__ = "BSD-3"
__version__ = ... | 30.929825 | 132 | 0.735678 |
ecca84768a5ccb5727594fc555597e86987f228f | 4,073 | py | Python | main.py | Karsonic/PTU-Helper | 6ba4404d4ca186fbbf09861baa647257e65c99d1 | [
"MIT"
] | null | null | null | main.py | Karsonic/PTU-Helper | 6ba4404d4ca186fbbf09861baa647257e65c99d1 | [
"MIT"
] | null | null | null | main.py | Karsonic/PTU-Helper | 6ba4404d4ca186fbbf09861baa647257e65c99d1 | [
"MIT"
] | null | null | null | import json
from level import Level
from location import Location
from pokemon import Pokemon
from typing import Any, Callable, List
pk_json_file = 'data/pokemon.json'
def _confirm(msg: str) -> bool:
print(msg)
confirm = input('Is this correct? [y/yes]').lower()
return confirm in ['y', 'yes', '']
def _... | 27.52027 | 81 | 0.62411 |
5783cc7daf9b7c058f74286f4e9daa59769c13c5 | 7,335 | py | Python | people_counter.py | huutrinh68/multi-object-tracking | d7856ed8650b453a233e5788a5bedfffef6d7e09 | [
"MIT"
] | null | null | null | people_counter.py | huutrinh68/multi-object-tracking | d7856ed8650b453a233e5788a5bedfffef6d7e09 | [
"MIT"
] | null | null | null | people_counter.py | huutrinh68/multi-object-tracking | d7856ed8650b453a233e5788a5bedfffef6d7e09 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from collections import defaultdict, deque
import cv2
import os
from datetime import datetime, timedelta
from motrackers import CentroidTracker
from motrackers.utils import draw_tracks
H = 0
W = 0
def yxyx2xywh(yxyx):
if len(yxyx.shape) == 2:
w, h = yxyx[:, 3] ... | 33.801843 | 137 | 0.587185 |
24aac079e3f34916c3bd3419205e7836ef259efa | 21,527 | py | Python | nemo/collections/nlp/parts/nlp_overrides.py | tbartley94/NeMo | e0b999ab331eae401d3df8d6eb5c47b159bd8abe | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/parts/nlp_overrides.py | tbartley94/NeMo | e0b999ab331eae401d3df8d6eb5c47b159bd8abe | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/parts/nlp_overrides.py | tbartley94/NeMo | e0b999ab331eae401d3df8d6eb5c47b159bd8abe | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. 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... | 43.40121 | 140 | 0.644772 |
6b37fa76d364d36bb755801291b469b16af60c6d | 2,866 | py | Python | doc/conf.py | kaushikcfd/pyrometheus | 49afb3ddb98e9115c366e6df6dffbb31cac04652 | [
"MIT"
] | 1 | 2021-01-15T18:18:44.000Z | 2021-01-15T18:18:44.000Z | doc/conf.py | kaushikcfd/pyrometheus | 49afb3ddb98e9115c366e6df6dffbb31cac04652 | [
"MIT"
] | 26 | 2020-12-17T21:50:28.000Z | 2021-11-09T17:59:25.000Z | doc/conf.py | kaushikcfd/pyrometheus | 49afb3ddb98e9115c366e6df6dffbb31cac04652 | [
"MIT"
] | 4 | 2021-02-11T19:51:37.000Z | 2021-09-29T14:25:51.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.942529 | 81 | 0.652826 |
53653bcef88a78f4248cc454931543193d88e065 | 223 | py | Python | mmdet/models/necks/__init__.py | i-pan/mmdetection | 1b299b5a7f677c531bbc63b3ecbf9820762fe119 | [
"Apache-2.0"
] | 1 | 2020-05-04T07:01:39.000Z | 2020-05-04T07:01:39.000Z | mmdet/models/necks/__init__.py | i-pan/mmdetection | 1b299b5a7f677c531bbc63b3ecbf9820762fe119 | [
"Apache-2.0"
] | null | null | null | mmdet/models/necks/__init__.py | i-pan/mmdetection | 1b299b5a7f677c531bbc63b3ecbf9820762fe119 | [
"Apache-2.0"
] | null | null | null | from .bfp import BFP
from .fpn import FPN
from .fpn_carafe import FPN_CARAFE
from .hrfpn import HRFPN
from .bifpn import BiFPN
from .nas_fpn import NASFPN
__all__ = ['FPN', 'BFP', 'BiFPN', 'HRFPN', 'NASFPN', 'FPN_CARAFE']
| 24.777778 | 66 | 0.735426 |
76a29ac9285eb2da71705f4ee4fcc6442f389eb6 | 11,154 | py | Python | kubernetes/client/models/v1beta1_csi_driver_spec.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1beta1_csi_driver_spec.py | palnabarun/Python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"Apache-2.0"
] | 7 | 2020-11-07T10:35:21.000Z | 2022-02-07T03:06:25.000Z | kubernetes/client/models/v1beta1_csi_driver_spec.py | palnabarun/python | 6b01c95e1673c0787d3d688b361bfd995d62dd98 | [
"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
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 62.312849 | 1,430 | 0.713197 |
c1b7cc1c04e1687f51310da144c3ba058876a5db | 5,308 | py | Python | onnxruntime/python/tools/quantization/operators/conv.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | 1 | 2020-10-21T11:54:26.000Z | 2020-10-21T11:54:26.000Z | onnxruntime/python/tools/quantization/operators/conv.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | null | null | null | onnxruntime/python/tools/quantization/operators/conv.py | surepassio/onnxruntime | 8d134edf8d67fd8dadb8039b2bd53ae839920a0c | [
"MIT"
] | 1 | 2020-09-11T02:23:48.000Z | 2020-09-11T02:23:48.000Z | import onnx
from .base_operator import QuantOperatorBase
from ..quant_utils import _find_by_name, _get_mul_node, QuantizedValue, QuantizedValueType, _attribute_to_kwarg
from onnx import onnx_pb as onnx_proto
class ConInteger(QuantOperatorBase):
def __init__(self, onnx_quantizer, onnx_node):
super().__init... | 42.464 | 112 | 0.645818 |
3ab09edf8c53d31c55949f18c794cb67f6bfcf8f | 3,693 | py | Python | steam/base/msg/headers.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | 5 | 2018-11-16T08:59:41.000Z | 2021-04-03T05:32:18.000Z | steam/base/msg/headers.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | null | null | null | steam/base/msg/headers.py | ivicel/steamkit-python | 0a3f250e432cf890965db5e7245841aa512bca22 | [
"Apache-2.0"
] | null | null | null | import abc
import struct
from .emsg import EMsg
from steam.utils.util import add_proto_mask
from steam.protobufs.steammessages_base_pb2 import CMsgProtoBufHeader
class BaseMsgHdr(abc.ABC):
emsg = EMsg.Invalid
def __init__(self, emsg, data=None):
self.emsg = emsg
if data is not None:
... | 29.782258 | 93 | 0.595451 |
a08cc5e45c3b9551e692653fbc938fb2b9925729 | 9,166 | py | Python | PC/VS8.0/build_ssl.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | PC/VS8.0/build_ssl.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | PC/VS8.0/build_ssl.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | # Script for building the _ssl and _hashlib modules for Windows.
# Uses Perl to setup the OpenSSL environment correctly
# and build OpenSSL, then invokes a simple nmake session
# for the actual _ssl.pyd and _hashlib.pyd DLLs.
# THEORETICALLY, you can:
# * Unpack the latest SSL release one level above your main Python ... | 36.517928 | 84 | 0.580406 |
cdf529a3196e8ee04988efb0fae7b4fcc605c318 | 1,170 | py | Python | new_post.py | asuith/asuith.github.io | 3770e57b0d0bb7026eac8ad53c1bd9902e6946c3 | [
"MIT"
] | null | null | null | new_post.py | asuith/asuith.github.io | 3770e57b0d0bb7026eac8ad53c1bd9902e6946c3 | [
"MIT"
] | null | null | null | new_post.py | asuith/asuith.github.io | 3770e57b0d0bb7026eac8ad53c1bd9902e6946c3 | [
"MIT"
] | null | null | null | # author: suith
# require: python3
# usage:
# python new_post.py "this is post title"
import sys
from time import localtime
import shutil
post_template = """
---
layout: article
date: "{date} {time} +0800"
title: ""
description: ""
keywords: ""
categories: cs, life
key: {title}
---
> {{ page.description }}
<... | 22.075472 | 74 | 0.612821 |
41a3f1d49adbb33ebbc90c99b918771fb37bd7b3 | 8,404 | py | Python | test-framework/test-suites/integration/tests/enable/test_enable_discovery.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | 123 | 2015-05-12T23:36:45.000Z | 2017-07-05T23:26:57.000Z | test-framework/test-suites/integration/tests/enable/test_enable_discovery.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | 177 | 2015-06-05T19:17:47.000Z | 2017-07-07T17:57:24.000Z | test-framework/test-suites/integration/tests/enable/test_enable_discovery.py | knutsonchris/stacki | 33087dd5fa311984a66ccecfeee6f9c2c25f665d | [
"BSD-3-Clause"
] | 32 | 2015-06-07T02:25:03.000Z | 2017-06-23T07:35:35.000Z | import json
import os
import time
import pytest
from stack.mq import ports, Message
import zmq
class DiscoveryListener:
def __init__(self):
# Set up ZMQ to listen to the 'discovery' channel
context = zmq.Context()
self._socket = context.socket(zmq.SUB)
self._socket.connect(f"tcp://localhost:{ports.subscrib... | 29.079585 | 63 | 0.678724 |
be7756377933731385d0cdb8a496694769719571 | 384 | py | Python | tests/exact_tests/point_tests/test__new__.py | lycantropos/rene | c73c616f3e360b994e92c950a3616a8ccb1136b9 | [
"MIT"
] | null | null | null | tests/exact_tests/point_tests/test__new__.py | lycantropos/rene | c73c616f3e360b994e92c950a3616a8ccb1136b9 | [
"MIT"
] | null | null | null | tests/exact_tests/point_tests/test__new__.py | lycantropos/rene | c73c616f3e360b994e92c950a3616a8ccb1136b9 | [
"MIT"
] | null | null | null | from hypothesis import given
from rithm import Fraction
from rene.exact import Point
from tests.hints import Scalar
from . import strategies
@given(strategies.scalars, strategies.scalars)
def test_basic(x: Scalar, y: Scalar) -> None:
result = Point(x, y)
assert isinstance(result, Point)
assert isinstanc... | 24 | 46 | 0.755208 |
1e4b72d5ad3f1396fcb75856656386f434047ec6 | 79,853 | py | Python | Huawei-TCX-Converter.py | robertoioi/Huawei-TCX-Converter | 062ba5545e52a906e4c2b9323c0a6b4eabd1bc11 | [
"MIT"
] | 131 | 2019-03-08T17:58:59.000Z | 2021-11-07T19:12:06.000Z | Huawei-TCX-Converter.py | robertoioi/Huawei-TCX-Converter | 062ba5545e52a906e4c2b9323c0a6b4eabd1bc11 | [
"MIT"
] | 53 | 2019-03-15T21:59:59.000Z | 2020-07-09T15:02:20.000Z | Huawei-TCX-Converter.py | robertoioi/Huawei-TCX-Converter | 062ba5545e52a906e4c2b9323c0a6b4eabd1bc11 | [
"MIT"
] | 31 | 2019-03-12T09:21:04.000Z | 2021-09-30T10:47:39.000Z | # Huawei-TCX-Converter.py
# Copyright (c) 2019 Ari Cooper-Davis / Christoph Vanthuyne - github.com/aricooperdavis/Huawei-TCX-Converter
import argparse
import collections
import csv
import datetime
import json
import logging
import math
import operator
import os
import re
import sys
import tarfile
import tempfile
# li... | 51.024281 | 331 | 0.600103 |
616fb19d19bb22eca7003841b043704df866c0a2 | 2,948 | py | Python | screens/ending/score.py | MinJunsu/space-invader | 68b3e89200a77f4bd68f1454e07ab1d451456f1f | [
"MIT"
] | null | null | null | screens/ending/score.py | MinJunsu/space-invader | 68b3e89200a77f4bd68f1454e07ab1d451456f1f | [
"MIT"
] | 8 | 2021-09-17T06:41:07.000Z | 2021-12-07T08:14:54.000Z | screens/ending/score.py | MinJunsu/space-invader | 68b3e89200a77f4bd68f1454e07ab1d451456f1f | [
"MIT"
] | 6 | 2021-09-17T08:10:59.000Z | 2021-12-08T14:58:01.000Z | from pygame.constants import KEYDOWN, K_q, K_SPACE, K_UP, K_DOWN, K_LEFT, K_RIGHT
from pygame.key import get_pressed
from screens import Screen, PAUSE_CONTEXT
from utils.file import File
class ScoreScreen(Screen):
CONTEXT = PAUSE_CONTEXT
CHOICE_COLOR = (249, 166, 2)
UN_CHOICE_COLOR = (255, 255, 255)
... | 36.395062 | 102 | 0.539688 |
4cefd4cc9c8fd8b7452e8b84bf974f902b5d86dc | 20,684 | py | Python | wiiboard-scale3.py | frostymccool/piscales | 83ad451cfc607eecd9a90fda2f95ef8587e6021d | [
"MIT"
] | null | null | null | wiiboard-scale3.py | frostymccool/piscales | 83ad451cfc607eecd9a90fda2f95ef8587e6021d | [
"MIT"
] | null | null | null | wiiboard-scale3.py | frostymccool/piscales | 83ad451cfc607eecd9a90fda2f95ef8587e6021d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# frostymccool - April 2018
# https://github.com/frostymccool/piscales
# Press the redbutton on the wii, what on screen instructions for when calibaration has been performed and get weighed :)
# runs in a constant loop so that the wiiboard red button is the only thing that is needed to be pressed... | 36.738899 | 129 | 0.568265 |
92f2f4710d1724ab389a729d1ff00b1b9fa2d5e0 | 31,014 | py | Python | theano/tensor/var.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/var.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/var.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | import copy
import traceback as tb
import warnings
import numpy
from six.moves import xrange
import theano
from theano.compat import PY3
from theano.scalar import ComplexError, IntegerDivisionError
from theano.gof import Constant, Variable
from theano.gof.utils import hashtype
from theano.tensor.utils import hash_fro... | 34.769058 | 80 | 0.586348 |
21acf908b8febf4c60dbd34c027da8c963c748ec | 8,885 | py | Python | plugins/modules/oci_bds_api_key_facts.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 108 | 2020-05-19T20:46:10.000Z | 2022-03-25T14:10:01.000Z | plugins/modules/oci_bds_api_key_facts.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 90 | 2020-06-14T22:07:11.000Z | 2022-03-07T05:40:29.000Z | plugins/modules/oci_bds_api_key_facts.py | slmjy/oci-ansible-collection | 349c91e2868bf4706a6e3d6fb3b47fc622bfe11b | [
"Apache-2.0"
] | 42 | 2020-08-30T23:09:12.000Z | 2022-03-25T16:58:01.000Z | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 31.507092 | 150 | 0.618796 |
40e1b0cff0729b2c949c9607fc15ae428f26254a | 4,192 | py | Python | subversion/bindings/swig/python/tests/fs.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | 1 | 2020-12-19T23:01:45.000Z | 2020-12-19T23:01:45.000Z | subversion/bindings/swig/python/tests/fs.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | 2 | 2020-12-19T22:02:34.000Z | 2020-12-19T22:10:58.000Z | subversion/bindings/swig/python/tests/fs.py | timgates42/subversion | 0f088f530747140c6783c2eeb77ceff8e8613c42 | [
"Apache-2.0"
] | null | null | null | #
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the... | 32 | 91 | 0.68249 |
5e2c7c83920b0636daab02caadda463c362f6616 | 6,544 | py | Python | python-cognito-alb-fargate/cognito_fargate_demo/cognito_fargate_demo_stack.py | ppbdrinker/cdk-templates | cce8fd50c412d66e27bc371933f8b7c49522021f | [
"Apache-2.0"
] | 117 | 2019-07-11T20:13:40.000Z | 2022-03-26T03:12:04.000Z | python-cognito-alb-fargate/cognito_fargate_demo/cognito_fargate_demo_stack.py | cruzantony/cdk-templates | 4d1db7eb31336403c2ecd940c9b89ef34b7b42fc | [
"Apache-2.0"
] | 58 | 2020-02-07T15:46:18.000Z | 2021-09-01T13:43:58.000Z | python-cognito-alb-fargate/cognito_fargate_demo/cognito_fargate_demo_stack.py | cruzantony/cdk-templates | 4d1db7eb31336403c2ecd940c9b89ef34b7b42fc | [
"Apache-2.0"
] | 25 | 2019-09-09T08:01:25.000Z | 2022-02-10T22:17:48.000Z | import os
import urllib.parse
from aws_cdk import core
import aws_cdk.aws_certificatemanager as certificatemanager
import aws_cdk.aws_cognito as cognito
import aws_cdk.aws_ec2 as ec2
import aws_cdk.aws_ecs as ecs
import aws_cdk.aws_ecs_patterns as ecs_patterns
import aws_cdk.aws_ecr_assets as ecr_assets
import aws_cd... | 34.808511 | 112 | 0.584046 |
582a50c6e062973c1db22422e3ebf95456d32bb4 | 2,429 | py | Python | Dataset/datamodule.py | younesbelkada/altegrad_challenge | 90939d3a6ae7c6c80f121679d1c2499014f96a43 | [
"Apache-2.0"
] | 1 | 2022-02-24T09:00:31.000Z | 2022-02-24T09:00:31.000Z | Dataset/datamodule.py | younesbelkada/altegrad_challenge | 90939d3a6ae7c6c80f121679d1c2499014f96a43 | [
"Apache-2.0"
] | null | null | null | Dataset/datamodule.py | younesbelkada/altegrad_challenge | 90939d3a6ae7c6c80f121679d1c2499014f96a43 | [
"Apache-2.0"
] | null | null | null | from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader, random_split
from Dataset import dataset
from Dataset import SentenceEmbeddings
class BaseDataModule(LightningDataModule):
def __init__(self, dataset_param):
super().__init__()
if "SentenceEmbeddings" in da... | 31.960526 | 70 | 0.613421 |
314402074a1b07aca64264671b69b857bc8dbc59 | 18,575 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/storage/netapp/na_ontap_broadcast_domain.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
# (c) 2018-2019, NetApp, Inc
# 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'],
... | 42.505721 | 128 | 0.627133 |
be9d9425491777b22fb790e273290ec01a1f1da9 | 1,880 | py | Python | userbot/plugins/Lucky.py | NubDexter/DexGram | 80b999442f87105b6a151616c0bec1cb03774006 | [
"MIT"
] | 2 | 2020-05-18T07:23:30.000Z | 2020-06-21T07:27:50.000Z | userbot/plugins/Lucky.py | xditya/DexGram | 80b999442f87105b6a151616c0bec1cb03774006 | [
"MIT"
] | null | null | null | userbot/plugins/Lucky.py | xditya/DexGram | 80b999442f87105b6a151616c0bec1cb03774006 | [
"MIT"
] | 2 | 2020-05-17T13:15:01.000Z | 2020-07-10T09:05:17.000Z | # plugin by lejend @r4r4n4
"""Emoji
Available Commands:
.lucky"""
from telethon import events
import asyncio
@borg.on(events.NewMessage(pattern=r"\.(.*)", outgoing=True))
async def _(event):
if event.fwd_from:
return
animation_interval = 0.5
animation_ttl = range(0, 17)
input_str ... | 30.819672 | 93 | 0.437766 |
4a2cdaa2f9dd82e0f071a84adfc2a12fa4b5cebc | 1,723 | py | Python | icedata/datasets/pets/parser.py | yrodriguezmd/icedata | ef97358fa5b01ce9b707310571262e6f26ff0694 | [
"Apache-2.0"
] | null | null | null | icedata/datasets/pets/parser.py | yrodriguezmd/icedata | ef97358fa5b01ce9b707310571262e6f26ff0694 | [
"Apache-2.0"
] | 1 | 2021-09-04T19:05:40.000Z | 2021-09-04T19:05:40.000Z | icedata/datasets/pets/parser.py | yrodriguezmd/icedata | ef97358fa5b01ce9b707310571262e6f26ff0694 | [
"Apache-2.0"
] | null | null | null | __all__ = ["parser", "PetsBBoxParser", "PetsMaskParser", "PetsMaskFile"]
from icevision.imports import *
from icevision.core import *
from icevision import parsers
from .data import *
def parser(data_dir: Path, mask=False):
annotations_dir = data_dir / "annotations/xmls"
images_dir = data_dir / "images"
... | 28.245902 | 83 | 0.644225 |
9c64b3b8d3169a22456381c5a450f4396eeb6b0b | 5,473 | py | Python | forch/http_server.py | henry54809/forch | 100b00d2ecf7aed8c204d8d06419f8add599af95 | [
"Apache-2.0"
] | null | null | null | forch/http_server.py | henry54809/forch | 100b00d2ecf7aed8c204d8d06419f8add599af95 | [
"Apache-2.0"
] | null | null | null | forch/http_server.py | henry54809/forch | 100b00d2ecf7aed8c204d8d06419f8add599af95 | [
"Apache-2.0"
] | null | null | null | """HTTP socket server interface"""
import functools
import http.server
import json
import os
import socketserver
import threading
import urllib
from google.protobuf.message import Message
from forch.utils import get_logger, proto_json
class HttpException(Exception):
"""Http exception base class"""
def __in... | 35.771242 | 98 | 0.621232 |
83ded7ca6e51b28e73525cb9049a0aad65ce57d5 | 2,605 | py | Python | thriftrw/wire/__init__.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 40 | 2016-02-18T18:01:23.000Z | 2022-03-31T10:34:33.000Z | thriftrw/wire/__init__.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 56 | 2016-02-10T16:51:07.000Z | 2020-02-07T05:28:49.000Z | thriftrw/wire/__init__.py | recht/thriftrw-python | aad5ee4e9ca21fe59c9bea479465615ef3825dec | [
"MIT"
] | 12 | 2016-03-29T17:29:28.000Z | 2021-10-30T14:36:39.000Z | # Copyright (c) 2016 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | 22.264957 | 79 | 0.70595 |
c008f6f495bb88b60e1f97efbae07c69a756ab8b | 2,224 | py | Python | task/statistics.py | tickbh/luojiawaf_server | 814793ff7989141caf38c3dedee95b4ecfacf8cc | [
"MulanPSL-1.0"
] | 2 | 2022-03-14T12:07:53.000Z | 2022-03-17T02:28:24.000Z | task/statistics.py | tickbh/luojiawaf_server | 814793ff7989141caf38c3dedee95b4ecfacf8cc | [
"MulanPSL-1.0"
] | null | null | null | task/statistics.py | tickbh/luojiawaf_server | 814793ff7989141caf38c3dedee95b4ecfacf8cc | [
"MulanPSL-1.0"
] | 1 | 2022-03-29T09:33:16.000Z | 2022-03-29T09:33:16.000Z | import redis
import math
import time
import json
import re
from common import config_utils, pool_utils, base_utils, cache_utils, waf_utils
from task.accessurl import AccessUrl, calc_not_wait_count
def statistics_request_msg(user_id):
base_client = pool_utils.get_redis_cache()
for client in pool_utils.iter_red... | 40.436364 | 105 | 0.616007 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.