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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bede1a634039ded6d50b19ffe133714751da4bcc | 3,023 | py | Python | baseline/model.py | minus31/vision_competition | adf652a16711946d5976ed3cd9b2470bd98e27f5 | [
"MIT"
] | null | null | null | baseline/model.py | minus31/vision_competition | adf652a16711946d5976ed3cd9b2470bd98e27f5 | [
"MIT"
] | null | null | null | baseline/model.py | minus31/vision_competition | adf652a16711946d5976ed3cd9b2470bd98e27f5 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torchvision.models as models
from efficientnet_pytorch import EfficientNet
class Baseline(nn.Module):
def __init__(self, hidden_size, out_size):
super().__init__()
self.net = nn.Sequential(
nn.Conv2d(in_channels=3, out_channels=hidden_size, ker... | 30.846939 | 99 | 0.594443 |
8d2aca29f447e745138a851cc81ebe6e4b6e60c4 | 580 | py | Python | apps/vscode/snippets/csharp_snippets.py | joshwcomeau/knausj_talon | b7ba05834699eb7337f6a6be7e5ba18a4ce6ffba | [
"Unlicense"
] | 1 | 2021-02-24T19:55:37.000Z | 2021-02-24T19:55:37.000Z | apps/vscode/snippets/csharp_snippets.py | joshwcomeau/knausj_talon | b7ba05834699eb7337f6a6be7e5ba18a4ce6ffba | [
"Unlicense"
] | null | null | null | apps/vscode/snippets/csharp_snippets.py | joshwcomeau/knausj_talon | b7ba05834699eb7337f6a6be7e5ba18a4ce6ffba | [
"Unlicense"
] | null | null | null | from talon import Context, actions, ui, Module, app
ctx = Context()
ctx.matches = r'''
app: Code
app: Code - OSS
app: Code
app: Visual Studio Code
app: Code.exe
mode: user.csharp
mode: command
and code.language: csharp
'''
#short name -> ide clip name
ctx.lists["user.snippets"] = {
#"funky": "def",
#"for": "f... | 21.481481 | 54 | 0.596552 |
e9e21b6815ba507f6ffd2ba6ae2ec5b51beb1b09 | 23,698 | py | Python | code/ch08/ch08.py | ergosfera1974/python-machine-learning-book-2nd-edition | ee85b8fe8551e16a9ac24ed294a37bfe5ff31bf2 | [
"MIT"
] | 6,947 | 2017-08-19T17:18:55.000Z | 2022-03-29T05:58:23.000Z | code/ch08/ch08.py | ergosfera1974/python-machine-learning-book-2nd-edition | ee85b8fe8551e16a9ac24ed294a37bfe5ff31bf2 | [
"MIT"
] | 94 | 2017-08-19T17:27:39.000Z | 2021-02-05T02:17:47.000Z | code/ch08/ch08.py | ergosfera1974/python-machine-learning-book-2nd-edition | ee85b8fe8551e16a9ac24ed294a37bfe5ff31bf2 | [
"MIT"
] | 2,771 | 2017-08-20T04:09:00.000Z | 2022-03-31T01:31:22.000Z | # coding: utf-8
import os
import sys
import tarfile
import time
import pyprind
import pandas as pd
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfTransformer
import re
from nltk.stem.porter import PorterStemmer
import nltk
from nltk.corp... | 32.596974 | 595 | 0.688286 |
4cf3c34f078754cc6aac9593b80f440f97c80085 | 5,036 | py | Python | src/lib/models/FPN_RFB_RON.py | TeleMidia/audio_reconstruction | 6fca53f6267081c7f9cdf04a1ff0faebda00f3a4 | [
"Apache-2.0"
] | 2 | 2021-10-16T01:39:19.000Z | 2022-01-06T15:53:10.000Z | src/lib/models/FPN_RFB_RON.py | TeleMidia/audio_reconstruction | 6fca53f6267081c7f9cdf04a1ff0faebda00f3a4 | [
"Apache-2.0"
] | null | null | null | src/lib/models/FPN_RFB_RON.py | TeleMidia/audio_reconstruction | 6fca53f6267081c7f9cdf04a1ff0faebda00f3a4 | [
"Apache-2.0"
] | 1 | 2021-11-25T16:59:16.000Z | 2021-11-25T16:59:16.000Z | import tensorflow as tf
from tensorflow.keras import Model
from tensorflow.keras.layers import Input, Conv2D, BatchNormalization, ReLU, Conv2DTranspose, MaxPool2D, UpSampling2D
from tensorflow.keras.activations import relu
class FPN_RFB_RON(Model):
def __init__(self):
super(FPN_RFB_RON, self).__init__()
... | 43.042735 | 129 | 0.664019 |
44b23e77c5dd2f110443fdcc65a4849cb64b6680 | 14,644 | py | Python | lib/workflow.py | bcarr15/bioblend-scripts | b53fc0b88e77dc6864ae6e0ddae23f46327922e8 | [
"MIT"
] | null | null | null | lib/workflow.py | bcarr15/bioblend-scripts | b53fc0b88e77dc6864ae6e0ddae23f46327922e8 | [
"MIT"
] | null | null | null | lib/workflow.py | bcarr15/bioblend-scripts | b53fc0b88e77dc6864ae6e0ddae23f46327922e8 | [
"MIT"
] | null | null | null | import os
import sys
import yaml
import json
from pprint import pprint
from planemo.runnable import for_path
from planemo.galaxy.workflows import install_shed_repos
import lib
import common
from bioblend.galaxy import GalaxyInstance
from common import connect
INVOCATIONS_DIR = "invocations"
METRICS_DIR = "metrics"
cl... | 34.701422 | 108 | 0.573409 |
7468bb0179c71da8d67d3ee366d97bdda226af45 | 4,098 | py | Python | app.py | olesyat/hotdogs | 965268e4cd57f1e3d2813905bad9a57230d4a0c9 | [
"MIT"
] | null | null | null | app.py | olesyat/hotdogs | 965268e4cd57f1e3d2813905bad9a57230d4a0c9 | [
"MIT"
] | null | null | null | app.py | olesyat/hotdogs | 965268e4cd57f1e3d2813905bad9a57230d4a0c9 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, redirect, request
import sqlite3
import mysql.connector
def get_connection():
return sqlite3.connect("HOTDOGS.db")
app = Flask(__name__)
@app.route('/')
def read():
connection = get_connection()
cursor = connection.cursor()
try:
cursor.execute(
... | 33.317073 | 248 | 0.582479 |
527213937fb6a54ace61f9072b8e54afe227418e | 588 | py | Python | lesson_06/Classwork_01.py | rotorypower/lessons | bd8f0d54159023e677608f2104e38d82de388fe4 | [
"BSD-3-Clause"
] | null | null | null | lesson_06/Classwork_01.py | rotorypower/lessons | bd8f0d54159023e677608f2104e38d82de388fe4 | [
"BSD-3-Clause"
] | null | null | null | lesson_06/Classwork_01.py | rotorypower/lessons | bd8f0d54159023e677608f2104e38d82de388fe4 | [
"BSD-3-Clause"
] | null | null | null | """Дан словарь, где в качестве ключей английские слова,
а значений - их перевод на русский язык. Написать две функции,
одна переводит слово с английского на русский,
где слово - это входной параметр, вторая функция - с русского на английский."""
def translate_en_to_ru(d, word):
return d[word]
def translate_ru_t... | 28 | 79 | 0.685374 |
9670329cd8ca18f5169d08606f9b8f6edaa373c8 | 2,685 | py | Python | saas/backend/api/application/views.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/api/application/views.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | saas/backend/api/application/views.py | nannan00/bk-iam-saas | 217600fa6e5fd466fff9c33c20c4dbd7c69f77d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with th... | 40.074627 | 115 | 0.766853 |
5c9a59564d9c28581679d503828a81df1093ef75 | 1,946 | py | Python | examples/echo_server/topology.py | GianGian/SDN-Slicing-in-ComNetsEmu | 4fded82ee61f948fc5ebb11a668fbcbd526afbb0 | [
"MIT"
] | null | null | null | examples/echo_server/topology.py | GianGian/SDN-Slicing-in-ComNetsEmu | 4fded82ee61f948fc5ebb11a668fbcbd526afbb0 | [
"MIT"
] | null | null | null | examples/echo_server/topology.py | GianGian/SDN-Slicing-in-ComNetsEmu | 4fded82ee61f948fc5ebb11a668fbcbd526afbb0 | [
"MIT"
] | 1 | 2020-04-20T10:42:03.000Z | 2020-04-20T10:42:03.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
from comnetsemu.cli import CLI, spawnXtermDocker
from comnetsemu.net import Containernet, VNFManager
from mininet.link import TCLink
from mininet.log import info, setLogLevel
from mininet.node import Controller
if __name__ == "__main__":
# Only used for ... | 29.484848 | 79 | 0.631038 |
4871bec789f655eea5b7a7dd58ba886ff517928f | 302 | py | Python | collectionmodeladmin/templatetags/collectionmodeladmin_tags.py | BabisK/wagtail-collectionmodeladmin | 9e1b6e0fecaafbdb473e5f9048ce9390926c9726 | [
"BSD-3-Clause"
] | null | null | null | collectionmodeladmin/templatetags/collectionmodeladmin_tags.py | BabisK/wagtail-collectionmodeladmin | 9e1b6e0fecaafbdb473e5f9048ce9390926c9726 | [
"BSD-3-Clause"
] | null | null | null | collectionmodeladmin/templatetags/collectionmodeladmin_tags.py | BabisK/wagtail-collectionmodeladmin | 9e1b6e0fecaafbdb473e5f9048ce9390926c9726 | [
"BSD-3-Clause"
] | null | null | null | from django.template import Library
register = Library()
@register.filter(name='get_app_name')
def get_app_name(d):
return d._meta.app_label
@register.filter(name='get_model_name')
def get_model_name(d):
return d._meta.model_name
@register.simple_tag
def setvar(val=None):
return val | 16.777778 | 39 | 0.754967 |
f3ccc33df11ed47776989bbe09c3c3cfeb419fb4 | 2,204 | py | Python | algorithm_mic_sdk/ws/speech_recognition_chinese.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | algorithm_mic_sdk/ws/speech_recognition_chinese.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | algorithm_mic_sdk/ws/speech_recognition_chinese.py | panyunsuo/AlgorithmicMicroserviceSDK | e7094a0a2a55b7bc7f65765bfb3918fc1fa305cc | [
"MIT"
] | null | null | null | import base64
import json
import time
from ..auth import AuthInfo
from ..ws_base import WSAlgoBase
def build_data_stream_source(data_stream_iterator):
def on_open(ws):
for stream in data_stream_iterator:
if isinstance(stream, bytes):
part = base64.b64encode(stream).decode()
... | 37.355932 | 109 | 0.666062 |
546124bbee899348e7519ce50f28017a698ba963 | 7,027 | py | Python | python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py | Ray2020BD/Paddle | 994087188816575d456c2f9c2a6c90aad83b4e71 | [
"Apache-2.0"
] | 2 | 2020-12-09T16:09:59.000Z | 2020-12-09T16:10:02.000Z | python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py | Ray2020BD/Paddle | 994087188816575d456c2f9c2a6c90aad83b4e71 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_buffer_shared_memory_reuse_pass.py | Ray2020BD/Paddle | 994087188816575d456c2f9c2a6c90aad83b4e71 | [
"Apache-2.0"
] | 1 | 2021-03-23T00:59:48.000Z | 2021-03-23T00:59:48.000Z | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.790576 | 83 | 0.608652 |
36be95c85ac9e3a964d98555ddb93bbe3d6c3cc6 | 734 | py | Python | tests/utils.py | immunochomik/notmany | 7b75c35cac2c3d0e465402099bcaa469924c7ca2 | [
"MIT"
] | null | null | null | tests/utils.py | immunochomik/notmany | 7b75c35cac2c3d0e465402099bcaa469924c7ca2 | [
"MIT"
] | null | null | null | tests/utils.py | immunochomik/notmany | 7b75c35cac2c3d0e465402099bcaa469924c7ca2 | [
"MIT"
] | null | null | null | import contextlib
import tempfile
from datetime import datetime, timedelta
import os
import shutil
from uuid import uuid4
from notmany.store.base import FORMAT
def dt(date):
return datetime.strptime(date, FORMAT)
@contextlib.contextmanager
def temporary_directory(sub_name=None):
sub_name = sub_name or st... | 18.35 | 59 | 0.692098 |
e4de733e5c0ae2e4678e9cda8d9bbc096dd360a5 | 594 | py | Python | server/grpc/pyserver.py | Panthereum/DigitalBeing | 7fda011f34dd62c03d1072035ae0ad2a129281a7 | [
"MIT"
] | 53 | 2021-07-20T04:01:57.000Z | 2022-03-13T17:31:08.000Z | server/grpc/pyserver.py | Panthereum/DigitalBeing | 7fda011f34dd62c03d1072035ae0ad2a129281a7 | [
"MIT"
] | 58 | 2021-08-20T02:22:16.000Z | 2021-12-13T10:38:58.000Z | server/grpc/pyserver.py | Panthereum/DigitalBeing | 7fda011f34dd62c03d1072035ae0ad2a129281a7 | [
"MIT"
] | 13 | 2021-08-23T20:16:14.000Z | 2022-01-31T23:59:21.000Z | import logging
import time
# import the original example.py
from handler import DigitalBeing as DB
logger = logging.getLogger('server_logger')
logger.setLevel(logging.DEBUG)
# create file handler which logs even debug messages
fh = logging.FileHandler('grpc_server.log')
fh.setLevel(logging.DEBUG)
logger.addHandler(f... | 22.846154 | 61 | 0.754209 |
6b9ca5a84a2b459f045547f6ffced3af8e3631fb | 5,430 | py | Python | MobileRevelator/python/fs_nqvault.py | ohunecker/MR | b0c93436c7964d87a0b8154f8b7662b1731124b9 | [
"MIT"
] | 98 | 2019-02-03T22:50:24.000Z | 2022-03-17T12:50:56.000Z | MobileRevelator/python/fs_nqvault.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 10 | 2019-03-14T20:12:10.000Z | 2020-05-23T10:37:54.000Z | MobileRevelator/python/fs_nqvault.py | cewatkins/MR | 5ba553fd0eb4c1d80842074a553119486f005822 | [
"MIT"
] | 30 | 2019-02-03T22:50:27.000Z | 2022-03-30T12:37:30.000Z | #Pluginname="NQ Vault (Android,FS)"
#Category="Extraction"
#Type=FS
import struct
import os
import tempfile
from Library.java import JavaFunc
from binascii import hexlify, unhexlify
def findnqvault():
#Lets see where the nq vault files are
ctx.gui_setMainLabel("Seeking for NQ Vault database")
result={... | 29.037433 | 98 | 0.671455 |
6d7d7123e339a9523e4fa08e5b23ade6729d1582 | 1,040 | py | Python | merlin/models/utils/nvt_utils.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | 45 | 2022-02-01T20:27:18.000Z | 2022-03-29T10:06:53.000Z | merlin/models/utils/nvt_utils.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | 142 | 2022-02-01T22:19:04.000Z | 2022-03-31T23:13:08.000Z | merlin/models/utils/nvt_utils.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | 12 | 2022-02-01T19:54:28.000Z | 2022-03-23T17:53:29.000Z | import logging
def require_nvt():
try:
import nvtabular as nvt # noqa
backend = None
try:
import tensorflow as tf
backend = tf
if tf.test.is_gpu_available():
_check_nvt_gpu()
except ImportError:
pass
if n... | 22.12766 | 74 | 0.518269 |
c32020963db7e585e8acd5bcf02594f18bf1af76 | 26,872 | py | Python | cvpysdk/subclients/virtualserver/vmwaresubclient.py | jack1806/cvpysdk | 6aa0beb426a95de877cd531602234515723ccc94 | [
"Apache-2.0"
] | 1 | 2021-02-27T05:31:38.000Z | 2021-02-27T05:31:38.000Z | cvpysdk/subclients/virtualserver/vmwaresubclient.py | jack1806/cvpysdk | 6aa0beb426a95de877cd531602234515723ccc94 | [
"Apache-2.0"
] | null | null | null | cvpysdk/subclients/virtualserver/vmwaresubclient.py | jack1806/cvpysdk | 6aa0beb426a95de877cd531602234515723ccc94 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Copyright Commvault Systems, Inc.
# See LICENSE.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""File for operating on a Vir... | 44.052459 | 124 | 0.500037 |
cce936e48cd1ac83b848d242a5b412e47d6452f8 | 2,365 | py | Python | voctocore/lib/tcpmulticonnection.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 521 | 2015-01-07T21:43:30.000Z | 2022-03-17T22:07:13.000Z | voctocore/lib/tcpmulticonnection.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 241 | 2015-05-27T10:11:09.000Z | 2022-02-11T03:29:20.000Z | voctocore/lib/tcpmulticonnection.py | 0xflotus/voctomix | 3156f3546890e6ae8d379df17e5cc718eee14b15 | [
"MIT"
] | 111 | 2015-08-13T20:06:52.000Z | 2022-03-11T09:48:46.000Z | import logging
import socket
import sys
from queue import Queue
from abc import ABCMeta, abstractmethod
from gi.repository import GObject
class TCPMultiConnection(object, metaclass=ABCMeta):
def __init__(self, port):
if not hasattr(self, 'log'):
self.log = logging.getLogger('TCPMultiConnectio... | 32.39726 | 147 | 0.612262 |
3c5d70e08ebe2600901ea97dd1e5635afcab25c4 | 3,279 | py | Python | contrib/zmq/zmq_sub3.4.py | rocheston/rosecoin | 5ea5390fc250bae8fdea9667eae760bbf6225f8c | [
"MIT"
] | 4 | 2020-12-15T02:44:30.000Z | 2022-03-24T13:09:20.000Z | contrib/zmq/zmq_sub3.4.py | Penny-Admixture/rosecoin | 5ea5390fc250bae8fdea9667eae760bbf6225f8c | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub3.4.py | Penny-Admixture/rosecoin | 5ea5390fc250bae8fdea9667eae760bbf6225f8c | [
"MIT"
] | 1 | 2021-05-02T23:07:21.000Z | 2021-05-02T23:07:21.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
RoseCoin should be started with the command line argumen... | 36.433333 | 107 | 0.648978 |
4b354fc42a634ba6c09c1a3d6a8b062296c19685 | 295 | py | Python | record/templatetags/record_extras.py | souper-streetwise/charity_data | 6d91d4b3d635dad868a5eabab94bbb20eea3d082 | [
"MIT"
] | 3 | 2020-02-05T06:42:15.000Z | 2020-02-17T14:39:58.000Z | record/templatetags/record_extras.py | souper-streetwise/charity_data | 6d91d4b3d635dad868a5eabab94bbb20eea3d082 | [
"MIT"
] | 8 | 2020-02-03T19:25:18.000Z | 2021-03-10T22:30:58.000Z | record/templatetags/record_extras.py | souper-streetwise/charity_data | 6d91d4b3d635dad868a5eabab94bbb20eea3d082 | [
"MIT"
] | null | null | null | from django import template
register = template.Library()
@register.inclusion_tag("record/bulk_entry.html", takes_context=True)
def bulk_entry(context):
return context
@register.inclusion_tag("record/clicker_entry.html", takes_context=True)
def clicker_entry(context):
return context
| 24.583333 | 72 | 0.79661 |
f57af5cdf19bb2746aa142a74a365237100994f8 | 6,571 | py | Python | ownphotos/settings.py | robertcontois/librephotos | 42f5ebc4f286e3da0bcadfc05004622b46ec3f29 | [
"MIT"
] | null | null | null | ownphotos/settings.py | robertcontois/librephotos | 42f5ebc4f286e3da0bcadfc05004622b46ec3f29 | [
"MIT"
] | null | null | null | ownphotos/settings.py | robertcontois/librephotos | 42f5ebc4f286e3da0bcadfc05004622b46ec3f29 | [
"MIT"
] | null | null | null | """
Django settings for ownphotos project.
Generated by 'django-admin startproject' using Django 1.11.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | 26.820408 | 83 | 0.681327 |
2a707051bebad818283dfad295b6fcc2d749c457 | 4,495 | py | Python | data-processing/converter_in.py | Ali-RT/Transit-Logic | ca812184d31b884b26173a506649c4b2828f0502 | [
"Apache-2.0"
] | null | null | null | data-processing/converter_in.py | Ali-RT/Transit-Logic | ca812184d31b884b26173a506649c4b2828f0502 | [
"Apache-2.0"
] | null | null | null | data-processing/converter_in.py | Ali-RT/Transit-Logic | ca812184d31b884b26173a506649c4b2828f0502 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Kafka deserializer
"""
__author__ = 'Ali Rahim-Taleqani'
__copyright__ = 'Copyright 2020, The Insight Data Engineering'
__credits__ = [""]
__version__ = '0.2'
__maintainer__ = 'Ali Rahim-Taleqani'
__email__ = 'ali.rahim.taleani@gmail.com'
__status__ = 'Development'
import asyncio
import json
... | 32.107143 | 99 | 0.639377 |
3c738e3b5ff1849fdf669ee71bcf176fc0d62929 | 2,641 | py | Python | NUMPY-SKILLS/code.py | Manpreet1377/ga-learner-dst-repo | b712886472c8dc88e266494adb5c24f0a9987014 | [
"MIT"
] | null | null | null | NUMPY-SKILLS/code.py | Manpreet1377/ga-learner-dst-repo | b712886472c8dc88e266494adb5c24f0a9987014 | [
"MIT"
] | null | null | null | NUMPY-SKILLS/code.py | Manpreet1377/ga-learner-dst-repo | b712886472c8dc88e266494adb5c24f0a9987014 | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
print("STEP 1: LOAD DATA TO NUMPY ARRAY AND A... | 34.75 | 158 | 0.698978 |
8aa101ca2f5205e7605335e41ff73b2c8ae80709 | 4,462 | py | Python | tests/components/homematicip_cloud/test_alarm_control_panel.py | rwbr/home-assistant | 58e3e2105a6e142fffc39f3a68c46e1d3c861910 | [
"Apache-2.0"
] | 1 | 2020-02-15T09:18:14.000Z | 2020-02-15T09:18:14.000Z | tests/components/homematicip_cloud/test_alarm_control_panel.py | rwbr/home-assistant | 58e3e2105a6e142fffc39f3a68c46e1d3c861910 | [
"Apache-2.0"
] | null | null | null | tests/components/homematicip_cloud/test_alarm_control_panel.py | rwbr/home-assistant | 58e3e2105a6e142fffc39f3a68c46e1d3c861910 | [
"Apache-2.0"
] | null | null | null | """Tests for HomematicIP Cloud alarm control panel."""
from homeassistant.components.alarm_control_panel import (
DOMAIN as ALARM_CONTROL_PANEL_DOMAIN,
)
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_... | 38.136752 | 88 | 0.732631 |
e12c0a69d43979013e741fc81714ee98bc556536 | 1,166 | py | Python | configs/celeba.py | yeshwanthv5/PruneFL | ad1f7f33b0605d1d79abfbe42ef287fcc613a943 | [
"MIT"
] | 6 | 2021-07-01T05:35:08.000Z | 2022-03-04T18:53:31.000Z | configs/celeba.py | yeshwanthv5/PruneFL | ad1f7f33b0605d1d79abfbe42ef287fcc613a943 | [
"MIT"
] | null | null | null | configs/celeba.py | yeshwanthv5/PruneFL | ad1f7f33b0605d1d79abfbe42ef287fcc613a943 | [
"MIT"
] | 1 | 2021-06-21T14:24:47.000Z | 2021-06-21T14:24:47.000Z | EXP_NAME = "CelebA"
IMG_DIM = (218, 178)
NUM_FEATURES = 218 * 178
NUM_CLASSES = 2
NUM_TRAIN_DATA = 177457
NUM_TEST_DATA = 22831
NUM_USERS = 9343
NUM_CLIENTS = 10
NUM_LOCAL_UPDATES = 5
CLIENT_BATCH_SIZE = 20
INIT_LR = 0.001
# Conv4
DENSE_TIME = 3.724286518478766
SPARSE_ALL_TIME = 2.66478774077259
SPA... | 22.423077 | 118 | 0.740995 |
b2aa814c50b27635c411c4d9e5e064b577c89245 | 4,996 | py | Python | Sample_Run/path_attn_Q/Config.py | yashchandak/GNN | 818d1aa25bd50a65bff3577758306d2e6c591100 | [
"MIT"
] | 1 | 2018-07-13T05:50:48.000Z | 2018-07-13T05:50:48.000Z | Sample_Run/path_attn_Q/Config.py | yashchandak/GNN | 818d1aa25bd50a65bff3577758306d2e6c591100 | [
"MIT"
] | null | null | null | Sample_Run/path_attn_Q/Config.py | yashchandak/GNN | 818d1aa25bd50a65bff3577758306d2e6c591100 | [
"MIT"
] | null | null | null | import tensorflow as tf
import sys, os, shutil
class Config(object):
def __init__(self, args):
self.codebase_root_path = args.path
sys.path.insert(0, self.codebase_root_path)
#### Directory paths ####
# Folder name and project name is the same
self.project_name = args.pro... | 39.650794 | 181 | 0.611689 |
6de49fc447ccb81c97d36a41c8a030b2778b0b3c | 8,720 | py | Python | userbot/modules/system_stats.py | teye01/OUBnew | 5654dae797496afa0b3a70bef39c4f69e8c8a071 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-06-03T19:19:25.000Z | 2020-06-03T19:19:25.000Z | userbot/modules/system_stats.py | teye01/OUBnew | 5654dae797496afa0b3a70bef39c4f69e8c8a071 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/system_stats.py | teye01/OUBnew | 5654dae797496afa0b3a70bef39c4f69e8c8a071 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-05-04T16:18:52.000Z | 2020-05-04T16:18:52.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for getting information about the server. """
from asyncio import create_subprocess_exec as asyncru... | 36.333333 | 85 | 0.511239 |
48808b7a4c6f8b6cdb635a933a552799c8e9a5de | 1,364 | py | Python | rdmo/conditions/tests/test_views.py | hafu/rdmo | 06ea034f7ffa0fbc1fd360be75d3031b038907af | [
"Apache-2.0"
] | null | null | null | rdmo/conditions/tests/test_views.py | hafu/rdmo | 06ea034f7ffa0fbc1fd360be75d3031b038907af | [
"Apache-2.0"
] | null | null | null | rdmo/conditions/tests/test_views.py | hafu/rdmo | 06ea034f7ffa0fbc1fd360be75d3031b038907af | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from test_generator.views import TestListViewMixin
from rdmo.core.testing.mixins import TestExportViewMixin, TestImportViewMixin
from rdmo.accounts.utils import set_group_permissions
class ConditionsViewTestCase(TestCase):
fixtures = (
'users.json',
'groups.json... | 25.259259 | 107 | 0.587977 |
66d412e154c0204b99dfb5f00808af6e009a0ea5 | 675 | py | Python | django_for_professionals/project_3_bookstore/manage.py | rednafi/django-unchained | 0f71c8d056699496d4af3ab049f9b2f9d057486b | [
"MIT"
] | 1 | 2020-07-25T18:06:56.000Z | 2020-07-25T18:06:56.000Z | django_for_professionals/project_3_bookstore/manage.py | rednafi/django-unchained | 0f71c8d056699496d4af3ab049f9b2f9d057486b | [
"MIT"
] | null | null | null | django_for_professionals/project_3_bookstore/manage.py | rednafi/django-unchained | 0f71c8d056699496d4af3ab049f9b2f9d057486b | [
"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", "project_3_bookstore.settings")
try:
from django.core.management import execute_from_command_line
... | 29.347826 | 83 | 0.684444 |
d8c8c282ee6d0de5b6ae3ce90750a5791695f960 | 602 | py | Python | conanfile.py | czoido/libA | f73b203fea64ea8d0773dc21f01d55bd68612eaf | [
"MIT"
] | null | null | null | conanfile.py | czoido/libA | f73b203fea64ea8d0773dc21f01d55bd68612eaf | [
"MIT"
] | null | null | null | conanfile.py | czoido/libA | f73b203fea64ea8d0773dc21f01d55bd68612eaf | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake
class LibA(ConanFile):
name = "libA"
version = "0.0"
settings = "os", "arch", "compiler", "build_type"
options = {"shared": [True, False]}
default_options = {"shared": False}
generators = "cmake"
scm = {"type": "git",
"url": "auto",
... | 21.5 | 53 | 0.548173 |
f8991d1038a5cc4dd67c9578dadd31ce1d94ce17 | 4,010 | py | Python | venv/Lib/site-packages/webargs/fields.py | nwrocketman64/JKWWOODWORKS-codebase | 81b49a6cddf3ded9166925cc7d4b5717a7ee45f0 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/webargs/fields.py | nwrocketman64/JKWWOODWORKS-codebase | 81b49a6cddf3ded9166925cc7d4b5717a7ee45f0 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/webargs/fields.py | nwrocketman64/JKWWOODWORKS-codebase | 81b49a6cddf3ded9166925cc7d4b5717a7ee45f0 | [
"MIT"
] | null | null | null | """Field classes.
Includes all fields from `marshmallow.fields` in addition to a custom
`Nested` field and `DelimitedList`.
All fields can optionally take a special `location` keyword argument, which
tells webargs where to parse the request argument from.
.. code-block:: python
args = {
"active": fields... | 34.273504 | 86 | 0.681047 |
0c73247b97a402d8834d79cbfed139ffb5109296 | 5,350 | py | Python | dayu_widgets3/toast.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 5 | 2020-10-16T03:46:47.000Z | 2022-03-21T07:10:37.000Z | dayu_widgets3/toast.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | null | null | null | dayu_widgets3/toast.py | muyr/dayu_widgets3 | a319cc719d84c031829893c45b8f20e87cbbabc8 | [
"MIT"
] | 1 | 2022-02-16T14:18:43.000Z | 2022-02-16T14:18:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###################################################################
# Author: Mu yanru
# Date : 2019.2
# Email : muyanru345@163.com
###################################################################
"""
MToast
"""
from dayu_widgets3 import dayu_theme
from dayu_widgets3.av... | 34.294872 | 100 | 0.630654 |
1a3830f06fd11d43b5c683b0f9a95332a16a4801 | 12,156 | py | Python | vaxapp/migrations/0016_auto__chg_field_alert_text.py | ewheeler/vaxtrack | 57191d5ae5626c944d765071f9a1d1fddfaad068 | [
"BSD-3-Clause"
] | 1 | 2015-03-28T17:00:54.000Z | 2015-03-28T17:00:54.000Z | vaxapp/migrations/0016_auto__chg_field_alert_text.py | ewheeler/vaxtrack | 57191d5ae5626c944d765071f9a1d1fddfaad068 | [
"BSD-3-Clause"
] | null | null | null | vaxapp/migrations/0016_auto__chg_field_alert_text.py | ewheeler/vaxtrack | 57191d5ae5626c944d765071f9a1d1fddfaad068 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Alert.text'
db.alter_column('vaxapp_alert', 'text', self.gf('django.db.models.fields.Cha... | 77.426752 | 185 | 0.556022 |
2a32f4f4e03bef6cb405cb53ddfcd9a188cafd63 | 2,614 | py | Python | syntropy_sdk/models/settings_types.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | 1 | 2020-12-17T17:30:12.000Z | 2020-12-17T17:30:12.000Z | syntropy_sdk/models/settings_types.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | syntropy_sdk/models/settings_types.py | SyntropyNet/syntropy-python-sdk | 27b7756b136f83886fd2a6e342fa4d4073779ff7 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
syntropy-controller
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
imp... | 28.413043 | 119 | 0.546289 |
4a97ef5eb6cc52ab14a9b684c78284219e1b1898 | 2,370 | py | Python | airflow/api_connexion/schemas/pool_schema.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | airflow/api_connexion/schemas/pool_schema.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | airflow/api_connexion/schemas/pool_schema.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 30.384615 | 72 | 0.715612 |
a21d9c1865e64f938c1d68099e9b9f8367cbd778 | 1,194 | py | Python | drf_elasticsearch_dsl/management/commands/update_index.py | ajbeach2/drf-elasticsearch-dsl | 2b55a295ece0438d6dd0ac92e291d0a69deb66ca | [
"MIT"
] | 3 | 2017-12-27T01:10:53.000Z | 2019-04-12T02:11:41.000Z | drf_elasticsearch_dsl/management/commands/update_index.py | ajbeach2/drf-elasticsearch-dsl | 2b55a295ece0438d6dd0ac92e291d0a69deb66ca | [
"MIT"
] | 5 | 2020-06-05T17:49:44.000Z | 2021-06-10T20:35:59.000Z | drf_elasticsearch_dsl/management/commands/update_index.py | ajbeach2/drf-elasticsearch-dsl | 2b55a295ece0438d6dd0ac92e291d0a69deb66ca | [
"MIT"
] | null | null | null | import multiprocessing
from django import db
from drf_elasticsearch_dsl.connection_handler import connection_handler
from django.core.management.base import BaseCommand
DEFAULT_BATCH_SIZE = 500
DEFAULT_WORKERS = 4
def worker(args):
document, model, start, end = args
db.connections.close_all()
row = model... | 31.421053 | 71 | 0.657454 |
ce0f933d57a36e8b6d980f5b604d255517547bc4 | 333 | py | Python | aws-pentesting-with-python/kms/correct/kms_client.py | qodirovshohijahon/python-scripting | 08f8492e137df37e7f9b41e9ee546f5783501c1a | [
"CNRI-Python"
] | null | null | null | aws-pentesting-with-python/kms/correct/kms_client.py | qodirovshohijahon/python-scripting | 08f8492e137df37e7f9b41e9ee546f5783501c1a | [
"CNRI-Python"
] | null | null | null | aws-pentesting-with-python/kms/correct/kms_client.py | qodirovshohijahon/python-scripting | 08f8492e137df37e7f9b41e9ee546f5783501c1a | [
"CNRI-Python"
] | null | null | null | import os
import boto3
def kmsClient():
kmsClient = boto3.client(
"kms",
aws_access_key_id=os.environ["AWS_ACCESS_KEY_ID"],
aws_secret_access_key=os.environ["AWS_SECRET_ACCESS_KEY"],
region_name=os.environ["AWS_REGION"],
)
return kmsClient
# print(os.environ["AWS_SECRET_... | 20.8125 | 66 | 0.684685 |
8c8b411a4809be8e8b899e318bdfd05a3188a4b6 | 1,651 | py | Python | components/job-orchestration/job_orchestration/scheduler/scheduler_data.py | kirkrodrigues/clp | bb81eec43da218a5fa3f3a367e0a24c144bdf0c8 | [
"Apache-2.0"
] | 28 | 2021-07-18T02:21:14.000Z | 2021-09-30T22:46:24.000Z | components/job-orchestration/job_orchestration/scheduler/scheduler_data.py | kirkrodrigues/clp | bb81eec43da218a5fa3f3a367e0a24c144bdf0c8 | [
"Apache-2.0"
] | 15 | 2021-10-12T03:55:07.000Z | 2022-03-24T09:04:35.000Z | components/job-orchestration/job_orchestration/scheduler/scheduler_data.py | kirkrodrigues/clp | bb81eec43da218a5fa3f3a367e0a24c144bdf0c8 | [
"Apache-2.0"
] | 11 | 2021-10-06T11:35:47.000Z | 2022-03-20T11:40:49.000Z | import datetime
import json
import typing
from typing import Dict
import msgpack
import zstandard
from celery.result import AsyncResult
from pydantic import BaseModel, validator
class TaskUpdate(BaseModel):
job_id: int
task_id: int
status: str
@validator('status')
def valid_status(cls, field):
... | 25.796875 | 90 | 0.710478 |
40fd5d1eef21c92e7871de5294755f81c75b76a6 | 679 | py | Python | tutorials/W3D3_NetworkCausality/solutions/W3D3_Tutorial4_Solution_d89caba5.py | himahuja/course-content | f3e17aedf722c818708b83b213a267682a238194 | [
"CC-BY-4.0"
] | null | null | null | tutorials/W3D3_NetworkCausality/solutions/W3D3_Tutorial4_Solution_d89caba5.py | himahuja/course-content | f3e17aedf722c818708b83b213a267682a238194 | [
"CC-BY-4.0"
] | null | null | null | tutorials/W3D3_NetworkCausality/solutions/W3D3_Tutorial4_Solution_d89caba5.py | himahuja/course-content | f3e17aedf722c818708b83b213a267682a238194 | [
"CC-BY-4.0"
] | null | null | null | def fit_second_stage(T_hat,Y):
"""
Estimates a scalar causal effect from 2-stage least squares regression using
an instrument.
Args:
T_hat (np.ndarray): the output of the first stage regression
Y (np.ndarray): our observed response (n, 1)
Returns:
beta (float): the estimate... | 27.16 | 80 | 0.681885 |
17b5abe5c85726e6286e4d5591bf7967b0e78944 | 3,479 | py | Python | db/migrations/0001_initial.py | housepig7/ops | ed1dc6f6e160e2a4a414c1eeeee78ded02597013 | [
"Apache-2.0"
] | null | null | null | db/migrations/0001_initial.py | housepig7/ops | ed1dc6f6e160e2a4a414c1eeeee78ded02597013 | [
"Apache-2.0"
] | null | null | null | db/migrations/0001_initial.py | housepig7/ops | ed1dc6f6e160e2a4a414c1eeeee78ded02597013 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-11 01:13
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
('asset', '0001_initial'),
]
operations... | 51.161765 | 166 | 0.592986 |
e3cf06aea46c71154f220b43eb60c06a52a0c6e6 | 5,632 | py | Python | tests/test_file.py | sebastianmika/dollar-ref | 9b067c8a32ac86a5c90f6c2377725cd52b039a29 | [
"MIT"
] | 11 | 2017-11-20T05:37:07.000Z | 2020-07-24T04:19:31.000Z | tests/test_file.py | sebastianmika/dollar-ref | 9b067c8a32ac86a5c90f6c2377725cd52b039a29 | [
"MIT"
] | 8 | 2017-11-18T15:13:24.000Z | 2021-06-01T13:24:29.000Z | tests/test_file.py | sebastianmika/dollar-ref | 9b067c8a32ac86a5c90f6c2377725cd52b039a29 | [
"MIT"
] | 8 | 2017-11-18T14:57:36.000Z | 2020-03-30T09:11:22.000Z | import json
import yaml
from dollar_ref import resolve
def test_basic(tmpdir):
root_dir = tmpdir.mkdir('root_dir')
root_doc = root_dir.join('root.json')
file_data = {
'some': 'in_file_data'
}
root_doc.write(json.dumps(file_data))
data = {
'inline': 'data',
'file_ref... | 20.782288 | 78 | 0.489347 |
a07241156757f6190126196d2c44acdd9a1500f1 | 687 | py | Python | mattermost_giphy/settings.py | hoplaventure/mattermost-integration-giphy | e495f942a77609c6381f743847fc8b7638c2733f | [
"Apache-2.0"
] | 1 | 2018-11-19T21:13:58.000Z | 2018-11-19T21:13:58.000Z | mattermost_giphy/settings.py | hoplaventure/mattermost-integration-giphy | e495f942a77609c6381f743847fc8b7638c2733f | [
"Apache-2.0"
] | null | null | null | mattermost_giphy/settings.py | hoplaventure/mattermost-integration-giphy | e495f942a77609c6381f743847fc8b7638c2733f | [
"Apache-2.0"
] | 3 | 2018-12-01T15:00:25.000Z | 2021-12-22T07:47:30.000Z | # -*- coding: utf-8 -*-
import os
# username the bot posts as
USERNAME = os.environ.get('USERNAME', 'giphy')
# display picture the bot posts with
ICON_URL = os.environ.get('ICON_URL', 'https://avatars0.githubusercontent.com/u/3588525?v=3&s=200')
# the maximum parental rating of gifs posted
RATING = os.environ.get('R... | 32.714286 | 99 | 0.745269 |
23b6468b6b41e661947ce3f6179d46d612905fbf | 2,389 | py | Python | src/optical_flow.py | avaneesh93/frame-prediction | c7f45fed3651bd8fc7e2db1a88eefb8a8057f117 | [
"MIT"
] | 1 | 2020-07-08T10:20:22.000Z | 2020-07-08T10:20:22.000Z | src/optical_flow.py | avaneesh93/frame-prediction | c7f45fed3651bd8fc7e2db1a88eefb8a8057f117 | [
"MIT"
] | null | null | null | src/optical_flow.py | avaneesh93/frame-prediction | c7f45fed3651bd8fc7e2db1a88eefb8a8057f117 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Dec 2 13:54:01 2018
@author: roshanprakash
"""
import numpy as np
import cv2 as cv
def compute_optical_flow(x):
""" Computes a multi-layered dense optical flow output from a sequence of images first. \
Next, the average optical ... | 39.816667 | 126 | 0.63918 |
fc0bf1d74989bb9ffe8331aede12ab7fd98b6006 | 38,697 | py | Python | tests/nlu/test_evaluation.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 1 | 2022-03-03T16:11:02.000Z | 2022-03-03T16:11:02.000Z | tests/nlu/test_evaluation.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 250 | 2020-08-14T13:41:26.000Z | 2022-03-28T12:10:13.000Z | tests/nlu/test_evaluation.py | fintzd/rasa | 6359be5509c7d87cd29c2ab5149bc45e843fea85 | [
"Apache-2.0"
] | 1 | 2021-12-03T13:04:55.000Z | 2021-12-03T13:04:55.000Z | import json
import os
import sys
import textwrap
from pathlib import Path
from typing import Text, List, Dict, Any, Set
from rasa.core.agent import Agent
from rasa.core.channels import UserMessage
import pytest
from _pytest.monkeypatch import MonkeyPatch
from unittest.mock import Mock
from rasa.nlu.extractors.crf_e... | 30.932854 | 88 | 0.581156 |
e8bbc8e665fab8a4ceae6ab368c8383d39c6a48e | 8,396 | py | Python | airflow/gcp/example_dags/example_bigtable.py | penghou620/airflow | 7b6045a479edca06732fd766ef8ceabf41c7e82a | [
"Apache-2.0"
] | 1 | 2019-10-02T13:33:48.000Z | 2019-10-02T13:33:48.000Z | airflow/gcp/example_dags/example_bigtable.py | penghou620/airflow | 7b6045a479edca06732fd766ef8ceabf41c7e82a | [
"Apache-2.0"
] | null | null | null | airflow/gcp/example_dags/example_bigtable.py | penghou620/airflow | 7b6045a479edca06732fd766ef8ceabf41c7e82a | [
"Apache-2.0"
] | 1 | 2019-11-26T21:53:20.000Z | 2019-11-26T21:53:20.000Z | # -*- 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
# ... | 40.560386 | 179 | 0.761672 |
80603874856fe859addece1371fe85427515b91e | 343 | py | Python | core/workaround/reproducibility.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 143 | 2021-12-03T02:33:36.000Z | 2022-03-29T00:01:48.000Z | core/workaround/reproducibility.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 33 | 2021-12-03T10:32:05.000Z | 2022-03-31T02:13:55.000Z | core/workaround/reproducibility.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 24 | 2021-12-04T06:46:42.000Z | 2022-03-30T07:57:47.000Z | def seed_all_rng(seed=0):
import random
random.seed(seed)
import numpy as np
np.random.seed(random.randint(0, 255))
import torch
torch.manual_seed(random.randint(0, 255))
def enable_deterministic_computation():
import torch
torch.backends.cudnn.deterministic = True
torch.backends.c... | 24.5 | 45 | 0.720117 |
6e146515f3b0bd318657c54e74a4810d362c046a | 7,956 | py | Python | src/manager/om/script/gspylib/inspection/common/CheckResult.py | wotchin/openGauss-server | ebd92e92b0cfd76b121d98e4c57a22d334573159 | [
"MulanPSL-1.0"
] | 1 | 2020-06-30T15:00:50.000Z | 2020-06-30T15:00:50.000Z | src/manager/om/script/gspylib/inspection/common/CheckResult.py | wotchin/openGauss-server | ebd92e92b0cfd76b121d98e4c57a22d334573159 | [
"MulanPSL-1.0"
] | null | null | null | src/manager/om/script/gspylib/inspection/common/CheckResult.py | wotchin/openGauss-server | ebd92e92b0cfd76b121d98e4c57a22d334573159 | [
"MulanPSL-1.0"
] | null | null | null | # -*- coding:utf-8 -*-
#############################################################################
# Copyright (c) 2020 Huawei Technologies Co.,Ltd.
#
# openGauss is licensed under Mulan PSL v2.
# You can use this software according to the terms
# and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan P... | 32.341463 | 78 | 0.497235 |
407ac3983179ffbf0412a941bdb08e5d8b6176a0 | 399 | py | Python | firstNetwork.py | ggavriil/pyltes | 1c913d00deef5c08a8548548395b3ab2b5ceb0a1 | [
"MIT"
] | null | null | null | firstNetwork.py | ggavriil/pyltes | 1c913d00deef5c08a8548548395b3ab2b5ceb0a1 | [
"MIT"
] | null | null | null | firstNetwork.py | ggavriil/pyltes | 1c913d00deef5c08a8548548395b3ab2b5ceb0a1 | [
"MIT"
] | null | null | null | from pyltes.network import CellularNetwork
network = CellularNetwork()
network.Generator.createHexagonalBSdeployment(1666)
network.Generator.insertUErandomly(100)
network.connectUsersToTheBestBS()
network.Printer.drawHistogramOfUEThroughput("thrHistogram")
network.Printer.drawNetwork(fillMethod="SINR", filename="sin... | 33.25 | 71 | 0.847118 |
3a50ee6fd9b0afc8503355ac764d6c8bfa16899e | 8,395 | py | Python | whitetube/views.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | whitetube/views.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | whitetube/views.py | AmanGiri007/youtube | b58009581378bf74cabfd791691dee65c9516685 | [
"MIT"
] | null | null | null | from django.shortcuts import render,reverse
from django.http import HttpResponse,HttpResponseRedirect
from django.views.generic import View
from .models import Channel,Video,Comment
from .forms import ChannelForm,CommentForm,LoginForm,RegisterForm,NewVideoForm
from django.contrib.auth import logout,login,authenticate
i... | 42.18593 | 106 | 0.618344 |
5e33a819a29b34100b9949e221376a9c06da7c08 | 547 | py | Python | Algorithms/Medium/718. Maximum Length of Repeated Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Medium/718. Maximum Length of Repeated Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Medium/718. Maximum Length of Repeated Subarray/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def findLength(self, A: List[int], B: List[int]) -> int:
memo = [[0] * (len(B) + 1) for _ in range(len(A) + 1)]
res = 0
for i in range(len(A)-1, -1, -1):
for j in range(len(B)-1, -1, -1):
if A[i] == B[j]:
... | 27.35 | 62 | 0.447898 |
a1fd375d327d8086d8d4442c56400a114e4450b4 | 4,960 | py | Python | RI/flask_server/tapi_server/models/tapi_photonic_media_media_channel_pool_capability_pac.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 57 | 2018-04-09T08:56:18.000Z | 2022-03-23T08:31:06.000Z | RI/flask_server/tapi_server/models/tapi_photonic_media_media_channel_pool_capability_pac.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 143 | 2016-06-08T04:09:54.000Z | 2018-02-23T10:45:59.000Z | RI/flask_server/tapi_server/models/tapi_photonic_media_media_channel_pool_capability_pac.py | arthurMll/TAPI | e1171bb139c6791a953af09cfc2bc7ad928da73d | [
"Apache-2.0"
] | 64 | 2018-03-07T07:55:17.000Z | 2022-03-28T07:14:28.000Z | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_photonic_media_spectrum_band import TapiPhotonicMediaSpectrumBand # noqa: F401,E501
from ... | 40 | 140 | 0.740927 |
aa1a2dbd58b35f22a3e7ceb75c536ed9c763d43b | 9,286 | py | Python | qiskit_metal/_gui/widgets/edit_component/table_model_options.py | wdczdj/qiskit-metal | c77805f66da60021ef8d10d668715c1dc2ebcd1d | [
"Apache-2.0"
] | null | null | null | qiskit_metal/_gui/widgets/edit_component/table_model_options.py | wdczdj/qiskit-metal | c77805f66da60021ef8d10d668715c1dc2ebcd1d | [
"Apache-2.0"
] | null | null | null | qiskit_metal/_gui/widgets/edit_component/table_model_options.py | wdczdj/qiskit-metal | c77805f66da60021ef8d10d668715c1dc2ebcd1d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 31.265993 | 100 | 0.56009 |
62a45ec747b3bc31bc5fe433962507ae0585a101 | 16,490 | py | Python | tools/TF2CaffeModel/itl/layers/inputs.py | chenaili6/FeatherCNN | 52cd8c8749ed584461a88b1f04749bb35a48f9a6 | [
"Apache-2.0"
] | 4 | 2018-05-14T09:00:33.000Z | 2021-05-14T08:11:54.000Z | tools/TF2CaffeModel/itl/layers/inputs.py | nihui/FeatherCNN | 2805f371bd8f33ef742cc9523979f29295d926fb | [
"Apache-2.0"
] | null | null | null | tools/TF2CaffeModel/itl/layers/inputs.py | nihui/FeatherCNN | 2805f371bd8f33ef742cc9523979f29295d926fb | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
# -*- coding: utf-8 -*-
import tensorflow as tf
from itl.layers.core import Layer
from itl.layers.core import LayersConfig
from itl import logging
__all__ = [
'InputLayer',
'OneHotInputLayer',
'Word2vecEmbeddingInputlayer',
'EmbeddingInputlayer',
'AverageEmbeddingInputlayer',
... | 37.307692 | 201 | 0.633535 |
d9d672869d661513e0679f3497246b67eb71d2eb | 7,208 | py | Python | extract_gear/index.py | kamerons/dde-extract-gear | 44464ae470bd5de6279d32e3587b469ce006ea42 | [
"Apache-2.0"
] | null | null | null | extract_gear/index.py | kamerons/dde-extract-gear | 44464ae470bd5de6279d32e3587b469ce006ea42 | [
"Apache-2.0"
] | null | null | null | extract_gear/index.py | kamerons/dde-extract-gear | 44464ae470bd5de6279d32e3587b469ce006ea42 | [
"Apache-2.0"
] | null | null | null | import os
from datetime import datetime
from extract_gear.cli import Cli
from folder.folder import Folder
# Creates an index file of the form:
# [
# {
# 'file_name': 'name.png',
# 'type': 'electric',
# 'num': 80
# },
# {}...
# ]
class Index:
NONE = "none"
STAT_OPTIONS = ['base', 'fire', 'elect... | 32.035556 | 111 | 0.638596 |
46653aa97034f223c9c990b0df13c5b9b0f6203d | 897 | pyw | Python | pybreak.pyw | loks0n/pybreak | 73f79c84ada224a8760449779c4e107eebee12b3 | [
"MIT"
] | 2 | 2020-04-26T09:16:40.000Z | 2021-04-19T16:17:02.000Z | pybreak.pyw | loks0n/pybreak | 73f79c84ada224a8760449779c4e107eebee12b3 | [
"MIT"
] | null | null | null | pybreak.pyw | loks0n/pybreak | 73f79c84ada224a8760449779c4e107eebee12b3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import time
import threading
import ctypes
WORK_DURATION = 600
LONG_BREAK_EVERY = 4
TITLE = 'pybreak'
MAIN_MENU_TEXT = 'Press OK to end session.'
SHORT_BREAK_TEXT = 'Go take a short break! Press OK when finished.'
LONG_BREAK_TEXT = 'Go take a long break! Press OK when finished.'
MAIN_MENU_ICON = ... | 21.878049 | 67 | 0.695652 |
330bf6fd5670c105af4211a68d4a73493a715229 | 610 | py | Python | src/saicinpainting/training/modules/squeeze_excitation.py | achen353/lama | 57438f957d5178d1180040fa349423e84af58e11 | [
"Apache-2.0"
] | null | null | null | src/saicinpainting/training/modules/squeeze_excitation.py | achen353/lama | 57438f957d5178d1180040fa349423e84af58e11 | [
"Apache-2.0"
] | null | null | null | src/saicinpainting/training/modules/squeeze_excitation.py | achen353/lama | 57438f957d5178d1180040fa349423e84af58e11 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
class SELayer(nn.Module):
def __init__(self, channel, reduction=16):
super(SELayer, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1)
self.fc = nn.Sequential(
nn.Linear(channel, channel // reduction, bias=False),
nn.ReLU(inplace=True),
... | 29.047619 | 65 | 0.547541 |
44e7aaacfe90515ef18a92a0ededeaaa1c88cc55 | 56 | py | Python | chest/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 130 | 2015-07-28T03:41:21.000Z | 2022-03-16T03:07:41.000Z | chest/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 119 | 2015-08-01T00:54:06.000Z | 2021-01-05T13:00:46.000Z | chest/run_test.py | nikicc/anaconda-recipes | 9c611a5854bf41bbc5e7ed9853dc71c0851a62ef | [
"BSD-3-Clause"
] | 72 | 2015-07-29T02:35:56.000Z | 2022-02-26T14:31:15.000Z | from chest import Chest
c = Chest()
c['x'] = [1, 2, 3]
| 11.2 | 23 | 0.553571 |
dd19b766822aa3235247aae663df78c756adace9 | 247 | py | Python | examples/template_video.py | VoIlAlex/cv2studio | 26ea110c141813b05fe1269a3e26493febe63e4d | [
"MIT"
] | 2 | 2019-10-31T06:17:48.000Z | 2020-12-13T20:24:44.000Z | examples/template_video.py | VoIlAlex/cv2studio | 26ea110c141813b05fe1269a3e26493febe63e4d | [
"MIT"
] | null | null | null | examples/template_video.py | VoIlAlex/cv2studio | 26ea110c141813b05fe1269a3e26493febe63e4d | [
"MIT"
] | null | null | null | import cv2studio
import cv2studio.components as components
import cv2
class VideoApp(cv2studio.App):
def __init__(self, path):
cv2studio.App.__init__(self, path, cv2studio.VIDEO)
app = VideoApp('../res/forest.mp4')
app.main_loop()
| 19 | 59 | 0.736842 |
f11f2c7c9db04e9d6d9dfc336c2daa1bd516c623 | 4,376 | py | Python | tests/datadriven/test_asserts.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | 83 | 2015-01-05T22:21:11.000Z | 2017-02-20T01:25:28.000Z | tests/datadriven/test_asserts.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | 1,508 | 2015-01-02T14:06:12.000Z | 2017-03-08T19:49:18.000Z | tests/datadriven/test_asserts.py | dkucsc/mavas | db3f7bd35944b7d0f510c62760eaa071bf53d7d8 | [
"Apache-2.0"
] | 99 | 2015-01-14T20:48:56.000Z | 2017-03-08T18:35:06.000Z | """
Tests the datadriven assert methods
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
import tests.datadriven as datadriven
class TestAsserts(unittest.TestCase):
def setUp(self):
self.testCase = datadriven.TestCase()
... | 35.290323 | 71 | 0.679159 |
21fa21af18edb516450ea607ceb34bf9f57b0b7e | 4,957 | py | Python | src/alldecays/data_handling/combined_data_set.py | LLR-ILD/alldecays | 08e51e99385ae7ca96edefddafd715e1d8cac3d3 | [
"Apache-2.0"
] | null | null | null | src/alldecays/data_handling/combined_data_set.py | LLR-ILD/alldecays | 08e51e99385ae7ca96edefddafd715e1d8cac3d3 | [
"Apache-2.0"
] | null | null | null | src/alldecays/data_handling/combined_data_set.py | LLR-ILD/alldecays | 08e51e99385ae7ca96edefddafd715e1d8cac3d3 | [
"Apache-2.0"
] | null | null | null | """Combination of data sets class"""
import numpy as np
from alldecays.exceptions import DataSetError
from .abstract_data_set import AbstractDataSet
class CombinedDataSet(AbstractDataSet):
"""Convenience wrapper around multiple `DataSet` objects.
Example:
>>> import alldecays
>>> isinstance... | 33.721088 | 85 | 0.626589 |
5a6f0c0c9dc0eac30a90708b82fb41b9eba201ef | 1,084 | py | Python | data/train/python/5a6f0c0c9dc0eac30a90708b82fb41b9eba201efurls.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/5a6f0c0c9dc0eac30a90708b82fb41b9eba201efurls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/5a6f0c0c9dc0eac30a90708b82fb41b9eba201efurls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | from django.conf.urls import patterns, url, include
from servicerating import api
from tastypie.api import Api
# Setting the API base name and registering the API resources using
# Tastypies API function
api_resources = Api(api_name='v1/servicerating')
api_resources.register(api.ContactResource())
api_resources.regis... | 38.714286 | 74 | 0.666974 |
2929981262da0d5dc113783e3f02907f81395cdb | 3,077 | py | Python | tests/integ/sagemaker/jumpstart/conftest.py | HappyAmazonian/sagemaker-python-sdk | bb7563f450113a3ba18a8e24cf6092f4325bb321 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | tests/integ/sagemaker/jumpstart/conftest.py | HappyAmazonian/sagemaker-python-sdk | bb7563f450113a3ba18a8e24cf6092f4325bb321 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | tests/integ/sagemaker/jumpstart/conftest.py | HappyAmazonian/sagemaker-python-sdk | bb7563f450113a3ba18a8e24cf6092f4325bb321 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 31.397959 | 95 | 0.724407 |
ada1e207bd9fea056085a297d6b73f207e268508 | 685 | py | Python | Shared/networkingSchemas/misc/auth.py | LukasSchmid97/elevatorbot | 77c45d8945c735c8dce9bc75563086bce265dc18 | [
"MIT"
] | null | null | null | Shared/networkingSchemas/misc/auth.py | LukasSchmid97/elevatorbot | 77c45d8945c735c8dce9bc75563086bce265dc18 | [
"MIT"
] | 89 | 2021-08-12T15:23:05.000Z | 2022-01-11T12:33:21.000Z | Shared/networkingSchemas/misc/auth.py | LukasSchmid97/elevatorbot | 77c45d8945c735c8dce9bc75563086bce265dc18 | [
"MIT"
] | 1 | 2021-10-20T20:07:22.000Z | 2021-10-20T20:07:22.000Z | from Shared.networkingSchemas.base import CustomBaseModel
class BackendUserModel(CustomBaseModel):
user_name: str
allowed_scopes: list[str]
has_write_permission: bool
has_read_permission: bool
disabled: bool
class Config:
orm_mode = True
class Token(CustomBaseModel):
access_toke... | 18.513514 | 57 | 0.734307 |
956d59dca3192fc92e16b9f9d119f3a8e326ace5 | 213 | py | Python | defIntToStr.py | medifle/python_6.00.1x | d40629f83e09b02cd4fc4e79e790d51d9b0ebf63 | [
"MIT"
] | 4 | 2015-10-27T15:42:33.000Z | 2018-03-08T07:16:26.000Z | defIntToStr.py | medifle/python_6.00.1x | d40629f83e09b02cd4fc4e79e790d51d9b0ebf63 | [
"MIT"
] | null | null | null | defIntToStr.py | medifle/python_6.00.1x | d40629f83e09b02cd4fc4e79e790d51d9b0ebf63 | [
"MIT"
] | null | null | null | # convert integer into string
def intToStr(i):
digits = '0123456789'
if i==0:
return '0'
result = ''
while i > 0:
result = digits[i % 10] + result
i /= 10
return result | 19.363636 | 40 | 0.525822 |
db90bfb9d00e2e5c818e9ffba1778ef4380e5f71 | 2,968 | py | Python | run_model.py | Antoine-BL/chess-ai.py | c68ca76063c14b1b8b91d338c8cead9f411521ca | [
"MIT"
] | 2 | 2019-08-21T15:52:29.000Z | 2021-09-11T23:07:17.000Z | run_model.py | Antoine-BL/chess-ai.py | c68ca76063c14b1b8b91d338c8cead9f411521ca | [
"MIT"
] | 5 | 2020-09-25T23:15:31.000Z | 2022-02-10T00:07:33.000Z | run_model.py | Antoine-BL/EuroTruck-ai.py | c68ca76063c14b1b8b91d338c8cead9f411521ca | [
"MIT"
] | null | null | null | from __future__ import print_function
import math
import os
import cv2
import time
from tensorflow.python.keras.models import load_model
import trainer
from trainer.model import model
import pyvjoy
import numpy as np
from mss import mss
from tensorflow.python.keras import Sequential
from pyvjoy import VJoyDevice... | 26.5 | 78 | 0.574798 |
db511acfa657b4591b921a090565c923a7b31ecb | 473 | py | Python | napari/plugins/_tests/fixtures/napari_bad_plugin2.py | yinawang28/napari | 6ea95a9fa2f9150a4dbb5ec1286b8ff2020c3957 | [
"BSD-3-Clause"
] | null | null | null | napari/plugins/_tests/fixtures/napari_bad_plugin2.py | yinawang28/napari | 6ea95a9fa2f9150a4dbb5ec1286b8ff2020c3957 | [
"BSD-3-Clause"
] | null | null | null | napari/plugins/_tests/fixtures/napari_bad_plugin2.py | yinawang28/napari | 6ea95a9fa2f9150a4dbb5ec1286b8ff2020c3957 | [
"BSD-3-Clause"
] | null | null | null | """
This plugin registers fine, and passes hook_specification validation.
But errors when the actual reader function is called. This is used for testing
the read_data_with_plugins loop.
"""
import pluggy
napari_hook_implementation = pluggy.HookimplMarker("napari")
def reader_function(path):
raise IOError(f"Plu... | 23.65 | 79 | 0.773784 |
37bed5d4b5cfbebc6a58987cd46d699709931564 | 43,007 | py | Python | cellpack/mgl_tools/DejaVu/Tests/test_Geom.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | cellpack/mgl_tools/DejaVu/Tests/test_Geom.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | 21 | 2021-10-02T00:07:05.000Z | 2022-03-30T00:02:10.000Z | cellpack/mgl_tools/DejaVu/Tests/test_Geom.py | mesoscope/cellpack | ec6b736fc706c1fae16392befa814b5337a3a692 | [
"MIT"
] | null | null | null | ## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
#
#
# $Id: test_Geom.py,v 1.29 2009/09/02 21:15:07 vareille Exp $
#
#
import unittest
import sys, os, math, Tkinter
import numpy
from opengltk.OpenGL import GL
from geomutils.geomalgorithms import TriangleNormals
import numpy.oldnumeric as Numeric, types
fr... | 35.05053 | 90 | 0.619155 |
d6e7976e3d67997398c00b7d8d76b3795a395c1d | 269 | py | Python | lifx_api.py | maltese-poodle/lifx_agent | 7e9f9b9f3281f441a4725daba448275bc8ce5e97 | [
"MIT"
] | null | null | null | lifx_api.py | maltese-poodle/lifx_agent | 7e9f9b9f3281f441a4725daba448275bc8ce5e97 | [
"MIT"
] | null | null | null | lifx_api.py | maltese-poodle/lifx_agent | 7e9f9b9f3281f441a4725daba448275bc8ce5e97 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os
import requests
def get_auth_header():
return {"Authorization": "Bearer %s" % os.getenv('LIFX_API_KEY')}
def get_devices():
return requests.get('https://api.lifx.com/v1/lights/all', headers=get_auth_header())
print(get_devices())
| 22.416667 | 88 | 0.717472 |
11a08e4fbfe30c3dea0cdb05b66dceffa03aff93 | 44,072 | py | Python | jax/experimental/maps.py | agudallago/jax | 3df58b9729e3991b64cecbd25c48f101ae92e99b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/maps.py | agudallago/jax | 3df58b9729e3991b64cecbd25c48f101ae92e99b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/maps.py | agudallago/jax | 3df58b9729e3991b64cecbd25c48f101ae92e99b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 45.38826 | 101 | 0.693751 |
65199beaa454d28f2747e63b49af429a3af191f2 | 1,874 | py | Python | extract_data.py | pcg15/bme590hrm | ac8d4865d870d0aebdbe32396b740dae5babee7b | [
"MIT"
] | null | null | null | extract_data.py | pcg15/bme590hrm | ac8d4865d870d0aebdbe32396b740dae5babee7b | [
"MIT"
] | null | null | null | extract_data.py | pcg15/bme590hrm | ac8d4865d870d0aebdbe32396b740dae5babee7b | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import logging
logging.basicConfig(filename='hrmonitorlog.txt', format='%(levelname)s \
%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p', level=logging.DEBUG)
def extract_voltage_data(filename):
"""pulls voltage data out of pandas data frame and normalizes values
... | 32.310345 | 78 | 0.713981 |
4b4dc3d62b0145573cfbdfd362e33d2baf29a1e3 | 1,729 | py | Python | tests/test_assets.py | simongarisch/pytrade | 6245c0a47017a880299fa7704a49580f394fa87b | [
"MIT"
] | 2 | 2020-10-19T02:44:57.000Z | 2021-11-08T10:45:25.000Z | tests/test_assets.py | simongarisch/pytrade | 6245c0a47017a880299fa7704a49580f394fa87b | [
"MIT"
] | 1 | 2020-12-24T02:59:58.000Z | 2020-12-24T02:59:58.000Z | tests/test_assets.py | simongarisch/pytrade | 6245c0a47017a880299fa7704a49580f394fa87b | [
"MIT"
] | null | null | null | import pytest
from pxtrade.settings import get_default_currency_code
from pxtrade.assets import reset, Asset, Stock
from pxtrade.observable import Observable
def test_is_observable():
""" All assets must be observable. """
stock = Stock("AAPL", currency_code="USD")
assert isinstance(stock, Observable)
d... | 24.013889 | 54 | 0.667438 |
ecc06a0067b3ef5339b5365953052c1785dd20c4 | 104 | py | Python | kafka_postgres/web_health_monitor/exceptions.py | eykop/Web-Monitoring-Kafka-PostgreSQL | d80ae6b1998c7c00af23cb805843162b9e6135b8 | [
"MIT"
] | null | null | null | kafka_postgres/web_health_monitor/exceptions.py | eykop/Web-Monitoring-Kafka-PostgreSQL | d80ae6b1998c7c00af23cb805843162b9e6135b8 | [
"MIT"
] | null | null | null | kafka_postgres/web_health_monitor/exceptions.py | eykop/Web-Monitoring-Kafka-PostgreSQL | d80ae6b1998c7c00af23cb805843162b9e6135b8 | [
"MIT"
] | 1 | 2021-06-03T11:53:43.000Z | 2021-06-03T11:53:43.000Z | """Module that defines exceptions for wbe monitoring"""
class WebMonitorException(Exception):
pass | 20.8 | 55 | 0.769231 |
b21bc420f024ce95d1a6590632025353f6a2c7d2 | 4,596 | py | Python | parkourdex/settings.py | moralrecordings/parkourdex | be0badf084b583588dbe672e53948a24ea82de95 | [
"BSD-3-Clause"
] | null | null | null | parkourdex/settings.py | moralrecordings/parkourdex | be0badf084b583588dbe672e53948a24ea82de95 | [
"BSD-3-Clause"
] | 8 | 2021-04-08T18:31:49.000Z | 2022-03-11T23:31:32.000Z | parkourdex/settings.py | moralrecordings/parkourdex | be0badf084b583588dbe672e53948a24ea82de95 | [
"BSD-3-Clause"
] | null | null | null | """
Django settings for parkourdex project.
"""
from confy import env, database, cache
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname( os.path.dirname( os.path.abspath( __file__ ) ) )
# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist... | 24.978261 | 91 | 0.635988 |
081567500f74584145d9d480074948699e05c6bb | 89,775 | py | Python | nilearn/datasets/neurovault.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 827 | 2015-01-30T23:11:42.000Z | 2022-03-29T21:21:05.000Z | nilearn/datasets/neurovault.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 2,845 | 2015-01-04T22:14:41.000Z | 2022-03-31T20:28:09.000Z | nilearn/datasets/neurovault.py | ctw/nilearn | 932eee9c69cd8fbf40ee6af5cee77f8f93b25da3 | [
"BSD-2-Clause"
] | 484 | 2015-02-03T10:58:19.000Z | 2022-03-29T21:57:16.000Z | """
Download statistical maps available on Neurovault (http://neurovault.org).
"""
# Author: Jerome Dockes
# License: simplified BSD
import os
import warnings
import traceback
from copy import copy, deepcopy
import shutil
import re
import json
from glob import glob
from tempfile import mkdtemp
import requests
from ur... | 33.324053 | 91 | 0.659504 |
fdfdd6e40687167a447bc765a830761657f92198 | 14,410 | py | Python | model_zoo/official/nlp/bert/src/bert_for_finetune.py | huxian123/mindspore | ec5ba10c82bbd6eccafe32d3a1149add90105bc8 | [
"Apache-2.0"
] | 1 | 2021-06-02T02:46:20.000Z | 2021-06-02T02:46:20.000Z | model_zoo/official/nlp/bert/src/bert_for_finetune.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | model_zoo/official/nlp/bert/src/bert_for_finetune.py | nudt-eddie/mindspore | 55372b41fdfae6d2b88d7078971e06d537f6c558 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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 applicable law or agreed to... | 43.534743 | 118 | 0.610548 |
19af0a1c151ba14dc4294b5b3685360069ccf70a | 5,002 | py | Python | resilient-circuits/tests/test_decorators.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 28 | 2017-12-22T00:26:59.000Z | 2022-01-22T14:51:33.000Z | resilient-circuits/tests/test_decorators.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 18 | 2018-03-06T19:04:20.000Z | 2022-03-21T15:06:30.000Z | resilient-circuits/tests/test_decorators.py | ibmresilient/resilient-python-api | 85e0ff684a88f744645c0ace414f51d769bcc3c2 | [
"MIT"
] | 28 | 2018-05-01T17:53:22.000Z | 2022-03-28T09:56:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# (c) Copyright IBM Corp. 2010, 2021. All Rights Reserved.
import pytest
from resilient_lib import IntegrationError
from resilient_circuits import constants, ResilientComponent, inbound_app, app_function
from tests import helpers, mock_constants, MockInboundAppComponent, A... | 58.162791 | 154 | 0.762495 |
96803f9f7c7311398b7912308e32bd367f0f3d3c | 2,961 | py | Python | covid/disease_objects/course.py | c200chromebook/Covid_Model | 860221a222ffab6a12d3894b58c7170af6e6b8bb | [
"MIT"
] | 2 | 2020-03-15T22:32:06.000Z | 2020-03-18T11:05:56.000Z | covid/disease_objects/course.py | c200chromebook/Covid_Model | 860221a222ffab6a12d3894b58c7170af6e6b8bb | [
"MIT"
] | null | null | null | covid/disease_objects/course.py | c200chromebook/Covid_Model | 860221a222ffab6a12d3894b58c7170af6e6b8bb | [
"MIT"
] | null | null | null | from collections import defaultdict
from covid.disease_objects.state import State
from covid.util.util import parse_tuple_list
class CourseState:
def __init__(self, course):
self.course = course
self.day_state = [state for state, days in self.course.disease_course for _ in range(days)]
sel... | 37.0125 | 117 | 0.643701 |
b7538554c20c79a8c84cbd38ec0ae941fbd35e65 | 1,592 | py | Python | oxygine/system_data_demo/build.py | savegame/oxygine-framework | bf49a097a86a2b99690a4fdc97efa73f2dfb70e4 | [
"MIT"
] | 803 | 2015-01-03T13:11:43.000Z | 2022-03-15T17:38:58.000Z | oxygine/system_data_demo/build.py | savegame/oxygine-framework | bf49a097a86a2b99690a4fdc97efa73f2dfb70e4 | [
"MIT"
] | 100 | 2015-01-07T17:07:56.000Z | 2021-12-21T20:09:20.000Z | oxygine/system_data_demo/build.py | savegame/oxygine-framework | bf49a097a86a2b99690a4fdc97efa73f2dfb70e4 | [
"MIT"
] | 265 | 2015-01-03T13:11:43.000Z | 2022-03-01T04:37:15.000Z | import os
import shutil
import zipfile
shutil.rmtree("data", True)
shutil.copytree("original", "data")
os.system("..\\..\\tools\\oxyresbuild.py -x sys_demo\\res.xml --src_data data --dest_data data\\sys_demo --nopng")
shutil.rmtree("data/sys_demo/anims/")
def recursive_zip(zipf, directory, folder = ""):
for ite... | 28.428571 | 114 | 0.644472 |
3362202e23bfcb5b731d60ae56b6d9975bf6a20e | 745 | py | Python | posts/urls.py | KingVulkan/Awards | 00d537f32029e9a21c26dcf95bca7e7a7854a4dc | [
"Unlicense"
] | null | null | null | posts/urls.py | KingVulkan/Awards | 00d537f32029e9a21c26dcf95bca7e7a7854a4dc | [
"Unlicense"
] | null | null | null | posts/urls.py | KingVulkan/Awards | 00d537f32029e9a21c26dcf95bca7e7a7854a4dc | [
"Unlicense"
] | null | null | null | from django.conf.urls import url
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns=[
url(r'^$', views.home, name='home'),
url(r'^user/(?P<username>\w+)', views.profile, name='profile'),
url(r'^upload/$', views.project, name='upload_project'),
ur... | 37.25 | 84 | 0.697987 |
93a5e3aab0f8cef8cd787ce29ba92bc939d8d391 | 25,844 | py | Python | qcodes/tests/instrument_mocks.py | RasmusBC59/Qcodes | 467ca557745278e6ff467965c57c77c2aa6d699b | [
"MIT"
] | 1 | 2021-04-07T08:53:05.000Z | 2021-04-07T08:53:05.000Z | qcodes/tests/instrument_mocks.py | M1racleShih/Qcodes | c03029a6968e16379155aadc8b083a02e01876a6 | [
"MIT"
] | 166 | 2020-12-25T07:09:57.000Z | 2022-03-30T00:16:23.000Z | qcodes/tests/instrument_mocks.py | nicholgroup/Qcodes | 6b9701bf469421fcf2ced58f67c01f69eba9d1f4 | [
"MIT"
] | 4 | 2017-12-11T12:13:41.000Z | 2018-08-01T13:13:04.000Z | from functools import partial
import logging
from typing import Any, Sequence, Dict, Optional
import numpy as np
from qcodes.instrument.base import Instrument, InstrumentBase
from qcodes.utils.validators import Numbers, Arrays, Strings, ComplexNumbers
from qcodes.instrument.parameter import MultiParameter, Parameter,... | 36.867332 | 113 | 0.553513 |
ef351182014148959df6e1eaa296ddde4cd8f7e4 | 13,376 | py | Python | simba/sklearn_plot_scripts/plot_sklearn_results_old.py | justinshenk/simba | a58ccd0ceeda201c1452d186033ce6b25fbab564 | [
"MIT"
] | 172 | 2019-12-18T22:19:42.000Z | 2022-03-29T01:58:25.000Z | simba/sklearn_plot_scripts/plot_sklearn_results_old.py | justinshenk/simba | a58ccd0ceeda201c1452d186033ce6b25fbab564 | [
"MIT"
] | 165 | 2020-01-10T19:05:16.000Z | 2022-03-31T16:08:36.000Z | simba/sklearn_plot_scripts/plot_sklearn_results_old.py | justinshenk/simba | a58ccd0ceeda201c1452d186033ce6b25fbab564 | [
"MIT"
] | 80 | 2019-12-20T00:01:43.000Z | 2022-03-29T16:20:10.000Z | import numpy as np
import cv2
import os
import pandas as pd
from scipy import ndimage
from configparser import ConfigParser, MissingSectionHeaderError, NoSectionError
import glob
from simba.drop_bp_cords import getBpNames
from pylab import *
from simba.rw_dfs import *
import random
def plotsklearnresult(... | 63.09434 | 242 | 0.606459 |
943a2febb11c31034fbd1b36e9903b0ec9618deb | 828 | py | Python | src/iBeatles/fitting/fitting_functions.py | ornlneutronimaging/iBeatles | 0a6ca1e18780cf08ad97b6cedede5a23f52bc953 | [
"MIT"
] | 3 | 2017-04-27T06:58:05.000Z | 2020-01-21T07:12:30.000Z | src/iBeatles/fitting/fitting_functions.py | ornlneutronimaging/iBeatles | 0a6ca1e18780cf08ad97b6cedede5a23f52bc953 | [
"MIT"
] | 99 | 2019-05-09T14:05:56.000Z | 2022-03-30T19:13:31.000Z | src/iBeatles/fitting/fitting_functions.py | ornlneutronimaging/iBeatles | 0a6ca1e18780cf08ad97b6cedede5a23f52bc953 | [
"MIT"
] | null | null | null | import math
import numpy as np
from scipy.special import erfc
def basic_fit(t, d_spacing, alpha, sigma, a1, a2):
t0 = 2 * d_spacing
term2 = erfc(-((t - t0) / (sigma * math.sqrt(2))) + sigma / alpha)
term1 = np.exp((t - t0) / alpha + (sigma * sigma) / (2 * alpha * alpha))
term0 = erfc(-((t - t0) / (sig... | 29.571429 | 81 | 0.532609 |
780708de0e3bbf65713227b1fc3c753e64b65f88 | 7,753 | py | Python | mnist-collection/dcgan.py | krishnaw14/nnabla-examples | cddbb7ddf036628ae722273b13574d5ee5e9b87a | [
"Apache-2.0"
] | 1 | 2020-08-03T12:49:25.000Z | 2020-08-03T12:49:25.000Z | mnist-collection/dcgan.py | takuseno/nnabla-examples | 070d25078ad3d5458744dbfd390cdd926e20e573 | [
"Apache-2.0"
] | null | null | null | mnist-collection/dcgan.py | takuseno/nnabla-examples | 070d25078ad3d5458744dbfd390cdd926e20e573 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony 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 applicabl... | 36.919048 | 96 | 0.617438 |
8bf374be507cfef048677ab826491844b028b56c | 5,399 | py | Python | deep_preprocessing/DATA.py | cc-ai/floods-gans | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 5 | 2019-05-07T15:14:58.000Z | 2020-11-23T00:21:50.000Z | deep_preprocessing/DATA.py | cc-ai/floods | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 13 | 2019-04-25T01:06:20.000Z | 2022-03-11T23:51:04.000Z | deep_preprocessing/DATA.py | cc-ai/floods | 787dc2a3c08483c68a687b4355c0f0f6f2711ab9 | [
"Apache-2.0"
] | 4 | 2019-04-24T18:06:10.000Z | 2020-07-15T18:02:56.000Z | import tensorflow as tf
import numpy as np
import random, os
from .CONVNET import *
# Configure
FLAGS = {}
FLAGS['num_gpu'] = '1'
FLAGS['num_exp'] = 577
FLAGS['num_epoch'] = 134
FLAGS['method'] = 'Unsupervised on MIT-Adobe-5K'
FLAGS['mode_use_debug'] = False
FLAGS['netG_init_method'] = 'var_scale' #var_scale, rand_u... | 49.081818 | 172 | 0.601963 |
fe496b76441bdf4586c12ac6fd10b85345584712 | 6,269 | py | Python | basicsr/data/vimeo90k_dataset.py | yuangan/Simple-SR | 630d2f9441b116620af88ff882eca4673dedc047 | [
"MIT"
] | null | null | null | basicsr/data/vimeo90k_dataset.py | yuangan/Simple-SR | 630d2f9441b116620af88ff882eca4673dedc047 | [
"MIT"
] | null | null | null | basicsr/data/vimeo90k_dataset.py | yuangan/Simple-SR | 630d2f9441b116620af88ff882eca4673dedc047 | [
"MIT"
] | null | null | null | import mmcv
import numpy as np
import random
import torch
from pathlib import Path
from torch.utils import data as data
from basicsr.data.transforms import augment, paired_random_crop, totensor
from basicsr.utils import FileClient, get_root_logger
def normalize_list(img_results):
out = []
for i in... | 36.236994 | 85 | 0.555431 |
0112277549548a4c9aa5f11d0ce4ee46af403330 | 3,560 | py | Python | bindings/python/ensmallen/datasets/string/burkholderiaspccge1002.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/burkholderiaspccge1002.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/burkholderiaspccge1002.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Burkholderia sp. CCGE1002.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--prot... | 32.962963 | 223 | 0.676966 |
be6e33a93259028fd313a8b58b6096a1b1311577 | 257 | py | Python | src/asm/layoutpage/layouts.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/layoutpage/layouts.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | src/asm/layoutpage/layouts.py | ctheune/assembly-cms | 20e000373fc30d9a14cb5dc882499b5eed1d86ee | [
"ZPL-2.1"
] | null | null | null | import asm.layoutpage.interfaces
import asm.layoutpage.layoutpage
import grok
class DefaultLayout(asm.layoutpage.layoutpage.Layout, grok.GlobalUtility):
grok.provides(asm.layoutpage.interfaces.ILayoutPage)
grok.name('default')
layout = '${}'
| 23.363636 | 74 | 0.774319 |
96b12e5adbcb6a48a88ebeb44b88f5063e13a4d8 | 3,553 | py | Python | downloads/views.py | cedadev/download-stats | 3d18b08ce239e82e53c5a9bd4dd77b35a1f040bc | [
"BSD-3-Clause"
] | null | null | null | downloads/views.py | cedadev/download-stats | 3d18b08ce239e82e53c5a9bd4dd77b35a1f040bc | [
"BSD-3-Clause"
] | 6 | 2019-08-29T10:35:09.000Z | 2021-04-07T12:24:37.000Z | downloads/views.py | cedadev/access-stats | 3d18b08ce239e82e53c5a9bd4dd77b35a1f040bc | [
"BSD-3-Clause"
] | 1 | 2018-11-01T16:31:16.000Z | 2018-11-01T16:31:16.000Z | from django.shortcuts import render
from django.http import HttpResponse, JsonResponse, HttpResponseNotFound
from django.views.generic import TemplateView
from django.conf import settings
from downloads.forms import FilterForm
from common.json_maker_factory import JsonMakerFactory
from common.file_response_factory im... | 38.204301 | 127 | 0.667042 |
2f062e88c1a50959d1ea4ba042340560ed997523 | 14,224 | py | Python | venv/lib/python3.8/site-packages/telegram/utils/helpers.py | anthonyricci123/python-telegram-bot-heroku | 96d75c1eca1f14fe68c81bf0b4cf30a34677dcde | [
"MIT"
] | 2 | 2021-09-17T10:55:14.000Z | 2021-09-17T10:55:38.000Z | telegram/amazon_bot/lib/python3.7/site-packages/telegram/utils/helpers.py | neerajp99/twitter_update_bot | 116c95f477af354e6016cbc4477e1d3bdd2ff484 | [
"MIT"
] | null | null | null | telegram/amazon_bot/lib/python3.7/site-packages/telegram/utils/helpers.py | neerajp99/twitter_update_bot | 116c95f477af354e6016cbc4477e1d3bdd2ff484 | [
"MIT"
] | 1 | 2021-05-31T18:23:02.000Z | 2021-05-31T18:23:02.000Z | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2020
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | 34.524272 | 98 | 0.63653 |
91957d7bd1a6e77d79bfe81ffffb07f965dd235d | 727 | py | Python | Asignaciones/Recursividad, Listas y arboles/Quicksort.py | TEC-2014092195/IC1802-introduccion-a-la-programacion | 20391cc2e301993cacb27178f2deab403016ed84 | [
"MIT"
] | null | null | null | Asignaciones/Recursividad, Listas y arboles/Quicksort.py | TEC-2014092195/IC1802-introduccion-a-la-programacion | 20391cc2e301993cacb27178f2deab403016ed84 | [
"MIT"
] | null | null | null | Asignaciones/Recursividad, Listas y arboles/Quicksort.py | TEC-2014092195/IC1802-introduccion-a-la-programacion | 20391cc2e301993cacb27178f2deab403016ed84 | [
"MIT"
] | null | null | null | def quicksort(lista):
if lista == []:
return []
else:
pivote = lista[0]
menor, igual, mayor = ordenar1(lista[1:],[],[pivote],[])
return quicksort(menor) + igual + quicksort(mayor)
def ordenar1(lista,menor,igual,mayor):
if lista == []:
return (meno... | 26.925926 | 72 | 0.530949 |
6b8d8d8663b017bf4ad149b1a8d24d6fd15d02ca | 4,476 | py | Python | weconnect/elements/window_heating_status.py | tillsteinbach/WeConnect-python | 8e8eade47eab9479a65d714de5009c5be975a59f | [
"MIT"
] | 22 | 2021-08-06T21:01:11.000Z | 2022-03-21T14:54:25.000Z | weconnect/elements/window_heating_status.py | tillsteinbach/WeConnect-python | 8e8eade47eab9479a65d714de5009c5be975a59f | [
"MIT"
] | 30 | 2021-06-20T21:11:26.000Z | 2022-03-22T21:11:04.000Z | weconnect/elements/window_heating_status.py | tillsteinbach/WeConnect-python | 8e8eade47eab9479a65d714de5009c5be975a59f | [
"MIT"
] | 8 | 2021-08-06T21:01:29.000Z | 2022-02-02T21:32:14.000Z | from enum import Enum
import logging
from weconnect.addressable import AddressableAttribute, AddressableDict, AddressableObject
from weconnect.elements.generic_status import GenericStatus
LOG = logging.getLogger("weconnect")
class WindowHeatingStatus(GenericStatus):
def __init__(
self,
vehicle,
... | 44.316832 | 122 | 0.590259 |
8043721e8eb06f2c86934cb13698155f007e9c21 | 6,628 | py | Python | website/models.py | NewWorldInnovations/fme | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | null | null | null | website/models.py | NewWorldInnovations/fme | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | 5 | 2021-03-18T20:32:49.000Z | 2022-03-11T23:21:21.000Z | website/models.py | NewWorldInnovations/fme-backend | a1558d7957ad26759c485c617f4fc25864da1925 | [
"MIT"
] | null | null | null | from django.db import models
from django.urls import reverse
from django.db import models
from django.conf import settings
from django.utils import timezone
from django.utils.html import format_html
from django.contrib.auth.models import User
import datetime,os
from decimal import Decimal
from rest_framework.revers... | 36.822222 | 119 | 0.734007 |
19b4640b290e1c4bb1ced71642e2a903e254fc47 | 4,244 | py | Python | src/oci/circuit_breaker/circuit_breaker.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/circuit_breaker/circuit_breaker.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/circuit_breaker/circuit_breaker.py | ezequielramos/oci-python-sdk | cc4235cf217beaf9feed75760e9ce82610222762 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 46.637363 | 245 | 0.671772 |
4ddd4a01ff8e08b9a99afa503da348dc2fa840d8 | 641 | py | Python | src/provider/views.py | mahidul-islam/shopmanagementsystem | 22679aa420e7408cd44cf1aa6b556bb94a30398a | [
"MIT"
] | null | null | null | src/provider/views.py | mahidul-islam/shopmanagementsystem | 22679aa420e7408cd44cf1aa6b556bb94a30398a | [
"MIT"
] | null | null | null | src/provider/views.py | mahidul-islam/shopmanagementsystem | 22679aa420e7408cd44cf1aa6b556bb94a30398a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.views import generic
from django.shortcuts import get_object_or_404, redirect
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from . import models
class ShowProvider(LoginRequiredMixin, generic.TemplateView):
templat... | 35.611111 | 64 | 0.75039 |
e6af9078defc1a6c4d12346b363a32a0af5e3d75 | 8,430 | py | Python | test/test_matchengine.py | TinEye/tineyeservices_python | d30098b734b703f4ff933dfbcf1f0f8321c8d0d7 | [
"MIT"
] | 13 | 2016-05-06T05:23:27.000Z | 2022-03-17T01:27:07.000Z | test/test_matchengine.py | seanwallawalla-forks/tineyeservices_python | d30098b734b703f4ff933dfbcf1f0f8321c8d0d7 | [
"MIT"
] | 1 | 2016-05-27T11:45:54.000Z | 2018-11-08T21:58:38.000Z | test/test_matchengine.py | seanwallawalla-forks/tineyeservices_python | d30098b734b703f4ff933dfbcf1f0f8321c8d0d7 | [
"MIT"
] | 8 | 2017-09-22T03:36:28.000Z | 2022-03-17T01:29:18.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018 TinEye. All rights reserved worldwide.
import os
import sys
import unittest
from tineyeservices import MatchEngineRequest
from tineyeservices import Image
from tineyeservices.exception import TinEyeServiceError, TinEyeServiceWarning
imagepath = os.path.abspath("test/image... | 37.802691 | 106 | 0.586833 |
f5aadfb3a9c8a816eed066d43fe94ab07045fc2b | 331 | py | Python | scholarmetrics/__init__.py | Michael-E-Rose/scholarmetrics | 16d6f3b149016ca9ce0da4ba3fa46069d67394ff | [
"MIT"
] | 4 | 2015-05-02T17:51:20.000Z | 2022-01-20T20:55:09.000Z | scholarmetrics/__init__.py | Michael-E-Rose/scholarmetrics | 16d6f3b149016ca9ce0da4ba3fa46069d67394ff | [
"MIT"
] | 8 | 2015-05-02T17:52:28.000Z | 2017-04-04T20:25:50.000Z | scholarmetrics/__init__.py | Michael-E-Rose/scholarmetrics | 16d6f3b149016ca9ce0da4ba3fa46069d67394ff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__author__ = """Michael E. Rose"""
__email__ = 'Michael.Ernst.Rose@gmail.com'
__all__ = ['euclidean', 'gindex', 'hindex']
from pbr.version import VersionInfo
_v = VersionInfo('scholarmetrics').semantic_version()
__version__ = _v.release_string()
version_info = _v.version_tuple()
from .metric... | 23.642857 | 53 | 0.719033 |
58c48899c39c2bdd21c9ecc48ba1ae34d163b3fa | 121 | py | Python | users/swagger/__init__.py | marianojabdala/microservices | 4a020cb9d703f20baa40446d525363d159d008ac | [
"Apache-2.0"
] | 1 | 2018-04-20T20:12:31.000Z | 2018-04-20T20:12:31.000Z | users/swagger/__init__.py | marianojabdala/microservices | 4a020cb9d703f20baa40446d525363d159d008ac | [
"Apache-2.0"
] | 17 | 2021-03-19T22:51:22.000Z | 2021-08-30T20:22:33.000Z | users/swagger/__init__.py | marianojabdala/microservices | 4a020cb9d703f20baa40446d525363d159d008ac | [
"Apache-2.0"
] | 2 | 2018-04-20T20:12:36.000Z | 2018-10-07T15:37:46.000Z | # -*- coding: utf-8 -*-
"""Expose the User schema for the swagger documentation."""
from .schemas.user import UserSchema
| 30.25 | 59 | 0.710744 |
2ea2694d7e574738860939ba096089dc8e93c0a1 | 5,579 | py | Python | util_uploader.py | um-flint/nix_bsd_mac_inventory | 0791e0d43b6dc01cb44721be1356ee81de04b0e1 | [
"MIT"
] | null | null | null | util_uploader.py | um-flint/nix_bsd_mac_inventory | 0791e0d43b6dc01cb44721be1356ee81de04b0e1 | [
"MIT"
] | null | null | null | util_uploader.py | um-flint/nix_bsd_mac_inventory | 0791e0d43b6dc01cb44721be1356ee81de04b0e1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import requests
try:
requests.packages.urllib3.disable_warnings()
except AttributeError:
pass
# To upload, or not to upload, question is now?
DRY_RUN = False
class Rest:
def __init__(self, base_url, username, secret, debug):
self.base_url = ... | 34.438272 | 103 | 0.500807 |
3967c69c600390e5988077b5938ed3969782ae5f | 12,248 | py | Python | cumulus/management/commands/syncstatic.py | sunscrapers/django-cumulus | e89bbba4bed729465c1e05993b8bae9461f7612b | [
"BSD-3-Clause"
] | null | null | null | cumulus/management/commands/syncstatic.py | sunscrapers/django-cumulus | e89bbba4bed729465c1e05993b8bae9461f7612b | [
"BSD-3-Clause"
] | null | null | null | cumulus/management/commands/syncstatic.py | sunscrapers/django-cumulus | e89bbba4bed729465c1e05993b8bae9461f7612b | [
"BSD-3-Clause"
] | null | null | null | import datetime
import fnmatch
import mimetypes
import optparse
import os
import pyrax
import re
import swiftclient
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import CommandError, NoArgsCommand
from cumulus.settings import CUMULUS
from cumulus.st... | 42.825175 | 90 | 0.565562 |
402dee23e8dc66e8b61530eafcbee401d5944b22 | 1,309 | py | Python | fractal/mandelbrot.py | Gagaro/pyfractal | 50bfad41e45cf268074c9c184c85da6d25909c35 | [
"MIT"
] | null | null | null | fractal/mandelbrot.py | Gagaro/pyfractal | 50bfad41e45cf268074c9c184c85da6d25909c35 | [
"MIT"
] | null | null | null | fractal/mandelbrot.py | Gagaro/pyfractal | 50bfad41e45cf268074c9c184c85da6d25909c35 | [
"MIT"
] | null | null | null | import logging
try:
import cmandelbrot
CMANDELBROT = True
except ImportError:
CMANDELBROT = False
logging.warning("cmandelbrot not present, using python implementation.")
ITERATIONS = 300
class Mandelbrot(object):
def __init__(self, width, height, min_r=-2.0, max_r=1.0, min_i=-1.5,
... | 29.75 | 76 | 0.593583 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.