hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 248 | max_issues_repo_name stringlengths 5 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 248 | max_forks_repo_name stringlengths 5 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 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ffe17de7805da9bfb7ad7d54bb9a08115c66b6e | 149 | py | Python | commonutils/__init__.py | lrbsunday/commonutils | 6a4f2106e877417eebc8b8c6a9c1610505bd21e3 | [
"BSD-3-Clause"
] | 1 | 2017-09-10T13:13:04.000Z | 2017-09-10T13:13:04.000Z | commonutils/__init__.py | lrbsunday/commonutils | 6a4f2106e877417eebc8b8c6a9c1610505bd21e3 | [
"BSD-3-Clause"
] | 2 | 2021-03-25T21:45:54.000Z | 2021-11-15T17:47:06.000Z | commonutils/__init__.py | lrbsunday/commonutils | 6a4f2106e877417eebc8b8c6a9c1610505bd21e3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for commonutils."""
__author__ = """lrbsunday"""
__email__ = '272316131@qq.com'
__version__ = '0.1.0'
| 18.625 | 40 | 0.637584 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 103 | 0.691275 |
9ffe6ea421da07a4d91197e1ea46c83dd156f66f | 826 | py | Python | app/components/admin.py | Uniquode/uniquode2 | 385f3e0b26383c042d8da64b52350e82414580ea | [
"MIT"
] | null | null | null | app/components/admin.py | Uniquode/uniquode2 | 385f3e0b26383c042d8da64b52350e82414580ea | [
"MIT"
] | null | null | null | app/components/admin.py | Uniquode/uniquode2 | 385f3e0b26383c042d8da64b52350e82414580ea | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.utils.timesince import timesince
class CreatedByAdminMixin:
def save_model(self, request, obj, form, change):
if getattr(obj, 'created_by', None) is None:
obj.created_by = request.user
# noinspection PyUnresolvedReferences
super().save_model... | 25.8125 | 69 | 0.690073 | 713 | 0.863196 | 0 | 0 | 0 | 0 | 0 | 0 | 153 | 0.18523 |
9fff12642cb00ff3e2ce7ae890c3d2b10cbbe1d1 | 8,936 | py | Python | src/WignerFunctionMeasurement.py | ngchihuan/WignerFunc_Measurement | 9c258180da4c1a1ff87b384f0aaf85dc0f92d667 | [
"MIT"
] | null | null | null | src/WignerFunctionMeasurement.py | ngchihuan/WignerFunc_Measurement | 9c258180da4c1a1ff87b384f0aaf85dc0f92d667 | [
"MIT"
] | null | null | null | src/WignerFunctionMeasurement.py | ngchihuan/WignerFunc_Measurement | 9c258180da4c1a1ff87b384f0aaf85dc0f92d667 | [
"MIT"
] | null | null | null | import os
from os.path import join, isfile
from shutil import Error
from sys import exec_prefix
import numpy as np
import fit
import simple_read_data
from tabulate import tabulate
import logging
np.seterr(all='raise')
class DataFormatError(Exception):
pass
class WrongPathFormat(Exception):
pass
def check_dat... | 31.575972 | 173 | 0.57218 | 7,339 | 0.821285 | 0 | 0 | 0 | 0 | 0 | 0 | 1,906 | 0.213295 |
b000e8e09627008c8e1b4d9bdfd0f7e449d23a7e | 1,729 | py | Python | falmer/content/models/scheme.py | sussexstudent/services-api | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 2 | 2017-04-27T19:35:59.000Z | 2017-06-13T16:19:33.000Z | falmer/content/models/scheme.py | sussexstudent/falmer | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 975 | 2017-04-13T11:31:07.000Z | 2022-02-10T07:46:18.000Z | falmer/content/models/scheme.py | sussexstudent/services-api | ae735bd9d6177002c3d986e5c19a78102233308f | [
"MIT"
] | 3 | 2018-05-09T06:42:25.000Z | 2020-12-10T18:29:30.000Z | from django.db import models
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel, MultiFieldPanel
from wagtail.core.blocks import StreamBlock
from wagtail.core.fields import StreamField
from wagtail.images.edit_handlers import ImageChooserPanel
from falmer.content import components
from falmer.content.... | 27.887097 | 97 | 0.685367 | 1,237 | 0.715442 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 0.126663 |
b0017ce65ff4bed42aaeae9f18c1a86d9bbd1f1d | 1,089 | py | Python | scripts/main_validation.py | platycristate/ptah | 15369382fc48860cc5bcd6a201a8b250ae8cb516 | [
"MIT"
] | null | null | null | scripts/main_validation.py | platycristate/ptah | 15369382fc48860cc5bcd6a201a8b250ae8cb516 | [
"MIT"
] | 1 | 2021-06-11T12:01:33.000Z | 2021-06-11T12:01:33.000Z | scripts/main_validation.py | platycristate/ptah | 15369382fc48860cc5bcd6a201a8b250ae8cb516 | [
"MIT"
] | 1 | 2021-06-11T11:57:06.000Z | 2021-06-11T11:57:06.000Z | import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import re
import spacy
from time import time
import pickle
from collections import defaultdict
import pmi_tfidf_classifier as ptic
path = "../data/"
pd.set_option("display.max_rows", None, "display.max_columns", None)
np.random.seed(250)
spacy.pre... | 25.325581 | 87 | 0.769513 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 201 | 0.184573 |
b00272462aa831ed8359bfb1b05ac3991b3aef99 | 956 | py | Python | src/marion/marion/tests/test_fields.py | openfun/marion | bf06b64bf78bca16685e62ff14b66897c1dbe80c | [
"MIT"
] | 7 | 2021-04-06T20:33:31.000Z | 2021-09-30T23:29:24.000Z | src/marion/marion/tests/test_fields.py | openfun/marion | bf06b64bf78bca16685e62ff14b66897c1dbe80c | [
"MIT"
] | 23 | 2020-09-09T15:01:50.000Z | 2022-01-03T08:58:36.000Z | src/marion/marion/tests/test_fields.py | openfun/marion | bf06b64bf78bca16685e62ff14b66897c1dbe80c | [
"MIT"
] | 2 | 2020-12-14T10:07:07.000Z | 2021-06-29T00:20:43.000Z | """Tests for the marion application fields"""
from marion.defaults import DocumentIssuerChoices
from ..fields import IssuerLazyChoiceField, LazyChoiceField
def test_fields_lazy_choice_field():
"""
LazyChoiceField class.
Choices instance attribute should not be customizable.
"""
field = LazyChoic... | 26.555556 | 70 | 0.712343 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 379 | 0.396444 |
b00495771d6a310aa5e5d77c1c05c91690f9a756 | 2,331 | py | Python | ObjectTrackingDrone/colorpickerusingTello.py | udayagopi587/ArealRobotics_AutonomousDrone | 6bc10ee167076086abb3b2eef311ae43f457f21d | [
"MIT"
] | 1 | 2022-03-12T00:47:24.000Z | 2022-03-12T00:47:24.000Z | ObjectTrackingDrone/colorpickerusingTello.py | udayagopi587/ArealRobotics_AutonomousDrone | 6bc10ee167076086abb3b2eef311ae43f457f21d | [
"MIT"
] | null | null | null | ObjectTrackingDrone/colorpickerusingTello.py | udayagopi587/ArealRobotics_AutonomousDrone | 6bc10ee167076086abb3b2eef311ae43f457f21d | [
"MIT"
] | 1 | 2022-03-14T23:42:57.000Z | 2022-03-14T23:42:57.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 3 12:15:40 2022
@author: udaya
"""
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 27 18:06:29 2022
@author: udaya
"""
import cv2
import numpy as np
from djitellopy import Tello
frameWidth = 640
frameHeight = 480
###############################
... | 26.793103 | 81 | 0.632347 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 586 | 0.251394 |
b0050cae1ff0c2350a07478cbaf2f32a1d466c54 | 16,101 | py | Python | climetlab_plugin_tools/create_plugin_cmd.py | ecmwf-lab/climetlab-plugin-tools | 52fc1c6c07958ecfb8a5c946f4851725832b3cd0 | [
"Apache-2.0"
] | null | null | null | climetlab_plugin_tools/create_plugin_cmd.py | ecmwf-lab/climetlab-plugin-tools | 52fc1c6c07958ecfb8a5c946f4851725832b3cd0 | [
"Apache-2.0"
] | null | null | null | climetlab_plugin_tools/create_plugin_cmd.py | ecmwf-lab/climetlab-plugin-tools | 52fc1c6c07958ecfb8a5c946f4851725832b3cd0 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2020 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmenta... | 33.266529 | 143 | 0.629464 | 14,422 | 0.895721 | 0 | 0 | 786 | 0.048817 | 0 | 0 | 6,537 | 0.406 |
b0074893c2e7005340588db291b50134738031f4 | 3,044 | py | Python | openclean/util/core.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 4 | 2021-04-20T09:06:26.000Z | 2021-11-20T20:31:28.000Z | openclean/util/core.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 14 | 2021-01-19T19:23:16.000Z | 2021-04-28T14:31:03.000Z | openclean/util/core.py | remram44/openclean-core | 8c09c8302cadbb3bb02c959907f91a3ae343f939 | [
"BSD-3-Clause"
] | 5 | 2021-08-24T11:57:21.000Z | 2022-03-17T04:39:04.000Z | # This file is part of the Data Cleaning Library (openclean).
#
# Copyright (C) 2018-2021 New York University.
#
# openclean is released under the Revised BSD License. See file LICENSE for
# full license details.
"""Collection of helper functions for various purpoeses."""
from typing import Optional
import uuid
de... | 23.415385 | 79 | 0.617608 | 1,163 | 0.382063 | 0 | 0 | 0 | 0 | 0 | 0 | 2,187 | 0.718463 |
b0091d1b6caace04c666bba350b86f62370a21bc | 78 | py | Python | desafio1.py | sergioboff/Desafios-Curso-em-Video | f876396635b12c00bdd9523758364bbebfd70ae0 | [
"MIT"
] | null | null | null | desafio1.py | sergioboff/Desafios-Curso-em-Video | f876396635b12c00bdd9523758364bbebfd70ae0 | [
"MIT"
] | null | null | null | desafio1.py | sergioboff/Desafios-Curso-em-Video | f876396635b12c00bdd9523758364bbebfd70ae0 | [
"MIT"
] | null | null | null | nome= input('Qual seu nome ?: ')
print ('Olá {} Seja bem vindo'.format(nome))
| 26 | 44 | 0.641026 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 0.544304 |
b00943e9be2f2f8a05e1b1e0bcce1f1c5bb49902 | 68 | py | Python | exquiro/parsers/openponk/__init__.py | xhusar2/conceptual_model_parser | 63eea4ab8b967a6d2ee612ffb4a06b93e97d0043 | [
"MIT"
] | null | null | null | exquiro/parsers/openponk/__init__.py | xhusar2/conceptual_model_parser | 63eea4ab8b967a6d2ee612ffb4a06b93e97d0043 | [
"MIT"
] | null | null | null | exquiro/parsers/openponk/__init__.py | xhusar2/conceptual_model_parser | 63eea4ab8b967a6d2ee612ffb4a06b93e97d0043 | [
"MIT"
] | null | null | null | from .openpondk_class_diagram_parser import OpenponkClsDiagramParser | 68 | 68 | 0.941176 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b00a0ae9f8f71c5f857d2683a8d63e315db4a5e2 | 254 | py | Python | fastNLP/modules/encoder/__init__.py | awesome-archive/fastNLP | 767e7971e542783c0129ed88b7d871db775e653e | [
"Apache-2.0"
] | 4 | 2019-01-19T13:58:10.000Z | 2019-01-19T15:07:48.000Z | fastNLP/modules/encoder/__init__.py | TTTREE/fastNLP | ef82c1f10000752db32a5fa323668b94bcb940a1 | [
"Apache-2.0"
] | 1 | 2018-09-30T13:30:51.000Z | 2018-09-30T13:30:51.000Z | fastNLP/modules/encoder/__init__.py | TTTREE/fastNLP | ef82c1f10000752db32a5fa323668b94bcb940a1 | [
"Apache-2.0"
] | null | null | null | from .conv import Conv
from .conv_maxpool import ConvMaxpool
from .embedding import Embedding
from .linear import Linear
from .lstm import LSTM
__all__ = ["LSTM",
"Embedding",
"Linear",
"Conv",
"ConvMaxpool"]
| 21.166667 | 37 | 0.629921 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.173228 |
b00bb16d432ae4e7eebbd1a8f438f11ad4838ec1 | 1,141 | py | Python | openCVTutorials/openCVimgChangeColorspaceTutorial.py | nahutch/BasketballAI_P1 | 9a44f80787231df386910c28f17bab465fee013d | [
"Apache-2.0"
] | 1 | 2019-01-24T19:07:08.000Z | 2019-01-24T19:07:08.000Z | openCVTutorials/openCVimgChangeColorspaceTutorial.py | nahutch/BasketballAI_P1 | 9a44f80787231df386910c28f17bab465fee013d | [
"Apache-2.0"
] | null | null | null | openCVTutorials/openCVimgChangeColorspaceTutorial.py | nahutch/BasketballAI_P1 | 9a44f80787231df386910c28f17bab465fee013d | [
"Apache-2.0"
] | null | null | null | #following tutorial: https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.html#converting-colorspaces
import numpy as np
import cv2
#there are more than 150 color-space conversions methods available in OpenCV
#why so many?
#gets all possible color space conver... | 26.534884 | 158 | 0.718668 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 500 | 0.438212 |
b00c4cc641fafb1dc25683af3562c4fd4137c48c | 1,724 | py | Python | sdcflows/utils/misc.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 16 | 2020-02-25T17:47:10.000Z | 2022-03-07T02:54:51.000Z | sdcflows/utils/misc.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 175 | 2020-02-15T00:52:28.000Z | 2022-03-29T21:42:31.000Z | sdcflows/utils/misc.py | madisoth/sdcflows | c2f01e4f9b19dbd89ac1b54e3cfb0643fc3fd4f2 | [
"Apache-2.0"
] | 12 | 2019-05-28T23:34:37.000Z | 2020-01-22T21:32:22.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2021 The NiPreps Developers <nipreps@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may... | 24.628571 | 77 | 0.657773 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,311 | 0.760441 |
b00d6bcbdc91daedbc8ff5cedd805b13268a4bca | 7,026 | py | Python | src/model1_predict.py | shubhampachori12110095/FashionAI-Clothing-Attribute-Labels-Classification | 04fb40948fcae55c379d8e878c41f281948155e8 | [
"Apache-2.0"
] | 2 | 2018-12-29T09:10:18.000Z | 2020-08-07T03:42:38.000Z | src/model1_predict.py | shubhampachori12110095/FashionAI-Clothing-Attribute-Labels-Classification | 04fb40948fcae55c379d8e878c41f281948155e8 | [
"Apache-2.0"
] | null | null | null | src/model1_predict.py | shubhampachori12110095/FashionAI-Clothing-Attribute-Labels-Classification | 04fb40948fcae55c379d8e878c41f281948155e8 | [
"Apache-2.0"
] | 3 | 2018-12-29T09:10:21.000Z | 2021-05-23T06:30:35.000Z | # -*- coding: UTF-8 -*-
import os
import numpy as np
import pandas as pd
from tqdm import tqdm
import json
import cv2
from sklearn.model_selection import train_test_split
import matplotlib
from keras.utils import np_utils
from keras.optimizers import *
from keras.preprocessing.image import ImageDataGenerator
from f... | 39.033333 | 117 | 0.646883 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,722 | 0.24509 |
b00f67fa0503dd85f3c8d37c378d2f72c7f066bd | 700 | py | Python | venv/lib/python3.6/site-packages/phonenumbers/shortdata/region_QA.py | exdeam/opencrm | dfdcfdf99f0b42eb3959171927cb6574583f5ee0 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/phonenumbers/shortdata/region_QA.py | exdeam/opencrm | dfdcfdf99f0b42eb3959171927cb6574583f5ee0 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/phonenumbers/shortdata/region_QA.py | exdeam/opencrm | dfdcfdf99f0b42eb3959171927cb6574583f5ee0 | [
"MIT"
] | 1 | 2020-09-08T14:45:34.000Z | 2020-09-08T14:45:34.000Z | """Auto-generated file, do not edit by hand. QA metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_QA = PhoneMetadata(id='QA', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[129]\\d{2,4}', possible_length=(3, 4, ... | 70 | 141 | 0.754286 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 138 | 0.197143 |
b00f7bd4e39ef2e25f158e39f9604eb34518aa71 | 815 | py | Python | test_parametrized_tests.py | karianjahi/python_pytest_tutorial | d8cf7bc9d85e75cc3248a35d8abdfd24d76276cd | [
"MIT"
] | null | null | null | test_parametrized_tests.py | karianjahi/python_pytest_tutorial | d8cf7bc9d85e75cc3248a35d8abdfd24d76276cd | [
"MIT"
] | null | null | null | test_parametrized_tests.py | karianjahi/python_pytest_tutorial | d8cf7bc9d85e75cc3248a35d8abdfd24d76276cd | [
"MIT"
] | null | null | null | """
Organizing test and parametrizing
"""
# Parametrized tests: Run many tests in one
# pylint: disable=W0622
# pylint: disable=R0201
# pylint: disable=R0903
import pytest
from word_counter import count_words
class TestWordCounterParametrization:
"""
In this case we want to test many tests in one function
"... | 27.166667 | 59 | 0.586503 | 606 | 0.742647 | 0 | 0 | 189 | 0.231618 | 0 | 0 | 437 | 0.535539 |
b0110b071338ec4840e5427dcade83815657e854 | 1,685 | py | Python | src/dep_appearances/cli.py | jdlubrano/dep-appearances | bf752b469463ee8cb7351df37231d250be3bcf47 | [
"MIT"
] | null | null | null | src/dep_appearances/cli.py | jdlubrano/dep-appearances | bf752b469463ee8cb7351df37231d250be3bcf47 | [
"MIT"
] | null | null | null | src/dep_appearances/cli.py | jdlubrano/dep-appearances | bf752b469463ee8cb7351df37231d250be3bcf47 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
import os
import pdb
import sys
from dep_appearances.appearances_report import AppearancesReport
def main():
parser = ArgumentParser(description='Find dependencies that are unused and underused in your codebase.')
parser.add_argument(
'project_root',
metava... | 30.089286 | 108 | 0.668249 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 569 | 0.337685 |
b01166da273e45dbd1d37d892c58fe4b13c2a3e7 | 250 | py | Python | kernel/filters.py | pycodi/django-kernel | 87829a0d47d04a3bb3d5c7cb79a03f0772dfdf46 | [
"MIT"
] | 1 | 2016-09-16T11:40:45.000Z | 2016-09-16T11:40:45.000Z | kernel/filters.py | pycodi/django-kernel | 87829a0d47d04a3bb3d5c7cb79a03f0772dfdf46 | [
"MIT"
] | null | null | null | kernel/filters.py | pycodi/django-kernel | 87829a0d47d04a3bb3d5c7cb79a03f0772dfdf46 | [
"MIT"
] | null | null | null | from django_filters import Filter
from django_filters.fields import Lookup
class ListFilter(Filter):
def filter(self, qs, value):
value_list = value.split(u',')
return super(ListFilter, self).filter(qs, Lookup(value_list, 'in')) | 31.25 | 75 | 0.716 | 173 | 0.692 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.032 |
b0120808c75c26295ac6097ea109b68947111348 | 323 | py | Python | tests/expr/expr08.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/expr/expr08.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/expr/expr08.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z | from polyphony import testbench
def expr08(a, b, c):
return a < b < c
@testbench
def test():
assert False == expr08(0, 0, 0)
assert True == expr08(0, 1, 2)
assert False == expr08(1, 0, 2)
assert False == expr08(2, 1, 0)
assert True == expr08(-1, 0, 1)
assert True == expr08(-2, -1, 0)
test... | 21.533333 | 36 | 0.575851 | 0 | 0 | 0 | 0 | 239 | 0.739938 | 0 | 0 | 0 | 0 |
b0134690af47b5e16baf709ce4dca459913ce34e | 1,175 | py | Python | pyfirmata_tmp36_MQ7_Mysql.py | amy861113/Arduino | 7592c2029242fca24245ee1c34b2b9f6043070d1 | [
"MIT"
] | null | null | null | pyfirmata_tmp36_MQ7_Mysql.py | amy861113/Arduino | 7592c2029242fca24245ee1c34b2b9f6043070d1 | [
"MIT"
] | null | null | null | pyfirmata_tmp36_MQ7_Mysql.py | amy861113/Arduino | 7592c2029242fca24245ee1c34b2b9f6043070d1 | [
"MIT"
] | null | null | null | from pyfirmata import Arduino, util
from time import sleep
import pymysql
def arduino_map(x, in_min, in_max, out_min, out_max):
return(x-in_min) * (out_max-out_min) / (in_max-in_min) + out_min
PORT = "COM4"
uno = Arduino(PORT)
sleep(5)
it = util.Iterator(uno)
it.start()
a4 = uno.get_pin('a:4:i')
a5 = uno.get_p... | 23.5 | 124 | 0.612766 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 264 | 0.224681 |
b01440159aa9a67d2eac6230f37afcedb41016ba | 303 | py | Python | app/views.py | kobrient/tinypilot | aa40f11a370e04b11e0f72d34647c0e01669bbe9 | [
"MIT"
] | null | null | null | app/views.py | kobrient/tinypilot | aa40f11a370e04b11e0f72d34647c0e01669bbe9 | [
"MIT"
] | null | null | null | app/views.py | kobrient/tinypilot | aa40f11a370e04b11e0f72d34647c0e01669bbe9 | [
"MIT"
] | null | null | null | import flask
from find_files import find as find_files
views_blueprint = flask.Blueprint('views', __name__, url_prefix='')
@views_blueprint.route('/', methods=['GET'])
def index_get():
return flask.render_template(
'index.html', custom_elements_files=find_files.custom_elements_files())
| 25.25 | 79 | 0.752475 | 0 | 0 | 0 | 0 | 175 | 0.577558 | 0 | 0 | 29 | 0.09571 |
b0144723fdb455462aff667b476dc0e86c2e8039 | 577 | py | Python | example.py | LAIRLAB/libpyarr | 9e973a4045519fa6aedae3aaabd8267f6f796a8c | [
"BSD-3-Clause"
] | 1 | 2016-04-09T02:37:03.000Z | 2016-04-09T02:37:03.000Z | example.py | LAIRLAB/libpyarr | 9e973a4045519fa6aedae3aaabd8267f6f796a8c | [
"BSD-3-Clause"
] | null | null | null | example.py | LAIRLAB/libpyarr | 9e973a4045519fa6aedae3aaabd8267f6f796a8c | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
import warnings, numpy
with warnings.catch_warnings():
warnings.simplefilter("ignore")
from libpyarr_example import *
def main():
my_uninited_arr = bar()
my_uninited_arr[:, 0,0] = -50
print "some -50s, some uninitialized:",my_uninited_arr[:,:2,0]
foo(my_uninited_arr... | 28.85 | 83 | 0.694974 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 210 | 0.363951 |
b0146dc56f96a9ee8522dfa5aeb06d9a9ea59827 | 1,167 | py | Python | kitty_tiny/tools/annoGen/AnnoEventHandler.py | sixxchung/mymm | 4e8cd43c2615c08a60bf21fe0c4604344b470602 | [
"MIT"
] | null | null | null | kitty_tiny/tools/annoGen/AnnoEventHandler.py | sixxchung/mymm | 4e8cd43c2615c08a60bf21fe0c4604344b470602 | [
"MIT"
] | null | null | null | kitty_tiny/tools/annoGen/AnnoEventHandler.py | sixxchung/mymm | 4e8cd43c2615c08a60bf21fe0c4604344b470602 | [
"MIT"
] | null | null | null |
import logging
from watchdog.events import LoggingEventHandler, FileSystemEventHandler
class AnnoEventHandler(FileSystemEventHandler):
"""Logs all the events captured."""
def __init__(self, logger=None):
super().__init__()
self.logger = logger or logging.root
def on_moved(self, event):
... | 31.540541 | 88 | 0.640103 | 1,077 | 0.922879 | 0 | 0 | 0 | 0 | 0 | 0 | 202 | 0.173093 |
b01504199a00f0b0ea4a2e7806f9a6775f0b35bb | 11,037 | py | Python | BCPNN/backend/_cpu_base_backend.py | KTH-HPC/StreamBrain | 37b16e7c8e02e6d2800bcf89630a0f4419e90cd4 | [
"BSD-2-Clause"
] | 4 | 2020-10-20T22:15:25.000Z | 2022-02-10T10:25:24.000Z | BCPNN/backend/_cpu_base_backend.py | KTH-HPC/StreamBrain | 37b16e7c8e02e6d2800bcf89630a0f4419e90cd4 | [
"BSD-2-Clause"
] | 1 | 2020-12-16T10:46:50.000Z | 2020-12-16T10:46:50.000Z | BCPNN/backend/_cpu_base_backend.py | KTH-HPC/StreamBrain | 37b16e7c8e02e6d2800bcf89630a0f4419e90cd4 | [
"BSD-2-Clause"
] | 1 | 2020-10-20T22:15:29.000Z | 2020-10-20T22:15:29.000Z | import sys
import numpy as np
from tqdm import tqdm
from contextlib import nullcontext
class DenseLayer:
_update_state = None
_softmax_minicolumns = None
_update_counters = None
_update_weights = None
_update_bias = None
def __init__(
self,
in_features,
hyp... | 35.038095 | 94 | 0.552596 | 10,941 | 0.991302 | 0 | 0 | 0 | 0 | 0 | 0 | 84 | 0.007611 |
b01639c2289f47ba698eea2092678bb22c032e75 | 6,879 | py | Python | flux_sensors/flux_sensor.py | Flux-Coordinator/flux-sensors | 44968c95e277023c3a6777d653e7b3cb4e333923 | [
"MIT"
] | null | null | null | flux_sensors/flux_sensor.py | Flux-Coordinator/flux-sensors | 44968c95e277023c3a6777d653e7b3cb4e333923 | [
"MIT"
] | 1 | 2018-06-14T18:21:33.000Z | 2018-06-14T18:21:33.000Z | flux_sensors/flux_sensor.py | Flux-Coordinator/flux-sensors | 44968c95e277023c3a6777d653e7b3cb4e333923 | [
"MIT"
] | null | null | null | from flux_sensors.localizer.localizer import Localizer, Coordinates, LocalizerError, PozyxDeviceError
from flux_sensors.light_sensor.light_sensor import LightSensor
from flux_sensors.config_loader import ConfigLoader
from flux_sensors.flux_server import FluxServer, FluxServerError
from flux_sensors.models import models... | 44.668831 | 118 | 0.602704 | 6,456 | 0.938509 | 0 | 0 | 154 | 0.022387 | 0 | 0 | 1,125 | 0.163541 |
b019647d7984c42bcd98ff6521f630e19b83c858 | 11,288 | py | Python | Network.py | Coldog2333/pytoflow | 3cec913fa5a2ddb8133a075d4ff177cceb74f06a | [
"MIT"
] | 102 | 2018-12-29T16:19:18.000Z | 2022-01-13T03:54:04.000Z | Network.py | mengxiangyudlut/pytoflow | 3cec913fa5a2ddb8133a075d4ff177cceb74f06a | [
"MIT"
] | 19 | 2019-04-26T10:19:14.000Z | 2021-11-14T07:36:23.000Z | Network.py | mengxiangyudlut/pytoflow | 3cec913fa5a2ddb8133a075d4ff177cceb74f06a | [
"MIT"
] | 32 | 2019-03-04T00:10:06.000Z | 2022-01-11T08:19:19.000Z | import math
import torch
# import torch.utils.serialization # it was removed in torch v1.0.0 or higher version.
arguments_strModel = 'sintel-final'
SpyNet_model_dir = './models' # The directory of SpyNet's weights
def normalize(tensorInput):
tensorRed = (tensorInput[:, 0:1, :, :] - 0.485) / 0.229
tensorGre... | 47.230126 | 186 | 0.589033 | 9,462 | 0.835423 | 0 | 0 | 0 | 0 | 0 | 0 | 1,519 | 0.134116 |
b01bbd168b9b732e58f788ff84aca342f6b50515 | 2,668 | py | Python | storagetest/pkgs/ltp/acl/acl_test.py | liufeng-elva/storage-test2 | 5364cc00dbe71b106f1bb740bf391e6124788bf4 | [
"MIT"
] | null | null | null | storagetest/pkgs/ltp/acl/acl_test.py | liufeng-elva/storage-test2 | 5364cc00dbe71b106f1bb740bf391e6124788bf4 | [
"MIT"
] | null | null | null | storagetest/pkgs/ltp/acl/acl_test.py | liufeng-elva/storage-test2 | 5364cc00dbe71b106f1bb740bf391e6124788bf4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
@file : acl_test.py
@Time : 2020/11/9 9:25
@Author: Tao.Xu
@Email : tao.xu2008@outlook.com
"""
import os
import unittest
from storagetest.libs import utils
from storagetest.libs.log import log
from storagetest.libs.exceptions import PlatformError, NoSuchDir, NoSuchBina... | 29.644444 | 92 | 0.613943 | 2,045 | 0.766492 | 0 | 0 | 0 | 0 | 0 | 0 | 615 | 0.23051 |
b01ead4c68269eedb233e679f59c48eb110ed041 | 1,518 | py | Python | recipes-bsp/b205/files/spihost_write_ftdi.py | tszucs/meta-ublox-tk1 | 8cb7c83d9a8b387fae4a4108a48e697d3e94df8e | [
"MIT"
] | null | null | null | recipes-bsp/b205/files/spihost_write_ftdi.py | tszucs/meta-ublox-tk1 | 8cb7c83d9a8b387fae4a4108a48e697d3e94df8e | [
"MIT"
] | null | null | null | recipes-bsp/b205/files/spihost_write_ftdi.py | tszucs/meta-ublox-tk1 | 8cb7c83d9a8b387fae4a4108a48e697d3e94df8e | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys, getopt, os, time, array
from pyftdi.spi import SpiController
def download ( filename, speed=5000000, chunksize=32 ):
try:
with open(filename, 'rb') as filein:
data = filein.read ()
data = array.array('B', data).tolist()
except IOError:
print "ERROR: Could not open file {0}".f... | 24.483871 | 147 | 0.675889 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 313 | 0.206192 |
b01eb11332b52c82d114e9890278450ea72e51d6 | 3,845 | py | Python | PedestrianSlayer/MechanicalControl/NeuralNetwork.py | Viriliter/PedestrianSlayer | 4adbdc3d0ed60408e6422cdba01f017701d05069 | [
"MIT"
] | 2 | 2018-05-23T14:14:23.000Z | 2018-12-03T21:08:37.000Z | PedestrianSlayer/MechanicalControl/NeuralNetwork.py | Viriliter/PedestrianSlayer | 4adbdc3d0ed60408e6422cdba01f017701d05069 | [
"MIT"
] | null | null | null | PedestrianSlayer/MechanicalControl/NeuralNetwork.py | Viriliter/PedestrianSlayer | 4adbdc3d0ed60408e6422cdba01f017701d05069 | [
"MIT"
] | null | null | null | import numpy as np
class NeuralNetwork():
'''
This neural network is designed for Pedestrian Car Project.
It constructs an input layer that gets 4 road and car parameters.
Using neural network algorithm, it gives optimum steering angle of the car.
To use this class:
-Firstly, using training... | 34.954545 | 116 | 0.635111 | 3,824 | 0.994538 | 0 | 0 | 0 | 0 | 0 | 0 | 1,116 | 0.290247 |
b01f92f5f3f6a4f80aa7644a0330cdac5e27b92c | 1,405 | py | Python | tests/test_paramviewer.py | lnielsen/pyhf | 3d98dc445c384d2919a77b9af0a202e12343a707 | [
"Apache-2.0"
] | null | null | null | tests/test_paramviewer.py | lnielsen/pyhf | 3d98dc445c384d2919a77b9af0a202e12343a707 | [
"Apache-2.0"
] | null | null | null | tests/test_paramviewer.py | lnielsen/pyhf | 3d98dc445c384d2919a77b9af0a202e12343a707 | [
"Apache-2.0"
] | null | null | null | import pyhf
from pyhf.parameters import ParamViewer
def test_paramviewer_simple_nonbatched(backend):
pars = pyhf.tensorlib.astensor([1, 2, 3, 4, 5, 6, 7])
parshape = pyhf.tensorlib.shape(pars)
view = ParamViewer(
parshape,
{'hello': {'slice': slice(0, 2)}, 'world': {'slice': slice(5, 7)}... | 31.222222 | 86 | 0.605694 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 114 | 0.081139 |
b0204523055a99ef60f353c69bef13df582957e8 | 15,276 | py | Python | library/modules/encoder_decoders/sequence_to_sequence.py | dangitstam/le-traducteur | 499005ac198029fd2a7e7469fb250b8b3af6a619 | [
"Apache-2.0"
] | 6 | 2018-10-23T10:05:55.000Z | 2020-08-30T13:04:51.000Z | library/modules/encoder_decoders/sequence_to_sequence.py | dangitstam/le-traducteur | 499005ac198029fd2a7e7469fb250b8b3af6a619 | [
"Apache-2.0"
] | 1 | 2018-08-20T21:58:33.000Z | 2020-12-29T17:44:04.000Z | library/modules/encoder_decoders/sequence_to_sequence.py | dangitstam/le-traducteur | 499005ac198029fd2a7e7469fb250b8b3af6a619 | [
"Apache-2.0"
] | 1 | 2022-03-26T05:13:38.000Z | 2022-03-26T05:13:38.000Z | from typing import Dict, Optional, Tuple
import numpy as np
import torch
import torch.nn.functional as F
from allennlp.common.checks import ConfigurationError
from allennlp.common.util import START_SYMBOL, END_SYMBOL
from allennlp.data.vocabulary import Vocabulary
from allennlp.models.model import Model
from allennlp.... | 48.805112 | 106 | 0.645719 | 14,276 | 0.934538 | 0 | 0 | 14,316 | 0.937156 | 0 | 0 | 4,518 | 0.295758 |
b021c9112da0b09c0383564d4213787ef0cf3187 | 1,372 | py | Python | hrv/filters.py | LegrandNico/hrv | 35cdd1b7ddf8afdebf2db91f982b256c3b9dbf67 | [
"BSD-3-Clause"
] | 1 | 2020-01-06T20:08:04.000Z | 2020-01-06T20:08:04.000Z | hrv/filters.py | LegrandNico/hrv | 35cdd1b7ddf8afdebf2db91f982b256c3b9dbf67 | [
"BSD-3-Clause"
] | null | null | null | hrv/filters.py | LegrandNico/hrv | 35cdd1b7ddf8afdebf2db91f982b256c3b9dbf67 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from hrv.rri import RRi
from hrv.utils import _create_time_info
def quotient(rri):
# TODO: Receive option to replaced outliers with stats
# functions (i.e mean, median etc)
# TODO: Receive option to re-create time array with cumsum of filtered rri
if isinstance(rri, RRi):
... | 25.886792 | 79 | 0.626093 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 206 | 0.150146 |
b02365bd68f389ec1ac4453e0ddfb053b1f457d4 | 20,428 | py | Python | PVPlugins/PVGeo_UBC_Tools.py | jkulesza/PVGeo | c7bdbad5e5e5579033e1b00605d680b67252b3f4 | [
"BSD-3-Clause"
] | 1 | 2020-06-09T16:49:28.000Z | 2020-06-09T16:49:28.000Z | PVPlugins/PVGeo_UBC_Tools.py | jkulesza/PVGeo | c7bdbad5e5e5579033e1b00605d680b67252b3f4 | [
"BSD-3-Clause"
] | null | null | null | PVPlugins/PVGeo_UBC_Tools.py | jkulesza/PVGeo | c7bdbad5e5e5579033e1b00605d680b67252b3f4 | [
"BSD-3-Clause"
] | null | null | null | paraview_plugin_version = '1.1.39'
# This is module to import. It provides VTKPythonAlgorithmBase, the base class
# for all python-based vtkAlgorithm subclasses in VTK and decorators used to
# 'register' the algorithm with ParaView along with information about UI.
from paraview.util.vtkAlgorithm import *
# Helpers:
fr... | 42.558333 | 221 | 0.684012 | 15,938 | 0.780204 | 0 | 0 | 19,077 | 0.933865 | 0 | 0 | 9,153 | 0.448061 |
b023ba4b1780ce639f98fb2247c460ffe792c1f6 | 20,333 | py | Python | tests/rewards_tree/test_rewards_flow.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 99 | 2020-12-02T08:40:48.000Z | 2022-03-15T05:21:06.000Z | tests/rewards_tree/test_rewards_flow.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 115 | 2020-12-15T07:15:39.000Z | 2022-03-28T22:21:03.000Z | tests/rewards_tree/test_rewards_flow.py | shuklaayush/badger-system | 1274eadbd0b0f3a02efbf40702719ce1d0a96c44 | [
"MIT"
] | 56 | 2020-12-11T06:50:04.000Z | 2022-02-21T09:17:38.000Z | import json
import secrets
import brownie
from dotmap import DotMap
import pytest
import pprint
from brownie import *
from helpers.constants import *
from helpers.registry import registry
from rich.console import Console
FARM_ADDRESS = "0xa0246c9032bC3A600820415aE600c6388619A14D"
XSUSHI_ADDRESS = "0x8798249c2E60744... | 31.137825 | 119 | 0.59278 | 0 | 0 | 0 | 0 | 144 | 0.007082 | 0 | 0 | 3,688 | 0.18138 |
b0249f5db53b2ce54527df608f97d99c1010a240 | 23,869 | py | Python | HCm-uv/HCm-UV_v4.11/HCm-UV_v4.11.py | Borja-Perez-Diaz/HII-CHI-Mistry | d0dafc753c63246bf14b77807a885ddc7bd4bb99 | [
"MIT"
] | null | null | null | HCm-uv/HCm-UV_v4.11/HCm-UV_v4.11.py | Borja-Perez-Diaz/HII-CHI-Mistry | d0dafc753c63246bf14b77807a885ddc7bd4bb99 | [
"MIT"
] | null | null | null | HCm-uv/HCm-UV_v4.11/HCm-UV_v4.11.py | Borja-Perez-Diaz/HII-CHI-Mistry | d0dafc753c63246bf14b77807a885ddc7bd4bb99 | [
"MIT"
] | null | null | null | # Filename: HCm_UV_v4.11.py
import string
import numpy as np
import sys
#sys.stderr = open('errorlog.txt', 'w')
#Function for interpolation of grids
def interpolate(grid,z,zmin,zmax,n):
ncol = 9
vec = []
for col in range(ncol):
inter = 0
no_inter = 0
for row in range(0,len(grid)):
... | 30.759021 | 453 | 0.526541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,758 | 0.157443 |
b026bd7b3b263fb2129be4259af4f24d57934ce8 | 20,746 | py | Python | Name Generator/names.py | Rakkerrak/Projects | 0a9bc54b7d41e69b444165f60254262a163509a9 | [
"MIT"
] | null | null | null | Name Generator/names.py | Rakkerrak/Projects | 0a9bc54b7d41e69b444165f60254262a163509a9 | [
"MIT"
] | null | null | null | Name Generator/names.py | Rakkerrak/Projects | 0a9bc54b7d41e69b444165f60254262a163509a9 | [
"MIT"
] | null | null | null | feFirst = ['Emma', 'Olivia', 'Ava', 'Isabella', 'Sophia', 'Charlotte', 'Mia', 'Amelia', 'Harper', 'Evelyn', 'Abigail', 'Emily', 'Elizabeth', 'Mila', 'Ella', 'Avery', 'Sofia', 'Camila', 'Aria', 'Scarlett', 'Victoria', 'Madison', 'Luna', 'Grace', 'Chloe', 'Penelope', 'Layla', 'Riley', 'Zoey', 'Nora', 'Lily', 'Eleanor', '... | 3,457.666667 | 10,010 | 0.594428 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 16,514 | 0.796009 |
b028018661b0929da5b6a926d65bb750a50efe57 | 444 | py | Python | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 22 | 2018-04-25T22:03:53.000Z | 2021-07-13T18:43:23.000Z | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 17 | 2018-04-30T14:04:08.000Z | 2022-02-13T19:52:44.000Z | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 7 | 2018-05-08T23:32:44.000Z | 2022-01-27T17:49:30.000Z | from nose.tools import eq_
from oldtoronto.toronto_archives import get_citation_hierarchy # noqa
def test_get_citation_hierarchy():
eq_([
'Fonds 200, Series 123',
'Fonds 200'
], get_citation_hierarchy('Fonds 200, Series 123, Item 456'))
eq_([
'Fonds 257, Series 12, File 1983',
... | 26.117647 | 73 | 0.646396 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 180 | 0.405405 |
b02d1a840f2e9ca574098b991b8f37e1b954c866 | 979 | py | Python | excel2.py | darkless456/Python | 1ba37d028e4a818ccfffc18682c1bac15554e3ac | [
"MIT"
] | null | null | null | excel2.py | darkless456/Python | 1ba37d028e4a818ccfffc18682c1bac15554e3ac | [
"MIT"
] | null | null | null | excel2.py | darkless456/Python | 1ba37d028e4a818ccfffc18682c1bac15554e3ac | [
"MIT"
] | null | null | null | # excel2.py
import xlrd
def print_xls(path):
xlsFile = xlrd.open_workbook(path)
try:
mySheet = xlsFile.sheets()[0] # 访问第1张表序号0 // xlsFile.sheet_by_name('sheetName') 通过工作表名访问
except:
print('no such sheet in file')
return
print('%d rows, %d cols' % (mySheet.nrows, mySheet.ncols)... | 27.194444 | 96 | 0.670072 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 865 | 0.641216 |
b02f9eadae5afd900218c21f9e3251e4c4f3cf07 | 1,162 | py | Python | reth_buffer/reth_buffer/__init__.py | sosp2021/Reth | 10c032f44a25049355ebdd97a2cb3299e8c3fb82 | [
"MIT"
] | null | null | null | reth_buffer/reth_buffer/__init__.py | sosp2021/Reth | 10c032f44a25049355ebdd97a2cb3299e8c3fb82 | [
"MIT"
] | 1 | 2021-08-10T02:58:58.000Z | 2021-08-10T02:58:58.000Z | reth_buffer/reth_buffer/__init__.py | sosp2021/reth | 10c032f44a25049355ebdd97a2cb3299e8c3fb82 | [
"MIT"
] | null | null | null | import multiprocessing as mp
import portpicker
from .client import Client, NumpyLoader, TorchCudaLoader
from .sampler import PERSampler
from .server.main_loop import main_loop
from .utils import get_local_ip
def start_server(
capacity, batch_size, host=None, port=None, samplers=None, cache_policy=None
):
if... | 23.24 | 81 | 0.645439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.075731 |
b02fad481b4d3cb3263f98acf09c40e1f2669bfa | 7,171 | py | Python | agent.py | FlowerForAlgernon/rainbow | 78492ba572e2f8b4b2228d2ca625af94a09ee696 | [
"Apache-2.0"
] | 1 | 2022-03-23T02:02:10.000Z | 2022-03-23T02:02:10.000Z | agent.py | FlowerForAlgernon/rainbow | 78492ba572e2f8b4b2228d2ca625af94a09ee696 | [
"Apache-2.0"
] | null | null | null | agent.py | FlowerForAlgernon/rainbow | 78492ba572e2f8b4b2228d2ca625af94a09ee696 | [
"Apache-2.0"
] | null | null | null | import random
import numpy as np
import torch
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transforms as T
from memory import Transition, ReplayMemory, PrioritizedReplayMemory, NStepMemory
from DQN import DQN, DuelingDQN, NoisyDQN, DistributionalDQN
class Agent:
def __... | 48.452703 | 142 | 0.647748 | 6,875 | 0.958723 | 0 | 0 | 270 | 0.037652 | 0 | 0 | 381 | 0.053131 |
b0347f10c5746915500b0d6e172c2c32ab5316d0 | 121 | py | Python | Deutsch-Jozsa-Algorithm/main.py | Gregory-Eales/QA-Reimplementations | bef0b3e67397a73c468e539c426c6629d398433b | [
"MIT"
] | 1 | 2019-05-03T21:48:29.000Z | 2019-05-03T21:48:29.000Z | Deutsch-Jozsa-Algorithm/main.py | Gregory-Eales/QA-Reimplementations | bef0b3e67397a73c468e539c426c6629d398433b | [
"MIT"
] | null | null | null | Deutsch-Jozsa-Algorithm/main.py | Gregory-Eales/QA-Reimplementations | bef0b3e67397a73c468e539c426c6629d398433b | [
"MIT"
] | null | null | null | import qsharp
from DeutschJozsa import SayHello, RunDeutschJozsa
SayHello.simulate()
RunDeutschJozsa.simulate(N=10)
| 13.444444 | 50 | 0.818182 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b0370f00352f25c209bf62c39330309ded5b5b35 | 413 | py | Python | xslt/apply.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 21 | 2015-02-06T21:55:59.000Z | 2021-04-29T11:23:18.000Z | xslt/apply.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 9 | 2015-02-03T10:41:35.000Z | 2020-02-18T12:46:10.000Z | xslt/apply.py | carlosduarteroa/smap | 5760631dfaf3e85da26ce68bf542bf254bb92c80 | [
"BSD-2-Clause"
] | 20 | 2015-02-06T00:09:19.000Z | 2020-01-10T13:27:06.000Z | """Apply a stylesheet to an XML file"""
import sys
from lxml import etree
if len(sys.argv) != 3:
print >>sys.stderr, "Usage: %s <stylesheet> <xml doc> ..." % sys.argv[0]
sys.exit(1)
transform = etree.XSLT(etree.XML(open(sys.argv[1], "r").read()))
for xmlfile in sys.argv[2:]:
with open(xmlfile, "r") as fp... | 27.533333 | 76 | 0.639225 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 83 | 0.200969 |
b037c4f526f6d6afd8598b5e5a8cb64d9cc7462a | 7,122 | py | Python | docs/conf.py | vlukes/io3d | 34d048b7f737a5e56610879f6ab103128e8f0750 | [
"MIT"
] | 8 | 2016-09-26T01:35:15.000Z | 2022-02-23T04:05:23.000Z | docs/conf.py | vlukes/io3d | 34d048b7f737a5e56610879f6ab103128e8f0750 | [
"MIT"
] | 4 | 2016-05-18T11:04:56.000Z | 2018-10-24T11:03:03.000Z | docs/conf.py | vlukes/io3d | 34d048b7f737a5e56610879f6ab103128e8f0750 | [
"MIT"
] | 6 | 2017-03-24T20:43:21.000Z | 2021-08-23T06:05:34.000Z | # -*- coding: utf-8 -*-
#
# io3d documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 27 12:01:57 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 32.226244 | 102 | 0.664139 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,004 | 0.843022 |
b038cebedd15245004a4a13444cb7f55e363f2e8 | 33,401 | py | Python | EVB.py | yunzhe-zhou/CS285-Project | e6aca061e27d2794949d4419339120107a6cb8f7 | [
"MIT"
] | null | null | null | EVB.py | yunzhe-zhou/CS285-Project | e6aca061e27d2794949d4419339120107a6cb8f7 | [
"MIT"
] | null | null | null | EVB.py | yunzhe-zhou/CS285-Project | e6aca061e27d2794949d4419339120107a6cb8f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""RED_linear_run1.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1-WN1MY9YYluGcnigLgrndqsxcOYldbB6
"""
#@title mount your Google Drive
#@markdown Your work will be stored in a folder called `cs285_f2021` by default to pr... | 32.586341 | 143 | 0.632945 | 3,437 | 0.102901 | 2,106 | 0.063052 | 0 | 0 | 0 | 0 | 7,311 | 0.218886 |
b03a815221b3f33cdcf33d82406be159b843f64d | 2,096 | py | Python | School-Management-System/teachers/views.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | null | null | null | School-Management-System/teachers/views.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | null | null | null | School-Management-System/teachers/views.py | GisaKaze/Python-Quarantine-Projects | 29fabcb7e4046e6f3e9a19403e6d2490fe4b9fc4 | [
"MIT"
] | null | null | null | from django.shortcuts import render, get_object_or_404, redirect
from .models import TeacherInfo
from .forms import CreateTeacher
from django.contrib import messages
from django.core.paginator import Paginator
# Create your views here.
def teacher_list(request):
teachers = TeacherInfo.objects.all()
paginator ... | 30.376812 | 102 | 0.705153 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 357 | 0.170324 |
b03af16df806f7a2f213bb90c1c62ae5588655f0 | 4,326 | py | Python | runner_service/controllers/jobs.py | tonykhbo/ansible-runner-service | 200bd9aa67fc0fd66a4425cfb38a2ac3aed4d4b2 | [
"Apache-2.0"
] | 174 | 2018-11-21T07:44:50.000Z | 2022-03-04T15:11:56.000Z | runner_service/controllers/jobs.py | tonykhbo/ansible-runner-service | 200bd9aa67fc0fd66a4425cfb38a2ac3aed4d4b2 | [
"Apache-2.0"
] | 76 | 2018-12-12T17:20:37.000Z | 2021-12-06T11:15:47.000Z | runner_service/controllers/jobs.py | tonykhbo/ansible-runner-service | 200bd9aa67fc0fd66a4425cfb38a2ac3aed4d4b2 | [
"Apache-2.0"
] | 61 | 2018-12-27T15:17:38.000Z | 2022-03-04T12:29:33.000Z | # from flask import request
from flask_restful import request
# import logging
from .utils import log_request
from .base import BaseResource
from ..services.jobs import get_events, get_event
from ..services.utils import APIResponse
import logging
logger = logging.getLogger(__name__)
class ListEvents(BaseResource):
... | 32.772727 | 184 | 0.502312 | 4,034 | 0.932501 | 0 | 0 | 3,828 | 0.884882 | 0 | 0 | 3,414 | 0.789182 |
b0433121aa8bbd1327d3221055a476dfcaf07db3 | 136 | py | Python | case3/test_calc.py | emre/unit-test-workshop | 6a323dd7ffac08e7aa56e09d307798d4ae984fa9 | [
"MIT"
] | 1 | 2017-11-20T18:15:12.000Z | 2017-11-20T18:15:12.000Z | case3/test_calc.py | emre/unit-test-workshop | 6a323dd7ffac08e7aa56e09d307798d4ae984fa9 | [
"MIT"
] | null | null | null | case3/test_calc.py | emre/unit-test-workshop | 6a323dd7ffac08e7aa56e09d307798d4ae984fa9 | [
"MIT"
] | null | null | null | import unittest
# https://docs.python.org/3/library/unittest.html
from calc import Calc
class TestCalc(unittest.TestCase):
pass
| 13.6 | 49 | 0.757353 | 43 | 0.316176 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.360294 |
b043e0116441bcee9ae6a5419079e591b49e7c1e | 3,267 | py | Python | tests/service/test_integer_converter_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 25 | 2018-03-04T07:49:21.000Z | 2022-03-28T05:20:50.000Z | tests/service/test_integer_converter_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 22 | 2018-03-25T13:19:45.000Z | 2020-11-28T17:21:08.000Z | tests/service/test_integer_converter_service.py | NeolithEra/WavesGatewayFramework | e7ba892427e1d0444f2bfdc2922c45ff5f4c4add | [
"MIT"
] | 31 | 2018-03-25T09:45:13.000Z | 2022-03-24T05:32:18.000Z | import unittest
from unittest.mock import patch
from waves_gateway.model import Transaction, TransactionReceiver
from waves_gateway.service import IntegerConverterService
class IntegerConverterServiceSpec(unittest.TestCase):
@patch.multiple( # type: ignore
IntegerConverterService, __abstractmethods__=s... | 37.551724 | 94 | 0.67034 | 3,091 | 0.946128 | 0 | 0 | 173 | 0.052954 | 0 | 0 | 221 | 0.067646 |
b044475c3b8a25898a8527a87ed6dc1d9dadbb1d | 6,670 | py | Python | live_demo.py | GerryZhang7/ASL-Translator- | 3963311d8dd1f010ee5a19b3760b451bc287ab1e | [
"MIT"
] | null | null | null | live_demo.py | GerryZhang7/ASL-Translator- | 3963311d8dd1f010ee5a19b3760b451bc287ab1e | [
"MIT"
] | null | null | null | live_demo.py | GerryZhang7/ASL-Translator- | 3963311d8dd1f010ee5a19b3760b451bc287ab1e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
LIVE DEMO
This script loads a pre-trained model (for best results use pre-trained weights for classification block)
and classifies American Sign Language finger spelling frame-by-frame in real-time
"""
import string
import cv2
import time
from processing import square... | 33.517588 | 105 | 0.553373 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,480 | 0.371814 |
b044b434998843e21fedc472b72d6aa6d023641a | 8,770 | py | Python | prob2020/python/gene_sequence.py | KarchinLab/probabilistic2020 | 8e0b1b9578bd8189b1690dd2f17476c3305b98dc | [
"Apache-2.0"
] | 8 | 2016-04-30T03:26:40.000Z | 2021-09-17T04:47:08.000Z | prob2020/python/gene_sequence.py | KarchinLab/probabilistic2020 | 8e0b1b9578bd8189b1690dd2f17476c3305b98dc | [
"Apache-2.0"
] | 9 | 2016-08-18T15:19:04.000Z | 2019-07-17T18:16:52.000Z | prob2020/python/gene_sequence.py | KarchinLab/probabilistic2020 | 8e0b1b9578bd8189b1690dd2f17476c3305b98dc | [
"Apache-2.0"
] | 7 | 2016-10-19T03:43:42.000Z | 2021-07-31T02:40:20.000Z | """Fetches gene sequence from gene fasta created by extract_genes.py"""
import prob2020.python.utils as utils
class GeneSequence(object):
def __init__(self, fasta_obj,
nuc_context=1.5):
self.fasta = fasta_obj
self.nuc_context = nuc_context
def set_gene(self, bed_line):
... | 34.801587 | 89 | 0.55382 | 3,881 | 0.442531 | 0 | 0 | 0 | 0 | 0 | 0 | 3,686 | 0.420296 |
b04538316ec8e7dec6961b4c00010c7027a8e97d | 1,118 | py | Python | src/main/python/request/http_request.py | photowey/pytest-dynamic-framework | 4e7b6d74594191006b50831d42e7aae21e154d56 | [
"Apache-2.0"
] | null | null | null | src/main/python/request/http_request.py | photowey/pytest-dynamic-framework | 4e7b6d74594191006b50831d42e7aae21e154d56 | [
"Apache-2.0"
] | null | null | null | src/main/python/request/http_request.py | photowey/pytest-dynamic-framework | 4e7b6d74594191006b50831d42e7aae21e154d56 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# ---------------------------------------------
# @file http_request
# @description http_request
# @author WcJun
# @date 2021/07/19
# ---------------------------------------------
from src.main.python.request.options import RequestOptions
class HttpRequest:
"""
Http Request
"""
... | 29.421053 | 92 | 0.573345 | 851 | 0.761181 | 0 | 0 | 0 | 0 | 0 | 0 | 237 | 0.211986 |
b04682256b68f1be1d146f950d4cf5cacbc05399 | 5,728 | py | Python | bot/helper/mirror_utils/download_utils/aria2_download.py | vincreator/Eunha | 85a702a5b5f30ccea1798122c261d4ff07fe0c0c | [
"Apache-2.0"
] | null | null | null | bot/helper/mirror_utils/download_utils/aria2_download.py | vincreator/Eunha | 85a702a5b5f30ccea1798122c261d4ff07fe0c0c | [
"Apache-2.0"
] | null | null | null | bot/helper/mirror_utils/download_utils/aria2_download.py | vincreator/Eunha | 85a702a5b5f30ccea1798122c261d4ff07fe0c0c | [
"Apache-2.0"
] | null | null | null | from time import sleep
from threading import Thread
from bot import aria2, download_dict_lock, download_dict, STOP_DUPLICATE, TORRENT_DIRECT_LIMIT, ZIP_UNZIP_LIMIT, LOGGER, STORAGE_THRESHOLD
from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper
from bot.helper.ext_utils.bot_utils import is_mag... | 46.569106 | 138 | 0.618191 | 0 | 0 | 0 | 0 | 3,977 | 0.694309 | 0 | 0 | 801 | 0.139839 |
b047b2781fee7bef3205107d3cc7277c6707a880 | 3,407 | py | Python | gol.py | AjayMT/game-of-life | 681bb92e1d7c0644645af7b77f0106ba2d4c9c20 | [
"MIT"
] | null | null | null | gol.py | AjayMT/game-of-life | 681bb92e1d7c0644645af7b77f0106ba2d4c9c20 | [
"MIT"
] | null | null | null | gol.py | AjayMT/game-of-life | 681bb92e1d7c0644645af7b77f0106ba2d4c9c20 | [
"MIT"
] | null | null | null |
import pygame
from pygame.locals import *
from pygamehelper import *
from vec2d import *
from random import randrange
class Matrix:
def __init__(self, w, h):
self.w, self.h = w, h
self._data = []
for i in range(self.w * self.h):
self._data.append(None)
def __getitem__(se... | 27.039683 | 70 | 0.502495 | 3,246 | 0.952744 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.022307 |
b048467d0a750345394b6d343d01156aad3e1cef | 109 | py | Python | pylib/gna/graph/__init__.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | 5 | 2019-10-14T01:06:57.000Z | 2021-02-02T16:33:06.000Z | pylib/gna/graph/__init__.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | pylib/gna/graph/__init__.py | gnafit/gna | c1a58dac11783342c97a2da1b19c97b85bce0394 | [
"MIT"
] | null | null | null | from gna.graph.walk import GraphWalker
from gna.graph.timeit import *
from gna.graph.walk_functions import *
| 27.25 | 38 | 0.816514 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b048ccf5383075a3e3ddc09cd04494ee80c2a300 | 434 | py | Python | Recursion/Aditya_Verma/Hypothesis_Method/Print_N_to_1.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | Recursion/Aditya_Verma/Hypothesis_Method/Print_N_to_1.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | Recursion/Aditya_Verma/Hypothesis_Method/Print_N_to_1.py | prash-kr-meena/GoogleR | 27aca71e51cc2442e604e07ab00406a98d8d63a4 | [
"Apache-2.0"
] | null | null | null | # Forward Implementation
def print_to_n_reverse(n):
if n == 1: # Base Condition
print(1, end=" ")
return
print(n, end=" ") # Induction
print_to_n_reverse(n - 1) # Hypothesis
# Backward implementation
# - Here backward implementation, would be a bit typical to do,
# - Forward implementa... | 25.529412 | 81 | 0.675115 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 248 | 0.571429 |
b04a94197db758a9aeced9b7588eec2e7e3ada18 | 7,835 | py | Python | certbot_azure/azure_agw.py | loufa-io/certbot-azure | f081da34fa74c3d2fded08af2da0ca2b5380fa14 | [
"MIT"
] | null | null | null | certbot_azure/azure_agw.py | loufa-io/certbot-azure | f081da34fa74c3d2fded08af2da0ca2b5380fa14 | [
"MIT"
] | null | null | null | certbot_azure/azure_agw.py | loufa-io/certbot-azure | f081da34fa74c3d2fded08af2da0ca2b5380fa14 | [
"MIT"
] | null | null | null | """Azure App Gateway Certbot installer plugin."""
from __future__ import print_function
import os
import sys
import logging
import time
import OpenSSL
import base64
try:
from secrets import token_urlsafe
except ImportError:
from os import urandom
def token_urlsafe(nbytes=None):
return urandom(nbyt... | 36.957547 | 117 | 0.664199 | 6,539 | 0.834588 | 0 | 0 | 439 | 0.056031 | 0 | 0 | 2,458 | 0.31372 |
b04b28603590e6dad8f700f43ec0e40f0f4392cb | 1,999 | py | Python | image/apps/Ignitions.py | AnthonyRawlinsUoM/MetricsDashboard | 37594e46b0cec340e10d3123bbaf94b277a3ce22 | [
"MIT"
] | null | null | null | image/apps/Ignitions.py | AnthonyRawlinsUoM/MetricsDashboard | 37594e46b0cec340e10d3123bbaf94b277a3ce22 | [
"MIT"
] | null | null | null | image/apps/Ignitions.py | AnthonyRawlinsUoM/MetricsDashboard | 37594e46b0cec340e10d3123bbaf94b277a3ce22 | [
"MIT"
] | null | null | null |
from pathlib import Path
from glob import glob as glob
from extractor.Ignition import Ignition
import logging
logger = logging.getLogger(__name__)
class Ignitions:
"""
"""
def __init__(self, path, scenario_name, redis):
self.redis = redis
self.active = False
self.name = "Ignition... | 36.345455 | 76 | 0.477239 | 1,848 | 0.924462 | 0 | 0 | 0 | 0 | 0 | 0 | 421 | 0.210605 |
b04cbd151462272c28fb0ccf978f4c3ccbb776cd | 11,913 | py | Python | frontend/alexa/alexa.py | jjanetzki/HackHPI-2017 | 5345a4b385b92dff8b665818127e85eb1e14b31f | [
"MIT"
] | 1 | 2017-06-17T18:18:55.000Z | 2017-06-17T18:18:55.000Z | frontend/alexa/alexa.py | janetzki/Productivity-Bot | 5345a4b385b92dff8b665818127e85eb1e14b31f | [
"MIT"
] | null | null | null | frontend/alexa/alexa.py | janetzki/Productivity-Bot | 5345a4b385b92dff8b665818127e85eb1e14b31f | [
"MIT"
] | null | null | null | """
This code sample is a part of a simple demo to show beginners how to create a skill (app) for the Amazon Echo using AWS Lambda and the Alexa Skills Kit.
For the full code sample visit https://github.com/pmckinney8/Alexa_Dojo_Skill.git
"""
from __future__ import print_function
import requests
import json
alcohol_... | 39.44702 | 242 | 0.697138 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4,205 | 0.352976 |
b04d338c3d1c16a12edd8387b7d2185efd9aed7b | 474 | py | Python | day1.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | 2 | 2021-12-04T21:15:14.000Z | 2021-12-12T09:28:28.000Z | day1.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | null | null | null | day1.py | kdrag0n/aoc2021 | 469bd861a7d7c0add14412a705ec4cb1e1b5a10f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
def ints(itr):
return [int(i) for i in itr]
with open(sys.argv[1], "r") as f:
lines = [l for l in f.read().split("\n") if l]
ilist = []
imap = {}
total = 0
result = 0
other = 0
last = -1
while True:
for l in lines:
val = int(l.split()[0])
if last !... | 12.810811 | 50 | 0.529536 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 0.172996 |
b04e83f0c6c5bd946cc75a63519557d702719e38 | 2,142 | py | Python | pythingspeak/test_pythingspeak.py | mdauphin/pythingspeak | d5971e9347b17a14221564a368fe032ca6acaa03 | [
"MIT"
] | null | null | null | pythingspeak/test_pythingspeak.py | mdauphin/pythingspeak | d5971e9347b17a14221564a368fe032ca6acaa03 | [
"MIT"
] | null | null | null | pythingspeak/test_pythingspeak.py | mdauphin/pythingspeak | d5971e9347b17a14221564a368fe032ca6acaa03 | [
"MIT"
] | null | null | null | #-*- coding: utf-8 -*-
import pythingspeak
import unittest
class TestPyThingSpeak(unittest.TestCase):
def test_update(self):
ts = pythingspeak.ThingSpeak( channel_id=59596, api_key='ISXCEH1JHRQR85O4' )
results = ts.update( [ 1, 2 ] )
self.assertTrue(results)
def test_feeds(self):
ts = pythingspeak.ThingSpe... | 31.5 | 78 | 0.745565 | 2,028 | 0.946779 | 0 | 0 | 0 | 0 | 0 | 0 | 248 | 0.11578 |
b04f12eb656c69facb8b7d0c196d013597b90eb0 | 11,920 | py | Python | esst/utils/historygraph.py | etcher-be/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | 4 | 2018-06-24T14:03:44.000Z | 2019-01-21T01:20:02.000Z | esst/utils/historygraph.py | etcher-be/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | 106 | 2018-06-24T13:59:52.000Z | 2019-11-26T09:05:14.000Z | esst/utils/historygraph.py | theendsofinvention/esst | ac41cd0c07af8ca8532997f533756c529c9609a4 | [
"MIT"
] | null | null | null | # coding=utf-8
"""
Creates graphic of perfs
"""
import datetime
import typing
from collections import namedtuple
from tempfile import mktemp
import humanize
from esst.core import CTX
PLT = GRID_SPEC = TICKER = None
# https://stackoverflow.com/questions/4931376/generating-matplotlib-graphs-without-a-running-x-serv... | 32.747253 | 117 | 0.640017 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,552 | 0.214094 |
b04f60f28cbb6155e0266d15a62d61ce814d26c3 | 1,267 | py | Python | 20.valid-parentheses.py | Qianli-Ma/LeetCode | ebda421c3d652adffca5e547a22937bf1726a532 | [
"MIT"
] | null | null | null | 20.valid-parentheses.py | Qianli-Ma/LeetCode | ebda421c3d652adffca5e547a22937bf1726a532 | [
"MIT"
] | null | null | null | 20.valid-parentheses.py | Qianli-Ma/LeetCode | ebda421c3d652adffca5e547a22937bf1726a532 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=20 lang=python3
#
# [20] Valid Parentheses
#
# https://leetcode.com/problems/valid-parentheses/description/
#
# algorithms
# Easy (36.20%)
# Total Accepted: 554.4K
# Total Submissions: 1.5M
# Testcase Example: '"()"'
#
# Given a string containing just the characters '(', ')', '{', '}', '[' a... | 16.454545 | 75 | 0.534333 | 421 | 0.332019 | 0 | 0 | 0 | 0 | 0 | 0 | 801 | 0.631703 |
b0578e2fd0b0bbd54ee3add80281e9bcba12bdeb | 428 | py | Python | airypi/redis_queue.py | airypi/airypi | c7e3e781eaf2e6b3e2e87b576d5202e381544d0c | [
"Apache-2.0"
] | 3 | 2015-11-04T19:45:48.000Z | 2017-10-26T19:40:18.000Z | airypi/redis_queue.py | airypi/airypi | c7e3e781eaf2e6b3e2e87b576d5202e381544d0c | [
"Apache-2.0"
] | null | null | null | airypi/redis_queue.py | airypi/airypi | c7e3e781eaf2e6b3e2e87b576d5202e381544d0c | [
"Apache-2.0"
] | null | null | null | import redis
from flask import g, session
import device
import message_queue
import os
class RedisMQ(message_queue.MessageQueue):
redis = None
def push(self, data):
RedisMQ.redis.lpush(self.queue_key, data)
RedisMQ.redis.ltrim(self.queue_key, 0, self.max_size)
def pop(self):
... | 22.526316 | 61 | 0.698598 | 339 | 0.792056 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b05916119eca4a721a156d9e476326122efd26e2 | 4,956 | py | Python | rnnApp.py | RiboswitchClassifier/RiboswitchClassification | 4a4ab0590aa50aa765638b2bd8aa0cfd84054ac7 | [
"MIT"
] | 2 | 2019-12-16T13:08:28.000Z | 2021-02-23T03:03:18.000Z | rnnApp.py | RiboswitchClassifier/RiboswitchClassification | 4a4ab0590aa50aa765638b2bd8aa0cfd84054ac7 | [
"MIT"
] | null | null | null | rnnApp.py | RiboswitchClassifier/RiboswitchClassification | 4a4ab0590aa50aa765638b2bd8aa0cfd84054ac7 | [
"MIT"
] | 3 | 2019-01-01T06:00:20.000Z | 2020-01-28T13:57:49.000Z | import tensorflow as tf
import theano
import pandas as pd
import numpy as np
import matplotlib
# matplotlib.use('pdf')
import matplotlib.pyplot as plt
from keras.layers import Dense, Dropout, LSTM, Embedding, Activation, Lambda, Bidirectional
from sklearn.preprocessing import OneHotEncoder
from keras.engine import Inpu... | 43.858407 | 193 | 0.7841 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,443 | 0.291162 |
b05b358493a6597bac995a34db28dd63e04524e6 | 72 | py | Python | geetiles/config/prod.py | icpac-igad/gee-tiles | 713a58e00b4377dd54aeaa77416ad7fe7b2c9206 | [
"MIT"
] | 1 | 2020-09-28T12:23:25.000Z | 2020-09-28T12:23:25.000Z | geetiles/config/prod.py | icpac-igad/gee-tiles | 713a58e00b4377dd54aeaa77416ad7fe7b2c9206 | [
"MIT"
] | 6 | 2019-08-28T17:17:25.000Z | 2021-10-13T07:19:14.000Z | geetiles/config/prod.py | icpac-igad/gee-tiles | 713a58e00b4377dd54aeaa77416ad7fe7b2c9206 | [
"MIT"
] | 5 | 2019-11-15T10:37:56.000Z | 2021-07-15T08:07:27.000Z | """-"""
SETTINGS = {
'logging': {
'level': 'DEBUG'
}
}
| 9 | 24 | 0.347222 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 0.416667 |
b05bf40e3728937480f8f42cb9c975d60036475f | 6,911 | py | Python | neptune-python-utils/neptune_python_utils/glue_gremlin_client.py | Alfian878787/amazon-neptune-tools | a447da238e99612a290babc66878fe772727a19e | [
"Apache-2.0"
] | null | null | null | neptune-python-utils/neptune_python_utils/glue_gremlin_client.py | Alfian878787/amazon-neptune-tools | a447da238e99612a290babc66878fe772727a19e | [
"Apache-2.0"
] | null | null | null | neptune-python-utils/neptune_python_utils/glue_gremlin_client.py | Alfian878787/amazon-neptune-tools | a447da238e99612a290babc66878fe772727a19e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Amazon.com, Inc. or its affiliates.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | 46.073333 | 135 | 0.570395 | 5,751 | 0.832152 | 0 | 0 | 0 | 0 | 0 | 0 | 2,307 | 0.333816 |
b05fe1389ad39d5ec1240e047aa523f2264c0d97 | 343 | py | Python | floyd_warshall/messages/rate_request.py | hrs231/sample-code | 91c2972d1a414397d3505d3b4df9ee80b67bcac0 | [
"MIT"
] | null | null | null | floyd_warshall/messages/rate_request.py | hrs231/sample-code | 91c2972d1a414397d3505d3b4df9ee80b67bcac0 | [
"MIT"
] | null | null | null | floyd_warshall/messages/rate_request.py | hrs231/sample-code | 91c2972d1a414397d3505d3b4df9ee80b67bcac0 | [
"MIT"
] | null | null | null |
class RateRequest(object):
"""" Used by Price Engine Clients to query the Price Engine """
def __init__(self, exch_1, curr_1, exch_2, curr_2):
self.exch_1 = exch_1
self.curr_1 = curr_1
self.exch_2 = exch_2
self.curr_2 = curr_2
self.rate = 0
self.path = []
... | 28.583333 | 67 | 0.594752 | 341 | 0.994169 | 0 | 0 | 0 | 0 | 0 | 0 | 63 | 0.183673 |
b0618e2deaae21564649c946c7681a44ee75680f | 2,613 | py | Python | backend/app/api/api_v1/router/file/excel_tool.py | PY-GZKY/fastapi-crawl-admin | 6535054994d11e3c31b4caeae65e8fa0f495d2b7 | [
"MIT"
] | 13 | 2021-07-25T15:26:04.000Z | 2022-03-02T12:12:02.000Z | backend/app/api/api_v1/router/file/excel_tool.py | PY-GZKY/fastapi-crawl-admin | 6535054994d11e3c31b4caeae65e8fa0f495d2b7 | [
"MIT"
] | 1 | 2021-07-26T03:26:09.000Z | 2021-07-26T09:05:38.000Z | backend/app/api/api_v1/router/file/excel_tool.py | PY-GZKY/fastapi-crawl-admin | 6535054994d11e3c31b4caeae65e8fa0f495d2b7 | [
"MIT"
] | 3 | 2021-07-26T01:44:24.000Z | 2021-07-31T14:31:49.000Z | # -*- coding: utf-8 -*
# @Time : 2020/12/22 15:58
from fastapi import Depends
from motor.motor_asyncio import AsyncIOMotorClient
from app.api.db.mongoDB import get_database
import pandas as pd
import numpy as np
from io import BytesIO
class ExcelTools:
def __init__(self, columns_map=None, order=None):
... | 25.871287 | 87 | 0.564485 | 2,534 | 0.900818 | 0 | 0 | 0 | 0 | 0 | 0 | 828 | 0.294348 |
b0619b37fbd880320070eeeb51552bb149486090 | 1,164 | py | Python | Lab8/1 + 2 (Simple socket server)/simple_client.py | marianfx/python-labs | 7066db410ad19cababb7b66745641e65a28ccd98 | [
"MIT"
] | null | null | null | Lab8/1 + 2 (Simple socket server)/simple_client.py | marianfx/python-labs | 7066db410ad19cababb7b66745641e65a28ccd98 | [
"MIT"
] | null | null | null | Lab8/1 + 2 (Simple socket server)/simple_client.py | marianfx/python-labs | 7066db410ad19cababb7b66745641e65a28ccd98 | [
"MIT"
] | null | null | null | """Simple socket client for the simple socket client."""
import sys
import socket
import time
SOCKET_ADDRESS = "127.0.0.1"
SOCKET_PORT = 6996
def build_client_tcp(address: str, port: int):
"""Builds the TCP client."""
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(... | 28.390244 | 98 | 0.649485 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 300 | 0.257732 |
b062b0f29115369104d664570dbb03f1de934fe3 | 2,689 | py | Python | 009/app.py | ilos-vigil/random-script | bf8d45196d4faa6912dc0469a86b8370f43ce7ac | [
"MIT"
] | null | null | null | 009/app.py | ilos-vigil/random-script | bf8d45196d4faa6912dc0469a86b8370f43ce7ac | [
"MIT"
] | null | null | null | 009/app.py | ilos-vigil/random-script | bf8d45196d4faa6912dc0469a86b8370f43ce7ac | [
"MIT"
] | null | null | null | import bs4
import nltk
import json
import re
import requests
with open('./acronym_abbreviation_id.json', 'r') as f:
data = f.read()
list_acronym_abbreviation = json.loads(data)
from_wikipedia = False
if from_wikipedia:
# Take text with Indonesian language from Wikipedia randomly
html = requests.get('h... | 38.414286 | 430 | 0.661584 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,205 | 0.443667 |
b062c54e4119bba9afb9e6fce3e62bb1a445400e | 2,295 | py | Python | graphs/page_rank.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | graphs/page_rank.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | graphs/page_rank.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 25.21978 | 74 | 0.616122 | 404 | 0.176035 | 0 | 0 | 0 | 0 | 0 | 0 | 1,016 | 0.442702 |
b064a795cdfc5cdd50a92817a383a97f8144e544 | 4,330 | py | Python | DeepRTS/python/game.py | cair/deep-rts | 7aa5dde0c5df10ae3a3d057e7b89641aec58e115 | [
"MIT"
] | 144 | 2018-07-13T07:47:50.000Z | 2022-03-31T06:29:50.000Z | DeepRTS/python/game.py | cair/DeepRTS | 2ea4de0993ea0ca2677fdb36a172779db4ce7868 | [
"MIT"
] | 18 | 2019-03-29T10:37:01.000Z | 2022-03-02T12:47:34.000Z | DeepRTS/python/game.py | cair/DeepRTS | 2ea4de0993ea0ca2677fdb36a172779db4ce7868 | [
"MIT"
] | 23 | 2018-11-02T18:12:51.000Z | 2022-02-15T20:32:18.000Z | from DeepRTS import Engine, Constants
from DeepRTS.python import GUI
from DeepRTS.python import Config
from DeepRTS.python import DeepRTSPlayer
import numpy as np
import random
import os
import argparse
import gym
dir_path = os.path.dirname(os.path.realpath(__file__))
class Game(Engine.Game):
def __init__(se... | 26.564417 | 116 | 0.599769 | 4,055 | 0.93649 | 0 | 0 | 202 | 0.046651 | 0 | 0 | 629 | 0.145266 |
b064ac81a6a14605eca93bb63e07f0834ed4309a | 1,147 | py | Python | lairgpt/utils/assets.py | lightonai/lairgpt | 7580e1339a39662b2ff636d158c36195eb7fe3fb | [
"MIT"
] | 19 | 2021-05-04T13:54:45.000Z | 2022-01-05T15:45:12.000Z | lairgpt/utils/assets.py | lightonai/lairgpt | 7580e1339a39662b2ff636d158c36195eb7fe3fb | [
"MIT"
] | null | null | null | lairgpt/utils/assets.py | lightonai/lairgpt | 7580e1339a39662b2ff636d158c36195eb7fe3fb | [
"MIT"
] | 1 | 2021-05-28T15:25:12.000Z | 2021-05-28T15:25:12.000Z | from enum import Enum
from os.path import expanduser
from lairgpt.utils.remote import local_dir
class Config(Enum):
"""Settings for preconfigured models instances
"""
SMALL = {
"d_model": 768,
"n_heads": 12,
"n_layers": 12,
"vocab_size": 50262,
"max_seq_len": 1024
... | 23.408163 | 60 | 0.558849 | 1,045 | 0.911072 | 0 | 0 | 0 | 0 | 0 | 0 | 450 | 0.392328 |
b0651029340e768b51b715881e03f9826ce6837f | 1,546 | py | Python | smart_open/__init__.py | DataTron-io/smart_open | 3565eff8f0ffe19d7fd31063753384e0084fb1e0 | [
"MIT"
] | 1 | 2020-09-28T06:47:58.000Z | 2020-09-28T06:47:58.000Z | smart_open/__init__.py | DataTron-io/smart_open | 3565eff8f0ffe19d7fd31063753384e0084fb1e0 | [
"MIT"
] | null | null | null | smart_open/__init__.py | DataTron-io/smart_open | 3565eff8f0ffe19d7fd31063753384e0084fb1e0 | [
"MIT"
] | null | null | null | import shutil
from .smart_open_lib import *
DEFAULT_CHUNKSIZE = 16*1024*1024 # 16mb
def copy_file(src, dest, close_src=True, close_dest=True, make_path=False):
"""
Copies file from src to dest. Supports s3 and webhdfs (does not include kerberos support)
If src does not exist, a FileNotFoundError is rais... | 34.355556 | 138 | 0.679172 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 694 | 0.4489 |
b068470f8ca662453890dee9ded5d2a25fb6fcdd | 4,706 | py | Python | guacozy_server/backend/api/utils.py | yinm8315/guacozy-django-react | 99a8270cb660052d3b4868b7959a5750968d9cc3 | [
"MIT"
] | 121 | 2019-10-28T09:23:05.000Z | 2022-03-19T00:30:36.000Z | guacozy_server/backend/api/utils.py | peppelinux/guacozy | ff4ca3fae8b9a5cb379a7a73d39f0d0ea8b6521c | [
"MIT"
] | 43 | 2019-10-28T09:22:59.000Z | 2022-03-18T23:01:25.000Z | guacozy_server/backend/api/utils.py | peppelinux/guacozy | ff4ca3fae8b9a5cb379a7a73d39f0d0ea8b6521c | [
"MIT"
] | 44 | 2019-11-05T01:58:05.000Z | 2022-03-30T08:05:18.000Z | import rules
from backend.models import Folder
def add_folder_to_tree_dictionary(folder, resulting_set, include_ancestors=False):
"""
Adds folder, folder's ancestors and folder's descendants
Ancestors are needed to build the traverse path in tree view
Descendants are needed because user has permissi... | 36.765625 | 115 | 0.698683 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,043 | 0.434127 |
b06a64034b02fc50eab6da81b27b39ddfc4affcc | 348 | py | Python | web/services/device-service/src/app.py | fhgrings/match-io | 0acb0b006ae8d8073f1d148e80275a568c2517ae | [
"MIT"
] | null | null | null | web/services/device-service/src/app.py | fhgrings/match-io | 0acb0b006ae8d8073f1d148e80275a568c2517ae | [
"MIT"
] | null | null | null | web/services/device-service/src/app.py | fhgrings/match-io | 0acb0b006ae8d8073f1d148e80275a568c2517ae | [
"MIT"
] | null | null | null | from flask import Flask
from flask_cors import CORS
from src.ext import configuration
def minimal_app(**config):
app = Flask(__name__)
configuration.init_app(app, **config)
CORS(app)
return app
def create_app(**config):
app = minimal_app(**config)
configuration.load_extension... | 19.333333 | 42 | 0.672414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b06a839b9e9c3f3cd1914d16be145f347a1d20cd | 11,314 | py | Python | nyc/nyc-new-cases.py | btrr/covid19-epicenters | 4134967f6dbbdeb5ad91a435dc72d905e9886fd6 | [
"MIT"
] | 1 | 2020-04-02T15:48:28.000Z | 2020-04-02T15:48:28.000Z | nyc/nyc-new-cases.py | btrr/covid19-epicenters | 4134967f6dbbdeb5ad91a435dc72d905e9886fd6 | [
"MIT"
] | null | null | null | nyc/nyc-new-cases.py | btrr/covid19-epicenters | 4134967f6dbbdeb5ad91a435dc72d905e9886fd6 | [
"MIT"
] | null | null | null | import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import matplotlib.ticker as ticker
from matplotlib.dates import MO, TU, WE, TH, FR, SA, SU
dates = ['2/29/2020', '3/1/2020', '3/2/2020', '3/3/2020', '3/4/2020', '3/5/2020', '3/6/2020', '3/7/2020', '3/8/2020', '3/9/2020', '3/10/2020... | 176.78125 | 4,998 | 0.595457 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6,274 | 0.554534 |
b06d15947556e9e4b04c29a89022d993e3d2bccf | 4,357 | py | Python | src/face_utils/save_figure.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | null | null | null | src/face_utils/save_figure.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | null | null | null | src/face_utils/save_figure.py | hankyul2/FaceDA | 73006327df3668923d4206f81d4976ca1240329d | [
"Apache-2.0"
] | null | null | null | import os
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import albumentations as A
from pathlib import Path
import torch
from torch import nn
from src_backup.cdan import get_model
from src.backbone.iresnet import get_arcface_backbone
class MyModel(nn.Module):
def __init__(self, backbo... | 36.008264 | 116 | 0.627037 | 457 | 0.104889 | 0 | 0 | 0 | 0 | 0 | 0 | 428 | 0.098233 |
b070934d7222c882ff718596c5213477b01b49fc | 2,481 | py | Python | tests/unit/tests_standard_lib/tests_sample_generation/test_time_parser.py | monishshah18/pytest-splunk-addon | 1600f2c7d30ec304e9855642e63511780556b406 | [
"Apache-2.0"
] | 39 | 2020-06-09T17:37:21.000Z | 2022-02-08T01:57:35.000Z | tests/unit/tests_standard_lib/tests_sample_generation/test_time_parser.py | monishshah18/pytest-splunk-addon | 1600f2c7d30ec304e9855642e63511780556b406 | [
"Apache-2.0"
] | 372 | 2020-04-15T13:55:09.000Z | 2022-03-31T17:14:56.000Z | tests/unit/tests_standard_lib/tests_sample_generation/test_time_parser.py | isabella232/pytest-splunk-addon | 5e6ae2b47df7a1feb6f358bbbd1f02197b5024f6 | [
"Apache-2.0"
] | 22 | 2020-05-06T10:43:45.000Z | 2022-03-16T15:50:08.000Z | import pytest
from datetime import datetime
from freezegun import freeze_time
from pytest_splunk_addon.standard_lib.sample_generation.time_parser import (
time_parse,
)
@pytest.fixture(scope="session")
def tp():
return time_parse()
def generate_parameters():
result = []
for s in ("s", "sec", "secs"... | 37.590909 | 80 | 0.523176 | 909 | 0.366385 | 0 | 0 | 943 | 0.380089 | 0 | 0 | 432 | 0.174123 |
c65e7d463bac4685e30ec3b3b04bcf2f66cd3d98 | 2,756 | py | Python | igcollect/artfiles.py | brainexe/igcollect | 12a2fa81331f305f8852b5a30c8d90d2a8895738 | [
"MIT"
] | 15 | 2016-04-13T11:13:41.000Z | 2020-12-04T17:25:43.000Z | igcollect/artfiles.py | brainexe/igcollect | 12a2fa81331f305f8852b5a30c8d90d2a8895738 | [
"MIT"
] | 10 | 2016-12-01T15:15:31.000Z | 2020-05-07T13:54:57.000Z | igcollect/artfiles.py | brainexe/igcollect | 12a2fa81331f305f8852b5a30c8d90d2a8895738 | [
"MIT"
] | 18 | 2016-03-16T11:06:10.000Z | 2022-03-14T14:56:05.000Z | #!/usr/bin/env python
"""igcollect - Artfiles Hosting Metrics
Copyright (c) 2019 InnoGames GmbH
"""
import base64
from argparse import ArgumentParser
from time import time
try:
# Try importing the Python3 packages
from urllib.request import Request, urlopen
from urllib.parse import urlencode
except Impor... | 30.966292 | 77 | 0.589623 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 572 | 0.207547 |
c65ec057f48af79a642c8637764b523b537f83f6 | 5,459 | py | Python | sem/storage/corpus.py | YoannDupont/SEM | ff21c5dc9a8e99eda81dc266e67cfa97dec7c243 | [
"MIT"
] | 22 | 2016-11-13T21:08:58.000Z | 2021-04-26T07:04:54.000Z | sem/storage/corpus.py | Raphencoder/SEM | ff21c5dc9a8e99eda81dc266e67cfa97dec7c243 | [
"MIT"
] | 15 | 2016-11-15T10:21:07.000Z | 2021-11-08T10:08:05.000Z | sem/storage/corpus.py | Raphencoder/SEM | ff21c5dc9a8e99eda81dc266e67cfa97dec7c243 | [
"MIT"
] | 8 | 2016-11-15T10:21:41.000Z | 2022-03-04T21:28:05.000Z | # -*- coding: utf-8 -*-
"""
file: corpus.py
Description: defines the Corpus object. It is an object representation
of a CoNLL-formatted corpus.
author: Yoann Dupont
MIT License
Copyright (c) 2018 Yoann Dupont
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associa... | 32.301775 | 130 | 0.634365 | 3,877 | 0.710203 | 193 | 0.035354 | 755 | 0.138304 | 0 | 0 | 1,653 | 0.302803 |
c660dc00601aa00fc2df39ad1285ba2cbf2bab57 | 3,426 | py | Python | recbole/utils/inferred_lm.py | ghazalehnt/RecBole | f1219847005e2c8d72b8c3cd5c49a138fe83276d | [
"MIT"
] | null | null | null | recbole/utils/inferred_lm.py | ghazalehnt/RecBole | f1219847005e2c8d72b8c3cd5c49a138fe83276d | [
"MIT"
] | null | null | null | recbole/utils/inferred_lm.py | ghazalehnt/RecBole | f1219847005e2c8d72b8c3cd5c49a138fe83276d | [
"MIT"
] | null | null | null | import time
import torch
from recbole.config import Config
from recbole.utils import get_model, init_seed
import gensim
import gensim.downloader as api
from recbole.data import create_dataset, data_preparation
import numpy as np
URL_FIELD = "item_url"
class ItemLM:
def __init__(self, checkpoint_file, model_name,... | 40.305882 | 140 | 0.613543 | 3,170 | 0.925277 | 0 | 0 | 0 | 0 | 0 | 0 | 234 | 0.068301 |
c660f9f806690fc5f7e2f8042a3e47405144af39 | 2,842 | py | Python | alchemist_py/parsetab.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | null | null | null | alchemist_py/parsetab.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-08-04T14:14:09.000Z | 2021-08-04T14:14:09.000Z | alchemist_py/parsetab.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-07-15T07:05:42.000Z | 2021-07-15T07:05:42.000Z |
# parsetab.py
# This file is automatically generated. Do not edit.
# pylint: disable=W,C,R
_tabversion = '3.10'
_lr_method = 'LALR'
_lr_signature = 'INTEGER L_BRACE L_BRACKET RESERVED R_BRACE R_BRACKET SEMICOLON STRUCT TYPE_BOOL TYPE_CSTDINT TYPE_PRIMITIVE_FLOAT TYPE_PRIMITIVE_INT TYPE_STRING TYPE_UNSIGNED VAR_NAMEM... | 64.590909 | 622 | 0.611189 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,612 | 0.567206 |
c665a58b2ec63745fb6a56eded667c424d56d832 | 548 | py | Python | fisica.py | Kenedw/RSSF | b9e7f2f0c6f2304af4de645039e70800d22d2b0c | [
"MIT"
] | 1 | 2019-09-01T20:28:35.000Z | 2019-09-01T20:28:35.000Z | fisica.py | Kenedw/RSSF | b9e7f2f0c6f2304af4de645039e70800d22d2b0c | [
"MIT"
] | null | null | null | fisica.py | Kenedw/RSSF | b9e7f2f0c6f2304af4de645039e70800d22d2b0c | [
"MIT"
] | 1 | 2019-05-18T00:09:26.000Z | 2019-05-18T00:09:26.000Z | from packet import packet
# Camada Fisica
class fisica():
'''
@param link list(hosts)
@param ativo boolean (true|false)
'''
def __init__(self):
self.__link = []
# self.__link = link
self.__is_ativo = False
self.__dado = packet
def __SetAtivo(self,ativo):
self.__is_ativo = ativo
de... | 18.896552 | 47 | 0.669708 | 504 | 0.919708 | 0 | 0 | 0 | 0 | 0 | 0 | 107 | 0.195255 |
c666e9dcacd68dd1abb51bc4ffb6d2640c170719 | 11,792 | py | Python | programs/pyeos/tests/python/cryptokitties/kittyownership.py | learnforpractice/pyeos | 4f04eb982c86c1fdb413084af77c713a6fda3070 | [
"MIT"
] | 144 | 2017-10-18T16:38:51.000Z | 2022-01-09T12:43:57.000Z | programs/pyeos/tests/python/cryptokitties/kittyownership.py | openchatproject/safeos | 2c8dbf57d186696ef6cfcbb671da9705b8f3d9f7 | [
"MIT"
] | 60 | 2017-10-11T13:07:43.000Z | 2019-03-26T04:33:27.000Z | programs/pyeos/tests/python/cryptokitties/kittyownership.py | learnforpractice/pyeos | 4f04eb982c86c1fdb413084af77c713a6fda3070 | [
"MIT"
] | 38 | 2017-12-05T01:13:56.000Z | 2022-01-07T07:06:53.000Z | from backend import *
from basement import *
from pausable import *
from kittyaccesscontrol import *
from kittybase import KittyBase
from erc721 import ERC721
from erc721metadata import ERC721Metadata
# @title The facet of the CryptoKitties core contract that manages ownership, ERC-721 (draft) compliant.
# @author Ax... | 45.180077 | 118 | 0.672914 | 11,277 | 0.956326 | 0 | 0 | 1,227 | 0.104054 | 0 | 0 | 7,699 | 0.6529 |
c6690d881a99354cf92a13a7b705df947e112eb1 | 5,009 | py | Python | menu.py | kokohi28/stock-prediction | 82d18cbb6366d522a01252e0cdc6eafa9fffea6d | [
"MIT"
] | 11 | 2020-06-15T12:38:57.000Z | 2021-12-08T13:34:28.000Z | menu.py | kokohi28/stock-prediction | 82d18cbb6366d522a01252e0cdc6eafa9fffea6d | [
"MIT"
] | null | null | null | menu.py | kokohi28/stock-prediction | 82d18cbb6366d522a01252e0cdc6eafa9fffea6d | [
"MIT"
] | 5 | 2020-12-17T16:58:36.000Z | 2022-02-08T09:29:28.000Z | import os
import const as CONST
from datetime import datetime
# Const
MENU_ROOT = 0
MENU_SPECIFY_DATE = 1
MENU_SPECIFY_PERCENT_TRAINED = 2
currMenu = MENU_ROOT
stockList = ['AAPL', '^DJI', '^HSI', '^GSPC']
def welcomeMessage():
print('##############################################################################'... | 27.075676 | 89 | 0.502296 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,652 | 0.329806 |
c6692746527064fc0f46c5e36e6e97f09870ae4f | 3,410 | py | Python | demo/infinity/triton_client.py | dumpmemory/transformer-deploy | 36993d8dd53c7440e49dce36c332fa4cc08cf9fb | [
"Apache-2.0"
] | 698 | 2021-11-22T17:42:40.000Z | 2022-03-31T11:16:08.000Z | demo/infinity/triton_client.py | dumpmemory/transformer-deploy | 36993d8dd53c7440e49dce36c332fa4cc08cf9fb | [
"Apache-2.0"
] | 38 | 2021-11-23T13:45:04.000Z | 2022-03-31T10:36:45.000Z | demo/infinity/triton_client.py | dumpmemory/transformer-deploy | 36993d8dd53c7440e49dce36c332fa4cc08cf9fb | [
"Apache-2.0"
] | 58 | 2021-11-24T11:46:21.000Z | 2022-03-29T08:45:16.000Z | # Copyright 2022, Lefebvre Dalloz Services
#
# 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 ag... | 46.712329 | 117 | 0.72346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,512 | 0.442882 |
c66969c34948d04bc70f6e069bd8dabc5e27f5b6 | 2,361 | py | Python | mf/knnbased.py | waashk/extended-pipeline | 1f8cdfcd1530a9dd502ea0d76d89b5010d19daf7 | [
"MIT"
] | null | null | null | mf/knnbased.py | waashk/extended-pipeline | 1f8cdfcd1530a9dd502ea0d76d89b5010d19daf7 | [
"MIT"
] | null | null | null | mf/knnbased.py | waashk/extended-pipeline | 1f8cdfcd1530a9dd502ea0d76d89b5010d19daf7 | [
"MIT"
] | null | null | null |
import numpy as np
from tqdm import tqdm
from scipy.sparse import csr_matrix, hstack, vstack
from sklearn.neighbors import NearestNeighbors
class MFKnn(object):
"""
Implementation of
"""
def __init__(self, metric, k):
self.k = k
self.metric = metric
def fit(self, X, y):
#
self.X_train = X
self.y_tr... | 23.147059 | 105 | 0.647183 | 2,216 | 0.938585 | 0 | 0 | 0 | 0 | 0 | 0 | 160 | 0.067768 |
c66bd961fbf8bcb3556ef3c4fc46854f04ab9b95 | 581 | py | Python | general-practice/Exercises solved/codingbat/Warmup2/string_match.py | lugabrielbueno/Projeto | f012c5bb9ce6f6d7c9e8196cc7986127dba3eba0 | [
"MIT"
] | null | null | null | general-practice/Exercises solved/codingbat/Warmup2/string_match.py | lugabrielbueno/Projeto | f012c5bb9ce6f6d7c9e8196cc7986127dba3eba0 | [
"MIT"
] | null | null | null | general-practice/Exercises solved/codingbat/Warmup2/string_match.py | lugabrielbueno/Projeto | f012c5bb9ce6f6d7c9e8196cc7986127dba3eba0 | [
"MIT"
] | null | null | null | #Given 2 strings, a and b, return the number of the positions where they contain the same length 2 substring. So "xxcaazz" and "xxbaaz" yields 3, since the "xx", "aa", and "az" substrings appear in the same place in both strings.
#string_match('xxcaazz', 'xxbaaz') → 3
#string_match('abc', 'abc') → 2
#string_match('abc... | 34.176471 | 229 | 0.593804 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 335 | 0.570698 |
c66c55f72d0c193656a8d7f34187cd20b4099a6f | 2,458 | py | Python | pycondor/tools.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 6 | 2015-04-17T08:25:30.000Z | 2020-04-11T23:58:16.000Z | pycondor/tools.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 3 | 2015-12-22T07:40:02.000Z | 2019-01-21T15:07:00.000Z | pycondor/tools.py | kant/pycondor | ee87854504e8f4023feda860d8a9ddbecc7a70da | [
"BSD-3-Clause"
] | 6 | 2015-11-13T18:55:22.000Z | 2020-03-12T19:32:56.000Z | #!/usr/bin/env python
#-*- coding:utf-8 -*-
"""
Tools
http://en.wikipedia.org/wiki/Haversine_formula
ToDo: ToFix / ToTest
"""
import math
def waypoint_bearing(lat1, lon1, lat2, lon2):
"""
Calculates the bearing between 2 locations.
Method calculates the bearing between 2 locations.
@param lon1 ... | 25.340206 | 83 | 0.633849 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 920 | 0.374288 |
c66f914aa66ae752fa396361357e16cd39293db5 | 10,951 | py | Python | courses/views.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | 4 | 2015-06-23T22:17:50.000Z | 2019-01-17T21:32:02.000Z | courses/views.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | null | null | null | courses/views.py | mdavoodi/konkourse-python | 50f2904e7bbb31f00c4dd66fb55cd644ea3c4eee | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, render_to_response
from django.template.context import RequestContext
from account.views import login
from models import Course
from website.views import index
from forms import CourseForm, CourseInitialForm
from account.util import createImage
from django.core.context_pro... | 37.892734 | 116 | 0.649621 | 0 | 0 | 77 | 0.007031 | 973 | 0.08885 | 0 | 0 | 942 | 0.08602 |
c67157381752f709d6b39cd4632427d8936411ad | 2,701 | py | Python | rx/operators/observable/delaywithselector.py | yutiansut/RxPY | c3bbba77f9ebd7706c949141725e220096deabd4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-11-16T09:07:13.000Z | 2018-11-16T09:07:13.000Z | rx/operators/observable/delaywithselector.py | yutiansut/RxPY | c3bbba77f9ebd7706c949141725e220096deabd4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | rx/operators/observable/delaywithselector.py | yutiansut/RxPY | c3bbba77f9ebd7706c949141725e220096deabd4 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-05-08T08:23:08.000Z | 2020-05-08T08:23:08.000Z | from rx.core import ObservableBase, AnonymousObservable, typing
from rx.disposables import CompositeDisposable, \
SingleAssignmentDisposable, SerialDisposable
def delay_with_selector(self, subscription_delay=None,
delay_duration_mapper=None) -> ObservableBase:
"""Time shifts the observ... | 32.154762 | 108 | 0.585339 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 668 | 0.247316 |
c6715e41c59947802aabe44b258270730dfcbb52 | 719 | py | Python | w2/palindrome.py | connorw72/connorapcsptri3 | 2e885644ed2a8d478e5ce193f94b02ad03c6e6b3 | [
"MIT"
] | null | null | null | w2/palindrome.py | connorw72/connorapcsptri3 | 2e885644ed2a8d478e5ce193f94b02ad03c6e6b3 | [
"MIT"
] | 3 | 2022-03-14T21:10:05.000Z | 2022-03-28T21:11:17.000Z | w2/palindrome.py | connorw72/connorapcsptri3 | 2e885644ed2a8d478e5ce193f94b02ad03c6e6b3 | [
"MIT"
] | 2 | 2022-03-10T06:11:11.000Z | 2022-03-11T06:11:11.000Z | class Palindrome:
def __init__(self, test):
self.test = test
def __call__(self):
test_strip = list([n for n in self.test if n.isalpha() or n.isnumeric()])
self.test = "".join(test_strip)
self.test = self.test.lower()
#Test to see if the phrase/word is a palindrome
... | 31.26087 | 81 | 0.585535 | 445 | 0.618915 | 0 | 0 | 0 | 0 | 0 | 0 | 193 | 0.268428 |
c672a5daf5acf1852874d76a788a6d4edc536ca3 | 3,890 | py | Python | sat-competition-2018/xof-state/sha3-xof.py | cipherboy/sat | 65cbcebf03ffdfd64d49359ebb1d654c73e2c720 | [
"MIT"
] | 1 | 2019-01-19T23:04:50.000Z | 2019-01-19T23:04:50.000Z | sat-competition-2018/xof-state/sha3-xof.py | cipherboy/sat | 65cbcebf03ffdfd64d49359ebb1d654c73e2c720 | [
"MIT"
] | null | null | null | sat-competition-2018/xof-state/sha3-xof.py | cipherboy/sat | 65cbcebf03ffdfd64d49359ebb1d654c73e2c720 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import hash_framework as hf
hf.config.model_dir = "/home/cipherboy/GitHub/sat/sat-competition-2018/models"
import time, sys, os, random
run = False
release = False
if '--run' in sys.argv:
run = True
if '--release' in sys.argv:
release = True
if '-h' in sys.argv or '--help' in sys.argv:... | 28.814815 | 103 | 0.554756 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 842 | 0.216452 |
c6739210f1e8d51ce9d34502997456a48bfc0ddd | 3,357 | py | Python | methinks/db.py | andreasgrv/methinks | 5c65fdb84e35b8082ee35963431a352e06f4af44 | [
"BSD-3-Clause"
] | null | null | null | methinks/db.py | andreasgrv/methinks | 5c65fdb84e35b8082ee35963431a352e06f4af44 | [
"BSD-3-Clause"
] | null | null | null | methinks/db.py | andreasgrv/methinks | 5c65fdb84e35b8082ee35963431a352e06f4af44 | [
"BSD-3-Clause"
] | null | null | null | import os
import datetime
import xxhash
import json
from flask_sqlalchemy import SQLAlchemy
from methinks.utils import str_to_date
from methinks.config import get_default_conf
db = SQLAlchemy()
class Entry(db.Model):
__tablename__ = 'entry'
id = db.Column(db.Integer, primary_key=True)
hexid = db.Colum... | 31.373832 | 89 | 0.593983 | 3,157 | 0.940423 | 0 | 0 | 1,744 | 0.519511 | 0 | 0 | 214 | 0.063747 |
c673cb49bd602adacaeaaa1c827fbb7abab3bbf6 | 580 | py | Python | functional/decorator.py | LaurenceYang/learn-python | 819994039abd3af298f73b1a73976eaa95071096 | [
"Apache-2.0"
] | 2 | 2018-01-20T03:38:58.000Z | 2019-07-21T11:33:24.000Z | functional/decorator.py | LaurenceYang/learn-python | 819994039abd3af298f73b1a73976eaa95071096 | [
"Apache-2.0"
] | null | null | null | functional/decorator.py | LaurenceYang/learn-python | 819994039abd3af298f73b1a73976eaa95071096 | [
"Apache-2.0"
] | null | null | null | import functools
def log(func):
@functools.wraps(func)
def wrapper(*args, **kw):
print('call %s():' % func.__name__)
return func(*args, **kw)
return wrapper
@log
def now():
print('2018-01-29')
now()
def logger(text):
def decorator(func):
@functools.wraps(func)
def... | 17.575758 | 58 | 0.568966 | 0 | 0 | 0 | 0 | 382 | 0.658621 | 0 | 0 | 67 | 0.115517 |
c6742b09c8b11bbe5babccf11451efdfb75310ee | 2,797 | py | Python | dense_estimation/points_estimation.py | zouzhenhong98/kitti-tools | 30b7d5c799ca2a44fe88522f6d46ad2a53c61d53 | [
"MIT"
] | 7 | 2020-01-03T13:05:36.000Z | 2021-08-03T07:51:43.000Z | dense_estimation/points_estimation.py | zouzhenhong98/kitti-tools | 30b7d5c799ca2a44fe88522f6d46ad2a53c61d53 | [
"MIT"
] | null | null | null | dense_estimation/points_estimation.py | zouzhenhong98/kitti-tools | 30b7d5c799ca2a44fe88522f6d46ad2a53c61d53 | [
"MIT"
] | 3 | 2020-07-07T03:35:06.000Z | 2021-07-21T11:40:38.000Z | '''
point clouds estimation: transfer sparse map to dense map,
work for both depth and reflectance.
'''
import sys
sys.path.append("..")
from utils import data_provider
from utils import velo_2_cam
import numpy as np
# fetch image and point clouds: coordinates and reflectance
def rawData(pc_path_, img_path_):
... | 35.405063 | 111 | 0.598498 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,011 | 0.361459 |
c6770cd7813960cae894c7947e2f76b45e5169f4 | 1,014 | py | Python | tests/run_compiler.py | yshrdbrn/ogle | 529337203b1bd3ec66c08f4ed153dba5fc8349a1 | [
"MIT"
] | null | null | null | tests/run_compiler.py | yshrdbrn/ogle | 529337203b1bd3ec66c08f4ed153dba5fc8349a1 | [
"MIT"
] | null | null | null | tests/run_compiler.py | yshrdbrn/ogle | 529337203b1bd3ec66c08f4ed153dba5fc8349a1 | [
"MIT"
] | null | null | null | from ogle.code_generator.code_generator import CodeGenerator
from ogle.lexer.lexer import Lexer
from ogle.parser.parser import Parser
from ogle.semantic_analyzer.semantic_analyzer import SemanticAnalyzer
def _get_errors_warnings(all_errors):
errors = [e for e in all_errors if 'Error' in e[1]]
warnings = [e for... | 36.214286 | 82 | 0.759369 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0.018738 |
c678c38909ca5f9f3348fe7d0e9471e1720d3bee | 817 | py | Python | graph/dfs_dict_attempt2.py | automoto/python-code-golf | 1a4e0b5984e64620637de9d80e82c6e89997f4af | [
"MIT"
] | null | null | null | graph/dfs_dict_attempt2.py | automoto/python-code-golf | 1a4e0b5984e64620637de9d80e82c6e89997f4af | [
"MIT"
] | null | null | null | graph/dfs_dict_attempt2.py | automoto/python-code-golf | 1a4e0b5984e64620637de9d80e82c6e89997f4af | [
"MIT"
] | null | null | null | # !depth first search !dfs !graph
# dict of nodes as the key and sets for the edges(children)
graph = {'A': set(['B', 'C', 'D']),
'B': set(['E', 'F']),
'C': set([]),
'D': set(['G', 'H']),
'E': set([]),
'F': set(['I', 'J']),
'G': set(['K']),
'H': set([]),
'I': set([]),
'J': set([]),
'K': ... | 24.029412 | 63 | 0.597307 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 423 | 0.517748 |