hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
633363b76466e92716048268564a895579aeca7d | 397 | py | Python | scripts/twice.py | Takaha333/rososys-kadai2 | 94a682264736c6b471bc039ea27aef165053602a | [
"MIT"
] | null | null | null | scripts/twice.py | Takaha333/rososys-kadai2 | 94a682264736c6b471bc039ea27aef165053602a | [
"MIT"
] | null | null | null | scripts/twice.py | Takaha333/rososys-kadai2 | 94a682264736c6b471bc039ea27aef165053602a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from std_msgs.msg import Int32
n = 0
def cb(message):
global n
n = message.data*2
if __name__ == '__main__':
rospy.init_node('twice')
sub = rospy.Subscriber('count_up', Int32, cb)
pub = rospy.Publisher('twice', Int32, queue_size=1)
rate = rospy.Rate(10)
... | 22.055556 | 56 | 0.63728 |
87c86958c721e7923dbbe04dbb9a79c0b13ec9da | 8,200 | py | Python | src/ambianic/webapp/server/samples.py | PhillipAmes/ambianic-edge | 6c6d6ab4aa88db8150ac42f85ac2b88723f046f5 | [
"Apache-2.0"
] | 1 | 2021-04-13T16:29:42.000Z | 2021-04-13T16:29:42.000Z | src/ambianic/webapp/server/samples.py | PhillipAmes/ambianic-edge | 6c6d6ab4aa88db8150ac42f85ac2b88723f046f5 | [
"Apache-2.0"
] | null | null | null | src/ambianic/webapp/server/samples.py | PhillipAmes/ambianic-edge | 6c6d6ab4aa88db8150ac42f85ac2b88723f046f5 | [
"Apache-2.0"
] | 1 | 2021-04-10T15:53:58.000Z | 2021-04-10T15:53:58.000Z | """REST API for timeline events from pipeline samples."""
import logging
import uuid
from datetime import datetime
from pathlib import Path
import os
import json
import yaml
from ambianic import DEFAULT_DATA_DIR
log = logging.getLogger()
SAMPLES = [
{
'file': '20190913-063945-json.txt',
'id': '2a... | 32.283465 | 86 | 0.579878 |
72d6f0ead80d35f42a74be5eed688b2d2680e176 | 854 | py | Python | mysite/urls.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | mysite/urls.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | mysite/urls.py | neethu567/learm_profile | c129961865fca88cdc9c1992683d59966ce88bf0 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import include,path
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add... | 34.16 | 77 | 0.713115 |
1fd5642fa584a80559d3c462f5aae1d0e0c3a495 | 4,632 | py | Python | crossdock/server/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | crossdock/server/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | crossdock/server/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | import json
import logging
import crossdock.server.api as api
import opentracing
import tornado.escape
import tornado.gen
import tornado.httpclient
import tornado.ioloop
import tornado.web
from jaeger_client import Tracer, ConstSampler
from jaeger_client.reporter import NullReporter
from opentracing_instrumentation im... | 30.675497 | 77 | 0.688472 |
1289ace5241e357ca8cfbd95f7004ecddddde223 | 9,957 | py | Python | var/spack/repos/builtin/packages/catalyst/package.py | williamfgc/spack | c8c795e7dbde22dc47c9ae285a4dd59004b115b1 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/catalyst/package.py | williamfgc/spack | c8c795e7dbde22dc47c9ae285a4dd59004b115b1 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/catalyst/package.py | williamfgc/spack | c8c795e7dbde22dc47c9ae285a4dd59004b115b1 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
import subprocess
import llnl.util.tty as tty
class Catalyst(CMakePackage):
"""Catalys... | 40.975309 | 110 | 0.617555 |
7b4b9ff113f45ad9c3769a034367b1d0592e612a | 6,081 | py | Python | motion_detection/transientMotionDetector/pcConfig/pc_m_detector.py | Siddharthm10/Face_Recognition_and_detection | 018a2cd5800ab69fd3bbfa76c0ac874e65845412 | [
"MIT"
] | null | null | null | motion_detection/transientMotionDetector/pcConfig/pc_m_detector.py | Siddharthm10/Face_Recognition_and_detection | 018a2cd5800ab69fd3bbfa76c0ac874e65845412 | [
"MIT"
] | null | null | null | motion_detection/transientMotionDetector/pcConfig/pc_m_detector.py | Siddharthm10/Face_Recognition_and_detection | 018a2cd5800ab69fd3bbfa76c0ac874e65845412 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
"""
Description:
Transient - for a short time.
This script runs a transient motion detector.
"""
import cv2
import numpy as np
import time
# =============================================================================
# USER-SET PARAMETERS
# ... | 34.551136 | 118 | 0.577865 |
92a6acffc1335829d3a72b4143781451e2940a3d | 3,317 | py | Python | benchmark/startCirq3309.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3309.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3309.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=44
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.269663 | 77 | 0.680434 |
666e3b955eae951adbfaf1f129290fdce72afb05 | 836 | py | Python | satchless/contrib/stock/singlestore/tests.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | 1 | 2015-11-05T05:09:27.000Z | 2015-11-05T05:09:27.000Z | satchless/contrib/stock/singlestore/tests.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | satchless/contrib/stock/singlestore/tests.py | cajun-code/satchless | 068b26046c3af63268f8eecd6e33da2bbb78b8d1 | [
"BSD-4-Clause"
] | null | null | null | from django.test import TestCase
from satchless.product.tests import DeadParrot, DeadParrotVariant
from satchless.cart.models import Cart
from . import models
class StockTest(TestCase):
def setUp(self):
self.cockatoo = DeadParrot.objects.create(slug='cockatoo',
species="White Cockatoo")
... | 41.8 | 94 | 0.735646 |
5b77002e32248567894df50420ed0f3b632b9940 | 7,340 | py | Python | asteroid/filterbanks/griffin_lim.py | DizzyProtos/asteroid | bb3c374fefe7525c2f6da355834e470d45b45b90 | [
"MIT"
] | 3 | 2020-09-30T02:32:08.000Z | 2021-02-05T04:48:01.000Z | asteroid/filterbanks/griffin_lim.py | DizzyProtos/asteroid | bb3c374fefe7525c2f6da355834e470d45b45b90 | [
"MIT"
] | 1 | 2020-09-17T08:55:12.000Z | 2020-09-17T08:55:12.000Z | asteroid/filterbanks/griffin_lim.py | DizzyProtos/asteroid | bb3c374fefe7525c2f6da355834e470d45b45b90 | [
"MIT"
] | 1 | 2021-02-05T04:48:05.000Z | 2021-02-05T04:48:05.000Z | import torch
import math
from . import Encoder, Decoder, STFTFB # noqa
from .stft_fb import perfect_synthesis_window
from . import transforms
from ..dsp.consistency import mixture_consistency
def griffin_lim(mag_specgram, stft_enc, angles=None, istft_dec=None, n_iter=6, momentum=0.9):
""" Estimates matching pha... | 43.952096 | 93 | 0.670572 |
7ca044577be4f24674ef4f27dd51f79b0d15fa8c | 4,744 | py | Python | ils_middleware/dags/penn.py | LD4P/ils-middleware | 6152ebfcfe503e7ec5ecce62118fe167830fafa6 | [
"Apache-2.0"
] | null | null | null | ils_middleware/dags/penn.py | LD4P/ils-middleware | 6152ebfcfe503e7ec5ecce62118fe167830fafa6 | [
"Apache-2.0"
] | 90 | 2021-08-30T14:58:30.000Z | 2022-03-31T19:46:27.000Z | ils_middleware/dags/penn.py | LD4P/ils-middleware | 6152ebfcfe503e7ec5ecce62118fe167830fafa6 | [
"Apache-2.0"
] | 1 | 2021-09-21T23:09:49.000Z | 2021-09-21T23:09:49.000Z | from datetime import datetime, timedelta
from airflow import DAG
from airflow.models import Variable
from airflow.operators.dummy import DummyOperator
from airflow.operators.python import PythonOperator
from airflow.utils.task_group import TaskGroup
from ils_middleware.tasks.amazon.alma_s3 import get_from_alma_s3, se... | 34.627737 | 133 | 0.700042 |
960e46d9b4dc66de700760e596535c37de159789 | 168 | py | Python | configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py | y-veys/detectron2 | a3a2ae45f2dd25e7db7e64d2b70f5bc420116880 | [
"Apache-2.0"
] | 201 | 2022-02-14T17:44:27.000Z | 2022-03-31T03:42:41.000Z | configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py | y-veys/detectron2 | a3a2ae45f2dd25e7db7e64d2b70f5bc420116880 | [
"Apache-2.0"
] | 8 | 2022-03-05T11:46:45.000Z | 2022-03-21T02:44:06.000Z | configs/new_baselines/mask_rcnn_regnetx_4gf_dds_FPN_200ep_LSJ.py | y-veys/detectron2 | a3a2ae45f2dd25e7db7e64d2b70f5bc420116880 | [
"Apache-2.0"
] | 15 | 2022-02-22T08:00:13.000Z | 2022-03-29T06:29:45.000Z | from .mask_rcnn_regnetx_4gf_dds_FPN_100ep_LSJ import (
dataloader,
lr_multiplier,
model,
optimizer,
train,
)
train.max_iter *= 2 # 100ep -> 200ep
| 16.8 | 54 | 0.684524 |
d1072a3c49130abc1ba502ec62a67d7b26a0d9b2 | 3,647 | py | Python | cnns/graphs/train-test/train-test.py | adam-dziedzic/time-series-ml | 81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a | [
"Apache-2.0"
] | 1 | 2018-03-25T13:19:46.000Z | 2018-03-25T13:19:46.000Z | cnns/graphs/train-test/train-test.py | adam-dziedzic/time-series-ml | 81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a | [
"Apache-2.0"
] | null | null | null | cnns/graphs/train-test/train-test.py | adam-dziedzic/time-series-ml | 81aaa27f1dd9ea3d7d62b661dac40cac6c1ef77a | [
"Apache-2.0"
] | null | null | null | import matplotlib
# matplotlib.use('TkAgg')
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42
import matplotlib.pyplot as plt
import csv
import os
print(matplotlib.get_backend())
plt.interactive(True)
# http://ksrowell.com/blog-visualizing-data/2012/02/02/optimal-colors-for-graphs/
MY_... | 28.053846 | 81 | 0.590348 |
42ca212392c7060f787a400fd872aca9cbc22644 | 1,702 | py | Python | django/conf/locale/cs/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | django/conf/locale/cs/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 18 | 2015-01-14T07:51:48.000Z | 2021-10-14T01:19:26.000Z | django/conf/locale/cs/formats.py | webjunkie/django | 5dbca13f3baa2e1bafd77e84a80ad6d8a074712e | [
"BSD-3-Clause"
] | 70 | 2015-01-01T00:33:24.000Z | 2021-12-10T03:43:07.000Z | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i:s'
DAT... | 37 | 77 | 0.548179 |
72bbb821c1b02deff85e33dac78a82d12f5120bd | 2,256 | py | Python | python/ray/tests/test_queue.py | thalvari/ray | 24ee496b8959f48cd4e5829700b9fc089b12ea12 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_queue.py | thalvari/ray | 24ee496b8959f48cd4e5829700b9fc089b12ea12 | [
"Apache-2.0"
] | null | null | null | python/ray/tests/test_queue.py | thalvari/ray | 24ee496b8959f48cd4e5829700b9fc089b12ea12 | [
"Apache-2.0"
] | null | null | null | import pytest
import ray
from ray.exceptions import RayTimeoutError
from ray.experimental.queue import Queue, Empty, Full
@ray.remote
def async_get(queue):
return queue.get(block=True)
@ray.remote
def async_put(queue, item):
return queue.put(item, block=True)
def test_simple_usage(ray_start_regular):
... | 17.625 | 69 | 0.60195 |
1ab0ae961d8a6983cd3bf1102b5d5461cc707e59 | 230 | py | Python | app/user/urls.py | abimaelneto/recipe-app-api | a71371faae3f7e1d1460416e800018a3530e9754 | [
"MIT"
] | null | null | null | app/user/urls.py | abimaelneto/recipe-app-api | a71371faae3f7e1d1460416e800018a3530e9754 | [
"MIT"
] | null | null | null | app/user/urls.py | abimaelneto/recipe-app-api | a71371faae3f7e1d1460416e800018a3530e9754 | [
"MIT"
] | null | null | null | from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name = 'create'),
path('token/', views.CreateTokenView.as_view(), name = 'token'),
]
| 20.909091 | 69 | 0.682609 |
49159428ff2f61a55c41f408b923d808eba3b24b | 379 | py | Python | mafia/base/migrations/0002_info_about.py | yestannn/agenakz | 493c25906c9afbc1e2e340ba2301a2555bf243af | [
"MIT"
] | null | null | null | mafia/base/migrations/0002_info_about.py | yestannn/agenakz | 493c25906c9afbc1e2e340ba2301a2555bf243af | [
"MIT"
] | null | null | null | mafia/base/migrations/0002_info_about.py | yestannn/agenakz | 493c25906c9afbc1e2e340ba2301a2555bf243af | [
"MIT"
] | null | null | null | # Generated by Django 3.2.4 on 2022-01-18 18:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='info',
name='about',
field=mod... | 19.947368 | 62 | 0.583113 |
89313abdd6936b604624a2cf8fcd08f0f2381485 | 1,368 | py | Python | scripts/games.py | dragon8897/QuickSDKTool_Win_P34 | 7f36bf100e41abc3c7eaa1515abf42805bc7ab1c | [
"MIT"
] | 9 | 2017-01-04T08:17:42.000Z | 2021-10-30T14:00:45.000Z | scripts/games.py | huanleyouren/QuickSDKTool_Win_P34 | 5dff6756aa74fab76454dc660e77c6dbdd478614 | [
"MIT"
] | null | null | null | scripts/games.py | huanleyouren/QuickSDKTool_Win_P34 | 5dff6756aa74fab76454dc660e77c6dbdd478614 | [
"MIT"
] | 32 | 2016-01-07T03:08:49.000Z | 2022-02-15T08:22:17.000Z | # -*- coding: utf-8 -*-
#Author:xiaohei
#CreateTime:2014-10-25
#
# The main operation entry for channel select and one thread.
#
import sys
import core
import file_utils
import apk_utils
import config_utils
import log_utils
import os
import os.path
import time
import main
import main_thread
def e... | 21.714286 | 91 | 0.613304 |
e0a35ca1b908d75f8e2d9174d202edb948ef93ad | 1,171 | py | Python | setup.py | duckravel/envirocar-py | 0a2983f39975033b2ebfc8b852211e399b667b02 | [
"MIT"
] | null | null | null | setup.py | duckravel/envirocar-py | 0a2983f39975033b2ebfc8b852211e399b667b02 | [
"MIT"
] | null | null | null | setup.py | duckravel/envirocar-py | 0a2983f39975033b2ebfc8b852211e399b667b02 | [
"MIT"
] | null | null | null | import io
from pip._internal.req import parse_requirements
from setuptools import setup, find_packages
# loading requirements
requirements = list(parse_requirements('requirements.txt', session='hack'))
requirements = [r.name for r in requirements]
def parse_long_description():
return io.open('README.md', encodi... | 30.815789 | 75 | 0.664389 |
02d92abe7fb0c8af69b189584ccf3d41010f6210 | 2,876 | py | Python | pymarkdown/plugins/rule_md_046.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | null | null | null | pymarkdown/plugins/rule_md_046.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | null | null | null | pymarkdown/plugins/rule_md_046.py | scop/pymarkdown | 562ba8f7857d99ba09e86e42de5a37ec6d9b2c30 | [
"MIT"
] | null | null | null | """
Module to implement a plugin that looks for hard tabs in the files.
"""
from pymarkdown.plugin_manager import Plugin, PluginDetails
class RuleMd046(Plugin):
"""
Class to implement a plugin that looks for hard tabs in the files.
"""
__consistent_style = "consistent"
__fenced_style = "fenced"
... | 33.44186 | 131 | 0.601182 |
f90dee7f97b91622f4c00b22351500d388e51467 | 6,521 | py | Python | networkx/tests/test_convert_scipy.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 4 | 2015-07-20T06:30:46.000Z | 2015-07-22T11:17:25.000Z | networkx/tests/test_convert_scipy.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | networkx/tests/test_convert_scipy.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 4 | 2016-04-25T22:15:40.000Z | 2017-12-18T14:40:58.000Z | from nose import SkipTest
from nose.tools import assert_raises, assert_true, assert_equal, raises
import networkx as nx
from networkx.generators.classic import barbell_graph,cycle_graph,path_graph
class TestConvertNumpy(object):
@classmethod
def setupClass(cls):
global np, sp, sparse, np_assert_equal
... | 36.227778 | 84 | 0.610029 |
cead73bfedbae71acb3c8cd08036d71adede4ad2 | 17,780 | py | Python | test/test_query.py | kiefermat/beets | 268dcb0008228912c305fc6e8818dafda3b48555 | [
"MIT"
] | null | null | null | test/test_query.py | kiefermat/beets | 268dcb0008228912c305fc6e8818dafda3b48555 | [
"MIT"
] | null | null | null | test/test_query.py | kiefermat/beets | 268dcb0008228912c305fc6e8818dafda3b48555 | [
"MIT"
] | null | null | null | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... | 32.268603 | 72 | 0.630315 |
0d5370b9919943a00d3a1c8dbc57e5b6d0eeb4e3 | 3,957 | py | Python | .ycm_extra_conf.py | blindij/boostkata | 5a0509c0413bddac54af94d2c00f9cb24b172279 | [
"MIT"
] | null | null | null | .ycm_extra_conf.py | blindij/boostkata | 5a0509c0413bddac54af94d2c00f9cb24b172279 | [
"MIT"
] | null | null | null | .ycm_extra_conf.py | blindij/boostkata | 5a0509c0413bddac54af94d2c00f9cb24b172279 | [
"MIT"
] | null | null | null | import os
import ycm_core
#from clang_helpers import PrepareClangFlags
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspath(__file__))
# This is the single most important line in this script. Everything else is just nice to have but
# not strictly necessary.
#compilation_database_folder = Director... | 29.75188 | 97 | 0.673995 |
48e76d51cf8e93657d2f858d4396a54e1594dbad | 619 | py | Python | src/wagtail_tag_manager/migrations/0007_auto_20190130_1435.py | Tehnode/wagtail-tag-manager | 048a03fe61b57ddd1eea0377ab26cf96527f5457 | [
"BSD-3-Clause"
] | 59 | 2018-06-13T07:30:42.000Z | 2022-03-22T02:14:34.000Z | src/wagtail_tag_manager/migrations/0007_auto_20190130_1435.py | Tehnode/wagtail-tag-manager | 048a03fe61b57ddd1eea0377ab26cf96527f5457 | [
"BSD-3-Clause"
] | 74 | 2018-08-09T20:52:56.000Z | 2022-03-02T08:39:30.000Z | src/wagtail_tag_manager/migrations/0007_auto_20190130_1435.py | Tehnode/wagtail-tag-manager | 048a03fe61b57ddd1eea0377ab26cf96527f5457 | [
"BSD-3-Clause"
] | 23 | 2018-10-10T05:29:38.000Z | 2022-01-19T15:09:51.000Z | # Generated by Django 2.1.4 on 2019-01-30 14:35
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wagtail_tag_manager', '0006_cookiebarsettings'),
]
operations = [
migrations.AlterField(
model_name='tag',
name='tag... | 32.578947 | 273 | 0.647819 |
58047fcd3cb5f71f35f33018e12ef9d54d40cb9b | 816 | py | Python | data_process/src/utils.py | Fifi-Huo/Digital_Appendix_C | 76aa286a6c3756e98e18d6064826689511e3e8cc | [
"MIT"
] | null | null | null | data_process/src/utils.py | Fifi-Huo/Digital_Appendix_C | 76aa286a6c3756e98e18d6064826689511e3e8cc | [
"MIT"
] | null | null | null | data_process/src/utils.py | Fifi-Huo/Digital_Appendix_C | 76aa286a6c3756e98e18d6064826689511e3e8cc | [
"MIT"
] | null | null | null | import datetime
def get_datetime(year, day, hour=0, minute=0, second=0):
""" Returns month and day given a day of a year"""
dt = datetime.datetime(year, 1, 1, hour, minute, second) + datetime.timedelta(days=day-1)
return dt
def get_file_time_info(radiance_filename, split_char='MYD021KM.A'):
time_inf... | 37.090909 | 117 | 0.709559 |
584d0e5626a8168e00517996b7271f9265ea60ce | 5,342 | py | Python | autolens/lens/model/maker.py | Jammy2211/PyAutoLens | 728100a3bf13f89f35030724aa08593ab44e65eb | [
"MIT"
] | 114 | 2018-03-05T07:31:47.000Z | 2022-03-08T06:40:52.000Z | autolens/lens/model/maker.py | Jammy2211/PyAutoLens | 728100a3bf13f89f35030724aa08593ab44e65eb | [
"MIT"
] | 143 | 2018-01-31T09:57:13.000Z | 2022-03-16T09:41:05.000Z | autolens/lens/model/maker.py | Jammy2211/PyAutoLens | 728100a3bf13f89f35030724aa08593ab44e65eb | [
"MIT"
] | 33 | 2018-01-31T12:15:57.000Z | 2022-01-08T18:31:02.000Z | import logging
import os
from typing import Callable, Union
from autoconf import conf
import autofit as af
from autolens.imaging.fit_imaging import FitImaging
from autolens.interferometer.fit_interferometer import FitInterferometer
from autolens.lens.model.preloads import Preloads
logger = logging.getLo... | 38.431655 | 119 | 0.624672 |
3c7fc2e5e790eef254871507d99830b4805cdcb1 | 1,665 | py | Python | models/hyperparameters/common_tpu_flags.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | 5,098 | 2018-02-09T16:56:49.000Z | 2022-03-31T13:50:40.000Z | models/hyperparameters/common_tpu_flags.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | 550 | 2018-02-07T05:30:06.000Z | 2022-03-13T22:00:09.000Z | models/hyperparameters/common_tpu_flags.py | aman2930/tpu | 1724c0ee08523ecb4e10872026afd2d8391137c1 | [
"Apache-2.0"
] | 1,920 | 2018-02-07T23:44:49.000Z | 2022-03-29T03:11:08.000Z | # Copyright 2018 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 applica... | 39.642857 | 82 | 0.682282 |
a42a9c65d41a321ae94b5258cd4c16bb5b8d1083 | 1,926 | py | Python | setup.py | NBISweden/dsw-tdk | 8c19acf9667cb01041f86e28d6d1de28058af83c | [
"Apache-2.0"
] | null | null | null | setup.py | NBISweden/dsw-tdk | 8c19acf9667cb01041f86e28d6d1de28058af83c | [
"Apache-2.0"
] | null | null | null | setup.py | NBISweden/dsw-tdk | 8c19acf9667cb01041f86e28d6d1de28058af83c | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
import os
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = ''.join(f.readlines())
setup(
name='dsw-tdk',
version='2.11.0',
keywords='dsw template toolk... | 29.181818 | 76 | 0.579958 |
83b0255f6c209fea131cc2b2cb5ea652fcececac | 1,794 | py | Python | tests/conftest.py | prothseda/flask-dv-blog | c6ec6dcce56c6e643dd11e43d27c930cebf24ca2 | [
"Unlicense"
] | null | null | null | tests/conftest.py | prothseda/flask-dv-blog | c6ec6dcce56c6e643dd11e43d27c930cebf24ca2 | [
"Unlicense"
] | 5 | 2020-08-05T10:53:01.000Z | 2021-04-26T10:27:58.000Z | tests/conftest.py | prothseda/flask-dv-blog | c6ec6dcce56c6e643dd11e43d27c930cebf24ca2 | [
"Unlicense"
] | null | null | null | from datetime import datetime
import pytest
from werkzeug.security import generate_password_hash
from flaskr import create_app, db, init_db
from flaskr.auth.models import User
from flaskr.blog.models import Post
_user1_pass = generate_password_hash("test")
_user2_pass = generate_password_hash("other")
@pytest.fixt... | 25.267606 | 80 | 0.616499 |
f2f27d84b8418ddaa7ca8732c88d0f5a992c3c4d | 12,258 | py | Python | api.py | Albert-ZCY/codemao-apis | 75aa6491427ebc7d2fd75da6fbd773b3a8b95d0b | [
"MIT"
] | null | null | null | api.py | Albert-ZCY/codemao-apis | 75aa6491427ebc7d2fd75da6fbd773b3a8b95d0b | [
"MIT"
] | null | null | null | api.py | Albert-ZCY/codemao-apis | 75aa6491427ebc7d2fd75da6fbd773b3a8b95d0b | [
"MIT"
] | null | null | null | from requests import *
from json import dumps, loads
from bs4 import BeautifulSoup
import os
import math
class CodemaoApi():
def __init__(self, UA='Mozilla/5.0 (Windows NT 10.0; ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36', debug=False):
# New: api sets
s... | 46.78626 | 175 | 0.563061 |
1eea666b460ee50bae37ecbf5b968fdd146e9b24 | 1,421 | py | Python | blog/urls.py | pranjalbareth/devlogs | 9f017f21ff1ab2d650e80102441bb89348fdd1aa | [
"MIT"
] | 1 | 2021-06-03T19:24:43.000Z | 2021-06-03T19:24:43.000Z | blog/urls.py | pranjalbareth/devlogs | 9f017f21ff1ab2d650e80102441bb89348fdd1aa | [
"MIT"
] | null | null | null | blog/urls.py | pranjalbareth/devlogs | 9f017f21ff1ab2d650e80102441bb89348fdd1aa | [
"MIT"
] | null | null | null | """devlogs URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 38.405405 | 77 | 0.672062 |
c8043a0a31437444c1250bb335e68ea520cd7fe6 | 3,174 | py | Python | lib/surface/compute/backend_services/get_health.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/backend_services/get_health.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/backend_services/get_health.py | bopopescu/Google-Cloud-SDK-1 | c4683bacb2f6192d8a816932e438a0493085469b | [
"Apache-2.0"
] | 1 | 2020-07-24T20:13:29.000Z | 2020-07-24T20:13:29.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 39.675 | 86 | 0.739761 |
7b14fa68bb100e0b7be6eefda9849078d364864b | 542 | py | Python | assignments/assignment2/metrics.py | Timurff/dlcourse_ai | ab7c0fb5d463f9e963a6624be78520dda1cf39e9 | [
"MIT"
] | null | null | null | assignments/assignment2/metrics.py | Timurff/dlcourse_ai | ab7c0fb5d463f9e963a6624be78520dda1cf39e9 | [
"MIT"
] | null | null | null | assignments/assignment2/metrics.py | Timurff/dlcourse_ai | ab7c0fb5d463f9e963a6624be78520dda1cf39e9 | [
"MIT"
] | null | null | null | def multiclass_accuracy(prediction, ground_truth):
"""
Computes metrics for multiclass classification
Arguments:
prediction, np array of int (num_samples) - model predictions
ground_truth, np array of int (num_samples) - true labels
Returns:
accuracy - ratio of accurate predictions to tota... | 27.1 | 65 | 0.671587 |
86c51334082edaec877871248731a2f2b00181cf | 824 | py | Python | tools/dynamo.py | indiees/EXAMine | edb52cc64905c59cae1c9dbd5600d73af30ed433 | [
"MIT"
] | null | null | null | tools/dynamo.py | indiees/EXAMine | edb52cc64905c59cae1c9dbd5600d73af30ed433 | [
"MIT"
] | null | null | null | tools/dynamo.py | indiees/EXAMine | edb52cc64905c59cae1c9dbd5600d73af30ed433 | [
"MIT"
] | null | null | null | from boto3.dynamodb.conditions import Key, Attr
from tools.helpers import *
import boto3
import json
dynamodb=boto3.resource("dynamodb", region_name="us-east-1")
table=dynamodb.Table("likes")
def dynamo_liked_questions(user):
id = user['UserAttributes'][0]['Value']
response=table.query(
IndexName="us... | 27.466667 | 60 | 0.649272 |
4543a0026702682a0d74e361093ba297e547e834 | 1,105 | py | Python | utils.py | rospoly/rmpc-daisy | 6e0741921094c6701546bc2a6a0ff2bff412fc3e | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | utils.py | rospoly/rmpc-daisy | 6e0741921094c6701546bc2a6a0ff2bff412fc3e | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | utils.py | rospoly/rmpc-daisy | 6e0741921094c6701546bc2a6a0ff2bff412fc3e | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | '''
method: checkInput (dictionary F, dictionary G, dictionary HXK, int NumControllers, int dimensions)
Checks that matrices from MATLAB are consistent.
Usefull to figure out eventual bugs in the parser.
'''
def checkInput(F, G, HXK, NumControllers, dimensions):
if len(F)!=NumControllers:
exit("F != NumControllers... | 26.95122 | 107 | 0.685068 |
6872ab19ab467d37c1ee31444d6071d87440eff1 | 17 | py | Python | Hologram/Api/__init__.py | kevswims/hologram-python | f1dac5e7d461146120b4f077ecbe90ccb3f4adaa | [
"MIT"
] | 1 | 2019-04-23T11:36:46.000Z | 2019-04-23T11:36:46.000Z | Hologram/Api/__init__.py | kevswims/hologram-python | f1dac5e7d461146120b4f077ecbe90ccb3f4adaa | [
"MIT"
] | null | null | null | Hologram/Api/__init__.py | kevswims/hologram-python | f1dac5e7d461146120b4f077ecbe90ccb3f4adaa | [
"MIT"
] | 1 | 2020-12-06T20:49:02.000Z | 2020-12-06T20:49:02.000Z | from Api import * | 17 | 17 | 0.764706 |
fb23531138e10f71927724f33da68370ae659f45 | 1,246 | py | Python | mlops_client/feature_store/feature.py | elemeno-ai/mlops-python-client | a5f3e3e6b8e732ff45a635e61c88eca78b443c38 | [
"Apache-2.0"
] | 1 | 2022-03-08T14:57:23.000Z | 2022-03-08T14:57:23.000Z | mlops_client/feature_store/feature.py | elemeno-ai/mlops-python-client | a5f3e3e6b8e732ff45a635e61c88eca78b443c38 | [
"Apache-2.0"
] | null | null | null | mlops_client/feature_store/feature.py | elemeno-ai/mlops-python-client | a5f3e3e6b8e732ff45a635e61c88eca78b443c38 | [
"Apache-2.0"
] | null | null | null |
from model.missing_field import MissingFieldError
from mlops_client.feature_store.feature_value_type import FeatureValueType
class Feature:
"""
Builds a Feature object.
Object building functions:
- with_feature_name: The name of the feature.
- with_feature_value_type: The type of the feature value.
... | 27.086957 | 87 | 0.728732 |
d8d48c8e3a3706e032a193eb0d89cc676eb904ec | 569 | py | Python | nomadgram/notifications/migrations/0003_auto_20180125_2222.py | sunutf/nomadgram | c46d3cd1ce6494cb83374ab360294f874946f2bb | [
"MIT"
] | null | null | null | nomadgram/notifications/migrations/0003_auto_20180125_2222.py | sunutf/nomadgram | c46d3cd1ce6494cb83374ab360294f874946f2bb | [
"MIT"
] | 16 | 2020-06-05T16:53:58.000Z | 2022-03-11T23:26:17.000Z | nomadgram/notifications/migrations/0003_auto_20180125_2222.py | sunutf/nomadgram | c46d3cd1ce6494cb83374ab360294f874946f2bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-01-25 13:22
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('notifications', '0002_auto_20180125_2217'),
]
oper... | 25.863636 | 123 | 0.659051 |
bb10add9d965a87aa59306356c6d670abc2a5612 | 2,018 | py | Python | controller/nodes/tf_prefixer.py | raphaeldeimel/panda_mti | 84d694fa0a1aa0df466d773410871eb1c4f6c1d9 | [
"BSD-3-Clause"
] | 9 | 2020-05-19T09:12:13.000Z | 2021-11-25T14:49:07.000Z | controller/nodes/tf_prefixer.py | raphaeldeimel/panda_mti | 84d694fa0a1aa0df466d773410871eb1c4f6c1d9 | [
"BSD-3-Clause"
] | null | null | null | controller/nodes/tf_prefixer.py | raphaeldeimel/panda_mti | 84d694fa0a1aa0df466d773410871eb1c4f6c1d9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#Copyright 2020 Raphael Deimel
#
#Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
#
#1. Redistributions of source code must retain the above copyright notice, this list of condit... | 49.219512 | 756 | 0.781962 |
615ca3ee57f8110ca680559f99f7871fa55f6a65 | 39,122 | py | Python | apps/othercontents/views.py | Sunbird-Ed/evolve-api | 371b39422839762e32401340456c13858cb8e1e9 | [
"MIT"
] | 1 | 2019-02-27T15:26:11.000Z | 2019-02-27T15:26:11.000Z | apps/othercontents/views.py | Sunbird-Ed/evolve-api | 371b39422839762e32401340456c13858cb8e1e9 | [
"MIT"
] | 9 | 2019-12-16T10:09:46.000Z | 2022-03-11T23:42:12.000Z | apps/othercontents/views.py | Sunbird-Ed/evolve-api | 371b39422839762e32401340456c13858cb8e1e9 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from .models import OtherContributors,Job
from rest_framework import status
from rest_framework.generics import (
ListAPIView,
ListCreateAPIView,
ListAPIView,
RetrieveUpdateAPIView,)
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticat... | 47.709756 | 493 | 0.73575 |
801c0cc27023596c77ffab00171f63063267b972 | 3,741 | py | Python | ros/src/tl_detector/light_classification/tl_classifier.py | tlapinsk/CarND-Capstone | d0f24113fec3423e3222543490c6f1add7082ba5 | [
"MIT"
] | 3 | 2018-03-08T06:05:13.000Z | 2018-03-09T14:36:43.000Z | ros/src/tl_detector/light_classification/tl_classifier.py | tlapinsk/CarND-Capstone | d0f24113fec3423e3222543490c6f1add7082ba5 | [
"MIT"
] | 1 | 2018-03-26T02:10:43.000Z | 2018-03-26T02:10:43.000Z | ros/src/tl_detector/light_classification/tl_classifier.py | tlapinsk/CarND-Capstone | d0f24113fec3423e3222543490c6f1add7082ba5 | [
"MIT"
] | 1 | 2018-03-30T19:45:02.000Z | 2018-03-30T19:45:02.000Z | from styx_msgs.msg import TrafficLight
from utils import label_map_util
from utils import visualization_utils as vis_util
import cv2
import rospy
import sys
import numpy as np
import tensorflow as tf
import os
REAL_MODEL = 'frozen_inference_graph_real.pb'
SIMULATION_SSD_MODEL = 'frozen_inference_graph_simulation_ssd... | 35.292453 | 130 | 0.642609 |
33305bc520932554a21b145b0dd0275efd66754b | 69,371 | py | Python | scripts/test_parse.py | KarenCommins/PD-books | ebb615621f255694a562faf0a2db1b1cc4cfaabf | [
"CC0-1.0"
] | 25 | 2019-07-22T13:40:35.000Z | 2021-04-27T14:51:34.000Z | scripts/test_parse.py | KarenCommins/PD-books | ebb615621f255694a562faf0a2db1b1cc4cfaabf | [
"CC0-1.0"
] | 2 | 2019-08-11T17:02:58.000Z | 2019-09-30T14:59:51.000Z | scripts/test_parse.py | KarenCommins/PD-books | ebb615621f255694a562faf0a2db1b1cc4cfaabf | [
"CC0-1.0"
] | 3 | 2020-04-20T20:00:34.000Z | 2020-11-25T14:56:37.000Z | import pytest
import parse
@pytest.fixture()
def simple():
return 'A. E. UHE, by Frederick H. Martens. (Little biographies: series 1, Musicians) © 30Dec22, A695089. R59809, 17Mar50, Breitkopf Publications, inc., successor to Breitkopf & Haertel, inc. (PWH)'
@pytest.fixture()
def simple_auth_title():
return '... | 46.032515 | 525 | 0.630422 |
784307a79ec184b28bca94de6e82ad6d828a6a26 | 6,042 | py | Python | src/models.py | Alex-Derhacobian/cs224w_project | bcce5d8497b4161bcdfc5dc367ea13ccd27af363 | [
"MIT"
] | null | null | null | src/models.py | Alex-Derhacobian/cs224w_project | bcce5d8497b4161bcdfc5dc367ea13ccd27af363 | [
"MIT"
] | null | null | null | src/models.py | Alex-Derhacobian/cs224w_project | bcce5d8497b4161bcdfc5dc367ea13ccd27af363 | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.layers import *
from torch.nn.parameter import Parameter
device = torch.device("cuda:0")
class GCNModel(nn.Module):
"""
The model for the single kind of deepgcn blocks.
The model architecture likes:
inpu... | 36.39759 | 119 | 0.563721 |
73ca8a8f4253adce47715be1fa467ea2f8405e44 | 194 | py | Python | erddapy/doc_helpers.py | pyoceans/erddapy | 784d164de97e764a757d9612dcd5e42f69e635eb | [
"BSD-3-Clause"
] | 17 | 2017-10-17T12:27:31.000Z | 2019-02-05T18:20:10.000Z | erddapy/doc_helpers.py | pyoceans/erddapy | 784d164de97e764a757d9612dcd5e42f69e635eb | [
"BSD-3-Clause"
] | 22 | 2017-10-09T18:50:02.000Z | 2019-01-31T13:54:08.000Z | erddapy/doc_helpers.py | pyoceans/erddapy | 784d164de97e764a757d9612dcd5e42f69e635eb | [
"BSD-3-Clause"
] | 4 | 2017-10-09T15:58:39.000Z | 2018-03-08T15:18:29.000Z | """Documentation helpers."""
def show_iframe(src):
"""Show HTML returns on Jupyter outputs."""
from IPython.display import IFrame
return IFrame(src=src, width="100%", height=950)
| 21.555556 | 52 | 0.685567 |
cca27db00f48d09e5ac376295204abfd1810ac54 | 35,115 | py | Python | pandas/io/html.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | 1 | 2018-08-01T05:39:55.000Z | 2018-08-01T05:39:55.000Z | pandas/io/html.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | null | null | null | pandas/io/html.py | henriqueribeiro/pandas | 996f361f8e6986ea1c65ccb164a4c585e1f4a027 | [
"BSD-3-Clause"
] | 1 | 2020-02-08T10:16:39.000Z | 2020-02-08T10:16:39.000Z | """:mod:`pandas.io.html` is a module containing functionality for dealing with
HTML IO.
"""
import os
import re
import numbers
import collections
from distutils.version import LooseVersion
from pandas.core.dtypes.common import is_list_like
from pandas.errors import EmptyDataError
from pandas.io.common import _is_ur... | 32.156593 | 79 | 0.587413 |
25572ea25c47c3cc92d372541c33ae163e5fca72 | 4,687 | py | Python | cloupy/test/test_integration/test_integration_imgw.py | pdGruby/cloupy | 1abf45af30871013b2fafd4d0c2f0d2ac52997d1 | [
"MIT"
] | 1 | 2021-11-13T13:56:31.000Z | 2021-11-13T13:56:31.000Z | cloupy/test/test_integration/test_integration_imgw.py | pdGruby/cloupy | 1abf45af30871013b2fafd4d0c2f0d2ac52997d1 | [
"MIT"
] | null | null | null | cloupy/test/test_integration/test_integration_imgw.py | pdGruby/cloupy | 1abf45af30871013b2fafd4d0c2f0d2ac52997d1 | [
"MIT"
] | null | null | null | from cloupy.scraping import imgw
import pytest
import urllib.request
import urllib.error
def check_if_NOT_connected_to_the_internet(host='http://google.com'):
try:
urllib.request.urlopen(host)
return False
except urllib.error.URLError:
return True
@pytest.mark.filterwarnings("ignore:... | 34.211679 | 110 | 0.572434 |
a411dfcfa78d767d36df241d6eb71fa377ef150f | 4,367 | py | Python | webservices/resources/filings.py | 18F/openFEC | ee7b7368e0934f50c391789fb55444f811c1a2f7 | [
"CC0-1.0"
] | 246 | 2015-01-07T16:59:42.000Z | 2020-01-18T20:35:05.000Z | webservices/resources/filings.py | 18F/openFEC | ee7b7368e0934f50c391789fb55444f811c1a2f7 | [
"CC0-1.0"
] | 2,532 | 2015-01-02T16:22:46.000Z | 2018-03-08T17:30:53.000Z | webservices/resources/filings.py | 18F/openFEC | ee7b7368e0934f50c391789fb55444f811c1a2f7 | [
"CC0-1.0"
] | 75 | 2015-02-01T00:46:56.000Z | 2021-02-14T10:51:34.000Z | from flask_apispec import doc
from webservices import args
from webservices import docs
from webservices import utils
from webservices import schemas
from webservices.common import views
from webservices.common import counts
from webservices.common import models
@doc(
tags=['filings'],
description=docs.FILIN... | 32.110294 | 106 | 0.654912 |
e6ade71a6b2a9be2a4423bfe33af308b4b2918fb | 1,952 | py | Python | torch/utils/data/datapipes/iter/__init__.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 1 | 2022-01-20T03:49:23.000Z | 2022-01-20T03:49:23.000Z | torch/utils/data/datapipes/iter/__init__.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | 14 | 2021-10-14T06:58:50.000Z | 2021-12-17T11:51:07.000Z | torch/utils/data/datapipes/iter/__init__.py | steffenerickson/pytorch | 0b656c4c69ce77ecd9aace486e471917e4660746 | [
"Intel"
] | null | null | null | from torch.utils.data.datapipes.iter.callable import (
CollatorIterDataPipe as Collator,
MapperIterDataPipe as Mapper,
)
from torch.utils.data.datapipes.iter.combinatorics import (
SamplerIterDataPipe as Sampler,
ShufflerIterDataPipe as Shuffler,
)
from torch.utils.data.datapipes.iter.combining import (... | 30.030769 | 59 | 0.697746 |
9dc7652ee3b9977c71d285503e1dbabc91b66e55 | 11,573 | py | Python | quantities/dimensionality.py | drammock/python-quantities | 6ee561e918c00fec773481fa9a2c73e8e106f061 | [
"DOC"
] | null | null | null | quantities/dimensionality.py | drammock/python-quantities | 6ee561e918c00fec773481fa9a2c73e8e106f061 | [
"DOC"
] | null | null | null | quantities/dimensionality.py | drammock/python-quantities | 6ee561e918c00fec773481fa9a2c73e8e106f061 | [
"DOC"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
from __future__ import absolute_import
import sys
import operator
import numpy as np
from . import markup
from .registry import unit_registry
from .decorators import memoize
def assert_isinstance(obj, types):
try:
assert isinstance(obj, types)
except AssertionError:
... | 28.089806 | 80 | 0.593105 |
c7bbda3b4ebbfe07ee0806de5edd1e217c1740cb | 17,025 | py | Python | python/ambassador/fetch/service.py | Asher-Wang/ambassador | 393a52832d081e0d8d0e0ecd5a14cfe18c62b837 | [
"Apache-2.0"
] | 3,438 | 2017-04-23T23:10:18.000Z | 2021-06-02T10:11:45.000Z | python/ambassador/fetch/service.py | Asher-Wang/ambassador | 393a52832d081e0d8d0e0ecd5a14cfe18c62b837 | [
"Apache-2.0"
] | 1,906 | 2017-04-11T17:47:54.000Z | 2021-06-02T14:20:11.000Z | python/ambassador/fetch/service.py | Asher-Wang/ambassador | 393a52832d081e0d8d0e0ecd5a14cfe18c62b837 | [
"Apache-2.0"
] | 591 | 2017-04-17T17:50:08.000Z | 2021-06-01T08:20:34.000Z | from typing import Dict, FrozenSet, List, Optional
import dataclasses
from ..config import Config
from .dependency import ServiceDependency
from .k8sobject import KubernetesGVK, KubernetesObjectKey, KubernetesObject
from .k8sprocessor import AggregateKubernetesProcessor, ManagedKubernetesProcessor
from .resource imp... | 41.933498 | 129 | 0.579853 |
cf4f07172815d56b413f5a7cedbcaf10122836ac | 951 | py | Python | lib/python/flame/object_factory.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 6 | 2022-03-30T23:37:05.000Z | 2022-03-31T17:29:14.000Z | lib/python/flame/object_factory.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 10 | 2022-03-31T00:03:58.000Z | 2022-03-31T07:15:06.000Z | lib/python/flame/object_factory.py | GaoxiangLuo/flame | 16bd1715a545421d45ea0fc32544e448389de49c | [
"Apache-2.0"
] | 2 | 2022-03-30T23:25:15.000Z | 2022-03-30T23:55:47.000Z | # Copyright 2022 Cisco Systems, Inc. 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 l... | 31.7 | 74 | 0.697161 |
dde51d794930d0e821efda2aad5378744326a0ea | 389 | py | Python | designthinking/urls.py | IBMIXN/DesignThinkingapp | 2f05f9130d8fd26f3ae7a94456a3e442c9fa5518 | [
"Apache-2.0"
] | null | null | null | designthinking/urls.py | IBMIXN/DesignThinkingapp | 2f05f9130d8fd26f3ae7a94456a3e442c9fa5518 | [
"Apache-2.0"
] | null | null | null | designthinking/urls.py | IBMIXN/DesignThinkingapp | 2f05f9130d8fd26f3ae7a94456a3e442c9fa5518 | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.dashboard, name='dashboard'),
path('profile', views.profile, name='profile'),
path('newdesign', views.newdesign, name='newdesign'),
path('review/<str:id>', views.review, name='review'),
path('help', views.helpPage, name... | 32.416667 | 57 | 0.66838 |
681ada74c8017847aa8beb5950ff49d630441a41 | 400 | py | Python | dfu/tools/nrfutil-script.py | wangchaoqun1997/AirMouse | c6bcdb6247128f4833bb81e1671ee88a520150b5 | [
"Apache-2.0"
] | 1 | 2021-06-13T17:41:21.000Z | 2021-06-13T17:41:21.000Z | dfu/tools/nrfutil-script.py | wangchaoqun1997/AirMouse | c6bcdb6247128f4833bb81e1671ee88a520150b5 | [
"Apache-2.0"
] | null | null | null | dfu/tools/nrfutil-script.py | wangchaoqun1997/AirMouse | c6bcdb6247128f4833bb81e1671ee88a520150b5 | [
"Apache-2.0"
] | 1 | 2021-07-12T01:02:14.000Z | 2021-07-12T01:02:14.000Z | #!c:\python27\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'nrfutil==3.4.0','console_scripts','nrfutil'
__requires__ = 'nrfutil==3.4.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
... | 30.769231 | 75 | 0.6425 |
adcf43cab659a9cb9d489121c7f898196c26eb52 | 627 | py | Python | Week 6/id_200/leetCode-547-200.py | theshaodi/algorithm004-05 | cac0cd3bb1211d50936234c08f6ece38677e55cf | [
"Apache-2.0"
] | 1 | 2019-10-12T06:48:45.000Z | 2019-10-12T06:48:45.000Z | Week 6/id_200/leetCode-547-200.py | theshaodi/algorithm004-05 | cac0cd3bb1211d50936234c08f6ece38677e55cf | [
"Apache-2.0"
] | 1 | 2019-12-01T10:02:03.000Z | 2019-12-01T10:02:03.000Z | Week 6/id_200/leetCode-547-200.py | theshaodi/algorithm004-05 | cac0cd3bb1211d50936234c08f6ece38677e55cf | [
"Apache-2.0"
] | null | null | null | # 547 朋友圈
class Solution:
def findCircleNum(self, M: List[List[int]]) -> int:
if not M: return 0
n=len(M)
p=[i for i in range(n)]
for i in range(n):
for j in range(n):
if M[i][j]==1:
self._union(p,i,j)
return len(set([self._par... | 25.08 | 62 | 0.46252 |
4b115fbc91eff496793d34ea4a1b1401c493b3ba | 43 | py | Python | test/ksbert.py | hyehyeonmoon/WelfareForEveryOne-1 | 7929b52e0235acb5208673b50214f0fe8130296a | [
"MIT"
] | null | null | null | test/ksbert.py | hyehyeonmoon/WelfareForEveryOne-1 | 7929b52e0235acb5208673b50214f0fe8130296a | [
"MIT"
] | null | null | null | test/ksbert.py | hyehyeonmoon/WelfareForEveryOne-1 | 7929b52e0235acb5208673b50214f0fe8130296a | [
"MIT"
] | null | null | null | from locust import HttpUser, between, task
| 21.5 | 42 | 0.813953 |
9c22fdb54cec76e368961464ab2a83b659ac22d5 | 2,612 | py | Python | test/contrib/prometheus_metric_test.py | victoriaalee/luigi | af3247695b499ffc678c574882aaa5dd282d9438 | [
"Apache-2.0"
] | 1 | 2017-09-13T12:28:09.000Z | 2017-09-13T12:28:09.000Z | test/contrib/prometheus_metric_test.py | victoriaalee/luigi | af3247695b499ffc678c574882aaa5dd282d9438 | [
"Apache-2.0"
] | null | null | null | test/contrib/prometheus_metric_test.py | victoriaalee/luigi | af3247695b499ffc678c574882aaa5dd282d9438 | [
"Apache-2.0"
] | null | null | null | from helpers import unittest
from nose.plugins.attrib import attr
from luigi.contrib.prometheus_metric import PrometheusMetricsCollector
from luigi.metrics import MetricsCollectors
from luigi.scheduler import Scheduler
WORKER = 'myworker'
TASK_ID = 'TaskID'
TASK_FAMILY = 'TaskFamily'
@attr('contrib')
class Promethe... | 36.788732 | 118 | 0.718989 |
0755c781e21531634fa599da0d601631b9d7d269 | 3,289 | py | Python | benchmark/startCirq3356.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3356.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startCirq3356.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=41
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 37.375 | 77 | 0.681666 |
2550705c0ab342bf10208cd93846ae45a66108ae | 2,812 | py | Python | skdecide/discrete_optimization/generic_tools/mutations/mutation_catalog.py | emilienDespres/scikit-decide | 2a3dd2d93e5e6d07984e1bc02b6e969261aeefbc | [
"MIT"
] | 27 | 2020-11-23T11:45:31.000Z | 2022-03-22T08:08:00.000Z | skdecide/discrete_optimization/generic_tools/mutations/mutation_catalog.py | emilienDespres/scikit-decide | 2a3dd2d93e5e6d07984e1bc02b6e969261aeefbc | [
"MIT"
] | 94 | 2021-02-24T09:50:23.000Z | 2022-02-27T10:07:15.000Z | skdecide/discrete_optimization/generic_tools/mutations/mutation_catalog.py | emilienDespres/scikit-decide | 2a3dd2d93e5e6d07984e1bc02b6e969261aeefbc | [
"MIT"
] | 12 | 2020-12-08T10:38:26.000Z | 2021-10-01T09:17:04.000Z | # Copyright (c) AIRBUS 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 __future__ import annotations
from skdecide.discrete_optimization.generic_tools.do_problem import (
Problem,
Solution,
TypeAttribute,
... | 36.519481 | 90 | 0.73862 |
f2be3adfacafcd1b1c764de9a7836e520502e1df | 290 | py | Python | fdk_client/platform/models/BulkHsnResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/BulkHsnResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | fdk_client/platform/models/BulkHsnResponse.py | kavish-d/fdk-client-python | a1023eb530473322cb52e095fc4ceb226c1e6037 | [
"MIT"
] | null | null | null | """Platform Models."""
from marshmallow import fields, Schema
from marshmallow.validate import OneOf
from ..enums import *
from ..models.BaseSchema import BaseSchema
class BulkHsnResponse(BaseSchema):
# Catalog swagger.json
success = fields.Boolean(required=False)
| 16.111111 | 44 | 0.734483 |
d377c568b9d20379a1ff0b4c5be1f1d09b59a532 | 1,141 | py | Python | migrations/versions/97facdf3c51a_users_table.py | Otacon27/pi-camera-stream-flask | 695f3ea16139a6ec170af5752831c730418c7d29 | [
"MIT"
] | null | null | null | migrations/versions/97facdf3c51a_users_table.py | Otacon27/pi-camera-stream-flask | 695f3ea16139a6ec170af5752831c730418c7d29 | [
"MIT"
] | null | null | null | migrations/versions/97facdf3c51a_users_table.py | Otacon27/pi-camera-stream-flask | 695f3ea16139a6ec170af5752831c730418c7d29 | [
"MIT"
] | null | null | null | """users table
Revision ID: 97facdf3c51a
Revises:
Create Date: 2021-11-16 10:59:52.955419
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '97facdf3c51a'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto genera... | 29.25641 | 82 | 0.680982 |
078238ce0c568997d866bac117c9aecb4243cd34 | 4,795 | py | Python | roundup/backends/sessions_dbm.py | aparcar/roundup | e2900d365e86da5e037cbe8c246bd3cbb190b834 | [
"MIT"
] | 4 | 2020-08-01T00:34:14.000Z | 2022-02-27T06:04:12.000Z | roundup/backends/sessions_dbm.py | aparcar/roundup | e2900d365e86da5e037cbe8c246bd3cbb190b834 | [
"MIT"
] | 1 | 2021-05-17T22:47:26.000Z | 2021-05-25T14:26:06.000Z | roundup/backends/sessions_dbm.py | aparcar/roundup | e2900d365e86da5e037cbe8c246bd3cbb190b834 | [
"MIT"
] | 3 | 2020-11-13T17:43:43.000Z | 2022-02-27T06:04:13.000Z | """This module defines a very basic store that's used by the CGI interface
to store session and one-time-key information.
Yes, it's called "sessions" - because originally it only defined a session
class. It's now also used for One Time Key handling too.
"""
__docformat__ = 'restructuredtext'
import os, marshal, time
... | 28.712575 | 77 | 0.544317 |
30a65d07fd79224148b1a2230195d8aac3867711 | 779 | py | Python | django_blog/users/forms.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | null | null | null | django_blog/users/forms.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | 6 | 2021-04-08T20:20:47.000Z | 2022-02-13T20:21:29.000Z | django_blog/users/forms.py | tienduy-nguyen/django-web | 4b4078042b9c388dd00907a09d10e2a7889f4dea | [
"MIT"
] | null | null | null | from django import forms
from django.forms import ModelForm
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm
from .models import Profile
class RegistrationForm(UserCreationForm):
email = forms.EmailField()
class Meta:
model = User
fields = [
... | 20.5 | 54 | 0.578947 |
9ada6b10e697968e06e0dbc443d5a6a68c2d1810 | 6,390 | py | Python | examples/add_sub/model.py | jackyh/python_backend | 89d88ecd11832e3ee46a532f083b47ff6ac09611 | [
"BSD-3-Clause"
] | null | null | null | examples/add_sub/model.py | jackyh/python_backend | 89d88ecd11832e3ee46a532f083b47ff6ac09611 | [
"BSD-3-Clause"
] | null | null | null | examples/add_sub/model.py | jackyh/python_backend | 89d88ecd11832e3ee46a532f083b47ff6ac09611 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 45.319149 | 82 | 0.681377 |
60d25ab16a9616ae141e0dfec53a8b49e1b756c7 | 888 | py | Python | recipes/Python/492230_progressbarpy/recipe-492230.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/492230_progressbarpy/recipe-492230.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/492230_progressbarpy/recipe-492230.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | import Tkinter
################################################################################
class PB:
# Create Progress Bar
def __init__(self, width, height):
self.__root = Tkinter.Toplevel()
self.__root.resizable(False, False)
self.__root.title('Progress Bar')
self.__canv... | 28.645161 | 80 | 0.547297 |
3fba9e7d1b272291157cc091229f954373cc1109 | 751 | py | Python | docs_src/metadata/tutorial001.py | shashankrnr32/fastapi | 58ab733f19846b4875c5b79bfb1f4d1cb7f4823f | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | docs_src/metadata/tutorial001.py | shashankrnr32/fastapi | 58ab733f19846b4875c5b79bfb1f4d1cb7f4823f | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | docs_src/metadata/tutorial001.py | shashankrnr32/fastapi | 58ab733f19846b4875c5b79bfb1f4d1cb7f4823f | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | from fastapi import FastAPI
description = """
ChimichangApp API helps you do awesome stuff. 🚀
## Items
You can **read items**.
## Users
You will be able to:
* **Create users** (_not implemented_).
* **Read users** (_not implemented_).
"""
app = FastAPI(
title="ChimichangApp",
description=description,
... | 19.763158 | 66 | 0.604527 |
ea48db568acb09ced66ef8a9f90f0e11e1d03857 | 1,191 | py | Python | imapclient/test/test_datetime_util.py | aleksandr-rakov/imapclient | 4efc7ef80caa82bdbc4c7aecfbc8f3139ae6ebe4 | [
"BSD-3-Clause"
] | 1 | 2017-05-12T23:54:10.000Z | 2017-05-12T23:54:10.000Z | imapclient/test/test_datetime_util.py | aleksandr-rakov/imapclient | 4efc7ef80caa82bdbc4c7aecfbc8f3139ae6ebe4 | [
"BSD-3-Clause"
] | null | null | null | imapclient/test/test_datetime_util.py | aleksandr-rakov/imapclient | 4efc7ef80caa82bdbc4c7aecfbc8f3139ae6ebe4 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2014, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
from __future__ import unicode_literals
from datetime import datetime
from ..datetime_util import parse_to_datetime, datetime_to_native
from ..fixed_offset import FixedOffset
from .util ... | 29.775 | 70 | 0.669186 |
de3562f174603fe6583f7e2613976639ea1f3f6d | 1,358 | py | Python | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/client.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 22 | 2020-08-27T00:47:20.000Z | 2020-09-17T15:39:39.000Z | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/client.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 116 | 2020-08-27T01:11:27.000Z | 2020-09-19T02:47:52.000Z | airbyte-integrations/connectors/source-google-sheets/google_sheets_source/client.py | heap/airbyte | 35e65f444f38b617a12e12d425da2115f08b5f14 | [
"MIT"
] | 1 | 2020-09-15T06:10:01.000Z | 2020-09-15T06:10:01.000Z | #
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#
from typing import Dict, List
import backoff
from googleapiclient import errors
from requests import codes as status_codes
from .helpers import SCOPES, Helpers
def give_up(error):
code = error.resp.status
# Stop retrying if it's not a problem wi... | 33.95 | 87 | 0.723859 |
af975e44550e5ae6475152356e79014c23b1201b | 1,209 | py | Python | blink1_demo/demo_multi_blink1.py | todbot/blink1-python | 0058d2f8f175332b1c41cd4d089f2beb26e0b2b5 | [
"MIT"
] | 35 | 2017-01-26T22:33:48.000Z | 2022-02-21T18:46:51.000Z | blink1_demo/demo_multi_blink1.py | todbot/blink1-python | 0058d2f8f175332b1c41cd4d089f2beb26e0b2b5 | [
"MIT"
] | 13 | 2017-01-28T18:30:15.000Z | 2021-09-21T01:26:49.000Z | blink1_demo/demo_multi_blink1.py | todbot/blink1-python | 0058d2f8f175332b1c41cd4d089f2beb26e0b2b5 | [
"MIT"
] | 7 | 2017-01-28T15:45:14.000Z | 2020-08-29T17:47:13.000Z | #!/usr/bin/env python
"""
demo2 -- demo of blink1 library, accessing multiple blink(1) devices
"""
import time,sys
from blink1.blink1 import Blink1
blink1_serials = Blink1.list()
if blink1_serials:
print("blink(1) devices found: "+ ','.join(blink1_serials))
else:
print("no blink1 found")
sys.exit()
# To... | 25.1875 | 68 | 0.705542 |
dcf20c8935d864de3e0acfb63304fc59fbc212a2 | 4,893 | py | Python | tests/stubtest_third_party.py | nzig/typeshed | bc2ec748f68dcb516a9ed83c6b8a494f31cf3698 | [
"Apache-2.0"
] | null | null | null | tests/stubtest_third_party.py | nzig/typeshed | bc2ec748f68dcb516a9ed83c6b8a494f31cf3698 | [
"Apache-2.0"
] | null | null | null | tests/stubtest_third_party.py | nzig/typeshed | bc2ec748f68dcb516a9ed83c6b8a494f31cf3698 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Test typeshed's third party stubs using stubtest"""
import argparse
import functools
import subprocess
import sys
import tempfile
import toml
import venv
from glob import glob
from pathlib import Path
EXCLUDE_LIST = [
"Flask", # fails when stubtest tries to stringify some object
"p... | 35.977941 | 103 | 0.613325 |
79f00d467a333898fd9c96326d03e32025adda5a | 6,583 | py | Python | tests/test_docker_cp.py | julianolf/docker-cp | bd7f7f0760cec0545a0a407ead0ba05eb7872a12 | [
"MIT"
] | null | null | null | tests/test_docker_cp.py | julianolf/docker-cp | bd7f7f0760cec0545a0a407ead0ba05eb7872a12 | [
"MIT"
] | 52 | 2019-07-01T19:32:51.000Z | 2022-03-01T16:56:28.000Z | tests/test_docker_cp.py | julianolf/docker-cp | bd7f7f0760cec0545a0a407ead0ba05eb7872a12 | [
"MIT"
] | null | null | null | import filecmp
import os
import socket
import sys
import tempfile
import time
from unittest import mock
import docker
import pytest
import schema
from docker_cp import cli
def docker_responsive():
client = docker.from_env()
try:
return client.ping()
except Exception:
return False
def i... | 29.922727 | 78 | 0.637399 |
2d3682ca6e554cbc116f7bee3adcc8e8bf575ca6 | 22,311 | py | Python | data/model/oci/test/test_oci_manifest.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | data/model/oci/test/test_oci_manifest.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | data/model/oci/test/test_oci_manifest.py | kwestpharedhat/quay | a0df895005bcd3e53847046f69f6a7add87c88fd | [
"Apache-2.0"
] | null | null | null | import json
import pytest
from playhouse.test_utils import assert_query_count
from app import docker_v2_signing_key, storage
from digest.digest_tools import sha256_digest
from data.database import (
Tag,
ManifestBlob,
ImageStorageLocation,
ManifestChild,
ImageStorage,
Image,
RepositoryTag... | 35.927536 | 100 | 0.698803 |
462aa77a681681c5de221409231a8f900a965c8b | 6,278 | py | Python | learn/plot_plotly.py | natolambert/dynamicslearn | ad32bf12ff0283884c4b0bcdcbb30ce680446208 | [
"MIT"
] | 32 | 2019-09-13T21:40:05.000Z | 2022-01-22T11:35:25.000Z | learn/plot_plotly.py | natolambert/dynamics-learn | ad32bf12ff0283884c4b0bcdcbb30ce680446208 | [
"MIT"
] | 7 | 2019-09-05T00:25:46.000Z | 2019-09-05T00:51:53.000Z | learn/plot_plotly.py | natolambert/dynamicslearn | ad32bf12ff0283884c4b0bcdcbb30ce680446208 | [
"MIT"
] | 12 | 2019-10-09T01:34:42.000Z | 2021-07-21T22:07:01.000Z | import plotly.io as pio
import hydra
from omegaconf import OmegaConf
import logging
import os
import sys
import glob
# from natsort import natsorted
import numpy as np
import torch
from collections import defaultdict
# add cwd to path to allow running directly from the repo top level directory
sys.path.append(os.get... | 34.119565 | 139 | 0.538866 |
f811c420b36047961872e4fd7d11699515f09af7 | 5,292 | py | Python | test/functional/p2p_leak.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | 2 | 2020-06-12T10:12:49.000Z | 2020-07-31T19:43:09.000Z | test/functional/p2p_leak.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | null | null | null | test/functional/p2p_leak.py | KiPa-SuJi/PaydayCoin-Core | d807d95550d955bfa9ffda2b39cad745422224e5 | [
"MIT"
] | 1 | 2020-12-04T13:34:46.000Z | 2020-12-04T13:34:46.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The PaydayCoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERS... | 41.669291 | 127 | 0.73167 |
da5bb9835a25f9770ba4e7c07192f57a65206342 | 1,219 | py | Python | setup.py | taljaards/jsons | 9ae486ebf85dea96f7b0b2e1ad62543a75aaa486 | [
"MIT"
] | null | null | null | setup.py | taljaards/jsons | 9ae486ebf85dea96f7b0b2e1ad62543a75aaa486 | [
"MIT"
] | null | null | null | setup.py | taljaards/jsons | 9ae486ebf85dea96f7b0b2e1ad62543a75aaa486 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md', 'r') as fh:
long_description = fh.read()
setup(
name='jsons',
version='1.1.1',
author='Ramon Hagenaars',
author_email='ramon.hagenaars@gmail.com',
description='For serializing Python objects to JSON (dicts) and back',
long_description=l... | 27.704545 | 74 | 0.604594 |
020bb6776dfbf03105618301fa3beba330546600 | 45,296 | py | Python | tests/custom_cluster/test_admission_controller.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | null | null | null | tests/custom_cluster/test_admission_controller.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | null | null | null | tests/custom_cluster/test_admission_controller.py | suifengzhuliu/impala | 611f4c6f3b18cfcddff3b2956cbb87c295a87655 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 47.932275 | 97 | 0.720174 |
580446f87732d4532d2d2252924a50aeda3accc0 | 3,017 | py | Python | wataru/workflow/scenario.py | risuoku/wataru | 63be36d15454abd0636f67eaf1e80728b8c5a9bd | [
"MIT"
] | null | null | null | wataru/workflow/scenario.py | risuoku/wataru | 63be36d15454abd0636f67eaf1e80728b8c5a9bd | [
"MIT"
] | null | null | null | wataru/workflow/scenario.py | risuoku/wataru | 63be36d15454abd0636f67eaf1e80728b8c5a9bd | [
"MIT"
] | null | null | null | from wataru.logging import getLogger
from wataru.workflow.state import (
Material as ModelMaterial,
session_scope,
get_session,
)
from wataru.workflow.manager import ModelManager
import wataru.workflow.state as wfstate
import wataru.workflow.utils as wfutils
import os
import sys
import importlib
import p... | 31.103093 | 101 | 0.602917 |
ed464397c1ca2351e586ee991dd157149120a36e | 1,358 | py | Python | turorials/tutorial1/blob_learning.py | JonasVervloet/RL-Coverage-Planner | 31c0cd704bf11e13354a8b744569241086e10916 | [
"MIT"
] | 12 | 2021-05-25T11:57:39.000Z | 2022-03-31T13:40:43.000Z | turorials/tutorial1/blob_learning.py | JonasVervloet/RL-Coverage-Planner | 31c0cd704bf11e13354a8b744569241086e10916 | [
"MIT"
] | 1 | 2021-07-08T07:55:06.000Z | 2021-07-08T07:55:06.000Z | turorials/tutorial1/blob_learning.py | JonasVervloet/RL-Coverage-Planner | 31c0cd704bf11e13354a8b744569241086e10916 | [
"MIT"
] | 5 | 2021-09-22T01:58:05.000Z | 2022-03-23T01:55:53.000Z | import matplotlib.pyplot as plt
import numpy as np
from turorials.tutorial1.environment import BlobEnv
from turorials.tutorial1.q_learner import QLearner
SIZE = 5
NB_EPISODES = 25000
START_EPS = 0.9
EPS_DECAY = 0.9999
SHOW_EVERY = 1000
PRINT_EVERY = 1000
LEARNING_RATE = 0.1
DISCOUNT = 0.95
env = BlobEnv(SIZE)
q_l... | 24.25 | 82 | 0.698822 |
0e43d46786162135ef6343b15ae8315e3531c083 | 9,058 | py | Python | uasyncio/uasyncio/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 126 | 2019-07-19T14:42:41.000Z | 2022-03-21T22:22:19.000Z | uasyncio/uasyncio/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 38 | 2019-08-28T01:46:31.000Z | 2022-03-17T05:46:51.000Z | uasyncio/uasyncio/__init__.py | MaxTurchin/pycopy-lib | d7a69fc2a28031e2ca475c29239f715c1809d8cc | [
"PSF-2.0"
] | 55 | 2019-08-02T09:32:33.000Z | 2021-12-22T11:25:51.000Z | # (c) 2014-2020 Paul Sokolovsky. MIT license.
from micropython import const
import uerrno
import uselect as select
import usocket as _socket
import uio
from uasyncio.core import *
DEBUG = 0
log = None
def set_debug(val):
global DEBUG, log
DEBUG = val
if val:
import ulogging
log = ulogging... | 33.179487 | 88 | 0.556966 |
9d63f8de43ddf5db539cb6f6cddc8b53b5380b6f | 583 | py | Python | tests/sentry/templatetags/test_sentry_api.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/templatetags/test_sentry_api.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/templatetags/test_sentry_api.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.template import engines
from sentry.testutils import TestCase
class SerializeDetailedOrgTest(TestCase):
TEMPLATE = engines["django"].from_string(
"""
{% load sentry_api %}
{% serialize_detailed_org org %}
"""
)
def test_esca... | 26.5 | 73 | 0.667238 |
a5b0bfab054c42f6f64a756fcce8ca5393f87445 | 5,335 | py | Python | jasmin/tools/migrations/migration.py | paradiseng/jasmin | 16c54261a6a1a82db64311ee2a235f6c966c14ab | [
"Apache-2.0"
] | 750 | 2015-01-02T23:09:54.000Z | 2022-03-29T11:00:29.000Z | jasmin/tools/migrations/migration.py | diwacreation3/jasmin | 16c54261a6a1a82db64311ee2a235f6c966c14ab | [
"Apache-2.0"
] | 806 | 2015-01-01T16:17:06.000Z | 2022-03-29T20:36:03.000Z | jasmin/tools/migrations/migration.py | diwacreation3/jasmin | 16c54261a6a1a82db64311ee2a235f6c966c14ab | [
"Apache-2.0"
] | 509 | 2015-01-16T20:15:25.000Z | 2022-03-30T12:57:03.000Z | import re
from jasmin.routing.Filters import TagFilter
from jasmin.routing.jasminApi import User, Group
def user_status(data, context=None):
"""Changes impacted by #306
Will migrate users to enable newly applied changes for enable/disable"""
# Create new users, they will have the enable/disable methods
... | 33.34375 | 112 | 0.622306 |
c94ef6dde4ce9405ebf96cf4471ac07f08c31f34 | 18,137 | py | Python | tests/unit/test_local_group.py | nordic-institute/X-Road-Security-Server-toolkit | 1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb | [
"MIT"
] | 7 | 2020-11-01T19:50:11.000Z | 2022-01-18T17:45:19.000Z | tests/unit/test_local_group.py | nordic-institute/X-Road-Security-Server-toolkit | 1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb | [
"MIT"
] | 24 | 2020-11-09T08:09:10.000Z | 2021-06-16T07:22:14.000Z | tests/unit/test_local_group.py | nordic-institute/X-Road-Security-Server-toolkit | 1538dbf3d76647f4fb3a72bbe93bf54f414ee9fb | [
"MIT"
] | 1 | 2021-04-27T14:39:48.000Z | 2021-04-27T14:39:48.000Z | from argparse import Namespace
import sys
import unittest
from unittest import mock
import pytest
from tests.util.test_util import StatusTestData
from xrdsst.controllers.local_group import LocalGroupController
from xrdsst.models import Client, ConnectionType, ClientStatus, LocalGroup, GroupMember
from xrdsst.main impor... | 47.981481 | 138 | 0.503336 |
859e371a1b8a0d6f16125d9ff34e1058bb7251e0 | 18,473 | py | Python | pontoon/sync/changeset.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 1 | 2019-05-26T04:16:47.000Z | 2019-05-26T04:16:47.000Z | pontoon/sync/changeset.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 9 | 2020-09-06T05:18:03.000Z | 2022-02-26T14:28:38.000Z | pontoon/sync/changeset.py | udacity/pontoon | e15a03a0c987615385b2a8c537bb18c99567f77e | [
"BSD-3-Clause"
] | 1 | 2019-05-25T23:24:42.000Z | 2019-05-25T23:24:42.000Z | import logging
from bulk_update.helper import bulk_update
from collections import defaultdict
from django.contrib.auth.models import User
from django.db import connection
from django.db.models import Prefetch
from django.template.defaultfilters import pluralize
from notifications.signals import notify
from pontoon.ba... | 39.304255 | 99 | 0.595464 |
a7d93046189273bdacaa3d46f0c1f412eb90b282 | 5,632 | py | Python | rllib/env/external_multi_agent_env.py | acmore/ray | 9f0f54266064e203b0bdcc9d3fa947cb4518ebc0 | [
"Apache-2.0"
] | 78 | 2022-02-02T00:23:02.000Z | 2022-03-15T11:44:02.000Z | rllib/env/external_multi_agent_env.py | acmore/ray | 9f0f54266064e203b0bdcc9d3fa947cb4518ebc0 | [
"Apache-2.0"
] | null | null | null | rllib/env/external_multi_agent_env.py | acmore/ray | 9f0f54266064e203b0bdcc9d3fa947cb4518ebc0 | [
"Apache-2.0"
] | 3 | 2022-01-30T05:10:14.000Z | 2022-03-04T21:18:44.000Z | import uuid
from ray.rllib.utils.annotations import override, PublicAPI
from ray.rllib.env.external_env import ExternalEnv, _ExternalEnvEpisode
@PublicAPI
class ExternalMultiAgentEnv(ExternalEnv):
"""This is the multi-agent version of ExternalEnv."""
@PublicAPI
def __init__(self, action_space, observati... | 36.102564 | 79 | 0.621271 |
3671e3a386b003f77417c60e2f36b27d4e9393c7 | 1,674 | py | Python | src/client/message.py | P-E-P/GroupChat | e99ad6db4c7332320a24640535da5f77b0cb2109 | [
"MIT"
] | 2 | 2019-04-04T18:31:33.000Z | 2021-05-23T16:56:19.000Z | src/client/message.py | P-E-P/GroupChat | e99ad6db4c7332320a24640535da5f77b0cb2109 | [
"MIT"
] | null | null | null | src/client/message.py | P-E-P/GroupChat | e99ad6db4c7332320a24640535da5f77b0cb2109 | [
"MIT"
] | null | null | null | from datetime import datetime
import uuid
"""
Recipients are for private messages, you could also use special keyword to designate special recipient:
- all : send the message to everyone.
- server : send the message to the server only (commands).
- last : send the message to the last client group you talked to,
... | 34.163265 | 108 | 0.647551 |
0bf2b0afc400dc852ed3b4a66dfdfb838f7dc3ea | 165 | py | Python | Code/CalPiV1.py | iuming/Python_Learning | 0162e69df2b854e182d958c9d95c84c348fe0b78 | [
"MIT"
] | null | null | null | Code/CalPiV1.py | iuming/Python_Learning | 0162e69df2b854e182d958c9d95c84c348fe0b78 | [
"MIT"
] | null | null | null | Code/CalPiV1.py | iuming/Python_Learning | 0162e69df2b854e182d958c9d95c84c348fe0b78 | [
"MIT"
] | null | null | null | #CalPiV1.py
pi = 0
N = 100
for k in range(N):
pi += 1/pow(16,k)*( \
4/(8*k+1) - 2/(8*k+4) - \
1/(8*k+5) - 1/(8*k+6))
print("圆周率值是:{}".format(pi)) | 20.625 | 33 | 0.430303 |
5f40a04814d33903832567c0b367f14672e887d7 | 3,309 | py | Python | userbot/modules/nhentai.py | fhmyngrh/ZELDA-UBOT | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-12-27T02:23:24.000Z | 2021-12-28T06:25:39.000Z | userbot/modules/nhentai.py | Ditomaheswara/Dito-Ubot | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/nhentai.py | Ditomaheswara/Dito-Ubot | c75bb37f6cd952e429a869fb524c061c530b6046 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 5 | 2021-12-27T02:23:06.000Z | 2022-02-05T08:33:06.000Z | # Copyright (C) 2020 KeselekPermen69
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
import re
from hentai import Hentai, Utils
from natsort import natsorted
from userbot import CMD_HANDLER as cmd
from userbot impor... | 31.514286 | 84 | 0.539136 |
ebec91e50ede7ac4f743c32a8695ccb888bc72ea | 1,508 | py | Python | server/src/cropper.py | humanova/cropper-service | 0df0d1da47801507a2880439dbd3a661b19a4093 | [
"Apache-2.0"
] | 1 | 2021-03-14T15:00:58.000Z | 2021-03-14T15:00:58.000Z | server/src/cropper.py | humanova/cropper-service | 0df0d1da47801507a2880439dbd3a661b19a4093 | [
"Apache-2.0"
] | null | null | null | server/src/cropper.py | humanova/cropper-service | 0df0d1da47801507a2880439dbd3a661b19a4093 | [
"Apache-2.0"
] | 1 | 2022-03-03T23:54:34.000Z | 2022-03-03T23:54:34.000Z | # (c) 2020 Emir Erbasan (humanova)
# Apache2 License, see LICENSE for more details
import io
import utils
from models.postprocessing import RemovingTooTransparentBordersHardAndBlurringHardBorders
from models.preprocessing import BoundingBoxDetectionFastRcnn
from models.u2net import U2NET
class Cropper:
... | 41.888889 | 125 | 0.687666 |
b848b27083e6e405f68a99b47b8ed39202e5834c | 1,351 | py | Python | bin/tests/test_host_factory.py | henrikingo/dsi | 0d0f98ee384257b8fbc74a7b6bfc1f9880ec30a5 | [
"Apache-2.0"
] | 1 | 2021-02-11T02:08:08.000Z | 2021-02-11T02:08:08.000Z | bin/tests/test_host_factory.py | henrikingo/dsi | 0d0f98ee384257b8fbc74a7b6bfc1f9880ec30a5 | [
"Apache-2.0"
] | null | null | null | bin/tests/test_host_factory.py | henrikingo/dsi | 0d0f98ee384257b8fbc74a7b6bfc1f9880ec30a5 | [
"Apache-2.0"
] | 1 | 2020-03-05T15:23:18.000Z | 2020-03-05T15:23:18.000Z | """Tests for bin/common/host.py"""
import unittest
from mock import patch
import common.models.host_info as host_info
import common.host_factory
class HostFactoryTestCase(unittest.TestCase):
""" Unit Test for Host Factory library """
@patch('paramiko.SSHClient')
def test_make_host(self, mock_ssh):
... | 33.775 | 89 | 0.6151 |
6d2ed1601bc776ed8e97de2c5f6c9ebf6c060c4d | 213 | py | Python | waroeng_bebek_selamet/waroeng_bebek_selamet/doctype/master_diskon/test_master_diskon.py | rifkisetyantto/frappe-digital-order | e1a9729a7d449ce7ef98a703d6a8d721fd5b5c5b | [
"MIT"
] | null | null | null | waroeng_bebek_selamet/waroeng_bebek_selamet/doctype/master_diskon/test_master_diskon.py | rifkisetyantto/frappe-digital-order | e1a9729a7d449ce7ef98a703d6a8d721fd5b5c5b | [
"MIT"
] | null | null | null | waroeng_bebek_selamet/waroeng_bebek_selamet/doctype/master_diskon/test_master_diskon.py | rifkisetyantto/frappe-digital-order | e1a9729a7d449ce7ef98a703d6a8d721fd5b5c5b | [
"MIT"
] | 2 | 2019-10-29T17:03:16.000Z | 2019-10-30T08:20:19.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Kelompok 6 and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
class TestMasterDiskon(unittest.TestCase):
pass
| 19.363636 | 49 | 0.769953 |
17f81ad7f813ffa30459223a504d13bac6d6af54 | 681 | py | Python | var/spack/repos/builtin/packages/py-bids-validator/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-bids-validator/package.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2022-01-08T08:41:11.000Z | 2022-03-14T19:28:07.000Z | var/spack/repos/builtin/packages/py-bids-validator/package.py | foeroyingur/spack | 5300cbbb2e569190015c72d0970d25425ea38647 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyBidsValidator(PythonPackage):
"""Validator for the Brain Imaging Data Structure"""
... | 35.842105 | 95 | 0.760646 |
11f8a02f5bad5fe908ed21273d6e99242e9ac9f7 | 14,795 | py | Python | tensorboardX/pytorch_graph.py | snard6/tensorboardX | 056bba6757e6ef64a8acc58097c25fe0c66d5f5f | [
"MIT"
] | null | null | null | tensorboardX/pytorch_graph.py | snard6/tensorboardX | 056bba6757e6ef64a8acc58097c25fe0c66d5f5f | [
"MIT"
] | null | null | null | tensorboardX/pytorch_graph.py | snard6/tensorboardX | 056bba6757e6ef64a8acc58097c25fe0c66d5f5f | [
"MIT"
] | null | null | null | import logging
import time
from collections import OrderedDict
from .proto.attr_value_pb2 import AttrValue
from .proto.graph_pb2 import GraphDef
from .proto.node_def_pb2 import NodeDef
from .proto.step_stats_pb2 import RunMetadata, StepStats, DeviceStepStats, NodeExecStats, AllocatorMemoryUsed
from .proto.tensor_shape_... | 43.514706 | 121 | 0.632308 |
314bdf42552ace702221cfc2b089b6e388ba6249 | 9,021 | py | Python | components/ibm-components/watson/train/src/wml-train.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | 1 | 2020-10-13T13:28:42.000Z | 2020-10-13T13:28:42.000Z | components/ibm-components/watson/train/src/wml-train.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | 2 | 2022-02-13T19:18:51.000Z | 2022-02-19T06:09:45.000Z | components/ibm-components/watson/train/src/wml-train.py | Intellicode/pipelines | f1d90407a8a2f56db11199c9c73e6df6c4a8b093 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | 40.819005 | 116 | 0.663452 |
6c113931c1a812856ecdf78a99e6671f349a1bc3 | 4,872 | py | Python | mne_hfo/score.py | racheljune/mne-hfo | a5f6c38d9219a97726d73333f51d412e772e84c1 | [
"BSD-3-Clause"
] | 4 | 2021-02-28T10:36:59.000Z | 2021-12-26T20:11:05.000Z | mne_hfo/score.py | racheljune/mne-hfo | a5f6c38d9219a97726d73333f51d412e772e84c1 | [
"BSD-3-Clause"
] | 33 | 2021-01-20T19:54:11.000Z | 2021-04-02T15:47:17.000Z | mne_hfo/score.py | racheljune/mne-hfo | a5f6c38d9219a97726d73333f51d412e772e84c1 | [
"BSD-3-Clause"
] | 6 | 2021-04-05T19:22:04.000Z | 2021-12-23T19:25:34.000Z | import numpy as np
import pandas as pd
from mne_hfo.posthoc import match_detected_annotations
from mne_hfo.sklearn import _convert_y_sklearn_to_annot_df
from mne_hfo.utils import _check_df
def true_positive_rate(y, y_pred):
"""
Calculate true positive rate as: tpr = tp / (tp + fn).
Parameters
------... | 25.914894 | 79 | 0.626847 |
4a24f56e1fb3731a1be2f5e878c6b82a8cddc520 | 2,799 | py | Python | lale/lib/rasl/_folds_for_monoid.py | Ingkarat/lale | faded6f80790629cfe216f72f1ceb1fb4f6c70bb | [
"Apache-2.0"
] | null | null | null | lale/lib/rasl/_folds_for_monoid.py | Ingkarat/lale | faded6f80790629cfe216f72f1ceb1fb4f6c70bb | [
"Apache-2.0"
] | null | null | null | lale/lib/rasl/_folds_for_monoid.py | Ingkarat/lale | faded6f80790629cfe216f72f1ceb1fb4f6c70bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.350649 | 79 | 0.689532 |
303c53bceb89e2fac6b2d54792a5117fc1cdbefe | 2,753 | py | Python | dataworkspace/dataworkspace/apps/datasets/migrations/0098_auto_20211119_1906.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 1 | 2019-06-10T08:22:56.000Z | 2019-06-10T08:22:56.000Z | dataworkspace/dataworkspace/apps/datasets/migrations/0098_auto_20211119_1906.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | 2 | 2019-05-17T13:10:42.000Z | 2019-06-17T10:48:46.000Z | dataworkspace/dataworkspace/apps/datasets/migrations/0098_auto_20211119_1906.py | uktrade/jupyterhub-data-auth-admin | 91544f376209a201531f4dbfb8faad1b8ada18c9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-19 19:06
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
("datasets", "0097_merge_2... | 33.987654 | 76 | 0.463858 |
9001b836a8e1dee683a437cb3d549330ba904650 | 774 | py | Python | armulator/armv6/opcodes/arm_instruction_set/arm_load_store_word_and_unsigned_byte/push_a2.py | matan1008/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 16 | 2018-01-22T14:36:49.000Z | 2021-12-17T15:39:52.000Z | armulator/armv6/opcodes/arm_instruction_set/arm_load_store_word_and_unsigned_byte/push_a2.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 3 | 2019-02-19T17:51:47.000Z | 2022-03-31T20:45:21.000Z | armulator/armv6/opcodes/arm_instruction_set/arm_load_store_word_and_unsigned_byte/push_a2.py | AhmedMounir/armulator | 04d24dcec6ab42326018f5e09331e5b4738d6b52 | [
"MIT"
] | 4 | 2020-06-18T23:51:03.000Z | 2022-02-09T17:43:13.000Z | from armulator.armv6.opcodes.abstract_opcodes.push import Push
from armulator.armv6.opcodes.opcode import Opcode
from bitstring import BitArray
class PushA2(Push, Opcode):
def __init__(self, instruction, registers, unaligned_allowed):
Opcode.__init__(self, instruction)
Push.__init__(self, register... | 32.25 | 100 | 0.683463 |
8bead43bb956943ac1d878fee63aff229823798f | 1,983 | py | Python | tests.py | dgarwin/LeaguePredictor | ca28c5656dce117d96940af9c953f149ba54d9b6 | [
"MIT"
] | 1 | 2017-03-17T11:39:20.000Z | 2017-03-17T11:39:20.000Z | tests.py | dgarwin/LeaguePredictor | ca28c5656dce117d96940af9c953f149ba54d9b6 | [
"MIT"
] | null | null | null | tests.py | dgarwin/LeaguePredictor | ca28c5656dce117d96940af9c953f149ba54d9b6 | [
"MIT"
] | null | null | null | import unittest
from collections import deque
from datetime import datetime, timedelta
from PlayerCollection import PlayerCollection
from LolApi import LolApi
class TestLolApi(unittest.TestCase):
def setUp(self):
self.api = LolApi()
self.player_id = 20649224
def test_solo_division(self):
... | 32.508197 | 73 | 0.67524 |
39cccd5445322fddcfc135e83988adba89559432 | 1,346 | py | Python | clearml/scikit-learn/sklearn_joblib_example.py | BUAD625-Team4-2021/tutorial-buffet | 0acfc9759f799b8e2a88eeba82e1ed5a3dbefc72 | [
"MIT"
] | 8 | 2019-04-24T18:55:50.000Z | 2022-03-04T13:38:42.000Z | clearml/scikit-learn/sklearn_joblib_example.py | BUAD625-Team4-2021/tutorial-buffet | 0acfc9759f799b8e2a88eeba82e1ed5a3dbefc72 | [
"MIT"
] | null | null | null | clearml/scikit-learn/sklearn_joblib_example.py | BUAD625-Team4-2021/tutorial-buffet | 0acfc9759f799b8e2a88eeba82e1ed5a3dbefc72 | [
"MIT"
] | 6 | 2021-03-06T03:18:14.000Z | 2021-12-14T02:40:12.000Z | try:
import joblib
except ImportError:
from sklearn.externals import joblib
from sklearn import datasets
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split
import numpy as np
import matplotlib
matplotlib.use('agg') # use agg instead of tkinter
import matplo... | 27.469388 | 102 | 0.713967 |
a7a26ef265d42489f8ba7407ed363ee679f1fdb9 | 462 | py | Python | env/Lib/site-packages/plotly/validators/scattermapbox/marker/colorbar/_ticktext.py | andresgreen-byte/Laboratorio-1--Inversion-de-Capital | 8a4707301d19c3826c31026c4077930bcd6a8182 | [
"MIT"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | venv/Lib/site-packages/plotly/validators/scattermapbox/marker/colorbar/_ticktext.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | venv/Lib/site-packages/plotly/validators/scattermapbox/marker/colorbar/_ticktext.py | wakisalvador/constructed-misdirection | 74779e9ec640a11bc08d5d1967c85ac4fa44ea5e | [
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class TicktextValidator(_plotly_utils.basevalidators.DataArrayValidator):
def __init__(
self,
plotly_name="ticktext",
parent_name="scattermapbox.marker.colorbar",
**kwargs
):
super(TicktextValidator, self).__init__(
plotly... | 27.176471 | 73 | 0.634199 |
479edd524cfec4cf072c51591a5ce74cbbf90862 | 4,363 | py | Python | 30_Cube/python/cube.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | 1 | 2022-03-23T23:06:26.000Z | 2022-03-23T23:06:26.000Z | 30_Cube/python/cube.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | null | null | null | 30_Cube/python/cube.py | Omega7379/basic-computer-games | 37033c40ebd267dc56de3db9813a23940445142f | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# CUBE
#
# Converted from BASIC to Python by Trevor Hobson
import random
from typing import Tuple
def mine_position() -> Tuple[int, int, int]:
return (random.randint(1, 3), random.randint(1, 3), random.randint(1, 3))
def parse_move(move: str) -> Tuple[int, int, int]:
coordinates = [i... | 34.904 | 82 | 0.526243 |
b2cd47ca6feef5e5721efec5c5fd96d36a7918c8 | 12,730 | py | Python | cgal4py/tests/test_delaunay.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 4 | 2020-01-05T06:31:55.000Z | 2021-03-06T03:11:33.000Z | cgal4py/tests/test_delaunay.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T14:59:03.000Z | 2020-03-21T14:59:03.000Z | cgal4py/tests/test_delaunay.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2021-03-07T07:08:11.000Z | 2021-03-07T07:08:11.000Z | r"""Tests for generic interface to Delaunay triangulations."""
import numpy as np
from nose.tools import assert_equal
from nose.tools import assert_raises
from cgal4py.delaunay import Delaunay, VoronoiVolumes, tools
from cgal4py.tests.test_delaunay2 import pts as pts2
from cgal4py.tests.test_delaunay2 import left_edge ... | 35.558659 | 79 | 0.582639 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.