hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7673d0bd42f3ef954347857169498452249be20c | 7,123 | py | Python | rexpro/connectors/sync/connection.py | platinummonkey/rexpro-python | 75e1b516e909058bd1a59964e1bb8284b3113dbd | [
"Apache-2.0"
] | 5 | 2015-04-23T17:38:38.000Z | 2021-07-13T01:45:04.000Z | rexpro/connectors/sync/connection.py | platinummonkey/rexpro-python | 75e1b516e909058bd1a59964e1bb8284b3113dbd | [
"Apache-2.0"
] | 7 | 2015-02-27T17:48:01.000Z | 2016-07-01T12:53:46.000Z | rexpro/connectors/sync/connection.py | platinummonkey/rexpro-python | 75e1b516e909058bd1a59964e1bb8284b3113dbd | [
"Apache-2.0"
] | 5 | 2015-02-09T16:55:00.000Z | 2016-09-09T09:53:13.000Z | from socket import socket
from rexpro._compat import Queue, text_type
from select import select
from rexpro.connectors.base import RexProBaseConnection, RexProBaseConnectionPool
import struct
from rexpro import exceptions
from rexpro import messages
class RexProSyncSocket(socket):
""" Subclass of python's socke... | 48.128378 | 116 | 0.46778 |
c944c1c64124e184eb7c9518e15212a82570f545 | 87,006 | py | Python | runtests.py | Juanlu001/cython | 3307467278f9121afc3d897df850883f2d6f9355 | [
"Apache-2.0"
] | null | null | null | runtests.py | Juanlu001/cython | 3307467278f9121afc3d897df850883f2d6f9355 | [
"Apache-2.0"
] | null | null | null | runtests.py | Juanlu001/cython | 3307467278f9121afc3d897df850883f2d6f9355 | [
"Apache-2.0"
] | 1 | 2018-10-13T01:28:13.000Z | 2018-10-13T01:28:13.000Z | #!/usr/bin/env python
import atexit
import os
import sys
import re
import gc
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
try:
import platform
IS_PYPY = platform.python_implementation() == ... | 39.139001 | 133 | 0.581879 |
ca4c6e72c738493f1cd0e677775e0cd2c7abb23c | 3,666 | py | Python | spektral/layers/convolutional/gcn_conv.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | 2 | 2021-02-21T10:02:38.000Z | 2021-02-21T10:02:43.000Z | spektral/layers/convolutional/gcn_conv.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | null | null | null | spektral/layers/convolutional/gcn_conv.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | null | null | null | from tensorflow.keras import backend as K
from spektral.layers import ops
from spektral.layers.convolutional.conv import Conv
from spektral.utils import gcn_filter
class GCNConv(Conv):
r"""
A graph convolutional layer (GCN) from the paper
> [Semi-Supervised Classification with Graph Convolutional Networ... | 31.067797 | 110 | 0.623022 |
6226bbef1bb69ce220e8141300f88ea050b7d7c0 | 4,625 | py | Python | django/django/contrib/webdesign/lorem_ipsum.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/django/contrib/webdesign/lorem_ipsum.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | null | null | null | django/django/contrib/webdesign/lorem_ipsum.py | jonaustin/advisoryscan | ba452c155f0d478450e0c91de5ea00f404e98616 | [
"MIT"
] | 1 | 2018-12-06T12:50:52.000Z | 2018-12-06T12:50:52.000Z | """
Utility functions for generating "lorem ipsum" Latin text.
"""
import random
COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo con... | 66.071429 | 1,905 | 0.643243 |
d1f32c3564c23b54036d53892a507ffa72d93593 | 2,934 | py | Python | diagnostics/volcInfo.py | bnb32/wrf_pipeline_tools | ddc4b2a84c601780a9cc8fe21b34e9715c4372be | [
"MIT"
] | null | null | null | diagnostics/volcInfo.py | bnb32/wrf_pipeline_tools | ddc4b2a84c601780a9cc8fe21b34e9715c4372be | [
"MIT"
] | null | null | null | diagnostics/volcInfo.py | bnb32/wrf_pipeline_tools | ddc4b2a84c601780a9cc8fe21b34e9715c4372be | [
"MIT"
] | null | null | null | import os
import Nio
import numpy
from scipy.signal import argrelextrema
import collections
def getVolcInfo(number,region):
forced_directories=[d for d in os.listdir('/glade/scratch/cmc542/tmp/bbenton/WRF_OUTPUT/forced')]# if os.path.isdir(d)]
forced_years = [int(d) for d in forced_directories if d !="T_sfc"... | 38.103896 | 172 | 0.608384 |
7b9e4f050d9aad972f8a6d45cf8fdb56fc59e846 | 12,031 | py | Python | test/unit/core/test_future.py | boto/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 13 | 2016-06-15T06:10:57.000Z | 2021-10-30T03:52:28.000Z | test/unit/core/test_future.py | DalavanCloud/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 11 | 2016-09-15T01:48:08.000Z | 2019-01-09T06:11:44.000Z | test/unit/core/test_future.py | DalavanCloud/botoflow | 49d8ed3bc9c57294504be82e933a051e1901b76e | [
"Apache-2.0"
] | 16 | 2016-06-05T03:42:04.000Z | 2022-03-01T17:43:14.000Z | import unittest
import logging
import pytest
from botoflow.core.async_event_loop import AsyncEventLoop
from botoflow.core.decorators import coroutine
from botoflow.core.base_future import BaseFuture, return_
from botoflow.core.future import AllFuture, AnyFuture, Future
from botoflow.core.exceptions import Cancellation... | 23.871032 | 82 | 0.519741 |
79939e1b1ce475d60aab4fbb0e962176c60b0714 | 111 | py | Python | pyech/__init__.py | CPA-Analytics/pyech | fe4dbfe601e31f3e670de356954b58ca93c42dc2 | [
"MIT"
] | null | null | null | pyech/__init__.py | CPA-Analytics/pyech | fe4dbfe601e31f3e670de356954b58ca93c42dc2 | [
"MIT"
] | 1 | 2022-01-22T02:42:56.000Z | 2022-01-22T02:42:56.000Z | pyech/__init__.py | CPA-Analytics/pyech | fe4dbfe601e31f3e670de356954b58ca93c42dc2 | [
"MIT"
] | 1 | 2022-01-17T12:03:48.000Z | 2022-01-17T12:03:48.000Z | from pyech.core import ECH
from pyech._version import __version__
__all__ = ["ECH"]
__version__ = __version__
| 18.5 | 38 | 0.792793 |
6c9505884cb6fb784d6aa2d214c781c58f1549fc | 7,065 | py | Python | pywikibot/tools/formatter.py | Darkdadaah/pywikibot-core | 6cad0915f3e058fe4cf2bce4f37d395d21636df9 | [
"MIT"
] | null | null | null | pywikibot/tools/formatter.py | Darkdadaah/pywikibot-core | 6cad0915f3e058fe4cf2bce4f37d395d21636df9 | [
"MIT"
] | null | null | null | pywikibot/tools/formatter.py | Darkdadaah/pywikibot-core | 6cad0915f3e058fe4cf2bce4f37d395d21636df9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Module containing various formatting related utilities."""
#
# (C) Pywikibot team, 2015-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__version__ = '$Id: 6c9505884cb6fb784d6aa2d214c781c58f1549fc $'
import inspect
import m... | 37.983871 | 80 | 0.602123 |
6395df1070468ebd537a8eb48c04f77a48fa1ecd | 133 | py | Python | django_backend/control_system/routing.py | teenkevo/UNM-MES | 498c544094bb01a0cfaa02ba8152beba4e695f8a | [
"MIT"
] | null | null | null | django_backend/control_system/routing.py | teenkevo/UNM-MES | 498c544094bb01a0cfaa02ba8152beba4e695f8a | [
"MIT"
] | null | null | null | django_backend/control_system/routing.py | teenkevo/UNM-MES | 498c544094bb01a0cfaa02ba8152beba4e695f8a | [
"MIT"
] | null | null | null | from django.urls import path, re_path
from . import consumers
websocket_urlpatterns = [
re_path(r'$', consumers.MQTTConsumer)
] | 19 | 41 | 0.75188 |
1151a73b5c1c7739d5a0fb41144d2b4f14d30ea8 | 11,033 | py | Python | Data-Structures/Python/Linkedlist-Stack-Queue.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 2 | 2021-12-13T10:09:47.000Z | 2022-01-05T11:04:31.000Z | Data-Structures/Python/Linkedlist-Stack-Queue.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 1 | 2021-10-15T17:55:47.000Z | 2021-10-17T20:43:15.000Z | Data-Structures/Python/Linkedlist-Stack-Queue.py | M-Usman-Tahir/Data-Structures-and-Algorithms | 08331182f0bbfd85fcdba50477dcf408b09a37cd | [
"Apache-2.0"
] | 4 | 2021-10-12T13:05:10.000Z | 2021-10-16T19:31:46.000Z | class Node:
def __init__(self, d = None):
self.data = d
self.Next = None
def __del__(self):
print("Node is deleted")
class linkedlist:
head = None
def __init__(self, size):
if size > 0:
self.insertAtHead(int(input("Enter the head value: ")))
... | 23.129979 | 157 | 0.491163 |
b9c7d1f2ff6785785ab63951c547401a1b91e415 | 1,137 | py | Python | tests/test_utils.py | dmonroy/k8s-app-abstraction | 3ccb388ac7882f569423ada5c5f3bf640ddcb1a2 | [
"MIT"
] | null | null | null | tests/test_utils.py | dmonroy/k8s-app-abstraction | 3ccb388ac7882f569423ada5c5f3bf640ddcb1a2 | [
"MIT"
] | null | null | null | tests/test_utils.py | dmonroy/k8s-app-abstraction | 3ccb388ac7882f569423ada5c5f3bf640ddcb1a2 | [
"MIT"
] | null | null | null | from textwrap import dedent
import pytest
from k8s_app_abstraction.utils import camelize, merge, parse_yaml
def test_merge_dict():
a = {"foo": "bar"}
b = {"baz": "spam"}
assert dict(merge(a, b)) == {"foo": "bar", "baz": "spam"}
def test_merge_yaml():
content = dedent(
"""
foo: bar... | 18.33871 | 65 | 0.475814 |
7654ff3b2d8db32802a0c8a5616dadc3ff4f1e8c | 14,229 | py | Python | test/operator/test_local_operator.py | pascal-vecsei/netket | 3985355234183e3f5a5a97d542a6240d490dcda2 | [
"Apache-2.0"
] | null | null | null | test/operator/test_local_operator.py | pascal-vecsei/netket | 3985355234183e3f5a5a97d542a6240d490dcda2 | [
"Apache-2.0"
] | null | null | null | test/operator/test_local_operator.py | pascal-vecsei/netket | 3985355234183e3f5a5a97d542a6240d490dcda2 | [
"Apache-2.0"
] | null | null | null | from netket.operator.boson import (
create as bcreate,
destroy as bdestroy,
number as bnumber,
)
from netket.operator.spin import sigmax, sigmay, sigmaz, sigmam, sigmap
from netket.operator import AbstractOperator, LocalOperator
import netket as nk
import numpy as np
import pytest
from pytest import raises
... | 29.582121 | 88 | 0.631176 |
a8f5349cbc59ec3daf89999b902a23d7ddc8bcdb | 3,574 | py | Python | perfkitbenchmarker/linux_packages/azure_cli.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 3 | 2018-04-28T13:06:14.000Z | 2020-06-09T02:39:44.000Z | perfkitbenchmarker/linux_packages/azure_cli.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 1 | 2018-03-15T21:01:27.000Z | 2018-03-15T21:01:27.000Z | perfkitbenchmarker/linux_packages/azure_cli.py | Nowasky/PerfKitBenchmarker | cfa88e269eb373780910896ed4bdc8db09469753 | [
"Apache-2.0"
] | 6 | 2019-06-11T18:59:57.000Z | 2021-03-02T19:14:42.000Z | # Copyright 2018 PerfKitBenchmarker 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... | 33.092593 | 82 | 0.728595 |
39cc3539fce6f3e368b51d8e9c732a42b3898782 | 13,926 | py | Python | cogs/Reddit.py | jali-clarke/HamoodBot | 85fb5a08dcbda42a99b3bdccf9a05cd921e2ed81 | [
"MIT"
] | null | null | null | cogs/Reddit.py | jali-clarke/HamoodBot | 85fb5a08dcbda42a99b3bdccf9a05cd921e2ed81 | [
"MIT"
] | null | null | null | cogs/Reddit.py | jali-clarke/HamoodBot | 85fb5a08dcbda42a99b3bdccf9a05cd921e2ed81 | [
"MIT"
] | null | null | null | import os
import random
import discord
from discord.ext import commands
import asyncio
# from modules.reddit_functions import findPost, cachePosts, do_cache
import modules.checks as checks
from utils.reddit import Redditing
class Reddit(commands.Cog):
"""Get Reddit Posts"""
def __init__(self, bot):
... | 36.647368 | 151 | 0.560175 |
fdee84c181b9c8979a8150f5bf8bcb5b44cb2979 | 22,544 | py | Python | fairseq/checkpoint_utils.py | oshaikh13/fairseq | 81677d751de120f69eef0c3eb36e849c977f7814 | [
"MIT"
] | 9 | 2020-10-24T06:20:12.000Z | 2021-12-17T14:35:04.000Z | fairseq/checkpoint_utils.py | oshaikh13/fairseq | 81677d751de120f69eef0c3eb36e849c977f7814 | [
"MIT"
] | 2 | 2021-03-31T10:58:54.000Z | 2021-05-07T09:50:52.000Z | fairseq/checkpoint_utils.py | oshaikh13/fairseq | 81677d751de120f69eef0c3eb36e849c977f7814 | [
"MIT"
] | 3 | 2021-04-12T05:06:25.000Z | 2021-09-16T11:07:56.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import ast
import collections
import logging
import os
import re
import traceback
from collections import OrderedDict
from typing import Optio... | 36.89689 | 114 | 0.640481 |
bc7b7fee508880070c5d0031ad019c552ff1d058 | 2,751 | py | Python | test.py | willway1023yx/adaloss | f44ca3c646ba4427ff596c6af757038b44ef6d73 | [
"Apache-2.0"
] | 2 | 2021-12-19T03:36:50.000Z | 2021-12-28T02:00:59.000Z | test.py | willway1023yx/adaloss | f44ca3c646ba4427ff596c6af757038b44ef6d73 | [
"Apache-2.0"
] | null | null | null | test.py | willway1023yx/adaloss | f44ca3c646ba4427ff596c6af757038b44ef6d73 | [
"Apache-2.0"
] | null | null | null | import argparse
import torch
import data_loader.data_loaders as module_data
import model.loss as module_loss
import model.metric as module_metric
import model.model as module_arch
from parse_config import ConfigParser
def main(config):
logger = config.get_logger('test')
# setup data_loader instances
data... | 33.54878 | 93 | 0.640494 |
ba33e3089c0bf607bc3a85399eb9167f0b2203fd | 35 | py | Python | test/helpers/__init__.py | maxwell-gregory/python-hcl2 | 6d5cece287e593215b177f53dff5c9f95eaf4277 | [
"MIT"
] | 128 | 2019-10-10T12:16:01.000Z | 2022-03-30T12:09:03.000Z | test/helpers/__init__.py | maxwell-gregory/python-hcl2 | 6d5cece287e593215b177f53dff5c9f95eaf4277 | [
"MIT"
] | 202 | 2016-03-08T17:13:08.000Z | 2019-02-01T00:49:06.000Z | test/helpers/__init__.py | maxwell-gregory/python-hcl2 | 6d5cece287e593215b177f53dff5c9f95eaf4277 | [
"MIT"
] | 29 | 2019-09-13T16:53:12.000Z | 2022-01-24T23:44:13.000Z | """
Helper functions for tests
"""
| 8.75 | 26 | 0.657143 |
1fdfe88dd0ae4d25aeb711a26c4d84dbff1ea08b | 5,364 | py | Python | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/mqs_forwarding.py | NQLoong/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/mqs_forwarding.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/mqs_forwarding.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class MqsForwarding:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is j... | 24.833333 | 100 | 0.554437 |
97adf4f5da1925d1807e30f6ee55207b1e86d119 | 827 | py | Python | userbot/congo.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/congo.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/congo.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | import random
from uniborg.util import lightning_cmd
RUNSREACTS = [
"`Congratulations and BRAVO!`",
"`You did it! So proud of you!`",
"`This calls for celebrating! Congratulations!`",
"`I knew it was only a matter of time. Well done!`",
"`Congratulations on your well-deserved success.`",
"`Hea... | 31.807692 | 75 | 0.685611 |
df037d4bf1ca2dc4ffa0c30eeccfe29ac6f2cf95 | 476 | py | Python | edfi_performance/tasks/pipeclean/report_card.py | Ed-Fi-Exchange-OSS/Suite-3-Performance-Testing | a15efafd5b209b6a82a84c7ee6bce215470dfd21 | [
"Apache-2.0"
] | null | null | null | edfi_performance/tasks/pipeclean/report_card.py | Ed-Fi-Exchange-OSS/Suite-3-Performance-Testing | a15efafd5b209b6a82a84c7ee6bce215470dfd21 | [
"Apache-2.0"
] | 10 | 2021-03-20T05:02:17.000Z | 2022-03-30T17:19:35.000Z | edfi_performance/tasks/pipeclean/report_card.py | Ed-Fi-Exchange-OSS/Ed-Fi-X-ODS-Performance | 05678a2c8c314d69a5e6b9ed3040800835b91582 | [
"Apache-2.0"
] | 1 | 2022-03-25T09:09:32.000Z | 2022-03-25T09:09:32.000Z | # SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
from edfi_performance.tasks.pipeclean import EdFiPipe... | 39.666667 | 85 | 0.804622 |
ba790d8a1cf9bbe3db1bb87d7be3a52f2da86044 | 2,918 | py | Python | smtm/simulation_trader.py | msaltnet/smtm | b2b480a59204e7d730d60ec037b00660d9dd235d | [
"MIT"
] | 16 | 2020-02-21T08:18:04.000Z | 2022-03-29T06:34:29.000Z | smtm/simulation_trader.py | msaltnet/smtm | b2b480a59204e7d730d60ec037b00660d9dd235d | [
"MIT"
] | 31 | 2019-11-11T13:06:47.000Z | 2022-02-26T12:14:41.000Z | smtm/simulation_trader.py | msaltnet/smtm | b2b480a59204e7d730d60ec037b00660d9dd235d | [
"MIT"
] | 12 | 2020-07-03T06:44:22.000Z | 2022-03-30T03:03:05.000Z | """시뮬레이션을 위한 가상 거래를 처리"""
from .log_manager import LogManager
from .trader import Trader
from .virtual_market import VirtualMarket
class SimulationTrader(Trader):
"""
거래 요청 정보를 받아서 거래소에 요청하고 거래소에서 받은 결과를 제공해주는 클래스
id: 요청 정보 id "1607862457.560075"
type: 거래 유형 sell, buy, cancel
price: 거래 가격
am... | 29.474747 | 77 | 0.569911 |
084a5d3e33ed5b60adaab5050c9e171239a49771 | 8,606 | py | Python | baselines/a2c/a2c.py | seungjaeryanlee/baselines-tf2 | 299c2e6fb0b1dc8dd5f25c826eb004cf276a5bfe | [
"MIT"
] | 10 | 2019-06-18T16:20:20.000Z | 2021-01-10T04:18:07.000Z | baselines/a2c/a2c.py | seungjaeryanlee/baselines-tf2 | 299c2e6fb0b1dc8dd5f25c826eb004cf276a5bfe | [
"MIT"
] | 5 | 2019-07-02T03:11:00.000Z | 2020-07-27T17:32:41.000Z | baselines/a2c/a2c.py | seungjaeryanlee/baselines-tf2 | 299c2e6fb0b1dc8dd5f25c826eb004cf276a5bfe | [
"MIT"
] | 6 | 2019-06-03T23:03:40.000Z | 2021-03-09T06:51:28.000Z | import time
import functools
import tensorflow as tf
from baselines import logger
from baselines.common import set_global_seeds, explained_variance
from baselines.common.models import get_network_builder
from baselines.common.policies import PolicyWithValue
from baselines.a2c.utils import InverseLinearTimeDecay
from... | 41.980488 | 186 | 0.677899 |
c2a851b5eb8b2371cf00feba402d11995ae88b99 | 1,271 | py | Python | src/test_led.py | ivyleavedtoadflax/elec | e3382dc41d8366516b07287980283a8da8b5613a | [
"MIT"
] | null | null | null | src/test_led.py | ivyleavedtoadflax/elec | e3382dc41d8366516b07287980283a8da8b5613a | [
"MIT"
] | null | null | null | src/test_led.py | ivyleavedtoadflax/elec | e3382dc41d8366516b07287980283a8da8b5613a | [
"MIT"
] | null | null | null | #!/usr/bin/python
import RPi.GPIO as GPIO
from time import sleep
from random import randint
from sys import argv
# (ORANGE) 3.3v [][] 5v (RED)
# I2C0 SDA [][] DO NOT CONNECT
# I2C0 SCL [][] GROUND (BLACK)
# (GREEN) GPIO 4 [][] UART TXD
# DO NOT CONNECT [][] UART RXD
# (YELLOW) GPIO 17[][] GPIO 18 (ORANGE)
# (BLUE) GP... | 23.109091 | 83 | 0.588513 |
e905d8322d89d74c0b333319e23d5eba52cc022a | 4,559 | py | Python | model_zoo/research/cv/centernet/src/post_process.py | kungfu-team/mindspore-bert | 71501cf52ae01db9d6a73fb64bcfe68a6509dc32 | [
"Apache-2.0"
] | 2 | 2021-07-08T13:10:42.000Z | 2021-11-08T02:48:57.000Z | model_zoo/research/cv/centernet/src/post_process.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"Apache-2.0"
] | null | null | null | model_zoo/research/cv/centernet/src/post_process.py | peixinhou/mindspore | fcb2ec2779b753e95c762cf292b23bd81d1f561b | [
"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... | 38.310924 | 96 | 0.621189 |
fc24932b2969b5973194eb8a469a86bbc9bec756 | 1,452 | py | Python | ibis/common/caching.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | ibis/common/caching.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | ibis/common/caching.py | rtpsw/ibis | d7318fdf87121cd8fadbcf0369a2b217aab3053a | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import weakref
from typing import MutableMapping
class WeakCache(MutableMapping):
__slots__ = ('_data',)
def __init__(self):
object.__setattr__(self, '_data', {})
def __setattr__(self, name, value):
raise TypeError(f"can't set {name}")
def __len_... | 29.04 | 75 | 0.651515 |
b6483be7763aed2fe9a18bd62637f0fb34f68fde | 7,917 | py | Python | coremltools/converters/nnssa/commons/basic_graph_ops.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 2 | 2020-01-07T21:27:38.000Z | 2020-11-21T06:02:50.000Z | coremltools/converters/nnssa/commons/basic_graph_ops.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | 2 | 2019-03-28T00:17:14.000Z | 2019-03-28T00:17:47.000Z | coremltools/converters/nnssa/commons/basic_graph_ops.py | Gerzer/coremltools | 47e2010a68668bd1960dca040f5f87c0e66a0cbd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function as _
from __future__ import division as _
from __future__ import absolute_import as _
def connect_edge(g, source, dest):
g[source].outputs.append(dest)
g[dest].inputs.append(source)
def replace_source(g, source, dest, new_source):
for idx, d ... | 30.333333 | 97 | 0.600101 |
c5cf52b8cea2124f0a65e155ca713cd9c6c264d1 | 2,413 | py | Python | venv/lib/python3.5/site-packages/extract_msg/dev.py | andrewcgarber/NoteSmoosh | 1e9b95cf276ae1b78c846027f8ada98f266a30c7 | [
"DOC"
] | null | null | null | venv/lib/python3.5/site-packages/extract_msg/dev.py | andrewcgarber/NoteSmoosh | 1e9b95cf276ae1b78c846027f8ada98f266a30c7 | [
"DOC"
] | 16 | 2020-01-28T23:10:19.000Z | 2021-09-08T01:29:55.000Z | venv/lib/python3.5/site-packages/extract_msg/dev.py | andrewcgarber/NoteSmoosh | 1e9b95cf276ae1b78c846027f8ada98f266a30c7 | [
"DOC"
] | null | null | null | """
Module for collecting data to be sent to the developer.
"""
# NOTE: Order of tasks:
# 1. Check for exceptions:
# * Check the entire process for exceptions raised by a specific file and log them. If none occur,
# log something like "No exceptions were detected."
# 2. Run the file through the dev... | 35.485294 | 105 | 0.647327 |
f61f365c1a69a01a7981ff1149cae2de942c5cd2 | 2,705 | py | Python | compiler/tests/06_hierarchical_decoder_test.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | 1 | 2022-02-17T22:12:46.000Z | 2022-02-17T22:12:46.000Z | compiler/tests/06_hierarchical_decoder_test.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | compiler/tests/06_hierarchical_decoder_test.py | ycyang0508/OpenRAM | 54c6043cb81c51f5f4a2f77e91145545ce0ed6d6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# See LICENSE for licensing information.
#
# Copyright (c) 2016-2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import unittest
from test... | 37.054795 | 82 | 0.698336 |
f26f1255d10059846da24e526284e16f48f0d7ed | 395 | py | Python | dataminer/dataminer.py | eklez/DataMiner | ccd77406751793388623464876052ac2823ed1d4 | [
"MIT"
] | null | null | null | dataminer/dataminer.py | eklez/DataMiner | ccd77406751793388623464876052ac2823ed1d4 | [
"MIT"
] | null | null | null | dataminer/dataminer.py | eklez/DataMiner | ccd77406751793388623464876052ac2823ed1d4 | [
"MIT"
] | null | null | null | from .imgconverter import ImgConverter
from .unpacker import Unpacker
from .util.json import loadJson
class Dataminer:
def __init__(self, config="dataminer2.json"):
self.config = loadJson(config)
if self.config is None:
print("Dataminer configuration file missing")
return
... | 24.6875 | 57 | 0.681013 |
8144c661360d5f6abebdc93c3834a73d80bf2fd1 | 9,731 | py | Python | drfexts/style_old.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | 4 | 2021-12-08T10:50:37.000Z | 2022-03-05T03:54:56.000Z | drfexts/style_old.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | 1 | 2022-02-17T02:34:40.000Z | 2022-02-17T02:34:40.000Z | drfexts/style_old.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
from typing import Dict, List, Optional
from django.utils.encoding import force_str
from rest_framework import serializers
from rest_framework.utils.field_mapping import ClassLookupDict
sentinel = object()
INPUT_TYPE_NONE = None # 不支持搜索
INPUT_TYPE_INPUT = "input"
INPUT_TYPE_SELEC... | 30.794304 | 115 | 0.612167 |
7b46ddbc7d84457be110e28f189ed1c3b7aff247 | 1,340 | py | Python | main.py | AdamaTraore75020/PYBomber | 38a1d2107a3a6b07085b89f61ecd1bc55cd673e3 | [
"MIT"
] | null | null | null | main.py | AdamaTraore75020/PYBomber | 38a1d2107a3a6b07085b89f61ecd1bc55cd673e3 | [
"MIT"
] | null | null | null | main.py | AdamaTraore75020/PYBomber | 38a1d2107a3a6b07085b89f61ecd1bc55cd673e3 | [
"MIT"
] | null | null | null | import pygame
import bombe
import board
import player
from pygame.locals import *
pygame.init()
maxWidth = 440
maxHeight = 440
window = pygame.display.set_mode((maxWidth, maxHeight))
bombX = 0
bombY = 0
bomb = None
board = board.Board(maxWidth, maxHeight, window)
walls = board.createBoard(window)
pygame.display.fl... | 23.928571 | 108 | 0.664925 |
b64b106008474af054ba2c9d5e9d84da4c7a36a7 | 13,619 | py | Python | examples/withRaycing/12_Multilayer/BalderDMM.py | adinatan/xrt | 75b884c0cba7e1aac15b30f2d0d803597328a208 | [
"MIT"
] | 71 | 2016-07-04T06:40:52.000Z | 2022-03-31T10:03:07.000Z | examples/withRaycing/12_Multilayer/BalderDMM.py | adinatan/xrt | 75b884c0cba7e1aac15b30f2d0d803597328a208 | [
"MIT"
] | 99 | 2016-07-10T16:39:05.000Z | 2022-03-28T07:50:10.000Z | examples/withRaycing/12_Multilayer/BalderDMM.py | adinatan/xrt | 75b884c0cba7e1aac15b30f2d0d803597328a208 | [
"MIT"
] | 30 | 2016-07-08T17:12:30.000Z | 2022-03-30T06:54:21.000Z | # -*- coding: utf-8 -*-
"""This module describes the beamline CLÆSS to be imported by
``traceBalderBL.py`` script."""
__author__ = "Konstantin Klementiev", "Roman Chernikov"
__date__ = "07 Jan 2016"
import math
import numpy as np
import os, sys; sys.path.append(os.path.join('..', '..', '..')) # analysis:ignore
impor... | 43.098101 | 82 | 0.642338 |
70bcbedae5209bb917c3e26043e49cfc8d6d0a0c | 2,705 | py | Python | app/recipe/tests/test_ingredient_api.py | minisonstis/recipe-app-api | 79d58b7f71e25270d9f96658e5681cdaa27e20a6 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | minisonstis/recipe-app-api | 79d58b7f71e25270d9f96658e5681cdaa27e20a6 | [
"MIT"
] | null | null | null | app/recipe/tests/test_ingredient_api.py | minisonstis/recipe-app-api | 79d58b7f71e25270d9f96658e5681cdaa27e20a6 | [
"MIT"
] | null | null | null | from urllib import response
from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Ingredient
from recipe.serializers import IngredientSerializer
INGREDIENTS_... | 35.12987 | 84 | 0.70647 |
8f6d0b35d7a075ebd240a49a99a4e513a0bd6f87 | 2,562 | py | Python | libsheep/tth.py | exogen/80sheep | a6da85f6c10c8088e2c86a186c2934e71e8d2d16 | [
"MIT"
] | 1 | 2016-05-09T03:32:09.000Z | 2016-05-09T03:32:09.000Z | libsheep/tth.py | exogen/80sheep | a6da85f6c10c8088e2c86a186c2934e71e8d2d16 | [
"MIT"
] | null | null | null | libsheep/tth.py | exogen/80sheep | a6da85f6c10c8088e2c86a186c2934e71e8d2d16 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from types import *
from base64 import b32encode
from mhash import MHASH, MHASH_TIGER
def tiger(chunk):
'''Hashes the string parameter'''
return MHASH(MHASH_TIGER, chunk).digest()
class node(object):
'''Represents a node in the tiger tree hash'''
def __init__(self, leaves):
... | 25.878788 | 79 | 0.52459 |
b1dc72037bf251fa12efb996754fea7781c71f3a | 429 | py | Python | ui/icon.py | 0v3rl0w/didactic-rotary-phone | 8bb43d15162137bdc1dd9ffdb60e4b80f6c1db75 | [
"MIT"
] | 1 | 2021-03-22T22:13:06.000Z | 2021-03-22T22:13:06.000Z | ui/icon.py | 0v3rl0w/didactic-rotary-phone | 8bb43d15162137bdc1dd9ffdb60e4b80f6c1db75 | [
"MIT"
] | null | null | null | ui/icon.py | 0v3rl0w/didactic-rotary-phone | 8bb43d15162137bdc1dd9ffdb60e4b80f6c1db75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import pygame
class Icon:
def __init__(self, Appath: str, iconPath: str):
img = pygame.image.load(iconPath).convert_alpha()
self.surface = pygame.transform.scale(img, (50, 50))
self.appName = Appath.split('/')[-1]
def get_surface(self) ->... | 25.235294 | 60 | 0.62704 |
88adcef0f79139580986dbe36a88a5bcc1f040a8 | 8,257 | py | Python | kratos/tests/test_geometries.py | Gaoliu19910601/Kratos | 0bac5e132d02061680fc90f1e52d4930b5ed7fa3 | [
"BSD-4-Clause"
] | null | null | null | kratos/tests/test_geometries.py | Gaoliu19910601/Kratos | 0bac5e132d02061680fc90f1e52d4930b5ed7fa3 | [
"BSD-4-Clause"
] | 1 | 2019-10-15T13:11:37.000Z | 2019-10-15T13:11:37.000Z | kratos/tests/test_geometries.py | Gaoliu19910601/Kratos | 0bac5e132d02061680fc90f1e52d4930b5ed7fa3 | [
"BSD-4-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division
import KratosMultiphysics.KratosUnittest as KratosUnittest
import KratosMultiphysics as KM
class TestGeometry(KratosUnittest.TestCase):
def setUp(self):
pass
def test_tetrahedra_3D4N(self):
current_model = KM.Model()
... | 35.13617 | 87 | 0.622623 |
2853b6f0fe2869a2cc660c51433d816ce1f7f589 | 40,450 | py | Python | dali/python/nvidia/dali/pipeline.py | Kh4L/DALI | ac04c55d06ba804aaa44d3a50dfc5d4f80312e5a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/pipeline.py | Kh4L/DALI | ac04c55d06ba804aaa44d3a50dfc5d4f80312e5a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/python/nvidia/dali/pipeline.py | Kh4L/DALI | ac04c55d06ba804aaa44d3a50dfc5d4f80312e5a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 41.917098 | 135 | 0.628282 |
482a77513c539e1d22486e28d8746987a4f69002 | 1,687 | py | Python | Scrapers/SeleniumScrap.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | 3 | 2021-07-21T16:20:01.000Z | 2022-03-27T18:25:09.000Z | Scrapers/SeleniumScrap.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | 1 | 2021-06-28T18:08:19.000Z | 2021-06-28T18:35:26.000Z | Scrapers/SeleniumScrap.py | Eric-Canas/bet-arbitrage-analysis | ac1b6939a7688bcefeb3e53fbd584adf3a2cb16c | [
"MIT"
] | null | null | null | from selenium import webdriver
from Constants import *
from time import sleep
from random import uniform, shuffle
from lxml import html
from Scrapers.commons import *
sports_with_other_markets = ['futbol']
class SeleniumScrap():
def __init__(self):
self.driver = webdriver.Chrome('./Drivers/chro... | 44.394737 | 104 | 0.633669 |
b93d3a9bc8c0cc14f98b70f8f8605d3465f944ee | 2,345 | py | Python | mapsite/mapapp/tests.py | pkolios/map-spa | 7f066377711aeb2864205b49874c48c83dc3f04f | [
"MIT"
] | null | null | null | mapsite/mapapp/tests.py | pkolios/map-spa | 7f066377711aeb2864205b49874c48c83dc3f04f | [
"MIT"
] | null | null | null | mapsite/mapapp/tests.py | pkolios/map-spa | 7f066377711aeb2864205b49874c48c83dc3f04f | [
"MIT"
] | null | null | null | from django.test import TestCase, override_settings
from django.urls import reverse
from . import models
def create_address(full_address, lat=10.0, lon=20.0):
"""
Creates an address with the given `full_address`.
"""
return models.Address.objects.create(
full_address=full_address, lat=lat, lo... | 35.530303 | 78 | 0.660981 |
d71c61540a0e1ea5c9c7a241935993afa00e4644 | 13,595 | py | Python | test/color/test_ycbcr.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-10-21T05:13:51.000Z | 2021-10-21T05:13:51.000Z | test/color/test_ycbcr.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2022-03-12T01:08:10.000Z | 2022-03-12T01:08:10.000Z | test/color/test_ycbcr.py | connorlee77/kornia | af5b1f76bedf2a7fc0e0da2386b1be3032b6534f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-02-09T02:19:32.000Z | 2021-02-09T02:19:32.000Z | import pytest
import kornia
import kornia.testing as utils # test utils
import cv2
import numpy as np
import torch
from torch.autograd import gradcheck
from torch.testing import assert_allclose
class TestRgbToYcbcr:
def test_rgb_to_ycbcr(self):
data = torch.tensor([[[0.7925, 0.8704, 0.2771, 0.3279, 0... | 54.598394 | 96 | 0.448915 |
4d08d4d14a74f0d661fe7fa7b1222bbfb847dddf | 746 | py | Python | PythonAPI/pythonwrappers/jetfuel/locale/__init__.py | InsightGit/JetfuelGameEngine | 3ea0bf2fb5e09aadf304b7b5a16882d72336c408 | [
"Apache-2.0"
] | 4 | 2018-02-05T03:40:10.000Z | 2021-06-18T16:22:13.000Z | PythonAPI/pythonwrappers/jetfuel/locale/__init__.py | InsightGit/JetfuelGameEngine | 3ea0bf2fb5e09aadf304b7b5a16882d72336c408 | [
"Apache-2.0"
] | null | null | null | PythonAPI/pythonwrappers/jetfuel/locale/__init__.py | InsightGit/JetfuelGameEngine | 3ea0bf2fb5e09aadf304b7b5a16882d72336c408 | [
"Apache-2.0"
] | null | null | null | # Project Neon- A moddable 2D RPG game engine
# Copyright (C) 2018 InfernoStudios
#
# Project Neon is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | 49.733333 | 73 | 0.735925 |
dce2b1a447eb4bc5ab3237141e1ea0da32a5c9c4 | 2,436 | py | Python | train/runClf.py | gcramerb/TransferLearning-Sensors | 44d7847d28ac8ae66e74bd458c612f76a1725946 | [
"MIT"
] | null | null | null | train/runClf.py | gcramerb/TransferLearning-Sensors | 44d7847d28ac8ae66e74bd458c612f76a1725946 | [
"MIT"
] | null | null | null | train/runClf.py | gcramerb/TransferLearning-Sensors | 44d7847d28ac8ae66e74bd458c612f76a1725946 | [
"MIT"
] | null | null | null | import sys
sys.path.insert(0, '../')
#import geomloss
import torch
from pytorch_lightning import Trainer
from pytorch_lightning.callbacks import EarlyStopping,ModelCheckpoint
from pytorch_lightning.loggers import WandbLogger
from train.trainerClf import networkLight
from dataProcessing.dataModule import SingleDatase... | 30.074074 | 82 | 0.635057 |
6f208d52fb62d73a4dbb3d18adbf09eae1e3e610 | 1,096 | py | Python | examples/rectifier/gen.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 20 | 2019-05-14T10:13:44.000Z | 2022-03-29T14:34:50.000Z | examples/rectifier/gen.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 43 | 2019-07-16T20:54:22.000Z | 2021-08-10T07:06:48.000Z | examples/rectifier/gen.py | SubjeBilisim/anasymod | d93f656c21e2aa238f7a5ada50955cc7dc615df1 | [
"BSD-3-Clause"
] | 5 | 2019-10-21T09:53:38.000Z | 2021-09-29T18:08:59.000Z | import os.path
from argparse import ArgumentParser
from msdsl import MixedSignalModel, VerilogGenerator
from anasymod import get_full_path
def main(tau=1e-6):
print('Running model generator...')
# parse command line arguments
parser = ArgumentParser()
parser.add_argument('-o', '--output', type=str)
... | 26.731707 | 78 | 0.679745 |
72ff48b1c51f256182686f657391d73a9d4f99c3 | 3,848 | py | Python | main.py | Harry-Hopkinson/Pong | d3bdf69b5c9915dff304f45454921ff3f522d1d9 | [
"Apache-2.0"
] | 3 | 2021-11-29T16:50:53.000Z | 2021-12-11T20:50:31.000Z | main.py | Harry-Hopkinson/Pong | d3bdf69b5c9915dff304f45454921ff3f522d1d9 | [
"Apache-2.0"
] | null | null | null | main.py | Harry-Hopkinson/Pong | d3bdf69b5c9915dff304f45454921ff3f522d1d9 | [
"Apache-2.0"
] | null | null | null | ### Imports ###
import turtle
import random
import time
from constants import *
# Create screen
sc = turtle.Screen()
sc.title("Pong game")
sc.bgcolor("white")
sc.setup(width=1000, height=600)
# Left paddle
left_pad = turtle.Turtle()
left_pad.speed(0)
left_pad.shape("square")
left_pad.color("black")
... | 22.372093 | 141 | 0.634356 |
9385969a5d054b49868026ccef26500eaa7adb9b | 4,178 | py | Python | backend/src/accounts/api/serializers.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null | backend/src/accounts/api/serializers.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null | backend/src/accounts/api/serializers.py | rcmiskin10/mob_files | dd4932c15c96bea914ffa99b72c83d471a4bfaff | [
"MIT"
] | null | null | null |
import os
from accounts.models import User, BusinessProfile, EventProfile
from rest_framework import serializers
import jwt
from django.utils.translation import gettext as _
import stripe
stripe.api_key = os.environ.get('STRIPE_SK_TEST_KEY')
class UserCreateSerializer(serializers.ModelSerializer):
email = seriali... | 29.422535 | 97 | 0.679512 |
bf26ca1b43003ff682499b9a215561c1a5c32427 | 2,069 | py | Python | tests/test-viewport-window-origin.py | 6tudent/pyemf | 830e61008af8acf1830e5c91dc876313a771afdb | [
"BSD-3-Clause-No-Nuclear-Warranty"
] | 16 | 2016-01-22T01:40:10.000Z | 2021-07-22T02:19:24.000Z | tests/test-viewport-window-origin.py | 6tudent/pyemf | 830e61008af8acf1830e5c91dc876313a771afdb | [
"BSD-3-Clause-No-Nuclear-Warranty"
] | 1 | 2017-11-07T11:53:14.000Z | 2017-11-07T11:53:14.000Z | tests/test-viewport-window-origin.py | jeremysanders/pyemf | 830e61008af8acf1830e5c91dc876313a771afdb | [
"BSD-3-Clause-No-Nuclear-Warranty"
] | 11 | 2017-02-28T21:02:26.000Z | 2020-10-21T19:23:29.000Z | #!/usr/bin/env python
import pyemf
print("Test of viewport origin and window origin.")
def path(emf,text,x,y,size=300):
emf.TextOut(x,y,text);
y+=50
emf.BeginPath()
emf.MoveTo(x,y)
emf.LineTo(x+100,y+300)
emf.ArcTo(x+100,y+300,x+100+size,y+300+size,x+100,y+300,x+100+size,y+300)
emf... | 27.223684 | 77 | 0.672305 |
81003caefd6771ab0d6462496001fea0ded16294 | 74,902 | py | Python | macOS/Xcode/Maestral/Maestral/app_packages/maestral/client.py | SamSchott/maestral-cocoa | bb031b2df010ae84e058fadd3a1b10b19d23b762 | [
"MIT"
] | 8 | 2020-11-13T08:48:01.000Z | 2021-12-16T06:30:27.000Z | macOS/Xcode/Maestral/Maestral/app_packages/maestral/client.py | SamSchott/maestral-cocoa | bb031b2df010ae84e058fadd3a1b10b19d23b762 | [
"MIT"
] | 4 | 2021-08-23T20:41:39.000Z | 2021-11-16T08:43:58.000Z | macOS/Xcode/Maestral/Maestral/app_packages/maestral/client.py | SamSchott/maestral-cocoa | bb031b2df010ae84e058fadd3a1b10b19d23b762 | [
"MIT"
] | 1 | 2021-11-09T07:14:44.000Z | 2021-11-09T07:14:44.000Z | # -*- coding: utf-8 -*-
"""
This modules contains the Dropbox API client. It wraps calls to the Dropbox Python SDK
and handles exceptions, chunked uploads or downloads, etc.
"""
# system imports
import errno
import os
import os.path as osp
import time
import logging
import contextlib
from datetime import datetime, tim... | 38.649123 | 94 | 0.597714 |
25ffd1f78709692efdbfa22b8b7a11c75c975b2d | 7,874 | py | Python | sdk/python/pulumi_azure_native/peering/peering_service.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/peering/peering_service.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/peering/peering_service.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"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
from .. import _utilities, _tables
from ... | 44.485876 | 983 | 0.660147 |
0cab9fcd5fe44f4bebf013e893f58404ac35a2db | 2,339 | py | Python | src/wagtailmedia/forms.py | cursive-works/wagtailmedia | 28383a8445d891059a5e709ce747a9a48b30c277 | [
"BSD-3-Clause"
] | 176 | 2016-05-05T03:02:12.000Z | 2022-03-23T08:08:43.000Z | src/wagtailmedia/forms.py | cursive-works/wagtailmedia | 28383a8445d891059a5e709ce747a9a48b30c277 | [
"BSD-3-Clause"
] | 113 | 2016-10-17T15:59:58.000Z | 2022-03-21T14:45:15.000Z | src/wagtailmedia/forms.py | cursive-works/wagtailmedia | 28383a8445d891059a5e709ce747a9a48b30c277 | [
"BSD-3-Clause"
] | 69 | 2016-06-17T17:10:33.000Z | 2022-03-08T18:20:46.000Z | from __future__ import unicode_literals
from django import forms
from django.forms.models import modelform_factory
from django.utils.module_loading import import_string
from django.utils.translation import gettext_lazy as _
from wagtail.admin import widgets
from wagtail.admin.forms.collections import (
BaseCollec... | 31.186667 | 81 | 0.704147 |
a10a8ac78f1c70773d3b175781d3b1bfa9fbaee1 | 11,981 | py | Python | examples/test_efi_ipxe_sanboot.py | inakypg/tcf | 569e21b25c8ee72ebad0c80d0a7de0714411185f | [
"Apache-2.0"
] | 1 | 2018-08-31T06:48:14.000Z | 2018-08-31T06:48:14.000Z | examples/test_efi_ipxe_sanboot.py | inakypg/tcf | 569e21b25c8ee72ebad0c80d0a7de0714411185f | [
"Apache-2.0"
] | null | null | null | examples/test_efi_ipxe_sanboot.py | inakypg/tcf | 569e21b25c8ee72ebad0c80d0a7de0714411185f | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
""".. _example_efi_pxe_sanboot:
Boot an ISO image off the network with EDK2 EFI BIOS and iPXE
=============================================================
Given a machine that ... | 51.420601 | 203 | 0.638845 |
27ec035a2359e43315a2b6537316e4236e175035 | 1,873 | py | Python | Kaggle_Dataset_Preprocess.py | MoonLight314/Mask_Detection | b45f9f74182ad08ed436d6477dab5f72804194fe | [
"Apache-2.0"
] | null | null | null | Kaggle_Dataset_Preprocess.py | MoonLight314/Mask_Detection | b45f9f74182ad08ed436d6477dab5f72804194fe | [
"Apache-2.0"
] | null | null | null | Kaggle_Dataset_Preprocess.py | MoonLight314/Mask_Detection | b45f9f74182ad08ed436d6477dab5f72804194fe | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import xml.etree.ElementTree as et
from tqdm import tqdm
import os
dir_path = "./Dataset/Face_Mask_Detection_Dataset_Kaggle/annotations/"
data_file_path = []
for (root, directories, files) in tqdm(os.walk(dir_path)):
for file in files:
if '.xml' in file:
file_path = os.pat... | 23.4125 | 70 | 0.439936 |
18a5881e97644219e7d4b87f7909b084e19054dd | 7,503 | py | Python | plotting/plot_beams.py | sjforeman/RadioFisher | fe25f969de9a700c5697168ba9e0d2645c55ed81 | [
"AFL-3.0"
] | 3 | 2020-12-05T11:28:47.000Z | 2021-07-09T02:42:21.000Z | plotting/plot_beams.py | sjforeman/RadioFisher | fe25f969de9a700c5697168ba9e0d2645c55ed81 | [
"AFL-3.0"
] | null | null | null | plotting/plot_beams.py | sjforeman/RadioFisher | fe25f969de9a700c5697168ba9e0d2645c55ed81 | [
"AFL-3.0"
] | 2 | 2021-07-09T02:42:23.000Z | 2021-11-30T06:37:47.000Z | #!/usr/bin/python
"""
Compare the transverse beams for a set of experiments. (Fig. 30)
"""
import numpy as np
import pylab as P
from rfwrapper import rf
import matplotlib.patches
import matplotlib.cm
import os
from radiofisher import euclid
from radiofisher.units import *
e = rf.experiments
cosmo = rf.experiments.cosm... | 33.495536 | 119 | 0.54898 |
18bc07d023d1ae2c2a479f457d7529b9d445322a | 147 | py | Python | newnnfw/tools/tflitefile_tool/tflite/CustomOptionsFormat.py | kosslab-kr/Tizen-NN-Framework | 132fc98ed57e4b19ad1f4cb258ad79fa9df1db7a | [
"Apache-2.0"
] | 8 | 2018-09-10T01:32:26.000Z | 2020-05-13T06:05:40.000Z | newnnfw/tools/tflitefile_tool/tflite/CustomOptionsFormat.py | kosslab-kr/Tizen-NN-Framework | 132fc98ed57e4b19ad1f4cb258ad79fa9df1db7a | [
"Apache-2.0"
] | 28 | 2018-09-10T05:01:09.000Z | 2021-03-04T10:07:12.000Z | newnnfw/tools/tflitefile_tool/tflite/CustomOptionsFormat.py | kosslab-kr/Tizen-NN-Framework | 132fc98ed57e4b19ad1f4cb258ad79fa9df1db7a | [
"Apache-2.0"
] | 4 | 2018-09-13T04:16:08.000Z | 2018-12-03T07:34:44.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
class CustomOptionsFormat(object):
FLEXBUFFERS = 0
| 18.375 | 68 | 0.77551 |
e32187464d2acdae5b3dcfbf8973b5b04a0425e9 | 4,846 | py | Python | setup.py | levinbgu/flexx | 69b85b308b505a8621305458a5094f2a6addd720 | [
"BSD-2-Clause"
] | 1,662 | 2017-12-13T06:58:28.000Z | 2022-03-29T07:55:38.000Z | setup.py | levinbgu/flexx | 69b85b308b505a8621305458a5094f2a6addd720 | [
"BSD-2-Clause"
] | 315 | 2017-12-11T11:11:51.000Z | 2022-03-31T21:52:52.000Z | setup.py | levinbgu/flexx | 69b85b308b505a8621305458a5094f2a6addd720 | [
"BSD-2-Clause"
] | 174 | 2017-12-12T21:09:03.000Z | 2022-03-23T03:38:25.000Z | # -*- coding: utf-8 -*-
"""
Flexx setup script.
"""
import os
import sys
import shutil
try:
import setuptools # noqa, analysis:ignore
except ImportError:
pass # setuptools allows for "develop", but it's not essential
from distutils.core import setup
## Function we need
def get_version_and_doc(filename)... | 33.652778 | 90 | 0.585844 |
2ec00807b4c9aeb026413b7b4ee94075775d3ec8 | 1,767 | py | Python | UnitTest/testLib.py | alexuong/free-python-games | 6926ed94a2c27dd6a4a457a59784404fc51c4a57 | [
"Apache-2.0"
] | null | null | null | UnitTest/testLib.py | alexuong/free-python-games | 6926ed94a2c27dd6a4a457a59784404fc51c4a57 | [
"Apache-2.0"
] | 1 | 2020-02-29T03:45:28.000Z | 2020-02-29T03:45:28.000Z | UnitTest/testLib.py | alexuong/free-python-games | 6926ed94a2c27dd6a4a457a59784404fc51c4a57 | [
"Apache-2.0"
] | null | null | null | """
Collection of utilities for testing.
"""
from contextlib import contextmanager
@contextmanager
def captured_output():
import sys
from StringIO import StringIO
new_out, new_err = StringIO(), StringIO()
old_out, old_err = sys.stdout, sys.stderr
try:
sys.stdout, sys.stderr = new_out... | 22.0875 | 72 | 0.582343 |
cd039044ae62c366067ce3437289d8b12e0b550c | 9,497 | py | Python | docs/source/conf.py | jhowl01/strax | 3125eb10603063d411f9ef2f6f596be247c6ec77 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | jhowl01/strax | 3125eb10603063d411f9ef2f6f596be247c6ec77 | [
"BSD-3-Clause"
] | null | null | null | docs/source/conf.py | jhowl01/strax | 3125eb10603063d411f9ef2f6f596be247c6ec77 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# strax documentation build configuration file, created by
# sphinx-quickstart on Sat May 5 22:35:12 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | 31.656667 | 79 | 0.714963 |
16be6673a6ffba87133b250deb7d5a8a8ed2b05d | 15,441 | py | Python | dbaas/maintenance/tasks.py | perry-contribs/database-as-a-service | db8fbee3982bbc32abf32aa86f7387de01a243be | [
"BSD-3-Clause"
] | null | null | null | dbaas/maintenance/tasks.py | perry-contribs/database-as-a-service | db8fbee3982bbc32abf32aa86f7387de01a243be | [
"BSD-3-Clause"
] | null | null | null | dbaas/maintenance/tasks.py | perry-contribs/database-as-a-service | db8fbee3982bbc32abf32aa86f7387de01a243be | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from dbaas.celery import app
import models
import logging
from notification.models import TaskHistory
from util import exec_remote_command_host, get_worker_name, \
build_context_script, get_dict_lines
from registered_functions.functools import get_function
from workflow.steps.util.dns ... | 35.743056 | 79 | 0.666084 |
f1cb441ad32136ac972c5450d57530db840ea5ec | 4,637 | py | Python | adal/token_cache.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2019-10-03T21:58:22.000Z | 2021-02-12T13:33:32.000Z | adal/token_cache.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2020-01-22T13:45:12.000Z | 2022-02-10T20:58:09.000Z | adal/token_cache.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2021-01-13T09:30:29.000Z | 2021-01-13T09:30:29.000Z | #------------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation.
# All rights reserved.
#
# This code is licensed under the MIT License.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated document... | 37.699187 | 106 | 0.628208 |
85e9790b8f420bc0cf8b8971816d80721fcb8a2a | 4,956 | py | Python | authorize/apis/transaction.py | denisroldan/authorizesauce | 06ddb7ef1afd9bcd0319050fb55e21b77055db48 | [
"MIT"
] | null | null | null | authorize/apis/transaction.py | denisroldan/authorizesauce | 06ddb7ef1afd9bcd0319050fb55e21b77055db48 | [
"MIT"
] | null | null | null | authorize/apis/transaction.py | denisroldan/authorizesauce | 06ddb7ef1afd9bcd0319050fb55e21b77055db48 | [
"MIT"
] | null | null | null | from decimal import Decimal
import requests
from authorize.exceptions import AuthorizeConnectionError, \
AuthorizeResponseError
PROD_URL = 'https://secure.authorize.net/gateway/transact.dll'
TEST_URL = 'https://test.authorize.net/gateway/transact.dll'
RESPONSE_FIELDS = {
0: 'response_code',
2: 'response_... | 38.71875 | 77 | 0.615214 |
157483e140ea1ed94e7b7f2494a3b3a354a3f07c | 3,496 | py | Python | nemopy/utils/io_util.py | torresr-cnrm/nemopy | d116172771a6c1be5606be4ccf41f2013de9c86a | [
"MIT"
] | null | null | null | nemopy/utils/io_util.py | torresr-cnrm/nemopy | d116172771a6c1be5606be4ccf41f2013de9c86a | [
"MIT"
] | null | null | null | nemopy/utils/io_util.py | torresr-cnrm/nemopy | d116172771a6c1be5606be4ccf41f2013de9c86a | [
"MIT"
] | null | null | null | """
"""
import os
_cmip_ids = ['variable_id', 'table_id', 'source_id', 'experiment_id', 'member_id',
'grid_label', 'time_range']
def load_cmip6_output(output):
"""
Function for reading an `output` directory which .nc files inside. This returns
a dictionnary object with all information about files fol... | 27.527559 | 89 | 0.594966 |
20d48ce03c30fabbf533b81e4498d78cc40bae9b | 16 | py | Python | podpointclient/helpers/__init__.py | mattrayner/podpointclient | 4b40aeccf759e8a7d97de0cd8200460caf113846 | [
"MIT"
] | 1 | 2022-03-22T12:29:34.000Z | 2022-03-22T12:29:34.000Z | podpointclient/helpers/__init__.py | mattrayner/podpointclient | 4b40aeccf759e8a7d97de0cd8200460caf113846 | [
"MIT"
] | null | null | null | podpointclient/helpers/__init__.py | mattrayner/podpointclient | 4b40aeccf759e8a7d97de0cd8200460caf113846 | [
"MIT"
] | null | null | null | """Initialise""" | 16 | 16 | 0.625 |
3a6e0bdcd3923e4723228e20e4860d02cf0cf79f | 1,341 | py | Python | tests/pyre.pkg/schemata/catalogs.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/pyre.pkg/schemata/catalogs.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | tests/pyre.pkg/schemata/catalogs.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
"""
Check that catalogs work as expected
"""
def test():
import pyre.schemata
# create a descriptor
descriptor = pyre.schemata.catalog(schema=pyre.schemata.str())
# casts
... | 23.526316 | 84 | 0.55481 |
de71160704e66b26a3779c1ed733482edc5287bb | 620 | py | Python | blog/migrations/0003_auto_20210703_1146.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | blog/migrations/0003_auto_20210703_1146.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | blog/migrations/0003_auto_20210703_1146.py | zebestd/soryabebegim | 01fa9f7d11994683c0ade4fd4e2c1d258c9c59c3 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-07-03 08:46
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0002_comment'),
]
operations = [
migrations.RenameField(
model_name='comment',
old_name='email',
new_nam... | 21.37931 | 47 | 0.520968 |
4acc3173081519f6d8752c908baabf050f10e0fa | 7,031 | py | Python | past_src/87transfer/module/trainer2.py | 5loaves-2fish-12basckets/ADF_studies | ea2a8eaebf994350e32501ddfc76258aa89bd880 | [
"MIT"
] | 1 | 2019-02-06T07:53:15.000Z | 2019-02-06T07:53:15.000Z | src/00template/module/trainer2.py | 5loaves-2fish-12basckets/ADF_studies | ea2a8eaebf994350e32501ddfc76258aa89bd880 | [
"MIT"
] | null | null | null | src/00template/module/trainer2.py | 5loaves-2fish-12basckets/ADF_studies | ea2a8eaebf994350e32501ddfc76258aa89bd880 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
__author__ = '{Jimmy Yeh}'
__email__ = '{marrch30@gmail.com}'
"""
from module.model import DaNN
from module.datafunc import make_dataloaders
import torch
from tqdm import tqdm
import numpy as np
import os
from convex_adversarial import robust_loss, robust_loss_parallel
torch.manual_se... | 37.59893 | 111 | 0.559949 |
192275773b916257de8715a5972e465a7c165912 | 1,828 | py | Python | Coursera/Capstone Retrieving, Processing, and Visualizing Data with Python/Week-4/Example/gmane/glineN.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 331 | 2019-10-22T09:06:28.000Z | 2022-03-27T13:36:03.000Z | Coursera/Capstone Retrieving, Processing, and Visualizing Data with Python/Week-4/Example/gmane/glineN.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 8 | 2020-04-10T07:59:06.000Z | 2022-02-06T11:36:47.000Z | Coursera/Capstone Retrieving, Processing, and Visualizing Data with Python/Week-4/Example/gmane/glineN.py | rishav3101/Online-Courses-Learning | 1e9356af331b27b6ee33d376d8d7104edaeac2fa | [
"MIT"
] | 572 | 2019-07-28T23:43:35.000Z | 2022-03-27T22:40:08.000Z | import sqlite3
import time
import zlib
conn = sqlite3.connect('index.sqlite')
cur = conn.cursor()
cur.execute('SELECT id, sender FROM Senders')
senders = dict()
for message_row in cur :
senders[message_row[0]] = message_row[1]
cur.execute('SELECT id, guid,sender_id,subject_id,sent_at FROM Messages')
messages = d... | 25.388889 | 92 | 0.655908 |
11e538671da441597196e3e90a60cb6a9fda784d | 2,730 | py | Python | Python3/301.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 854 | 2018-11-09T08:06:16.000Z | 2022-03-31T06:05:53.000Z | Python3/301.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 29 | 2019-06-02T05:02:25.000Z | 2021-11-15T04:09:37.000Z | Python3/301.py | rakhi2001/ecom7 | 73790d44605fbd51e8f7e804b9808e364fcfc680 | [
"MIT"
] | 347 | 2018-12-23T01:57:37.000Z | 2022-03-12T14:51:21.000Z | __________________________________________________________________________________________________
sample 24 ms submission
class Solution:
def removeInvalidParentheses(self, s: str) -> List[str]:
ret = []
remove(s, ret, 0, 0, '()')
return ret
def remove(s, ret, last_i, last_j, par):
st... | 36.4 | 99 | 0.563004 |
361fc6f7b573f1919b313bad46eaf8cf5af08c2a | 456 | py | Python | portfolio/pages/views.py | dark00infinity/infinity_loops-learning | 3f603e83feb2853bf4b783ec4ac333d6c63ec1b3 | [
"MIT"
] | 1 | 2021-05-07T19:00:31.000Z | 2021-05-07T19:00:31.000Z | portfolio/pages/views.py | dark00infinity/infinity_loops-learning | 3f603e83feb2853bf4b783ec4ac333d6c63ec1b3 | [
"MIT"
] | null | null | null | portfolio/pages/views.py | dark00infinity/infinity_loops-learning | 3f603e83feb2853bf4b783ec4ac333d6c63ec1b3 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from listings.models import Listing
from listings.choices import level_choice, time_choice,programming_choice
def index(request):
listings=Listing.objects.order_by('-list_date').filter(is_published=True)[:3]
context={
'listings': listi... | 32.571429 | 81 | 0.763158 |
a45bbecd85d5e8efbfbc77ef366a621cb0bf7179 | 689 | py | Python | tests/pyposmat/engines/PyposmatBaseSampler/test__generate_free_parameters.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 4 | 2018-01-18T19:59:56.000Z | 2020-08-25T11:56:52.000Z | tests/pyposmat/engines/PyposmatBaseSampler/test__generate_free_parameters.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2018-04-22T23:02:13.000Z | 2018-04-22T23:02:13.000Z | tests/pyposmat/engines/PyposmatBaseSampler/test__generate_free_parameters.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2019-09-14T07:04:42.000Z | 2019-09-14T07:04:42.000Z | import pytest
import os
from collections import OrderedDict
import pypospack.utils
pypospack_root_dir = pypospack.utils.get_pypospack_root_directory()
config_fn = os.path.join(pypospack_root_dir,'data/MgO_pareto_data/pyposmat.config.in')
def test__generate_free_parameters():
from pypospack.pyposmat.engines impo... | 32.809524 | 86 | 0.811321 |
36c8f8124ba1ca2ffa54b31482dbe64c9c02ca44 | 7,583 | py | Python | CEC/__init__.py | gmum/ecml17 | 76fb8382d35bfd12098a0e83f2f5f815fa7fb5f0 | [
"Apache-2.0"
] | 5 | 2017-04-21T09:23:15.000Z | 2022-02-25T03:00:54.000Z | CEC/__init__.py | gmum/ecml17 | 76fb8382d35bfd12098a0e83f2f5f815fa7fb5f0 | [
"Apache-2.0"
] | null | null | null | CEC/__init__.py | gmum/ecml17 | 76fb8382d35bfd12098a0e83f2f5f815fa7fb5f0 | [
"Apache-2.0"
] | 2 | 2018-11-26T08:43:50.000Z | 2020-10-24T16:44:40.000Z | from __future__ import division
from six import string_types
import logging
logging.basicConfig()
logger = logging.getLogger("CEC")
logger.setLevel(logging.INFO)
import numpy as np
from scipy.stats import multivariate_normal
from sklearn.base import BaseEstimator
from sklearn.utils.extmath import logsumexp
from jobl... | 32.545064 | 118 | 0.541342 |
d7aba5ca02a22a433c8bc1ff5a5037c39d6f47f6 | 3,678 | py | Python | utils/trk_2_binary.py | banctilrobitaille/LogEuclidean-Intro | 1fbce17ea778a8cf1fb3d317f4f68a682ef9d675 | [
"MIT"
] | 3 | 2020-04-22T15:08:47.000Z | 2022-01-06T21:48:56.000Z | utils/trk_2_binary.py | zhenglong178/LogEuclidean-Intro | 1fbce17ea778a8cf1fb3d317f4f68a682ef9d675 | [
"MIT"
] | null | null | null | utils/trk_2_binary.py | zhenglong178/LogEuclidean-Intro | 1fbce17ea778a8cf1fb3d317f4f68a682ef9d675 | [
"MIT"
] | 3 | 2020-04-22T15:09:02.000Z | 2021-04-23T14:35:21.000Z | """
Convert a trk streamline file to a binary map.
Arguments:
trk_file_in
mask_file_out
reference_file (file with same affine as DWI file, e.g. brain mask)
Example:
python trk_2_binary.py CST_right.trk CST_right.nii.gz nodif_brain_mask.nii.gz
"""
import logging
import nibabel as nib
i... | 36.78 | 123 | 0.691408 |
4b1026856c78a6f46c2e91a996489be0011a2915 | 249 | py | Python | Algorithmic/Easy/basic text encoding/txtToHexAndBin.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 1 | 2022-03-16T16:47:22.000Z | 2022-03-16T16:47:22.000Z | Algorithmic/Easy/basic text encoding/txtToHexAndBin.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | null | null | null | Algorithmic/Easy/basic text encoding/txtToHexAndBin.py | saintwithataint/Pro-g-rammingChallenges4 | 3f720a375b89ee289237819c2dc89226634b7a5b | [
"Apache-2.0"
] | 2 | 2022-02-02T18:02:03.000Z | 2022-03-16T16:47:34.000Z | def text_to_hex(text):
return "".join(hex(ord(char)).lstrip("0x").rstrip("L") for char in text)
def text_to_bin(text):
return bin(int.from_bytes(text.encode(), "big")).lstrip("0b")
print(text_to_hex("Saint"))
print(text_to_hex("Saint"))
| 22.636364 | 76 | 0.678715 |
fc24481bba9af69fad5ed509662e0d007a2feb85 | 9,081 | py | Python | beagle/backends/networkx.py | zeroalphat/beagle | f4e245d3403f9930460f18dbabe65aa6b722d02f | [
"MIT"
] | null | null | null | beagle/backends/networkx.py | zeroalphat/beagle | f4e245d3403f9930460f18dbabe65aa6b722d02f | [
"MIT"
] | null | null | null | beagle/backends/networkx.py | zeroalphat/beagle | f4e245d3403f9930460f18dbabe65aa6b722d02f | [
"MIT"
] | null | null | null | from collections import defaultdict
from typing import Optional
import networkx as nx
from beagle.backends.base_backend import Backend
from beagle.common import logger
from beagle.nodes import Node
class NetworkX(Backend):
"""NetworkX based backend. Other backends can subclass this backend in order to have acce... | 34.011236 | 103 | 0.552362 |
4749f42e1c0d4e24d5a02efdb8a924f638fe8362 | 1,507 | py | Python | driftbase/auth/__init__.py | directivegames/drift-base | 5fc7d4686c56e93fc22178f3b1bb49239d7eee45 | [
"MIT"
] | 1 | 2021-09-04T01:45:44.000Z | 2021-09-04T01:45:44.000Z | driftbase/auth/__init__.py | directivegames/drift-base | 5fc7d4686c56e93fc22178f3b1bb49239d7eee45 | [
"MIT"
] | 30 | 2020-12-09T04:10:26.000Z | 2022-03-02T02:34:49.000Z | driftbase/auth/__init__.py | directivegames/drift-base | 5fc7d4686c56e93fc22178f3b1bb49239d7eee45 | [
"MIT"
] | 2 | 2016-10-31T09:47:41.000Z | 2019-06-06T03:06:21.000Z | import importlib
import functools
from drift.utils import get_config
from drift.core.extensions import jwt
AUTH_MODULES = {
'gamecenter': 'driftbase.auth.gamecenter',
'googleplay': 'driftbase.auth.googleplay',
'oculus': 'driftbase.auth.oculus',
'psn': 'driftbase.auth.psn',
'steam': 'driftbase.aut... | 32.76087 | 113 | 0.69144 |
ef2ac21e7f4899f2a48ccab6c0735389e874be26 | 9,857 | py | Python | cairis/mio/ModelExport.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/mio/ModelExport.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | cairis/mio/ModelExport.py | RAIJ95/https-github.com-failys-cairis | 86601347ea016f4a3f90b6942093d63e91de5f74 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | 33.413559 | 262 | 0.691285 |
4e9d16e35031f74bcfe69e888ab2fd125035adf1 | 2,360 | py | Python | tastyworks/example.py | krsvojte/tastyworks_api | 692c4e434d6c5daa2d91fcb09a3aabb8d5d24c6f | [
"Apache-2.0"
] | null | null | null | tastyworks/example.py | krsvojte/tastyworks_api | 692c4e434d6c5daa2d91fcb09a3aabb8d5d24c6f | [
"Apache-2.0"
] | null | null | null | tastyworks/example.py | krsvojte/tastyworks_api | 692c4e434d6c5daa2d91fcb09a3aabb8d5d24c6f | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
from datetime import date
from tastyworks.models.option import Option, OptionType, OptionUnderlyingType
from tastyworks.models.order import (Order, OrderDetails, OrderPriceEffect,
OrderType)
from tastyworks.models.session import TastyAPISession
from ta... | 29.5 | 90 | 0.675 |
5b6a8cbc4cf54c909a588eba47e70b7f207f57c6 | 430 | py | Python | poketech/pokequest/migrations/0013_pokemon_attack1_name.py | sagarmanchanda/PokeQuest | feea3003fc2918f678dc67c09491f6fc07685677 | [
"MIT"
] | null | null | null | poketech/pokequest/migrations/0013_pokemon_attack1_name.py | sagarmanchanda/PokeQuest | feea3003fc2918f678dc67c09491f6fc07685677 | [
"MIT"
] | null | null | null | poketech/pokequest/migrations/0013_pokemon_attack1_name.py | sagarmanchanda/PokeQuest | feea3003fc2918f678dc67c09491f6fc07685677 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('pokequest', '0012_auto_20150829_1624'),
]
operations = [
migrations.AddField(
model_name='pokemon',
... | 21.5 | 71 | 0.618605 |
95d8e09639d6e6000b37f81982fda7f5bc28b02b | 4,562 | py | Python | integration/python/integration_api/models/brokerage_account_co.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 11 | 2019-04-16T02:11:17.000Z | 2021-12-16T22:51:40.000Z | integration/python/integration_api/models/brokerage_account_co.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 81 | 2019-11-19T23:24:28.000Z | 2022-03-28T11:35:47.000Z | integration/python/integration_api/models/brokerage_account_co.py | ShekharPaatni/SDK | 6534ffdb63af87c02c431df9add05a90370183cb | [
"Apache-2.0"
] | 11 | 2020-07-08T02:29:56.000Z | 2022-03-28T10:05:33.000Z | # coding: utf-8
"""
Hydrogen Integration API
The Hydrogen Integration API # noqa: E501
OpenAPI spec version: 1.3.1
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
from integration_api.con... | 30.413333 | 110 | 0.617492 |
3db5559ad8c3d3521e15bb759a7f3aa7f2a3a3e8 | 322 | py | Python | src/waldur_core/structure/widgets.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 26 | 2017-10-18T13:49:58.000Z | 2021-09-19T04:44:09.000Z | src/waldur_core/structure/widgets.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 14 | 2018-12-10T14:14:51.000Z | 2021-06-07T10:33:39.000Z | src/waldur_core/structure/widgets.py | geant-multicloud/MCMS-mastermind | 81333180f5e56a0bc88d7dad448505448e01f24e | [
"MIT"
] | 32 | 2017-09-24T03:10:45.000Z | 2021-10-16T16:41:09.000Z | from django.contrib.admin.widgets import FilteredSelectMultiple
class ScrolledSelectMultiple(FilteredSelectMultiple):
def __init__(self, verbose_name, is_stacked=False, attrs=None, choices=()):
attrs = attrs or {'style': 'overflow-x: auto'}
super().__init__(verbose_name, is_stacked, attrs, choices... | 40.25 | 79 | 0.748447 |
6c9dc15bf7b8d034026d9c0087d5983cd20651b6 | 11,670 | py | Python | model/building_blocks.py | Wu-Chenyang/SMC-POMDP | 953c1abab412627080c63fbf8bb7f661b75e7006 | [
"MIT"
] | null | null | null | model/building_blocks.py | Wu-Chenyang/SMC-POMDP | 953c1abab412627080c63fbf8bb7f661b75e7006 | [
"MIT"
] | null | null | null | model/building_blocks.py | Wu-Chenyang/SMC-POMDP | 953c1abab412627080c63fbf8bb7f661b75e7006 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import pyro.distributions as D
import numpy as np
import math
from typing import Tuple
# from torch.nn.utils import weight_norm
from utils.util import eps, max_deviation, Softclamp, softclamp
class MLP(nn.Module):
def __init__(self, layer_sizes: list, dropout = 0.3):
... | 55.308057 | 177 | 0.637446 |
89ed6d1d33ecce66b0efab1a6ccccbb114b67e57 | 4,242 | py | Python | Lib/site-packages/cfe/app.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/cfe/app.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 4 | 2020-06-06T00:04:23.000Z | 2021-09-08T01:26:23.000Z | Lib/site-packages/cfe/app.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | null | null | null | import argparse
import sys
from subprocess import call
import os
import time
import shutil
from cfe.cli.utils.styling import progress
from cfe.cli.utils.main import initialize_project
from cfe.cli.utils.upgrade import UpgradeVenvPackage
import getpass
def cfe_cli(args=None):
parser = argparse.ArgumentParser(... | 41.184466 | 289 | 0.634371 |
91f5c082b9abc8f00bce1f0cf2a0a49144fe5300 | 3,375 | py | Python | invokers/python/pyfunc/locate.py | andrew-su/function-buildpacks-for-knative | dcb9a8c1e07a6288dbc096e2f5270eb5e16a625a | [
"BSD-2-Clause"
] | 19 | 2021-11-03T15:02:24.000Z | 2022-03-23T04:33:56.000Z | invokers/python/pyfunc/locate.py | andrew-su/function-buildpacks-for-knative | dcb9a8c1e07a6288dbc096e2f5270eb5e16a625a | [
"BSD-2-Clause"
] | 36 | 2021-11-05T14:33:37.000Z | 2022-03-24T20:13:40.000Z | invokers/python/pyfunc/locate.py | andrew-su/function-buildpacks-for-knative | dcb9a8c1e07a6288dbc096e2f5270eb5e16a625a | [
"BSD-2-Clause"
] | 4 | 2021-11-16T08:27:58.000Z | 2022-02-03T02:58:24.000Z | # Copyright 2021-2022 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause
import importlib.util
import inspect
import pathlib
import sys
import typing
import types
import flask
import cloudevents.sdk.event.base as ce_sdk
from .config import Config
def find_func(dir: str) -> typing.Callable:
cfg = Config(search... | 32.451923 | 124 | 0.607407 |
dad17fd4639e1180608480c769c6cd2eb55abcad | 2,737 | py | Python | pawpaw/http_connection_reader.py | open-eio/upython-pawpaw | 67ed36b0f1738f57e8be29559f19df2bdc9161e1 | [
"MIT"
] | null | null | null | pawpaw/http_connection_reader.py | open-eio/upython-pawpaw | 67ed36b0f1738f57e8be29559f19df2bdc9161e1 | [
"MIT"
] | null | null | null | pawpaw/http_connection_reader.py | open-eio/upython-pawpaw | 67ed36b0f1738f57e8be29559f19df2bdc9161e1 | [
"MIT"
] | null | null | null | import time, socket
try:
import sys
from sys import print_exception #micropython specific
except ImportError:
import traceback
print_exception = lambda exc, file_: traceback.print_exc(file=file_)
try:
from collections import OrderedDict
except ImportError:
from ucollections import Ordered... | 33.790123 | 80 | 0.592254 |
0fb3f6cbdaf6478307347ed643e882fbd114dc19 | 6,050 | py | Python | liuer/13-1.py | jobsfan/pytorch | 221ae8e3673f8d2fbf0a58f40a30553c76084831 | [
"Apache-2.0"
] | 1 | 2020-04-30T07:08:45.000Z | 2020-04-30T07:08:45.000Z | liuer/13-1.py | jobsfan/pytorch | 221ae8e3673f8d2fbf0a58f40a30553c76084831 | [
"Apache-2.0"
] | null | null | null | liuer/13-1.py | jobsfan/pytorch | 221ae8e3673f8d2fbf0a58f40a30553c76084831 | [
"Apache-2.0"
] | null | null | null | import torch
import time
import math
import matplotlib.pyplot as plt
import numpy as np
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pack_padded_sequence
import csv
import gzip
HIDDEN_SIZE = 100
BATCH_SIZE = 256
N_LAYER = 2
N_EPOCHS = 100
N_CHARS = 128
USE... | 32.880435 | 122 | 0.656198 |
74a11582bf74917c0a4640e135a296e5482c79e3 | 3,115 | py | Python | airbyte-integrations/connectors/source-pipedrive/source_pipedrive/source.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | null | null | null | airbyte-integrations/connectors/source-pipedrive/source_pipedrive/source.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2021-12-08T21:39:05.000Z | 2021-12-09T17:10:45.000Z | airbyte-integrations/connectors/source-pipedrive/source_pipedrive/source.py | kattos-aws/airbyte | cbcbab4a2399c08d8f66d1b693ac824c245ba3da | [
"MIT"
] | 1 | 2022-02-19T17:22:50.000Z | 2022-02-19T17:22:50.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
from typing import Any, List, Mapping, Tuple
import pendulum
from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk... | 36.22093 | 122 | 0.644302 |
3425509fadcbb9eb8e2427fd0cc89fb29d870bb2 | 347 | py | Python | ddrev/__meta__.py | akari-doichan/Arcade-Dancing-System | 668153fb1c54c0b82782c623fe3441e7c7fd0bb1 | [
"MIT"
] | 2 | 2021-07-08T05:14:43.000Z | 2021-07-08T16:34:32.000Z | ddrev/__meta__.py | akari-doichan/Arcade-Dancing-System | 668153fb1c54c0b82782c623fe3441e7c7fd0bb1 | [
"MIT"
] | 5 | 2021-07-06T12:19:15.000Z | 2021-07-12T02:05:17.000Z | ddrev/__meta__.py | akari-doichan/Arcade-Dancing-System | 668153fb1c54c0b82782c623fe3441e7c7fd0bb1 | [
"MIT"
] | null | null | null | # coding: utf-8
__all__ = [
"__package_name__",
"__module_name__",
"__author__",
"__copyright__",
"__version__",
"__license__",
]
__package_name__ = "Arcade-Dancing-System"
__module_name__ = "ddrev"
__author__ = "akari-doichan"
__copyright__ = f"Copyright (C) 2021 {__author__}"
__version__ = "... | 19.277778 | 50 | 0.680115 |
0a7ad9404a6fdcc029d06a0a777208f107ff7d47 | 119,574 | py | Python | tools/marvin/marvin/integration/lib/base.py | pkoistin/cloudstack | fd43cf151663c48fe29f97323490d53a7c0f9d5b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tools/marvin/marvin/integration/lib/base.py | pkoistin/cloudstack | fd43cf151663c48fe29f97323490d53a7c0f9d5b | [
"ECL-2.0",
"Apache-2.0"
] | 6 | 2020-11-16T20:46:14.000Z | 2022-02-01T01:06:16.000Z | tools/marvin/marvin/integration/lib/base.py | pkoistin/cloudstack | fd43cf151663c48fe29f97323490d53a7c0f9d5b | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.652649 | 108 | 0.609388 |
e5022f68668c8514d6328513b363beb4f2b38380 | 3,510 | py | Python | tests/test_agent_ebest.py | hopelife/mstb | bd8bd50bb63670b00ebf06be1e71c727a0e5e155 | [
"MIT"
] | null | null | null | tests/test_agent_ebest.py | hopelife/mstb | bd8bd50bb63670b00ebf06be1e71c727a0e5e155 | [
"MIT"
] | null | null | null | tests/test_agent_ebest.py | hopelife/mstb | bd8bd50bb63670b00ebf06be1e71c727a0e5e155 | [
"MIT"
] | null | null | null | import unittest
import os, sys
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from stocklab.agent.ebest import EBest
import inspect
import time
class TestEbest(unittest.TestCase):
def setUp(self):
self.ebest = EBest("DEMO")
self.ebest.login()
# def test_get_code... | 30.521739 | 99 | 0.609972 |
851bd624a7e89bbc0a7204145d5daa7b06dd3872 | 1,200 | py | Python | app/core/models.py | ddalma/recipe-app-api | 3ea144e1d3980d74adab768bf6e3941a8fd33295 | [
"MIT"
] | null | null | null | app/core/models.py | ddalma/recipe-app-api | 3ea144e1d3980d74adab768bf6e3941a8fd33295 | [
"MIT"
] | null | null | null | app/core/models.py | ddalma/recipe-app-api | 3ea144e1d3980d74adab768bf6e3941a8fd33295 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \
PermissionsMixin
# Create your models here.
class UserManager(BaseUserManager):
def create_user(self, email, password=None, **extra_fields):
"""Creates and saves ... | 35.294118 | 76 | 0.6675 |
390645a94d463b802f3a2bb0596f72237408717b | 3,024 | py | Python | evaluation/eval_runner/detection_eval.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | evaluation/eval_runner/detection_eval.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | evaluation/eval_runner/detection_eval.py | greatwallet/cosypose | e72ce7d521ef61870daef267cbbe65aaebe9d24d | [
"MIT"
] | null | null | null | from tqdm import tqdm
import numpy as np
import torch
import pandas as pd
from collections import OrderedDict
from torch.utils.data import DataLoader
from cosypose.utils.distributed import get_world_size, get_rank, get_tmp_dir
import cosypose.utils.tensor_collection as tc
from cosypose.evaluation.data_u... | 37.333333 | 108 | 0.577381 |
fb01d0fb61d7cbc6850d32b784441fe7c5ba9d5b | 42,016 | py | Python | tests/models/test_dataset.py | foobarbecue/pyDataverse | b0f73e95a498412e15f26c02e17de3c049c7efb8 | [
"MIT"
] | 21 | 2020-12-29T18:19:26.000Z | 2022-03-19T15:19:01.000Z | tests/models/test_dataset.py | foobarbecue/pyDataverse | b0f73e95a498412e15f26c02e17de3c049c7efb8 | [
"MIT"
] | 92 | 2020-12-09T15:36:59.000Z | 2022-03-22T21:16:10.000Z | tests/models/test_dataset.py | foobarbecue/pyDataverse | b0f73e95a498412e15f26c02e17de3c049c7efb8 | [
"MIT"
] | 19 | 2019-05-06T18:46:05.000Z | 2020-12-07T20:54:52.000Z | """Dataset data model tests."""
import json
import os
import platform
import pytest
from pyDataverse.models import Dataset
from ..conftest import test_config
def read_file(filename, mode="r"):
"""Read in a file.
Parameters
----------
filename : str
Filename with full path.
mode : str
... | 34.89701 | 151 | 0.54296 |
340489d7202f0b704a7f3fb201e7aa60c7c72ce6 | 514 | py | Python | plugins/contents/fps_contents/models.py | jtpio/jupyverse | 2419c7d2cee618b791908f8a63db9f7b18cab78e | [
"MIT"
] | null | null | null | plugins/contents/fps_contents/models.py | jtpio/jupyverse | 2419c7d2cee618b791908f8a63db9f7b18cab78e | [
"MIT"
] | null | null | null | plugins/contents/fps_contents/models.py | jtpio/jupyverse | 2419c7d2cee618b791908f8a63db9f7b18cab78e | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Union
from pydantic import BaseModel
class Checkpoint(BaseModel):
id: str
last_modified: str
class SaveContent(BaseModel):
content: Union[str, Dict]
format: str
path: str
type: str
class Content(BaseModel):
name: str
path: str
last_modi... | 17.724138 | 46 | 0.673152 |
69d6f536400386f54e61bfed245044f55e871566 | 267 | py | Python | web/core/migrations/0047_merge_20200605_1811.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-03-22T18:13:12.000Z | 2021-01-25T10:33:31.000Z | web/core/migrations/0047_merge_20200605_1811.py | MTES-MCT/carbure | 2876756b760ab4866fa783bb40e61a046eebb1ab | [
"MIT"
] | 20 | 2020-07-06T14:33:14.000Z | 2022-03-15T16:54:17.000Z | web/core/migrations/0047_merge_20200605_1811.py | MTES-MCT/biocarburants | ff084916e18cdbdc41400f36fa6cc76a5e05900e | [
"MIT"
] | 4 | 2020-04-03T12:19:12.000Z | 2021-06-15T12:20:57.000Z | # Generated by Django 3.0.7 on 2020-06-05 16:11
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0046_auto_20200604_1724'),
('core', '0042_auto_20200605_1800'),
]
operations = [
]
| 17.8 | 47 | 0.640449 |
a57ad6c805e966bf90ff52f594dbcf2b4bfd724a | 427 | py | Python | privagal/gallery/views.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | 6 | 2016-06-06T15:27:24.000Z | 2016-07-14T01:26:42.000Z | privagal/gallery/views.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | null | null | null | privagal/gallery/views.py | ychab/privagal | 118197c8fdeb7e32c95cf9672b87fb0350a5a874 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import get_object_or_404
from django.views.generic import View
from privagal.core.mixins import PageLoginRequiredMixin
from .models import Gallery
class GalleryDownloadView(PageLoginRequiredMixin, View):
def get(self, reques... | 25.117647 | 56 | 0.775176 |
5b120fd0d5354be02d05e85f46df6524c26b64ec | 7,187 | py | Python | pyqmc/reblock.py | bbusemeyer/pyqmc | e0baa1dd04ef47ad3a00abc3ff2a5a665347fad6 | [
"MIT"
] | 1 | 2019-05-27T16:25:34.000Z | 2019-05-27T16:25:34.000Z | pyqmc/reblock.py | jnbrodrigues/pyqmc | f7e29df271e413c3ff9cfc694d6216933745d7b4 | [
"MIT"
] | null | null | null | pyqmc/reblock.py | jnbrodrigues/pyqmc | f7e29df271e413c3ff9cfc694d6216933745d7b4 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
def reblock(df, nblocks, weights=None):
"""
Reblock df into nblocks new blocks (nblocks is the length of the returned data)
:param df: data to reblock
:type df: pandas DataFrame, Series, or numpy array
:param nblocks: number of resulting blocks
:type nbl... | 31.942222 | 89 | 0.624878 |
9cec040676d6c5d202d77ed589d053b8cf807a2b | 1,425 | py | Python | contrib/zmq/zmq_sub.py | Gigacrash/WebGold | 88bd804d81b90e709f3995b3f1346021f6cbf28a | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | Gigacrash/WebGold | 88bd804d81b90e709f3995b3f1346021f6cbf28a | [
"MIT"
] | 1 | 2018-02-27T06:55:56.000Z | 2018-02-27T06:55:56.000Z | contrib/zmq/zmq_sub.py | xshard/Shard | e4b7bbd7f322f31ecbd3ea19c322a177853cad13 | [
"MIT"
] | 1 | 2020-05-26T00:01:50.000Z | 2020-05-26T00:01:50.000Z | #!/usr/bin/env python2
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import array
import binascii
import zmq
import struct
port = 21331
zmqContext = zmq.Context()
zmqSubSoc... | 31.666667 | 69 | 0.628772 |
7d84ac2b6324da0f113843ba231735e7eb930550 | 23 | py | Python | config.py | Manwholikespie/ModularFlask | 9e644ddb003a4000196f72288e2084bd9645951a | [
"MIT"
] | null | null | null | config.py | Manwholikespie/ModularFlask | 9e644ddb003a4000196f72288e2084bd9645951a | [
"MIT"
] | 1 | 2018-03-06T04:56:22.000Z | 2018-03-06T04:56:22.000Z | config.py | Manwholikespie/ModularFlask | 9e644ddb003a4000196f72288e2084bd9645951a | [
"MIT"
] | 1 | 2019-03-24T18:10:10.000Z | 2019-03-24T18:10:10.000Z | LOG_FILE = "errors.log" | 23 | 23 | 0.73913 |
e448fd8233822eba7b365a9821fec92952c44596 | 1,981 | py | Python | src/command_modules/azure-cli-resource/setup.py | KTH/azure-cli | 58aa9e320ea7c5213b4517172eaf71b3f5230fd6 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-resource/setup.py | KTH/azure-cli | 58aa9e320ea7c5213b4517172eaf71b3f5230fd6 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-resource/setup.py | KTH/azure-cli | 58aa9e320ea7c5213b4517172eaf71b3f5230fd6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ---------------------------------------------... | 31.951613 | 94 | 0.603735 |
11da3ea0d2aef9cd90ce4f0b44b7e6a3a362f0d1 | 2,951 | py | Python | pyrex/kernel.py | shrishabh/pyrex | 80798ec2c4fd2e27f40843e37013765ee6a4e551 | [
"MIT"
] | null | null | null | pyrex/kernel.py | shrishabh/pyrex | 80798ec2c4fd2e27f40843e37013765ee6a4e551 | [
"MIT"
] | null | null | null | pyrex/kernel.py | shrishabh/pyrex | 80798ec2c4fd2e27f40843e37013765ee6a4e551 | [
"MIT"
] | null | null | null | """Module for the simulation kernel. Includes neutrino generation,
ray tracking (no raytracing yet), and hit generation."""
import logging
import numpy as np
from pyrex.internal_functions import normalize
from pyrex.signals import AskaryanSignal
from pyrex.ray_tracing import RayTracer
from pyrex.ice_model import IceMo... | 41.56338 | 80 | 0.610302 |
332928c874901bb47bc9a5bf5c7c0a4a80e180b5 | 2,384 | py | Python | midi/midi_utils.py | SudharshanShanmugasundaram/Music-Generation | 17c438d6ba921a8848cf29ded6fd24399981bda1 | [
"MIT"
] | 27 | 2018-11-30T12:56:55.000Z | 2022-03-18T14:19:53.000Z | utils/midi/midi_utils.py | Khamies/PianoNotes-LSTM-Generation | ff886834fa1cf8cd15aac54c9bb238b2460ce978 | [
"MIT"
] | null | null | null | utils/midi/midi_utils.py | Khamies/PianoNotes-LSTM-Generation | ff886834fa1cf8cd15aac54c9bb238b2460ce978 | [
"MIT"
] | 3 | 2020-04-06T08:32:54.000Z | 2022-03-03T00:17:08.000Z | # Author: Nicolas Boulanger-Lewandowski
# University of Montreal (2013)
# RNN-RBM deep learning tutorial
#
# Implements midiread and midiwrite functions to read/write MIDI files to/from piano-rolls
from MidiOutFile import MidiOutFile
from MidiInFile import MidiInFile
from MidiOutStream import MidiOutStream
import nu... | 27.402299 | 90 | 0.647651 |
ed15866f0f3797a20f4ba798a045c3ac950f18a6 | 13,055 | py | Python | t2t_bert/test/test_wsdm_distributed_esim_bert.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/test/test_wsdm_distributed_esim_bert.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/test/test_wsdm_distributed_esim_bert.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | import sys,os
sys.path.append("..")
from model_io import model_io
import numpy as np
import tensorflow as tf
from bunch import Bunch
from example import feature_writer, write_to_tfrecords, classifier_processor
from data_generator import tokenization
from data_generator import hvd_distributed_tf_data_utils as tf_data_ut... | 40.417957 | 137 | 0.578399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.