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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e9576e580a2536189c3d52cdc0e7069a58a7437 | 3,614 | py | Python | tapystry/concurrency.py | daniel-ziegler/tapystry | 927d51be776103d7cbfa29a02ce93c0bc5747d12 | [
"MIT"
] | null | null | null | tapystry/concurrency.py | daniel-ziegler/tapystry | 927d51be776103d7cbfa29a02ce93c0bc5747d12 | [
"MIT"
] | null | null | null | tapystry/concurrency.py | daniel-ziegler/tapystry | 927d51be776103d7cbfa29a02ce93c0bc5747d12 | [
"MIT"
] | null | null | null | from uuid import uuid4
from collections import deque
from tapystry import Call, Broadcast, Receive, TapystryError, as_effect
"""
TODO: have something like a Promise?
def doStuffWithPromise(p):
...
yield p.Resolve(val)
p = Promise()
yield Fork(doStuffWithPromise, (p,))
yield p
reem suggests just running an ... | 28.68254 | 114 | 0.566408 |
f6893bb2bf8738a10951d9c0ce69d7aa9f498ded | 831 | py | Python | pythello/ai/score.py | klane/pythello | 3b4dcb0526dfce4869d8e4f7822c35b195e1a0b7 | [
"MIT"
] | null | null | null | pythello/ai/score.py | klane/pythello | 3b4dcb0526dfce4869d8e4f7822c35b195e1a0b7 | [
"MIT"
] | null | null | null | pythello/ai/score.py | klane/pythello | 3b4dcb0526dfce4869d8e4f7822c35b195e1a0b7 | [
"MIT"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
import numpy as np
if TYPE_CHECKING:
from pythello.game import GridGame
class EdgeScore:
def __init__(self, size: int):
self.board_score = np.ones((size, size), dtype=np.int8)
self.board_score[0, :] = 3
self.board_s... | 28.655172 | 84 | 0.617329 |
7d05cc4c9873b9f0212d700e6966151b043210e2 | 3,087 | py | Python | orc8r/gateway/python/magma/common/rpc_utils.py | KenG98/magma | dac860761778371f305901e54d81fb09eff102e7 | [
"BSD-3-Clause"
] | 3 | 2019-08-16T17:03:09.000Z | 2019-08-23T21:57:48.000Z | orc8r/gateway/python/magma/common/rpc_utils.py | irsols-devops/magma | 1f01a86e0515ffeef689e863db6daa7b31a57e0b | [
"BSD-3-Clause"
] | 1 | 2020-04-23T11:10:11.000Z | 2020-04-23T11:10:11.000Z | orc8r/gateway/python/magma/common/rpc_utils.py | irsols-devops/magma | 1f01a86e0515ffeef689e863db6daa7b31a57e0b | [
"BSD-3-Clause"
] | 1 | 2020-01-14T14:28:23.000Z | 2020-01-14T14:28:23.000Z | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
# pylint: disable=broad-exce... | 26.612069 | 79 | 0.637188 |
e50802493b6b2687af3a30cf1adb5f9a9d44b303 | 3,358 | py | Python | examples/weatherbyphone/weather.py | cyberfonica/plivohelper | 8e0288f8b908262a3e26ae7c83d1e587962cb881 | [
"MIT"
] | null | null | null | examples/weatherbyphone/weather.py | cyberfonica/plivohelper | 8e0288f8b908262a3e26ae7c83d1e587962cb881 | [
"MIT"
] | null | null | null | examples/weatherbyphone/weather.py | cyberfonica/plivohelper | 8e0288f8b908262a3e26ae7c83d1e587962cb881 | [
"MIT"
] | null | null | null | ############################################
# host/port binding for http server
HOST = '127.0.0.1'
PORT = 5000
############################################
from flask import Flask, request, render_template
import urllib
import plivohelper
import os
from xml.dom import minidom
WEATHER_API_URL = "http://weather.yahooa... | 30.807339 | 85 | 0.631328 |
4e733a758f9f18465f509dc5a2c9394f6d722bf6 | 16,318 | py | Python | src/nexuscli/cli/__init__.py | arachnist/nexus3-cli | 662a2a6cdfda6ea4a4502ee23b0e5fb3e2ed54e5 | [
"MIT"
] | null | null | null | src/nexuscli/cli/__init__.py | arachnist/nexus3-cli | 662a2a6cdfda6ea4a4502ee23b0e5fb3e2ed54e5 | [
"MIT"
] | null | null | null | src/nexuscli/cli/__init__.py | arachnist/nexus3-cli | 662a2a6cdfda6ea4a4502ee23b0e5fb3e2ed54e5 | [
"MIT"
] | null | null | null | import click
import pkg_resources
from nexuscli import nexus_config
from nexuscli.api.repository import model
from nexuscli.cli import (
root_commands, util, subcommand_repository,
subcommand_cleanup_policy, subcommand_script)
PACKAGE_VERSION = pkg_resources.get_distribution('nexus3-cli').version
ENV_VAR_PREF... | 31.562863 | 79 | 0.678147 |
e6ec23c54b6edac396bae9ceefdff2408c5b7094 | 349 | py | Python | src/streamlit/pages/edapages/eda_script.py | Supreeth-Shetty/neuro-data | 8332485421b04120924d4640d221f40cacb78741 | [
"MIT"
] | null | null | null | src/streamlit/pages/edapages/eda_script.py | Supreeth-Shetty/neuro-data | 8332485421b04120924d4640d221f40cacb78741 | [
"MIT"
] | null | null | null | src/streamlit/pages/edapages/eda_script.py | Supreeth-Shetty/neuro-data | 8332485421b04120924d4640d221f40cacb78741 | [
"MIT"
] | null | null | null | import pandas as pd
import streamlit as st
# import sqlite3
# from sqlite3 import Connection
# from . import excelpage,dashboard
# from .resource import *
# from multipage import MultiPage
import numpy as np
import pandas as pd
#import excelpage
# @st.cache
#from DataTransfer.src.resource import *
def app():
st.... | 16.619048 | 40 | 0.753582 |
0b5d443267892b00346bb16a4474de34a80cc444 | 58,729 | py | Python | XMLConverter.py | seriousthoj/PlexConnect | 9c726f8cae8d13479df51ae8e89900ef30756c63 | [
"MIT"
] | null | null | null | XMLConverter.py | seriousthoj/PlexConnect | 9c726f8cae8d13479df51ae8e89900ef30756c63 | [
"MIT"
] | null | null | null | XMLConverter.py | seriousthoj/PlexConnect | 9c726f8cae8d13479df51ae8e89900ef30756c63 | [
"MIT"
] | 1 | 2019-01-30T21:19:11.000Z | 2019-01-30T21:19:11.000Z | #!/usr/bin/env python
"""
Sources:
ElementTree
http://docs.python.org/2/library/xml.etree.elementtree.html#xml.etree.ElementTree.SubElement
trailers.apple.com root URL
http://trailers.apple.com/appletv/us/js/application.js
navigation pane
http://trailers.apple.com/appletv/us/nav.xml
->top trailers: http://trailers.a... | 40.81237 | 190 | 0.563589 |
c8f99518a955c5b3570e700e22863e873cd33dbc | 26,670 | py | Python | tests/common/test_server.py | doooooolfinbot/python-socketio | 38fd4396de2d02057161008a70d1dd134d14e803 | [
"MIT"
] | 1 | 2019-06-10T21:51:59.000Z | 2019-06-10T21:51:59.000Z | tests/common/test_server.py | doooooolfinbot/python-socketio | 38fd4396de2d02057161008a70d1dd134d14e803 | [
"MIT"
] | null | null | null | tests/common/test_server.py | doooooolfinbot/python-socketio | 38fd4396de2d02057161008a70d1dd134d14e803 | [
"MIT"
] | null | null | null | import json
import logging
import unittest
import six
if six.PY3:
from unittest import mock
else:
import mock
from socketio import exceptions
from socketio import namespace
from socketio import packet
from socketio import server
@mock.patch('engineio.Server')
class TestServer(unittest.TestCase):
def tea... | 40.655488 | 79 | 0.595276 |
757c26bec7553912bd7f07b76bb4ae817c12e471 | 4,805 | py | Python | pymc/distributions/transforms.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 1,554 | 2015-01-03T05:50:28.000Z | 2022-03-31T03:32:29.000Z | pymc/distributions/transforms.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 922 | 2015-01-03T17:51:09.000Z | 2022-03-31T22:49:44.000Z | pymc/distributions/transforms.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 484 | 2015-01-12T16:44:47.000Z | 2022-03-31T13:40:01.000Z | # Copyright 2020 The PyMC Developers
# 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 agree... | 28.772455 | 121 | 0.619355 |
951d53c8016389058180d7c7e6cd4c100f060ba2 | 2,278 | py | Python | syft_proto/types/torch/v1/device_pb2.py | bcebere/syft-proto | 7c997f254d6848082a770a9cdb21aa7f14438c06 | [
"Apache-2.0"
] | null | null | null | syft_proto/types/torch/v1/device_pb2.py | bcebere/syft-proto | 7c997f254d6848082a770a9cdb21aa7f14438c06 | [
"Apache-2.0"
] | null | null | null | syft_proto/types/torch/v1/device_pb2.py | bcebere/syft-proto | 7c997f254d6848082a770a9cdb21aa7f14438c06 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: syft_proto/types/torch/v1/device.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _refle... | 31.638889 | 214 | 0.762511 |
8e24d5f3e118b8d375b390d1933cc188d324be1f | 2,749 | py | Python | python/generative.py | dblalock/sprintz | a056cdb67d049669875ab5487359aca99ae873ea | [
"Apache-2.0"
] | 45 | 2019-02-02T15:50:25.000Z | 2022-03-08T05:42:06.000Z | python/generative.py | memetb/sprintz | a056cdb67d049669875ab5487359aca99ae873ea | [
"Apache-2.0"
] | 2 | 2020-03-27T23:29:15.000Z | 2020-11-09T01:37:08.000Z | python/generative.py | memetb/sprintz | a056cdb67d049669875ab5487359aca99ae873ea | [
"Apache-2.0"
] | 10 | 2019-03-08T09:04:29.000Z | 2022-02-18T22:28:23.000Z | #!/usr/bin/env python
# generative model associated with compression approaches to give us insights
# into how to compress better
import numpy as np
import matplotlib.pyplot as plt
# from .datasets import viz
# ================================================================ main
def unif_nbits(N=200, B=16, M=8, ... | 27.767677 | 77 | 0.548563 |
baecaea74dfed9a5242f26f68315efad3c0e118b | 17,454 | py | Python | tests/test_31_introspection.py | IdentityPython/oicsrv | 951da10e09db72ca1ea9713c9e154bbe8db123bf | [
"Apache-2.0"
] | 6 | 2019-01-11T00:31:25.000Z | 2020-11-05T18:17:09.000Z | tests/test_31_introspection.py | IdentityPython/oicsrv | 951da10e09db72ca1ea9713c9e154bbe8db123bf | [
"Apache-2.0"
] | 69 | 2019-03-06T10:35:00.000Z | 2021-04-21T18:13:58.000Z | tests/test_31_introspection.py | IdentityPython/oicsrv | 951da10e09db72ca1ea9713c9e154bbe8db123bf | [
"Apache-2.0"
] | 8 | 2019-01-11T00:37:57.000Z | 2020-05-11T11:08:04.000Z | import base64
import json
import os
import pytest
from cryptojwt import JWT
from cryptojwt import as_unicode
from cryptojwt.key_jar import build_keyjar
from cryptojwt.utils import as_bytes
from oidcmsg.oauth2 import TokenIntrospectionRequest
from oidcmsg.oidc import AccessTokenRequest
from oidcmsg.oidc import Authoriz... | 37.374732 | 98 | 0.576143 |
d33e5596297b8c6f1e66adc64fafeb4ae3c66c17 | 2,559 | py | Python | setup_logging.py | labscript-suite-temp-archive/labscript_utils-fork--pstarkey-labscript_utils--forked-from--labscript_suite-labscript_utils | 136e173280716295a0611980947c4cf54f9125cf | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | setup_logging.py | labscript-suite-temp-archive/labscript_utils-fork--pstarkey-labscript_utils--forked-from--labscript_suite-labscript_utils | 136e173280716295a0611980947c4cf54f9125cf | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | setup_logging.py | labscript-suite-temp-archive/labscript_utils-fork--pstarkey-labscript_utils--forked-from--labscript_suite-labscript_utils | 136e173280716295a0611980947c4cf54f9125cf | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #####################################################################
# #
# /setup_logging.py #
# #
# Copyright 2013, Monash University ... | 49.211538 | 125 | 0.555295 |
45581d52ae344accdcfbadf9a002ee13e339717f | 5,559 | py | Python | qucumber/callbacks/metric_evaluator.py | GTorlai/QuCumber | 128f68b7a2b1187a7f252b29c87e2de724fa200f | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-25T07:54:11.000Z | 2021-06-18T18:37:30.000Z | qucumber/callbacks/metric_evaluator.py | GTorlai/QuCumber | 128f68b7a2b1187a7f252b29c87e2de724fa200f | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | qucumber/callbacks/metric_evaluator.py | GTorlai/QuCumber | 128f68b7a2b1187a7f252b29c87e2de724fa200f | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-25T07:54:15.000Z | 2021-05-25T07:54:15.000Z | # Copyright 2019 PIQuIL - All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed ... | 37.308725 | 89 | 0.629969 |
2ead57eac6b226c154c974d7ccb2a8895c4443e5 | 625 | py | Python | manage.py | Ecotrust/TogglParser | 95f0806b7f8ec9078e73f1623fc852a869d40183 | [
"Apache-2.0"
] | null | null | null | manage.py | Ecotrust/TogglParser | 95f0806b7f8ec9078e73f1623fc852a869d40183 | [
"Apache-2.0"
] | 1 | 2020-01-14T17:45:21.000Z | 2020-01-14T17:45:21.000Z | manage.py | Ecotrust/TogglParser | 95f0806b7f8ec9078e73f1623fc852a869d40183 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'toggl.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportEr... | 28.409091 | 73 | 0.6816 |
3d212130ffaec0252dff96b476e077d06ece7311 | 8,338 | py | Python | src/algorithms/sac.py | jangirrishabh/look-closer | 91647b429a5e8f85fe29079035d4f51772df8382 | [
"MIT"
] | 15 | 2022-01-20T01:04:35.000Z | 2022-01-29T09:30:50.000Z | src/algorithms/sac.py | jangirrishabh/look-closer | 91647b429a5e8f85fe29079035d4f51772df8382 | [
"MIT"
] | 1 | 2022-03-24T23:44:11.000Z | 2022-03-27T21:59:24.000Z | src/algorithms/sac.py | jangirrishabh/look-closer | 91647b429a5e8f85fe29079035d4f51772df8382 | [
"MIT"
] | 1 | 2022-01-29T09:30:50.000Z | 2022-01-29T09:30:50.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
import utils
import algorithms.modules as m
from color_jitter import random_color_jitter
class SAC(object):
def __init__(self, obs_shape, state_shape, action_shape, args):
self.discount = args.discount
self.upd... | 34.032653 | 187 | 0.710602 |
85c9025c37e8c84d3e816f3ac280f86482493dc2 | 6,486 | py | Python | nets/yolo3.py | ElegantAnkster/yolov3-pytorch | 310c013f8a995dd32c83fed4b40fcd6533d290cc | [
"MIT"
] | 3 | 2021-05-29T17:42:48.000Z | 2021-06-05T09:41:34.000Z | nets/yolo3.py | ElegantAnkster/yolov3-pytorch | 310c013f8a995dd32c83fed4b40fcd6533d290cc | [
"MIT"
] | null | null | null | nets/yolo3.py | ElegantAnkster/yolov3-pytorch | 310c013f8a995dd32c83fed4b40fcd6533d290cc | [
"MIT"
] | 1 | 2021-05-29T17:43:47.000Z | 2021-05-29T17:43:47.000Z | from collections import OrderedDict
import torch
import torch.nn as nn
from nets.darknet import darknet53
# filter_in输入特征通道数
# filter_out输出特征通道数
# kernel_size卷积核大小
# # 其实就是一组卷积、标准化、激活函数
def conv2d(filter_in, filter_out, kernel_size):
pad = (kernel_size - 1) // 2 if kernel_size else 0
return nn.Sequential(Or... | 36.033333 | 111 | 0.506321 |
403d49a1b5150dd1640c1dedc4614be24e9fb407 | 250 | py | Python | hello/abs/my_abs.py | ToBegin/hello-python | 71d9989e3a8695550391ac544c59e5866366a3e7 | [
"Apache-2.0"
] | null | null | null | hello/abs/my_abs.py | ToBegin/hello-python | 71d9989e3a8695550391ac544c59e5866366a3e7 | [
"Apache-2.0"
] | null | null | null | hello/abs/my_abs.py | ToBegin/hello-python | 71d9989e3a8695550391ac544c59e5866366a3e7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# pep8 -> pip install --upgrade autopep8
def my_abs(num):
if not isinstance(num, (int, float)):
raise TypeError('bad operand type expect Number')
if num > 0:
return num
else:
return -num
| 20.833333 | 57 | 0.58 |
27e4f5a048517cf79340842956f1b7a9d95a0367 | 4,142 | py | Python | awx_collection/plugins/modules/tower_host.py | Akasurde/awx | b81c9dbeeaa891b258364a6471924e3f43994430 | [
"Apache-2.0"
] | null | null | null | awx_collection/plugins/modules/tower_host.py | Akasurde/awx | b81c9dbeeaa891b258364a6471924e3f43994430 | [
"Apache-2.0"
] | 12 | 2021-06-17T07:32:11.000Z | 2022-03-29T22:11:45.000Z | awx_collection/plugins/modules/tower_host.py | Akasurde/awx | b81c9dbeeaa891b258364a6471924e3f43994430 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | 28.965035 | 119 | 0.647272 |
9f7487fdc63aa90ebd17013e25529ff6ca7b5b24 | 2,093 | py | Python | tests/utils/test_data.py | piyueh/TorchSWE | 3faa18d83e24ae0b74966777516458eb1aa6f480 | [
"BSD-3-Clause"
] | 2 | 2022-03-07T09:22:27.000Z | 2022-03-24T02:30:30.000Z | tests/utils/test_data.py | reyhashemi/TorchSWE | 3faa18d83e24ae0b74966777516458eb1aa6f480 | [
"BSD-3-Clause"
] | null | null | null | tests/utils/test_data.py | reyhashemi/TorchSWE | 3faa18d83e24ae0b74966777516458eb1aa6f480 | [
"BSD-3-Clause"
] | 2 | 2021-05-18T10:56:56.000Z | 2022-01-11T09:12:09.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2021 Pi-Yueh Chuang <pychuang@gwu.edu>
#
# Distributed under terms of the BSD 3-Clause license.
"""Tests for data models.
"""
import pydantic
from torchswe import nplike
from torchswe.utils.data import Gridline
def test_gridline_validat... | 34.311475 | 92 | 0.607262 |
ce3ec0a3989eefafa0a993e7775793040c7bc917 | 333 | py | Python | carball/__init__.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/__init__.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/__init__.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | try:
# from carball.decompile_replays import decompile_replay
# from carball.decompile_replays import analyze_replay_file
pass
except ModuleNotFoundError as e:
print("Not importing functions due to missing packages:", e)
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent / "... | 27.75 | 64 | 0.774775 |
32babaed7bdf357284556f6efaf1c97d2179e7bc | 10,503 | py | Python | factories/workflow_models.py | Falliatcom-sa/falliatcom | 39fb926de072c296ed32d50cccfb8003ca870739 | [
"Apache-2.0"
] | null | null | null | factories/workflow_models.py | Falliatcom-sa/falliatcom | 39fb926de072c296ed32d50cccfb8003ca870739 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:42:48.000Z | 2022-03-12T00:19:38.000Z | factories/workflow_models.py | Falliatcom-sa/falliatcom | 39fb926de072c296ed32d50cccfb8003ca870739 | [
"Apache-2.0"
] | null | null | null | import itertools
import datetime
from django.template.defaultfilters import slugify
from factory import (
DjangoModelFactory,
lazy_attribute,
LazyAttribute,
SubFactory,
PostGeneration,
post_generation,
Sequence,
RelatedFactory,
Trait
)
from factories.django_models import UserFactory,... | 35.12709 | 122 | 0.619823 |
658938c7886664b71c104e3f932bcbe69f7245a7 | 7,617 | py | Python | _unittests/ut_onnxrt/test_onnxrt_python_runtime_2.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | 1 | 2020-12-18T03:49:53.000Z | 2020-12-18T03:49:53.000Z | _unittests/ut_onnxrt/test_onnxrt_python_runtime_2.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | null | null | null | _unittests/ut_onnxrt/test_onnxrt_python_runtime_2.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | null | null | null | """
@brief test log(time=2s)
"""
import unittest
from logging import getLogger
import numpy
from pyquickhelper.pycode import ExtTestCase
from skl2onnx.algebra.onnx_ops import ( # pylint: disable=E0611
OnnxArrayFeatureExtractor,
)
from skl2onnx.common.data_types import FloatTensorType
from skl2onnx import __ve... | 46.445122 | 107 | 0.562164 |
c754e0aae68dcc6dbf748d795935927777cb4a4e | 479 | py | Python | main.py | opa-oz/python-utils-server | 9a911ee52b0893ef0680b4dcc700d4f50d9e0780 | [
"MIT"
] | null | null | null | main.py | opa-oz/python-utils-server | 9a911ee52b0893ef0680b4dcc700d4f50d9e0780 | [
"MIT"
] | null | null | null | main.py | opa-oz/python-utils-server | 9a911ee52b0893ef0680b4dcc700d4f50d9e0780 | [
"MIT"
] | null | null | null | from http.server import HTTPServer
from server import Server
from src.utils.logger import Logger
HOST_NAME = 'localhost'
PORT_NUMBER = 8080
logger = Logger('Runner')
if __name__ == '__main__':
httpd = HTTPServer((HOST_NAME, PORT_NUMBER), Server)
logger.info(f'Server UP - {HOST_NAME}:{PORT_NUMBER}')
try:... | 23.95 | 59 | 0.703549 |
560897fda8716108397196295a96b821c1a224d3 | 39,854 | py | Python | ravem/tests/operations_test.py | pferreir/indico-plugins-cern | 0fc2eb6b1aa3c3083a813477886a6632f148a4d9 | [
"MIT"
] | null | null | null | ravem/tests/operations_test.py | pferreir/indico-plugins-cern | 0fc2eb6b1aa3c3083a813477886a6632f148a4d9 | [
"MIT"
] | null | null | null | ravem/tests/operations_test.py | pferreir/indico-plugins-cern | 0fc2eb6b1aa3c3083a813477886a6632f148a4d9 | [
"MIT"
] | null | null | null | # This file is part of the CERN Indico plugins.
# Copyright (C) 2014 - 2019 CERN
#
# The CERN Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License; see
# the LICENSE file for more details.
import json
import logging
import pytest
from mock import MagicMoc... | 39.381423 | 119 | 0.612987 |
3625c658c84d2f9e9edd994771f3a0ee093fec69 | 360 | py | Python | jumper/animations/blood_animation.py | ccmikechen/Jumper-Game | b68a03cdfee27cea2bfb321f77b57ce80904bef6 | [
"MIT"
] | null | null | null | jumper/animations/blood_animation.py | ccmikechen/Jumper-Game | b68a03cdfee27cea2bfb321f77b57ce80904bef6 | [
"MIT"
] | null | null | null | jumper/animations/blood_animation.py | ccmikechen/Jumper-Game | b68a03cdfee27cea2bfb321f77b57ce80904bef6 | [
"MIT"
] | 1 | 2017-12-19T17:42:52.000Z | 2017-12-19T17:42:52.000Z | from jumper.animation import Animation
from jumper.sprite_sheet import SpriteSheet
class BloodAnimation(Animation):
def __init__(self, time, position, size):
super().__init__(6, time, position, size)
self.sprite_sheet = SpriteSheet("blood", (512, 512))
def get_frame(self, index):
retu... | 30 | 60 | 0.713889 |
2c7dc53e610c7670f64dee2202ea6fa8268836fb | 6,001 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/pavelib/paver_tests/test_i18n.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/pavelib/paver_tests/test_i18n.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/pavelib/paver_tests/test_i18n.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Tests for pavelib/i18n.py.
"""
import os
import textwrap
import unittest
from unittest.mock import mock_open, patch
import pytest
from paver.easy import call_task, task
import pavelib.i18n
from pavelib.paver_tests.utils import PaverTestCase
from pavelib.utils.envs import Env
TX_CONFIG_SIMPLE = """\
[main]
host... | 32.090909 | 111 | 0.690385 |
5887e32919776fd82b935d5e8293a7213c90a06c | 232 | py | Python | sample_python_package/__init__.py | wesleyit/sample_python_package | 21d0cad1db304e7f2ec6b236dad6eb144cc16d3d | [
"MIT"
] | 1 | 2020-11-20T21:28:30.000Z | 2020-11-20T21:28:30.000Z | sample_python_package/__init__.py | wesleyit/sample_python_package | 21d0cad1db304e7f2ec6b236dad6eb144cc16d3d | [
"MIT"
] | null | null | null | sample_python_package/__init__.py | wesleyit/sample_python_package | 21d0cad1db304e7f2ec6b236dad6eb144cc16d3d | [
"MIT"
] | null | null | null | """
sample_python_package
=====================
This is a sample package structure which
you can apply to your python projects.
"""
__version__ = '0.1.0'
__author__ = 'Wesley Rodrigues da Silva <wesley.it@gmail.com>'
__all__ = []
| 19.333333 | 62 | 0.668103 |
2416fb1412b9d6636e0ed6de6a428ee37b7f2997 | 4,397 | py | Python | tests/test_xmltodict_facten.py | Facten/xmltodict | 871d419d8282303b24d58de25f9096b150b08536 | [
"MIT"
] | null | null | null | tests/test_xmltodict_facten.py | Facten/xmltodict | 871d419d8282303b24d58de25f9096b150b08536 | [
"MIT"
] | null | null | null | tests/test_xmltodict_facten.py | Facten/xmltodict | 871d419d8282303b24d58de25f9096b150b08536 | [
"MIT"
] | null | null | null | from xmltodict import parse, ParsingInterrupted
import collections
import unittest
class XMLToDictFactenTestCase(unittest.TestCase):
def test_force_flatten_callable(self):
xml = """
<config>
<flatten>
<server>
<name>server1</name>
... | 27.310559 | 87 | 0.380487 |
42c721704bff866699f355c75b6aa6f913ca936f | 379 | py | Python | products/models.py | pcromano/py1 | dae829f42edaf6985653e0cdb1080306c24458d4 | [
"Unlicense"
] | null | null | null | products/models.py | pcromano/py1 | dae829f42edaf6985653e0cdb1080306c24458d4 | [
"Unlicense"
] | null | null | null | products/models.py | pcromano/py1 | dae829f42edaf6985653e0cdb1080306c24458d4 | [
"Unlicense"
] | null | null | null | from django.db import models
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.FloatField()
stock = models.IntegerField()
image_url = models.CharField(max_length=2083)
class Offer(models.Model):
code = models.CharField(max_length=10)
description = models.Cha... | 23.6875 | 50 | 0.728232 |
79744008b5b6a88b62093342d0542b31746853ee | 9,001 | py | Python | graphlca.py | BlueSmiley/Least-Common-Ancestor | d97759299629c9f90c0732e33765dea3dd5589a3 | [
"MIT"
] | null | null | null | graphlca.py | BlueSmiley/Least-Common-Ancestor | d97759299629c9f90c0732e33765dea3dd5589a3 | [
"MIT"
] | null | null | null | graphlca.py | BlueSmiley/Least-Common-Ancestor | d97759299629c9f90c0732e33765dea3dd5589a3 | [
"MIT"
] | null | null | null |
class LCAGraph(object):
"""
Create graphs with which the lowest common ancestor of nodes can be found
Offers functionality to add nodes and edges between nodes to an instance
of the class which represents a directed acyclic graph.
Allows keys of any type for nodes as long as __eq__ and __hash__ is... | 42.658768 | 80 | 0.630708 |
5198b0056b4a6ad4ba0bc8c4ca88fc6776d918af | 1,492 | py | Python | light_aligner/text2udict.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | 3 | 2020-08-09T12:58:56.000Z | 2021-08-11T02:08:22.000Z | light_aligner/text2udict.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | null | null | null | light_aligner/text2udict.py | ffreemt/light-aligner | fb1c3f2e7105c9f3ff4f5b3a93b817fd81ca7a9a | [
"MIT"
] | null | null | null | r""" text (: or TAB separate) to dict(userdef: 1 )
takes only te first delimter if more than one exist
discard the line if no delimiter exists.
"""
from typing import Optional, Dict
# from pathlib import Path
import re
# from light_aligner.read_text import read_text
# def text2udict(text: str, delim: Optio... | 27.62963 | 115 | 0.559651 |
c4e9245cd7953df62cf1d74b7bb923ee20e3af6f | 284 | py | Python | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:55:29.000Z | 2021-04-29T14:55:29.000Z | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/agriculture/doctype/linked_soil_analysis/linked_soil_analysis.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | 1 | 2021-04-29T14:39:01.000Z | 2021-04-29T14:39:01.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class LinkedSoilAnalysis(Document):
pass
| 25.818182 | 68 | 0.785211 |
457fb1f94817a10d3bc6be1fda4bd8c546792a58 | 855 | py | Python | logger/AppLogger.py | Bennett-Wendorf/Kivy-Raspi-Desktop-App | ff80665260bc95bff963680682fc46c4b15a7c8e | [
"MIT"
] | 7 | 2020-03-12T07:56:14.000Z | 2022-01-22T21:36:52.000Z | logger/AppLogger.py | Bennett-Wendorf/Kivy-Raspi-Desktop-App | ff80665260bc95bff963680682fc46c4b15a7c8e | [
"MIT"
] | 6 | 2021-01-02T01:49:02.000Z | 2021-06-05T01:46:29.000Z | logger/AppLogger.py | Bennett-Wendorf/Kivy-Raspi-Desktop-App | ff80665260bc95bff963680682fc46c4b15a7c8e | [
"MIT"
] | null | null | null | import logging
from datetime import datetime
# TODO Change these when I come up with an app name
APP_LOGGER_NAME = "App"
APP_LOG_FILENAME = 'app.log'
def build_logger(logger_name = APP_LOGGER_NAME, filename = APP_LOG_FILENAME, debug = False):
logger = logging.getLogger(logger_name)
logger.setLevel(logging.DEB... | 31.666667 | 118 | 0.74386 |
6168559e7d09d50f3c24ed2f3a47be61fcf43529 | 37,631 | py | Python | harness/determined/profiler.py | mackrorysd/determined | 4a5c47042cbe27d41f4bf3bbccaa13890239ed97 | [
"Apache-2.0"
] | null | null | null | harness/determined/profiler.py | mackrorysd/determined | 4a5c47042cbe27d41f4bf3bbccaa13890239ed97 | [
"Apache-2.0"
] | null | null | null | harness/determined/profiler.py | mackrorysd/determined | 4a5c47042cbe27d41f4bf3bbccaa13890239ed97 | [
"Apache-2.0"
] | null | null | null | import contextlib
import logging
import queue
import threading
import time
from datetime import datetime, timedelta, timezone
from enum import Enum
from types import TracebackType
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, Union, cast
import psutil
import determined as det
from det... | 37.518445 | 100 | 0.641333 |
594f05c0e570de09a17902a170cb798b0cd5ddfc | 1,371 | py | Python | lamby/__init__.py | lamby-ml/lamby-cli | c6f7d21750c94e47ced05bdb2e11a7e882e77f93 | [
"MIT"
] | null | null | null | lamby/__init__.py | lamby-ml/lamby-cli | c6f7d21750c94e47ced05bdb2e11a7e882e77f93 | [
"MIT"
] | 7 | 2019-02-04T19:39:42.000Z | 2019-04-18T16:33:54.000Z | lamby/__init__.py | lamby-ml/lamby-cli | c6f7d21750c94e47ced05bdb2e11a7e882e77f93 | [
"MIT"
] | null | null | null | import click
from lamby.src.auth import auth
from lamby.src.checkout import checkout
from lamby.src.clone import clone
from lamby.src.commit import commit
from lamby.src.config import config
from lamby.src.init import init
from lamby.src.log import log
from lamby.src.pull import pull
from lamby.src.push import push
fr... | 25.388889 | 75 | 0.755653 |
fb3dbd08731c5794262313da3deaa52e6a585285 | 98,697 | py | Python | kubernetes/client/api/events_v1_api.py | henrywu2019/python | fb7214144395c05349e70a58ea129576f6b11fc4 | [
"Apache-2.0"
] | 4,417 | 2018-01-13T04:30:48.000Z | 2022-03-31T15:33:59.000Z | kubernetes/client/api/events_v1_api.py | henrywu2019/python | fb7214144395c05349e70a58ea129576f6b11fc4 | [
"Apache-2.0"
] | 1,414 | 2018-01-12T19:31:56.000Z | 2022-03-31T22:01:02.000Z | kubernetes/client/api/events_v1_api.py | henrywu2019/python | fb7214144395c05349e70a58ea129576f6b11fc4 | [
"Apache-2.0"
] | 2,854 | 2018-01-14T08:57:33.000Z | 2022-03-31T01:41:56.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.21
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import r... | 72.411592 | 1,390 | 0.675188 |
c304cb2f361a0068aa3cf02278fd52b257e39521 | 671 | py | Python | hedgehogsRestApi/tools/parse_collections.py | rmarathay/hedgehogs_rcos | 07129fbd215e4b6a68f0ce4f9a47101f56222aa9 | [
"MIT"
] | 9 | 2018-02-06T19:08:16.000Z | 2022-03-15T13:31:57.000Z | hedgehogsRestApi/tools/parse_collections.py | rmarathay/hedgehogs_rcos | 07129fbd215e4b6a68f0ce4f9a47101f56222aa9 | [
"MIT"
] | 37 | 2018-02-09T21:22:58.000Z | 2021-12-13T19:51:24.000Z | hedgehogsRestApi/tools/parse_collections.py | rmarathay/hedgehogs_rcos | 07129fbd215e4b6a68f0ce4f9a47101f56222aa9 | [
"MIT"
] | 10 | 2018-02-27T20:26:55.000Z | 2021-02-06T02:26:30.000Z | import csv
import pickle
c_dict = dict()
def save_obj(obj, name ):
with open(name+'.pkl', 'wb') as f:
pickle.dump(obj, f, pickle.HIGHEST_PROTOCOL)
def load_obj(name ):
with open(name + '.pkl', 'rb') as f:
return pickle.load(f)
def intial_save():
with open('constituents.csv') as csv_file:
c... | 22.366667 | 54 | 0.627422 |
11fd6af8b845020962f91cbac8aa37846ca872a5 | 352 | py | Python | ramda/omit_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 56 | 2018-08-06T08:44:58.000Z | 2022-03-17T09:49:03.000Z | ramda/omit_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 28 | 2019-06-17T11:09:52.000Z | 2022-02-18T16:59:21.000Z | ramda/omit_test.py | jakobkolb/ramda.py | 982b2172f4bb95b9a5b09eff8077362d6f2f0920 | [
"MIT"
] | 5 | 2019-09-18T09:24:38.000Z | 2021-07-21T08:40:23.000Z | from .omit import omit
from ramda.private.asserts import assert_dicts_equal
def pick_nocurry_test():
assert_dicts_equal(
omit(["a", "d"], {"a": 1, "b": 2, "c": 3, "d": 4}), {"b": 2, "c": 3}
)
assert_dicts_equal(
omit(["there_is_no_key"], {"a": 1, "b": 2, "c": 3, "d": 4}),
{"a": 1,... | 25.142857 | 76 | 0.494318 |
b2e3292b8ad11f6f29b5488514f96f4893d7ad09 | 4,727 | py | Python | src/mitre/securingai/restapi/queue/schema.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 14 | 2021-06-17T15:16:12.000Z | 2021-11-08T10:25:37.000Z | src/mitre/securingai/restapi/queue/schema.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 7 | 2021-09-20T20:20:26.000Z | 2022-03-30T13:17:43.000Z | src/mitre/securingai/restapi/queue/schema.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 4 | 2021-06-29T16:52:42.000Z | 2022-01-21T16:56:45.000Z | # This Software (Dioptra) is being made available as a public service by the
# National Institute of Standards and Technology (NIST), an Agency of the United
# States Department of Commerce. This software was developed in part by employees of
# NIST and in part by NIST contractors. Copyright in portions of this softwar... | 34.007194 | 86 | 0.688809 |
1e193830005f62b32be1f1692849ef38afda956b | 5,379 | py | Python | homeassistant/components/rollershutter/zwave.py | smilepc/Home-assistant | db3bfad0b5e0815ba1e255d4d646af7c99caef8b | [
"MIT"
] | null | null | null | homeassistant/components/rollershutter/zwave.py | smilepc/Home-assistant | db3bfad0b5e0815ba1e255d4d646af7c99caef8b | [
"MIT"
] | null | null | null | homeassistant/components/rollershutter/zwave.py | smilepc/Home-assistant | db3bfad0b5e0815ba1e255d4d646af7c99caef8b | [
"MIT"
] | null | null | null | """
Support for Zwave roller shutter components.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/rollershutter.zwave/
"""
# Because we do not compile openzwave on CI
# pylint: disable=import-error
import logging
from homeassistant.components.rollershutter im... | 38.978261 | 77 | 0.649935 |
774ee65dfd752741671339a7433c763fb83d57ff | 1,799 | py | Python | avalara/models.py | Lightmatter/django-oscar-avalara | 27e17080bfba1ff6b90dbedcf5fde034c34b7a22 | [
"BSD-3-Clause"
] | 4 | 2015-08-14T20:43:01.000Z | 2021-02-08T03:43:04.000Z | avalara/models.py | Lightmatter/django-oscar-avalara | 27e17080bfba1ff6b90dbedcf5fde034c34b7a22 | [
"BSD-3-Clause"
] | 3 | 2015-10-03T18:15:47.000Z | 2020-10-05T13:44:33.000Z | avalara/models.py | Lightmatter/django-oscar-avalara | 27e17080bfba1ff6b90dbedcf5fde034c34b7a22 | [
"BSD-3-Clause"
] | 7 | 2015-01-16T16:47:47.000Z | 2019-11-01T18:26:50.000Z | import pprint
from decimal import Decimal as D
from django.db import models
import json
class Request(models.Model):
"""
Audit model for tracking requests
"""
account_number = models.CharField(max_length=64)
method = models.CharField(max_length=32, default="GET")
url = models.CharField(max_le... | 25.7 | 59 | 0.620901 |
3a39d6201d83d332a6e2f0ec80a7162b8c4b147d | 81,886 | py | Python | sklearn/model_selection/tests/test_validation.py | Micky774/scikit-learn | 5d28cd762f09face717eb1a86254bdb3fef9d928 | [
"BSD-3-Clause"
] | null | null | null | sklearn/model_selection/tests/test_validation.py | Micky774/scikit-learn | 5d28cd762f09face717eb1a86254bdb3fef9d928 | [
"BSD-3-Clause"
] | 1 | 2022-03-09T19:32:57.000Z | 2022-03-09T20:23:30.000Z | sklearn/model_selection/tests/test_validation.py | Micky774/scikit-learn | 5d28cd762f09face717eb1a86254bdb3fef9d928 | [
"BSD-3-Clause"
] | null | null | null | """Test the validation module"""
import os
import re
import sys
import tempfile
import warnings
from functools import partial
from time import sleep
import pytest
import numpy as np
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.exceptions import FitFailedWarning
from sklearn.model_selection.tests.test_... | 34.478316 | 88 | 0.644408 |
4e9b44797b9b979a18fec6ab5ac54c11036ddc16 | 36,324 | py | Python | mc_gpu_cube.py | FraCose/Grid-free_prob_safety | 4bf0a404fd0f8859513d8f964bbf0a13fe5d3049 | [
"MIT"
] | null | null | null | mc_gpu_cube.py | FraCose/Grid-free_prob_safety | 4bf0a404fd0f8859513d8f964bbf0a13fe5d3049 | [
"MIT"
] | null | null | null | mc_gpu_cube.py | FraCose/Grid-free_prob_safety | 4bf0a404fd0f8859513d8f964bbf0a13fe5d3049 | [
"MIT"
] | null | null | null | import numpy as np
import cupy as cp
import matplotlib
matplotlib.use('tkagg')
from mpl_toolkits import mplot3d
import matplotlib.pyplot as plt
from itertools import product, combinations
import copy
from matplotlib.patches import Rectangle
# THIS REPOSITORY CONTAINS THE ALGORITHMS EXPLAINED IN THE WORK
# Cosentino, A... | 39.184466 | 133 | 0.485437 |
9a982e9b9491bd033b38d0b403665b4b0415fde4 | 5,530 | py | Python | unicom-task/tenscf_rely/Cryptodome/Util/py3compat.py | Charles-Hello/myScripts | 07f2d0fe51ab3581d812de64c57110bcad6219cd | [
"MIT"
] | 3 | 2021-12-06T15:35:58.000Z | 2021-12-06T15:57:18.000Z | unicom-task/tenscf_rely/Cryptodome/Util/py3compat.py | Charles-Hello/myScripts | 07f2d0fe51ab3581d812de64c57110bcad6219cd | [
"MIT"
] | null | null | null | unicom-task/tenscf_rely/Cryptodome/Util/py3compat.py | Charles-Hello/myScripts | 07f2d0fe51ab3581d812de64c57110bcad6219cd | [
"MIT"
] | 2 | 2022-02-09T19:03:34.000Z | 2022-03-27T03:34:19.000Z | # -*- coding: utf-8 -*-
#
# Util/py3compat.py : Compatibility code for handling Py3k / Python 2.x
#
# Written in 2010 by Thorsten Behrens
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the publi... | 31.6 | 85 | 0.642495 |
a2f858985cc1ed964d013b056a1c6ca8be25f542 | 1,231 | py | Python | rdflib/plugins/parsers/pyRdfa/transform/prototype.py | gromgull/rdflib | 7c90f646e3734ee6d3081b5d3f699f0f501f6a39 | [
"BSD-3-Clause"
] | 4 | 2019-01-07T06:55:58.000Z | 2021-07-16T13:34:58.000Z | rdflib/plugins/parsers/pyRdfa/transform/prototype.py | gromgull/rdflib | 7c90f646e3734ee6d3081b5d3f699f0f501f6a39 | [
"BSD-3-Clause"
] | null | null | null | rdflib/plugins/parsers/pyRdfa/transform/prototype.py | gromgull/rdflib | 7c90f646e3734ee6d3081b5d3f699f0f501f6a39 | [
"BSD-3-Clause"
] | 2 | 2018-05-01T13:18:13.000Z | 2018-11-15T04:58:05.000Z | # -*- coding: utf-8 -*-
"""
Encoding of the RDFa prototype vocabulary behavior. This means processing the graph by adding and removing triples
based on triples using the rdfa:Prototype and rdfa:ref class and property, respectively. For details, see the HTML5+RDFa document.
@author: U{Ivan Herman<a href="http://www.w3... | 36.205882 | 130 | 0.697807 |
47e02bf1c3928ae45bdb7e2156e4a8214f5d36f1 | 3,099 | py | Python | userbot/modules/core.py | Yansaii/Bdrl-Ubot | 60dbbcc8270061379e848c2bce09e756c6ae143a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/core.py | Yansaii/Bdrl-Ubot | 60dbbcc8270061379e848c2bce09e756c6ae143a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/core.py | Yansaii/Bdrl-Ubot | 60dbbcc8270061379e848c2bce09e756c6ae143a | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 7 | 2022-02-03T11:06:48.000Z | 2022-03-09T00:53:53.000Z | # Credits: @mrismanaziz
# FROM Man-Userbot
# Recode by @greyyvbss
# Recode2 by @BukanBdrl
import os
from pathlib import Path
from userbot import CMD_HELP, bot
from userbot.events import bdrl_cmd
from userbot.utils import edit_or_reply, load_module, remove_plugin, reply_id
@bot.on(bdrl_cmd(outgoing=True, pattern="i... | 34.054945 | 92 | 0.582769 |
5bea1c113476096b205aa7df6f2ff375bd79a1e5 | 4,133 | py | Python | main1.py | 17jrb17/E06a-Bullets | 59b576f0819bdb2257c34d29a188336d88909099 | [
"MIT"
] | null | null | null | main1.py | 17jrb17/E06a-Bullets | 59b576f0819bdb2257c34d29a188336d88909099 | [
"MIT"
] | null | null | null | main1.py | 17jrb17/E06a-Bullets | 59b576f0819bdb2257c34d29a188336d88909099 | [
"MIT"
] | null | null | null | import sys, logging, os, random, math, open_color, arcade
#check to make sure we are running the right version of Python
version = (3,7)
assert sys.version_info >= version, "This script requires at least Python {0}.{1}".format(version[0],version[1])
#turn on logging, in case we have to leave ourselves debugging messa... | 30.167883 | 112 | 0.589886 |
c31cb07680427e5ece89b69155684a13368f1fb6 | 5,101 | py | Python | telemetry/telemetry/internal/results/json_output_formatter_unittest.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 4 | 2017-06-04T05:37:39.000Z | 2021-06-26T05:30:15.000Z | telemetry/telemetry/internal/results/json_output_formatter_unittest.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/internal/results/json_output_formatter_unittest.py | ravitejavalluri/catapult | 246a39a82c2213d913a96fff020a263838dc76e6 | [
"BSD-3-Clause"
] | 1 | 2019-10-04T03:24:35.000Z | 2019-10-04T03:24:35.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import os
import shutil
import StringIO
import tempfile
import unittest
from telemetry import story
from telemetry import benchmark
from telemetr... | 37.233577 | 77 | 0.723388 |
983a7f139dbb854725afa36c4c8e02e532859169 | 923 | py | Python | setup.py | pinodeca/tatu | 18413ba679326fed158e014290c4666eecc0ac44 | [
"Apache-2.0"
] | 1 | 2020-12-14T03:17:51.000Z | 2020-12-14T03:17:51.000Z | setup.py | pinodeca/tatu | 18413ba679326fed158e014290c4666eecc0ac44 | [
"Apache-2.0"
] | null | null | null | setup.py | pinodeca/tatu | 18413ba679326fed158e014290c4666eecc0ac44 | [
"Apache-2.0"
] | 1 | 2020-12-14T03:17:52.000Z | 2020-12-14T03:17:52.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 35.5 | 78 | 0.725894 |
8667a0fa2edbc813aba5d3b2f39ff64bcb527c26 | 9,863 | py | Python | mindspore/nn/optim/ftrl.py | HappyKL/mindspore | 479cb89e8b5c9d859130891567038bb849a30bce | [
"Apache-2.0"
] | 2 | 2021-04-22T07:00:59.000Z | 2021-11-08T02:49:09.000Z | mindspore/nn/optim/ftrl.py | ReIadnSan/mindspore | c3d1f54c7f6d6f514e5748430d24b16a4f9ee9e5 | [
"Apache-2.0"
] | 1 | 2020-12-29T06:46:38.000Z | 2020-12-29T06:46:38.000Z | mindspore/nn/optim/ftrl.py | ReIadnSan/mindspore | c3d1f54c7f6d6f514e5748430d24b16a4f9ee9e5 | [
"Apache-2.0"
] | 1 | 2021-05-10T03:30:36.000Z | 2021-05-10T03:30:36.000Z | # 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... | 53.896175 | 119 | 0.669776 |
31892a6e652972171e197d96c86558bbeb68075b | 323 | py | Python | cursoemvideo/python3_mundo3/aula_20/ex096.py | Tiago-Baptista/CursoEmVideo_Python3 | 381044e66594362a3767a776530c2ba7dc02dcf2 | [
"MIT"
] | null | null | null | cursoemvideo/python3_mundo3/aula_20/ex096.py | Tiago-Baptista/CursoEmVideo_Python3 | 381044e66594362a3767a776530c2ba7dc02dcf2 | [
"MIT"
] | null | null | null | cursoemvideo/python3_mundo3/aula_20/ex096.py | Tiago-Baptista/CursoEmVideo_Python3 | 381044e66594362a3767a776530c2ba7dc02dcf2 | [
"MIT"
] | null | null | null | def area(comp, alt):
a = comp * alt
print(f'Um terreno com {comp}m de comprimento e {alt}m de largura, tem uma area de {a} metros quadrados.')
#Calcular a area
print('=' * 20)
print('Calculando uma area')
print('=' * 20)
comp = float(input('Comprimento (m): '))
alt = float(input('Largura (m): '))
area(comp, al... | 26.916667 | 110 | 0.640867 |
55e9e380b8343360d1fdf8eb67a91fdd20314b42 | 758 | py | Python | epcpy/epc_schemes/imovn.py | nedap/retail-epcpy | f5a454f2a06053f64bc42e6c6411fbd6cb47e745 | [
"MIT"
] | 2 | 2022-03-21T08:22:30.000Z | 2022-03-22T12:32:29.000Z | epcpy/epc_schemes/imovn.py | nedap/retail-epcpy | f5a454f2a06053f64bc42e6c6411fbd6cb47e745 | [
"MIT"
] | 1 | 2022-03-28T14:48:52.000Z | 2022-03-28T14:48:52.000Z | epcpy/epc_schemes/imovn.py | nedap/retail-epcpy | f5a454f2a06053f64bc42e6c6411fbd6cb47e745 | [
"MIT"
] | null | null | null | import re
from epcpy.epc_schemes.base_scheme import EPCScheme
from epcpy.utils.common import ConvertException
from epcpy.utils.regex import IMOVN_URI
IMOVN_URI_REGEX = re.compile(IMOVN_URI)
class IMOVN(EPCScheme):
"""IMOVN EPC scheme implementation.
IMOVN pure identities are of the form:
urn:epc:id... | 24.451613 | 75 | 0.700528 |
ad0a6bfff4213cecafaf48d8f3839cb767d76ef0 | 848 | py | Python | tests/test_wallet.py | VinChain/python-vinchain | 56b25224e8ba04811a6f87f101d92ba464804061 | [
"MIT"
] | 3 | 2018-05-21T03:45:48.000Z | 2021-03-17T00:11:22.000Z | tests/test_wallet.py | VinChain/python-vinchain | 56b25224e8ba04811a6f87f101d92ba464804061 | [
"MIT"
] | null | null | null | tests/test_wallet.py | VinChain/python-vinchain | 56b25224e8ba04811a6f87f101d92ba464804061 | [
"MIT"
] | 2 | 2018-04-13T18:49:54.000Z | 2018-06-06T11:34:07.000Z | import unittest
import mock
from pprint import pprint
from vinchainio import VinChain
from vinchainio.account import Account
from vinchainio.amount import Amount
from vinchainio.asset import Asset
from vinchainio.instance import set_shared_vinchain_instance
from vinchainiobase.operationids import getOperationNameForId
... | 30.285714 | 73 | 0.725236 |
3303b3e5d1939aa642810b08ad7fbd1efbf16ea1 | 7,382 | py | Python | modules/calc_parts/calc_part_019.py | dahsa333/Calc | 990d0b363a4fbe768ce35d0f0cd9f7b168c22b22 | [
"Unlicense"
] | null | null | null | modules/calc_parts/calc_part_019.py | dahsa333/Calc | 990d0b363a4fbe768ce35d0f0cd9f7b168c22b22 | [
"Unlicense"
] | null | null | null | modules/calc_parts/calc_part_019.py | dahsa333/Calc | 990d0b363a4fbe768ce35d0f0cd9f7b168c22b22 | [
"Unlicense"
] | null | null | null | import math
from modules.graph_data import GraphData
from modules.gas_table_data import TableData
import modules.graph_save_data as gs
def add_variables(f):
f.add_variable("cz*" + s(f.v["i_int"] + 1), 1.0, "")
for i in range(1, f.v["i_int"] + 2):
f.add_variable("pt2F_" + s(i), 1.0, "")
f.add_v... | 43.680473 | 120 | 0.487131 |
b908b6417b9045555d430c73cd2f252c18cb62d6 | 1,071 | py | Python | examples/advanced/interpolateScalar.py | Gjacquenot/vtkplotter | dc865f28dec0c6f10de159dc1f8f20dd69ee74cf | [
"MIT"
] | null | null | null | examples/advanced/interpolateScalar.py | Gjacquenot/vtkplotter | dc865f28dec0c6f10de159dc1f8f20dd69ee74cf | [
"MIT"
] | null | null | null | examples/advanced/interpolateScalar.py | Gjacquenot/vtkplotter | dc865f28dec0c6f10de159dc1f8f20dd69ee74cf | [
"MIT"
] | 1 | 2019-05-22T09:23:11.000Z | 2019-05-22T09:23:11.000Z | """
Use scipy to interpolate the value of a scalar known on a set of points
on a new set of points where the scalar is not defined.
Two interpolation methods are possible: Radial Basis Function, Nearest Point.
"""
from scipy.interpolate import Rbf, NearestNDInterpolator as Near
import numpy as np
# np.random.seed(0)
... | 28.945946 | 81 | 0.693744 |
1602be4c10613465dee688fd9439bcf88891e6cf | 2,147 | py | Python | test_files/type_checking2.expected.py | sqlalchemyorg/zimports | 66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7 | [
"MIT"
] | 65 | 2019-01-02T05:44:38.000Z | 2021-11-08T11:47:09.000Z | test_files/type_checking2.expected.py | sqlalchemyorg/zimports | 66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7 | [
"MIT"
] | 32 | 2019-01-07T15:43:15.000Z | 2022-02-09T20:36:32.000Z | test_files/type_checking2.expected.py | sqlalchemyorg/zimports | 66f65b6ecf9f8fc434aff2b4ded1d6738085bbd7 | [
"MIT"
] | 7 | 2019-01-07T15:11:31.000Z | 2020-07-08T17:42:13.000Z | # schema.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Compatibility namespace for sqlalchemy.sql.schema and related.
"""
from typing import ... | 33.546875 | 69 | 0.787145 |
034aa876449fb9e3c57f386dc2b3faa54a147c65 | 12,691 | py | Python | macapype/nodes/extract_brain.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 7 | 2020-07-04T04:04:03.000Z | 2022-03-24T14:35:45.000Z | macapype/nodes/extract_brain.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 95 | 2020-01-02T16:41:20.000Z | 2021-12-07T15:50:41.000Z | macapype/nodes/extract_brain.py | Macatools/macapype | 50820e2ab948c91c5362771d51688edd09b72499 | [
"BSD-3-Clause"
] | 9 | 2019-11-14T12:46:14.000Z | 2022-01-26T09:44:21.000Z |
from nipype.interfaces.base import (CommandLine, CommandLineInputSpec,
TraitedSpec)
from nipype.interfaces.base import traits, File
import os
from nipype.interfaces.fsl.base import (FSLCommand, FSLCommandInputSpec)
class T1xT2BETInputSpec(FSLCommandInputSpec):
t1_file = Fi... | 31.648379 | 79 | 0.569695 |
91c7be67eff797277e5086597830c75018f4a30e | 4,362 | py | Python | tests/integration/console_render/test_text.py | sunnycloudy/python-inquirer_plus | aa962dc5a0f661a3efc05e1eb25188b287e2b665 | [
"MIT"
] | null | null | null | tests/integration/console_render/test_text.py | sunnycloudy/python-inquirer_plus | aa962dc5a0f661a3efc05e1eb25188b287e2b665 | [
"MIT"
] | null | null | null | tests/integration/console_render/test_text.py | sunnycloudy/python-inquirer_plus | aa962dc5a0f661a3efc05e1eb25188b287e2b665 | [
"MIT"
] | null | null | null | import re
import unittest
import inquirer.questions as questions
from . import helper
from readchar import key
from inquirer.render import ConsoleRender
from inquirer import errors
class TextRenderTest(unittest.TestCase, helper.BaseTestCase):
def setUp(self):
self.base_setup()
def tearDown(self):
... | 29.876712 | 76 | 0.569693 |
e6499ce47ce5a918fd30a5369c0e2c5bba169a9d | 615 | py | Python | practice/practice_4/iterator.py | Norbert2808/programming | 3dbab86718c1cee5efe3b4b92e4492f984c75ea2 | [
"Unlicense"
] | null | null | null | practice/practice_4/iterator.py | Norbert2808/programming | 3dbab86718c1cee5efe3b4b92e4492f984c75ea2 | [
"Unlicense"
] | null | null | null | practice/practice_4/iterator.py | Norbert2808/programming | 3dbab86718c1cee5efe3b4b92e4492f984c75ea2 | [
"Unlicense"
] | null | null | null | from generator import isPrime
class IteratorLucasNumbers:
def __init__(self):
self.num = 2
self.first = 2
self.second = 1
def __iter__(self):
return self
def __next__(self):
if self.first == 2:
self.first, self.second = self.second, self.second + self.... | 27.954545 | 79 | 0.560976 |
9da343e3b6583d298d9ce4d5dffbc83ac79143ba | 2,025 | py | Python | fileOverlap.py | neoCaffe/pythonWalk | c78fba44cf6be84303b5dac78538cc85961cbe9a | [
"MIT"
] | null | null | null | fileOverlap.py | neoCaffe/pythonWalk | c78fba44cf6be84303b5dac78538cc85961cbe9a | [
"MIT"
] | null | null | null | fileOverlap.py | neoCaffe/pythonWalk | c78fba44cf6be84303b5dac78538cc85961cbe9a | [
"MIT"
] | null | null | null | ''' fileOverlap.py 檔案重覆之處理 Author: neoCaffe 2021/9/9 '''
import os, hashlib
#--- 找出重覆之檔案
# 參數 nPath 資料夾 / fTypes 要搜尋的類型
def findOverlap( nPath, fTypes ):
allimage = []
allhsh = dict() # key: hash / value: filePath
overlapA = [] # 重覆之檔 位置A
overlapB = [] # 重覆之檔 位置B
f_tree = os.walk(nPat... | 30.681818 | 68 | 0.555062 |
5e198be86157b2c52ad32109f3e6285026bed740 | 6,601 | py | Python | pyzoo/zoo/chronos/autots/deprecated/forecast.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 2,970 | 2017-06-08T00:24:43.000Z | 2022-03-30T12:14:55.000Z | pyzoo/zoo/chronos/autots/deprecated/forecast.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 3,530 | 2017-05-09T08:29:10.000Z | 2022-03-21T02:11:45.000Z | pyzoo/zoo/chronos/autots/deprecated/forecast.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 972 | 2017-05-09T07:03:50.000Z | 2022-03-23T07:48:48.000Z | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 34.380208 | 98 | 0.579912 |
571e29cdeceb2a95843caa9472512d63c195b7a2 | 1,278 | py | Python | setup.py | TediCreations/buildutil | 75742ca37c73eb232db3c44941aa6a8de9d7cee5 | [
"MIT"
] | null | null | null | setup.py | TediCreations/buildutil | 75742ca37c73eb232db3c44941aa6a8de9d7cee5 | [
"MIT"
] | 1 | 2021-06-20T18:03:36.000Z | 2021-06-20T18:03:36.000Z | setup.py | TediCreations/buildutil | 75742ca37c73eb232db3c44941aa6a8de9d7cee5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from distutils.core import setup
from os import path
here = path.abspath(path.dirname(__file__))
#-------------------------------------------------------------------------------
# Package name
name="buildutil"
# Import version info
exec(open(path.join(here, '{}/version.py'.format(name))).re... | 27.782609 | 96 | 0.611894 |
4ef843ede383b90c0446cc3bc75a0c8a374351c7 | 396 | py | Python | news/migrations/0014_newsletter_name.py | kneeraazon01/webNewsNepal | bb337678e79293896b88b0ccea77b090b8e1075e | [
"Apache-2.0"
] | 1 | 2020-09-19T16:12:05.000Z | 2020-09-19T16:12:05.000Z | news/migrations/0014_newsletter_name.py | kneeraazon01/webNewsNepal | bb337678e79293896b88b0ccea77b090b8e1075e | [
"Apache-2.0"
] | null | null | null | news/migrations/0014_newsletter_name.py | kneeraazon01/webNewsNepal | bb337678e79293896b88b0ccea77b090b8e1075e | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2 on 2020-08-16 07:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0013_auto_20200816_0739'),
]
operations = [
migrations.AddField(
model_name='newsletter',
name='name',
... | 20.842105 | 65 | 0.603535 |
03f0ec5bc0f3ab07b3532099d45e45208d28df1f | 1,535 | py | Python | kolejka/common/http_socket.py | dtracz/kolejka | ff62bd242b2a3f64f44c3b8e6379e083a67f211d | [
"MIT"
] | 11 | 2018-03-16T08:27:17.000Z | 2021-11-14T23:48:47.000Z | kolejka/common/http_socket.py | dtracz/kolejka | ff62bd242b2a3f64f44c3b8e6379e083a67f211d | [
"MIT"
] | 1 | 2021-08-18T18:05:37.000Z | 2021-08-18T18:05:37.000Z | kolejka/common/http_socket.py | dtracz/kolejka | ff62bd242b2a3f64f44c3b8e6379e083a67f211d | [
"MIT"
] | 3 | 2018-01-10T13:57:19.000Z | 2021-07-24T09:54:27.000Z | # vim:ts=4:sts=4:sw=4:expandtab
import http.client
import os
import socket
import socketserver
import struct
class HTTPUnixServer(socketserver.UnixStreamServer):
allow_reuse_address = 1
def server_bind(self):
try:
os.unlink(self.server_address)
except:
pass
... | 27.410714 | 109 | 0.652769 |
f999d6b1ece91aeed77d8439df2aeb7eb63b0fe5 | 994 | py | Python | setup.py | WLPhoenix/punct | 04b946c68b24a00123905df41ac51f28613abad0 | [
"MIT"
] | null | null | null | setup.py | WLPhoenix/punct | 04b946c68b24a00123905df41ac51f28613abad0 | [
"MIT"
] | null | null | null | setup.py | WLPhoenix/punct | 04b946c68b24a00123905df41ac51f28613abad0 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
version = '0.0.1a3'
setup(
name='punct',
version=version,
url='https://github.com/WLPhoenix/punct',
author='Cory Hughes',
author_email='w.cory.hughes@gmail.com',
description=('A tool to convert fancy unicode punctuation into standard '
... | 33.133333 | 77 | 0.613682 |
9acd1cf8bd37f809aa6d1891eb13a4bb4680456c | 3,980 | py | Python | benchmarks/lasso_replicas/bench_plot_lasso_path_156.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | 1 | 2022-03-03T23:54:50.000Z | 2022-03-03T23:54:50.000Z | benchmarks/lasso_replicas/bench_plot_lasso_path_156.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | null | null | null | benchmarks/lasso_replicas/bench_plot_lasso_path_156.py | Giannos-G/scikit-learn_modified | 03df71bbea1bcb3423262b711191552420422cda | [
"BSD-3-Clause"
] | null | null | null | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_path, lars_path_gram
from sklearn.linear_m... | 34.310345 | 76 | 0.56407 |
290cd15c3b088b77632afac10c8cccada862dde1 | 1,882 | bzl | Python | dart/build_rules/internal/pub.bzl | nickclmb/rules_dart | 2cae27be60b858bfa45c649db15946cabb245556 | [
"Apache-2.0"
] | null | null | null | dart/build_rules/internal/pub.bzl | nickclmb/rules_dart | 2cae27be60b858bfa45c649db15946cabb245556 | [
"Apache-2.0"
] | null | null | null | dart/build_rules/internal/pub.bzl | nickclmb/rules_dart | 2cae27be60b858bfa45c649db15946cabb245556 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 29.40625 | 74 | 0.685441 |
8b69203f58b9df085d14aabe85077de55c11f1f3 | 13,999 | py | Python | vocano/model/PyramidNet_ShakeDrop.py | B05901022/VOCANO | 669b3faa2e3df4aaba84844496c7cb370b6feb1d | [
"MIT"
] | 30 | 2020-10-31T19:57:22.000Z | 2022-03-01T18:15:01.000Z | vocano/model/PyramidNet_ShakeDrop.py | B05901022/VOCANO | 669b3faa2e3df4aaba84844496c7cb370b6feb1d | [
"MIT"
] | 2 | 2021-08-06T17:23:26.000Z | 2021-12-04T15:38:23.000Z | vocano/model/PyramidNet_ShakeDrop.py | B05901022/VOCANO | 669b3faa2e3df4aaba84844496c7cb370b6feb1d | [
"MIT"
] | 2 | 2021-09-13T09:00:29.000Z | 2021-10-08T22:05:40.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 14:24:23 2019
@author: Austin Hsu
"""
import torch
import torch.nn as nn
import math
from .ShakeDrop import ShakeDrop
class PyramidBlock(nn.Module):
def __init__(self, in_channel, out_channel,
stride=1, padding=1, shakedrop=False, p_shakedr... | 38.886111 | 112 | 0.498607 |
be8201c652a6ec805ed62852530fc51c562809db | 11,407 | py | Python | scripts/deploy_dag.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | scripts/deploy_dag.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | scripts/deploy_dag.py | arjunsgill/public-datasets-pipelines | 45dd0b2c15821e38f0b7b511c253025fc7497ad0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 30.097625 | 157 | 0.639432 |
932cc65fe040717f21f7022e6b59a97687907032 | 666 | py | Python | tools/esp_prov/utils/__init__.py | ebertn/esp-idf-nes | 9dc7e9a258fd378d36408a1348253b373974b431 | [
"Apache-2.0"
] | 2 | 2020-06-23T08:05:58.000Z | 2020-06-24T01:25:51.000Z | tools/esp_prov/utils/__init__.py | ebertn/esp-idf-nes | 9dc7e9a258fd378d36408a1348253b373974b431 | [
"Apache-2.0"
] | 2 | 2022-03-29T05:16:50.000Z | 2022-03-29T05:16:50.000Z | vendors/espressif/esp-idf/tools/esp_prov/utils/__init__.py | ictk-solution-dev/amazon-freertos | cc76512292ddfb70bba3030dbcb740ef3c6ead8b | [
"MIT"
] | null | null | null | # Copyright 2018 Espressif Systems (Shanghai) PTE 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 applica... | 39.176471 | 75 | 0.738739 |
c7b22f2012fe226fc094baf6d61bdf7c24fa85c7 | 8,104 | py | Python | ontospy/ontodocs/viz/viz_html_multi.py | lambdamusic/Ontospy | 0b2c06b5aedcc0b755ba17af935558c70a4a03fa | [
"MIT"
] | 134 | 2017-04-09T01:39:07.000Z | 2022-03-31T13:40:05.000Z | ontospy/ontodocs/viz/viz_html_multi.py | lambdamusic/Ontospy | 0b2c06b5aedcc0b755ba17af935558c70a4a03fa | [
"MIT"
] | 76 | 2017-04-14T09:45:42.000Z | 2022-03-11T18:58:59.000Z | ontospy/ontodocs/viz/viz_html_multi.py | lambdamusic/Ontospy | 0b2c06b5aedcc0b755ba17af935558c70a4a03fa | [
"MIT"
] | 39 | 2017-06-04T01:51:42.000Z | 2022-03-08T14:53:09.000Z | # !/usr/bin/env python
# -*- coding: UTF-8 -*-
#
#
# ==================
# VIZ HTML MULTI - html visualization with multiple files, one per entity
# ==================
import os, sys
import json
from ..utils import *
from ..builder import * # loads and sets up Django
from ..viz_factory import VizFactory
class K... | 38.77512 | 133 | 0.596989 |
8182de518904cbcb7160ca000a0810e19ea533c5 | 2,481 | py | Python | src/RIOT/dist/pythonlibs/testrunner/__init__.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | 2 | 2020-04-30T08:17:45.000Z | 2020-05-23T08:46:54.000Z | src/RIOT/dist/pythonlibs/testrunner/__init__.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | null | null | null | src/RIOT/dist/pythonlibs/testrunner/__init__.py | ARte-team/ARte | 19f17f57522e1b18ba390718fc94be246451837b | [
"MIT"
] | null | null | null | # Copyright (C) 2018-19 Freie Universität Berlin
# 2017 Cenk Gündoğan <cenk.guendogan@haw-hamburg.de>
# 2016 Kaspar Schleiser <kaspar@schleiser.de>
# 2014 Martine Lenders <mlenders@inf.fu-berlin.de>
#
# This file is subject to the terms and conditions of the GNU Lesser
# Genera... | 35.442857 | 78 | 0.665054 |
2476a7edabf676815d3a4e6cec1eef52478ecb57 | 414 | py | Python | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | setup_cx.py | deathbreakfast/ManageService | 3b7e21b02af35f93aadc609890e3dff33812e937 | [
"MIT"
] | null | null | null | from cx_Freeze import setup, Executable
executables = [
Executable(
'manageservice/manage-service.py',
base = None,
targetName = 'manage-service'
)
]
setup(
name='Manage Service',
version = '1.0.0',
description = 'A python service that can b... | 23 | 107 | 0.591787 |
03874ed331e9f9db6f4d25c24f8e718a0acac74a | 80,806 | py | Python | tests/components/mqtt/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 3 | 2019-10-02T04:40:26.000Z | 2020-02-16T13:19:08.000Z | tests/components/mqtt/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 25 | 2021-10-02T10:01:14.000Z | 2022-03-31T06:11:49.000Z | tests/components/mqtt/test_init.py | mtarjoianu/core | 44e9146463ac505eb3d1c0651ad126cb25c28a54 | [
"Apache-2.0"
] | 1 | 2021-12-10T10:33:28.000Z | 2021-12-10T10:33:28.000Z | """The tests for the MQTT component."""
import asyncio
from datetime import datetime, timedelta
from functools import partial
import json
import logging
import ssl
from unittest.mock import ANY, AsyncMock, MagicMock, call, mock_open, patch
import pytest
import voluptuous as vol
import yaml
from homeassistant import c... | 33.418528 | 131 | 0.643145 |
26d0fad697a01fa5afcc8f6f90bc61c826972c2f | 305 | py | Python | tictactoe/environment/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | tictactoe/environment/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | tictactoe/environment/__init__.py | luisds95/tictactoe-python | 9765556372e303943bea82b85264e3fdca25a254 | [
"MIT"
] | null | null | null | from tictactoe.environment.board import Board
from tictactoe.environment.constants import DICT_DATABASE_FILE
from tictactoe.environment.enums import GameOutcome
from tictactoe.environment.exceptions import (
BoardError,
GameError,
InvalidBoardError,
InvalidMoveError,
NoWinnerError,
)
| 27.727273 | 62 | 0.813115 |
8489139c34c6113ecdd7b3b77291b83356690f73 | 1,855 | py | Python | Auction/models.py | Poornartha/Odonata | 71e8dfc4e8d93c6ecc1a3a155459b7e43bd28cdb | [
"MIT"
] | null | null | null | Auction/models.py | Poornartha/Odonata | 71e8dfc4e8d93c6ecc1a3a155459b7e43bd28cdb | [
"MIT"
] | null | null | null | Auction/models.py | Poornartha/Odonata | 71e8dfc4e8d93c6ecc1a3a155459b7e43bd28cdb | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from Client.models import Emp as Employee
# Create your models here.
class Task(models.Model):
name = models.TextField()
description = models.TextField()
creator = models.ForeignKey(Employee, on_delete=models.CASCADE , default=1)
... | 41.222222 | 88 | 0.763342 |
30424cbc6c31e8c4b9dde9ed10a65b3317b74294 | 454 | py | Python | imperative/python/megengine/data/transform/__init__.py | jonrzhang/MegEngine | 94b72022156a068d3e87bceed7e1c7ae77dada16 | [
"Apache-2.0"
] | 3 | 2020-10-23T06:33:57.000Z | 2020-10-23T06:34:06.000Z | imperative/python/megengine/data/transform/__init__.py | yang-shuohao/MegEngine | 2e8742086563ea442c357b14560245c54e0aa0a3 | [
"Apache-2.0"
] | null | null | null | imperative/python/megengine/data/transform/__init__.py | yang-shuohao/MegEngine | 2e8742086563ea442c357b14560245c54e0aa0a3 | [
"Apache-2.0"
] | 1 | 2020-11-09T06:29:51.000Z | 2020-11-09T06:29:51.000Z | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2020 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... | 41.272727 | 88 | 0.757709 |
9abfa35014b36cf513858761b02270442ea9b1cf | 8,579 | py | Python | helpers/gnosis_safe.py | zhou141319/badger-system | 5ded1159aa2ac7ea0db72a8312f02ff1cfe682e4 | [
"MIT"
] | 1 | 2021-06-13T06:11:45.000Z | 2021-06-13T06:11:45.000Z | helpers/gnosis_safe.py | zhou141319/badger-system | 5ded1159aa2ac7ea0db72a8312f02ff1cfe682e4 | [
"MIT"
] | null | null | null | helpers/gnosis_safe.py | zhou141319/badger-system | 5ded1159aa2ac7ea0db72a8312f02ff1cfe682e4 | [
"MIT"
] | null | null | null | from enum import Enum
from ape_safe import ApeSafe
from helpers.token_utils import distribute_test_ether
from brownie import *
from rich.console import Console
from tabulate import tabulate
from scripts.systems.gnosis_safe_system import connect_gnosis_safe
from helpers.multicall import func
console = Console()
"""
... | 27.674194 | 123 | 0.60415 |
a5e6f905df1a4d10b24cc3b58c41d6ce5ed39db7 | 31,380 | py | Python | cats/tests/08.py | YingluDeng/CS61A | 667afc5da9f63ae953beff08b71a6744211a7477 | [
"MIT"
] | null | null | null | cats/tests/08.py | YingluDeng/CS61A | 667afc5da9f63ae953beff08b71a6744211a7477 | [
"MIT"
] | null | null | null | cats/tests/08.py | YingluDeng/CS61A | 667afc5da9f63ae953beff08b71a6744211a7477 | [
"MIT"
] | null | null | null | test = {
'name': 'Problem 8',
'points': 2,
'suites': [
{
'cases': [
{
'code': r"""
>>> typed = ['I', 'have', 'begun']
>>> prompt = ['I', 'have', 'begun', 'to', 'type']
>>> print_progress({'id': 1, 'progress': 0.6})
ID: 1 Progress: 0.6
... | 33.489861 | 272 | 0.441842 |
a89ed645380694b274c9d049b019aa9904a40a8e | 8,764 | py | Python | src/python/tests/core/local/butler/reproduce_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/local/butler/reproduce_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | 20 | 2020-07-28T19:01:56.000Z | 2021-03-23T01:04:42.000Z | src/python/tests/core/local/butler/reproduce_test.py | nopsledder/clusterfuzz | 529963438d956e46ddddfb62debc6ed808be0083 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.978903 | 78 | 0.67743 |
df1c0c96c492e3c3bb0f1462e1146d2b18ea8f9c | 952 | py | Python | ps1_python/scripts/ps1_4.py | andrew-kulikov/intro-to-cv-ud810 | 031c0d36a2f6a5b33264e61bf648ec0bd80c8b49 | [
"MIT"
] | 1 | 2019-01-14T16:59:48.000Z | 2019-01-14T16:59:48.000Z | ps1_python/scripts/ps1_4.py | andrew-kulikov/intro-to-cv-ud810 | 031c0d36a2f6a5b33264e61bf648ec0bd80c8b49 | [
"MIT"
] | null | null | null | ps1_python/scripts/ps1_4.py | andrew-kulikov/intro-to-cv-ud810 | 031c0d36a2f6a5b33264e61bf648ec0bd80c8b49 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from hough_lines_acc import *
from hough_peaks import *
from hough_lines_draw import *
def run():
img = cv2.imread('../input/ps1-input1.png', cv2.IMREAD_GRAYSCALE)
img_smoothed = cv2.GaussianBlur(img, (31, 31), 3)
cv2.imwrite('../output/ps1-4-a-1.png', img_smoothed)
... | 31.733333 | 73 | 0.664916 |
49137de2ef420f657f9a500a182d4a0574fff403 | 4,691 | py | Python | src/ethereum/tangerine_whistle/vm/instructions/memory.py | newtonproject/newchain-specs | bd79de5eb7ee0a960ea3cadd2375e66361a56177 | [
"CC0-1.0"
] | 102 | 2021-08-19T02:44:03.000Z | 2022-03-27T23:46:00.000Z | src/ethereum/tangerine_whistle/vm/instructions/memory.py | newtonproject/newchain-specs | bd79de5eb7ee0a960ea3cadd2375e66361a56177 | [
"CC0-1.0"
] | 264 | 2021-08-18T14:15:26.000Z | 2022-03-31T12:24:23.000Z | src/ethereum/tangerine_whistle/vm/instructions/memory.py | LaudateCorpus1/execution-specs | 1f2e9f925ffd7352da74408dfaa823c67cf469ff | [
"CC0-1.0"
] | 30 | 2021-08-20T05:38:34.000Z | 2022-01-19T06:49:29.000Z | """
Ethereum Virtual Machine (EVM) Memory Instructions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Implementations of the EVM Memory instructions.
"""
from ethereum.base_types import U8_MAX_VALUE, U256, Uint
from ethere... | 27.594118 | 72 | 0.659774 |
3ac189250e2a4c8e82b1721af745c35d930cb441 | 561 | py | Python | study/curso-em-video/exercises/100.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | study/curso-em-video/exercises/100.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | study/curso-em-video/exercises/100.py | jhonatanmaia/python | d53c64e6bab598c7e85813fd3f107c6f23c1fc46 | [
"MIT"
] | null | null | null | import time
import random
def sorteio(lista):
for i in range(0,5):
lista.append(random.randint(1,10))
# Poderia ter posto o print dos numeros aqui dentro
print('Sortenando 5 valores da lsita: ',end='')
for i in lista:
time.sleep(0.25)
print(f'{i} ',end='')
print('PRONTO!... | 21.576923 | 63 | 0.579323 |
3c3228fafc3c1ebe63d5a3e46be9f6581c711b17 | 59,295 | py | Python | tests/forms_tests/tests/test_formsets.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/forms_tests/tests/test_formsets.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/forms_tests/tests/test_formsets.py | ponsonio-aurea/django | dc165ec8e5698ffc6dee6b510f1f92c9fd7467fe | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import datetime
from collections import Counter
from unittest import mock
from django.forms import (
BaseForm, CharField, DateField, FileField, Form, IntegerField,
SplitDateTimeField, ValidationError, formsets,
)
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.utils import Erro... | 42.505376 | 119 | 0.603727 |
f56baf5e72deef095386b963f90a085f0bad93f3 | 5,919 | py | Python | bigdense.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 5 | 2019-01-04T06:50:18.000Z | 2019-02-13T12:02:24.000Z | bigdense.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | null | null | null | bigdense.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 1 | 2019-08-24T20:56:53.000Z | 2019-08-24T20:56:53.000Z | import argparse, os
import pdb
import torch
import random
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from srdense.thinnet import bigdensenet, L1_Charbonnier_loss
from srdense.dataset import DatasetFro... | 38.940789 | 150 | 0.645886 |
88df26756f4d2511b8925b4ee5ec1ed8cec09d0b | 1,234 | py | Python | utils.py | wangke0809/learn-statistical-learning-method | 10772659ff52ef64e7ff36dd3b701615e58de335 | [
"MIT"
] | null | null | null | utils.py | wangke0809/learn-statistical-learning-method | 10772659ff52ef64e7ff36dd3b701615e58de335 | [
"MIT"
] | null | null | null | utils.py | wangke0809/learn-statistical-learning-method | 10772659ff52ef64e7ff36dd3b701615e58de335 | [
"MIT"
] | null | null | null | import os
import numpy as np
def load_mnist(path='mnist'):
data_dir = os.path.join("./data", path)
fd = open(os.path.join(data_dir,'train-images-idx3-ubyte'))
loaded = np.fromfile(file=fd,dtype=np.uint8)
trX = loaded[16:].reshape((60000,28,28,1)).astype(np.float)
fd = open(os.path.join(data_dir,'... | 29.380952 | 63 | 0.638574 |
6beacd53ae260d61c2ff63d62f32ed48d92b1eb8 | 1,247 | py | Python | subtasks/with_netmiko/netmiko_copy.py | no-such-anthony/net-run | cb1189e8b3e5f27d0c0d19ed509d138b15a8025a | [
"MIT"
] | 1 | 2021-06-28T04:52:53.000Z | 2021-06-28T04:52:53.000Z | subtasks/with_netmiko/netmiko_copy.py | no-such-anthony/net-run | cb1189e8b3e5f27d0c0d19ed509d138b15a8025a | [
"MIT"
] | null | null | null | subtasks/with_netmiko/netmiko_copy.py | no-such-anthony/net-run | cb1189e8b3e5f27d0c0d19ed509d138b15a8025a | [
"MIT"
] | null | null | null | def netmiko_copy(device, source='', destination='', ckwargs={}, **kwargs):
# Example of a copy subtask
if source and destination:
command = f'copy {source} {destination}'
# For Cisco as long "file prompt" is either alert or noisy this should work
# if "file prompt" is quiet tr... | 35.628571 | 89 | 0.578188 |
d4f31fbb323b651839e4d9e14dd1472d53309198 | 1,148 | py | Python | manim/utils/family.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 2 | 2022-03-31T08:31:00.000Z | 2022-03-31T08:31:43.000Z | manim/utils/family.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 21 | 2022-03-02T15:25:49.000Z | 2022-03-07T11:15:45.000Z | manim/utils/family.py | DD2480-Group-10/manim | e147a9fc6c117332221e42437481f3efba76499a | [
"MIT"
] | null | null | null | from __future__ import annotations
import itertools as it
from ..mobject.mobject import Mobject
from ..utils.iterables import remove_list_redundancies
def extract_mobject_family_members(
mobjects,
use_z_index=False,
only_those_with_points=False,
):
"""Returns a list of the types of mobjects and thei... | 28 | 80 | 0.699477 |
dce3f64677921e19da279beed414a5c9de19f78b | 379 | py | Python | jp.atcoder/abc104/abc104_b/9257371.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc104/abc104_b/9257371.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc104/abc104_b/9257371.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
s = sys.stdin.readline().rstrip()
def main():
if s[0] == "A":
if "C" in s[2:-1]:
cnt = 0
for letter in s:
if 65 <= ord(letter) <= 90:
cnt += 1
if cnt == 2:
return "AC"
return "WA"
if ... | 18.047619 | 44 | 0.37467 |
b46f8116124c56f57377e3a36f55144e1f7f586b | 67,003 | py | Python | tests/test_operator.py | vmickus/devito | 1e8d6af2cb8615e47ae20b68d5f2e30d530d03ff | [
"MIT"
] | 2 | 2019-04-05T20:52:23.000Z | 2019-11-03T21:36:53.000Z | tests/test_operator.py | vmickus/devito | 1e8d6af2cb8615e47ae20b68d5f2e30d530d03ff | [
"MIT"
] | 9 | 2019-06-11T20:54:19.000Z | 2020-04-06T17:56:10.000Z | tests/test_operator.py | vmickus/devito | 1e8d6af2cb8615e47ae20b68d5f2e30d530d03ff | [
"MIT"
] | null | null | null | import numpy as np
import pytest
from itertools import permutations
from conftest import skipif
from devito import (Grid, Eq, Operator, Constant, Function, TimeFunction,
SparseFunction, SparseTimeFunction, Dimension, error, SpaceDimension,
NODE, CELL, dimensions, configuration, ... | 39.930274 | 90 | 0.538334 |
58bdbe7394cf772723fc99bf8f4d1517d078592c | 519 | py | Python | blender/arm/logicnode/sound_pause_speaker.py | Sanva/armory | 61b2d008e3b73bd978966b3209b646d162923e18 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/sound_pause_speaker.py | Sanva/armory | 61b2d008e3b73bd978966b3209b646d162923e18 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/sound_pause_speaker.py | Sanva/armory | 61b2d008e3b73bd978966b3209b646d162923e18 | [
"Zlib"
] | null | null | null | import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class PauseSpeakerNode(Node, ArmLogicTreeNode):
'''Pause speaker node'''
bl_idname = 'LNPauseSoundNode'
bl_label = 'Pause Speaker'
bl_icon = 'NONE'
def init(self, context):
self.... | 28.833333 | 57 | 0.707129 |
fa1d0e014dee923f0f3539a31375b95db9225f1f | 94,179 | py | Python | Lib/test/test_collections.py | vajdaz/cpython | f8a2fab212c4e9ea92a5b667560449904c4cf7af | [
"0BSD"
] | null | null | null | Lib/test/test_collections.py | vajdaz/cpython | f8a2fab212c4e9ea92a5b667560449904c4cf7af | [
"0BSD"
] | 8 | 2022-01-07T11:31:11.000Z | 2022-03-04T00:07:16.000Z | Lib/test/test_collections.py | sebawild/cpython | 874ba1a9c948af33de2ad229df42e03dc516f0a8 | [
"0BSD"
] | null | null | null | """Unit tests for collections.py."""
import collections
import copy
import doctest
import inspect
import operator
import pickle
from random import choice, randrange
from itertools import product, chain, combinations
import string
import sys
from test import support
import types
import unittest
from collections import... | 39.637626 | 107 | 0.549698 |
3955153669b95b60c574b78787e2d7a441535187 | 2,119 | py | Python | tekore/_model/__init__.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 135 | 2020-01-14T17:47:26.000Z | 2022-03-25T18:30:04.000Z | tekore/_model/__init__.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 135 | 2020-01-13T22:56:35.000Z | 2022-03-11T19:41:36.000Z | tekore/_model/__init__.py | evanofslack/tekore | 91e4a1471562af01a9a33681d2ac3406f41990da | [
"MIT"
] | 21 | 2020-01-16T16:01:23.000Z | 2022-02-17T12:46:32.000Z | from .album import (
AlbumType,
Album,
AlbumGroup,
SimpleAlbum,
SimpleAlbumPaging,
)
from .album.full import FullAlbum, SavedAlbum, SavedAlbumPaging
from .artist import (
Artist,
SimpleArtist,
FullArtist,
FullArtistCursorPaging,
FullArtistOffsetPaging,
)
from .audio_analysis impo... | 20.375 | 65 | 0.723454 |
ddf00d3e0644f77b6c4c4f2487f2a3b90fa82af1 | 3,910 | py | Python | dsac-v2.py | marc-rigter/dsac | 6023ebacd7c8be1764f41567c4cbe6f79fab1c26 | [
"MIT"
] | null | null | null | dsac-v2.py | marc-rigter/dsac | 6023ebacd7c8be1764f41567c4cbe6f79fab1c26 | [
"MIT"
] | null | null | null | dsac-v2.py | marc-rigter/dsac | 6023ebacd7c8be1764f41567c4cbe6f79fab1c26 | [
"MIT"
] | null | null | null | import argparse
import torch
import yaml
import wandb
import rlkit.torch.pytorch_util as ptu
from rlkit.data_management.torch_replay_buffer import TorchReplayBuffer
from rlkit.envs import make_env
from rlkit.envs.vecenv import SubprocVectorEnv, VectorEnv
from rlkit.launchers.launcher_util import set_seed, setup_logger
... | 32.857143 | 107 | 0.681841 |
1723454ef36548f370e9b826f7bb1c5772ddbef0 | 903 | py | Python | keypoints/gym_wrappers.py | tripathiarpan20/keypoints | 8ef49d29d8d29c79598ad8ece64d1618eceda260 | [
"MIT"
] | 42 | 2019-11-05T08:26:33.000Z | 2022-01-29T16:05:30.000Z | keypoints/gym_wrappers.py | tripathiarpan20/keypoints | 8ef49d29d8d29c79598ad8ece64d1618eceda260 | [
"MIT"
] | 6 | 2019-12-02T23:39:38.000Z | 2021-02-07T13:17:29.000Z | keypoints/gym_wrappers.py | tripathiarpan20/keypoints | 8ef49d29d8d29c79598ad8ece64d1618eceda260 | [
"MIT"
] | 9 | 2019-12-01T09:21:42.000Z | 2022-01-28T00:36:43.000Z | import gym
class RewardCountLimit(gym.Wrapper):
def __init__(self, env, max_reward_count=None):
"""
Returns done once a number of nonzero rewards have been received
:param env: the env to wrap
:param max_reward_count: the
"""
super().__init__(env)
self.max_r... | 34.730769 | 95 | 0.631229 |
77a04f0d724f2cf5aca517cb408b834ccf1171cc | 29,061 | py | Python | tweakwcs/linearfit.py | perrygreenfield/tweakwcs | a89b390139f0931a1d02d93209c0bb53e6f4f1e3 | [
"BSD-3-Clause"
] | null | null | null | tweakwcs/linearfit.py | perrygreenfield/tweakwcs | a89b390139f0931a1d02d93209c0bb53e6f4f1e3 | [
"BSD-3-Clause"
] | null | null | null | tweakwcs/linearfit.py | perrygreenfield/tweakwcs | a89b390139f0931a1d02d93209c0bb53e6f4f1e3 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
A module that provides algorithms for performing linear fit between
sets of 2D points.
:Authors: Mihai Cara, Warren Hack
:License: :doc:`../LICENSE`
"""
import logging
import numbers
import numpy as np
from .linalg import inv
from . import __versio... | 34.803593 | 90 | 0.577509 |
7040279d076655a53372f2333f5abf90d6a50757 | 1,576 | py | Python | examples/app_commands/info.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/app_commands/info.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | null | null | null | examples/app_commands/info.py | Mihitoko/pycord | 137c1474eed5fb4273e542bd22ad76764a8712fc | [
"MIT"
] | 1 | 2022-02-20T09:10:40.000Z | 2022-02-20T09:10:40.000Z | # This example requires the 'members' privileged intent to use the Member converter.
import discord
intents = discord.Intents.default()
intents.members = True
bot = discord.Bot(
debug_guilds=[...],
description="An example to showcase how to extract info about users.",
intents=intents,
)
@bot.slash_comm... | 33.531915 | 91 | 0.64467 |
3facd598365eb02c85cb7898e7da14ef6927b9de | 2,052 | py | Python | fhirclient/models/communication_tests.py | NematiLab/Streaming-Sepsis-Prediction-System-for-Intensive-Care-Units | fb5ad260fb8d264d85aea9e6c895d1700eea4d11 | [
"Apache-2.0"
] | 2 | 2019-05-16T16:41:22.000Z | 2021-04-22T22:06:49.000Z | fhirclient/models/communication_tests.py | NematiLab/Streaming-Sepsis-Prediction-System-for-Intensive-Care-Units | fb5ad260fb8d264d85aea9e6c895d1700eea4d11 | [
"Apache-2.0"
] | null | null | null | fhirclient/models/communication_tests.py | NematiLab/Streaming-Sepsis-Prediction-System-for-Intensive-Care-Units | fb5ad260fb8d264d85aea9e6c895d1700eea4d11 | [
"Apache-2.0"
] | 3 | 2019-03-26T01:39:18.000Z | 2020-02-02T19:06:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 on 2016-06-23.
# 2016, SMART Health IT.
import os
import io
import unittest
import json
from . import communication
from .fhirdate import FHIRDate
class CommunicationTests(unittest.TestCase):
def instantiate_from(self, filename):... | 41.877551 | 145 | 0.67885 |
39f98af4517c4fd0ae7456638189c8b568804c38 | 8,817 | py | Python | tests/thumbnails_tests.py | BrayanArrieta/incubator-superset | f6e13b64b0cd32ddf3480f883491b54ab82c2cfc | [
"Apache-2.0"
] | 6 | 2020-11-19T23:28:09.000Z | 2021-12-15T19:52:46.000Z | tests/thumbnails_tests.py | BrayanArrieta/incubator-superset | f6e13b64b0cd32ddf3480f883491b54ab82c2cfc | [
"Apache-2.0"
] | 1 | 2020-06-30T12:43:09.000Z | 2020-06-30T12:43:09.000Z | tests/thumbnails_tests.py | BrayanArrieta/incubator-superset | f6e13b64b0cd32ddf3480f883491b54ab82c2cfc | [
"Apache-2.0"
] | 5 | 2021-01-08T00:42:28.000Z | 2022-01-19T10:44:00.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... | 39.895928 | 86 | 0.663264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.