hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d51947422b3339afff96c1f8d98cf521285b5593 | 44,042 | py | Python | trac/util/datefmt.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/util/datefmt.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | trac/util/datefmt.py | mikiec84/trac | d51a7119b9fcb9061d7fe135c7d648fa671555dd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2020 Edgewall Software
# Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2006 Matthew Good <trac@matt-good.net>
# Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org>
# All rights reserved.
#
# This software is licensed as described in t... | 36.579734 | 79 | 0.568412 |
d5195f203c37c04c5f47351741e2287b86becab3 | 3,298 | bzl | Python | deploy/starlark/config_test.bzl | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | null | null | null | deploy/starlark/config_test.bzl | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | null | null | null | deploy/starlark/config_test.bzl | kourtneyshort/healthcare | 1d1e2375304ac99f43a8b6aee7374fcdf641eb6f | [
"Apache-2.0"
] | null | null | null | """Test rule that fails if a project config is not valid."""
def _impl(ctx):
"""Core implementation of _config_test rule."""
content = "{config_loader} --config_path {path}".format(
config_loader = ctx.executable._config_loader.short_path,
path = ctx.file.config.short_path,
)
if ctx.fi... | 35.462366 | 119 | 0.60188 |
d5196f1910905f1fea89a3a797872e2d65fdf7f0 | 2,500 | py | Python | src/authentication/serializers.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | 1 | 2016-01-18T08:19:22.000Z | 2016-01-18T08:19:22.000Z | src/authentication/serializers.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | null | null | null | src/authentication/serializers.py | litedesk/litedesk-webserver-provision | 1576b9d3e5e2e64d1136d276767c2710cfb1938f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
from django.contrib import messages
from django.contrib.sessions.models import Session
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from rest_framework.reverse import reverse
from rest_framework import serializers
class SessionS... | 33.783784 | 94 | 0.6836 |
d519718a7c89108843f764792a79005b3024c8bb | 2,401 | py | Python | scripts/send_queued_mails.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | scripts/send_queued_mails.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | scripts/send_queued_mails.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | import logging
from django.db import transaction
from django.utils import timezone
from modularodm import Q
from framework.celery_tasks import app as celery_app
from website.app import init_app
from website import mails, settings
from scripts.utils import add_file_logger
logger = logging.getLogger(__name__)
loggi... | 33.347222 | 125 | 0.650979 |
d519f0e6cd2c526150d23609c4d8fb53b6ece8fe | 2,009 | py | Python | feature_extraction_techniques/plp.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 203 | 2018-03-20T13:39:52.000Z | 2022-03-24T07:52:31.000Z | feature_extraction_techniques/plp.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 3 | 2019-01-15T07:39:02.000Z | 2021-06-07T11:29:34.000Z | feature_extraction_techniques/plp.py | gionanide/Speech-Signal-Processing-and-Classification | eff023fd491697a89cdb0491393d2e9600b65895 | [
"MIT"
] | 68 | 2018-05-03T06:40:38.000Z | 2022-02-13T04:30:57.000Z | #!usr/bin/python
import numpy
import numpy.matlib
import scipy
from scipy.fftpack.realtransforms import dct
from sidekit.frontend.vad import pre_emphasis
from sidekit.frontend.io import *
from sidekit.frontend.normfeat import *
from sidekit.frontend.features import *
import scipy.io.wavfile as wav
import numpy as np
... | 32.403226 | 111 | 0.744649 |
d51a117f4e43eeae067b38cb8324bed6bf40a1e9 | 70 | py | Python | emlx_parse/__init__.py | crb912/emlx_parse | c1e87fb356762f50542dcdad6295e380b2eeda4a | [
"MIT"
] | 8 | 2019-08-29T00:46:05.000Z | 2022-01-02T11:59:38.000Z | emlx_parse/__init__.py | crb912/emlx_parse | c1e87fb356762f50542dcdad6295e380b2eeda4a | [
"MIT"
] | null | null | null | emlx_parse/__init__.py | crb912/emlx_parse | c1e87fb356762f50542dcdad6295e380b2eeda4a | [
"MIT"
] | null | null | null | from .emlx import Emlx
__name__ = 'emlx_parse'
__version__ = '1.0.0'
| 14 | 23 | 0.714286 |
d51a401e5b6264315f3518644b74694beef69901 | 575 | py | Python | src/spacy_affixes/__main__.py | linhd-postdata/spacy-affixes | c4aff3a75cec8f782cced8a7765fbfb25369d677 | [
"Apache-2.0"
] | 3 | 2019-11-21T09:55:41.000Z | 2020-07-18T04:01:10.000Z | src/spacy_affixes/__main__.py | linhd-postdata/spacy-affixes | c4aff3a75cec8f782cced8a7765fbfb25369d677 | [
"Apache-2.0"
] | 19 | 2019-05-28T11:20:39.000Z | 2021-02-16T09:16:32.000Z | src/spacy_affixes/__main__.py | linhd-postdata/spacy-affixes | c4aff3a75cec8f782cced8a7765fbfb25369d677 | [
"Apache-2.0"
] | null | null | null | import sys
from .utils import download
USAGE = """Usage:
python -m spacy_affixes download lang [version]
Parameters:
- lang. Two characters code for a language
- version. (Optional) Version to use (defaults to '4.1')
For example, the default behaviour is:
python -m spacy_affixes download es 4.1
"""
if __name... | 27.380952 | 56 | 0.667826 |
d51a5cf70e29c077a3ee4d3dd3cdf713a598a55f | 47 | py | Python | test/test_job_array/test_config.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | test/test_job_array/test_config.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | test/test_job_array/test_config.py | hchau630/nn-analysis | 0fbe7ad7b2b4566b9f88d8f21413a6d405f96bdc | [
"MIT"
] | null | null | null | model_one 0 1 2 hello 1
model_two 11 12 13 hi 0 | 23.5 | 23 | 0.765957 |
d51a5e6f919075bd6630553c1883af15ffa47fdc | 1,494 | py | Python | quote_splashRequest_adv/jsquotescrape/spiders/jsquote.py | barnwalp/web_scrapping | 776d9d00d406976959caeb707850e0b871676552 | [
"MIT"
] | null | null | null | quote_splashRequest_adv/jsquotescrape/spiders/jsquote.py | barnwalp/web_scrapping | 776d9d00d406976959caeb707850e0b871676552 | [
"MIT"
] | null | null | null | quote_splashRequest_adv/jsquotescrape/spiders/jsquote.py | barnwalp/web_scrapping | 776d9d00d406976959caeb707850e0b871676552 | [
"MIT"
] | null | null | null | import scrapy
from scrapy_splash import SplashRequest
from scrapy.shell import inspect_response
class QuoteSpider(scrapy.Spider):
name = 'jsquote'
user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36'
script = """
function main(spl... | 29.88 | 123 | 0.532129 |
d51a72412ac85221973f8107d7901c4a179db764 | 517 | py | Python | mail_archives/__manifest__.py | trojikman/mail-addons | 193caa9af759700a588cdec8910ccbad05b59104 | [
"MIT"
] | 1 | 2020-12-07T19:52:33.000Z | 2020-12-07T19:52:33.000Z | mail_archives/__manifest__.py | trojikman/mail-addons | 193caa9af759700a588cdec8910ccbad05b59104 | [
"MIT"
] | null | null | null | mail_archives/__manifest__.py | trojikman/mail-addons | 193caa9af759700a588cdec8910ccbad05b59104 | [
"MIT"
] | null | null | null | {
"name": "Mail archives",
"summary": """Adds menu to find old messages""",
"category": "Discuss",
"images": ["images/1.jpg"],
"version": "13.0.1.0.1",
"author": "IT-Projects LLC, Pavel Romanchenko",
"support": "apps@itpp.dev",
"website": "https://itpp.dev",
"license": "Other OSI app... | 28.722222 | 52 | 0.55706 |
d51a7270c583f888456359fbf0a6819b9a2f89d6 | 2,582 | py | Python | projects/euler/problems/problem_008.py | jmsung/jmsung-research | c31f5a68e78b75e76b383bf6d2a2c4c478f6f566 | [
"MIT"
] | null | null | null | projects/euler/problems/problem_008.py | jmsung/jmsung-research | c31f5a68e78b75e76b383bf6d2a2c4c478f6f566 | [
"MIT"
] | null | null | null | projects/euler/problems/problem_008.py | jmsung/jmsung-research | c31f5a68e78b75e76b383bf6d2a2c4c478f6f566 | [
"MIT"
] | null | null | null | """
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832.
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
6689... | 40.984127 | 106 | 0.89543 |
d51a74367b87a685df32a0afdb947e6137b44d94 | 2,142 | py | Python | tests/test_api_auth.py | MontrealCorpusTools/iscan-server | 1ba1fba87a9e2a1a3b29b6df1c485a45535ea071 | [
"MIT"
] | 5 | 2018-12-27T10:52:56.000Z | 2021-04-26T07:13:52.000Z | tests/test_api_auth.py | MontrealCorpusTools/polyglot-server | 1ba1fba87a9e2a1a3b29b6df1c485a45535ea071 | [
"MIT"
] | 128 | 2018-06-18T17:20:25.000Z | 2018-10-11T21:32:44.000Z | tests/test_api_auth.py | MontrealCorpusTools/ISCAN | 1ba1fba87a9e2a1a3b29b6df1c485a45535ea071 | [
"MIT"
] | null | null | null | from django.urls import reverse
from rest_framework import status
from rest_framework.test import APITestCase, APILiveServerTestCase
from iscan.models import Database
from iscan.api import DatabaseViewSet
from rest_framework.test import APIClient, APIRequestFactory
from django.test import TestCase, override_settings
fr... | 35.7 | 111 | 0.678805 |
d51a879b41301f41a2fef9ca060f2a012525122f | 3,230 | py | Python | test/test_feed.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | 2 | 2019-08-18T11:05:25.000Z | 2019-11-17T02:07:18.000Z | test/test_feed.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | 3 | 2018-07-26T17:56:30.000Z | 2018-07-27T20:23:27.000Z | test/test_feed.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | 3 | 2018-07-25T22:53:31.000Z | 2018-09-16T06:14:43.000Z | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import io
import sys
import datetime
import xml.etree.ElementTree as etree
import xml.dom.minidom
import pytest
from as... | 26.916667 | 94 | 0.669659 |
d51a89e307cd91ac38f3ed37f54459478fde89b8 | 25,589 | py | Python | lrs/tests/AgentManagerTests.py | ELSUru/ADL_LRS | aabeb9cf3e56795b148f37d07e1bb2b41e61e470 | [
"Apache-2.0"
] | null | null | null | lrs/tests/AgentManagerTests.py | ELSUru/ADL_LRS | aabeb9cf3e56795b148f37d07e1bb2b41e61e470 | [
"Apache-2.0"
] | null | null | null | lrs/tests/AgentManagerTests.py | ELSUru/ADL_LRS | aabeb9cf3e56795b148f37d07e1bb2b41e61e470 | [
"Apache-2.0"
] | null | null | null | import hashlib
import json
import base64
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.conf import settings
from ..models import Agent, Statement
from ..views import register, statements
from ..objects.AgentManager import AgentManager
class AgentManagerTests(TestCase):
... | 46.106306 | 131 | 0.631912 |
d51a93ed76e88c3ce2598ae8370866a0f03fb408 | 433 | py | Python | tests/case/util_module.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 2,266 | 2015-01-01T08:47:33.000Z | 2022-03-21T05:02:55.000Z | tests/case/util_module.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 221 | 2015-01-13T01:55:57.000Z | 2022-02-25T23:23:35.000Z | tests/case/util_module.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 315 | 2015-01-23T06:38:55.000Z | 2022-03-27T08:33:33.000Z | from unittest import TestCase
from grab.util.module import import_string, ImportStringError
class UtilModuleTestCase(TestCase):
def test_import_string(self):
mod = import_string('tests.case.util_module')
self.assertTrue(hasattr(mod, 'UtilModuleTestCase'))
def test_import_string_error(self):
... | 30.928571 | 61 | 0.720554 |
d51a9810f3400a8860d634bc315d0793b351b4de | 576 | py | Python | tests/integration/__init__.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 21 | 2017-01-26T21:23:57.000Z | 2021-08-07T02:56:49.000Z | tests/integration/__init__.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 151 | 2016-11-29T05:09:33.000Z | 2021-05-19T22:47:58.000Z | tests/integration/__init__.py | shawn-rusaw/aws-lambda-fsm-workflows | 9fcf5af14bf0f4500d4a7e7b3e0eda00423c1d42 | [
"Apache-2.0"
] | 17 | 2016-11-29T05:07:58.000Z | 2021-05-04T21:22:29.000Z | # Copyright 2016 Workiva 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 agreed to in writing,... | 41.142857 | 74 | 0.762153 |
d51aad3d418e2c165426c2c84c736d5f1bb6ffb7 | 568 | py | Python | missioncontrol/home/migrations/0017_pass_attributes.py | fleetspace/missioncontrol | d7116569b689875f5d149273150c3ce4c1319cd0 | [
"Apache-2.0"
] | 7 | 2019-03-29T06:05:08.000Z | 2021-07-29T07:49:49.000Z | missioncontrol/home/migrations/0017_pass_attributes.py | fleetspace/missioncontrol | d7116569b689875f5d149273150c3ce4c1319cd0 | [
"Apache-2.0"
] | 18 | 2019-02-19T05:59:34.000Z | 2021-05-18T03:05:30.000Z | missioncontrol/home/migrations/0017_pass_attributes.py | fleetspace/missioncontrol | d7116569b689875f5d149273150c3ce4c1319cd0 | [
"Apache-2.0"
] | 3 | 2019-01-31T02:07:38.000Z | 2019-08-04T14:52:02.000Z | # Generated by Django 2.1.4 on 2019-01-22 02:37
import django.contrib.postgres.fields.hstore
from django.db import migrations
from django.contrib.postgres.operations import HStoreExtension
class Migration(migrations.Migration):
dependencies = [("home", "0016_verbose_plural_names")]
operations = [
H... | 25.818182 | 68 | 0.647887 |
d51ab83f141bf1020a0dbded7fead605ad5a29b9 | 8,838 | py | Python | webservices/resources/committees.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | 246 | 2015-01-07T16:59:42.000Z | 2020-01-18T20:35:05.000Z | webservices/resources/committees.py | adborden/openFEC | 53a0a2b1a56292c5ca8e7a3185832baaed4a63d9 | [
"CC0-1.0"
] | 2,532 | 2015-01-02T16:22:46.000Z | 2018-03-08T17:30:53.000Z | webservices/resources/committees.py | 18F/openFEC | ee7b7368e0934f50c391789fb55444f811c1a2f7 | [
"CC0-1.0"
] | 75 | 2015-02-01T00:46:56.000Z | 2021-02-14T10:51:34.000Z | import sqlalchemy as sa
from flask_apispec import doc
from webservices import args
from webservices import docs
from webservices import utils
from webservices import filters
from webservices import schemas
from webservices import exceptions
from webservices.common import models
from webservices.common.models import db... | 32.855019 | 111 | 0.610998 |
d51ad6cb84399a0213043e33ef5f4a131d7d2409 | 209 | py | Python | wheelchair/__init__.py | vd2org/wheelchair | 94f833a0f977a94547d1783d57ca7ed61db870b6 | [
"MIT"
] | 3 | 2020-06-17T07:59:08.000Z | 2020-07-05T08:59:11.000Z | wheelchair/__init__.py | vd2org/wheelchair | 94f833a0f977a94547d1783d57ca7ed61db870b6 | [
"MIT"
] | null | null | null | wheelchair/__init__.py | vd2org/wheelchair | 94f833a0f977a94547d1783d57ca7ed61db870b6 | [
"MIT"
] | null | null | null | # Copyright (C) 2019-2021 by Vd.
# This file is part of Wheelchair, the async CouchDB connector.
# Wheelchair is released under the MIT License (see LICENSE).
from .api import *
from .version import version
| 26.125 | 63 | 0.751196 |
d51ae115310a34f60370e02b6a4ef19cc98fce99 | 1,183 | py | Python | component/tile/spa_tile.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/tile/spa_tile.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | component/tile/spa_tile.py | ingdanielguerrero/gwb | 162f7e1a885945814c584a188e78d571a32a9d80 | [
"MIT"
] | null | null | null | import json
import shutil
from sepal_ui import sepalwidgets as sw
import ipyvuetify as v
from component.message import cm
from component import parameter as cp
from component import widget as cw
from component import scripts as cs
from .gwb_tile import GwbTile
class SpaTile(GwbTile):
def __init__(self, io):
... | 25.717391 | 104 | 0.584954 |
d51af45ec4216ee33c70068d2bf897661118246d | 4,822 | py | Python | src/wos_functions.py | Jinlu088/lit_reviewer | 78d186d11253c76b7f56f143dd4e7073f3ba01c5 | [
"MIT"
] | 1 | 2021-05-06T07:42:34.000Z | 2021-05-06T07:42:34.000Z | src/wos_functions.py | Jinlu088/lit_reviewer | 78d186d11253c76b7f56f143dd4e7073f3ba01c5 | [
"MIT"
] | null | null | null | src/wos_functions.py | Jinlu088/lit_reviewer | 78d186d11253c76b7f56f143dd4e7073f3ba01c5 | [
"MIT"
] | null | null | null | import os
from query_list import query_list
import pandas as pd
from wos import WosClient
import wos.utils
import suds
from bs4 import BeautifulSoup
from datetime import datetime
from ratelimit import limits
import time
import logging
logging.getLogger('suds.client').setLevel(logging.CRITICAL)
@limits(c... | 45.92381 | 79 | 0.463293 |
d51b001463bf5041d1549e1195dc69beea0eb947 | 20,888 | py | Python | python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py | xinjinhan/Spark-scheduling-huaweiTest | dfa8232e6117f87a9a4071ebb74b4c46c6d3f629 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py | xinjinhan/Spark-scheduling-huaweiTest | dfa8232e6117f87a9a4071ebb74b4c46c6d3f629 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | python/pyspark/sql/tests/test_pandas_udf_grouped_agg.py | xinjinhan/Spark-scheduling-huaweiTest | dfa8232e6117f87a9a4071ebb74b4c46c6d3f629 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 39.938815 | 98 | 0.557066 |
d51bb141cfe0c3bf431f1b097724fc27cd6bde5b | 1,912 | py | Python | branchnode.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | 1 | 2020-02-20T15:00:14.000Z | 2020-02-20T15:00:14.000Z | branchnode.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | null | null | null | branchnode.py | deshpandeyash/treesplittingsimulator | aa93dcac892cd580669e453353a88a7b9343b423 | [
"MIT"
] | null | null | null | class BranchNode(object):
"""
This class keeps the status of the tree, 0 is the left most and Q-1 is the right most branch.
Currently the easiest method seems to be to keep it in a string. This process is not iterative right now.
"""
def __init__(self):
# Keeps the movement of the ... | 38.24 | 110 | 0.604603 |
d51bb32bf27ae5f16aed6a9c186b80d7c058d992 | 3,479 | py | Python | models/attention.py | genggng/Meta-DETR | 45f9dcb4d3402b0e308e06537284fe2c8443b3f6 | [
"MIT"
] | 184 | 2021-03-23T03:19:48.000Z | 2022-03-31T07:42:03.000Z | models/attention.py | genggng/Meta-DETR | 45f9dcb4d3402b0e308e06537284fe2c8443b3f6 | [
"MIT"
] | 24 | 2021-03-31T19:12:27.000Z | 2022-03-20T06:04:22.000Z | models/attention.py | genggng/Meta-DETR | 45f9dcb4d3402b0e308e06537284fe2c8443b3f6 | [
"MIT"
] | 36 | 2021-03-26T15:51:06.000Z | 2022-03-31T02:15:23.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class ScaledDotProductAttention(nn.Module):
""" Scaled Dot-Product Attention """
def __init__(self, temperature, attn_dropout=0.0):
super().__init__()
self.temperature = temperature
self.dropout = nn.... | 42.426829 | 115 | 0.612532 |
d51bc2e8643a76fb7c3eda5de8da47c4b04b2cbc | 2,284 | gyp | Python | device/vibration/vibration.gyp | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | device/vibration/vibration.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | device/vibration/vibration.gyp | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //device/vibration:mojo_bindings
'target_name': 'device_vibrat... | 26.870588 | 97 | 0.52627 |
d51c1ec187eaf7b1a4d2b9f5d1fb3e75894bb0a4 | 8,459 | py | Python | trio/testing/_mock_clock.py | StephenSchroeder/trio | b117c019a5c20e604c8429ea0b8fa1d395b50e36 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-11-18T03:40:44.000Z | 2020-11-18T03:40:44.000Z | trio/testing/_mock_clock.py | smurfix/trio | 4c255f0ed7ab6c7574ce23c67fd3a41ab1c5ff0b | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/testing/_mock_clock.py | smurfix/trio | 4c255f0ed7ab6c7574ce23c67fd3a41ab1c5ff0b | [
"Apache-2.0",
"MIT"
] | null | null | null | import time
from math import inf
from .. import _core
from .._abc import Clock
__all__ = ["MockClock"]
################################################################
# The glorious MockClock
################################################################
# Prior art:
# https://twistedmatrix.com/documents/curr... | 40.668269 | 84 | 0.614848 |
d51c5bc89c546e1b18860f260a1c4ed67c0b2649 | 1,536 | py | Python | design_utils/common_design_utils.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 14 | 2021-06-01T16:45:19.000Z | 2022-03-08T20:07:00.000Z | design_utils/common_design_utils.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | null | null | null | design_utils/common_design_utils.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 3 | 2021-08-05T16:37:47.000Z | 2022-01-06T00:25:49.000Z | #Copyright (c) Facebook, Inc. and its affiliates.
#This source code is licensed under the MIT license found in the
#LICENSE file in the root directory of this source tree.
from settings import config
# ------------------------------
# Functionality:
# this function helps us to convert energy to power by slicing the... | 45.176471 | 115 | 0.684896 |
d51c67381be01e92866bd52366c95a121e5046ff | 8,478 | py | Python | train.py | gujingxiao/AliProducts_Recognition_Competition_Pytorch | f601aefc5ed5e35ff92111cc8fffdc71606eb82f | [
"Apache-2.0"
] | 2 | 2021-04-23T09:26:09.000Z | 2021-05-15T06:47:51.000Z | train.py | gujingxiao/AliProducts_Recognition_Competition_Pytorch | f601aefc5ed5e35ff92111cc8fffdc71606eb82f | [
"Apache-2.0"
] | 1 | 2020-08-25T01:29:51.000Z | 2020-08-25T01:29:51.000Z | train.py | gujingxiao/AliProducts_Recognition_Competition_Pytorch | f601aefc5ed5e35ff92111cc8fffdc71606eb82f | [
"Apache-2.0"
] | 2 | 2020-09-24T09:51:00.000Z | 2021-05-03T14:39:47.000Z | # Author: Jingxiao Gu
# Description: Train Code for AliProducts Recognition Competition
import time
from reader.dataloader import *
from utils.metric import *
from utils.margin import *
from utils.loss import *
from model import modelzoo
from optimizer.adam_gc import Adam_GC
from pytorch_metric_learning import losses
... | 37.848214 | 142 | 0.633404 |
d51c7ba7fa28efbc72b559de49a8eb3873a00d30 | 2,034 | py | Python | dit/multivariate/cohesion.py | volpatto/dit | a8b0ffd72e0829c4b239419e85b9e0cfd20085dd | [
"BSD-3-Clause"
] | 1 | 2021-03-15T08:51:42.000Z | 2021-03-15T08:51:42.000Z | dit/multivariate/cohesion.py | volpatto/dit | a8b0ffd72e0829c4b239419e85b9e0cfd20085dd | [
"BSD-3-Clause"
] | null | null | null | dit/multivariate/cohesion.py | volpatto/dit | a8b0ffd72e0829c4b239419e85b9e0cfd20085dd | [
"BSD-3-Clause"
] | null | null | null | """
Cohesion, a generalization bridging the total correlation and the dual total correlation.
"""
from itertools import combinations
from ..helpers import normalize_rvs
from ..math import multinomial
from ..shannon import conditional_entropy as H
from ..utils import unitful
__all__ = [
'cohesion',
]
@unitful
... | 32.285714 | 98 | 0.653884 |
d51c9361ff4a5175cc400f1e2656c574a8898dca | 505 | py | Python | authorization/migrations/0002_auto_20200524_0424.py | Joost-dm/jooster | 04f3fa979b689b61a4aeae8a5309a09277404fd6 | [
"MIT"
] | 1 | 2020-06-17T02:51:35.000Z | 2020-06-17T02:51:35.000Z | authorization/migrations/0002_auto_20200524_0424.py | Joost-dm/jooster | 04f3fa979b689b61a4aeae8a5309a09277404fd6 | [
"MIT"
] | 7 | 2020-06-06T18:32:37.000Z | 2022-03-12T00:33:42.000Z | authorization/migrations/0002_auto_20200524_0424.py | Joost-dm/jooster | 04f3fa979b689b61a4aeae8a5309a09277404fd6 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-24 01:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authorization', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='customuser',
name='age',
... | 21.956522 | 68 | 0.570297 |
d51c9613d21734cbe9ef86de7ecb3c8936522ada | 40,856 | py | Python | distributedspace_mesa/space_distribute.py | tpike3/distributedspace_mesa | 7e46046a6747bca8d447180b09da87c936b90f1b | [
"MIT"
] | 1 | 2020-07-29T19:25:41.000Z | 2020-07-29T19:25:41.000Z | distributedspace_mesa/space_distribute.py | tpike3/distributedspace_mesa | 7e46046a6747bca8d447180b09da87c936b90f1b | [
"MIT"
] | null | null | null | distributedspace_mesa/space_distribute.py | tpike3/distributedspace_mesa | 7e46046a6747bca8d447180b09da87c936b90f1b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:34:33 2019
THis module is a first attempt at creating an easily used distributed space
library for Mesa.
Conceptutally this library splits the grid into the number of processors with a
buffer on each side, it then creates a netwrok of the processors and p... | 38.398496 | 116 | 0.455478 |
d51ce70fcd43d0c60474dbb9185989b05445edf6 | 13,127 | py | Python | tests/test_seqio.py | plijnzaad/atropos | dcc79d0aa89b5d2b87f02ee841525fa154898ae6 | [
"CC0-1.0"
] | null | null | null | tests/test_seqio.py | plijnzaad/atropos | dcc79d0aa89b5d2b87f02ee841525fa154898ae6 | [
"CC0-1.0"
] | 1 | 2020-09-23T07:37:32.000Z | 2020-09-23T07:37:32.000Z | tests/test_seqio.py | plijnzaad/atropos | dcc79d0aa89b5d2b87f02ee841525fa154898ae6 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
from pytest import raises
from collections import defaultdict
import random
import sys
import os
from io import StringIO
import shutil
from textwrap import dedent
from tempfile import mkdtemp
from atropos.io import xopen, open_output
from atropos.io.seqio import (
Sequence,
ColorspaceSequence,
... | 31.784504 | 103 | 0.578198 |
d51cf8020a8cae27abb2fa2f3e1ffa303c47f63e | 1,406 | py | Python | flickr_crawler.py | chenusc11/flickr-crawl_James_Clarke | fe991d9a62f58f2570a978689c1aac92e6322c09 | [
"MIT"
] | 10 | 2017-11-06T05:19:48.000Z | 2021-10-05T04:48:00.000Z | flickr_crawler.py | chenusc11/flickr-crawl_James_Clarke | fe991d9a62f58f2570a978689c1aac92e6322c09 | [
"MIT"
] | null | null | null | flickr_crawler.py | chenusc11/flickr-crawl_James_Clarke | fe991d9a62f58f2570a978689c1aac92e6322c09 | [
"MIT"
] | 2 | 2018-12-23T10:47:02.000Z | 2021-10-05T04:48:02.000Z | #!/usr/bin/env python
"""Usage: python flickr_crawler.py TAGS
TAGS is a space delimited list of tags
Created by Shuai Chen on 2017-06-08
Credit to Matt Warren of HalOtis
"""
__author__ = "Shuai Chen <shuaic92@gmail.com>"
__version__ = "$Rev: 3 $"
__date__ = "$Date: 2017-06-18 10:00:00 +0000 (Sun, 18 Jun 2017) $"
__cop... | 26.037037 | 77 | 0.635135 |
d51d2ad11f4e9fae3ac3e6159ead261f40520e3b | 8,068 | py | Python | tests/test_wiki_ES.py | jbgriesner/idunn | e3c40f1d1bad4486357bd8bc0acc77825980a067 | [
"Apache-2.0"
] | null | null | null | tests/test_wiki_ES.py | jbgriesner/idunn | e3c40f1d1bad4486357bd8bc0acc77825980a067 | [
"Apache-2.0"
] | null | null | null | tests/test_wiki_ES.py | jbgriesner/idunn | e3c40f1d1bad4486357bd8bc0acc77825980a067 | [
"Apache-2.0"
] | null | null | null | from apistar.test import TestClient
from freezegun import freeze_time
import pytest
import os
import re
import json
import responses
from app import app, settings
@pytest.fixture(scope="session", autouse=True)
def basket_ball_wiki_es(wiki_client, init_indices):
"""
fill the elasticsearch WIKI_ES with a POI of... | 32.796748 | 357 | 0.53706 |
d51d3ab755a9dddd0f556cf63e94dfcf9b6fd570 | 13,627 | py | Python | modules/templates/SAMBRO/menus.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | modules/templates/SAMBRO/menus.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | modules/templates/SAMBRO/menus.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | 1 | 2017-10-03T13:03:47.000Z | 2017-10-03T13:03:47.000Z | # -*- coding: utf-8 -*-
from gluon import *
from core import *
from s3layouts import *
try:
from .layouts import *
except ImportError:
pass
import s3menus as default
# =============================================================================
class S3MainMenu(default.S3MainMenu):
"""
Custom App... | 40.921922 | 99 | 0.420709 |
d51d3e174d233fcd4c197c7c885c2f816d4cf160 | 5,137 | py | Python | collections/ansible_collections/community/general/plugins/modules/cloud/scaleway/scaleway_user_data.py | escalate/my-smart-home | a9579c845761b980515ff34d2a95568c6e7c2b6c | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/general/plugins/modules/cloud/scaleway/scaleway_user_data.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Ansible-AWS-Provisioning/collections/ansible_collections/community/general/plugins/modules/cloud/scaleway/scaleway_user_data.py | premsagar0228/ansible-real-life | 1a51193b833ab6ad320100472333b9ffb0da39d4 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Scaleway user data management module
#
# Copyright (C) 2018 Online SAS.
# https://www.scaleway.com
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__... | 29.693642 | 131 | 0.692817 |
d51d43bcae96b3e96ff86900daa9338cea7cc87a | 406 | py | Python | lab/refactoring/inline_method.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | lab/refactoring/inline_method.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | lab/refactoring/inline_method.py | sprajjwal/spd2.3-Testing_and_Architecture | 333e4e191d51eae3f8e84b2aca2f2f63731a22aa | [
"MIT"
] | null | null | null | # by Kami Bigdely
# Inline method.
# TODO: Refactor this program to improve its readability.
LEGAL_DRINKING_AGE = 18
class Person:
def __init__(self, my_age):
self.age = my_age
def enter_night_club(individual):
if individual.age > 18:
print("Allowed to enter.")
else:
print(... | 23.882353 | 57 | 0.672414 |
d51dd32dee1a98f41932bf9f926982abc0cb9cd1 | 2,537 | py | Python | core/tests/test_security_user_model.py | cjmash/art-backend | fb1dfd69cca9cda1d8714bd7066c3920d1a97312 | [
"MIT"
] | null | null | null | core/tests/test_security_user_model.py | cjmash/art-backend | fb1dfd69cca9cda1d8714bd7066c3920d1a97312 | [
"MIT"
] | null | null | null | core/tests/test_security_user_model.py | cjmash/art-backend | fb1dfd69cca9cda1d8714bd7066c3920d1a97312 | [
"MIT"
] | null | null | null | from ..models import SecurityUser
from core.tests import CoreBaseTestCase
class SecurityUserModelTest(CoreBaseTestCase):
""" Tests for the Security User Model """
def setUp(self):
super(SecurityUserModelTest, self).setUp()
SecurityUser.objects.create(
email="sectest1@andela.com",
... | 32.948052 | 64 | 0.630666 |
d51dd4a942166f1afa60e3d998f48c51758a6e3c | 1,722 | py | Python | tests/ssg_test_suite/profile.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | tests/ssg_test_suite/profile.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | tests/ssg_test_suite/profile.py | maage/scap-security-guide | 06474db16e5de438902162a6f72c9db996c1b6b7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
from __future__ import print_function
import logging
import ssg_test_suite.oscap
from ssg_test_suite.rule import get_viable_profiles
logging.getLogger(__name__).addHandler(logging.NullHandler())
class ProfileChecker(ssg_test_suite.oscap.Checker):
"""
Iterate over profiles in datastream ... | 35.142857 | 91 | 0.673055 |
d51dfd0db6cf6fcac47daccaba9def75871289d8 | 197 | py | Python | python/modules/pytest/t1/test_class.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | python/modules/pytest/t1/test_class.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | python/modules/pytest/t1/test_class.py | zhaoace/codecraft | bf06267e86bd7386714911b0df4aa0ca0a91d882 | [
"Unlicense"
] | null | null | null | class TestClass:
def test_one(self):
x = "this"
assert 'h' in x
def test_two(self):
x = "hello"
assert hasattr(x,'hello')
assert hasattr(x,'check')
| 19.7 | 33 | 0.522843 |
d51dfe03e69e3133ad90fde3e33c45901e242a65 | 411 | py | Python | customer_geocoder/wsgi.py | flych3r/customer-geocoder | dce33c075b22947c84a61f85f14a8fc8b67127b9 | [
"MIT"
] | null | null | null | customer_geocoder/wsgi.py | flych3r/customer-geocoder | dce33c075b22947c84a61f85f14a8fc8b67127b9 | [
"MIT"
] | null | null | null | customer_geocoder/wsgi.py | flych3r/customer-geocoder | dce33c075b22947c84a61f85f14a8fc8b67127b9 | [
"MIT"
] | null | null | null | """
WSGI config for customer_geocoder project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJ... | 24.176471 | 78 | 0.79562 |
d51e388195dc0535e00795133a87e1f931908dc9 | 540 | py | Python | src/bin/hooks/django_orm/manage.py | ddamerell53/ChemiRegV2 | 906fa4674bfda0088b86b3bcdde0e000510c79e0 | [
"CC0-1.0"
] | null | null | null | src/bin/hooks/django_orm/manage.py | ddamerell53/ChemiRegV2 | 906fa4674bfda0088b86b3bcdde0e000510c79e0 | [
"CC0-1.0"
] | null | null | null | src/bin/hooks/django_orm/manage.py | ddamerell53/ChemiRegV2 | 906fa4674bfda0088b86b3bcdde0e000510c79e0 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "chemireg.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
d51e464a493085f839f45fef201ca18b2f10ab01 | 1,010 | py | Python | kpiit/publishers/__init__.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | null | null | null | kpiit/publishers/__init__.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | null | null | null | kpiit/publishers/__init__.py | lnielsen/kpiit | a48c1c2ff807aa63b04b776d010f7e6da9cfc2e0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# KPIit is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Publisher instances."""
from enum import Enum
from celery.utils.log import get_task_logger
from kpiit.publishers.cern ... | 22.954545 | 72 | 0.673267 |
d51e615f03c8334f9815618d629986e64b9d1649 | 6,059 | py | Python | rrt_NodePruning.py | anaghamalladi/3D_Path_Planning | 616c4784a53bf031f165578b8840e4f8dd6ea68b | [
"MIT"
] | null | null | null | rrt_NodePruning.py | anaghamalladi/3D_Path_Planning | 616c4784a53bf031f165578b8840e4f8dd6ea68b | [
"MIT"
] | null | null | null | rrt_NodePruning.py | anaghamalladi/3D_Path_Planning | 616c4784a53bf031f165578b8840e4f8dd6ea68b | [
"MIT"
] | null | null | null | import math, sys, pygame, random
from math import *
from pygame import *
class Node(object):
def __init__(self, point, parent):
super(Node, self).__init__()
self.point = point
self.parent = parent
XDIM = 720
YDIM = 500
windowSize = [XDIM, YDIM]
delta = 10.0
GAME_LEVEL = 1
GOAL_RADIUS = 10
... | 28.990431 | 92 | 0.530616 |
d51e792c06f78b5ec7fd036a28854948b0cf7754 | 3,601 | py | Python | demo.py | abelttitus/sn-tsdf-fusion | df0762477d48b3f3163d232f337e02b8ecade339 | [
"BSD-2-Clause"
] | null | null | null | demo.py | abelttitus/sn-tsdf-fusion | df0762477d48b3f3163d232f337e02b8ecade339 | [
"BSD-2-Clause"
] | null | null | null | demo.py | abelttitus/sn-tsdf-fusion | df0762477d48b3f3163d232f337e02b8ecade339 | [
"BSD-2-Clause"
] | null | null | null | """Fuse 1000 RGB-D images from the 7-scenes dataset into a TSDF voxel volume with 2cm resolution.
"""
import time
import cv2
import numpy as np
import fusion
if __name__ == "__main__":
# ======================================================================================================== #
# (Optional) This... | 34.295238 | 110 | 0.631769 |
d51e9fdf75ccf2e5fe193a9d9c816cbb42877b9b | 3,118 | py | Python | pyseas/maps/ticks.py | GlobalFishingWatch/pyseas | 7559c4e07db3f7df8d42281029b793c8a30c552c | [
"Apache-2.0"
] | 1 | 2021-11-04T01:49:59.000Z | 2021-11-04T01:49:59.000Z | pyseas/maps/ticks.py | GlobalFishingWatch/pyseas | 7559c4e07db3f7df8d42281029b793c8a30c552c | [
"Apache-2.0"
] | 7 | 2021-07-15T00:16:13.000Z | 2021-11-30T13:50:26.000Z | pyseas/maps/ticks.py | GlobalFishingWatch/pyseas | 7559c4e07db3f7df8d42281029b793c8a30c552c | [
"Apache-2.0"
] | 1 | 2021-11-04T01:51:34.000Z | 2021-11-04T01:51:34.000Z |
# Based on this stackoverflow post:
# https://stackoverflow.com/questions/27962953/cartopy-axis-label-workaround
import cartopy.crs as ccrs
from cartopy.mpl.gridliner import LATITUDE_FORMATTER, LONGITUDE_FORMATTER
import matplotlib.pyplot as plt
import numpy as np
import shapely.geometry as sgeom
def find_side(ls, si... | 38.02439 | 95 | 0.631174 |
d51eb04d89bba0fb61ffc0a38f1d67f08c508b8f | 64,958 | py | Python | samtranslator/model/sam_resources.py | jonife/serverless-application-model | 77deed7091f1901ae83c79142e97948606002758 | [
"Apache-2.0"
] | null | null | null | samtranslator/model/sam_resources.py | jonife/serverless-application-model | 77deed7091f1901ae83c79142e97948606002758 | [
"Apache-2.0"
] | null | null | null | samtranslator/model/sam_resources.py | jonife/serverless-application-model | 77deed7091f1901ae83c79142e97948606002758 | [
"Apache-2.0"
] | 1 | 2022-03-07T05:44:22.000Z | 2022-03-07T05:44:22.000Z | """ SAM macro definitions """
from six import string_types
import copy
import samtranslator.model.eventsources
import samtranslator.model.eventsources.pull
import samtranslator.model.eventsources.push
import samtranslator.model.eventsources.cloudwatchlogs
from .api.api_generator import ApiGenerator
from .api.http_api... | 46.66523 | 120 | 0.671064 |
d51ed399eb900307fbde13be0d2ed12601fb17bc | 3,776 | py | Python | rls/memories/per_buffer.py | StepNeverStop/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 371 | 2019-04-26T00:37:33.000Z | 2022-03-31T07:33:12.000Z | rls/memories/per_buffer.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 47 | 2019-07-21T11:51:57.000Z | 2021-08-31T08:45:22.000Z | rls/memories/per_buffer.py | BlueFisher/RLs | 25cc97c96cbb19fe859c9387b7547cbada2c89f2 | [
"Apache-2.0"
] | 102 | 2019-06-29T13:11:15.000Z | 2022-03-28T13:51:04.000Z | import sys
from typing import Dict, NoReturn
import numpy as np
from rls.common.data import Data
from rls.memories.er_buffer import DataBuffer
from rls.memories.sum_tree import Sum_Tree
class PrioritizedDataBuffer(DataBuffer):
def __init__(self,
n_copies=1,
batch_size=1,
... | 38.927835 | 120 | 0.572564 |
d51f270b2bc3e79ccdce01e23db852f4a2676da2 | 688 | py | Python | isy-00/test.py | bschurian/Interactive-Systems-Ben | f1a02a7150b154cd53806db190ebae5072ba74f1 | [
"MIT"
] | null | null | null | isy-00/test.py | bschurian/Interactive-Systems-Ben | f1a02a7150b154cd53806db190ebae5072ba74f1 | [
"MIT"
] | null | null | null | isy-00/test.py | bschurian/Interactive-Systems-Ben | f1a02a7150b154cd53806db190ebae5072ba74f1 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
cap = cv2.VideoCapture(0)
sift = cv2.xfeatures2d.SIFT_create()
blur_flag = False
while(True):
# Capture frame-by-frame
ret, frame = cap.read()
# Our operations on the frame come here
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
if cv2.waitKey(100) & 0xFF == ord('... | 21.5 | 50 | 0.643895 |
d51f49fafe428c4b4752b315c15451e0d8c9a968 | 957 | py | Python | scattertext/Common.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2020-08-11T03:27:28.000Z | 2020-08-11T03:27:28.000Z | scattertext/Common.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | null | null | null | scattertext/Common.py | tigerneil/scattertext | 23351895ada347fae300bf910c2c77f47ac58a35 | [
"Apache-2.0"
] | 1 | 2020-01-08T00:25:31.000Z | 2020-01-08T00:25:31.000Z | # Constants for scaled f-score
DEFAULT_BETA = 2
DEFAULT_SCALER_ALGO = 'normcdf'
DEFAULT_PMI_THRESHOLD_COEFFICIENT = 8
DEFAULT_MINIMUM_TERM_FREQUENCY = 3
# Constants for background scaled f-score
DEFAULT_BACKGROUND_BETA = 1
DEFAULT_BACKGROUND_SCALER_ALGO = 'none'
# For sample corpus
POLITICAL_DATA_URL = 'https://git... | 36.807692 | 142 | 0.814002 |
d51f4f9d6b9f6eb33fa18634eb2a1f68894a620f | 723 | py | Python | rl-toolkit/rlf/algos/__init__.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | 4 | 2021-11-17T20:19:34.000Z | 2022-03-31T04:21:26.000Z | rl-toolkit/rlf/algos/__init__.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | rl-toolkit/rlf/algos/__init__.py | clvrai/goal_prox_il | 7c809b2ee575a69a14997068db06f3c1f3c8bd08 | [
"MIT"
] | null | null | null | from rlf.algos.base_algo import BaseAlgo
from rlf.algos.base_net_algo import BaseNetAlgo
from rlf.algos.on_policy.ppo import PPO
from rlf.algos.off_policy.ddpg import DDPG
from rlf.algos.off_policy.q_learning import QLearning
from rlf.algos.off_policy.sac import SAC
from rlf.algos.on_policy.sarsa import SARSA
from rlf.... | 42.529412 | 62 | 0.849239 |
d51f6a87a221fe63a19730534cb6f3dfba2be30b | 25,069 | py | Python | code/modshift_test.py | christopherburke/TESS-ExoClass | 0ec4cef57b60e50dbe693d27c3c1664d0c7289ff | [
"MIT"
] | 5 | 2019-02-01T00:32:07.000Z | 2021-03-02T15:06:06.000Z | code/modshift_test.py | christopherburke/TESS-ExoClass | 0ec4cef57b60e50dbe693d27c3c1664d0c7289ff | [
"MIT"
] | 1 | 2021-11-02T05:50:50.000Z | 2021-11-08T16:43:19.000Z | code/modshift_test.py | christopherburke/TESS-ExoClass | 0ec4cef57b60e50dbe693d27c3c1664d0c7289ff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Perform a trapezoid model fit to the phased light curve
using the Pretty Good MCMC package
https://github.com/christopherburke/PGMCMC
Although the version on Github is out of date, so use the one included
in this package. Shame on me :(
Also, your not doing MCMC fitting with PGMCMC, just chi... | 40.696429 | 139 | 0.598349 |
d51fd8fd593a256d8f9fbd8ce16b3d35bfafdf22 | 809 | py | Python | hfpy_code/chapter5/page170.py | leobarros/use_cabeca_python | 4e0897a68fb7ef669ec05eab7cba9412baa0e85e | [
"Apache-2.0"
] | 1 | 2016-04-01T04:31:52.000Z | 2016-04-01T04:31:52.000Z | hfpython_code/hfpy_code/chapter5/page170.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | null | null | null | hfpython_code/hfpy_code/chapter5/page170.py | tdean1995/HFPythonSandbox | dc72257e4353c5bca7a2c401d18587c6d799f9a1 | [
"Apache-2.0"
] | 1 | 2020-06-02T17:47:22.000Z | 2020-06-02T17:47:22.000Z |
def sanitize(time_string):
if '-' in time_string:
splitter = '-'
elif ':' in time_string:
splitter = ':'
else:
return(time_string)
(mins, secs) = time_string.split(splitter)
return(mins + '.' + secs)
def get_coach_data(filename):
try:
with open(filename) as f:
data =... | 26.966667 | 53 | 0.644005 |
d51fdd27aeaadd73e4d4492b82c186aa51c632dc | 23,402 | py | Python | enterprise/pulsar.py | AaronDJohnson/enterprise | d964464bba699a9455897d890a97c40f25c5b004 | [
"MIT"
] | 35 | 2017-01-18T18:02:28.000Z | 2021-11-14T14:14:35.000Z | enterprise/pulsar.py | AaronDJohnson/enterprise | d964464bba699a9455897d890a97c40f25c5b004 | [
"MIT"
] | 174 | 2017-02-02T22:13:46.000Z | 2022-03-04T21:00:24.000Z | enterprise/pulsar.py | AaronDJohnson/enterprise | d964464bba699a9455897d890a97c40f25c5b004 | [
"MIT"
] | 49 | 2017-01-17T21:59:43.000Z | 2021-11-03T11:26:37.000Z | # pulsar.py
"""Class containing pulsar data from timing package [tempo2/PINT].
"""
import json
import logging
import os
import pickle
import astropy.constants as const
import astropy.units as u
import numpy as np
from ephem import Ecliptic, Equatorial
import enterprise
from enterprise.signals import utils
from ente... | 35.947773 | 116 | 0.585634 |
d51fee717804d01ceafa1e44354422e1216d5f76 | 886 | py | Python | python/tvm/relay/op/_make.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | python/tvm/relay/op/_make.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | python/tvm/relay/op/_make.py | mingwayzhang/tvm | 3b287c4d4e6d83e6fd30db47ffa3d5481a332a63 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 42.190476 | 62 | 0.769752 |
d52001229eb88e6c467fbef602177efa5be1a863 | 20,645 | py | Python | end_to_end_tests/golden-record/my_test_api_client/models/a_model.py | JamesHinshelwood/openapi-python-client | 08bc2acf91d50d4fcdd7f0e50a8b0d3f00a187d9 | [
"MIT"
] | 1 | 2022-02-17T11:45:13.000Z | 2022-02-17T11:45:13.000Z | end_to_end_tests/golden-record/my_test_api_client/models/a_model.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | end_to_end_tests/golden-record/my_test_api_client/models/a_model.py | guioliveirabh/openapi-python-client | d8d9cecffe41c5dc1c43bc667598b90f0d9253ca | [
"MIT"
] | null | null | null | import datetime
from typing import Any, Dict, List, Optional, Type, TypeVar, Union, cast
import attr
from dateutil.parser import isoparse
from ..models.an_all_of_enum import AnAllOfEnum
from ..models.an_enum import AnEnum
from ..models.different_enum import DifferentEnum
from ..models.free_form_model import FreeFormM... | 45.877778 | 120 | 0.685396 |
d520215f52ce64db555c3fbde542cd36c6f05803 | 2,514 | py | Python | config.py | Dineshkarthik/animefox1 | 0ea8a04971bcb30a91858226ac51231837d01045 | [
"MIT"
] | null | null | null | config.py | Dineshkarthik/animefox1 | 0ea8a04971bcb30a91858226ac51231837d01045 | [
"MIT"
] | null | null | null | config.py | Dineshkarthik/animefox1 | 0ea8a04971bcb30a91858226ac51231837d01045 | [
"MIT"
] | null | null | null | import os
import hashlib
from flask_appbuilder.security.manager import AUTH_DB
basedir = os.path.abspath(os.path.dirname(__file__))
# Your App secret key
SECRET_KEY = os.environ.get("SECRET_KEY", "\2\1thisismyscretkey\1\2\e\y\y\h")
# The SQLAlchemy connection string.
SQLALCHEMY_DATABASE_URI = os.environ.get(
"DA... | 33.972973 | 141 | 0.556881 |
d52032a3dbd0dbc96c87f5e5c2c6326f9f3dca6f | 25,207 | py | Python | icm.py | ChenSun-Phys/cosmo_axions | daf68ba72da2e3cde875803eb27ba70eb37fe30f | [
"MIT"
] | null | null | null | icm.py | ChenSun-Phys/cosmo_axions | daf68ba72da2e3cde875803eb27ba70eb37fe30f | [
"MIT"
] | null | null | null | icm.py | ChenSun-Phys/cosmo_axions | daf68ba72da2e3cde875803eb27ba70eb37fe30f | [
"MIT"
] | null | null | null | #######################################################
### Code for probabilities for axion-photon ###
### conversion in the ICM ###
### by Manuel A. Buen-Abad, 2020 ###
### and Chen Sun, 2020 ###
########################################... | 37.791604 | 197 | 0.538184 |
d5203736207aa533f7562b67d9dec549f133ac12 | 3,836 | py | Python | pgxnclient/utils/semver.py | umitanuki/pgxnclient | c6f8cdd124f55e07b1dad7e07c10ace431eb037f | [
"BSD-3-Clause"
] | 1 | 2018-05-31T07:59:30.000Z | 2018-05-31T07:59:30.000Z | pgxnclient/utils/semver.py | umitanuki/pgxnclient | c6f8cdd124f55e07b1dad7e07c10ace431eb037f | [
"BSD-3-Clause"
] | null | null | null | pgxnclient/utils/semver.py | umitanuki/pgxnclient | c6f8cdd124f55e07b1dad7e07c10ace431eb037f | [
"BSD-3-Clause"
] | null | null | null | """
SemVer -- semantic version specification
http://semver.org/
This implementation is conform to the SemVer 0.2.1 implementation by David
Wheeler (http://pgxn.org/dist/semver/0.2.1/) and passes all its unit test.
Note that it is slightly non conform to the original specification, as the
trailing part should be comp... | 26.825175 | 80 | 0.5756 |
d52038b6bc939f26eb64cbfae71b644e9c6e8595 | 9,706 | py | Python | unit_tests/test_actions.py | sombrafam/charm-swift-storage | 821c61a4bdee43f199c933d040930d7c49929091 | [
"ECL-2.0",
"Apache-2.0"
] | 15 | 2016-04-22T10:00:09.000Z | 2020-05-06T16:27:01.000Z | unit_tests/test_actions.py | sombrafam/charm-swift-storage | 821c61a4bdee43f199c933d040930d7c49929091 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2018-01-29T01:13:56.000Z | 2018-03-22T01:49:10.000Z | unit_tests/test_actions.py | sombrafam/charm-swift-storage | 821c61a4bdee43f199c933d040930d7c49929091 | [
"ECL-2.0",
"Apache-2.0"
] | 12 | 2016-03-23T20:32:57.000Z | 2020-11-18T13:52:40.000Z | # Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 39.137097 | 79 | 0.539872 |
d5203ab90d430fb0bee75ecf471b9f501653aa6c | 2,194 | py | Python | mopidy/audio/listener.py | liamw9534/mopidy | 9dc8038025cdde07df308e1ea2037de3854fbb68 | [
"Apache-2.0"
] | 1 | 2015-02-13T23:59:44.000Z | 2015-02-13T23:59:44.000Z | mopidy/audio/listener.py | liamw9534/mopidy | 9dc8038025cdde07df308e1ea2037de3854fbb68 | [
"Apache-2.0"
] | 1 | 2015-01-05T10:40:38.000Z | 2015-03-21T15:42:16.000Z | mopidy/audio/listener.py | liamw9534/mopidy | 9dc8038025cdde07df308e1ea2037de3854fbb68 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from mopidy import listener
class AudioListener(listener.Listener):
"""
Marker interface for recipients of events sent by the audio actor.
Any Pykka actor that mixes in this class will receive calls to the methods
defined here when the corresponding events hap... | 37.827586 | 79 | 0.684594 |
d52090fb9240fd3a007b9c9ba1f479db380928e7 | 27,112 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_03_01/aio/operations/_virtual_machine_scale_set_vm_run_commands_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.564912 | 261 | 0.679515 |
d5209e1bbd379e2a09aaec59fec9328c3ff76c96 | 4,862 | py | Python | train.py | aguirrejuan/hipposeg | 1059feb677a8fa6f9903d18df1753eaf3be68d7c | [
"MIT"
] | null | null | null | train.py | aguirrejuan/hipposeg | 1059feb677a8fa6f9903d18df1753eaf3be68d7c | [
"MIT"
] | null | null | null | train.py | aguirrejuan/hipposeg | 1059feb677a8fa6f9903d18df1753eaf3be68d7c | [
"MIT"
] | null | null | null |
import tensorflow as tf
import logging
from model.model import get_model_transfer, load_models,load_model
from utils.get_data import get_data
from utils.loss import Dice_loss, boundary_loss, GDL_loss, Dice_metric
from evaluate import print_metrics,scores
from glob import glob
import os
import nibabel as nib
import a... | 38.896 | 130 | 0.677705 |
d520a2d93a9b1fd3551b1d124e6068af14d4f666 | 9,689 | py | Python | utils/config.py | sparkie3/MF_run_counter | e4b672fcdefbccf7bf82493c1f69a264e0bca54e | [
"MIT"
] | 43 | 2020-10-04T12:00:09.000Z | 2022-03-01T15:05:15.000Z | utils/config.py | sparkie3/MF_run_counter | e4b672fcdefbccf7bf82493c1f69a264e0bca54e | [
"MIT"
] | 7 | 2020-10-02T15:16:07.000Z | 2022-01-14T02:36:52.000Z | utils/config.py | oskros/MF_counter_releases | 8a94fa8ad388d16eb516dd462e7dd716a7e80729 | [
"MIT"
] | 12 | 2020-09-30T22:58:41.000Z | 2022-02-09T02:52:57.000Z | from init import *
import os
import base64
import configparser
import system_hotkey
from tkinter import messagebox
from utils import other_utils
mf_config_path = 'mf_config.ini'
class Config:
@staticmethod
def find_SP_game_path():
possible_paths = [
'C:/Program Files (x86)/Diablo II - 1.13... | 48.20398 | 190 | 0.622975 |
d5212a080c48b083470e7c9908e6a6f4d8484344 | 8,298 | py | Python | bokeh/server/plot_msid.py | ddkauffman/jeta | b40b4ca117007a3b85a8e863eac549c70aadf672 | [
"BSD-3-Clause"
] | 2 | 2021-02-28T04:16:40.000Z | 2021-09-06T18:09:29.000Z | bokeh/server/plot_msid.py | ddkauffman/jeta | b40b4ca117007a3b85a8e863eac549c70aadf672 | [
"BSD-3-Clause"
] | null | null | null | bokeh/server/plot_msid.py | ddkauffman/jeta | b40b4ca117007a3b85a8e863eac549c70aadf672 | [
"BSD-3-Clause"
] | null | null | null | # msid_full_resolution_plot.py
# Plotting Libraries
from bokeh.core.property.numeric import Interval
from bokeh.io.doc import curdoc
from bokeh.models.annotations import Legend, LegendItem
# from bokeh.models.callbacks import CustomJS, Div
from bokeh.models.ranges import Range1d
from bokeh.models.widgets.groups import... | 32.669291 | 112 | 0.532176 |
d521475e35c37273b534bf9e129c9b500bae292b | 2,481 | py | Python | django_xsede_warehouse/goendpoint_api/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | 1 | 2019-10-29T22:50:29.000Z | 2019-10-29T22:50:29.000Z | django_xsede_warehouse/goendpoint_api/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | null | null | null | django_xsede_warehouse/goendpoint_api/views.py | XSEDE/XSEDE_Information_Warehouse | 8b3aab42b7afd70ce69b9bf44551a0ded4491831 | [
"Apache-2.0"
] | null | null | null | from django.http import *
from django.shortcuts import render
from django.utils.encoding import uri_to_iri
# Create your views here.
from datetime import datetime
from rest_framework import viewsets, status
from rest_framework.views import APIView
from rest_framework.permissions import IsAuthenticated, IsAuthenticated... | 44.303571 | 150 | 0.741233 |
d521543ad36c1000c788357794e28b87315e7d46 | 3,415 | py | Python | pygcn/train.py | d222nguy/gcn_research | 83ced4f7d9f7840e48900e62c1eabec0444c5fa2 | [
"MIT"
] | null | null | null | pygcn/train.py | d222nguy/gcn_research | 83ced4f7d9f7840e48900e62c1eabec0444c5fa2 | [
"MIT"
] | null | null | null | pygcn/train.py | d222nguy/gcn_research | 83ced4f7d9f7840e48900e62c1eabec0444c5fa2 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
import time
import argparse
import numpy as np
import torch
import torch.nn.functional as F
import torch.optim as optim
from utils import load_data, accuracy
from models import GCN
# Training settings
parser = argparse.ArgumentParser()
parser.add... | 31.915888 | 72 | 0.651537 |
d5215edcdfa164e8ea85648ff5ff585fa0092939 | 4,273 | py | Python | tests/rbac/common/user/create_user_helper.py | knagware9/sawtooth-next-directory | be80852e08d2b27e105d964c727509f2a974002d | [
"Apache-2.0"
] | 1 | 2019-04-14T20:16:59.000Z | 2019-04-14T20:16:59.000Z | tests/rbac/common/user/create_user_helper.py | crazyrex/sawtooth-next-directory | 210b581c8c92c307fab2f6d2b9a55526b56b790a | [
"Apache-2.0"
] | null | null | null | tests/rbac/common/user/create_user_helper.py | crazyrex/sawtooth-next-directory | 210b581c8c92c307fab2f6d2b9a55526b56b790a | [
"Apache-2.0"
] | 1 | 2018-12-07T10:55:08.000Z | 2018-12-07T10:55:08.000Z | # Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 ... | 35.31405 | 83 | 0.663234 |
d521a8d54816589534c4e84bb78a25ac5d7b4757 | 3,920 | py | Python | utils/apriori.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | null | null | null | utils/apriori.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | 3 | 2015-09-21T21:50:45.000Z | 2015-09-22T15:42:28.000Z | utils/apriori.py | igemsoftware/HFUT-China_2015 | 5db86858963d29188ec1a8fdedaf7a98f4528cf4 | [
"Apache-2.0"
] | 2 | 2020-03-28T01:33:51.000Z | 2021-07-18T13:56:27.000Z | import os
import django
import sys
import pickle
pro_dir = os.getcwd()
sys.path.append(pro_dir)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "BioDesigner.settings")
from design.models import teams, team_parts, parts
from igemRecomdData import getResult
def loadDataSet():
dataList = list()
al... | 29.037037 | 101 | 0.552806 |
d521b347939ceabece2d98546cbdebbb1b36bcf3 | 4,686 | py | Python | api/yangSearch/module.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | api/yangSearch/module.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | api/yangSearch/module.py | sleinen/backend | 6df1a8f399586ce19aa04b85b92b2c73d2d1d7d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Cisco and its affiliates
#
# 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... | 30.232258 | 114 | 0.593683 |
d521f6e800ca1d99e75f5d6d40bbca1192c67db8 | 8,582 | py | Python | pcdet/models/dense_heads/target_assigner/anchor_generator.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 8 | 2021-06-23T02:06:56.000Z | 2022-03-18T08:34:32.000Z | pcdet/models/dense_heads/target_assigner/anchor_generator.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | 2 | 2021-07-17T11:19:14.000Z | 2021-09-25T03:30:36.000Z | pcdet/models/dense_heads/target_assigner/anchor_generator.py | zhangweichen2006/SRDAN_Open | 47c1bd9d2369d8e486b18a7aea220af7324c9011 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
class AnchorGenerator(object):
def __init__(self, anchor_range, anchor_generator_config, nusc=False, fpn_layer=None):
super().__init__()
self.anchor_generator_cfg = anchor_generator_config
self.anchor_range = anchor_range
self.anchor_sizes = [config[... | 49.321839 | 122 | 0.595199 |
d5220481ee8d9b409485766d017e1423dc1ca597 | 589 | py | Python | pypipet/plugins/canadapost/shipping_status.py | pypipet/pypipet | 8c489e4a7992281fbb68b12e2627decf24f2facb | [
"MIT"
] | null | null | null | pypipet/plugins/canadapost/shipping_status.py | pypipet/pypipet | 8c489e4a7992281fbb68b12e2627decf24f2facb | [
"MIT"
] | null | null | null | pypipet/plugins/canadapost/shipping_status.py | pypipet/pypipet | 8c489e4a7992281fbb68b12e2627decf24f2facb | [
"MIT"
] | 1 | 2021-12-10T22:36:34.000Z | 2021-12-10T22:36:34.000Z | import requests
def request_handler(func):
def wrapper(*args, **kwargs):
try:
res = func(*args, **kwargs)
if res.status_code in [200, 201]:
return res.json()
logger.debug(res.json())
return None
except KeyError as e:
log... | 26.772727 | 94 | 0.601019 |
d5223592dbcc190c8202c011a5b8a3d2c363af06 | 3,469 | py | Python | setup.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | setup.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | setup.py | MetcalfeTom/qiskit-aqua | 1718e1612dba38a3f15309c860fe7875914fe8cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 38.120879 | 114 | 0.683771 |
d5223ab40e60c11c3838940b3528366ecf7995dd | 9,709 | py | Python | util/timit/old/timit_preprocess_mel40_spikegram4_8.py | HanSeokhyeon/Speech_recogniton_for_English_and_Korean | e0eaf1da1e1ac15f34402fea8cb330d008140d61 | [
"MIT"
] | null | null | null | util/timit/old/timit_preprocess_mel40_spikegram4_8.py | HanSeokhyeon/Speech_recogniton_for_English_and_Korean | e0eaf1da1e1ac15f34402fea8cb330d008140d61 | [
"MIT"
] | null | null | null | util/timit/old/timit_preprocess_mel40_spikegram4_8.py | HanSeokhyeon/Speech_recogniton_for_English_and_Korean | e0eaf1da1e1ac15f34402fea8cb330d008140d61 | [
"MIT"
] | null | null | null | # reference : https://github.com/Faur/TIMIT
# https://github.com/jameslyons/python_speech_features/issues/53
import os
import sys
import timeit; program_start_time = timeit.default_timer()
import random; random.seed(int(timeit.default_timer()))
from six.moves import cPickle
import numpy as np
import librosa
# a py... | 33.136519 | 128 | 0.617777 |
d5223b9b551bc5cb1e007c97820b9425ea13334b | 4,976 | py | Python | tensorflow/contrib/specs/python/specs.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/contrib/specs/python/specs.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/contrib/specs/python/specs.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 31.1 | 80 | 0.712219 |
d5223cb51e2c7209026a93669bb1fa8817768f73 | 6,980 | py | Python | maddpg_trainer.py | katnoria/unityml-tennis | d1533fd49ff9dfd17909256aaa51532b496dde18 | [
"MIT"
] | 5 | 2020-04-27T12:48:52.000Z | 2021-09-23T12:07:41.000Z | maddpg_trainer.py | katnoria/unityml-tennis | d1533fd49ff9dfd17909256aaa51532b496dde18 | [
"MIT"
] | 2 | 2019-07-11T15:50:09.000Z | 2020-05-18T21:40:57.000Z | maddpg_trainer.py | katnoria/unityml-tennis | d1533fd49ff9dfd17909256aaa51532b496dde18 | [
"MIT"
] | 1 | 2020-09-18T06:50:35.000Z | 2020-09-18T06:50:35.000Z | import os
from datetime import datetime
import logging
from collections import deque
import argparse
import numpy as np
import torch
# from maddpg_orig import MADDPGAgent
from maddpg import MADDPGAgentTrainer
from unityagents import UnityEnvironment
from utils import VisWriter, save_to_txt
# Create logger
logger = log... | 46.533333 | 160 | 0.667622 |
d5224fe1d9657149dbff12633e7394193c6bd7b2 | 1,681 | py | Python | tests/test_invoice.py | jlfrancisco/paydunya-python | a8c1d513c5eaf34cd4698b3c5c49d963bd6d9491 | [
"MIT"
] | 1 | 2021-04-18T04:01:59.000Z | 2021-04-18T04:01:59.000Z | tests/test_invoice.py | jlfrancisco/paydunya-python | a8c1d513c5eaf34cd4698b3c5c49d963bd6d9491 | [
"MIT"
] | 2 | 2021-04-18T05:12:34.000Z | 2022-02-01T13:33:26.000Z | tests/test_invoice.py | paydunyadev/paydunya-python-master | f3d3419c0f98d00c7e4124ba60cfa2ddfc99d005 | [
"MIT"
] | 1 | 2021-04-15T06:57:43.000Z | 2021-04-15T06:57:43.000Z | import unittest
import paydunya
from . import PAYDUNYA_ACCESS_TOKENS
paydunya.debug = True
paydunya.api_keys = PAYDUNYA_ACCESS_TOKENS
class Invoice(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.store = paydunya.Store(name="Event Shop")
self.items = [
... | 32.960784 | 70 | 0.608566 |
d522678aa330059bdcd08e9c8f1cc52426c06b40 | 1,318 | py | Python | sdsapp/views/login.py | candle645/sdsapp | 1168bfb7d6d679026f7681adc40c19ba16297297 | [
"MIT"
] | null | null | null | sdsapp/views/login.py | candle645/sdsapp | 1168bfb7d6d679026f7681adc40c19ba16297297 | [
"MIT"
] | null | null | null | sdsapp/views/login.py | candle645/sdsapp | 1168bfb7d6d679026f7681adc40c19ba16297297 | [
"MIT"
] | null | null | null | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPFound,
)
from .base import BaseView
import logging
log = logging.getLogger('sdsapp')
from pyramid.security import (
remember,
forget,
)... | 29.954545 | 59 | 0.572838 |
d52272abe3140cdd67928a67fc88d6dbe72bcac7 | 673 | py | Python | docsim/settings.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 1 | 2020-04-29T13:52:29.000Z | 2020-04-29T13:52:29.000Z | docsim/settings.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | 136 | 2019-09-19T03:36:21.000Z | 2019-11-28T08:50:45.000Z | docsim/settings.py | tarohi24/docsim | 4879bcc889c32470a27094eb183c2ce15ae2f1fb | [
"MIT"
] | null | null | null | from pathlib import Path
import os
from elasticsearch import Elasticsearch
project_root: Path = Path(os.environ['PROJECT_ROOT'])
is_test: bool = bool(int(os.environ['IS_TEST']))
test_dir: Path = project_root.joinpath('docsim/tests')
root: Path = test_dir if is_test else project_root
data_dir: Path = root.joinpath(... | 24.925926 | 56 | 0.753343 |
d5227390c0bca7ee2373b7880abcc1646b14b669 | 13,702 | py | Python | srcflib/plumbing/bespoke.py | SRCF/SRCFLib | 1483dbf2abb8dd36268bd1c49abe5385d7a501aa | [
"MIT"
] | null | null | null | srcflib/plumbing/bespoke.py | SRCF/SRCFLib | 1483dbf2abb8dd36268bd1c49abe5385d7a501aa | [
"MIT"
] | 2 | 2020-08-23T17:23:44.000Z | 2020-12-21T17:05:50.000Z | srcflib/plumbing/bespoke.py | SRCF/SRCFLib | 1483dbf2abb8dd36268bd1c49abe5385d7a501aa | [
"MIT"
] | null | null | null | """
SRCF-specific tools.
Most methods identify users and groups using the `Member` and `Society` database models.
"""
from contextlib import contextmanager
from datetime import date
import logging
import os.path
import pwd
import shutil
import time
from typing import Generator, List, Optional, Set
from requests impo... | 32.164319 | 99 | 0.63363 |
d5228c60b173f8719e6bb7dc4f59a5a6b3074a15 | 3,859 | py | Python | 03_OD_matrix_estimation_cdc16/GLS_Oct_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | 03_OD_matrix_estimation_cdc16/GLS_Oct_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | 03_OD_matrix_estimation_cdc16/GLS_Oct_weekday_MD.py | jingzbu/InverseVITraffic | c0d33d91bdd3c014147d58866c1a2b99fb8a9608 | [
"MIT"
] | null | null | null | from util import *
# implement GLS method to estimate OD demand matrix
def GLS(x, A, L):
"""
x: sample matrix, each column is a link flow vector sample; 24 * K
A: path-link incidence matrix
P: logit route choice probability matrix
L: dimension of xi
----------------
return: xi
---------... | 27.564286 | 110 | 0.582275 |
d52291c706aa09edd8724da2b0ed42583f912333 | 1,316 | py | Python | sdks/bkapi-client-core/tests/esb/test_django_helper.py | IMBlues/bkpaas-python-sdk | a87bee3d26f0ddeac124c7a4679cd3eff4abb8fc | [
"MIT"
] | 17 | 2021-08-03T03:15:35.000Z | 2022-03-18T06:10:04.000Z | sdks/bkapi-client-core/tests/esb/test_django_helper.py | piglei/bkpaas-python-sdk | 3dfea8be5702ccea1228691c6c1c3e87a27238d2 | [
"MIT"
] | 7 | 2021-08-03T07:10:12.000Z | 2022-03-23T04:47:22.000Z | sdks/bkapi-client-core/tests/esb/test_django_helper.py | piglei/bkpaas-python-sdk | 3dfea8be5702ccea1228691c6c1c3e87a27238d2 | [
"MIT"
] | 9 | 2021-08-03T03:20:36.000Z | 2022-03-08T13:47:50.000Z | # -*- coding: utf-8 -*-
"""
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available.
* Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in co... | 45.37931 | 118 | 0.732523 |
d522937ed51de173785412c4f6a02018c539892a | 2,841 | py | Python | server/src/routes/upload.py | CollinStark/metamdb | 6df29f0b0ab1362904f3efb42a651ee433f517df | [
"MIT"
] | 1 | 2021-05-27T13:43:08.000Z | 2021-05-27T13:43:08.000Z | server/src/routes/upload.py | metamdb/metamdb | f884cfb604007ed0bbebbd76ee353fa14797b5fb | [
"MIT"
] | 1 | 2021-06-11T09:35:24.000Z | 2021-06-11T09:35:24.000Z | server/src/routes/upload.py | metamdb/metamdb | f884cfb604007ed0bbebbd76ee353fa14797b5fb | [
"MIT"
] | null | null | null | """Routes for the upload of model files."""
import json
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from werkzeug.datastructures import FileStorage
from flask import Blueprint, Response, jsonify, request
from src.components.upload import reaction
from src.errors import handler
from src.errors.exception im... | 33.034884 | 74 | 0.664907 |
d522af098b1bf62fce2e6783a5672741b673cd88 | 3,590 | py | Python | toontown/pets/PetTricks.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/pets/PetTricks.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/pets/PetTricks.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from toontown.toonbase.ToonPythonUtil import Enum, invertDictLossless
from direct.interval.IntervalGlobal import *
import types
import random
Tricks = Enum('JUMP, BEG, PLAYDEAD, ROLLOVER, BACKFLIP, DANCE, SPEAK, BALK,')
NonHappyMinActualTrickAptitude = 0.1
NonHappyMaxActualTrickAptitude = 0.6
MinActualTrickAptitude = 0... | 34.190476 | 149 | 0.683565 |
d522b25aa1417778b8b82b9c053577131e5c9fac | 1,524 | py | Python | tests/fixture/enum_pb2.py | elelayan/pylint-protobuf | 197349b18099d3613facd6e421dff3e35b8e8a6b | [
"MIT"
] | null | null | null | tests/fixture/enum_pb2.py | elelayan/pylint-protobuf | 197349b18099d3613facd6e421dff3e35b8e8a6b | [
"MIT"
] | null | null | null | tests/fixture/enum_pb2.py | elelayan/pylint-protobuf | 197349b18099d3613facd6e421dff3e35b8e8a6b | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: enum.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _mess... | 26.275862 | 127 | 0.765092 |
d522d7fa89941b81de5530791ab72849562fdf38 | 19,495 | py | Python | rotkehlchen/exchanges/binance.py | ngoctrantl/rotki | c30b2d0084c215b72e061e04d9f8391f8106b874 | [
"BSD-3-Clause"
] | null | null | null | rotkehlchen/exchanges/binance.py | ngoctrantl/rotki | c30b2d0084c215b72e061e04d9f8391f8106b874 | [
"BSD-3-Clause"
] | 3 | 2020-08-03T03:03:51.000Z | 2021-05-11T21:26:14.000Z | rotkehlchen/exchanges/binance.py | DUMIE505/rotki | 046169bc068c7b29a271d6e80d978e02d0ea76ac | [
"BSD-3-Clause"
] | null | null | null | import hashlib
import hmac
import logging
import time
from json.decoder import JSONDecodeError
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Tuple, Union
from urllib.parse import urlencode
import gevent
from gevent.lock import Semaphore
from rotkehlchen.assets.converters import asset_from_b... | 37.062738 | 135 | 0.587074 |
d522fa508977447faa47c741deed23b0a31cc0aa | 27,966 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_02_preview/operations/_snapshots_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... | 40.945827 | 202 | 0.662626 |
d5230b702d48b944ebd33140382e2af861dd8fe9 | 2,690 | py | Python | cells.py | tiredamage42/WikiCrawler | 264d3511dec20bcf9c633315d3d6c93aa64cbe5c | [
"MIT"
] | 1 | 2021-02-14T19:49:39.000Z | 2021-02-14T19:49:39.000Z | cells.py | tiredamage42/WikiCrawler | 264d3511dec20bcf9c633315d3d6c93aa64cbe5c | [
"MIT"
] | null | null | null | cells.py | tiredamage42/WikiCrawler | 264d3511dec20bcf9c633315d3d6c93aa64cbe5c | [
"MIT"
] | null | null | null | '''
some custom cells with added save state functionality
cells inheret from tensorflow rnn cell, so can be used with tensorflow rnns
'''
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
from tensorflow.python.ops.rnn_cell import LSTMStateTuple, BasicLSTMCell
class MultiRNNCell(tf.nn.rnn_cell.RNNCell):
... | 32.02381 | 105 | 0.637918 |
d5232f5a85d13d80bc50ea76359414aa947e940c | 1,435 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_gizmo/eink_gizmo.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 47 | 2021-02-15T23:02:36.000Z | 2022-03-04T21:30:03.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_gizmo/eink_gizmo.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 7 | 2021-02-19T20:00:08.000Z | 2022-01-14T10:51:12.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/lib/adafruit_gizmo/eink_gizmo.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 14 | 2021-02-20T17:40:56.000Z | 2022-01-01T19:53:38.000Z | # SPDX-FileCopyrightText: 2019 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
`adafruit_gizmo.tft_gizmo`
================================================================================
Helper for the `Tri-Color E-Ink Gizmo <https://www.adafruit.com/product/4428>`_.
* Author(s... | 28.137255 | 80 | 0.594425 |
d5234d87a6663ab4cf8c423169990c2935b425a9 | 1,533 | py | Python | portal/libs/scripts/rdesc.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 8 | 2020-12-15T17:11:08.000Z | 2021-12-13T22:08:33.000Z | portal/libs/scripts/rdesc.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 28 | 2020-12-15T17:34:03.000Z | 2022-02-01T04:09:10.000Z | portal/libs/scripts/rdesc.py | Artis-Physis/utopia-cms | 5cb8d941d0b2df53fddc566a52e9d3baee4a007e | [
"BSD-3-Clause"
] | 7 | 2020-12-15T19:59:17.000Z | 2021-11-24T16:47:06.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from urllib2 import urlopen
import re
def get_html():
YOUTUBE_URL = 'http://www.youtube.com/profile?user=LosInformantes&view=videos&start=%i'
handler = file('rdesc.youtube', 'a')
for jump in (0, 20, 40, 60, 80, 100, 120):
handler.write('%s\n' % urlopen(YOUT... | 28.924528 | 91 | 0.570776 |
d523549f90baacba224a642d27ca75c28e3cf1a9 | 756 | py | Python | setup.py | thalmic/ChamberConnectLibrary | 142444a103e5d42b16bc1f28c6e6c63387616aae | [
"MIT"
] | 5 | 2018-03-19T20:26:39.000Z | 2022-02-02T18:38:29.000Z | setup.py | thalmic/ChamberConnectLibrary | 142444a103e5d42b16bc1f28c6e6c63387616aae | [
"MIT"
] | null | null | null | setup.py | thalmic/ChamberConnectLibrary | 142444a103e5d42b16bc1f28c6e6c63387616aae | [
"MIT"
] | 2 | 2018-05-04T18:33:38.000Z | 2019-02-11T21:17:03.000Z | '''setup script for this module'''
from setuptools import setup
def readme():
'''pull iin the readme file for the long description'''
with open('README.md') as rfile:
return rfile.read()
setup(
name='chamberconnectlibrary',
version='2.0.2',
description='A library for interfacing with Espe... | 29.076923 | 78 | 0.701058 |
d5236459511aaeeba869b319c4a82192d898f286 | 12,989 | py | Python | ceph/datadog_checks/ceph/ceph.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | ceph/datadog_checks/ceph/ceph.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | ceph/datadog_checks/ceph/ceph.py | blaines/integrations-core | ff54d2d864bf37eea3a021d316e42742d499e3ca | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import division
import os
import re
import simplejson as json
from six import iteritems
from datadog_checks.base import AgentCheck
from datadog_checks.base.config import _is_affirmative
... | 44.482877 | 115 | 0.550004 |
d5238ae9af1bbe468994df5c5788ec1203e3e173 | 25,074 | py | Python | mmdet3d/models/dense_heads/vote_head.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 12 | 2021-03-17T09:07:18.000Z | 2022-01-21T01:37:42.000Z | mmdet3d/models/dense_heads/vote_head.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 1 | 2020-08-11T05:44:29.000Z | 2020-08-11T05:44:29.000Z | mmdet3d/models/dense_heads/vote_head.py | BOURSa/mmdetection3d | 27d0001e873b3102a828a27e1372873fcf81ed7e | [
"Apache-2.0"
] | 2 | 2021-03-17T09:25:15.000Z | 2021-04-22T09:15:58.000Z | import numpy as np
import torch
from mmcv.cnn import ConvModule
from torch import nn as nn
from torch.nn import functional as F
from mmdet3d.core.post_processing import aligned_3d_nms
from mmdet3d.models.builder import build_loss
from mmdet3d.models.losses import chamfer_distance
from mmdet3d.models.model_utils import... | 43.008576 | 79 | 0.600423 |
d523c7b963d36b18aed3a617cd43fa3d2ae13027 | 1,404 | py | Python | tools/tcam-capture/tcam_capture/ImageProvider.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 241 | 2015-02-20T09:10:41.000Z | 2022-03-18T08:53:26.000Z | tools/tcam-capture/tcam_capture/ImageProvider.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 435 | 2015-01-19T10:18:01.000Z | 2022-03-28T08:03:08.000Z | tools/tcam-capture/tcam_capture/ImageProvider.py | lkucalaba/tiscamera | e1fa7b21bb4dd777ae8039dfa072cfa2daa88244 | [
"Apache-2.0"
] | 141 | 2015-01-03T17:54:08.000Z | 2022-02-09T09:55:15.000Z | # Copyright 2018 The Imaging Source Europe GmbH
#
# 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 ... | 29.87234 | 74 | 0.680199 |
d524737896bf64e776470ea9c249655ccf2a7092 | 674 | py | Python | tests/test_config.py | aiomessaging/aiomessaging | 0fe2296d5a772a9b28c3173259e7a6ace6e45624 | [
"MIT"
] | 4 | 2018-07-08T18:49:10.000Z | 2018-08-16T20:17:29.000Z | tests/test_config.py | aiomessaging/aiomessaging | 0fe2296d5a772a9b28c3173259e7a6ace6e45624 | [
"MIT"
] | 23 | 2018-07-08T18:52:42.000Z | 2018-10-25T16:58:50.000Z | tests/test_config.py | aiomessaging/aiomessaging | 0fe2296d5a772a9b28c3173259e7a6ace6e45624 | [
"MIT"
] | null | null | null | """
Configuration tests.
"""
import pytest
from aiomessaging.config import Config
from aiomessaging.utils import class_from_string
def test_get_logging_dict():
"""Test getting logging dict from config.
Just for coverage: we don't use logging when measuring coverage.
"""
conf = Config()
assert is... | 21.741935 | 68 | 0.681009 |
d52491aa0a20bd7b6c57920e7d50b72049e28528 | 925 | py | Python | dev/tasks/internal/init.py | MasonData/dev | f4e996e7bb75d4b478fdd96ab8ac98edf63d7d36 | [
"MIT"
] | 12 | 2021-12-27T14:40:17.000Z | 2022-03-22T20:14:42.000Z | dev/tasks/internal/init.py | MasonData/dev | f4e996e7bb75d4b478fdd96ab8ac98edf63d7d36 | [
"MIT"
] | null | null | null | dev/tasks/internal/init.py | MasonData/dev | f4e996e7bb75d4b478fdd96ab8ac98edf63d7d36 | [
"MIT"
] | null | null | null | import sys
from typing import Any, Optional
from docopt import DocoptExit
from schema import Schema
from dev.console import error_console
from dev.helpers import root_path
from dev.task import InternalTask
class Init(InternalTask):
__schema__ = Schema([str])
__description__ = 'Initialize shell environment'
... | 29.83871 | 114 | 0.641081 |
d524bed66cfa4595e8364f726df9cfb10d555633 | 5,824 | py | Python | lib.py | bskp/PlannedHoliday | 79df5bd392b2b0899893af9f5b095cd1739686a2 | [
"Unlicense"
] | 1 | 2019-06-20T08:03:53.000Z | 2019-06-20T08:03:53.000Z | lib.py | mountainash/PlannedHoliday | 79df5bd392b2b0899893af9f5b095cd1739686a2 | [
"Unlicense"
] | null | null | null | lib.py | mountainash/PlannedHoliday | 79df5bd392b2b0899893af9f5b095cd1739686a2 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import sys
import socket
import glob
from time import sleep
from functools import reduce
from random import shuffle
import signal
import numpy as np
from PIL import Image, ImageChops, ImageDraw, ImageFont, ImageColor
import matplotlib
# Helpers
_fnt = ImageFont.truetype('fonts/pixelmix.otf',... | 25.884444 | 105 | 0.564045 |
d524c4f575286a2a6d0cf20aac542f142de17f6e | 1,060 | py | Python | tests/test_wps_subset_countries.py | tlvu/flyingpigeon | 2fb3eb4f32c3d2c18ec266834d113dc710e24ffc | [
"Apache-2.0"
] | null | null | null | tests/test_wps_subset_countries.py | tlvu/flyingpigeon | 2fb3eb4f32c3d2c18ec266834d113dc710e24ffc | [
"Apache-2.0"
] | null | null | null | tests/test_wps_subset_countries.py | tlvu/flyingpigeon | 2fb3eb4f32c3d2c18ec266834d113dc710e24ffc | [
"Apache-2.0"
] | null | null | null | import pytest
from pywps import Service
from pywps.tests import assert_response_success
from flyingpigeon.processes import SubsetcountryProcess
from tests.common import TESTDATA, client_for, get_output, CFG_FILE
datainputs_fmt = (
"resource=@xlink:href={0};"
"region={1};"
"mosaic={2};"
)
@pytest.mark.... | 26.5 | 71 | 0.683019 |
d524cb4d7b32be12301d6d6a3c3b7f36680ce4df | 390 | py | Python | abc/088/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/088/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/088/C.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
C = []
for i in range(3):
C.append(na())
for i in range(2):
for j in range(2):
if C[i][j] - C[i][j + 1] != C[i + 1][j] - C[i ... | 18.571429 | 66 | 0.520513 |
d524cfc8dce6ff397542f1728a67da92b4e202a8 | 6,908 | py | Python | clingraph/multigraph.py | henryotunuya/clingraph | b8cfd8a104ea0e82228bf4a8e18b238d306af9a3 | [
"MIT"
] | null | null | null | clingraph/multigraph.py | henryotunuya/clingraph | b8cfd8a104ea0e82228bf4a8e18b238d306af9a3 | [
"MIT"
] | null | null | null | clingraph/multigraph.py | henryotunuya/clingraph | b8cfd8a104ea0e82228bf4a8e18b238d306af9a3 | [
"MIT"
] | null | null | null | """
Definition of a MultiModelClingraph
"""
import os
import logging
import json
from clingraph.clingraph import Clingraph
from clingraph.exception import InvalidSyntax
log = logging.getLogger('custom')
class MultiModelClingraph:
"""
Holds multiple models in the same structure. Each model will be associat... | 35.244898 | 147 | 0.577157 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.