hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 125 | 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 4 247 | max_forks_repo_name stringlengths 4 125 | 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 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
163743d78c16425801fc8839cd339747e3afc7a4 | 15,109 | py | Python | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | dynaconf/cli.py | aruncse01/dynaconf | 61c361821cf89b728e3bf3ae2c0b773e3387e120 | [
"MIT"
] | null | null | null | import io
import os
import sys
import toml
import click
import pprint
import importlib
import webbrowser
from pathlib import Path
from dynaconf import default_settings
from dynaconf import constants
from dynaconf.validator import Validator
from dynaconf.utils.parse_conf import parse_conf_data
from dotenv import cli as ... | 34.813364 | 101 | 0.586538 | import io
import os
import sys
import toml
import click
import pprint
import importlib
import webbrowser
from pathlib import Path
from dynaconf import default_settings
from dynaconf import constants
from dynaconf.validator import Validator
from dynaconf.utils.parse_conf import parse_conf_data
from dotenv import cli as ... | 458 | 0 | 73 |
e03ddb71ae236fed5ccd6de147c4d4b99638e687 | 5,850 | py | Python | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | cbandits/core/contextual_dataset.py | AlliedToasters/dev_bandits | 7e3655bd5a91854951a52d0f037ee06aefb2922c | [
"MIT"
] | null | null | null | """Define a data buffer for contextual bandit algorithms."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class ContextualDataset(object):
"""The buffer is able to append new data, and sample random minibatches."""
def __ini... | 36.335404 | 95 | 0.607692 | """Define a data buffer for contextual bandit algorithms."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
class ContextualDataset(object):
"""The buffer is able to append new data, and sample random minibatches."""
def __ini... | 501 | 0 | 235 |
4210e8540a38faec5e55ddf81f43aaa043dc7da9 | 921 | py | Python | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | null | null | null | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | 65 | 2021-06-01T15:52:12.000Z | 2021-10-01T15:44:50.000Z | web-app/migrations/versions/20210626_114817_822caa87a652_add_quiz_game_setups_table.py | philipp-mos/iubh-quiz-app | 3ea4a6b673bba6df0ece273e17e65c8fe5edc341 | [
"MIT"
] | 1 | 2022-03-29T14:13:45.000Z | 2022-03-29T14:13:45.000Z | """Add quiz_game_setups Table
Revision ID: 822caa87a652
Revises: 3b809ceaf543
Create Date: 2021-06-26 11:48:17.948434
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '822caa87a652'
down_revision = '3b809ceaf543'
branch_labels = None
depends_on = None
| 26.314286 | 74 | 0.697068 | """Add quiz_game_setups Table
Revision ID: 822caa87a652
Revises: 3b809ceaf543
Create Date: 2021-06-26 11:48:17.948434
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '822caa87a652'
down_revision = '3b809ceaf543'
branch_labels = None
depends_on = None
def upgr... | 563 | 0 | 46 |
12e7db795759076fbdbf6d2c0d3b75f7bcb8889a | 2,368 | py | Python | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 15 | 2019-07-05T20:26:18.000Z | 2020-09-18T12:44:16.000Z | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 7 | 2019-07-07T19:55:07.000Z | 2019-08-20T22:07:31.000Z | clamor/rest/endpoints/emoji.py | TomSputz/Clamor | 13222b90532938e6ebdbe8aea0430512e7d22817 | [
"MIT"
] | 6 | 2019-07-07T20:39:29.000Z | 2020-11-06T10:12:20.000Z | # -*- coding: utf-8 -*-
from ..routes import Routes
from .base import *
__all__ = (
'EmojiWrapper',
)
class EmojiWrapper(EndpointsWrapper):
"""A higher-level wrapper around Emoji endpoints.
.. seealso:: Emoji endpoints https://discordapp.com/developers/docs/resources/emoji
"""
| 36.430769 | 87 | 0.472551 | # -*- coding: utf-8 -*-
from ..routes import Routes
from .base import *
__all__ = (
'EmojiWrapper',
)
class EmojiWrapper(EndpointsWrapper):
"""A higher-level wrapper around Emoji endpoints.
.. seealso:: Emoji endpoints https://discordapp.com/developers/docs/resources/emoji
"""
def __init__(sel... | 1,907 | 0 | 162 |
879bf6cedca3a228a0ed5d68b969c46f3730e446 | 7,697 | py | Python | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | api/base/filters.py | bdyetton/prettychart | e8b33a7dfdc8c33d15969586be7f68172795f76d | [
"Apache-2.0"
] | null | null | null | import re
import functools
from modularodm import Q
from rest_framework.filters import OrderingFilter
from rest_framework import serializers as ser
class ODMOrderingFilter(OrderingFilter):
"""Adaptation of rest_framework.filters.OrderingFilter to work with modular-odm."""
# override
query_pattern = re.comp... | 39.071066 | 149 | 0.678706 | import re
import functools
from modularodm import Q
from rest_framework.filters import OrderingFilter
from rest_framework import serializers as ser
class ODMOrderingFilter(OrderingFilter):
"""Adaptation of rest_framework.filters.OrderingFilter to work with modular-odm."""
# override
def filter_queryset(... | 2,736 | 0 | 366 |
6a9ee4906295ec1af783379bcd1b815404b3ad4d | 1,597 | py | Python | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | 8 | 2019-12-15T22:32:30.000Z | 2021-06-14T07:38:51.000Z | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | null | null | null | engine/gui/uielement.py | UnidayStudio/Easy-2D-Game-Engine | 1a8501cba538d7542b0e24bf64eead388085480f | [
"MIT"
] | 2 | 2020-09-10T17:34:23.000Z | 2021-03-11T09:26:26.000Z | import pygame
import pygame_gui
import engine.app
from engine.math import Vector
import engine.math
############################
| 22.814286 | 67 | 0.690044 | import pygame
import pygame_gui
import engine.app
from engine.math import Vector
import engine.math
class UIElement():
def __init__(self):
self._element = None
self._lastResolution = [-1, -1]
self._position = Vector(0.4, 0.45)
self._scale = Vector(0.2, 0.1)
self._killed = False
def isKilled(self):
r... | 1,229 | -3 | 238 |
8c117027b71e3ca13907608742ca89676f486313 | 504 | py | Python | test/test_scripta.py | rec/ascript | 99975ca4e94c5791ee09864ce7cb23e2d43f7cd6 | [
"MIT"
] | 1 | 2021-08-04T18:06:37.000Z | 2021-08-04T18:06:37.000Z | test/test_scripta.py | rec/scripta | 99975ca4e94c5791ee09864ce7cb23e2d43f7cd6 | [
"MIT"
] | 6 | 2020-06-25T16:16:36.000Z | 2020-06-25T23:54:57.000Z | test/test_scripta.py | rec/ascript | 99975ca4e94c5791ee09864ce7cb23e2d43f7cd6 | [
"MIT"
] | null | null | null | from scripta import cast_recorder
from scripta import scripta
from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch
import asyncio
import tdir
| 26.526316 | 68 | 0.765873 | from scripta import cast_recorder
from scripta import scripta
from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch
import asyncio
import tdir
class CastRecorder(cast_recorder.CastRecorder):
async def record_to(self, cast_file, cast):
await asyncio.sleep(0)
class TestScripta(Isola... | 121 | 143 | 72 |
016c3b8beea50db52081dfe286ec8ca22e8adc82 | 5,347 | py | Python | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | src/libs/core/results/console.py | VirtualVFix/AndroidTestFramework | 1feb769c6aca39a78e6daefd6face0a1e4d62cd4 | [
"MIT"
] | null | null | null | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "12/18/2017 4:43 PM"
from config import CONFIG
from libs.core.tools.utility import Utility
... | 55.123711 | 124 | 0.438751 | # All rights reserved by forest fairy.
# You cannot modify or share anything without sacrifice.
# If you don't agree, keep calm and don't look at code bellow!
__author__ = "VirtualV <https://github.com/virtualvfix>"
__date__ = "12/18/2017 4:43 PM"
from config import CONFIG
from libs.core.tools.utility import Utility
... | 0 | 0 | 0 |
78fee5d7b83ceaeb50369b8d08b4b4f569f3d5fc | 115 | py | Python | web_scraping/ec2files/ec2file32.py | nikibhatt/Groa | fc2d4ae87cb825e6d54a0831c72be16541eebe61 | [
"MIT"
] | 1 | 2020-04-08T20:11:48.000Z | 2020-04-08T20:11:48.000Z | web_scraping/ec2files/ec2file32.py | cmgospod/Groa | 31b3624bfe61e772b55f8175b4e95d63c9e67966 | [
"MIT"
] | null | null | null | web_scraping/ec2files/ec2file32.py | cmgospod/Groa | 31b3624bfe61e772b55f8175b4e95d63c9e67966 | [
"MIT"
] | 1 | 2020-09-12T07:07:41.000Z | 2020-09-12T07:07:41.000Z | from scraper import *
s = Scraper(start=57024, end=58805, max_iter=30, scraper_instance=32)
s.scrape_letterboxd() | 38.333333 | 70 | 0.773913 | from scraper import *
s = Scraper(start=57024, end=58805, max_iter=30, scraper_instance=32)
s.scrape_letterboxd() | 0 | 0 | 0 |
427c94638f2f3f91cf67eb6119a5530d3b4ed8b8 | 8,175 | py | Python | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | 1 | 2020-09-18T20:48:10.000Z | 2020-09-18T20:48:10.000Z | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | null | null | null | catalog.py | healingbrew/HeroesEmojiSlicer | 3c2cab9db8a0afea6b3bf3eb60c2a0e45d840355 | [
"MIT"
] | null | null | null | # encoding: utf-8
from Storm.Localized import Strings as LocalizedStrings
from Storm.GameData import Catalog
from Storm.DepotIndex import DepotIndex
from Storm.DepotCataFile import DepotCataFile, TYPE_NONE, TYPE_PRODUCTS, TYPE_LICENSES
from sys import argv
from os.path import exists
if __name__ != '__main__':
... | 41.923077 | 159 | 0.596697 | # encoding: utf-8
from Storm.Localized import Strings as LocalizedStrings
from Storm.GameData import Catalog
from Storm.DepotIndex import DepotIndex
from Storm.DepotCataFile import DepotCataFile, TYPE_NONE, TYPE_PRODUCTS, TYPE_LICENSES
from sys import argv
from os.path import exists
def print_utf8(text):
... | 4,997 | 0 | 75 |
fc9232403d12cc2eba69cc683ada204241083f20 | 2,640 | py | Python | src/graph_notebook/options/options.py | joywa/graph-notebook | 2c55b4fb5b6fb3c3205d0786a45a9101a44288a4 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | 1 | 2021-07-10T14:20:09.000Z | 2021-07-10T14:20:09.000Z | src/graph_notebook/options/options.py | QPC-database/graph-notebook | ea162e47c2c2e5600417e6ad9ac34aa7ac462899 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | src/graph_notebook/options/options.py | QPC-database/graph-notebook | ea162e47c2c2e5600417e6ad9ac34aa7ac462899 | [
"ISC",
"Apache-2.0",
"CC0-1.0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
OPTIONS_DEFAULT_DIRECTED = {
"nodes": {
"borderWidthSelected": 0,
"borderWidth": 0,
"color": {
"background": "rgba(210, 229, 255, 1)",
"border": "transparen... | 25.882353 | 106 | 0.485606 | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
OPTIONS_DEFAULT_DIRECTED = {
"nodes": {
"borderWidthSelected": 0,
"borderWidth": 0,
"color": {
"background": "rgba(210, 229, 255, 1)",
"border": "transparen... | 0 | 0 | 0 |
8846f6302398d9ef67a8e1cf2f29121a9029efb4 | 722 | py | Python | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | 8 | 2017-03-06T01:37:06.000Z | 2020-11-05T09:58:01.000Z | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | null | null | null | module/other-test/unroll/unroll-test.py | dbunker/SABR | 556fd9d9e152c3067ea873e401d68d7656284808 | [
"MIT"
] | 2 | 2018-12-19T23:01:51.000Z | 2021-09-19T07:13:08.000Z | # shell game
import sys, os, time, random, math
relFold = '../../../'
sys.path.append(relFold+'module')
import sabr
sabrUnroll() | 17.609756 | 55 | 0.587258 | # shell game
import sys, os, time, random, math
relFold = '../../../'
sys.path.append(relFold+'module')
import sabr
def sabrUnroll():
sabrObj = sabr.SabrObj()
# sym
sabrObj.setSym(['0','1','2'])
# board
sabrObj.setBoard(['a','b','c'])
# start
sabrObj.setStart(['2','0','1'])
# end
sabrObj.setEnd(['0... | 569 | 0 | 23 |
b1a15c0179cdcdd136cb7dc16f3e4a530d7b79cb | 289 | py | Python | release/stubs.min/Autodesk/Revit/DB/__init___parts/ExternalResourceType.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/ExternalResourceType.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/Autodesk/Revit/DB/__init___parts/ExternalResourceType.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class ExternalResourceType(GuidEnum):
"""
A type class used to distinguish between different kinds of external resource.
ExternalResourceType(guid: Guid)
"""
@staticmethod
def __new__(self, guid):
""" __new__(cls: type,guid: Guid) """
pass
| 20.642857 | 80 | 0.633218 | class ExternalResourceType(GuidEnum):
"""
A type class used to distinguish between different kinds of external resource.
ExternalResourceType(guid: Guid)
"""
@staticmethod
def __new__(self, guid):
""" __new__(cls: type,guid: Guid) """
pass
| 0 | 0 | 0 |
b9932aaaeb9920723bc0da7fce971d77b6853de5 | 2,485 | py | Python | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | 1 | 2022-03-31T20:47:02.000Z | 2022-03-31T20:47:02.000Z | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | null | null | null | assembly_ai/app.py | mattheweverette/Lectern | cc06a4df7af7fad9c320eb4803746da3669f1275 | [
"MIT"
] | null | null | null | import streamlit as st
import glob
import json
from podcasts import pipeline
from threading import Thread
st.title("Podcast Summaries")
json_files = glob.glob('*.json')
episode_id = st.sidebar.text_input("Episode ID")
button = st.sidebar.button("Download Episode summary")
if button and episode_id:
st.sidebar.wr... | 32.272727 | 104 | 0.591952 | import streamlit as st
import glob
import json
from podcasts import pipeline
from threading import Thread
st.title("Podcast Summaries")
json_files = glob.glob('*.json')
episode_id = st.sidebar.text_input("Episode ID")
button = st.sidebar.button("Download Episode summary")
if button and episode_id:
st.sidebar.wr... | 1,566 | 0 | 23 |
f6ef9e916c9d652c9865097a55a09201ba1bdecc | 3,364 | py | Python | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 146 | 2015-01-04T15:16:44.000Z | 2022-01-27T11:29:31.000Z | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 143 | 2015-01-07T00:20:42.000Z | 2021-11-04T07:48:26.000Z | rootpy/utils/ext_glob.py | masonproffitt/rootpy | 3926935e1f2100d8ba68070c2ab44055d4800f73 | [
"BSD-3-Clause"
] | 56 | 2015-01-30T11:11:07.000Z | 2022-03-28T09:42:06.000Z | """
Reproduce the standard glob package behaviour but use TSystem to be able to
query remote file systems such as xrootd
"""
from __future__ import print_function
from rootpy.ROOT import gSystem
import glob as gl
import os.path
import fnmatch
__all__ = ["glob", "iglob"]
if __name__ == "__main__":
test_paths... | 31.439252 | 75 | 0.615933 | """
Reproduce the standard glob package behaviour but use TSystem to be able to
query remote file systems such as xrootd
"""
from __future__ import print_function
from rootpy.ROOT import gSystem
import glob as gl
import os.path
import fnmatch
__all__ = ["glob", "iglob"]
def __directory_iter(directory):
while Tr... | 1,472 | 0 | 92 |
f700e672cd17275a041dea32beccb6a84ec37569 | 392 | py | Python | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null | setup.py | Damaen/Travis-Hello-world | 6c88895142e708638000c9bd9550c3bc61045689 | [
"MIT"
] | null | null | null |
#!/usr/bin/env python
from distutils.core import setup
from glob import glob
from setuptools import find_packages
setup(name='Fibonacci',
version='1.0',
description='Python Distribution Utilities',
author='Kevin Chen',
packages=find_packages('src'),
package_dir={'': 'src'},
py_mo... | 24.5 | 76 | 0.665816 |
#!/usr/bin/env python
from distutils.core import setup
from glob import glob
from setuptools import find_packages
setup(name='Fibonacci',
version='1.0',
description='Python Distribution Utilities',
author='Kevin Chen',
packages=find_packages('src'),
package_dir={'': 'src'},
py_mo... | 0 | 0 | 0 |
140c6353a82e92848c975322c3dc412086d94517 | 125 | py | Python | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | null | null | null | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | 3 | 2020-06-14T22:41:10.000Z | 2020-06-16T17:15:29.000Z | tests/__init__.py | Foxbud/tagup | e55f13658006563851943ee68cd2955b79b19c3d | [
"MIT"
] | null | null | null | """
This file is part of the tagup Python module which is released under MIT.
See file LICENSE for full license details.
"""
| 25 | 73 | 0.752 | """
This file is part of the tagup Python module which is released under MIT.
See file LICENSE for full license details.
"""
| 0 | 0 | 0 |
8555ab80f0d583260980e8115da2a96b1679c256 | 5,152 | py | Python | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | 1 | 2021-05-07T08:42:40.000Z | 2021-05-07T08:42:40.000Z | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | null | null | null | models_dev/point_transformer.py | A-suozhang/SpatioTemporalSegmentation-ScanNet | 479de1793afe6ec20bed6c0f68498b0c49e7315c | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.pct_utils import TDLayer, TULayer, PTBlock, TRBlock
| 39.937984 | 135 | 0.638199 | import torch
import torch.nn as nn
import torch.nn.functional as F
from models.pct_utils import TDLayer, TULayer, PTBlock, TRBlock
class PointTransformer(nn.Module):
def __init__(self,config,num_class,N,normal_channel=3):
super(PointTransformer, self).__init__()
# The normal channel for Modelnet is... | 4,325 | 594 | 99 |
a9cbb09777c6a011d3778870d939d1f2d673530d | 5,138 | py | Python | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | backend/src/apiserver/visualization/server.py | nostro-im/pipelines | 39f5b6b74040abbf4b764cbd5b422d7548723d9e | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | # Copyright 2019 The Kubeflow 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 in... | 34.253333 | 91 | 0.651226 | # Copyright 2019 The Kubeflow 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 in... | 0 | 0 | 0 |
33a5ac76b77f1aa14a86896845f1a9bc7a935744 | 5,678 | py | Python | accenv/lib/python3.4/site-packages/IPython/nbformat/v3/tests/test_nbbase.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/lib/python3.4/site-packages/IPython/nbformat/v3/tests/test_nbbase.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | accenv/lib/python3.4/site-packages/IPython/nbformat/v3/tests/test_nbbase.py | adamshamsudeen/clubdin-dj | eb48c67dab3a4ae7c4032544eb4d64e0b1d7e15a | [
"MIT"
] | null | null | null | from unittest import TestCase
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_worksheet, new_notebook, new_output,
new_author, new_metadata, new_heading_cell, nbformat
)
| 36.397436 | 80 | 0.646883 | from unittest import TestCase
from ..nbbase import (
NotebookNode,
new_code_cell, new_text_cell, new_worksheet, new_notebook, new_output,
new_author, new_metadata, new_heading_cell, nbformat
)
class TestCell(TestCase):
def test_empty_code_cell(self):
cc = new_code_cell()
self.assertEq... | 4,727 | 36 | 708 |
5daf88dd6a1a490f60f07f2c9811da15535f9510 | 1,404 | py | Python | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | 1 | 2020-02-02T13:53:21.000Z | 2020-02-02T13:53:21.000Z | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | null | null | null | apps/trade/src/market/QuoineConstants.py | kikei/btc-bot-ai | cb118fa1809ebef472a2025be697c9050e948009 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 新規注文後、一定時間経ってもオーダーが残っている場合に
# 処理を続行するか否か
ORDER_IGNORE_TIMEOUT = True
# 注文完了待ち確認間隔
ORDER_EXECUTED_RETRY_INTERVAL = 2
# 注文完了待ち確認回数
ORDER_EXECUTED_RETRY = 40
# クローズ済みトレード取得時の許容時間誤差 [s]
TIME_ERROR_ALLOW = 3
# API呼び出しリトライ数
RETRY_API_CALL = 10
API_URI = 'https://api.liquid.com'
API_USER_AGENT ... | 24.206897 | 148 | 0.775641 | # -*- coding: utf-8 -*-
# 新規注文後、一定時間経ってもオーダーが残っている場合に
# 処理を続行するか否か
ORDER_IGNORE_TIMEOUT = True
# 注文完了待ち確認間隔
ORDER_EXECUTED_RETRY_INTERVAL = 2
# 注文完了待ち確認回数
ORDER_EXECUTED_RETRY = 40
# クローズ済みトレード取得時の許容時間誤差 [s]
TIME_ERROR_ALLOW = 3
# API呼び出しリトライ数
RETRY_API_CALL = 10
API_URI = 'https://api.liquid.com'
API_USER_AGENT ... | 0 | 0 | 0 |
035639992fbaa91dbf14c63e7f1d5e1d1b08b6d2 | 7,226 | py | Python | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | 1 | 2019-11-19T12:31:49.000Z | 2019-11-19T12:31:49.000Z | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | null | null | null | Code/scripts/Worlds/RvizElements.py | JoseAndresMR/jamrepo | b4205d55995a138f5d5e8502015b3620ab2afa10 | [
"MIT"
] | 2 | 2019-11-19T12:31:45.000Z | 2020-09-27T07:45:23.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------------------------------------------------
# ROS-MAGNA
# -----------------------------------------------------------------------------------------... | 35.772277 | 165 | 0.640742 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------------------------------------------------
# ROS-MAGNA
# -----------------------------------------------------------------------------------------... | 4,421 | 22 | 390 |
d609e4179a2fa5c1d3b6e223cb14512352e5b429 | 697 | py | Python | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/osbu-forecast-api | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 3 | 2016-03-02T17:27:54.000Z | 2016-03-15T16:49:27.000Z | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/forecast | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 62 | 2015-12-14T14:42:35.000Z | 2016-05-19T16:47:56.000Z | forecast-admin/forecast/opportunities/migrations/0007_auto_20151127_1141.py | 18F/forecast | 26a53dad8da4f3d2de522ac1e488e7135a56b557 | [
"CC0-1.0"
] | 5 | 2016-01-29T17:10:24.000Z | 2021-02-14T12:15:37.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| 27.88 | 110 | 0.629842 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('opportunities', '0006_auto_20151127_0336'),
]
operations = [
migrations.AlterField(
model_name='opportunity',
... | 0 | 567 | 23 |
4e5f3a16117fa6e6f15130ae3b5999c7cf174f54 | 1,457 | py | Python | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 25 | 2018-07-26T17:30:31.000Z | 2021-02-23T22:54:01.000Z | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 150 | 2018-11-02T18:09:12.000Z | 2020-05-15T01:01:35.000Z | foreshadow/smart/intent_resolving/core/secondary_featurizers/base_featurizer_via_lambda.py | adithyabsk/foreshadow | ca2e927c396ae0d61923b287d6e32e142f3ba96f | [
"Apache-2.0"
] | 1 | 2019-02-20T22:24:00.000Z | 2019-02-20T22:24:00.000Z | """Class defintion for BaseFeaturizeViaLambda abstract class."""
from typing import Callable
import pandas as pd
from .base_featurizer import BaseFeaturizer
class BaseFeaturizerViaLambda(BaseFeaturizer):
"""
Abstract class to create secondary featurization via a custom function.
Attributes:
_c... | 30.354167 | 80 | 0.633493 | """Class defintion for BaseFeaturizeViaLambda abstract class."""
from typing import Callable
import pandas as pd
from .base_featurizer import BaseFeaturizer
class BaseFeaturizerViaLambda(BaseFeaturizer):
"""
Abstract class to create secondary featurization via a custom function.
Attributes:
_c... | 0 | 0 | 0 |
5834ad7c7df985e3609b87d3b72c1aec6609e340 | 666 | py | Python | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | ind2.py | 12W300/Three | 1faf8e5379541d409978c64ca1c8facdef58552b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
A = tuple(map(int, input().split()))
print('максимальный элемент имеет номер ', A.index(max(A)))
zero_1 = zero_2 = -1
for i, item in enumerate(A):
if (item == 0) and (zero_1 != -1) and (zero_2 == -... | 30.272727 | 101 | 0.558559 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
if __name__ == '__main__':
A = tuple(map(int, input().split()))
print('максимальный элемент имеет номер ', A.index(max(A)))
zero_1 = zero_2 = -1
for i, item in enumerate(A):
if (item == 0) and (zero_1 != -1) and (zero_2 == -... | 0 | 0 | 0 |
a36534259b6d4d6eb89bb926cda2c1dd7feac4ad | 579 | py | Python | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | 2 | 2017-08-28T18:24:47.000Z | 2019-08-29T03:34:15.000Z | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | null | null | null | aula7/tarefa1.py | davidpvilaca/TEP | decbf61a96863d76e1b84dc097aa37b12038aa75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 08:29:23 2017
@author: davidpvilaca
"""
import matplotlib.pyplot as plt
import cv2
img1 = cv2.imread('vermelho3.jpg')
img1_hsv = cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)
i = img1_hsv[:,:, 0] < 30
img1_hsv[i, 0] += 30
i = img1_hsv[:,:, 0] > 150
i... | 21.444444 | 72 | 0.699482 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Sep 14 08:29:23 2017
@author: davidpvilaca
"""
import matplotlib.pyplot as plt
import cv2
img1 = cv2.imread('vermelho3.jpg')
img1_hsv = cv2.cvtColor(img1, cv2.COLOR_BGR2HSV)
i = img1_hsv[:,:, 0] < 30
img1_hsv[i, 0] += 30
i = img1_hsv[:,:, 0] > 150
i... | 0 | 0 | 0 |
46c72939e50816fe6d9dffd8f1c48937d6b5bd57 | 51,920 | py | Python | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | 1 | 2018-10-07T15:52:32.000Z | 2018-10-07T15:52:32.000Z | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | null | null | null | professors/generative_professor.py | tudor-berariu/training-teachers | 44d0e754a058bc45c3529a906127e09ae30fe670 | [
"MIT"
] | null | null | null | from itertools import chain
from collections import OrderedDict
import os.path
from typing import Tuple
from argparse import Namespace
from tabulate import tabulate
from termcolor import colored as clr
import numpy as np
import torch
from torch import Tensor
from torch import nn
import torch.nn.functional as F
from tor... | 42.452984 | 86 | 0.518394 | from itertools import chain
from collections import OrderedDict
import os.path
from typing import Tuple
from argparse import Namespace
from tabulate import tabulate
from termcolor import colored as clr
import numpy as np
import torch
from torch import Tensor
from torch import nn
import torch.nn.functional as F
from tor... | 50,174 | 50 | 609 |
74dcaf3b4fc5c6a6b348a1d53ba3fa3b1a0c2513 | 1,450 | py | Python | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | 4 | 2016-08-23T12:13:21.000Z | 2018-08-22T12:55:55.000Z | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | null | null | null | example-data/3d-reconstruct.py | DiamondLightSource/rpi-config | 617f5e176c0621e3ea1b567e9586e96ba0f8b5db | [
"Apache-2.0"
] | 2 | 2016-09-15T19:17:30.000Z | 2018-03-06T06:34:13.000Z | import numpy as np
import h5py
import scisoftpy as dnp
from time import sleep
from math import cos, sin
print("Starting")
data = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/data']
angles = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/Angle']
fram... | 23.387097 | 108 | 0.622759 | import numpy as np
import h5py
import scisoftpy as dnp
from time import sleep
from math import cos, sin
print("Starting")
data = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/data']
angles = h5py.File('/dls/tmp/ssg37927/31_processed_160905_141219.nxs','r')['entry/result/Angle']
fram... | 0 | 0 | 0 |
16f438ea264cd3a6cbbb277a018a017480157550 | 3,757 | py | Python | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 136 | 2021-04-18T12:03:55.000Z | 2022-03-31T14:58:46.000Z | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 3 | 2021-08-08T08:38:06.000Z | 2022-03-26T17:17:40.000Z | PaperwithCode/1.Co-Interactive-Transformer/load_data.py | techthiyanes/nlp-notebook | 0e5f4b75e635128d4056c89a6c65bea60c15e836 | [
"MIT"
] | 40 | 2021-05-18T06:55:37.000Z | 2022-03-30T00:47:12.000Z | # -*- coding: utf-8 -*-
import csv
import torch
import torch.utils.data as tud
from torch.nn.utils.rnn import pad_sequence
TRAIN_DATA_PATH = './data/data_with_slots_intent_train.csv'
DEV_DATA_PATH = './data/data_with_slots_intent_dev.csv'
SLOT_PATH = './data/slot_maping.csv'
INTENT_PATH = './data/intent_maping.csv'
BA... | 36.475728 | 120 | 0.637211 | # -*- coding: utf-8 -*-
import csv
import torch
import torch.utils.data as tud
from torch.nn.utils.rnn import pad_sequence
TRAIN_DATA_PATH = './data/data_with_slots_intent_train.csv'
DEV_DATA_PATH = './data/data_with_slots_intent_dev.csv'
SLOT_PATH = './data/slot_maping.csv'
INTENT_PATH = './data/intent_maping.csv'
BA... | 856 | 12 | 126 |
4dc63e70df28d10f5316b2903975a3cb406d4d5c | 1,222 | py | Python | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | 3 | 2018-09-11T07:28:18.000Z | 2020-07-07T17:25:11.000Z | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | 50 | 2018-01-20T20:48:24.000Z | 2018-03-05T00:29:47.000Z | data/render_data.py | ai-se/ResourcesDataDrivenSBSE | a061313f108f416035dcc6d03edc212aa4c7563e | [
"CC0-1.0"
] | null | null | null | from __future__ import print_function
from glob2 import glob
import pandas as pd
import os
from pdb import set_trace
head = """
[home](http://tiny.cc/sbse) |
[models](xx) |
[data](xx) |
[discuss](https://github.com/ai-se/ResourcesDataDrivenSBSE/issues) |
[citation](https://github.com/ai-se/ResourcesDataDrivenSBSE/blo... | 26.565217 | 135 | 0.728314 | from __future__ import print_function
from glob2 import glob
import pandas as pd
import os
from pdb import set_trace
head = """
[home](http://tiny.cc/sbse) |
[models](xx) |
[data](xx) |
[discuss](https://github.com/ai-se/ResourcesDataDrivenSBSE/issues) |
[citation](https://github.com/ai-se/ResourcesDataDrivenSBSE/blo... | 0 | 0 | 0 |
13eea81b3a271a532aa1b861edb5ff30a4588a1b | 712 | py | Python | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | monster_scrapper.py | Mounika1705/job_analysis | f90b7ca6dfb023ef06f894f120fde6673a1f3d8f | [
"Apache-2.0"
] | null | null | null | import feedparser
import csv
import json
#import pandas as pd
from urllib.request import urlopen
from bs4 import BeautifulSoup
query="engineer"
extract(query) | 20.342857 | 60 | 0.651685 | import feedparser
import csv
import json
#import pandas as pd
from urllib.request import urlopen
from bs4 import BeautifulSoup
def extract(query):
url= "http://rss.jobsearch.monster.com/rssquery.ashx?q="
query= "engineer"
final_url = url + query
url_xml = urlopen(final_url)
xml = url_xml.read()
... | 498 | 0 | 46 |
066097e133b01ab3ecc03ebcc6052eaff7e3fa82 | 9,550 | py | Python | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | null | null | null | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | 2 | 2019-07-09T19:37:39.000Z | 2020-07-25T12:23:27.000Z | bleak/backends/dotnet/scanner.py | soldag/bleak | 7ef5d61c93cf92806ac16eca38ed565d08d8ac59 | [
"MIT"
] | 2 | 2019-07-03T20:26:30.000Z | 2020-09-05T13:01:53.000Z | import logging
import asyncio
import pathlib
import uuid
from functools import wraps
from typing import Callable, Any, Union, List
from bleak.backends.device import BLEDevice
from bleak.backends.dotnet.utils import BleakDataReader
from bleak.exc import BleakError, BleakDotNetTaskError
from bleak.backends.scanner impor... | 37.747036 | 129 | 0.673927 | import logging
import asyncio
import pathlib
import uuid
from functools import wraps
from typing import Callable, Any, Union, List
from bleak.backends.device import BLEDevice
from bleak.backends.dotnet.utils import BleakDataReader
from bleak.exc import BleakError, BleakDotNetTaskError
from bleak.backends.scanner impor... | 3,716 | 0 | 265 |
b4c3955dd508cc1e9a27ca02d24fb2d7945bcf45 | 467 | py | Python | src/super_gradients/training/datasets/detection_datasets/coco_detection.py | Deci-AI/super-gradients | 658f638389654668a085e23c3b19622241fd9267 | [
"Apache-2.0"
] | 308 | 2021-12-30T10:14:30.000Z | 2022-03-30T19:05:31.000Z | src/super_gradients/training/datasets/detection_datasets/coco_detection.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | 24 | 2022-01-10T08:05:37.000Z | 2022-03-30T18:49:06.000Z | src/super_gradients/training/datasets/detection_datasets/coco_detection.py | karndeepsingh/super-gradients | bfed440ecaf485af183570bf965eb5b74cb9f832 | [
"Apache-2.0"
] | 26 | 2021-12-31T06:04:07.000Z | 2022-03-21T09:51:44.000Z | from super_gradients.training.datasets.detection_datasets.detection_dataset import DetectionDataSet
from super_gradients.training.datasets.datasets_conf import COCO_DETECTION_CLASSES_LIST
class COCODetectionDataSet(DetectionDataSet):
"""
COCODetectionDataSet - Detection Data Set Class COCO Data Set
"""
| 35.923077 | 99 | 0.777302 | from super_gradients.training.datasets.detection_datasets.detection_dataset import DetectionDataSet
from super_gradients.training.datasets.datasets_conf import COCO_DETECTION_CLASSES_LIST
class COCODetectionDataSet(DetectionDataSet):
"""
COCODetectionDataSet - Detection Data Set Class COCO Data Set
"""
... | 122 | 0 | 27 |
f00bbaa6bf9d748d229a232f4dfbb02cf2de0cca | 2,904 | py | Python | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | contract_tests.py | LukasForst/SWA-TP-user-service-contract-tests | 7f08be64b23ff63f2b647c811226097619a363db | [
"MIT"
] | null | null | null | import unittest
import uuid
import requests
SERVICE_URL = 'http://localhost:8080'
if __name__ == '__main__':
unittest.main()
| 38.210526 | 113 | 0.625689 | import unittest
import uuid
import requests
SERVICE_URL = 'http://localhost:8080'
class MyTestCase(unittest.TestCase):
def test_status_returns_ok(self):
r = requests.get(f'{SERVICE_URL}/status')
self.assertEqual('OK', r.json()['status'])
def test_version_returns_some_version(self):
... | 2,516 | 15 | 239 |
e59843bb2a662d5fa0cc55c5911cde4a95adf697 | 674 | py | Python | src/user/user_controller.py | andresposada/mongoconnections-dependency-injections | 77b19229e6a867584051592632b7624d1dd3c7ad | [
"Apache-2.0"
] | null | null | null | src/user/user_controller.py | andresposada/mongoconnections-dependency-injections | 77b19229e6a867584051592632b7624d1dd3c7ad | [
"Apache-2.0"
] | null | null | null | src/user/user_controller.py | andresposada/mongoconnections-dependency-injections | 77b19229e6a867584051592632b7624d1dd3c7ad | [
"Apache-2.0"
] | null | null | null | import json
from src.user.use_cases import UserUseCase
from src.user.schemas import UserSchema
from abc import ABC, abstractmethod
from src.containers import Services
| 22.466667 | 47 | 0.718101 | import json
from src.user.use_cases import UserUseCase
from src.user.schemas import UserSchema
from abc import ABC, abstractmethod
from src.containers import Services
class UserControllerBase(ABC):
@abstractmethod
def execute(self, **kwargs):
pass
class UserControllerPost(UserControllerBase):
... | 283 | 125 | 96 |
46cb05635ad337e6167d8763bcaa6919b36bc980 | 2,539 | py | Python | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | null | null | null | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | 5 | 2020-07-07T19:41:23.000Z | 2022-02-12T05:42:50.000Z | server/app/service/motion.py | raspihats/EvePnP | 2961d759554c38609f0f431c012ea8d38016f347 | [
"MIT"
] | null | null | null | from ..dao import axis_dao
from .controllers import controllers_service
motion_service = MotionService()
| 36.271429 | 89 | 0.579756 | from ..dao import axis_dao
from .controllers import controllers_service
class MotionService(object):
def home(self):
controllers_service.motion_controller.home()
self.park([{'id': 'z'}])
self.park([{'id': 'x'}, {'id': 'y'}])
self.park([{'id': 'a'}, {'id': 'b'}])
def park(self... | 2,239 | 7 | 185 |
dc2728c07d84b61179c743daba2813a4ab10792d | 2,029 | py | Python | tests/int_return_menu_test.py | IXIXIXIXIXIXIXIXIX/pyMenus | 843abe73e3c19492cfdc62365bc2a4e6c5066050 | [
"MIT"
] | null | null | null | tests/int_return_menu_test.py | IXIXIXIXIXIXIXIXIX/pyMenus | 843abe73e3c19492cfdc62365bc2a4e6c5066050 | [
"MIT"
] | null | null | null | tests/int_return_menu_test.py | IXIXIXIXIXIXIXIXIX/pyMenus | 843abe73e3c19492cfdc62365bc2a4e6c5066050 | [
"MIT"
] | null | null | null | import unittest
from py_CLI_menus.int_return_menu import IntReturnMenu
| 32.725806 | 120 | 0.631345 | import unittest
from py_CLI_menus.int_return_menu import IntReturnMenu
class TestIntReturnMenu(unittest.TestCase):
def setUp(self):
self.list_of_options_1 = [
"First Option - choose this",
"Second Option",
"Third Option",
"Fourth Option"
]
... | 1,724 | 22 | 212 |
37a912fcaa51bf417936b1e79aa45ed24ecd9252 | 563 | py | Python | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | null | null | null | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | 13 | 2021-09-08T21:05:49.000Z | 2021-12-16T04:58:51.000Z | backend/smartMoney_project/smartMoney_app/migrations/0013_expense_category.py | uca-pid/f-al-cuadrado-2021 | 2cd203f5a998f3b4f54811a382458ce5b6762a2a | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2021-09-19 22:33
from django.db import migrations, models
import django.db.models.deletion
import smartMoney_app.models
| 26.809524 | 157 | 0.68206 | # Generated by Django 3.2.4 on 2021-09-19 22:33
from django.db import migrations, models
import django.db.models.deletion
import smartMoney_app.models
class Migration(migrations.Migration):
dependencies = [
('smartMoney_app', '0012_auto_20210919_2119'),
]
operations = [
migrations.AddFi... | 0 | 387 | 23 |
94e1a55855eb3fba74bcfbc988c3961ba5b60fc7 | 2,321 | py | Python | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | udapi/mongodb/databases.py | FOSS-X/udapi-core-v2 | 0e0cceb7130389d01bc4e674ad9a1f38fb556837 | [
"MIT"
] | null | null | null | #
# databases.py
# Start of dataabases.py
#
# Created by FOSS-X UDAPI Desgin Team on 7/05/20.
# Copyright © 2020 FOSS-X. All rights reserved.
#
from flask import Flask, jsonify, request,Blueprint
from ..util_mongodb import *
from ..util import *
from ..util_mysql import *
import pymongo
mod = Blueprint(... | 35.707692 | 124 | 0.691081 | #
# databases.py
# Start of dataabases.py
#
# Created by FOSS-X UDAPI Desgin Team on 7/05/20.
# Copyright © 2020 FOSS-X. All rights reserved.
#
from flask import Flask, jsonify, request,Blueprint
from ..util_mongodb import *
from ..util import *
from ..util_mysql import *
import pymongo
mod = Blueprint(... | 843 | 0 | 44 |
56483d92d184dffd6f7b6f11cd36ff2344b63545 | 550 | py | Python | relaax/server/common/saver/fs_saver.py | j0k/relaax | dff865facc2932e4f8317d6ab4ad32a1f218e7b6 | [
"MIT"
] | 4 | 2018-07-31T06:32:30.000Z | 2021-05-02T20:21:37.000Z | relaax/server/common/saver/fs_saver.py | bohblue2/relaax | 0a7ed8f2a21e37ca047e16d216d164527c1fffdd | [
"MIT"
] | null | null | null | relaax/server/common/saver/fs_saver.py | bohblue2/relaax | 0a7ed8f2a21e37ca047e16d216d164527c1fffdd | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import tensorflow
import saver
| 22.916667 | 52 | 0.667273 | from __future__ import print_function
import os
import tensorflow
import saver
class FsSaver(saver.Saver):
def __init__(self, dir):
super(FsSaver, self).__init__()
self._dir = dir
def restore_latest_checkpoint(self, session):
return self._restore(self._dir, session)
def save_ch... | 332 | 6 | 130 |
062502d51ba25c33ec0f0bba62d7be2e338d4bb9 | 1,762 | py | Python | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 1 | 2021-07-15T08:55:12.000Z | 2021-07-15T08:55:12.000Z | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 7 | 2021-01-07T23:51:57.000Z | 2021-12-13T19:50:57.000Z | syn/tagmathon/b/tests/test_interpreter.py | mbodenhamer/syn | aeaa3ad8a49bac8f50cf89b6f1fe97ad43d1d258 | [
"MIT"
] | 2 | 2016-07-11T08:46:31.000Z | 2017-12-13T13:30:51.000Z | from nose.tools import assert_raises
from syn.tagmathon.b import Frame, Env, eval
#-------------------------------------------------------------------------------
# Frame
#-------------------------------------------------------------------------------
# Env
#----------------------------------------------------------... | 21.753086 | 80 | 0.420545 | from nose.tools import assert_raises
from syn.tagmathon.b import Frame, Env, eval
#-------------------------------------------------------------------------------
# Frame
def test_frame():
f = Frame()
f['a'] = 1
f['b'] = 2
assert f.globals == {}
assert f.locals == dict(a=1, b=2)
f.set_global... | 1,107 | 0 | 69 |
23022abdf1b502146d3781d4836f78943a7ec6e6 | 2,186 | py | Python | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 55 | 2017-02-10T07:55:21.000Z | 2021-09-01T00:59:36.000Z | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 106 | 2017-02-13T09:58:27.000Z | 2022-02-15T09:51:48.000Z | kvmagent/kvmagent/test/test_vm_plugin_update_hostIommu_status.py | qianfei11/zstack-utility | e791bc6b6ae3a74e202f6fce84bde498c715aee8 | [
"Apache-2.0"
] | 68 | 2017-02-13T11:02:01.000Z | 2021-12-16T11:02:01.000Z | '''
@author: kaicai.hu
'''
import unittest
import tempfile
from kvmagent import kvmagent
from kvmagent.plugins import vm_plugin
from zstacklib.utils import bash
if __name__ == "__main__":
unittest.main() | 46.510638 | 237 | 0.639067 | '''
@author: kaicai.hu
'''
import unittest
import tempfile
from kvmagent import kvmagent
from kvmagent.plugins import vm_plugin
from zstacklib.utils import bash
class Test(unittest.TestCase):
def testName(self):
temp = tempfile.NamedTemporaryFile(prefix='grub', suffix='', dir='/tmp', mode='w+b', del... | 1,911 | 9 | 56 |
ea8f8a167839e9e37d789b4d71ccdca1c2f23656 | 2,816 | py | Python | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | 3 | 2022-02-07T09:45:59.000Z | 2022-02-08T08:48:43.000Z | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | 13 | 2021-08-06T02:20:30.000Z | 2021-09-09T02:20:43.000Z | math/functions/contrast/contrast.py | timi-liuliang/auto | 2562fd6c41b05e6db453bc0346ddcb4a0a9281a1 | [
"MIT"
] | null | null | null | import os
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.ticker import FuncFormatter, MultipleLocator
from scipy import integrate
# total time
base_time = 4.0
pause_time = 1.5
total_time = base_time + pause_time
# fig
fig, ax = plt.subplots()
#... | 22.173228 | 150 | 0.675426 | import os
import math
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.ticker import FuncFormatter, MultipleLocator
from scipy import integrate
# total time
base_time = 4.0
pause_time = 1.5
total_time = base_time + pause_time
# fig
fig, ax = plt.subplots()
#... | 1,542 | 0 | 165 |
096631f832909cdbfb5d9cd339d4547385821674 | 75 | py | Python | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | simple_test.py | RaymondKlass/raspberry_pi_tuner | 0f2bc1d4a9e483f293575fc5b4765d7bf3489b49 | [
"MIT"
] | null | null | null | import spidev
import os
spi = spidev.SpiDev()
spi.open(0,0)
print("Yay")
| 9.375 | 21 | 0.693333 | import spidev
import os
spi = spidev.SpiDev()
spi.open(0,0)
print("Yay")
| 0 | 0 | 0 |
e5c02850e19cee76b29d8f84b88d8484cee6661b | 5,377 | py | Python | arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | null | null | null | arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | 1 | 2020-01-14T04:52:52.000Z | 2020-01-14T04:52:52.000Z | test/arith.py | versey-sherry/arith | e110fe050bd04ca00fd9d9c0d4261e4bff49366e | [
"MIT"
] | 1 | 2020-04-03T21:43:08.000Z | 2020-04-03T21:43:08.000Z |
#!/usr/bin/env python3
#I mainly followed this post https://ruslanspivak.com/lsbasi-part7/
#Lexer
#Tokenize the inputs
#Token type PLUS MUL MINUS INTEGER
import sys
sys.tracebacklimit=0
#String representation for debugging just in case
#lexer
#advance to the next character
#skipping white spaces
#multiple digi... | 23.378261 | 87 | 0.679375 |
#!/usr/bin/env python3
#I mainly followed this post https://ruslanspivak.com/lsbasi-part7/
#Lexer
#Tokenize the inputs
#Token type PLUS MUL MINUS INTEGER
import sys
sys.tracebacklimit=0
class Token():
def __init__(self, type, value):
self.type = type
self.value = value
#String representation for debugging just... | 3,710 | -38 | 737 |
9664835c042e90d1230dac038e374368cbb3ceb1 | 1,284 | py | Python | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 299 | 2018-11-05T20:29:13.000Z | 2022-03-31T11:03:45.000Z | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 103 | 2018-11-21T20:00:24.000Z | 2022-03-30T21:03:56.000Z | auto_pose/meshrenderer/gl_utils/glfw_offscreen_context.py | juwangvsu/AugmentedAutoencoder_new | f29d657f369332a6284cf39e615af24758add624 | [
"MIT"
] | 96 | 2018-11-30T12:03:21.000Z | 2022-02-18T07:15:24.000Z | # -*- coding: utf-8 -*-
import logging as log
import os
from OpenGL.GL import *
import cyglfw3 as glfw
| 25.68 | 77 | 0.634735 | # -*- coding: utf-8 -*-
import logging as log
import os
from OpenGL.GL import *
import cyglfw3 as glfw
class OffscreenContext(object):
def __init__(self):
assert glfw.Init(), 'Glfw Init failed!'
glfw.WindowHint(glfw.VISIBLE, False)
self._offscreen_context = glfw.CreateWindow(1, 1, "", No... | 916 | 240 | 23 |
71ad7eeb0397df8745079fc70911f19d55534c40 | 12,461 | py | Python | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | 1 | 2018-09-24T21:17:32.000Z | 2018-09-24T21:17:32.000Z | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | 6 | 2017-09-25T00:28:18.000Z | 2022-01-13T03:01:32.000Z | legacy/dicebox_multi_client.py | shapeandshare/dicebox.sdk | 4cf80f5034e4c3f2f859bc5cbd6607c8af278819 | [
"MIT"
] | null | null | null | ###############################################################################
# dice box
###############################################################################
import cv
import cv2
from datetime import datetime
import json
import requests
import os
import numpy
import math
from lib import dicebox_config as c... | 35.300283 | 148 | 0.644892 | ###############################################################################
# dice box
###############################################################################
import cv
import cv2
from datetime import datetime
import json
import requests
import os
import numpy
import math
from lib import dicebox_config as c... | 4,129 | 0 | 137 |
59c6f237a998baf3a75150823097b488c556a173 | 1,473 | py | Python | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | null | null | null | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | 1 | 2020-05-06T01:34:25.000Z | 2020-05-06T01:34:25.000Z | eland/tests/operations/test_map_pd_aggs_to_es_aggs_pytest.py | mesejo/eland | d1444f8e094ef11ce4fa6713a521245b68a842d7 | [
"Apache-2.0"
] | 1 | 2020-05-06T01:31:18.000Z | 2020-05-06T01:31:18.000Z | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
from eland.operations import Operations
| 36.825 | 87 | 0.649695 | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
from eland.operations import Operations
def test_all_aggs():
es_aggs = Operations._map_pd_aggs_to_es_aggs(
... | 1,182 | 0 | 46 |
fd052ded2f5e1744dcd04fbd358f8ba09d27b9d2 | 2,386 | py | Python | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | src/visualization/plot_dist.py | igordub/enm-research-project | c5c52f2a6b415bd871800bcf725fda23cb3fd542 | [
"MIT"
] | null | null | null | import os,sys, math, numpy as np, itertools
from matplotlib.patches import Patch
import matplotlib.pyplot as plt
from pylab import *
import src.utilities as utils
config = utils.read_config()
mpl.rcParams.update(mpl.rcParamsDefault) # VS Code plots not black
plt.style.use(config['viz'])
infile='dist.dat' #First ... | 22.299065 | 102 | 0.601006 | import os,sys, math, numpy as np, itertools
from matplotlib.patches import Patch
import matplotlib.pyplot as plt
from pylab import *
import src.utilities as utils
config = utils.read_config()
mpl.rcParams.update(mpl.rcParamsDefault) # VS Code plots not black
plt.style.use(config['viz'])
infile='dist.dat' #First ... | 0 | 0 | 0 |
50b592b7a39165dd3bf0043bc15a4c59db51dd20 | 1,048 | py | Python | WindNinja_learning/nwp.py | louisletoumelin/wind_downscaling_cnn | 9d08711620db1ee1f472847f0e822c5f4eb1d300 | [
"W3C"
] | null | null | null | WindNinja_learning/nwp.py | louisletoumelin/wind_downscaling_cnn | 9d08711620db1ee1f472847f0e822c5f4eb1d300 | [
"W3C"
] | 12 | 2021-11-30T16:56:05.000Z | 2021-12-13T16:26:31.000Z | WindNinja_learning/nwp.py | louisletoumelin/wind_downscaling_cnn | 9d08711620db1ee1f472847f0e822c5f4eb1d300 | [
"W3C"
] | null | null | null | import numpy as np
import xarray as xr
| 29.942857 | 91 | 0.678435 | import numpy as np
import xarray as xr
def preprocess_function(netCDF_file):
try:
netCDF_file = netCDF_file.assign_coords(time=("time", netCDF_file.time.data))
except:
netCDF_file = netCDF_file.assign_coords(time=("oldtime", netCDF_file.time.data))
netCDF_file = netCDF_file.assign_coords(... | 913 | 0 | 92 |
39fff929dd82ff62b575763af114fc78809ce1dc | 1,639 | py | Python | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | lib/uiEntityClass.py | Dogeek/codevo | 690d161b4099d37597246f1ca3164f60a350e662 | [
"MIT"
] | null | null | null | import pygame
from pygame.locals import *
import math
from . import *
#from .functions import *
#from .constants import *
| 36.422222 | 85 | 0.705918 | import pygame
from pygame.locals import *
import math
from . import *
#from .functions import *
#from .constants import *
class UiEntity(pygame.sprite.Sprite):
def __init__(self, player):
pygame.sprite.Sprite.__init__(self, uiEntityGroup)
self.heart_sprites = []
heart_spritesheet = pygame.image.load(PATH+"spri... | 1,428 | 16 | 72 |
86f6eecde8359d62f3d37ec3b0aaee3b5aa05a27 | 799 | py | Python | profit/dataset/preprocessing/__init__.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | profit/dataset/preprocessing/__init__.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | 1 | 2021-09-15T13:13:12.000Z | 2021-09-15T13:13:12.000Z | profit/dataset/preprocessing/__init__.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | from profit.dataset.preprocessing import mol_feats
from profit.dataset.preprocessing import mutator
from profit.dataset.preprocessing import seq_feats
from profit.dataset.preprocessing.mol_feats import construct_adj_matrix
from profit.dataset.preprocessing.mol_feats import construct_mol_features
from profit.dataset.pr... | 49.9375 | 81 | 0.894869 | from profit.dataset.preprocessing import mol_feats
from profit.dataset.preprocessing import mutator
from profit.dataset.preprocessing import seq_feats
from profit.dataset.preprocessing.mol_feats import construct_adj_matrix
from profit.dataset.preprocessing.mol_feats import construct_mol_features
from profit.dataset.pr... | 0 | 0 | 0 |
729efd3596279ece5858734443f087028b153fd0 | 4,806 | py | Python | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | tests/models/test_tensorflow.py | cdknorow/modelstore | f08839478432b89e828a8dcb41adf27b0e3aa66b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Neal Lathia
#
# 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 agre... | 29.484663 | 88 | 0.700375 | # Copyright 2020 Neal Lathia
#
# 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 agre... | 3,326 | 0 | 319 |
ed60387424a02a928c8ef69020f22264e81ae158 | 524 | py | Python | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | tests/test_main_game.py | sandu-alexandru/hero_game | f8094cec260b45e7e1e2b847cd4bb5ae726a38f6 | [
"MIT"
] | null | null | null | from game_hero.main_game import HeroGame
def test_start_game():
"""
Tests output of the game as string
"""
game_instance = HeroGame()
game_output = game_instance.start_game()
assert isinstance(game_output, str), "Output of the game is not string!"
def test_game_instance():
"""
Tests ... | 26.2 | 77 | 0.709924 | from game_hero.main_game import HeroGame
def test_start_game():
"""
Tests output of the game as string
"""
game_instance = HeroGame()
game_output = game_instance.start_game()
assert isinstance(game_output, str), "Output of the game is not string!"
def test_game_instance():
"""
Tests ... | 0 | 0 | 0 |
012bae7ff5639b2c9a4156f6f0c70ca87eab3abc | 6,948 | py | Python | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | previousTries (1).py | Katzuno/BlackBoxClassification-IA-Sem2 | 79869dc5abf4cb04b12ff9b722c77a2c296b144d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 23:15:21 2019
@author: erikh
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 21:15:45 2019
@author: erikh
"""
# Data Preprocessing Template
"""
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas... | 31.726027 | 174 | 0.614421 | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 23:15:21 2019
@author: erikh
"""
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 4 21:15:45 2019
@author: erikh
"""
# Data Preprocessing Template
"""
"""
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas... | 56 | 0 | 25 |
c85c112ba096f11bd69535331666d12ef9fc027a | 13,077 | py | Python | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apIMAGIC.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | import os
import re
import shutil
import sys
import stat
import time
import subprocess
import glob
from appionlib import apDisplay
from appionlib import apParam
from pyami import imagic2mrc
#======================
#======================
#======================
def executeImagicBatchFile(filename, showcmd=True, ve... | 28.803965 | 123 | 0.679131 | import os
import re
import shutil
import sys
import stat
import time
import subprocess
import glob
from appionlib import apDisplay
from appionlib import apParam
from pyami import imagic2mrc
#======================
def checkImagicExecutablePath():
### check for IMAGIC installation
d = os.environ
if d.has_key('IMAGIC... | 3,441 | 0 | 132 |
84676529c79351f4d06d6bfc27b4b70952854e49 | 3,736 | py | Python | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | null | null | null | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | 223 | 2020-02-21T06:16:56.000Z | 2022-03-01T22:24:19.000Z | home/storage/migrations/0003_logical_delete.py | he0119/smart-home | bdd3a59a8c46c0fdc07ac3049bf589c7f95a2683 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-21 11:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def set_edited_by(apps, schema_editor):
"""将修改人设置为录入人"""
Item = apps.get_model("storage", "Item")
for item in Item.objects.all():
item.edited_... | 30.876033 | 83 | 0.546842 | # Generated by Django 3.1.4 on 2020-12-21 11:36
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
def set_edited_by(apps, schema_editor):
"""将修改人设置为录入人"""
Item = apps.get_model("storage", "Item")
for item in Item.objects.all():
item.edited_... | 0 | 3,246 | 23 |
067cdd1fe5c0e35cddffd2297f13aa8f28c0b978 | 903 | py | Python | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | 3 | 2020-08-05T01:15:41.000Z | 2020-08-05T09:28:36.000Z | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | null | null | null | chapter05/eight_queens_problem.py | persevere-in-coding-persist-in-learning/python2 | b207d0040232abae63638784b34a950b932bef77 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
"""
@desc:
国际象棋中的皇后比中国象棋里的大车还厉害,皇后能横向,纵向和斜向移动,在这三条线上的其他棋子都可以被吃掉。
所谓八皇后问题就是:将八位皇后放在一张8x8的棋盘上,使得每位皇后都无法吃掉别的皇后,(即任意两个皇后都不在同一条横线,
竖线和斜线上),问一共有多少种摆法。此问题是在1848年由棋手马克思·贝瑟尔提出的,后面陆续有包括高斯等大数学家们给出
自己的思考和解法,所以此问题不只是有年头了,简直比82年的拉菲还有年头,我们今天不妨尝尝这老酒。
@author: huijz
@version 0.1
@date 2020-08-31
@email huijz8117@gmail.co... | 23.763158 | 60 | 0.654485 | # coding=utf-8
"""
@desc:
国际象棋中的皇后比中国象棋里的大车还厉害,皇后能横向,纵向和斜向移动,在这三条线上的其他棋子都可以被吃掉。
所谓八皇后问题就是:将八位皇后放在一张8x8的棋盘上,使得每位皇后都无法吃掉别的皇后,(即任意两个皇后都不在同一条横线,
竖线和斜线上),问一共有多少种摆法。此问题是在1848年由棋手马克思·贝瑟尔提出的,后面陆续有包括高斯等大数学家们给出
自己的思考和解法,所以此问题不只是有年头了,简直比82年的拉菲还有年头,我们今天不妨尝尝这老酒。
@author: huijz
@version 0.1
@date 2020-08-31
@email huijz8117@gmail.co... | 469 | 0 | 46 |
3cfe2ab1ae54a13c77234ff9e4a3a082363da06f | 361 | py | Python | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/corp/ddcc2019_b.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null |
N = int(input())
ans = 0
K = 100
for i in range(N):
for j in range(N):
a, b = i * 2 * K, (i + 1) * 2 * K
c, d = j * 2 * K, (j + 1) * 2 * K
if in_(a, c) and in_(a, d) and in_(b, c) and in_(b, d):
ans += 1
print(ans)
| 25.785714 | 89 | 0.393352 | def in_(x, y):
return -x + y >= -N * K and x + y >= N * K and x + y <= 3 * K * N and -x + y <= N * K
N = int(input())
ans = 0
K = 100
for i in range(N):
for j in range(N):
a, b = i * 2 * K, (i + 1) * 2 * K
c, d = j * 2 * K, (j + 1) * 2 * K
if in_(a, c) and in_(a, d) and in_(b, c) and in... | 83 | 0 | 22 |
d9a2f33161a7ccbe3aabf596b65a792342fd5b61 | 366 | py | Python | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 5 | 2016-12-08T15:40:27.000Z | 2021-09-10T16:01:36.000Z | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 1 | 2020-02-03T22:11:09.000Z | 2020-02-03T22:11:09.000Z | gee_gateway/__init__.py | jdilger/gee-gateway | 2e4d11f01e785359e6f213fe7d647032f1212b76 | [
"MIT"
] | 8 | 2017-05-12T20:49:38.000Z | 2020-05-14T19:22:21.000Z | from flask import Blueprint
gee_gateway = Blueprint('gee_gateway', __name__, template_folder='templates', static_folder='static', static_url_path='/static/gee_gateway')
from . import gee, web
| 40.666667 | 140 | 0.795082 | from flask import Blueprint
gee_gateway = Blueprint('gee_gateway', __name__, template_folder='templates', static_folder='static', static_url_path='/static/gee_gateway')
from . import gee, web
def gee_initialize(ee_account='', ee_key_path='', ee_user_token=''):
gee.utils.initialize(ee_account=ee_account, ee_key_p... | 149 | 0 | 23 |
d31522c6adbf649e52bc307feaa904c8a1650d3f | 2,445 | py | Python | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | main1.py | wotmd5731/pseudo_random_gen | f79810cd5ac79afe0a73dee73aa21bd8c01aeb9b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import random
import numpy as np
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import os
import csv
"""
NOT USED.
leaky_relu사용.
Pred 값이 - ~ +가 나옴
real target value is only 0 or 1 value
"""
... | 21.447368 | 114 | 0.633538 | # -*- coding: utf-8 -*-
import random
import numpy as np
import time
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
import os
import csv
"""
NOT USED.
leaky_relu사용.
Pred 값이 - ~ +가 나옴
real target value is only 0 or 1 value
"""
... | 285 | 4 | 92 |
20b6df6c10f2fe6702e8ead6111932be15ff0bb4 | 2,403 | py | Python | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | Bot/cogs/staff/shutdown.py | HoggyTheWizard/GuildofGuilds | e0dd5188b41e542587149c38e41d85414ada6e5c | [
"MIT"
] | null | null | null | from discord.ext import commands
from Bot.utils.staff.staff_checks import *
from main import main_db
from pathlib import Path
from config import prefixes
users = main_db["users"]
blacklisted_files = ["shutdown", "start", "reload"]
| 33.84507 | 119 | 0.555972 | from discord.ext import commands
from Bot.utils.staff.staff_checks import *
from main import main_db
from pathlib import Path
from config import prefixes
users = main_db["users"]
blacklisted_files = ["shutdown", "start", "reload"]
class shutdown(commands.Cog):
def __init__(self, bot):
self.bot = bot
... | 1,832 | 292 | 46 |
e7acf8eecac1fc1b17b7af722ce3c075dadbe3ca | 3,383 | py | Python | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | tests/lib/interface/test_predicate.py | Finistere/dependency_manager | 5a183d46ac5d760944dc507d1281813d02d2c75e | [
"MIT"
] | null | null | null | # pyright: reportUnusedClass=false
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Iterator, Optional, TypeVar
import pytest
from antidote import implements, inject, injectable, interface, world
from antidote.lib.injectable import register_injectable_provider
from antidot... | 23.493056 | 99 | 0.663021 | # pyright: reportUnusedClass=false
from __future__ import annotations
from dataclasses import dataclass
from typing import Any, Iterator, Optional, TypeVar
import pytest
from antidote import implements, inject, injectable, interface, world
from antidote.lib.injectable import register_injectable_provider
from antidot... | 2,501 | 105 | 272 |
df82f21dd0f33072fb753615eac78da6261729b3 | 2,580 | py | Python | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | 1 | 2015-04-30T14:18:45.000Z | 2015-04-30T14:18:45.000Z | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/webservergluecgi.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# $Id: webservergluecgi.py $
"""
Test Manager Core - Web Server Abstraction Base Class.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you ... | 30 | 78 | 0.711628 | # -*- coding: utf-8 -*-
# $Id: webservergluecgi.py $
"""
Test Manager Core - Web Server Abstraction Base Class.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you ... | 837 | 0 | 323 |
72c98fea0717dde69cbc4a74a1ecfb4b2872563f | 23,840 | py | Python | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | tests/test_vjp.py | AmintorDusko/pennylane-lightning | 9554a95842de9d7759ce96bfa75857e0c9ca756b | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 32.928177 | 100 | 0.574664 | # Copyright 2018-2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or... | 2,556 | 0 | 182 |
0a101192ae0b1abd0f873dc0f51892babefc1c5e | 31,147 | py | Python | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | test/initial_sharding.py | Santiclause/vitess | 870177ca857e3bba2941a999174cc97d2c40c864 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 43.020718 | 81 | 0.650239 | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 28,452 | 56 | 365 |
714062181c6a8c08dde0d08f41e9a77ca3c05897 | 229 | py | Python | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 3 | 2018-10-19T06:57:50.000Z | 2020-11-12T11:20:37.000Z | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 16 | 2017-02-14T12:37:58.000Z | 2019-04-25T07:55:42.000Z | tests/settings_pg.py | maykinmedia/djadyen | 8bde7172c72d68975d4a77c7ef6bed73412619dc | [
"BSD-3-Clause"
] | 2 | 2018-05-16T10:08:34.000Z | 2019-09-29T23:31:04.000Z | from .settings import *
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'djadyen',
# 'USERNAME': 'djadyen',
# 'PASSWORD': 'djadyen',
# }
# }
| 20.818182 | 61 | 0.50655 | from .settings import *
# DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.postgresql_psycopg2',
# 'NAME': 'djadyen',
# 'USERNAME': 'djadyen',
# 'PASSWORD': 'djadyen',
# }
# }
| 0 | 0 | 0 |
c88544e218ee014200864ebbb2fdc9913c90a8f4 | 3,068 | py | Python | super_sac/adv_estimator.py | QData/super_sac | f44f0ab88bc462da0cee354b406822db7084f430 | [
"MIT"
] | 1 | 2021-12-10T20:25:44.000Z | 2021-12-10T20:25:44.000Z | super_sac/adv_estimator.py | QData/super_sac | f44f0ab88bc462da0cee354b406822db7084f430 | [
"MIT"
] | null | null | null | super_sac/adv_estimator.py | QData/super_sac | f44f0ab88bc462da0cee354b406822db7084f430 | [
"MIT"
] | 1 | 2022-01-14T19:26:14.000Z | 2022-01-14T19:26:14.000Z | import random
import torch
from torch import nn
import torch.nn.functional as F
| 34.088889 | 86 | 0.563233 | import random
import torch
from torch import nn
import torch.nn.functional as F
class AdvantageEstimator(nn.Module):
def __init__(
self,
encoder,
actors,
critics,
popart=False,
discrete_method="indirect",
continuous_method="mean",
discrete=False,
... | 2,787 | 15 | 184 |
96a4c857fca98f8eee279e5b54706931a2a8bdf5 | 478 | py | Python | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | AiSD_03/Zadanie_9.py | DLQuake/Algorytmy_i_struktury_danych | 210d0b4e868e5cc9d6aa730a2297d8074e4d52a1 | [
"MIT"
] | null | null | null | # Zaimplementować funkcję remove_duplicates(txt: str) -> str, która zwróci wartość parametru txt pozbawioną sąsiadujących duplikujących się znaków. Przykład: XXYZZZ -> XYZ
print(remove_duplicates("XXYZZ")) | 31.866667 | 171 | 0.682008 | # Zaimplementować funkcję remove_duplicates(txt: str) -> str, która zwróci wartość parametru txt pozbawioną sąsiadujących duplikujących się znaków. Przykład: XXYZZZ -> XYZ
def remove_duplicates(txt: str):
if len(txt)==0 or len(txt)==1:
return txt
elif txt[0]==txt[1]:
pom1=txt[1:]
pom2=remove_... | 249 | 0 | 23 |
c88837628aad1517d6dea3ae4d7df98cf1f290e6 | 4,476 | py | Python | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | 3 | 2016-01-25T02:19:28.000Z | 2019-09-01T22:03:31.000Z | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | null | null | null | bomba.py | ncos/checkq | 79506a9eafc9c5dacc84ee3dc37f799d734f4701 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import cv2
import numpy as np
p = Process('/root/Desktop/b.jpg')
img_disp = ImageDisplay('result')
img_disp.spin(p)
| 33.155556 | 138 | 0.59294 | #!/usr/bin/python
import cv2
import numpy as np
class ImageDisplay:
def __init__(self, windowname):
self.windowname = windowname
cv2.namedWindow(windowname, cv2.WINDOW_NORMAL)
def show_blend(self, images, windowname):
if len(images) == 0:
print "WARNING: No images prov... | 4,000 | -9 | 345 |
13f06832e4295172b8c261e2389cec10b0362703 | 3,512 | py | Python | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 11 | 2015-01-17T04:27:26.000Z | 2018-06-07T21:56:25.000Z | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 41 | 2015-05-08T18:54:46.000Z | 2019-10-25T05:08:31.000Z | moksha.hub/moksha/hub/__init__.py | hroncok/moksha | 08b3f668a9a3ca45fe49174eaace7b89bb995a92 | [
"Apache-2.0"
] | 16 | 2015-06-26T21:52:42.000Z | 2021-05-10T17:27:32.000Z | # This file is part of Moksha.
# Copyright (C) 2008-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.63964 | 80 | 0.693622 | # This file is part of Moksha.
# Copyright (C) 2008-2014 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 546 | 24 | 76 |
ad89261a9f20fc8289c0d58ac0edee9defef16a5 | 20 | py | Python | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null | nifi-linksmart-processors/src/test/resources/get_exception.py | linksmart/nifi-linksmart-processor | 74317b338669525ea60538ad2fe13841e71edaf4 | [
"Apache-2.0"
] | null | null | null | import sys
a = 10/0 | 6.666667 | 10 | 0.65 | import sys
a = 10/0 | 0 | 0 | 0 |
084c8ad941c710c63aaa85337527e56dbf84f640 | 584 | py | Python | trackash/budget/admin.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | trackash/budget/admin.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | trackash/budget/admin.py | black-redoc/trackash | 99ded8445eaaa1bdf616d43c36ba402356e2f9d3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Income, Expense, Budget, Extract
@admin.register(Budget)
@admin.register(Income)
@admin.register(Expense)
@admin.register(Extract)
| 24.333333 | 65 | 0.724315 | from django.contrib import admin
from .models import Income, Expense, Budget, Extract
@admin.register(Budget)
class BudgetAdmin(admin.ModelAdmin):
list_display = ("balance", "incomes", "expenses")
@admin.register(Income)
class IncomeAdmin(admin.ModelAdmin):
list_display = ("created_at", "concept", "value",... | 0 | 303 | 88 |
131e7ecadea4a9957479632d96bd39eede25e3ea | 878 | py | Python | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/field/eunwol_house.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # 410000001
if sm.hasQuest(38002):
sm.removeEscapeButton()
sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("What happened? A house and a new name... But what happened to my friends? Are they alive? If I am, then maybe we failed to seal the Black Mage...")
sm.sendSay("No. They wouldn't give up that easily. ... | 67.538462 | 188 | 0.719818 | # 410000001
if sm.hasQuest(38002):
sm.removeEscapeButton()
sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("What happened? A house and a new name... But what happened to my friends? Are they alive? If I am, then maybe we failed to seal the Black Mage...")
sm.sendSay("No. They wouldn't give up that easily. ... | 0 | 0 | 0 |
b7e295aaee12733b24208bc9ecfd8c3391cf29ce | 10,398 | py | Python | daceml/autodiff/utils.py | spcl/daceml | a096cf009d1c9fbb2f1872a86a016d209d344f22 | [
"BSD-3-Clause"
] | 30 | 2020-09-09T21:13:36.000Z | 2022-03-15T01:58:10.000Z | daceml/autodiff/utils.py | Shigangli/daceml | c2133c677d5174763e30cf2d98dcb3fd64059db3 | [
"BSD-3-Clause"
] | 83 | 2020-09-05T11:45:06.000Z | 2021-09-28T14:21:44.000Z | daceml/autodiff/utils.py | Shigangli/daceml | c2133c677d5174763e30cf2d98dcb3fd64059db3 | [
"BSD-3-Clause"
] | 7 | 2020-09-03T13:28:45.000Z | 2021-12-12T02:53:22.000Z | import collections
import typing
import copy
import inspect
import ast
import astunparse
import dace
import dace.sdfg.nodes as nd
import dace.data as dt
from dace.frontend.python.parser import DaceProgram
from daceml.autodiff.base_abc import BackwardContext, BackwardResult
import daceml.util.utils as utils
def for... | 40.937008 | 119 | 0.614637 | import collections
import typing
import copy
import inspect
import ast
import astunparse
import dace
import dace.sdfg.nodes as nd
import dace.data as dt
from dace.frontend.python.parser import DaceProgram
from daceml.autodiff.base_abc import BackwardContext, BackwardResult
import daceml.util.utils as utils
def for... | 1,445 | 17 | 176 |
11b8ebdd1c7b704fd7e62c4aa52c1ebd4b17118e | 885 | py | Python | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | app/db.py | narutox900/GotItOnboardFinal | 32d4c186adb1ac0cb0cd719f4a3aa8d5e85ea07b | [
"MIT"
] | null | null | null | import click
from flask.cli import with_appcontext
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import DateTime
# Force mysql to compile fraction of seconds
@compiles(DateTime, "mysql")
db = SQLAlchemy()
@click.command("init-db")
@with_appcontext
... | 19.23913 | 72 | 0.734463 | import click
from flask.cli import with_appcontext
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.types import DateTime
# Force mysql to compile fraction of seconds
@compiles(DateTime, "mysql")
def compile_datetime_mysql(type_, compiler, **kw):
return "DATETI... | 195 | 0 | 112 |
2d277923a1f07571de22bab838242f14997d5396 | 3,669 | py | Python | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 509 | 2019-11-06T22:08:49.000Z | 2022-03-30T01:06:52.000Z | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 14 | 2018-10-23T10:08:24.000Z | 2022-01-14T02:02:17.000Z | benchmarks/run_benchmark.py | kokizzu/prometeo | ce8aa66a21bec51581cad0a7a0998b0a86581734 | [
"BSD-2-Clause"
] | 22 | 2019-06-12T10:01:13.000Z | 2022-02-27T06:38:21.000Z | import numpy as np
import subprocess
import json
import matplotlib
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.preamble'] = [r'\usepackage{lmodern}']
font = {'family':'serif'}
plt.rc('font',**font)
NM = range(2,150,4)
# NM = range(2,20,2)
NREP_sm... | 30.07377 | 89 | 0.677569 | import numpy as np
import subprocess
import json
import matplotlib
import matplotlib.pyplot as plt
import matplotlib as mpl
plt.rcParams['text.usetex'] = True
plt.rcParams['text.latex.preamble'] = [r'\usepackage{lmodern}']
font = {'family':'serif'}
plt.rc('font',**font)
NM = range(2,150,4)
# NM = range(2,20,2)
NREP_sm... | 0 | 0 | 0 |
56a1896325abf664998601ebfdf9e7d181777606 | 29,130 | py | Python | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 15 | 2018-06-28T01:11:25.000Z | 2021-09-27T15:57:18.000Z | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-29T04:08:23.000Z | 2019-10-17T13:57:22.000Z | psx/_dump_/50/_dump_ida_/overlay_c/set_funcs.py | maoa3/scalpel | 2e7381b516cded28996d290438acc618d00b2aa7 | [
"Unlicense"
] | 7 | 2018-06-28T01:11:34.000Z | 2020-05-23T09:21:48.000Z | del_items(0x8012F26C)
SetType(0x8012F26C, "void GameOnlyTestRoutine__Fv()")
del_items(0x8012F274)
SetType(0x8012F274, "int vecleny__Fii(int a, int b)")
del_items(0x8012F298)
SetType(0x8012F298, "int veclenx__Fii(int a, int b)")
del_items(0x8012F2C4)
SetType(0x8012F2C4, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... | 48.308458 | 195 | 0.789255 | del_items(0x8012F26C)
SetType(0x8012F26C, "void GameOnlyTestRoutine__Fv()")
del_items(0x8012F274)
SetType(0x8012F274, "int vecleny__Fii(int a, int b)")
del_items(0x8012F298)
SetType(0x8012F298, "int veclenx__Fii(int a, int b)")
del_items(0x8012F2C4)
SetType(0x8012F2C4, "void GetDamageAmt__FiPiT1(int i, int *mind, int *... | 0 | 0 | 0 |
53654b6927aa429eb4b1d14084bab5ab43f23388 | 7,762 | py | Python | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | null | null | null | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | 3 | 2020-04-29T20:30:05.000Z | 2020-08-04T22:51:11.000Z | ansible_collections/ctera/ctera/plugins/modules/ctera_portal_plan.py | ctera/ctera-ansible-collections | 0a3a664e271015a3a701349fc4fd1ad7df0acebd | [
"Apache-2.0"
] | 2 | 2020-04-28T17:01:53.000Z | 2021-03-01T19:23:14.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, CTERA Networks Ltd.
# 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',... | 32.613445 | 135 | 0.583355 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, CTERA Networks Ltd.
# 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',... | 4,313 | 640 | 46 |
d207914ecf9eca2833a7d7d4678a7431ddca2809 | 734 | py | Python | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | sensorCalibration.py | cbates8/CompostMonitoringSystem | 765fbf60e3d684c83c8fda6d9f18b5de2b7e03ab | [
"MIT"
] | null | null | null | import adafruit_mcp3xxx.mcp3008 as MCP
from multiprocessing import Process
from moistureSensor import MoistureSensor
moisture_one = MoistureSensor(MCP.P0)
moisture_two = MoistureSensor(MCP.P1)
moisture_three = MoistureSensor(MCP.P3)
# Calibrates the sensors in parallel.
p1 = Process(target=moisture_one.calibrate())
... | 28.230769 | 82 | 0.77248 | import adafruit_mcp3xxx.mcp3008 as MCP
from multiprocessing import Process
from moistureSensor import MoistureSensor
moisture_one = MoistureSensor(MCP.P0)
moisture_two = MoistureSensor(MCP.P1)
moisture_three = MoistureSensor(MCP.P3)
# Calibrates the sensors in parallel.
p1 = Process(target=moisture_one.calibrate())
... | 0 | 0 | 0 |
cfb14c38b8c02167d0a208d3b4653323a9779125 | 1,741 | py | Python | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | 4 | 2017-03-01T21:20:37.000Z | 2018-07-17T08:29:08.000Z | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | 1 | 2017-03-03T12:45:25.000Z | 2017-03-03T12:45:25.000Z | app.py | MostafaBalata/smart-monitor-system | 079b4e1cf2e2639a710e6854b628cb7ee820ab5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from flask import Flask, render_template, Response
# emulated camera
#from camera import Camera
from camera_pi import Camera
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import Camera
from motion_tracker import get_frame
app = Flask(__name__)
@app.route('/')
def ind... | 26.784615 | 81 | 0.63297 | #!/usr/bin/env python
from flask import Flask, render_template, Response
# emulated camera
#from camera import Camera
from camera_pi import Camera
# Raspberry Pi camera module (requires picamera package)
# from camera_pi import Camera
from motion_tracker import get_frame
app = Flask(__name__)
@app.route('/')
def ind... | 636 | 0 | 44 |
861af63dd167216ae5c049d5687c7fa9d4f851f5 | 279 | py | Python | jsub/config/error.py | xianghuzhao/jsub | fda16e9a0983410d33e454d9f1c4a94134e49d41 | [
"MIT"
] | 2 | 2017-05-26T07:17:34.000Z | 2019-04-08T05:53:35.000Z | jsub/config/error.py | xianghuzhao/jsub | fda16e9a0983410d33e454d9f1c4a94134e49d41 | [
"MIT"
] | null | null | null | jsub/config/error.py | xianghuzhao/jsub | fda16e9a0983410d33e454d9f1c4a94134e49d41 | [
"MIT"
] | 1 | 2019-04-08T06:52:46.000Z | 2019-04-08T06:52:46.000Z | from jsub.error import JsubError
| 16.411765 | 44 | 0.784946 | from jsub.error import JsubError
class ConfigError(JsubError):
pass
class SyntaxError(ConfigError):
pass
class UnknownConfigFormatError(ConfigError):
pass
class ConfigFileNotFoundError(ConfigError):
pass
class UnknownUpdateMethodError(ConfigError):
pass
| 0 | 131 | 115 |
855310f6abf608e0738d7e82ba8e8976e6186a5e | 2,487 | py | Python | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 13 | 2021-12-01T03:50:04.000Z | 2022-03-23T14:16:29.000Z | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 7 | 2021-11-30T19:52:21.000Z | 2021-12-20T07:46:00.000Z | src/adventofcode/year_2021/day_05_2021.py | marcelblijleven/adventofcode | 94def5ec340fbb58eaa56e82b54b9495903eb9d9 | [
"MIT"
] | 6 | 2021-11-30T20:15:35.000Z | 2021-12-20T17:14:19.000Z | import re
from collections import defaultdict
from typing import List, DefaultDict, Generator
from adventofcode.util.exceptions import SolutionNotFoundException
from adventofcode.util.helpers import solution_timer
from adventofcode.util.input_helpers import get_input_for_day
Coord = tuple[int, int]
GridType = Default... | 25.377551 | 92 | 0.685967 | import re
from collections import defaultdict
from typing import List, DefaultDict, Generator
from adventofcode.util.exceptions import SolutionNotFoundException
from adventofcode.util.helpers import solution_timer
from adventofcode.util.input_helpers import get_input_for_day
Coord = tuple[int, int]
GridType = Default... | 1,682 | 0 | 205 |
6a75bf2fba99e0f78b96884a2eac1f74834ce13c | 1,162 | py | Python | inferfuzzy/rule.py | leynier/inferfuzzy | bc9dd3a3d0d59f323c5c573423ff7d20ba771eeb | [
"MIT"
] | 3 | 2020-11-23T21:05:31.000Z | 2020-11-25T17:33:27.000Z | inferfuzzy/rule.py | leynier/fuzzpy | bc9dd3a3d0d59f323c5c573423ff7d20ba771eeb | [
"MIT"
] | null | null | null | inferfuzzy/rule.py | leynier/fuzzpy | bc9dd3a3d0d59f323c5c573423ff7d20ba771eeb | [
"MIT"
] | null | null | null | from typing import Any, List
from .base_set import BaseSet
from .base_var import VarSet
from .predicates import Predicate
| 27.023256 | 74 | 0.613597 | from typing import Any, List
from .base_set import BaseSet
from .base_var import VarSet
from .predicates import Predicate
class BaseRule:
def __init__(self, antecedent: Predicate):
self.antecedent = antecedent
def __call__(self, values: dict):
raise NotImplementedError()
def __str__(sel... | 810 | -6 | 233 |
edf651a400730b62f2a934c8bd13d13b520aa848 | 741 | py | Python | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | null | null | null | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | null | null | null | wicked_historian/compat/mysql.py | innovationinit/django-wicked-historian | bef0011639791e2275c6bf2272b57542174b4cf0 | [
"BSD-2-Clause"
] | 1 | 2022-03-15T07:29:58.000Z | 2022-03-15T07:29:58.000Z | import json
from django_mysql.models.fields import JSONField as MySQLJSONField
from wicked_historian.encoder import JSONEncoder
__all__ = (
'JSONField',
)
| 26.464286 | 71 | 0.68691 | import json
from django_mysql.models.fields import JSONField as MySQLJSONField
from wicked_historian.encoder import JSONEncoder
__all__ = (
'JSONField',
)
class JSONField(MySQLJSONField):
def __init__(self, *args, **kwargs):
self.encoder = kwargs.pop('encoder', JSONEncoder)
super().__init_... | 463 | 11 | 104 |
5827ec9f745130abc2c1eddb42effc2086db230d | 6,023 | py | Python | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | 4 | 2021-12-20T12:52:02.000Z | 2021-12-29T09:34:42.000Z | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | null | null | null | others/old/Dataset.py | YuRui8879/CPSC2021_python | bfa4c565ec3113528e73b064041082863cd228b4 | [
"MIT"
] | 1 | 2021-11-20T12:20:55.000Z | 2021-11-20T12:20:55.000Z | import numpy as np
import random
if __name__ == '__main__':
X = np.empty((10,5))
Y = np.linspace(0,9,10)
d = AssembleDataset(X,Y,5,seed = 0)
a,b = d.get_fold_data()
print(a,b)
a,b = d.get_res_data()
print(a,b)
| 32.556757 | 65 | 0.470032 | import numpy as np
import random
class Dataset:
def __init__(self,X,Y,fold):
self.idx = 0
self.fold = fold
self.X = np.array(X)
self.Y = np.array(Y)
if self.X.shape[0] != self.Y.shape[0]:
raise Exception('数据与标签维度不一致')
self.length = self.Y.shape[0]
... | 5,648 | -6 | 405 |
d227c6b7d42bf9b54733a1338de7b87c5ae514d8 | 6,236 | py | Python | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 2 | 2020-09-05T07:17:08.000Z | 2021-05-02T21:10:28.000Z | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 4 | 2020-11-13T18:58:27.000Z | 2022-02-10T01:58:38.000Z | open_spiel/python/algorithms/action_value_vs_best_response.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:52:48.000Z | 2020-06-02T17:52:48.000Z | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 38.732919 | 100 | 0.712155 | # Copyright 2019 DeepMind Technologies Ltd. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 746 | 0 | 75 |
0080f062d8e05c5c6a29ce1eb5063d5916a0df3c | 1,427 | py | Python | fline/losses/research/component.py | asromahin/fline | a34243878093b3b883607557eeaf968ef4b8acf6 | [
"MIT"
] | 5 | 2021-07-01T08:19:51.000Z | 2022-03-28T06:09:55.000Z | fline/losses/research/component.py | asromahin/fline | a34243878093b3b883607557eeaf968ef4b8acf6 | [
"MIT"
] | 1 | 2022-03-21T02:42:44.000Z | 2022-03-28T06:10:57.000Z | fline/losses/research/component.py | asromahin/fline | a34243878093b3b883607557eeaf968ef4b8acf6 | [
"MIT"
] | null | null | null | import torch
from fline.losses.segmentation.dice import BCEDiceLoss
| 32.431818 | 101 | 0.531885 | import torch
from fline.losses.segmentation.dice import BCEDiceLoss
class ConnectLoss(torch.nn.Module):
def __init__(self, device):
super(ConnectLoss, self).__init__()
self.loss = BCEDiceLoss(activation=None)
self.device = device
def forward(
self,
pred_insta... | 1,266 | 14 | 77 |
60f7add424ef1c9769b7a21c44abf24d17df3775 | 217 | py | Python | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 5 | 2021-05-07T08:56:46.000Z | 2022-02-08T20:58:56.000Z | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 1 | 2021-05-14T09:11:51.000Z | 2021-05-14T09:11:51.000Z | 10-Tecnologie_Web-Introduzione_a_Python/esempio06.py | matteocerullo/TW6 | 0219418576960ff8163fbe90f866c15f1fb1ad27 | [
"CC0-1.0"
] | 64 | 2021-05-07T08:53:30.000Z | 2022-02-10T17:02:41.000Z | # Cycles - For
import random
n = 10000
m = 0
l = 1000
for i in range(n):
count = 0
x = -1
while x != l:
x = random.randint(1, l)
count=count+1
m=m+count
print("Done! average:", m/n) | 12.764706 | 32 | 0.520737 | # Cycles - For
import random
n = 10000
m = 0
l = 1000
for i in range(n):
count = 0
x = -1
while x != l:
x = random.randint(1, l)
count=count+1
m=m+count
print("Done! average:", m/n) | 0 | 0 | 0 |
35b7aa855385ade468b728b5ddd2f4f8a05dd422 | 1,961 | py | Python | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | autoremovetorrents/torrent.py | drawwon/autoremove-torrents | 730fe989a6ffd53213b15e4f39b1c95f256e0a52 | [
"MIT"
] | null | null | null | #-*- coding:utf-8 -*-
import sys
import time
from .torrentstatus import TorrentStatus | 31.126984 | 109 | 0.54819 | #-*- coding:utf-8 -*-
import sys
import time
from .torrentstatus import TorrentStatus
class Torrent(object):
def __init__(self, hash_value, name, category, tracker, status, stalled, size, ratio,
uploaded, create_time, seeding_time):
# Save Properties
self.hash = hash_value
self.na... | 1,562 | 289 | 23 |
90459e756ccbe912bed5ca83e56c654291f93de6 | 4,873 | py | Python | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | 5 | 2018-03-09T13:51:11.000Z | 2021-12-17T02:05:59.000Z | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null | Lang/Python/py_base/data_structure/graph/graph.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null |
from pydotplus import Dot, Node, Edge
import os
# 该图配置
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def find_path(graph, start, end, path=[]):
"""
在图graph中找路径:
从顶点start到顶点end
走... | 26.922652 | 70 | 0.533963 |
from pydotplus import Dot, Node, Edge
import os
# 该图配置
graph = {'A': ['B', 'C', 'F'],
'B': ['C', 'D'],
'C': ['D'],
'D': ['C'],
'E': ['F', 'D'],
'F': ['C']
}
def dotgraph(graph):
__graph = Dot(rankdir='TB', fontname="Fangsong",
fontcolor='bl... | 3,697 | 0 | 115 |
8790f34d0d7e3a06ae4b661ea64a167a9284b21f | 521 | py | Python | app/config_template.py | larrylx/email-bot | 0689ddb3a63dc0faa7d97a2aa2b72d9a428157da | [
"MIT"
] | null | null | null | app/config_template.py | larrylx/email-bot | 0689ddb3a63dc0faa7d97a2aa2b72d9a428157da | [
"MIT"
] | null | null | null | app/config_template.py | larrylx/email-bot | 0689ddb3a63dc0faa7d97a2aa2b72d9a428157da | [
"MIT"
] | null | null | null | # Auth
ALLOW_HOST = []
# Bot Address
SEND_AS = ""
# Google
GOOGLE_WORKSPACE_USER = ""
GOOGLE_WORKSPACE_SERVICE_ACCOUNT_CREDENTIALS = '''{
"type": "service_account",
"project_id": "",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "https://accounts... | 24.809524 | 80 | 0.646833 | # Auth
ALLOW_HOST = []
# Bot Address
SEND_AS = ""
# Google
GOOGLE_WORKSPACE_USER = ""
GOOGLE_WORKSPACE_SERVICE_ACCOUNT_CREDENTIALS = '''{
"type": "service_account",
"project_id": "",
"private_key_id": "",
"private_key": "",
"client_email": "",
"client_id": "",
"auth_uri": "https://accounts... | 0 | 0 | 0 |
604d2c58889a799deb5a51136f866fdb18afcd8e | 756 | py | Python | pylearn2/datasets/tests/test_adult.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 2,045 | 2015-01-01T14:07:52.000Z | 2022-03-08T08:56:41.000Z | pylearn2/datasets/tests/test_adult.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 305 | 2015-01-02T13:18:24.000Z | 2021-08-20T18:03:28.000Z | pylearn2/datasets/tests/test_adult.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 976 | 2015-01-01T17:08:51.000Z | 2022-03-25T19:53:17.000Z | """
Test code for adult.py
=======
Testing class that simply checks to see if the adult dataset
is loadable
"""
import numpy
from pylearn2.datasets.adult import adult
from pylearn2.testing.skip import skip_if_no_data
def test_adult():
"""
Tests if it will work correctly for train and test set.
"""
ski... | 27 | 60 | 0.678571 | """
Test code for adult.py
=======
Testing class that simply checks to see if the adult dataset
is loadable
"""
import numpy
from pylearn2.datasets.adult import adult
from pylearn2.testing.skip import skip_if_no_data
def test_adult():
"""
Tests if it will work correctly for train and test set.
"""
ski... | 0 | 0 | 0 |
101e781d3dec1f78602616edae26f232874b490e | 1,789 | py | Python | multichoice/forms.py | Palombredun/django_quiz | 1565d251d54dfb54fdee83096b560876833275a2 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | multichoice/forms.py | Palombredun/django_quiz | 1565d251d54dfb54fdee83096b560876833275a2 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | multichoice/forms.py | Palombredun/django_quiz | 1565d251d54dfb54fdee83096b560876833275a2 | [
"Unlicense",
"MIT-0",
"MIT"
] | null | null | null | from django import forms
from multichoice.models import MCQuestion
from quiz.forms import QuestionForm
class CreationMultiChoiceForm(QuestionForm):
"""
Form dedicated to the creation of a MultiChoice Question.
It inherits from QuestionForm and adds the fields
answerN and and answerN_correct.
"""... | 35.78 | 86 | 0.65735 | from django import forms
from multichoice.models import MCQuestion
from quiz.forms import QuestionForm
class CreationMultiChoiceForm(QuestionForm):
"""
Form dedicated to the creation of a MultiChoice Question.
It inherits from QuestionForm and adds the fields
answerN and and answerN_correct.
"""... | 0 | 344 | 27 |
58251a14d5f0a885f6169a7ae42e78076d256e6f | 401 | py | Python | tests/cases/fib_with_argparse.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 2 | 2022-02-02T11:37:53.000Z | 2022-03-30T18:19:06.000Z | tests/cases/fib_with_argparse.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | 25 | 2022-02-28T21:19:11.000Z | 2022-03-23T21:26:20.000Z | tests/cases/fib_with_argparse.py | MiguelMarcelino/py2many | 9b040b2a157e265df9c053eaf3e5cd644d3e30d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from argparse_dataclass import dataclass
@dataclass
if __name__ == "__main__":
args = Options.parse_args()
if args.v:
print("args.v is true")
if args.n == 0:
args.n = 5
print(fib(args.n))
| 16.04 | 40 | 0.553616 | #!/usr/bin/env python3
from argparse_dataclass import dataclass
@dataclass
class Options:
v: bool = False
n: int = 0
def fib(i: int) -> int:
if i == 0 or i == 1:
return 1
return fib(i - 1) + fib(i - 2)
if __name__ == "__main__":
args = Options.parse_args()
if args.v:
print... | 79 | 28 | 45 |
396d1311738d5c4198813a6e64e8cda6bf7c0a43 | 3,821 | py | Python | src/util.py | Fluxticks/BountyOptimiser | 5ce96dd58045d540536ad4c31fd1b454461bd9f1 | [
"MIT"
] | null | null | null | src/util.py | Fluxticks/BountyOptimiser | 5ce96dd58045d540536ad4c31fd1b454461bd9f1 | [
"MIT"
] | null | null | null | src/util.py | Fluxticks/BountyOptimiser | 5ce96dd58045d540536ad4c31fd1b454461bd9f1 | [
"MIT"
] | null | null | null | import logging
import colorlog
from coloured_log import ColoredFormatter
DEBUG_TRACE_NUM = 9
logging.Logger.trace = trace
logging.addLevelName(9, 'TRACE')
class bcolours:
"""The ANSI colour codes
"""
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m... | 35.055046 | 114 | 0.61921 | import logging
import colorlog
from coloured_log import ColoredFormatter
DEBUG_TRACE_NUM = 9
def trace(self, message, *args, **kws):
if self.isEnabledFor(DEBUG_TRACE_NUM):
self._log(DEBUG_TRACE_NUM, message, args, **kws)
logging.Logger.trace = trace
logging.addLevelName(9, 'TRACE')
def makeLogg... | 1,899 | 0 | 98 |
28702ad204922dd46aac6611c5b25848b5b1b25c | 5,505 | py | Python | src/train.py | jf20541/DNNHyperparameterTuning | ba741c8eaaa4b814407ebb063bddde9f7a51bcbd | [
"MIT"
] | 1 | 2021-08-17T02:01:19.000Z | 2021-08-17T02:01:19.000Z | src/train.py | jf20541/DNNHyperparameterTuning | ba741c8eaaa4b814407ebb063bddde9f7a51bcbd | [
"MIT"
] | null | null | null | src/train.py | jf20541/DNNHyperparameterTuning | ba741c8eaaa4b814407ebb063bddde9f7a51bcbd | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import torch
import optuna
from dataset import HotelDataSet
from model import DeepNeuralNetwork
import config
from engine import Engine
from sklearn.metrics import roc_auc_score
import torch.optim as optim
def train(fold, params, save_model=False):
"""Finding the optimal DNN... | 36.456954 | 115 | 0.662125 | import pandas as pd
import numpy as np
import torch
import optuna
from dataset import HotelDataSet
from model import DeepNeuralNetwork
import config
from engine import Engine
from sklearn.metrics import roc_auc_score
import torch.optim as optim
def train(fold, params, save_model=False):
"""Finding the optimal DNN... | 0 | 0 | 0 |
3d27ae549e9ad48016af98290dc2ad7096ed0215 | 9,638 | py | Python | src/serverattack_main.py | Ilcyb/Federated-Learning-PyTorch | 4830a89ffa1ac0ad0e52a4551338532cfb4ca210 | [
"MIT"
] | 1 | 2021-04-28T03:34:01.000Z | 2021-04-28T03:34:01.000Z | src/serverattack_main.py | Ilcyb/Federated-Learning-PyTorch | 4830a89ffa1ac0ad0e52a4551338532cfb4ca210 | [
"MIT"
] | null | null | null | src/serverattack_main.py | Ilcyb/Federated-Learning-PyTorch | 4830a89ffa1ac0ad0e52a4551338532cfb4ca210 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import os
import copy
import time
import pickle
import numpy as np
from tqdm import tqdm
import torch
from tensorboardX import SummaryWriter
import torchvision.utils as vutils
from options import args_parser
from update import LocalUpdate, test_inf... | 44.62037 | 206 | 0.618489 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python version: 3.6
import os
import copy
import time
import pickle
import numpy as np
from tqdm import tqdm
import torch
from tensorboardX import SummaryWriter
import torchvision.utils as vutils
from options import args_parser
from update import LocalUpdate, test_inf... | 0 | 0 | 0 |
93c0cc9337e79fdca67a9b20fc3b1dcffb643e0e | 1,327 | py | Python | ODEs/RK_methods.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | null | null | null | ODEs/RK_methods.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | 1 | 2020-10-06T13:29:01.000Z | 2020-10-06T13:29:01.000Z | ODEs/RK_methods.py | Zettergren-Courses/EP501_python | dabaa584e5158eb35197a43f38920a9ed7cc02b8 | [
"MIT"
] | 6 | 2020-09-01T10:35:59.000Z | 2020-09-18T10:12:59.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 07:23:35 2020
Illustrate the use of Runge-Kutta methods to solve ODEs
@author: zettergm
"""
# Imports
import numpy as np
import matplotlib.pyplot as plt
# RHS of ODE for use with RK4
# Time grid
N=15
tmin=0
tmax=6
t=np.linspace(tmin,tmax,n... | 17.012821 | 55 | 0.635268 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 19 07:23:35 2020
Illustrate the use of Runge-Kutta methods to solve ODEs
@author: zettergm
"""
# Imports
import numpy as np
import matplotlib.pyplot as plt
# RHS of ODE for use with RK4
def fRK(t,y,alpha):
fval=-alpha*y
return fval
# ... | 32 | 0 | 22 |
fc148f3dfeed66f22fc7a3ed41f21e0da706a57c | 1,267 | py | Python | album_recommender/rec_system/migrations/0001_initial.py | LevUdaltsov/album_recommender | 86d5f225bab0f8f4d65fd8184abadafb6654155f | [
"MIT"
] | 1 | 2020-11-22T20:00:27.000Z | 2020-11-22T20:00:27.000Z | album_recommender/rec_system/migrations/0001_initial.py | LevUdaltsov/album_recommender | 86d5f225bab0f8f4d65fd8184abadafb6654155f | [
"MIT"
] | null | null | null | album_recommender/rec_system/migrations/0001_initial.py | LevUdaltsov/album_recommender | 86d5f225bab0f8f4d65fd8184abadafb6654155f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-04 19:12
from django.db import migrations, models
| 36.2 | 114 | 0.573007 | # Generated by Django 3.1.2 on 2020-11-04 19:12
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Album',
fields=[
('id', models.AutoField(au... | 0 | 1,153 | 23 |