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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
eefa2d530adebabe10a337d7cdc3e28bc2a8ca7c | 12,839 | py | Python | EMD_data_training_server.py | NahianHasan/Cardiovascular_Disease_Classification_Employing_EMD | 57bf6425808bcff4f1c54e6be2e1df9c14b61313 | [
"MIT"
] | 6 | 2019-10-10T18:53:13.000Z | 2020-08-13T08:39:43.000Z | EMD_data_training_server.py | NahianHasan/Cardiovascular_Disease_Classification_Employing_EMD | 57bf6425808bcff4f1c54e6be2e1df9c14b61313 | [
"MIT"
] | null | null | null | EMD_data_training_server.py | NahianHasan/Cardiovascular_Disease_Classification_Employing_EMD | 57bf6425808bcff4f1c54e6be2e1df9c14b61313 | [
"MIT"
] | 1 | 2020-04-22T07:50:49.000Z | 2020-04-22T07:50:49.000Z | #import other files
import EMD_data_prepare as E
import EMD_Models
import config
import Folder_creation as FC
import Training_Analysis as TRA
import Confusion_Matrix as CM
#import other libraries
import wfdb
import os
import sys
import threading
import time
import glob
import argparse
import numpy as np
import GPUtil
i... | 39.749226 | 154 | 0.727315 |
86c4312123d39252c56cb7c7e6b50403a0fb1319 | 3,972 | py | Python | lib/py/src/server/TProcessPoolServer.py | yelirekim/thrift | 2fd8a15fc4e458aee13dd3be7fcba96bb5019c38 | [
"Apache-2.0"
] | 11 | 2016-09-28T09:13:21.000Z | 2021-08-23T07:28:41.000Z | lib/py/src/server/TProcessPoolServer.py | yelirekim/thrift | 2fd8a15fc4e458aee13dd3be7fcba96bb5019c38 | [
"Apache-2.0"
] | 1 | 2018-07-09T01:38:43.000Z | 2018-07-11T20:15:45.000Z | lib/py/src/server/TProcessPoolServer.py | yelirekim/thrift | 2fd8a15fc4e458aee13dd3be7fcba96bb5019c38 | [
"Apache-2.0"
] | 15 | 2015-01-09T04:56:04.000Z | 2021-04-13T12:33:05.000Z | #
# 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
# "License"); you may not u... | 33.378151 | 79 | 0.63721 |
2472f20546d5ae69481bea036f52c9d87428afa4 | 146 | py | Python | starter-stack/player1.py | InsperDynamics/Soccer-Simulation-2D | a548d576ca4ab2a8f797810f5e23875c45cef73f | [
"Apache-2.0"
] | null | null | null | starter-stack/player1.py | InsperDynamics/Soccer-Simulation-2D | a548d576ca4ab2a8f797810f5e23875c45cef73f | [
"Apache-2.0"
] | null | null | null | starter-stack/player1.py | InsperDynamics/Soccer-Simulation-2D | a548d576ca4ab2a8f797810f5e23875c45cef73f | [
"Apache-2.0"
] | null | null | null | import os
def player1():
os.chdir('Agent1/src')
os.system('./start.sh -t teamnacme') #Aqui você pode trocar o nome do time
player1()
| 14.6 | 78 | 0.650685 |
2d09b2e7c8596327b2f83c4cd4c4a0d7a71ecc25 | 746 | py | Python | setup.py | a12k/credstash | 83b30071398bf3c768096fc8d4384934c33e955a | [
"Apache-2.0"
] | null | null | null | setup.py | a12k/credstash | 83b30071398bf3c768096fc8d4384934c33e955a | [
"Apache-2.0"
] | null | null | null | setup.py | a12k/credstash | 83b30071398bf3c768096fc8d4384934c33e955a | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(
name='credstash',
version='1.14.0',
description='A utility for managing secrets in the cloud using AWS KMS and DynamoDB',
license='Apache2',
url='https://github.com/LuminalOSS/credstash',
classifiers=[
'Intended Audience :: Developers',
'Inten... | 25.724138 | 89 | 0.587131 |
34ec955e7e297540287fd0fc0d5d560841075bb7 | 1,708 | py | Python | app/core/migrations/0001_initial.py | kaminski-pawel/dj-recipe-api | 5cb180e6ac8e4189d2c9f6e53661e9d468e59ee2 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | kaminski-pawel/dj-recipe-api | 5cb180e6ac8e4189d2c9f6e53661e9d468e59ee2 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | kaminski-pawel/dj-recipe-api | 5cb180e6ac8e4189d2c9f6e53661e9d468e59ee2 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.8 on 2019-04-02 23:02
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.235294 | 266 | 0.638759 |
53f7a1a84481c155005699d3fe95284d3a4fdb55 | 3,423 | py | Python | src/m6_loops_within_loops_printing.py | robertcarl/20-Exam3Practice | e63a9e9bbae81f599d3beea20ae9002a203d7cef | [
"MIT"
] | null | null | null | src/m6_loops_within_loops_printing.py | robertcarl/20-Exam3Practice | e63a9e9bbae81f599d3beea20ae9002a203d7cef | [
"MIT"
] | null | null | null | src/m6_loops_within_loops_printing.py | robertcarl/20-Exam3Practice | e63a9e9bbae81f599d3beea20ae9002a203d7cef | [
"MIT"
] | null | null | null | """
PRACTICE Exam 3.
This problem provides practice at:
*** LOOPS WITHIN LOOPS in PRINTING-TO-CONSOLE problems. ***
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Mark Hays, Amanda Stouder, Aaron Wilkin, their colleagues,
and Drew Roberts.
""" # DONE: 1. PUT YOUR NAME IN THE... | 31.694444 | 79 | 0.434122 |
0114cc564b7d8ff0c99aa1f9c244d023b4e99874 | 1,649 | py | Python | data/interpretability/info_error_warning/classes/data_loader.py | QuLog1/QuLog | 121f3a8c6f5ee60cde771c36b9eef823a1b2597a | [
"Apache-2.0"
] | null | null | null | data/interpretability/info_error_warning/classes/data_loader.py | QuLog1/QuLog | 121f3a8c6f5ee60cde771c36b9eef823a1b2597a | [
"Apache-2.0"
] | null | null | null | data/interpretability/info_error_warning/classes/data_loader.py | QuLog1/QuLog | 121f3a8c6f5ee60cde771c36b9eef823a1b2597a | [
"Apache-2.0"
] | null | null | null | from keras.preprocessing.sequence import pad_sequences
from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler
import torch
import numpy as np
TORCH_INT_TYPE = torch.int16
NP_INT_TYPE = np.int16
def create_data_loaders(load_train, labels_train, load_test, labels_test, pad_len, batch_... | 39.261905 | 95 | 0.763493 |
07defab8c663a19881eee9ce12b4cfbc1b04e281 | 2,606 | py | Python | pagina_01/views.py | JeanContreras12/ColungaRepo | af59e07f31b3d56ebdf02431a2967134985c1624 | [
"MIT"
] | 1 | 2021-06-02T02:04:14.000Z | 2021-06-02T02:04:14.000Z | pagina_01/views.py | JeanContreras12/ColungaRepo | af59e07f31b3d56ebdf02431a2967134985c1624 | [
"MIT"
] | 1 | 2021-06-03T03:03:59.000Z | 2021-06-03T03:03:59.000Z | pagina_01/views.py | JeanContreras12/ColungaRepo | af59e07f31b3d56ebdf02431a2967134985c1624 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.contrib.auth.forms import UserCreationForm, UserChangeForm
from django.contrib.auth.models import User
from .forms import CustomUserForm
from django.contrib.auth import login, authenticate
from django.contrib.auth.models import Group
from django.contrib import m... | 35.216216 | 70 | 0.748657 |
b7d407504dc059490d6ebadacc0cdbb06c36d5d6 | 3,358 | py | Python | opensanctions/crawlers/ua_sfms_blacklist.py | fastbone/opensanctions | dea7f7d073083eece26241bcade697a2b959a09e | [
"MIT"
] | null | null | null | opensanctions/crawlers/ua_sfms_blacklist.py | fastbone/opensanctions | dea7f7d073083eece26241bcade697a2b959a09e | [
"MIT"
] | null | null | null | opensanctions/crawlers/ua_sfms_blacklist.py | fastbone/opensanctions | dea7f7d073083eece26241bcade697a2b959a09e | [
"MIT"
] | null | null | null | from datetime import datetime
from prefixdate import parse_formats
from opensanctions.helpers import make_sanction
from opensanctions.util import jointext, remove_bracketed, multi_split
FORMATS = ["%d %b %Y", "%d %B %Y", "%Y", "%b %Y", "%B %Y"]
def parse_date(date):
if date is None:
return
date = da... | 36.107527 | 71 | 0.625074 |
735491b1f2d86b699cb7ebabca000acf732b7597 | 7,585 | py | Python | clmr/models/preliminary_models/NoPadConnectNetNoAVGAlter.py | Marcel-Velez/CLMR | 730bd9078756650a53b4c6438b29e5aeb2c15134 | [
"Apache-2.0"
] | null | null | null | clmr/models/preliminary_models/NoPadConnectNetNoAVGAlter.py | Marcel-Velez/CLMR | 730bd9078756650a53b4c6438b29e5aeb2c15134 | [
"Apache-2.0"
] | null | null | null | clmr/models/preliminary_models/NoPadConnectNetNoAVGAlter.py | Marcel-Velez/CLMR | 730bd9078756650a53b4c6438b29e5aeb2c15134 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
import sys
from torch.autograd import Variable
import math
import torch.nn.functional as F
from torchsummary import summary
POOLSIZE = 2
DROPOUT_RATE = .25
def init_weights(m):
if isinstance(m, nn.Linear):
torch.nn.ini... | 38.502538 | 169 | 0.633092 |
8c2d1d028cc121951fa31ef2b4b91c6a5febefeb | 546 | py | Python | nemoobot/bot/tests/test_utils.py | samuelfirst/nemoobot | b74ad66d4f2052eaba14e4b79e20c3da274b5909 | [
"MIT"
] | 1 | 2021-01-30T09:19:37.000Z | 2021-01-30T09:19:37.000Z | nemoobot/bot/tests/test_utils.py | samuelfirst/nemoobot | b74ad66d4f2052eaba14e4b79e20c3da274b5909 | [
"MIT"
] | 2 | 2020-12-21T20:57:19.000Z | 2021-01-26T08:08:09.000Z | nemoobot/bot/tests/test_utils.py | samuelfirst/nemoobot | b74ad66d4f2052eaba14e4b79e20c3da274b5909 | [
"MIT"
] | 1 | 2020-12-22T07:42:42.000Z | 2020-12-22T07:42:42.000Z | import pytest
import requests
from unittest.mock import MagicMock
from mock import patch
from pytest_mock import mocker
from bot.utils import load_user_settings
@pytest.fixture
def setup_mock_get_method(mocker):
mocker.patch('requests.get')
yield requests.get
def test_load_user_settings_returns_list_if_any... | 24.818182 | 77 | 0.809524 |
35dc2fff7614e8a79d3182a7758453b15222baff | 4,218 | py | Python | faq/views.py | howiworkdaily/django-faq | fc680d6be1deaa035e4bb2e752bb57db3eb0e096 | [
"BSD-3-Clause"
] | 46 | 2015-02-01T22:33:00.000Z | 2022-02-27T05:25:11.000Z | faq/views.py | jhensley/django-faq | fc680d6be1deaa035e4bb2e752bb57db3eb0e096 | [
"BSD-3-Clause"
] | 2 | 2015-02-28T11:28:33.000Z | 2015-03-15T21:03:37.000Z | faq/views.py | jhensley/django-faq | fc680d6be1deaa035e4bb2e752bb57db3eb0e096 | [
"BSD-3-Clause"
] | 23 | 2015-03-12T15:06:27.000Z | 2021-09-30T03:19:15.000Z | from __future__ import absolute_import
from django.db.models import Max
from django.core.urlresolvers import reverse, NoReverseMatch
from django.contrib import messages
from django.http import Http404
from django.shortcuts import redirect, render, get_object_or_404
from django.utils.translation import ugettext as _
fro... | 39.055556 | 95 | 0.667378 |
5eba0a9d05553d93abb656d3a94ea1895fee25fd | 1,216 | py | Python | recipe/hunspell_test.py | regro-cf-autotick-bot/hunspell-en-feedstock | d218096f540dd1e3edb6f2abf0d4f12e8e351b0b | [
"BSD-3-Clause"
] | null | null | null | recipe/hunspell_test.py | regro-cf-autotick-bot/hunspell-en-feedstock | d218096f540dd1e3edb6f2abf0d4f12e8e351b0b | [
"BSD-3-Clause"
] | 6 | 2020-06-16T02:34:33.000Z | 2021-11-08T03:59:07.000Z | recipe/hunspell_test.py | regro-cf-autotick-bot/hunspell-en-feedstock | d218096f540dd1e3edb6f2abf0d4f12e8e351b0b | [
"BSD-3-Clause"
] | 2 | 2020-06-16T00:50:15.000Z | 2020-10-08T15:04:33.000Z | import os, sys, shutil, subprocess
from pathlib import Path
OUT = Path(os.environ["PREFIX"]) / "share" / "hunspell_dictionaries"
PKG = os.environ["PKG_NAME"]
L10N = PKG.split("-")[-1].upper()
HUNSPELL_ARGS = ["hunspell", "-G"]
L10N_SEPARATOR = {
"AU": "_",
"CA": "_",
"GB": "-",
"US": "_",
"ZA": "... | 29.658537 | 80 | 0.628289 |
032899978098fbac5c807398811b4d2a03d71362 | 2,031 | py | Python | object_detection/core/box_coder_test.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 14 | 2018-06-26T09:40:19.000Z | 2022-01-24T00:12:07.000Z | object_detection/core/box_coder_test.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 2 | 2018-05-30T16:56:49.000Z | 2018-07-23T22:55:43.000Z | object_detection/core/box_coder_test.py | gourav108/coreml | 6bc2d494dff23cff923368e735992a4f4a47483c | [
"MIT"
] | 7 | 2018-06-08T05:53:01.000Z | 2020-06-09T12:23:44.000Z | # Copyright 2017 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... | 32.758065 | 80 | 0.669129 |
efa7879c766943710f9e2c5e3c7e6cbb4cdf566c | 15,613 | py | Python | metadrive/manager/agent_manager.py | decisionforce/metadrive | c18e29f5169868dabe74c327ab092daeca5bf98c | [
"Apache-2.0"
] | 125 | 2021-08-30T06:33:57.000Z | 2022-03-31T09:02:44.000Z | metadrive/manager/agent_manager.py | Morefrees/metadrive | c18e29f5169868dabe74c327ab092daeca5bf98c | [
"Apache-2.0"
] | 72 | 2021-08-30T16:23:41.000Z | 2022-03-31T19:17:16.000Z | metadrive/manager/agent_manager.py | Morefrees/metadrive | c18e29f5169868dabe74c327ab092daeca5bf98c | [
"Apache-2.0"
] | 20 | 2021-09-09T08:20:25.000Z | 2022-03-24T13:24:07.000Z | import copy
from typing import Dict
from gym.spaces import Box, Dict, MultiDiscrete
from metadrive.constants import DEFAULT_AGENT
from metadrive.manager.base_manager import BaseManager
from metadrive.policy.AI_protect_policy import AIProtectPolicy
from metadrive.policy.env_input_policy import EnvInputPolicy
from metad... | 43.856742 | 120 | 0.660283 |
2f150beb1e765fb78298290368cce5d76113eb6f | 8,633 | py | Python | tests/program_analysis/test_py_ast_to_cast.py | rsulli55/automates | 1647a8eef85c4f03086a10fa72db3b547f1a0455 | [
"Apache-2.0"
] | null | null | null | tests/program_analysis/test_py_ast_to_cast.py | rsulli55/automates | 1647a8eef85c4f03086a10fa72db3b547f1a0455 | [
"Apache-2.0"
] | null | null | null | tests/program_analysis/test_py_ast_to_cast.py | rsulli55/automates | 1647a8eef85c4f03086a10fa72db3b547f1a0455 | [
"Apache-2.0"
] | null | null | null | import pytest
import ast
import json
from automates.program_analysis.PyAST2CAST import py_ast_to_cast
from automates.program_analysis.CAST2GrFN.model.cast import (
AstNode,
Assignment,
Attribute,
BinaryOp,
BinaryOperator,
Call,
ClassDef,
Dict,
Expr,
FunctionDef,
List,
Lo... | 23.652055 | 85 | 0.698367 |
bcd6812d4569e6159320d978f84f45133d089dab | 1,503 | py | Python | lib/python3.4/site-packages/pip/_vendor/progress/counter.py | LChristakis/chalice-hunter | 6bffea4620e23ce9ff12ac30526ebafcb9c10058 | [
"MIT"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | lib/python3.4/site-packages/pip/_vendor/progress/counter.py | LChristakis/chalice-hunter | 6bffea4620e23ce9ff12ac30526ebafcb9c10058 | [
"MIT"
] | 309 | 2016-10-27T23:47:06.000Z | 2017-04-02T04:40:21.000Z | lib/python3.4/site-packages/pip/_vendor/progress/counter.py | LChristakis/chalice-hunter | 6bffea4620e23ce9ff12ac30526ebafcb9c10058 | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | 30.06 | 74 | 0.689288 |
9b26282ed78ef26e3eba56a0d9d8373f02bb6798 | 28,123 | py | Python | scrapy/tests/test_http_request.py | dominikszabo/scrapy | e7de00a8f043f710d7dda38f0ba803bb89f55ad9 | [
"BSD-3-Clause"
] | 1 | 2022-03-04T06:18:22.000Z | 2022-03-04T06:18:22.000Z | scrapy/tests/test_http_request.py | dominikszabo/scrapy | e7de00a8f043f710d7dda38f0ba803bb89f55ad9 | [
"BSD-3-Clause"
] | null | null | null | scrapy/tests/test_http_request.py | dominikszabo/scrapy | e7de00a8f043f710d7dda38f0ba803bb89f55ad9 | [
"BSD-3-Clause"
] | null | null | null | import cgi
import unittest
import xmlrpclib
from cStringIO import StringIO
from urlparse import urlparse
from scrapy.http import Request, FormRequest, XmlRpcRequest, Headers, HtmlResponse
class RequestTest(unittest.TestCase):
request_class = Request
default_method = 'GET'
default_headers = {}
defaul... | 42.353916 | 105 | 0.577357 |
75d4f74399552c4753d961b874d2ede86c38b922 | 986 | py | Python | neutron/db/migration/alembic_migrations/versions/yoga/expand/cd9ef14ccf87_add_index_to_agents_host.py | dangervon/neutron | 06ce0c2c94d2256a8f6804a1eacb0733747dcf46 | [
"Apache-2.0"
] | null | null | null | neutron/db/migration/alembic_migrations/versions/yoga/expand/cd9ef14ccf87_add_index_to_agents_host.py | dangervon/neutron | 06ce0c2c94d2256a8f6804a1eacb0733747dcf46 | [
"Apache-2.0"
] | null | null | null | neutron/db/migration/alembic_migrations/versions/yoga/expand/cd9ef14ccf87_add_index_to_agents_host.py | dangervon/neutron | 06ce0c2c94d2256a8f6804a1eacb0733747dcf46 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 OpenStack Foundation
#
# 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 ... | 25.947368 | 78 | 0.719067 |
833618195a62da0c306eabed37e03931c973918c | 2,403 | py | Python | model/SSIM.py | 17854212083/MSCANet | 4dd3aa8a85e16ae9eb15c87ab5dd5a7158417cb2 | [
"MIT"
] | null | null | null | model/SSIM.py | 17854212083/MSCANet | 4dd3aa8a85e16ae9eb15c87ab5dd5a7158417cb2 | [
"MIT"
] | null | null | null | model/SSIM.py | 17854212083/MSCANet | 4dd3aa8a85e16ae9eb15c87ab5dd5a7158417cb2 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import keras_contrib.backend as KC
from keras import backend as K
class DSSIMObjective:
def __init__(self, k1=0.01, k2=0.03, kernel_size=3, max_value=1.0):
self.__name__ = 'DSSIMObjective'
self.kernel_size = kernel_size
self.k1 = k1
... | 43.690909 | 89 | 0.575531 |
40888293dc7a862822c8c8d61077b7c856bf94d2 | 1,169 | py | Python | src/models/Seq2seq.py | mhannani/ZinVert | d54e1ab1980ed70945c34d2ceb294d559126f623 | [
"Apache-2.0"
] | null | null | null | src/models/Seq2seq.py | mhannani/ZinVert | d54e1ab1980ed70945c34d2ceb294d559126f623 | [
"Apache-2.0"
] | null | null | null | src/models/Seq2seq.py | mhannani/ZinVert | d54e1ab1980ed70945c34d2ceb294d559126f623 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
class Seq2Seq(nn.Module):
"""
Seq2seq model, combining encoder and decoder models.
"""
def __init__(self, encoder, decoder):
"""
The class constructor.
:param encoder: The Encoder model.
:param decoder: The Decocer model.
"""
su... | 29.225 | 87 | 0.621044 |
eba39459a560a1856acc4ffa362a663a1751a7f1 | 2,618 | py | Python | dbbackup/settings.py | sroussy/django-dbbackup | db1df2b06a5484e2a232a5fff3cf90d14a7caf67 | [
"BSD-3-Clause"
] | null | null | null | dbbackup/settings.py | sroussy/django-dbbackup | db1df2b06a5484e2a232a5fff3cf90d14a7caf67 | [
"BSD-3-Clause"
] | null | null | null | dbbackup/settings.py | sroussy/django-dbbackup | db1df2b06a5484e2a232a5fff3cf90d14a7caf67 | [
"BSD-3-Clause"
] | null | null | null | # DO NOT IMPORT THIS BEFORE django.configure() has been run!
import os
from django.conf import settings
DATABASES = getattr(settings, 'DBBACKUP_DATABASES', list(settings.DATABASES.keys()))
BACKUP_DIRECTORY = getattr(settings, 'DBBACKUP_BACKUP_DIRECTORY', os.getcwd())
# Fake host
DBBACKUP_FAKE_HOST = getattr(setting... | 41.555556 | 121 | 0.800611 |
e3b542f188d3a18abd69225d2567fab5713cf533 | 946 | py | Python | cyclofit/rides/forms.py | piyushmohan01/CycloFit-SEPM | f97a7032e22e29daf48f0796462a22e58b20709c | [
"MIT"
] | 4 | 2021-09-10T00:30:15.000Z | 2022-03-03T09:05:03.000Z | cyclofit/rides/forms.py | piyushmohan01/CycloFit-SEPM | f97a7032e22e29daf48f0796462a22e58b20709c | [
"MIT"
] | 1 | 2022-03-03T05:41:13.000Z | 2022-03-03T05:44:41.000Z | cyclofit/rides/forms.py | piyushmohan01/CycloFit-SEPM | f97a7032e22e29daf48f0796462a22e58b20709c | [
"MIT"
] | 3 | 2021-05-18T18:19:55.000Z | 2021-10-13T11:29:56.000Z | from flask_wtf import FlaskForm
from wtforms import SelectField, IntegerField, SubmitField, RadioField
from wtforms.validators import DataRequired
class NewRideForm(FlaskForm):
# distance and calorie-count
duration = SelectField('Ride Duration', choices=[(15, '15 Min'), (30, '30 Min'),\
(45, '45 Min'),... | 52.555556 | 94 | 0.615222 |
0878e6268fab762b577b608c79988c3f34d42ff5 | 22,285 | py | Python | test/functional/test_framework/util.py | Everyone-Coin/scholarshipcoin | 5ce0333efff7e20387c467ae8e9dc2a11184c5fe | [
"MIT"
] | 4 | 2021-01-26T09:19:26.000Z | 2021-08-15T12:42:10.000Z | test/functional/test_framework/util.py | Everyone-Coin/scholarshipcoin | 5ce0333efff7e20387c467ae8e9dc2a11184c5fe | [
"MIT"
] | 5 | 2021-01-26T18:18:48.000Z | 2021-03-24T20:45:27.000Z | test/functional/test_framework/util.py | Everyone-Coin/scholarshipcoin | 5ce0333efff7e20387c467ae8e9dc2a11184c5fe | [
"MIT"
] | 5 | 2021-02-01T19:15:22.000Z | 2022-02-07T02:52:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | 38.891798 | 140 | 0.652277 |
e5b5ec6a7e66cca97e462465b1990a63f99cf115 | 4,783 | py | Python | lib/acconeer_utils/clients/json/client.py | GoldenRed/acconeer-python-exploration | 5e60cbc105e532c4a6d5562ba29e195854e3d7c5 | [
"BSD-3-Clause-Clear"
] | 1 | 2019-10-15T15:57:50.000Z | 2019-10-15T15:57:50.000Z | lib/acconeer_utils/clients/json/client.py | GoldenRed/acconeer-python-exploration | 5e60cbc105e532c4a6d5562ba29e195854e3d7c5 | [
"BSD-3-Clause-Clear"
] | 2 | 2019-10-15T12:59:40.000Z | 2019-10-17T11:25:00.000Z | lib/acconeer_utils/clients/json/client.py | GoldenRed/acconeer-python-exploration | 5e60cbc105e532c4a6d5562ba29e195854e3d7c5 | [
"BSD-3-Clause-Clear"
] | null | null | null | from time import time
from copy import deepcopy
import logging
from distutils.version import StrictVersion
from acconeer_utils.clients.base import BaseClient, ClientError
from acconeer_utils.clients import links
from acconeer_utils.clients.json import protocol
from acconeer_utils.clients.base import decode_version_str... | 28.640719 | 95 | 0.597324 |
7d4744d2d1a40bd217e0b6099d4a6406e19cdfc0 | 34,110 | py | Python | downstream_tasks/run_classifier.py | meganbarnes/clinicalBERT | b1ec6de9094df525011159acd8c8718c7949e376 | [
"MIT"
] | null | null | null | downstream_tasks/run_classifier.py | meganbarnes/clinicalBERT | b1ec6de9094df525011159acd8c8718c7949e376 | [
"MIT"
] | null | null | null | downstream_tasks/run_classifier.py | meganbarnes/clinicalBERT | b1ec6de9094df525011159acd8c8718c7949e376 | [
"MIT"
] | null | null | null | # Code is adapted from the PyTorch pretrained BERT repo - See copyright & license below.
# Copyright 2018 The Google AI Language Team Authors and The HugginFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... | 42.58427 | 139 | 0.60815 |
20f537268340330bc1bb1ae8fcf9d69d467c54f2 | 6,768 | py | Python | std/huggingface/mlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/huggingface/mlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/huggingface/mlm.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2021 Quantapix Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 37.392265 | 117 | 0.552305 |
260351fab4774241d51f99be02133bf480309d6f | 3,334 | py | Python | original_script.py | codepost-io/heatmap-viewer | a8edc17ac0a01b7aca22cb9e9ec897387272a5ff | [
"MIT"
] | 1 | 2019-08-22T22:19:39.000Z | 2019-08-22T22:19:39.000Z | original_script.py | codepost-io/heatmap-viewer | a8edc17ac0a01b7aca22cb9e9ec897387272a5ff | [
"MIT"
] | null | null | null | original_script.py | codepost-io/heatmap-viewer | a8edc17ac0a01b7aca22cb9e9ec897387272a5ff | [
"MIT"
] | null | null | null | import requests
import functools
import pandas as pd # Package to manipulate tables of data
import seaborn as sns # Package to create visual heatmap
import matplotlib.pyplot as plt # Package to plot heatmap
api_key = "<API - KEY>" # Temporary Api token provided to CourseAdmin user
headers = {"Authorization": api_key} ... | 53.774194 | 129 | 0.705159 |
ab35f89af753121beda31c85107913756ecccf46 | 53,512 | py | Python | src/twisted/conch/test/test_keys.py | mmilata/twisted | a24e9345c609f824a813febfc6af7f350812dbc0 | [
"Unlicense",
"MIT"
] | 4 | 2020-07-05T21:15:38.000Z | 2021-04-09T05:42:19.000Z | src/twisted/conch/test/test_keys.py | mmilata/twisted | a24e9345c609f824a813febfc6af7f350812dbc0 | [
"Unlicense",
"MIT"
] | 10 | 2020-06-05T23:30:34.000Z | 2021-09-22T18:56:54.000Z | src/twisted/conch/test/test_keys.py | mmilata/twisted | a24e9345c609f824a813febfc6af7f350812dbc0 | [
"Unlicense",
"MIT"
] | 5 | 2020-05-12T11:04:44.000Z | 2020-05-31T14:08:00.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.ssh.keys}.
"""
from __future__ import absolute_import, division
from twisted.python.reflect import requireModule
cryptography = requireModule("cryptography")
if cryptography is None:
skipCryptography = 'Cannot ... | 38.608947 | 79 | 0.663907 |
19a18a247d4381814a222e45e444d6f21729a5d9 | 4,791 | py | Python | pypureclient/flasharray/FA_2_7/models/hardware_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_7/models/hardware_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_7/models/hardware_get_response.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 36.853846 | 524 | 0.606137 |
cac8d5fee2d0336e015c6c2326f024f40ad5c2a2 | 2,878 | py | Python | examples/GLSurfacePlot.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | null | null | null | examples/GLSurfacePlot.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | 1 | 2021-04-04T15:05:47.000Z | 2021-05-15T23:56:42.000Z | examples/GLSurfacePlot.py | abbasegbeyemi/pyqtgraph | 6aeafce477d1d7eebb9d2fe824d4c5573ef9ceed | [
"MIT"
] | 1 | 2021-05-19T10:11:17.000Z | 2021-05-19T10:11:17.000Z | # -*- coding: utf-8 -*-
"""
This example demonstrates the use of GLSurfacePlotItem.
"""
## Add path to library (just for examples; you do not need this)
import initExample
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph as pg
import pyqtgraph.opengl as gl
import numpy as np
## Create a GL View widget to dis... | 28.78 | 105 | 0.664698 |
0dbe845818982fcc2d8f06eadecf04fa6816df55 | 4,983 | py | Python | rbac/common/user/create_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 75 | 2018-04-06T09:13:34.000Z | 2020-05-18T18:59:47.000Z | rbac/common/user/create_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 989 | 2018-04-18T21:01:56.000Z | 2019-10-23T15:37:09.000Z | rbac/common/user/create_user.py | fthornton67/sawtooth-next-directory | 79479afb8d234911c56379bb1d8abf11f28ef86d | [
"Apache-2.0"
] | 72 | 2018-04-13T18:29:12.000Z | 2020-05-29T06:00:33.000Z | # Copyright 2019 Contributors to Hyperledger Sawtooth
#
# 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 ... | 36.639706 | 88 | 0.642785 |
9f89c04375f08b57ae375a35ed381efa1c03f191 | 3,646 | py | Python | backend/Tests/test_categorize.py | Cameramorphic/classify-images | bf1e6c39145fe6562a485d5a593fd63f32511db1 | [
"MIT"
] | 2 | 2021-02-11T17:04:48.000Z | 2021-02-11T17:04:51.000Z | backend/Tests/test_categorize.py | Cameramorphic/classify-images | bf1e6c39145fe6562a485d5a593fd63f32511db1 | [
"MIT"
] | 5 | 2021-02-11T17:06:25.000Z | 2021-02-11T17:06:51.000Z | backend/Tests/test_categorize.py | Cameramorphic/classify-images | bf1e6c39145fe6562a485d5a593fd63f32511db1 | [
"MIT"
] | null | null | null | import requests
import os
import abstract_test
files = os.listdir("Pictures")
categorize_endpoint = abstract_test.ADDRESS + abstract_test.categorize
def test_get_categorize(module_scoped_container_getter):
abstract_test.wait_for_server(abstract_test.categorize)
response = requests.get(categorize_endpoint)... | 48.613333 | 138 | 0.738892 |
fe15f8f191f5227e19860dcaaf0a5f2deac304a3 | 223 | py | Python | trader/__init__.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | trader/__init__.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | trader/__init__.py | geisten/bot | 76d4aef279cd168f6cbf7994055c1d289329e49c | [
"MIT"
] | null | null | null | """Package definition"""
from .trader import TradingBook, Order, HookValue
from .binance import authenticate_to_broker, test_runner
__all__ = ('authenticate_to_broker', 'test_runner', 'TradingBook', 'Order', 'HookValue')
| 37.166667 | 89 | 0.775785 |
cb31a61e1e5a62ad786a4f8c95663b08e721fe4f | 6,149 | py | Python | cohesity_management_sdk/models/protection_environment_enum.py | cohesity/management-sdk-python | 867d8c0c40dd317cdb017902c895527da7ae31c0 | [
"Apache-2.0"
] | 18 | 2019-09-24T17:35:53.000Z | 2022-03-25T08:08:47.000Z | cohesity_management_sdk/models/protection_environment_enum.py | cohesity/management-sdk-python | 867d8c0c40dd317cdb017902c895527da7ae31c0 | [
"Apache-2.0"
] | 18 | 2019-03-29T19:32:29.000Z | 2022-01-03T23:16:45.000Z | cohesity_management_sdk/models/protection_environment_enum.py | cohesity/management-sdk-python | 867d8c0c40dd317cdb017902c895527da7ae31c0 | [
"Apache-2.0"
] | 16 | 2019-02-27T06:54:12.000Z | 2021-11-16T18:10:24.000Z | # -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
class ProtectionEnvironmentEnum(object):
"""Implementation of the 'ProtectionSourceEnvironment' enum.
Specifies the source environment of the protection job.
Supported environment types such as 'kView', 'kSQL', 'kVMware',
etc.
NOTE: 'kPuppete... | 34.161111 | 78 | 0.709058 |
487fc0e001273d66a1720fef440e1e060253dfb9 | 1,112 | py | Python | application/ov1.py | justinhchae/app_courts | c46d48c4fa02cec91bda6fc3818ab677d6a83281 | [
"MIT"
] | 4 | 2021-01-04T05:46:43.000Z | 2022-01-06T16:33:40.000Z | application/ov1.py | justinhchae/app_courts | c46d48c4fa02cec91bda6fc3818ab677d6a83281 | [
"MIT"
] | null | null | null | application/ov1.py | justinhchae/app_courts | c46d48c4fa02cec91bda6fc3818ab677d6a83281 | [
"MIT"
] | null | null | null | import streamlit as st
from analyze_data.metrics import Metrics
from do_data.getter import Reader
class OV_1():
def __init__(self):
pass
def narrative(self):
st.write(
'Cook county is the largest county in the United States by population and has millions of court records available... | 44.48 | 171 | 0.70054 |
caeb0b7319e4d3f714118a3dec653097700b07e8 | 403 | py | Python | juliany_pizza/wsgi.py | kzborisov/Juliany-Pizza | 4ebc0b21e314b244048df79e4858f30447b43f8b | [
"MIT"
] | null | null | null | juliany_pizza/wsgi.py | kzborisov/Juliany-Pizza | 4ebc0b21e314b244048df79e4858f30447b43f8b | [
"MIT"
] | 9 | 2022-03-23T13:13:23.000Z | 2022-03-28T13:40:20.000Z | juliany_pizza/wsgi.py | kzborisov/Juliany-Pizza | 4ebc0b21e314b244048df79e4858f30447b43f8b | [
"MIT"
] | null | null | null | """
WSGI config for juliany_pizza 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... | 23.705882 | 78 | 0.791563 |
f2484ee2c5e53a1d8d41be21c4ba30199d4c05ac | 12,419 | py | Python | dataset/transform.py | lilinxi/210414_CfgYoloV3 | e6bbb64efa22e7d4c1f583f033370be4b16e548b | [
"MIT"
] | null | null | null | dataset/transform.py | lilinxi/210414_CfgYoloV3 | e6bbb64efa22e7d4c1f583f033370be4b16e548b | [
"MIT"
] | null | null | null | dataset/transform.py | lilinxi/210414_CfgYoloV3 | e6bbb64efa22e7d4c1f583f033370be4b16e548b | [
"MIT"
] | null | null | null | from typing import List
import numpy
import PIL.Image
import torch
import torchvision
def rand(min: float, max: float) -> float:
return numpy.random.rand() * (max - min) + min
class Compose(object):
"""
复合多种变换操作
"""
def __init__(self, transforms):
self.transforms = transforms
def... | 33.117333 | 119 | 0.596666 |
13b28aaa2595419ec3268980a2a2381d3ef18c95 | 20 | py | Python | example_project/some_modules/third_modules/a16.py | Yuriy-Leonov/cython_imports_limit_issue | 2f9e7c02798fb52185dabfe6ce3811c439ca2839 | [
"MIT"
] | null | null | null | example_project/some_modules/third_modules/a16.py | Yuriy-Leonov/cython_imports_limit_issue | 2f9e7c02798fb52185dabfe6ce3811c439ca2839 | [
"MIT"
] | null | null | null | example_project/some_modules/third_modules/a16.py | Yuriy-Leonov/cython_imports_limit_issue | 2f9e7c02798fb52185dabfe6ce3811c439ca2839 | [
"MIT"
] | null | null | null | class A16:
pass
| 6.666667 | 10 | 0.6 |
68729f3e1a90d94e87f6b70900b8bae66fa73ed4 | 400 | py | Python | ratingapp/migrations/0006_auto_20200607_1753.py | Edwin-Karanu-Muiruri/Rating-app | 35b13cec7bffed1f26391cb6e9991cee85e4ee4c | [
"MIT"
] | null | null | null | ratingapp/migrations/0006_auto_20200607_1753.py | Edwin-Karanu-Muiruri/Rating-app | 35b13cec7bffed1f26391cb6e9991cee85e4ee4c | [
"MIT"
] | 6 | 2021-03-30T13:33:32.000Z | 2022-01-13T02:50:26.000Z | ratingapp/migrations/0006_auto_20200607_1753.py | Edwin-Karanu-Muiruri/Rating-app | 35b13cec7bffed1f26391cb6e9991cee85e4ee4c | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-06-07 14:53
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('ratingapp', '0005_auto_20200607_1732'),
]
operations = [
migrations.RemoveField(
model_name='rating',
name='project',
... | 19.047619 | 49 | 0.57 |
0b63c116cc9ff3f972de01448bfb53b9ff94df7e | 1,894 | py | Python | aalh_iit_peopleportraits_010/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_peopleportraits_010/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | aalh_iit_peopleportraits_010/merge-description-columns.py | johndewees/iitmigration | 4dadfbecda719d6e7d60af076a231aedec3c862f | [
"Unlicense"
] | null | null | null | from openpyxl import load_workbook
filename = 'aalh_iit_peopleportraits_010.xlsx'
wb = load_workbook(filename)
ws = wb['Metadata Template']
minimumcol = 8
maximumcol = 8
minimumrow = 7
maximumrow = 499
iterationrow = 7
targetcol = 46
linkstring = 'Terms associated with the photograph are: '
for row i... | 42.088889 | 105 | 0.658395 |
b7ef95db75aeb08308872adfe96385fd821ec2dd | 15,344 | py | Python | wiphy/code/duc.py | ishikawalab/wiphy | 00131ee4ad2560d9b39f27fd3c2508d810e84802 | [
"MIT"
] | 4 | 2021-03-13T15:17:26.000Z | 2022-03-13T07:51:11.000Z | wiphy/code/duc.py | ishikawalab/wiphy | 00131ee4ad2560d9b39f27fd3c2508d810e84802 | [
"MIT"
] | null | null | null | wiphy/code/duc.py | ishikawalab/wiphy | 00131ee4ad2560d9b39f27fd3c2508d810e84802 | [
"MIT"
] | null | null | null | # Copyright (c) WiPhy Development Team
# This library is released under the MIT License, see LICENSE.txt
__all__ = ['generateDUCCodes']
import numpy as np
def generateDUCCodes(M, L, initu=None):
"""
Generates a codebook of the diagonal unitary code (DUC). A seminal research can be found in [1].
- [1] B... | 60.172549 | 149 | 0.510949 |
092416c0f0ddea338b98d750aa6a26012ff97df7 | 28,463 | py | Python | software/v2.3c/test/run_test.py | HelloWorksGroup/nanoDAP | 3d7b680c015099a3850ab270535001ef0cdd5c96 | [
"Apache-2.0"
] | 708 | 2018-10-07T05:51:03.000Z | 2022-03-31T08:24:21.000Z | software/v2.3c/test/run_test.py | fsyinghua/nanoDAP | abb2576144f368c224b653192094c20ed8aa74d7 | [
"Apache-2.0"
] | 18 | 2019-01-20T16:07:00.000Z | 2022-03-20T04:27:34.000Z | software/v2.3c/test/run_test.py | fsyinghua/nanoDAP | abb2576144f368c224b653192094c20ed8aa74d7 | [
"Apache-2.0"
] | 209 | 2018-12-27T12:49:11.000Z | 2022-03-29T13:16:35.000Z | #
# DAPLink Interface Firmware
# Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 40.25884 | 107 | 0.619822 |
9754d2ce57802b6a16cfcf111dd7d0c3f0123d50 | 3,076 | py | Python | utilities.py | RyanLinXiang/flower-classifier | b9bf566dcc99864666bbf73f68cdf056b9b1c4b5 | [
"MIT"
] | null | null | null | utilities.py | RyanLinXiang/flower-classifier | b9bf566dcc99864666bbf73f68cdf056b9b1c4b5 | [
"MIT"
] | null | null | null | utilities.py | RyanLinXiang/flower-classifier | b9bf566dcc99864666bbf73f68cdf056b9b1c4b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# PROGRAMMER: Ryan Lin Xiang
# DATE CREATED: 4th Feb 2020
# REVISED DATE: 05th Feb 2020
# PURPOSE: This file included all the helper functions necessary to save and load the model, as well as process the images
from PIL import Image
impo... | 31.71134 | 122 | 0.640767 |
45c73c8dc41c4b6b73948fd08f197402b854a718 | 16,001 | py | Python | HmiLogViewer.py | LoicGRENON/HmiLogViewer | 6e2406a2e1f3d3dc3e864a39dfbe984b4fdcaaf1 | [
"MIT"
] | null | null | null | HmiLogViewer.py | LoicGRENON/HmiLogViewer | 6e2406a2e1f3d3dc3e864a39dfbe984b4fdcaaf1 | [
"MIT"
] | null | null | null | HmiLogViewer.py | LoicGRENON/HmiLogViewer | 6e2406a2e1f3d3dc3e864a39dfbe984b4fdcaaf1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Created on 9 juil. 2015
@author: GRENON Loïc
"""
from PyQt4 import QtCore, QtGui
from ui.main import Ui_MainWindow
from ItemModels import COLOR_ROLE, LogReaderTableModel
from MyAboutDialog import MyAboutDialog
from MyExceptions import *
import codecs
import csv
import sys... | 44.820728 | 116 | 0.460596 |
ceb4b6cfb6cb752aac1b0cb218b02c83671241e2 | 3,129 | py | Python | serve/predict.py | saidulislam/sentiment-analysis-sagemaker | 3f72639c04efe4795ec0b31704c1cca0abc30e98 | [
"Apache-2.0"
] | null | null | null | serve/predict.py | saidulislam/sentiment-analysis-sagemaker | 3f72639c04efe4795ec0b31704c1cca0abc30e98 | [
"Apache-2.0"
] | null | null | null | serve/predict.py | saidulislam/sentiment-analysis-sagemaker | 3f72639c04efe4795ec0b31704c1cca0abc30e98 | [
"Apache-2.0"
] | null | null | null | import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
from utils import review_to_words, convert_and_pad
def model_fn(mod... | 32.59375 | 107 | 0.702141 |
ba38c31aacfed98a869e90c009cce5ff38a0ebab | 8,438 | py | Python | iter8_analytics/api/v2/examples/examples_metrics.py | sushmarchandran/iter8-analytics | 8264a8064cad930bf94670b10c061ee411cb948d | [
"Apache-2.0"
] | null | null | null | iter8_analytics/api/v2/examples/examples_metrics.py | sushmarchandran/iter8-analytics | 8264a8064cad930bf94670b10c061ee411cb948d | [
"Apache-2.0"
] | null | null | null | iter8_analytics/api/v2/examples/examples_metrics.py | sushmarchandran/iter8-analytics | 8264a8064cad930bf94670b10c061ee411cb948d | [
"Apache-2.0"
] | null | null | null | """
Metric examples used in other examples.
"""
request_count = {
"name": "request-count",
"metricObj": {
"apiVersion": "iter8.tools/v2alpha2",
"kind": "Metric",
"metadata": {
"name": "request-count"
},
"spec": {
"params": [{
"name"... | 33.484127 | 410 | 0.492178 |
65d2aa00d414bb51ec6e07527fa5c84de69c4723 | 8,686 | py | Python | sources/modis/arcpy_modis_721_etl_main.py | SERVIR/ReferenceNode_ETL | bda84fba651077dce74dd4d4f178de6acfc9a54c | [
"Apache-2.0"
] | null | null | null | sources/modis/arcpy_modis_721_etl_main.py | SERVIR/ReferenceNode_ETL | bda84fba651077dce74dd4d4f178de6acfc9a54c | [
"Apache-2.0"
] | null | null | null | sources/modis/arcpy_modis_721_etl_main.py | SERVIR/ReferenceNode_ETL | bda84fba651077dce74dd4d4f178de6acfc9a54c | [
"Apache-2.0"
] | 6 | 2016-12-17T22:39:17.000Z | 2019-07-08T08:55:31.000Z | # Developer: SpatialDev
# Company: Spatial Development International
# --------------- Imports -------------------------------------
# standard library
from datetime import datetime, timedelta
import sys
import os
# third-party
import arcpy
# Add the ETLBaseModule directory location to the Python system path in or... | 47.98895 | 166 | 0.616509 |
b8f62440b668cb2116379e968585c324aa74acc2 | 11,200 | py | Python | modules/torrentsearch.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 422 | 2015-01-08T14:08:08.000Z | 2022-02-07T11:47:37.000Z | modules/torrentsearch.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 581 | 2015-01-01T08:07:16.000Z | 2022-02-23T11:44:37.000Z | modules/torrentsearch.py | scambra/HTPC-Manager | 1a1440db84ae1b6e7a2610c7f3bd5b6adf0aab1d | [
"MIT"
] | 115 | 2015-01-08T14:41:00.000Z | 2022-02-13T12:31:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import re
import cherrypy
import jsonrpclib
import htpc
from ts import norbits
from ts import ka
from ts import ptp
from ts import rarbg
from ts import torrentproject
from ts import jackett2
from cherrypy.lib.auth2 import require
regex_codec = re.compil... | 40.57971 | 191 | 0.554018 |
0c154a33aa5304085497fac8a3cc0ac839b7bfe0 | 719 | py | Python | level21-zip_bz2_reverse.py | feliposz/python-challenge-solutions | 2d0d8fb6f29e69ce9e42539b88eb1fb37985419c | [
"MIT"
] | null | null | null | level21-zip_bz2_reverse.py | feliposz/python-challenge-solutions | 2d0d8fb6f29e69ce9e42539b88eb1fb37985419c | [
"MIT"
] | null | null | null | level21-zip_bz2_reverse.py | feliposz/python-challenge-solutions | 2d0d8fb6f29e69ce9e42539b88eb1fb37985419c | [
"MIT"
] | null | null | null | import cys_magic
import zlib, bz2
packFileName = "unreal\\package.pack"
print(cys_magic.file(packFileName))
pack = open(packFileName, "rb")
contents = pack.read()
zflag = False
bz2flag = False
reverse = False
log = ''
while True:
try:
contents = zlib.decompress(contents)
zflag = True
rev... | 18.435897 | 45 | 0.573018 |
92de7812eac73a49a75f42b730f581ee7deed78d | 20,218 | py | Python | sdk/python/pulumi_azure_native/network/v20171001/route_table.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20171001/route_table.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20171001/route_table.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 55.69697 | 5,091 | 0.683302 |
b0131f1cd6429d7284573e88dcde24d8ce328555 | 5,075 | py | Python | reviewboard/scmtools/managers.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 2 | 2020-06-19T14:57:49.000Z | 2020-06-19T15:17:40.000Z | reviewboard/scmtools/managers.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | 1 | 2019-08-03T01:48:33.000Z | 2019-08-03T01:48:33.000Z | reviewboard/scmtools/managers.py | amalik2/reviewboard | 676aa2dce38ce619a74f2d4cb3cfae9bce21416e | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.db.models import Manager, Q
from django.db.models.query import QuerySet
_TOOL_CACHE = {}
class ToolQuerySet(QuerySet):
def get(self, *args, **kwargs):
pk = kwargs.get('id__exact', None)
if pk is None:
return super(ToolQuerySet, se... | 32.954545 | 78 | 0.608276 |
8de238d3687b719802cabb53d8b4cc06b444554d | 16,500 | py | Python | localstack/services/apigateway/apigateway_listener.py | SVemulapalli/localstack | c5079d7c2053efd10ea2e2dfde782f643173576b | [
"Apache-2.0"
] | null | null | null | localstack/services/apigateway/apigateway_listener.py | SVemulapalli/localstack | c5079d7c2053efd10ea2e2dfde782f643173576b | [
"Apache-2.0"
] | null | null | null | localstack/services/apigateway/apigateway_listener.py | SVemulapalli/localstack | c5079d7c2053efd10ea2e2dfde782f643173576b | [
"Apache-2.0"
] | null | null | null | import re
import json
import time
import logging
import requests
import datetime
from flask import Response as FlaskResponse
from six.moves.urllib_parse import urljoin
from requests.models import Response
from localstack.utils import common
from localstack.config import TEST_KINESIS_URL, TEST_SQS_URL
from localstack.co... | 42.416452 | 184 | 0.618242 |
52c652d0feeee6df4aac3ed08fa7d17ca5dfbb8f | 3,454 | py | Python | my_classes/Tuples/.history/name_tuples_20210722114320.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210722114320.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/Tuples/.history/name_tuples_20210722114320.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """ Tuple as Data Structure
We have see how we interpreted tuples as data structures
The position of the object contained in the tuple gives it meaning
For example, we can represent a 2D coordinate as: (10, 20)
x y
If pt is a position tuple, we can re... | 32.584906 | 154 | 0.615518 |
2b8c696f61def54035ba6d0878995139210695fc | 25,003 | py | Python | rest-api-server/main.py | OddballSports-tv/tidbyt-scoreboard | 35dc66826966eb1a93c1fd1bbfe57367b2f29741 | [
"Apache-2.0"
] | null | null | null | rest-api-server/main.py | OddballSports-tv/tidbyt-scoreboard | 35dc66826966eb1a93c1fd1bbfe57367b2f29741 | [
"Apache-2.0"
] | null | null | null | rest-api-server/main.py | OddballSports-tv/tidbyt-scoreboard | 35dc66826966eb1a93c1fd1bbfe57367b2f29741 | [
"Apache-2.0"
] | null | null | null | # imports
from flask import Flask
from flask import request
from flask import abort
from functools import wraps
from flask import json
from flask import jsonify
from flask_cors import CORS
from markupsafe import escape
from PIL import Image, ImageDraw
import os
import base64
from io import BytesIO
from google.cloud imp... | 30.015606 | 162 | 0.544615 |
784c65288205c2c2abd2bb6f065f0d721ff8d0e6 | 70 | py | Python | tests/filesystem/__init__.py | mehrdad-shokri/retdec-regression-tests-framework | 9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3 | [
"MIT"
] | 21 | 2017-12-12T20:38:43.000Z | 2019-04-14T12:46:10.000Z | tests/filesystem/__init__.py | mehrdad-shokri/retdec-regression-tests-framework | 9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3 | [
"MIT"
] | 6 | 2018-01-06T13:32:23.000Z | 2018-09-14T15:09:11.000Z | tests/filesystem/__init__.py | mehrdad-shokri/retdec-regression-tests-framework | 9c3edcd0a7bc292a0d5b5cbfb4315010c78d3bc3 | [
"MIT"
] | 11 | 2017-12-12T20:38:46.000Z | 2018-07-19T03:12:03.000Z | """
Tests for the :mod:`regression_tests.filesystem` package.
"""
| 17.5 | 61 | 0.671429 |
f2a56270f15b5a1ab0a32cb3abea2b8058c2f1af | 25,959 | py | Python | amaml_reach_train.py | ZiyeHu/mil | a240aac7734ecc129788c944e3623aff1aa1b6f0 | [
"MIT"
] | null | null | null | amaml_reach_train.py | ZiyeHu/mil | a240aac7734ecc129788c944e3623aff1aa1b6f0 | [
"MIT"
] | null | null | null | amaml_reach_train.py | ZiyeHu/mil | a240aac7734ecc129788c944e3623aff1aa1b6f0 | [
"MIT"
] | null | null | null | import numpy as np
import random
import tensorflow as tf
import logging
import imageio
import os
import gym
from functools import reduce
from operator import mul
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from data_generator import DataGenerator
# from amaml import MIL
from amaml import MIL
from evaluation.eval_reach ... | 59.813364 | 220 | 0.677607 |
3e79ab4525d6f1914056bf8ccce7c0151a9ecb58 | 408 | py | Python | um7/setup.py | philsuth/um7 | 2b76775011c9b1faf60272a8d91722ca5c473167 | [
"MIT"
] | null | null | null | um7/setup.py | philsuth/um7 | 2b76775011c9b1faf60272a8d91722ca5c473167 | [
"MIT"
] | null | null | null | um7/setup.py | philsuth/um7 | 2b76775011c9b1faf60272a8d91722ca5c473167 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='um7',
version='0.16+rct0',
description='Classes to interface with CH Robotics / Redshift Labs UM7 IMU',
url='https://github.com/philsuth/um7',
author='Till Busch, Daniel Kurek, Phil Sutherland',
author_email='phils@rct-global.com',
license='M... | 31.384615 | 82 | 0.654412 |
371dcab456c83b309642376df08d1c4f09dfffe1 | 1,402 | py | Python | utils/gyb_syntax_support/CommonNodes.py | elizachen/swift | be1a2c334c5bc02051779d0151b8b95805f4e911 | [
"Apache-2.0"
] | 1 | 2018-02-24T06:55:39.000Z | 2018-02-24T06:55:39.000Z | utils/gyb_syntax_support/CommonNodes.py | elizachen/swift | be1a2c334c5bc02051779d0151b8b95805f4e911 | [
"Apache-2.0"
] | null | null | null | utils/gyb_syntax_support/CommonNodes.py | elizachen/swift | be1a2c334c5bc02051779d0151b8b95805f4e911 | [
"Apache-2.0"
] | null | null | null | from Child import Child
from Node import Node # noqa: I201
COMMON_NODES = [
Node('Decl', kind='Syntax'),
Node('Expr', kind='Syntax'),
Node('Stmt', kind='Syntax'),
Node('Type', kind='Syntax'),
Node('Pattern', kind='Syntax'),
Node('UnknownDecl', kind='Decl'),
Node('UnknownExpr', kind='Expr')... | 33.380952 | 67 | 0.531384 |
f4ec9eacb8f5af393fb0a78c159f591e1c40400e | 1,087 | py | Python | src/streamlink/plugins/latina.py | melmorabity/streamlink | 24c59a23103922977991acc28741a323d8efa7a1 | [
"BSD-2-Clause"
] | 4 | 2020-10-17T06:35:39.000Z | 2021-05-14T20:00:01.000Z | src/streamlink/plugins/latina.py | TheDrHax/streamlink | 4dfd0d516fd8484438389518985e3b5131b7a253 | [
"BSD-2-Clause"
] | null | null | null | src/streamlink/plugins/latina.py | TheDrHax/streamlink | 4dfd0d516fd8484438389518985e3b5131b7a253 | [
"BSD-2-Clause"
] | null | null | null | import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import useragents
from streamlink.plugin.api.utils import itertags
from streamlink.stream import HLSStream
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r"https?://(?:www\.)?latina\.pe/tvenvivo... | 29.378378 | 82 | 0.602576 |
68449348227933efc770bedbbdf707394da32c1e | 2,311 | py | Python | data/test/test_encryption.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | data/test/test_encryption.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | data/test/test_encryption.py | sferich888/quay | 4672db1df76874238baf134d04e74112ac9f630d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from data.encryption import FieldEncrypter, _VERSIONS, DecryptionFailureException
@pytest.mark.parametrize(
"test_data",
[
"",
"hello world",
"wassup?!",
"IGZ2Y8KUN3EFWAZZXR3D7U4V5NXDVYZI5VGU6STPB6KM83PAB8WRGM32RD9FW0C0",
"JLRFBYS... | 30.813333 | 100 | 0.655128 |
989d878a499c40ebea3c3e64e960bbc3f0e579ce | 4,574 | py | Python | test/Fortran/F03.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | test/Fortran/F03.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | test/Fortran/F03.py | clemens-tolboom/scons | cd722bdc5f6b1163d56246ee0afc63c28ecc138e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, publish,
... | 34.651515 | 73 | 0.670748 |
30a230036f9b79d5a880fce4f01c833f88b77345 | 968 | py | Python | test/automation/test/test_all.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 3 | 2022-01-12T06:51:51.000Z | 2022-02-23T18:54:33.000Z | test/automation/test/test_all.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 6 | 2021-08-31T19:21:26.000Z | 2022-01-03T05:53:42.000Z | test/automation/test/test_all.py | agupta54/ulca | c1f570ac254ce2ac73f40c49716458f4f7cbaee2 | [
"MIT"
] | 8 | 2021-08-12T08:07:49.000Z | 2022-01-25T04:40:51.000Z | from .test_public_website import test_public_website
from .test_asr import test_asr_record
from .test_leaderboard import test_leaderboard
from .test_cards import test_cards
from .test_elements import test_elements_with_browser
def perform_testing_all(login,driver):
#public-pages-testing
driver=test_asr_record(... | 32.266667 | 53 | 0.772727 |
9f96f901e31777ccf6cd485241625e2fea2d3674 | 12,915 | py | Python | poly_plotter.py | yhsmiley/lsc-cnn | fd4a99b2822a2f8b4beace4a3b8b1fe2f1792dbd | [
"MIT"
] | 2 | 2020-08-21T04:37:24.000Z | 2021-03-21T22:32:37.000Z | poly_plotter.py | levan92/lsc-cnn | 27ad9465798e65c7c99e22a448ccaac9880e35d8 | [
"MIT"
] | null | null | null | poly_plotter.py | levan92/lsc-cnn | 27ad9465798e65c7c99e22a448ccaac9880e35d8 | [
"MIT"
] | 3 | 2019-09-19T09:29:38.000Z | 2020-02-24T11:27:04.000Z | import cv2
import copy
import numpy as np
# if __name__ == '__main__':
# from misc import init_imshow, show
# else:
# from .misc import init_imshow, show
mouse_pt = None
click_pt = None
start_click_pt = None
stored_rect_pts = None
pre_adjust_mode = []
adjust_mode = []
move_start_pt = None
anchor_rect_pts =... | 37.112069 | 149 | 0.603794 |
b86e5f28e3154cd6c8cc12a760941d90cde7f764 | 259 | py | Python | tex/make_message.py | salimfadhley/hoax1 | c48c1721f2882a4e8e242067314f793a28f4bfc0 | [
"MIT"
] | null | null | null | tex/make_message.py | salimfadhley/hoax1 | c48c1721f2882a4e8e242067314f793a28f4bfc0 | [
"MIT"
] | null | null | null | tex/make_message.py | salimfadhley/hoax1 | c48c1721f2882a4e8e242067314f793a28f4bfc0 | [
"MIT"
] | null | null | null | import base64
import codecs
rot13 = codecs.getencoder( "rot-13" )
CLEARTEXT_MESSAGE:bytes = rot13("Mark Steele is a gullible fuckwit!")[0].encode("utf-8")
with open("message.txt", "w") as f:
f.write(base64.b64encode(CLEARTEXT_MESSAGE).decode("utf-8"))
| 25.9 | 88 | 0.718147 |
47d302fff49f69f3247200731c62e824c3532945 | 2,036 | py | Python | selfdrive/test/helpers.py | alvaro-blz/openpilot | 09ad35beebef1c904d8751e52ae60c4762ea5b95 | [
"MIT"
] | 3 | 2020-10-04T03:55:59.000Z | 2021-05-13T06:34:02.000Z | selfdrive/test/helpers.py | alvaro-blz/openpilot | 09ad35beebef1c904d8751e52ae60c4762ea5b95 | [
"MIT"
] | null | null | null | selfdrive/test/helpers.py | alvaro-blz/openpilot | 09ad35beebef1c904d8751e52ae60c4762ea5b95 | [
"MIT"
] | 4 | 2020-09-16T00:02:07.000Z | 2020-11-24T06:02:08.000Z | import time
import subprocess
from functools import wraps
from nose.tools import nottest
from common.hardware import PC
from common.apk import update_apks, start_offroad, pm_apply_packages, android_packages
from common.params import Params
from selfdrive.version import training_version, terms_version
from selfdrive.ma... | 28.676056 | 86 | 0.686149 |
e43df2f1314d850d8d72a7ef0f30305f7f0db843 | 6,946 | py | Python | nni/experiment/launcher.py | acured/nni | 03ff374189837d28d98c3e0a14ea248d9a231f82 | [
"MIT"
] | 1 | 2021-08-22T12:04:23.000Z | 2021-08-22T12:04:23.000Z | nni/experiment/launcher.py | acured/nni | 03ff374189837d28d98c3e0a14ea248d9a231f82 | [
"MIT"
] | null | null | null | nni/experiment/launcher.py | acured/nni | 03ff374189837d28d98c3e0a14ea248d9a231f82 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import contextlib
import logging
from pathlib import Path
import socket
from subprocess import Popen
import sys
import time
from typing import Optional, Tuple
import colorama
import nni_node # pylint: disable=import-error
import nni.runtime.pr... | 39.022472 | 138 | 0.663115 |
3dbb66679763d00fb93a405be5321050adaf85be | 65,803 | py | Python | nxt_editor/main_window.py | Mikfr83/nxt_editor | ea419c2a53817cd2b1a9fbedfd328193cde4a17f | [
"MIT"
] | null | null | null | nxt_editor/main_window.py | Mikfr83/nxt_editor | ea419c2a53817cd2b1a9fbedfd328193cde4a17f | [
"MIT"
] | null | null | null | nxt_editor/main_window.py | Mikfr83/nxt_editor | ea419c2a53817cd2b1a9fbedfd328193cde4a17f | [
"MIT"
] | null | null | null | # Built-in
import os
import sys
import logging
import subprocess
import traceback
from collections import OrderedDict
import webbrowser
from functools import partial
import time
# External
from Qt import QtWidgets
from Qt import QtGui
from Qt import QtCore
# Internal
import nxt_editor
from nxt_editor import user_dir
... | 41.178348 | 119 | 0.63953 |
58e00459697805d8f1e7adbc2795e9616fc70667 | 3,717 | py | Python | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 106 | 2015-07-21T16:18:26.000Z | 2022-03-31T06:45:34.000Z | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 21 | 2015-07-11T03:48:28.000Z | 2022-01-18T12:57:30.000Z | batch_score.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 26 | 2015-07-22T22:38:21.000Z | 2022-03-14T10:11:56.000Z | #!/usr/bin/env python3
import argparse
import os
import sys
import traceback
from lib import core, utilities, run
from lib.attributes import Attributes
from lib.database import Database
def process_arguments():
"""
Uses the argparse module to parse commandline arguments.
Returns:
Dictionary of ... | 26.361702 | 76 | 0.584073 |
2325ca98e7636876fccf2eb5a9b9a1466b871466 | 12,352 | py | Python | src/loaders/load.py | asrayousuf/Eva | f652e5d398556055490c146f37e7a2d7a9d091f3 | [
"Apache-2.0"
] | 1 | 2019-11-06T03:30:08.000Z | 2019-11-06T03:30:08.000Z | src/loaders/load.py | asrayousuf/Eva | f652e5d398556055490c146f37e7a2d7a9d091f3 | [
"Apache-2.0"
] | 1 | 2019-11-18T03:09:56.000Z | 2019-11-18T03:09:56.000Z | src/loaders/load.py | asrayousuf/Eva | f652e5d398556055490c146f37e7a2d7a9d091f3 | [
"Apache-2.0"
] | null | null | null | """
This folder contains all util functions needed to load the dataset with
annotation.
Demo could be run with the command
python loaders/load.py
@Jaeho Bang
"""
import os
import time
import xml.etree.ElementTree as ET
import cv2
import numpy as np
import pandas as pd
from . import TaskManager
# Make this return... | 38.6 | 79 | 0.545903 |
9c06ee2f427e8c529e15a72f61593168a7679620 | 2,236 | py | Python | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py | tc79/python-project-template | bd2521252365d46ca3a2ba00abef1e0b4c8a1f1c | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py | tc79/python-project-template | bd2521252365d46ca3a2ba00abef1e0b4c8a1f1c | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/__init__.py | tc79/python-project-template | bd2521252365d46ca3a2ba00abef1e0b4c8a1f1c | [
"BSD-3-Clause"
] | null | null | null | # -*- encoding: utf-8 -*-
# {{ cookiecutter.project_name }} v{{ cookiecutter.version }}
# {{ cookiecutter.project_short_description }}
# Copyright © {{ cookiecutter.year }}, {{ cookiecutter.company }}.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are perm... | 42.188679 | 92 | 0.749106 |
e7998116ae01af13dd6c85afdcaf4b845cf2ad94 | 3,594 | py | Python | TicTacToe/tictactoe_board.py | sbeignez/Playground | 3e59888b97c988dbb072bfb7ce026af657083d96 | [
"MIT"
] | null | null | null | TicTacToe/tictactoe_board.py | sbeignez/Playground | 3e59888b97c988dbb072bfb7ce026af657083d96 | [
"MIT"
] | null | null | null | TicTacToe/tictactoe_board.py | sbeignez/Playground | 3e59888b97c988dbb072bfb7ce026af657083d96 | [
"MIT"
] | null | null | null |
from hmac import trans_36
from tictactoe import TicTacToe
import random
class Board:
def __init__(self, m=3, n=3, k=3, list = []):
self.cols = m
self.rows = n
if list:
self.board = list
else:
self.board = [TicTacToe.BOARD_EMPTY for _ in range(self.cols *... | 28.299213 | 140 | 0.516138 |
22c727102a304d24cca378a8b5eeb3ab1d0ff003 | 5,642 | py | Python | tests/test_lstm.py | JesseTG/Sock | 97b2f76dae324708a26bb46ce466680e6e4c769e | [
"BSD-3-Clause"
] | null | null | null | tests/test_lstm.py | JesseTG/Sock | 97b2f76dae324708a26bb46ce466680e6e4c769e | [
"BSD-3-Clause"
] | null | null | null | tests/test_lstm.py | JesseTG/Sock | 97b2f76dae324708a26bb46ce466680e6e4c769e | [
"BSD-3-Clause"
] | null | null | null | import pytest
import torch
from tests.marks import *
from sock.model.data import WordEmbeddings, sentence_label_pad, sentence_pad
from sock.model.nn import ContextualLSTM
@modes("cpu", "cuda")
def test_devices_are_the_same(lstm: ContextualLSTM, glove_embedding: WordEmbeddings):
assert lstm.device == glove_embedd... | 31.171271 | 106 | 0.667494 |
9b38837e44ddf801b104146b4174410e41ef737a | 297 | py | Python | tests/basics/builtin_delattr.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | 8 | 2017-01-08T19:45:01.000Z | 2020-09-07T04:39:10.000Z | tests/basics/builtin_delattr.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | null | null | null | tests/basics/builtin_delattr.py | 84KaliPleXon3/micropython-esp32 | a64dc82742749cf4a4bbe5688dde05122fb38f56 | [
"MIT"
] | 2 | 2017-07-27T19:45:05.000Z | 2020-08-02T19:00:33.000Z | # test builtin delattr
try:
delattr
except:
import sys
print("SKIP")
sys.exit()
class A: pass
a = A()
a.x = 1
print(a.x)
delattr(a, 'x')
try:
a.x
except AttributeError:
print('AttributeError')
try:
delattr(a, 'x')
except AttributeError:
print('AttributeError')
| 11.88 | 27 | 0.622896 |
e48412bb7edaeaab7561952a83cb5df97a9aeb17 | 15,044 | py | Python | ml-agents/mlagents/trainers/sac_transfer/trainer.py | ycsun2017/ml-agents | 81eaaad4b0bec6e7ba16a3bb4c003208db846984 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/sac_transfer/trainer.py | ycsun2017/ml-agents | 81eaaad4b0bec6e7ba16a3bb4c003208db846984 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/sac_transfer/trainer.py | ycsun2017/ml-agents | 81eaaad4b0bec6e7ba16a3bb4c003208db846984 | [
"Apache-2.0"
] | null | null | null | # ## ML-Agent Learning (SAC)
# Contains an implementation of SAC as described in https://arxiv.org/abs/1801.01290
# and implemented in https://github.com/hill-a/stable-baselines
from collections import defaultdict
from typing import Dict, cast
import os
import numpy as np
from mlagents.trainers.policy.checkpoint_mana... | 40.224599 | 122 | 0.644443 |
8db30592a1583a9ddc22718ab608005a3f23f411 | 3,177 | py | Python | tests/aat/api/v1/client/models/bulk_stop_packet_captures_request.py | DerangedMonkeyNinja/openperf | cde4dc6bf3687f0663c11e9e856e26a0dc2b1d16 | [
"Apache-2.0"
] | 20 | 2019-12-04T01:28:52.000Z | 2022-03-17T14:09:34.000Z | tests/aat/api/v1/client/models/bulk_stop_packet_captures_request.py | DerangedMonkeyNinja/openperf | cde4dc6bf3687f0663c11e9e856e26a0dc2b1d16 | [
"Apache-2.0"
] | 115 | 2020-02-04T21:29:54.000Z | 2022-02-17T13:33:51.000Z | tests/aat/api/v1/client/models/bulk_stop_packet_captures_request.py | DerangedMonkeyNinja/openperf | cde4dc6bf3687f0663c11e9e856e26a0dc2b1d16 | [
"Apache-2.0"
] | 16 | 2019-12-03T16:41:18.000Z | 2021-11-06T04:44:11.000Z | # coding: utf-8
"""
OpenPerf API
REST API interface for OpenPerf # noqa: E501
OpenAPI spec version: 1
Contact: support@spirent.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class BulkStopPacketCapturesRequest(object... | 27.387931 | 86 | 0.563425 |
a219ae0c928d1bd914a24417fb7084b8b3c51e51 | 466 | py | Python | vortex/errors.py | sihrc/vortex | 4b913946c8c1743a5cd7a07b80bc7ab516ce12f2 | [
"MIT"
] | null | null | null | vortex/errors.py | sihrc/vortex | 4b913946c8c1743a5cd7a07b80bc7ab516ce12f2 | [
"MIT"
] | 6 | 2018-08-04T21:29:11.000Z | 2021-05-16T05:30:34.000Z | vortex/errors.py | sihrc/vortex | 4b913946c8c1743a5cd7a07b80bc7ab516ce12f2 | [
"MIT"
] | 1 | 2019-08-22T11:48:30.000Z | 2019-08-22T11:48:30.000Z | class VortexException(Exception):
def __init__(self, message, code=400, **kwargs):
self.code = code
self.message = message
self.body = kwargs
super().__init__("{}. status={}".format(message, code))
def to_dict(self):
return {"message": self.message, "code": self.code, "b... | 31.066667 | 78 | 0.639485 |
fab833f38855e2d66b6fed6fb6c8fb32a5695b0e | 22 | py | Python | couch/datadog_checks/couch/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2021-05-14T20:00:35.000Z | 2021-05-14T20:00:35.000Z | couch/datadog_checks/couch/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | null | null | null | couch/datadog_checks/couch/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2021-09-07T12:35:18.000Z | 2021-09-07T12:35:18.000Z | __version__ = "2.6.1"
| 11 | 21 | 0.636364 |
a32ab0503cebb92ce647798914203ad545f98d7a | 3,524 | py | Python | examples/random_forest_importances.py | joshloyal/drforest | ab1e3f01cab36f15f1c37b82f71421cd025c901e | [
"MIT"
] | 2 | 2021-09-22T12:15:43.000Z | 2022-01-04T12:59:50.000Z | examples/random_forest_importances.py | joshloyal/drforest | ab1e3f01cab36f15f1c37b82f71421cd025c901e | [
"MIT"
] | null | null | null | examples/random_forest_importances.py | joshloyal/drforest | ab1e3f01cab36f15f1c37b82f71421cd025c901e | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
from sklearn.ensemble import RandomForestRegressor
from drforest.datasets import make_simulation1
from drforest.ensemble import DimensionReductionForestRegressor
from drforest.ensemble import permutation_importance
plt.rc('... | 36.329897 | 95 | 0.663451 |
c3dde282e9f9e170d3833590eec5a39905cf7796 | 7,119 | py | Python | tests/standard/fido2/extensions/test_hmac_secret.py | rgerganov/fido2-tests | 7881689b86a2e9ad5aa9ba2aa9c0747bd406b643 | [
"Apache-2.0",
"MIT"
] | 3 | 2020-02-05T03:36:21.000Z | 2020-03-05T21:34:32.000Z | tests/standard/fido2/extensions/test_hmac_secret.py | antonio-fr/fido2-tests | cb3e3a66aa139b5b2cfd8e6f8cf8f5511d8931be | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/standard/fido2/extensions/test_hmac_secret.py | antonio-fr/fido2-tests | cb3e3a66aa139b5b2cfd8e6f8cf8f5511d8931be | [
"Apache-2.0",
"MIT"
] | null | null | null | import pytest
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from fido2.ctap import CtapError
from fido2.utils import hmac_sha256, sha256
from tests.utils import FidoRequest, shannon_entropy, verify
def get_salt_params(cipher, sha... | 35.242574 | 94 | 0.648687 |
148bfdbc9bdc74cea8946bfe747d00ee3de5df62 | 956 | py | Python | prov_vo/migrations/0003_rename_entity_datatype.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | 1 | 2018-12-11T05:53:55.000Z | 2018-12-11T05:53:55.000Z | prov_vo/migrations/0003_rename_entity_datatype.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | null | null | null | prov_vo/migrations/0003_rename_entity_datatype.py | kristinriebe/django-prov-vo | 5bd86eb58833fe591004e6ef431b2b3deae7a62c | [
"Apache-2.0"
] | 1 | 2021-06-23T13:09:05.000Z | 2021-06-23T13:09:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-15 22:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('prov_vo', '0002_parameter_entityrights'),
]
operations = [
migrations.Remov... | 38.24 | 446 | 0.600418 |
52c12395a31c3beb95946b66ced5665803206452 | 1,936 | py | Python | tests/test_analyze.py | edumotya/cvdata | 9c3f6ea3520b564b3386ce1149a7ce40b4d14e7a | [
"MIT"
] | 15 | 2020-01-22T16:10:35.000Z | 2022-01-09T13:27:32.000Z | tests/test_analyze.py | edumotya/cvdata | 9c3f6ea3520b564b3386ce1149a7ce40b4d14e7a | [
"MIT"
] | 94 | 2019-11-14T14:40:33.000Z | 2022-01-10T06:38:44.000Z | tests/test_analyze.py | edumotya/cvdata | 9c3f6ea3520b564b3386ce1149a7ce40b4d14e7a | [
"MIT"
] | 8 | 2020-03-10T11:10:06.000Z | 2022-01-09T13:30:00.000Z | import logging
import os
import pytest
from cvdata import analyze
# ------------------------------------------------------------------------------
# disable logging messages
logging.disable(logging.CRITICAL)
# ------------------------------------------------------------------------------
@pytest.mark.usefixtures(
... | 32.813559 | 90 | 0.633781 |
76f099ee9bb4d5a69e6021466e1407a4f6a49372 | 8,610 | py | Python | model.py | young-geng/iColorTF | 81d151fba6a405769ed5aade845fda3e1f66a33c | [
"MIT"
] | 1 | 2018-03-15T15:29:11.000Z | 2018-03-15T15:29:11.000Z | model.py | young-geng/iColorTF | 81d151fba6a405769ed5aade845fda3e1f66a33c | [
"MIT"
] | null | null | null | model.py | young-geng/iColorTF | 81d151fba6a405769ed5aade845fda3e1f66a33c | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = self
def pad2d(input_tensor, padding):
return tf.pad(
input_tensor, [[0, 0], [padding, padding], [padding, p... | 27.684887 | 79 | 0.566086 |
c25dfff9856298ab2af664ac926d16d6fa88eea8 | 253 | py | Python | taskqueue/__init__.py | neurodata/python-task-queue | f2b20d6b008e2c0cead418441c60d7dc07188848 | [
"BSD-3-Clause"
] | null | null | null | taskqueue/__init__.py | neurodata/python-task-queue | f2b20d6b008e2c0cead418441c60d7dc07188848 | [
"BSD-3-Clause"
] | null | null | null | taskqueue/__init__.py | neurodata/python-task-queue | f2b20d6b008e2c0cead418441c60d7dc07188848 | [
"BSD-3-Clause"
] | null | null | null | from .registered_task import RegisteredTask, MockTask, PrintTask
from .taskqueue import TaskQueue, MockTaskQueue, LocalTaskQueue
from .secrets import (
QUEUE_NAME, TEST_QUEUE_NAME, QUEUE_TYPE,
PROJECT_NAME, AWS_DEFAULT_REGION
)
__version__ = 0.9.0 | 31.625 | 64 | 0.818182 |
0513336c72cde352c087cd6cbffe9f7c6b149cd9 | 1,186 | py | Python | run/kerberom/modules/rom/_crypto/ARC4.py | zaza568/yo | 7e32382280647a0f07f74cd5fd54fb6ba68afd6e | [
"OLDAP-2.4"
] | 1 | 2021-10-08T17:49:57.000Z | 2021-10-08T17:49:57.000Z | run/kerberom/modules/rom/_crypto/ARC4.py | zaza568/yo | 7e32382280647a0f07f74cd5fd54fb6ba68afd6e | [
"OLDAP-2.4"
] | null | null | null | run/kerberom/modules/rom/_crypto/ARC4.py | zaza568/yo | 7e32382280647a0f07f74cd5fd54fb6ba68afd6e | [
"OLDAP-2.4"
] | null | null | null | # ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <eddy (dot) maaalou (at) gmail (dot) com> wrote this file. As long as you
# retain this notice you can do whatever you want with this stuff. If we meet
# some day, and you think this stuff is wor... | 30.410256 | 78 | 0.43339 |
02883bcd4f62c4155c945ce3fadf1273e1942e7b | 284 | py | Python | app/user/urls.py | thein3000/recipe-app-api | b5cd78e534bf7a298c5c30a6b4dc70b7bebe5c7c | [
"MIT"
] | null | null | null | app/user/urls.py | thein3000/recipe-app-api | b5cd78e534bf7a298c5c30a6b4dc70b7bebe5c7c | [
"MIT"
] | 6 | 2020-05-15T10:53:08.000Z | 2022-02-10T14:31:30.000Z | app/user/urls.py | thein3000/recipe-app-api | b5cd78e534bf7a298c5c30a6b4dc70b7bebe5c7c | [
"MIT"
] | null | null | null | from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name='create'),
path('token/', views.CreateTokenView.as_view(), name='token'),
path('me/', views.ManageUserView.as_view(), name='me'),
] | 28.4 | 67 | 0.68662 |
fec8ee5ffb1b7c6a327b0731ab25d3b4909ffb54 | 9,496 | py | Python | utils/plot_utils.py | msieb1/LTCN | c9432891327774edf8193e885cc4f10f53fcaa60 | [
"MIT"
] | 1 | 2020-08-21T03:47:33.000Z | 2020-08-21T03:47:33.000Z | utils/plot_utils.py | msieb1/LTCN | c9432891327774edf8193e885cc4f10f53fcaa60 | [
"MIT"
] | null | null | null | utils/plot_utils.py | msieb1/LTCN | c9432891327774edf8193e885cc4f10f53fcaa60 | [
"MIT"
] | null | null | null | import datetime
import itertools
import os
import numpy as np
from pdb import set_trace
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from pdb import set_trace
def plot_split_count(counts_train, counts_test, path, name='split_count', save_figure=True, overwrite=True):
import matplotlib.py... | 37.09375 | 155 | 0.61984 |
af78851ae3d35243a32a9d7ac8b0ec23f0157102 | 10,276 | py | Python | src/uvm/seq/uvm_sequencer.py | rodrigomelo9/uvm-python | e3127eba2cc1519a61dc6f736d862a8dcd6fce20 | [
"Apache-2.0"
] | 140 | 2020-01-18T00:14:17.000Z | 2022-03-29T10:57:24.000Z | src/uvm/seq/uvm_sequencer.py | Mohsannaeem/uvm-python | 1b8768a1358d133465ede9cadddae651664b1d53 | [
"Apache-2.0"
] | 24 | 2020-01-18T18:40:58.000Z | 2021-03-25T17:39:07.000Z | src/uvm/seq/uvm_sequencer.py | Mohsannaeem/uvm-python | 1b8768a1358d133465ede9cadddae651664b1d53 | [
"Apache-2.0"
] | 34 | 2020-01-18T12:22:59.000Z | 2022-02-11T07:03:11.000Z | #//----------------------------------------------------------------------
#// Copyright 2007-2011 Mentor Graphics Corporation
#// Copyright 2007-2011 Cadence Design Systems, Inc.
#// Copyright 2010 Synopsys, Inc.
#// Copyright 2014 NVIDIA Corporation
#// Copyright 2019-2021 Tuomas Poikela (tpoikela)
#// All... | 33.802632 | 99 | 0.625535 |
e2367c3b3c5d2fd1b22f5af2201ffb2770ce4a9c | 3,975 | py | Python | assignments/2018/assignment2/cs231n/gradient_check.py | dpetrini/cs231n.github.io | 7dc3be43c523889eafebdef3dc65ef35aab69d16 | [
"MIT"
] | 2 | 2021-11-04T18:35:47.000Z | 2021-11-09T01:43:36.000Z | hw2/cs682/gradient_check.py | michael940716/CS682_LCN | 32ca389b642387b637422e4383c9e709779f9b4c | [
"MIT"
] | null | null | null | hw2/cs682/gradient_check.py | michael940716/CS682_LCN | 32ca389b642387b637422e4383c9e709779f9b4c | [
"MIT"
] | null | null | null | from __future__ import print_function
from builtins import range
#from past.builtins import xrange
import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
"""
a naive implementation of numerical gradient of f at x
- f should be a function that takes a si... | 30.576923 | 78 | 0.588428 |
47e9233ad594e27e559e049bc7d0a16c1d909729 | 3,206 | py | Python | _includes/vis_kode/euklids_algoritme copy.py | Andremartiny/AndreMartiny.github.io | 54d6ebadb735bc865ee152a59d6ee964a0cf9c0c | [
"MIT"
] | null | null | null | _includes/vis_kode/euklids_algoritme copy.py | Andremartiny/AndreMartiny.github.io | 54d6ebadb735bc865ee152a59d6ee964a0cf9c0c | [
"MIT"
] | null | null | null | _includes/vis_kode/euklids_algoritme copy.py | Andremartiny/AndreMartiny.github.io | 54d6ebadb735bc865ee152a59d6ee964a0cf9c0c | [
"MIT"
] | null | null | null |
# def FellesFaktorAv(a, b):
# while a != b:
# a, b = max(a, b), min(a, b) #Definerer x til å være den største av x og y.
# a = a - b
# return a
# def EuklidsMetodeForFellesFaktorAv(a, b):
# while a!= 0:
# a, b = max(a, b), min(a, b) #Definerer x til å være den største av x og y.
#... | 41.102564 | 178 | 0.538677 |
3ea86f9ae400ebc58053648c97439d8b2e382d8d | 1,718 | py | Python | tests/testUtils.py | ivanvladimir/ShiCo | e8566896bdc212a556675a0e3a6bbab522bd8271 | [
"Apache-2.0"
] | null | null | null | tests/testUtils.py | ivanvladimir/ShiCo | e8566896bdc212a556675a0e3a6bbab522bd8271 | [
"Apache-2.0"
] | 15 | 2018-09-27T12:58:19.000Z | 2020-04-14T11:39:15.000Z | tests/testUtils.py | ivanvladimir/ShiCo | e8566896bdc212a556675a0e3a6bbab522bd8271 | [
"Apache-2.0"
] | 1 | 2020-06-03T12:43:49.000Z | 2020-06-03T12:43:49.000Z | import unittest
from shico import utils as shU
import numpy as np
class TestUtils(unittest.TestCase):
'''Tests for utils'''
@classmethod
def setUpClass(self):
windowSize = 15
self.y1 = 1960
self.y2 = 1970
self.y0 = self.y1-windowSize
self.yN = self.y1+windowSize
... | 35.791667 | 78 | 0.574505 |
4f5bfd85920518554cf86cc03b71d1dfe7678f73 | 4,577 | py | Python | apphub/adversarial_training/ecc_hinge/ecc_hinge_tf.py | fastestimator/fastestimator | a8ea30c5da2d92ff8aa0de0084d10c86fb8dfd10 | [
"Apache-2.0"
] | 57 | 2019-05-21T21:29:26.000Z | 2022-02-23T05:55:21.000Z | apphub/adversarial_training/ecc_hinge/ecc_hinge_tf.py | fastestimator/fastestimator | a8ea30c5da2d92ff8aa0de0084d10c86fb8dfd10 | [
"Apache-2.0"
] | 93 | 2019-05-23T18:36:07.000Z | 2022-03-23T17:15:55.000Z | apphub/adversarial_training/ecc_hinge/ecc_hinge_tf.py | fastestimator/fastestimator | a8ea30c5da2d92ff8aa0de0084d10c86fb8dfd10 | [
"Apache-2.0"
] | 47 | 2019-05-09T15:41:37.000Z | 2022-03-26T17:00:08.000Z | # Copyright 2019 The FastEstimator 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 appl... | 44.436893 | 119 | 0.653048 |
17290ec9441e3710d21add89af52c722b1e1be64 | 24,978 | py | Python | tests/test_asg.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | tests/test_asg.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | tests/test_asg.py | ktravis/cloud-custodian | d5f61d8a09f8a37a85777b527ee87c363040fbd1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-2017 Capital One Services, 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 40.028846 | 83 | 0.56854 |
ba8d8f1529bb9705b02cc4d9d0567bb0141c4361 | 874 | py | Python | python/ethereum/etherscan/erc721.py | stoooops/potpourri | 07f38981766b6b4133f397109ac20ce2c6e2b76b | [
"MIT"
] | null | null | null | python/ethereum/etherscan/erc721.py | stoooops/potpourri | 07f38981766b6b4133f397109ac20ce2c6e2b76b | [
"MIT"
] | null | null | null | python/ethereum/etherscan/erc721.py | stoooops/potpourri | 07f38981766b6b4133f397109ac20ce2c6e2b76b | [
"MIT"
] | null | null | null | from typing import Dict
from potpourri.python.ethereum.etherscan.base import BaseEventDetailed
class ERC721Transfer(BaseEventDetailed):
def __init__(self, data: Dict[str, str]):
super().__init__(data=data)
assert self._input == "deprecated", f"Expected 'deprecated' value for 'input'. Got: '{self... | 27.3125 | 108 | 0.661327 |
dfcb7d260c7aa1ff061479c85cdde80bd5c89dd4 | 23,906 | py | Python | test/lib/ufe/testAttribute.py | fractal-picture/maya-usd | f86a2e64372c85d26dabc0c1214b6f315d5224c8 | [
"Apache-2.0"
] | null | null | null | test/lib/ufe/testAttribute.py | fractal-picture/maya-usd | f86a2e64372c85d26dabc0c1214b6f315d5224c8 | [
"Apache-2.0"
] | null | null | null | test/lib/ufe/testAttribute.py | fractal-picture/maya-usd | f86a2e64372c85d26dabc0c1214b6f315d5224c8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2019 Autodesk
#
# 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 ... | 38.495974 | 112 | 0.665523 |
f64a18f948b46bb54e0a595677b40a2c51263e4a | 4,003 | py | Python | jupyter/utils.py | perellonieto/background_check | a5b6549a62be276c7199e87e78a94a64af688ab9 | [
"MIT"
] | 4 | 2017-01-14T12:59:58.000Z | 2021-06-21T10:55:17.000Z | jupyter/utils.py | REFRAME/background_check | 7da967bad4a6d8cbc924b5301041f3c99ba39595 | [
"MIT"
] | null | null | null | jupyter/utils.py | REFRAME/background_check | 7da967bad4a6d8cbc924b5301041f3c99ba39595 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
from scipy.stats import norm
def draw_in_row(fruits, sizes):
indices = np.argsort(sizes)
sizes_sorted = sizes[indices]
fruits_sorted = fruits[indices]
images = map(Image.open, ['./images/'+fruit+'.jpg' for fruit in
... | 29.007246 | 78 | 0.605546 |
84244b56a7c76a183597267b03919b199281a95c | 1,111 | py | Python | oauth_toolkit_spa/views.py | oscarychen/django-oauth-toolkit-spa | d84059f4ae63330d3cf2d13c0988dd46dddcf154 | [
"MIT"
] | 4 | 2022-01-27T21:44:40.000Z | 2022-03-14T13:27:08.000Z | oauth_toolkit_spa/views.py | oscarychen/django-oauth-toolkit-spa | d84059f4ae63330d3cf2d13c0988dd46dddcf154 | [
"MIT"
] | 1 | 2022-01-19T16:28:50.000Z | 2022-01-19T17:08:29.000Z | oauth_toolkit_spa/views.py | oscarychen/django-oauth-toolkit-cookie-refresh | d84059f4ae63330d3cf2d13c0988dd46dddcf154 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework import permissions
from .mixins import OAuthToolKitMixin
class LogIn(APIView, OAuthToolKitMixin):
'''Log in API endpoint'''
permission_classes = [permissions.AllowAny]
def post(self, request, *args, **kwargs):
return self.get_login_resp... | 30.861111 | 116 | 0.737174 |
bb6fc7bcc9da1a079d81f5c405e44b7ae62bedef | 2,615 | py | Python | news.py | panliming0418/science | 1a5a04bcfadc10f71adb6025e675995b237f85af | [
"Apache-2.0"
] | null | null | null | news.py | panliming0418/science | 1a5a04bcfadc10f71adb6025e675995b237f85af | [
"Apache-2.0"
] | null | null | null | news.py | panliming0418/science | 1a5a04bcfadc10f71adb6025e675995b237f85af | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import json
def getHTMLText(url):
'''
获取网页的html文档
'''
try:
#添加请求头
#不同网页的请求头不同
headers = {
'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 M... | 30.057471 | 354 | 0.563671 |
2f9902bc93ef7fb4d482837412ad7ef7befd7580 | 54,442 | py | Python | configure.py | georgeslabreche/tensorflow-smartcamluvsu | dcccc9f756192c43c6d2af2d02249e518b3e0eb4 | [
"Apache-2.0"
] | 10 | 2021-04-29T16:31:02.000Z | 2021-08-10T13:17:55.000Z | configure.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 88 | 2020-11-24T08:18:10.000Z | 2022-03-25T20:28:30.000Z | configure.py | sseung0703/tensorflow | be084bd7a4dd241eb781fc704f57bcacc5c9b6dd | [
"Apache-2.0"
] | 9 | 2020-11-06T22:50:15.000Z | 2021-12-30T01:45:55.000Z | # Copyright 2017 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... | 36.246338 | 98 | 0.679861 |
fca0f4a99119fb440eb07c792c2cf14b29fa2529 | 3,516 | py | Python | tests/test_examples.py | jasonstrimpel/zipline | 21b4d3e2bbd32e1af5ded3e4834b007fe02bd83a | [
"Apache-2.0"
] | 1 | 2020-09-24T15:25:26.000Z | 2020-09-24T15:25:26.000Z | tests/test_examples.py | jasonstrimpel/zipline | 21b4d3e2bbd32e1af5ded3e4834b007fe02bd83a | [
"Apache-2.0"
] | null | null | null | tests/test_examples.py | jasonstrimpel/zipline | 21b4d3e2bbd32e1af5ded3e4834b007fe02bd83a | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 34.811881 | 76 | 0.670648 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.