hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a289d9f60ab55aac5358d7c9a198ff79b014f668 | 2,590 | py | Python | sd_material_ui/CircularProgress.py | Michael-fore/sd-material-ui | 9496d02821c7a25c71fc9d03729f551432bf55f5 | [
"MIT"
] | null | null | null | sd_material_ui/CircularProgress.py | Michael-fore/sd-material-ui | 9496d02821c7a25c71fc9d03729f551432bf55f5 | [
"MIT"
] | null | null | null | sd_material_ui/CircularProgress.py | Michael-fore/sd-material-ui | 9496d02821c7a25c71fc9d03729f551432bf55f5 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class CircularProgress(Component):
"""A CircularProgress component.
Material UI CircularProgress component
Keyword arguments:
- classes (dict; optional): The classes to be applied to this component. This... | 45.438596 | 231 | 0.708494 |
ed6ed1e9012a0538265e7fc65dda0cba3b6c04d3 | 895 | py | Python | Example/Python/Subscribe.py | irkasper/MQL-CopyTrade | 0f09794632319a9a755616ebcdf5c876cc1eb8c4 | [
"MIT"
] | 67 | 2019-04-26T07:17:55.000Z | 2022-03-16T07:57:28.000Z | Example/Python/Subscribe.py | irkasper/MQL-CopyTrade | 0f09794632319a9a755616ebcdf5c876cc1eb8c4 | [
"MIT"
] | 11 | 2019-08-13T14:41:43.000Z | 2021-12-20T09:05:21.000Z | Example/Python/Subscribe.py | irkasper/MQL-CopyTrade | 0f09794632319a9a755616ebcdf5c876cc1eb8c4 | [
"MIT"
] | 52 | 2019-04-22T02:00:57.000Z | 2022-01-21T15:38:01.000Z | #!/usr/bin/env python
import sys
import time
import zmq
import numpy
def main():
connect_to = "tcp://127.0.0.1:5559"
topics = ""
ctx = zmq.Context()
s = ctx.socket(zmq.SUB)
s.connect(connect_to)
s.setsockopt(zmq.SUBSCRIBE, b'')
try:
while True:
recv = s.recv_multipart... | 22.375 | 63 | 0.507263 |
593b6b72e619ee7bf1098ad9979a637b7b236ade | 4,648 | py | Python | repocracy/repo/migrations/0005_auto__add_unique_repository_slug.py | repocracy/repocracy | 5ca22ae23ad9a2eae4bb4c712886aff634b8ad0e | [
"BSD-3-Clause"
] | 1 | 2015-08-10T02:33:49.000Z | 2015-08-10T02:33:49.000Z | repocracy/repo/migrations/0005_auto__add_unique_repository_slug.py | repocracy/repocracy | 5ca22ae23ad9a2eae4bb4c712886aff634b8ad0e | [
"BSD-3-Clause"
] | null | null | null | repocracy/repo/migrations/0005_auto__add_unique_repository_slug.py | repocracy/repocracy | 5ca22ae23ad9a2eae4bb4c712886aff634b8ad0e | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding unique constraint on 'Repository', fields ['slug']
db.create_unique('repo_repository', ['slug'])
... | 63.671233 | 182 | 0.567771 |
9125087e915f447445b00bd2c2db21f1ae06b671 | 21,040 | py | Python | tools/accuracy_checker/accuracy_checker/metrics/reid.py | gnomonsis/open_model_zoo | 72dbeb263cab19e7e232793246521e96f3821959 | [
"Apache-2.0"
] | 1 | 2020-08-06T23:08:32.000Z | 2020-08-06T23:08:32.000Z | tools/accuracy_checker/accuracy_checker/metrics/reid.py | gnomonsis/open_model_zoo | 72dbeb263cab19e7e232793246521e96f3821959 | [
"Apache-2.0"
] | 4 | 2021-04-30T21:21:07.000Z | 2022-01-13T03:12:46.000Z | tools/accuracy_checker/accuracy_checker/metrics/reid.py | gnomonsis/open_model_zoo | 72dbeb263cab19e7e232793246521e96f3821959 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019 Intel 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,... | 37.437722 | 120 | 0.661454 |
9733f996b779be2a85f947ae984f165778789c59 | 9,371 | py | Python | tests/asyncio/test_h2.py | ampstat/hypercorn | 6b1e1689cddfcf9e19a63bb701d6b37a5e9f9acd | [
"MIT"
] | null | null | null | tests/asyncio/test_h2.py | ampstat/hypercorn | 6b1e1689cddfcf9e19a63bb701d6b37a5e9f9acd | [
"MIT"
] | null | null | null | tests/asyncio/test_h2.py | ampstat/hypercorn | 6b1e1689cddfcf9e19a63bb701d6b37a5e9f9acd | [
"MIT"
] | null | null | null | import asyncio
import json
from typing import AsyncGenerator, Optional
from unittest.mock import Mock
import h2
import h11
import pytest
from hypercorn.asyncio.h2 import H2Server
from hypercorn.config import Config
from hypercorn.typing import ASGIFramework
from .helpers import MockTransport
from ..helpers import chu... | 40.5671 | 98 | 0.669406 |
0e5edf3efeaca6210cbe54edd1f5982a25922c14 | 3,615 | py | Python | jia/jia/query.py | joshblum/chronology | d730355a5686ebba9f1c8e369ba26a3080d9fa26 | [
"MIT"
] | null | null | null | jia/jia/query.py | joshblum/chronology | d730355a5686ebba9f1c8e369ba26a3080d9fa26 | [
"MIT"
] | null | null | null | jia/jia/query.py | joshblum/chronology | d730355a5686ebba9f1c8e369ba26a3080d9fa26 | [
"MIT"
] | null | null | null | import copy
import json
import metis.core.query.aggregate
import metis.core.query.value
from flask import current_app
from metis.core.query.aggregate import GroupBy
from metis.core.query.condition import Condition
from metis.core.query.operator import Aggregate
from metis.core.query.operator import DataAccess
from meti... | 29.631148 | 72 | 0.698755 |
dea180e2c17aa0b8b1f43cce86919aa559182d5f | 6,888 | py | Python | edb/edgeql/compiler/typegen.py | kafein/edgedb | 3cc4c5e6e11a6f25a82b061d7ba294deeb9ccb80 | [
"Apache-2.0"
] | null | null | null | edb/edgeql/compiler/typegen.py | kafein/edgedb | 3cc4c5e6e11a6f25a82b061d7ba294deeb9ccb80 | [
"Apache-2.0"
] | null | null | null | edb/edgeql/compiler/typegen.py | kafein/edgedb | 3cc4c5e6e11a6f25a82b061d7ba294deeb9ccb80 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http... | 28.345679 | 79 | 0.651278 |
8c0fb8afa81907744cc59732a7aedac83c6f4745 | 342 | py | Python | tests/test_demo.py | norlyakov/gino-aiohttp | 2730bf2122dfceb61efddd6e00746fb1452ba905 | [
"BSD-3-Clause"
] | 80 | 2020-02-09T13:13:56.000Z | 2022-03-30T06:53:13.000Z | tests/test_demo.py | norlyakov/gino-aiohttp | 2730bf2122dfceb61efddd6e00746fb1452ba905 | [
"BSD-3-Clause"
] | 32 | 2020-05-11T20:35:06.000Z | 2021-07-14T07:37:53.000Z | tests/test_demo.py | norlyakov/gino-aiohttp | 2730bf2122dfceb61efddd6e00746fb1452ba905 | [
"BSD-3-Clause"
] | 24 | 2020-02-04T09:28:23.000Z | 2022-03-11T21:01:36.000Z | import uuid
def test(venv_client):
assert venv_client.get("/users/1").status_code == 404
nickname = str(uuid.uuid4())
r = venv_client.post("/users", json=dict(name=nickname))
r.raise_for_status()
r = r.json()
assert (
venv_client.get("/users/{}".format(r["id"])).json()["nickname"]
... | 24.428571 | 71 | 0.602339 |
00e50c30ac915696007dd10a30f564e71d3d1f62 | 2,292 | py | Python | src/musictag/mutagentagloader.py | lmdslyngl/lmdsmusic | 376849d278374ffee0caf56073001cd2ba8ae463 | [
"MIT"
] | null | null | null | src/musictag/mutagentagloader.py | lmdslyngl/lmdsmusic | 376849d278374ffee0caf56073001cd2ba8ae463 | [
"MIT"
] | 3 | 2021-06-08T21:20:20.000Z | 2022-03-12T00:24:37.000Z | src/musictag/mutagentagloader.py | lmdslyngl/lmdsmusic | 376849d278374ffee0caf56073001cd2ba8ae463 | [
"MIT"
] | null | null | null |
import os
from typing import Dict
from logging import getLogger
import mutagen
from mutagen.id3 import ID3
from mutagen._vorbis import VCommentDict
from mutagen.mp4 import MP4Tags
from .util import TagLoaderException, str2int, get_or_default
def load(file_path) -> Dict[str, str]:
music_file = mutagen.File(file_p... | 28.65 | 67 | 0.617801 |
088b9fd37731b8ca69a5941d5ef4527257401c91 | 5,233 | py | Python | gym/envs/classic_control/mountain_car.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/classic_control/mountain_car.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | gym/envs/classic_control/mountain_car.py | caffett/gym | a9126ace2488acfaa63544ad14859d530ee4ac76 | [
"Python-2.0",
"OLDAP-2.7"
] | null | null | null | """
http://incompleteideas.net/sutton/MountainCar/MountainCar1.cp
permalink: https://perma.cc/6Z2N-PFWC
"""
import math
import gym
from gym import spaces
from gym.utils import seeding
import numpy as np
from os import path
import tensorflow as tf
from tensorflow.keras.models import load_model
ROOT = path.dirname(pat... | 34.655629 | 108 | 0.618001 |
74362fe7e7f65405a3a77334ddf3398ed0dd9ec8 | 18,802 | py | Python | scraper/unique_scraper.py | uvacw/avca | fa07fa6d05fc3b058c75278db1d984abac0e331c | [
"MIT"
] | 1 | 2021-03-09T10:47:53.000Z | 2021-03-09T10:47:53.000Z | scraper/unique_scraper.py | uvacw/avca | fa07fa6d05fc3b058c75278db1d984abac0e331c | [
"MIT"
] | null | null | null | scraper/unique_scraper.py | uvacw/avca | fa07fa6d05fc3b058c75278db1d984abac0e331c | [
"MIT"
] | null | null | null |
# coding: utf-8
## NOTE: This scraper illustrates how to collect images from websites for academic research
## THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO ... | 45.635922 | 463 | 0.49633 |
b02c9b2b34bb131d2b0e883df9cf5b8f5dffea42 | 4,194 | py | Python | devserver.py | OpenCIOC/offlinetools | d73b151b1b17029b3d61fea23f3d09455fb04901 | [
"Apache-2.0"
] | 1 | 2018-01-31T04:39:30.000Z | 2018-01-31T04:39:30.000Z | devserver.py | OpenCIOC/offlinetools | d73b151b1b17029b3d61fea23f3d09455fb04901 | [
"Apache-2.0"
] | null | null | null | devserver.py | OpenCIOC/offlinetools | d73b151b1b17029b3d61fea23f3d09455fb04901 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import sys
import os
import io
import logging.config
# ==========================================================================
# start of inlined methods from site.py to bootstrap site-packages directory
# covered by PSF license from Python distribution
# =====================... | 32.015267 | 92 | 0.564855 |
45d84dbb971ec3a65164bb7cc53a658e5187e1c5 | 1,651 | py | Python | google/cloud/identity_toolkit_v2/types/__init__.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | google/cloud/identity_toolkit_v2/types/__init__.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | google/cloud/identity_toolkit_v2/types/__init__.py | renovate-bot/python-identity-toolkit | ccf9b1bc538d1a3de90fcefd66465b947198a1a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 30.018182 | 74 | 0.761357 |
c9d8e0f0274078183967b830fafe0657c684473c | 2,029 | py | Python | 02_primes.py | deshmukhmayur/tcs-codevita6-round1 | 975bd639b187fa6897d2acf58611a7e793b4072d | [
"MIT"
] | null | null | null | 02_primes.py | deshmukhmayur/tcs-codevita6-round1 | 975bd639b187fa6897d2acf58611a7e793b4072d | [
"MIT"
] | null | null | null | 02_primes.py | deshmukhmayur/tcs-codevita6-round1 | 975bd639b187fa6897d2acf58611a7e793b4072d | [
"MIT"
] | 1 | 2020-06-11T17:44:22.000Z | 2020-06-11T17:44:22.000Z | '''
Prime Numbers spelt with prime number of letters
'''
WORDS = {
1: 'ONE',
2: 'TWO',
3: 'THREE',
4: 'FOUR',
5: 'FIVE',
6: 'SIX',
7: 'SEVEN',
8: 'EIGHT',
9: 'NINE',
0: '',
10: 'TEN',
11: 'ELEVEN',
12: 'TWELVE',
13: 'THIRTEEN',
14: 'FOURTEE... | 19.509615 | 63 | 0.435683 |
33a22b0475647395bac9a2cb91e61be39872df70 | 6,073 | py | Python | leapfrog/poll/vimeo.py | markpasc/leapfrog | fde06e10cb896936f3f6535bd3f31c64700a3c8d | [
"MIT"
] | 3 | 2015-11-05T07:19:49.000Z | 2020-10-07T08:50:28.000Z | leapfrog/poll/vimeo.py | markpasc/leapfrog | fde06e10cb896936f3f6535bd3f31c64700a3c8d | [
"MIT"
] | null | null | null | leapfrog/poll/vimeo.py | markpasc/leapfrog | fde06e10cb896936f3f6535bd3f31c64700a3c8d | [
"MIT"
] | null | null | null | from __future__ import division
from datetime import datetime
import json
import logging
import re
import socket
from urllib import urlencode
from django.conf import settings
import httplib2
import oauth2 as oauth
from leapfrog.models import Account, Media, Person, Object, UserStream
import leapfrog.poll.embedlam
... | 35.30814 | 133 | 0.649597 |
ddd343eb59d86eeaf9845bf198051a9a5bf6b7e6 | 6,109 | py | Python | nova/virt/hyperv/pathutils.py | nelsnelson/nova | 826fe1cc6af2df291d5aaafdc5d498d626475d19 | [
"Apache-2.0"
] | 1 | 2015-02-26T03:23:49.000Z | 2015-02-26T03:23:49.000Z | nova/virt/hyperv/pathutils.py | nelsnelson/nova | 826fe1cc6af2df291d5aaafdc5d498d626475d19 | [
"Apache-2.0"
] | null | null | null | nova/virt/hyperv/pathutils.py | nelsnelson/nova | 826fe1cc6af2df291d5aaafdc5d498d626475d19 | [
"Apache-2.0"
] | 2 | 2015-06-17T13:24:55.000Z | 2015-10-27T05:28:38.000Z | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... | 41.842466 | 79 | 0.641021 |
b4fe361be2385e11ed63fe65057ec4424631dcd4 | 6,116 | py | Python | spektral/layers/pooling/mincut_pool.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | 2 | 2021-02-21T10:02:38.000Z | 2021-02-21T10:02:43.000Z | spektral/layers/pooling/mincut_pool.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | null | null | null | spektral/layers/pooling/mincut_pool.py | herman-nside/spektral | 58bb524ec783f187145c3afe53db491dbc1f0ba0 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras import backend as K
from tensorflow.keras.layers import Dense
from spektral.layers import ops
from spektral.layers.pooling.pool import Pool
class MinCutPool(Pool):
r"""
A MinCut pooling layer from the paper
> [Spectral... | 33.420765 | 110 | 0.609222 |
b3982753210db31ccd9d9ee5312c5065fa012c4b | 22,065 | py | Python | huobi/client/market.py | Reactive-Capital/huobi_Python | 1ba61f50be514b42a9fa3c2fe5d894e496b042e5 | [
"Apache-2.0"
] | null | null | null | huobi/client/market.py | Reactive-Capital/huobi_Python | 1ba61f50be514b42a9fa3c2fe5d894e496b042e5 | [
"Apache-2.0"
] | null | null | null | huobi/client/market.py | Reactive-Capital/huobi_Python | 1ba61f50be514b42a9fa3c2fe5d894e496b042e5 | [
"Apache-2.0"
] | null | null | null |
from huobi.constant import *
from huobi.model.market import *
from huobi.utils import *
from huobi.utils.input_checker import check_in_list
class MarketClient(object):
def __init__(self, **kwargs):
"""
Create the request client instance.
:param kwargs: The option of request connection.
... | 44.485887 | 157 | 0.653705 |
87b623971f6ce4c2d43cab30e8be7cf30931d68c | 3,692 | py | Python | Sketches/JMB/mysite/settings.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/JMB/mysite/settings.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/JMB/mysite/settings.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | # -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Lice... | 36.196078 | 111 | 0.728061 |
81b1d64161ef00d03f8a99a9d649d9d3942f4fcd | 4,443 | py | Python | fb_chat.py | ShivamSarodia/FB-Chat-Parser | bbeb6161e9555a20e0bee87520535345e3234c9b | [
"MIT"
] | 11 | 2015-05-02T16:23:13.000Z | 2021-08-31T03:39:39.000Z | fb_chat.py | ShivamSarodia/FB-Chat-Parser | bbeb6161e9555a20e0bee87520535345e3234c9b | [
"MIT"
] | 2 | 2016-01-24T01:03:53.000Z | 2017-08-22T22:45:05.000Z | fb_chat.py | ShivamSarodia/FB-Chat-Parser | bbeb6161e9555a20e0bee87520535345e3234c9b | [
"MIT"
] | 2 | 2016-12-19T17:37:02.000Z | 2017-02-27T19:09:03.000Z | from datetime import datetime
import pickle
def load_data(filename):
"""Return a Data object loaded from the given pickle file."""
with open(filename, "rb") as f:
return pickle.load(f)
class Data:
def __init__(self, threads, me=None):
self.threads = threads
if me:
self... | 29.818792 | 89 | 0.578438 |
e89f2792f7c5b9c6b7ebc32552b3d39d93730dd7 | 10,656 | py | Python | spirecomm/ai/behaviours.py | joshmiller17/spirecomm | 57e0d4e773e0e7accbfb4eb8f512f090432edb08 | [
"MIT"
] | 2 | 2019-08-24T15:52:51.000Z | 2019-08-24T15:53:33.000Z | spirecomm/ai/behaviours.py | joshmiller17/spirecomm | 57e0d4e773e0e7accbfb4eb8f512f090432edb08 | [
"MIT"
] | 61 | 2019-05-18T22:40:52.000Z | 2019-08-24T14:10:51.000Z | spirecomm/ai/behaviours.py | joshmiller17/spirecomm | 57e0d4e773e0e7accbfb4eb8f512f090432edb08 | [
"MIT"
] | null | null | null | import py_trees
import json
from spirecomm.communication.action import *
# This is the Template class from which all StS Behaviours inherit
# It also includes the original comments for what should go in each method
class DefaultBehaviour(py_trees.behaviour.Behaviour):
def __init__(self, name, agent):
"""
Minimal... | 33.093168 | 99 | 0.721471 |
0de9a6df4d0284cbd4c73853f307b0e39fd677fc | 13,797 | py | Python | tests/ignite/metrics/test_metrics_lambda.py | WrRan/ignite | 00c79702b3c20e87168b93e73c250035a8d1d901 | [
"BSD-3-Clause"
] | 1 | 2020-09-18T18:28:30.000Z | 2020-09-18T18:28:30.000Z | tests/ignite/metrics/test_metrics_lambda.py | alxlampe/ignite | b53c6aeef87754b3cd3638c91172b386dc73af12 | [
"BSD-3-Clause"
] | null | null | null | tests/ignite/metrics/test_metrics_lambda.py | alxlampe/ignite | b53c6aeef87754b3cd3638c91172b386dc73af12 | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
import pytest
import torch
from pytest import approx
from sklearn.metrics import f1_score, precision_score, recall_score
import ignite.distributed as idist
from ignite.engine import Engine
from ignite.metrics import Metric, MetricsLambda, Precision, Recall
class ListGatherMetric(Metric)... | 32.463529 | 110 | 0.66297 |
49a3251372381015263ea8015c42012bbf58fad9 | 7,520 | py | Python | synapse/replication/http/federation.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 2 | 2020-04-30T18:38:02.000Z | 2020-07-08T21:38:28.000Z | synapse/replication/http/federation.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | null | null | null | synapse/replication/http/federation.py | rvleij/synapse | 77d9357226687a177c865bcdeaa0e750612fc078 | [
"Apache-2.0"
] | 2 | 2020-03-03T18:34:52.000Z | 2022-03-31T11:06:18.000Z | # -*- coding: utf-8 -*-
# Copyright 2018 New Vector 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 la... | 30.569106 | 81 | 0.646277 |
c97afa5bbd903a0fbfacab455dd28e48366f14c4 | 744 | py | Python | bobocep/rules/actions/no_action.py | r3w0p/bobocep | 5f08348e9a2c3b0f92e935429d4f265c1693d26c | [
"MIT"
] | 5 | 2019-09-02T13:19:48.000Z | 2021-07-31T23:42:06.000Z | bobocep/rules/actions/no_action.py | r3w0p/bobocep | 5f08348e9a2c3b0f92e935429d4f265c1693d26c | [
"MIT"
] | null | null | null | bobocep/rules/actions/no_action.py | r3w0p/bobocep | 5f08348e9a2c3b0f92e935429d4f265c1693d26c | [
"MIT"
] | 2 | 2020-11-05T07:53:37.000Z | 2021-06-06T06:48:44.000Z | from bobocep.rules.actions.bobo_action import BoboAction
from bobocep.rules.events.bobo_event import BoboEvent
class NoAction(BoboAction):
"""
An action that does nothing and always returns the specified boolean value.
:param name: The action name, defaults to an empty string.
:type name: str, option... | 31 | 79 | 0.692204 |
b31999cc54b7dc28e81bb0ebef385bd3a558c0b2 | 173 | py | Python | break and continue.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | 1 | 2019-09-02T15:56:38.000Z | 2019-09-02T15:56:38.000Z | break and continue.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | null | null | null | break and continue.py | karanjakhar/python-programs | 316cd4e83ae39c1d1e70c2a5e8a9329641bad9e1 | [
"MIT"
] | null | null | null | i=10
while(i>=1):
print(i)
i-=1
if(i>4):
continue
else:
break
while(i<16):
if(i==13):
break
print(i)
i+=1
| 11.533333 | 17 | 0.375723 |
28776a48ab65463747c86bd14be87ab4580d37ea | 523 | py | Python | logger_lesson/logger.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | logger_lesson/logger.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | logger_lesson/logger.py | farooq-teqniqly/pakt-complete-python-course | 01717bbe97181f70c38166b3dc82ba7b00098430 | [
"MIT"
] | null | null | null | import logging
import time
logger = logging.getLogger("logger_root")
log_entry_format = "%(asctime)s %(levelname)-8s %(name)s [%(filename)s:%(lineno)d] %(message)s"
logging.basicConfig(level=logging.DEBUG, format=log_entry_format)
logging.Formatter.converter = time.gmtime
logger.info("Here is some info...")
logger.w... | 29.055556 | 95 | 0.755258 |
961d77ce05265748a670c9e7548815fb7bbd72d8 | 489 | py | Python | zerver/lib/user_agent.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 17,004 | 2015-09-25T18:27:24.000Z | 2022-03-31T22:02:32.000Z | zerver/lib/user_agent.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 20,344 | 2015-09-25T19:02:42.000Z | 2022-03-31T23:54:40.000Z | zerver/lib/user_agent.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 7,271 | 2015-09-25T18:48:39.000Z | 2022-03-31T21:06:11.000Z | import re
from typing import Dict
# Warning: If you change this parsing, please test using
# zerver/tests/test_decorators.py
# And extend zerver/tests/fixtures/user_agents_unique with any new test cases
pattern = re.compile(
"""^ (?P<name> [^/ ]* [^0-9/(]* )
(/ (?P<version> [^/ ]* ))?
([ /] .*)?
$"""... | 24.45 | 77 | 0.629857 |
6f93d9b7385844241f750b700c4633c0ed16b0b9 | 974 | py | Python | vitrage/evaluator/actions/base.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | vitrage/evaluator/actions/base.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | vitrage/evaluator/actions/base.py | mail2nsrajesh/vitrage | 41f863bbb7568f70d347feeab8eaca13085f81ba | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 - Nokia
#
# 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, sof... | 30.4375 | 75 | 0.714579 |
c90d7be74d1fea13a78f253c16b7fdeaee791ba1 | 3,538 | py | Python | src/cray/boa/__init__.py | Cray-HPE/boa | 0718b5a1f40134f16b7279a93f545d9f5ca2b664 | [
"MIT"
] | null | null | null | src/cray/boa/__init__.py | Cray-HPE/boa | 0718b5a1f40134f16b7279a93f545d9f5ca2b664 | [
"MIT"
] | 2 | 2022-03-09T18:00:45.000Z | 2022-03-29T18:54:52.000Z | src/cray/boa/__init__.py | Cray-HPE/boa | 0718b5a1f40134f16b7279a93f545d9f5ca2b664 | [
"MIT"
] | null | null | null | #
# MIT License
#
# (C) Copyright 2019-2022 Hewlett Packard Enterprise Development LP
#
# 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... | 34.019231 | 82 | 0.738553 |
e331dbff1b94734440a927c02902e42c3f1c9cc7 | 876 | py | Python | src/bookmark_parser.py | Oscarshu0719/cableav-web-crawler | dce1dea30939b3799df71b17cb3f6b805b82219d | [
"MIT"
] | 15 | 2020-12-21T10:20:38.000Z | 2022-03-17T05:17:09.000Z | src/bookmark_parser.py | 287456405/cableav-web-crawler | dce1dea30939b3799df71b17cb3f6b805b82219d | [
"MIT"
] | 3 | 2021-01-27T08:40:35.000Z | 2021-01-29T00:31:40.000Z | src/bookmark_parser.py | 287456405/cableav-web-crawler | dce1dea30939b3799df71b17cb3f6b805b82219d | [
"MIT"
] | 8 | 2020-12-21T10:20:40.000Z | 2021-12-03T02:31:12.000Z | # -*- coding: UTF-8 -*-
import re
from constants import BOOKMARK_PATH, PATTERN_BOOKMARK
"""
Usage:
python bookmark_parser.py *path*
Args:
*path*: Chrome bookmark file.
Notice:
Export bookmarks from 'Bookmark manager'.
"""
def get_urls_from_html(path):
with open(path, 'r... | 21.9 | 77 | 0.59589 |
98dffc423083c815f9b8befdb30d8922e5a91576 | 1,651 | py | Python | zipline/api.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | 6 | 2017-12-11T06:12:00.000Z | 2019-05-23T17:39:10.000Z | zipline/api.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | null | null | null | zipline/api.py | liudengfeng/zipline | 01fdd51d83efeb3453e92b7d02c255a06eba49ac | [
"Apache-2.0"
] | 1 | 2018-01-26T14:19:38.000Z | 2018-01-26T14:19:38.000Z | #
# Copyright 2014 Quantopian, 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 wr... | 27.065574 | 74 | 0.721381 |
0ea057e33dca1f4a3b6964d86d76c4e3e8cef0ac | 2,045 | py | Python | mac/google-cloud-sdk/lib/surface/iot/devices/configs/list.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | mac/google-cloud-sdk/lib/surface/iot/devices/configs/list.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 4 | 2020-07-21T12:51:46.000Z | 2022-01-22T10:29:25.000Z | mac/google-cloud-sdk/lib/surface/iot/devices/configs/list.py | bopopescu/cndw | ee432efef88a4351b355f3d6d5350defc7f4246b | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. 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 requi... | 34.661017 | 96 | 0.719315 |
e1ee84f551836390f2ff2571629a339a8fd6924a | 2,383 | py | Python | eve_auth/tasks.py | bastianh/django-eve-auth | 26d7440a41708d46b057f98d60dffe9705c03d8b | [
"BSD-2-Clause"
] | null | null | null | eve_auth/tasks.py | bastianh/django-eve-auth | 26d7440a41708d46b057f98d60dffe9705c03d8b | [
"BSD-2-Clause"
] | null | null | null | eve_auth/tasks.py | bastianh/django-eve-auth | 26d7440a41708d46b057f98d60dffe9705c03d8b | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from datetime import datetime, timezone
import logging
from celery import shared_task
from celery.utils.log import get_task_logger
from .utils.eveapi import eveapi
logger2 = get_task_logger(__name__)
logger = logging.getLogger(__name__)
@shared_task
def check_key(key_id):
... | 33.097222 | 114 | 0.698699 |
f44450f3ad90b9eb54c11bc67a84a71a66681324 | 3,474 | py | Python | darglint/parse/grammars/google_short_description.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 405 | 2017-10-19T11:04:21.000Z | 2022-03-23T07:58:40.000Z | darglint/parse/grammars/google_short_description.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 186 | 2018-03-26T20:33:37.000Z | 2022-03-20T22:47:54.000Z | darglint/parse/grammars/google_short_description.py | s-weigand/darglint | 6bc5d764db86626a996de1ff50925f976bf1449e | [
"MIT"
] | 43 | 2018-10-14T23:49:48.000Z | 2022-02-10T12:39:16.000Z | # Generated on 2020-04-04 11:23:40.191231
from darglint.parse.grammar import (
BaseGrammar,
P,
)
from darglint.token import (
TokenType,
)
from darglint.parse.identifiers import (
NoqaIdentifier,
)
class ShortDescriptionGrammar(BaseGrammar):
productions = [
P("short-description", ([], "w... | 119.793103 | 779 | 0.661485 |
715de4bb93c4a15635052daabd7c11699f82b1d7 | 505 | py | Python | PROC Monitor/lab.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | PROC Monitor/lab.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | PROC Monitor/lab.py | IRIDIUM-SUB/Sys_Course_Design | 52ec96378e9f9c8d7dc366efcba154df3f1cbc67 | [
"MIT"
] | null | null | null | import tkinter
'''
win=tkinter.Tk() #构造窗体
my_frame = tkinter.Frame(win, relief="sunken")
my_frame.pack()
mylist=tkinter.Listbox(my_frame,width=100) #列表框
mylist.pack()
for item in ["1","asdsa","asdsadsa","asdsadsad",1,2,3,4,5,6,7,8,9,11,22,33,44,55,66,77]: #插入内容
mylist.insert(tkinter.END,item) #从尾部插入
tkinter... | 26.578947 | 96 | 0.663366 |
c3dba09a12f9596c49a33add17d65375a028eb87 | 9,619 | py | Python | setup.py | cshivade/pytorchpipe | d8d92937de2ae7e23db1895c79a09ba47f5698e0 | [
"Apache-2.0"
] | 1 | 2021-09-03T07:49:42.000Z | 2021-09-03T07:49:42.000Z | setup.py | cshivade/pytorchpipe | d8d92937de2ae7e23db1895c79a09ba47f5698e0 | [
"Apache-2.0"
] | null | null | null | setup.py | cshivade/pytorchpipe | d8d92937de2ae7e23db1895c79a09ba47f5698e0 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) IBM Corporation 2018-2019
#
# 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 t... | 41.461207 | 106 | 0.693627 |
48541a57e95f20c2caa073c82601fea68669d5e0 | 12,843 | py | Python | build/lib/simplemediawiki.py | LucianNovo/WikiKrawl | 8a6d150cba74b12c7c62cb2044c14816e190df79 | [
"MIT"
] | 2 | 2015-04-03T06:15:10.000Z | 2022-03-12T15:37:36.000Z | simplemediawiki.py | LucianNovo/WikiKrawl | 8a6d150cba74b12c7c62cb2044c14816e190df79 | [
"MIT"
] | 1 | 2019-09-24T09:56:52.000Z | 2019-09-24T09:56:52.000Z | core/lib/wikipedia/simplemediawiki.py | vsilent/smarty-bot | 963cba05433be14494ba339343c9903ccab3c37d | [
"MIT"
] | null | null | null | # python-simplemediawiki - Extremely low-level wrapper to the MediaWiki API
# Copyright (C) 2011 Red Hat, Inc.
# Primary maintainer: Ian Weller <iweller@redhat.com>
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the ... | 39.395706 | 79 | 0.615666 |
00501d3ddabc4475f90bfd6ce29bce3023f32081 | 4,248 | py | Python | airflow/contrib/hooks/aws_glue_catalog_hook.py | FlyrInc/airflow-1 | 74b22337b45a1eb25585d52e35694e6b0eb81f03 | [
"Apache-2.0"
] | 1 | 2020-09-03T09:35:30.000Z | 2020-09-03T09:35:30.000Z | airflow/contrib/hooks/aws_glue_catalog_hook.py | FlyrInc/airflow-1 | 74b22337b45a1eb25585d52e35694e6b0eb81f03 | [
"Apache-2.0"
] | 1 | 2019-03-27T02:21:36.000Z | 2019-03-27T02:21:36.000Z | airflow/contrib/hooks/aws_glue_catalog_hook.py | FlyrInc/airflow-1 | 74b22337b45a1eb25585d52e35694e6b0eb81f03 | [
"Apache-2.0"
] | 2 | 2020-04-24T10:51:17.000Z | 2020-05-26T01:50:29.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 35.697479 | 137 | 0.627589 |
ef3b557b0aece96c72158903948d94d72d0380c9 | 15,092 | py | Python | advanced_filters/forms.py | FreckleIOT/django-advanced-filters | fc4dd0b5f17051dad282eaca3482da7c9ef0ac70 | [
"MIT"
] | null | null | null | advanced_filters/forms.py | FreckleIOT/django-advanced-filters | fc4dd0b5f17051dad282eaca3482da7c9ef0ac70 | [
"MIT"
] | null | null | null | advanced_filters/forms.py | FreckleIOT/django-advanced-filters | fc4dd0b5f17051dad282eaca3482da7c9ef0ac70 | [
"MIT"
] | null | null | null | import logging
import operator
from datetime import datetime as dt
from pprint import pformat
import django
from django import forms
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.utils import get_fields_from_path
from django.db.models import Fi... | 38.896907 | 91 | 0.597403 |
51f4a0b974ef0151a0d337402095ba68312bf25c | 463 | py | Python | test/os_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/os_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/os_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | import os
import psutil
import time
import subprocess
if __name__ == "__main__":
pass
# op_content = "/Applications/微信.app"
# p = subprocess.Popen(op_content)
# time.sleep(3)
# p.terminate()
# os.system(f'open \"{op_content}\"')
# os.system("osascript -e 'tell application \"/Applications/微... | 23.15 | 83 | 0.602592 |
62ada1806ff717068dc400eb8843bfc3388928eb | 1,301 | py | Python | tests/test_sessions.py | kennethreitz/requests-async | 213da681c13a79e2f6232920e61f2181d92daa3e | [
"Apache-2.0"
] | 7 | 2019-03-22T10:48:42.000Z | 2019-06-24T03:28:33.000Z | tests/test_sessions.py | Lt-grint/requests-async | b5147b15c67ca504fe35536c950fcca67da9d147 | [
"Apache-2.0"
] | null | null | null | tests/test_sessions.py | Lt-grint/requests-async | b5147b15c67ca504fe35536c950fcca67da9d147 | [
"Apache-2.0"
] | 2 | 2019-04-15T09:59:52.000Z | 2019-06-11T08:24:34.000Z | import asyncio
import requests_async
import pytest
@pytest.mark.asyncio
async def test_session(server):
url = "http://127.0.0.1:8000/"
with requests_async.Session() as session:
response = await session.get(url)
assert response.status_code == 200
assert response.json() == {"method": "G... | 34.236842 | 79 | 0.598002 |
8c708082f02fa3b39d8b345ddafd84f986fd9b76 | 5,697 | py | Python | blabel/label_tools.py | kubaraczkowski/blabel | afbe6ecd7805ef83e24a52eb60476216c1086711 | [
"MIT"
] | 91 | 2018-11-07T09:03:44.000Z | 2022-03-25T04:43:45.000Z | blabel/label_tools.py | kubaraczkowski/blabel | afbe6ecd7805ef83e24a52eb60476216c1086711 | [
"MIT"
] | 17 | 2019-09-20T11:31:52.000Z | 2022-02-16T14:37:06.000Z | blabel/label_tools.py | kubaraczkowski/blabel | afbe6ecd7805ef83e24a52eb60476216c1086711 | [
"MIT"
] | 26 | 2019-09-20T11:20:17.000Z | 2021-11-11T12:14:51.000Z | """Utilities for label generation.
"""
import base64
from io import BytesIO
import datetime
import textwrap
import qrcode
import barcode as python_barcode
from pystrich.datamatrix import DataMatrixEncoder
from PIL import Image, ImageOps
def now(fmt="%Y-%m-%d %H:%M"):
"""Display the current time.
Default form... | 29.518135 | 80 | 0.626821 |
188bd8feac21a8211dd02329d143c9e2016abd26 | 8,446 | py | Python | src/learners/maddpg_learner.py | at-peter/epymarl | e84ee56f435e6fe69e9bb3297256a326f65b3b1f | [
"Apache-2.0"
] | null | null | null | src/learners/maddpg_learner.py | at-peter/epymarl | e84ee56f435e6fe69e9bb3297256a326f65b3b1f | [
"Apache-2.0"
] | null | null | null | src/learners/maddpg_learner.py | at-peter/epymarl | e84ee56f435e6fe69e9bb3297256a326f65b3b1f | [
"Apache-2.0"
] | null | null | null | import copy
from components.episode_buffer import EpisodeBatch
from modules.critics.maddpg import MADDPGCritic
import torch as th
from torch.optim import RMSprop, Adam
from controllers.maddpg_controller import gumbel_softmax
from modules.critics import REGISTRY as critic_registry
class MADDPGLearner:
def __init__(... | 45.654054 | 156 | 0.6287 |
6f80d3e9c779d6682b1cc587762ad462a45911e4 | 134 | py | Python | dataservice/api/biospecimen/__init__.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 6 | 2018-01-25T13:49:24.000Z | 2020-03-07T16:25:09.000Z | dataservice/api/biospecimen/__init__.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 369 | 2018-01-17T15:22:18.000Z | 2022-03-10T19:14:56.000Z | dataservice/api/biospecimen/__init__.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | 3 | 2018-04-11T14:18:37.000Z | 2018-10-31T19:09:48.000Z | from dataservice.api.biospecimen.resources import BiospecimenAPI
from dataservice.api.biospecimen.resources import BiospecimenListAPI
| 44.666667 | 68 | 0.895522 |
746b3f8be8e0bfc2d11fd8fd8ea8717dcf33514e | 129,224 | py | Python | Lib/test/test_os.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | 27 | 2017-04-21T14:57:04.000Z | 2021-11-03T22:10:38.000Z | Lib/test/test_os.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | null | null | null | Lib/test/test_os.py | Golfist/cpython | c4750959acbfc3057f12aaec832483ba30898d1c | [
"PSF-2.0"
] | 9 | 2017-04-26T14:14:05.000Z | 2020-12-14T16:26:41.000Z | # As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# portable than they had been thought to be.
import asynchat
import asyncore
import codecs
import contextlib
import decimal
import errno
import fractions
import getpass
... | 37.218894 | 101 | 0.595006 |
97e48efb7eaa58c4d95781afdfddf4fc5c47ab58 | 11,364 | py | Python | mw4/logic/camera/cameraAlpaca.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 16 | 2020-01-11T22:32:26.000Z | 2022-03-31T15:18:14.000Z | mw4/logic/camera/cameraAlpaca.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 196 | 2020-01-16T13:56:01.000Z | 2022-03-29T02:06:51.000Z | mw4/logic/camera/cameraAlpaca.py | mworion/MountWizzard4 | 4e06b29ec2ef70be40e114b911b7bdf2f858a4b1 | [
"Apache-2.0"
] | 6 | 2019-12-01T19:39:33.000Z | 2021-05-27T13:14:20.000Z | ############################################################
# -*- coding: utf-8 -*-
#
# # # # # # #
# ## ## # ## # #
# # # # # # # # # # #
# # ## # ## ## ######
# # # # # # #
#
# Python-based Tool for interaction with the 10micron mounts
# GUI with PyQT5 fo... | 36.191083 | 90 | 0.556582 |
4ce2a354338658947c4bdb4444d2c8634d1ed5d6 | 24,310 | py | Python | opencolorio_config_aces/config/generation/common.py | michdolan/OpenColorIO-Config-ACES | 5216c2a184e03529557993b7dc670d351aadddc7 | [
"BSD-3-Clause"
] | null | null | null | opencolorio_config_aces/config/generation/common.py | michdolan/OpenColorIO-Config-ACES | 5216c2a184e03529557993b7dc670d351aadddc7 | [
"BSD-3-Clause"
] | null | null | null | opencolorio_config_aces/config/generation/common.py | michdolan/OpenColorIO-Config-ACES | 5216c2a184e03529557993b7dc670d351aadddc7 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
"""
OpenColorIO Config Generation Common Objects
============================================
Defines various objects related to *OpenColorIO* config generation:
- :class:`opencolorio_config_aces.VersionData`
- :class:`op... | 30.772152 | 79 | 0.574044 |
6062406330a254d802b58d272f8336120fb4129f | 7,916 | py | Python | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/yaml/resolver.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/yaml/resolver.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null | taln2016/icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/yaml/resolver.py | hectormartinez/rougexstem | 32da9eab253cb88fc1882e59026e8b5b40900a25 | [
"Apache-2.0"
] | null | null | null |
__all__ = ['BaseResolver', 'Resolver']
from error import *
from nodes import *
import re
class ResolverError(YAMLError):
pass
class BaseResolver(object):
DEFAULT_SCALAR_TAG = u'tag:yaml.org,2002:str'
DEFAULT_SEQUENCE_TAG = u'tag:yaml.org,2002:seq'
DEFAULT_MAPPING_TAG = u'tag:yaml.org,2002:map'
... | 37.516588 | 82 | 0.541056 |
7e3aa5b537ce2ac7c92e8f19fe7c336ad045ef1d | 9,456 | py | Python | daedalus/PopulationSynthesis/static.py | niklomax/daedalus | 4936f181050dc6c3eaf564b1a03e9f0b45396e39 | [
"MIT"
] | 4 | 2020-05-13T10:54:32.000Z | 2021-12-17T11:00:42.000Z | daedalus/PopulationSynthesis/static.py | niklomax/daedalus | 4936f181050dc6c3eaf564b1a03e9f0b45396e39 | [
"MIT"
] | 30 | 2022-02-14T11:21:04.000Z | 2022-03-30T11:00:22.000Z | minos/PopulationSynthesis/static.py | Leeds-MRG/Minos | 6273dc718a7a1e8513b0c31e26269ff8f9720ae1 | [
"MIT"
] | 2 | 2021-01-12T10:49:33.000Z | 2021-01-20T13:11:36.000Z | """
Microsimulation by a sequence of microsynthesised populations
"""
import numpy as np
import pandas as pd
# from random import randint
#import humanleague as hl
import ukpopulation.nppdata as nppdata
import ukpopulation.snppdata as snppdata
import ukpopulation.customsnppdata as customsnppdata
import ukpopulation.my... | 45.461538 | 121 | 0.603955 |
6900fe08f4d8b068481d7dbed2105bc7d3a47b25 | 6,406 | py | Python | localstack/utils/persistence.py | ninhkd/localstack | 9a415e2067f6fafa3cdc9dd84f5b491b0b2a2acd | [
"Apache-2.0"
] | 1 | 2020-09-27T06:56:06.000Z | 2020-09-27T06:56:06.000Z | localstack/utils/persistence.py | ninhkd/localstack | 9a415e2067f6fafa3cdc9dd84f5b491b0b2a2acd | [
"Apache-2.0"
] | null | null | null | localstack/utils/persistence.py | ninhkd/localstack | 9a415e2067f6fafa3cdc9dd84f5b491b0b2a2acd | [
"Apache-2.0"
] | 1 | 2020-08-07T12:49:58.000Z | 2020-08-07T12:49:58.000Z | import os
import re
import json
import base64
import traceback
import requests
import logging
from six import add_metaclass
from abc import ABCMeta, abstractmethod
from localstack.config import DATA_DIR
from localstack.utils.aws import aws_stack
from localstack.utils.common import to_bytes, to_str
from localstack.utils... | 33.364583 | 108 | 0.645489 |
959b337839feb408e0ca14c539bdba98142b253c | 1,572 | py | Python | src/PythonClient.py | indiajoe/JuliaProcessingServer.jl | 75e683902fc4db011a9ed811c39c3351140bbfc6 | [
"TCP-wrappers"
] | null | null | null | src/PythonClient.py | indiajoe/JuliaProcessingServer.jl | 75e683902fc4db011a9ed811c39c3351140bbfc6 | [
"TCP-wrappers"
] | null | null | null | src/PythonClient.py | indiajoe/JuliaProcessingServer.jl | 75e683902fc4db011a9ed811c39c3351140bbfc6 | [
"TCP-wrappers"
] | null | null | null | #!/usr/bin/env python
""" This script is to send numpy assray to the Julia server """
import socket
import numpy as np
import logging
from cStringIO import StringIO
PortOfServer = 8006
Array = np.random.random((3,4,5))*10
def get_RemoteProcessedData(DataCube,port,hostname="localhost"):
""" Sends the DataCube to s... | 34.173913 | 110 | 0.638041 |
2b2c4cf0a90c3d057f8f22b8501b11ab25bdb337 | 16,122 | py | Python | Lib/test/test_ftplib.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_ftplib.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_ftplib.py | deadsnakes/python3.1 | 88d77610a7873c5161bfc15cd69557fc7697b1a3 | [
"PSF-2.0"
] | null | null | null | """Test script for ftplib module."""
# Modified by Giampaolo Rodola' to test FTP class and IPv6 environment
import ftplib
import threading
import asyncore
import asynchat
import socket
import io
from unittest import TestCase
from test import support
from test.support import HOST
# the dummy data returned by server ... | 30.708571 | 82 | 0.607865 |
4d63af818381889409dd4ee964b413ffc8d6d8c0 | 10,829 | py | Python | rllib/policy/torch_policy.py | eisber/ray | 94a286ef1d8ad5a3093b7f996a811727fa0e2d3e | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | eisber/ray | 94a286ef1d8ad5a3093b7f996a811727fa0e2d3e | [
"Apache-2.0"
] | null | null | null | rllib/policy/torch_policy.py | eisber/ray | 94a286ef1d8ad5a3093b7f996a811727fa0e2d3e | [
"Apache-2.0"
] | null | null | null | import numpy as np
import time
from ray.rllib.policy.policy import Policy, LEARNER_STATS_KEY
from ray.rllib.policy.sample_batch import SampleBatch
from ray.rllib.utils import try_import_torch
from ray.rllib.utils.annotations import override, DeveloperAPI
from ray.rllib.utils.tracking_dict import UsageTrackingDict
from... | 37.085616 | 79 | 0.614831 |
61523daa8578e69fbc093207761c283f79840f70 | 1,521 | py | Python | instaphotos/migrations/0001_initial.py | LekamCharity/insta-IG | 0302440df3b2029297af54eb9c56090f82232973 | [
"MIT"
] | null | null | null | instaphotos/migrations/0001_initial.py | LekamCharity/insta-IG | 0302440df3b2029297af54eb9c56090f82232973 | [
"MIT"
] | null | null | null | instaphotos/migrations/0001_initial.py | LekamCharity/insta-IG | 0302440df3b2029297af54eb9c56090f82232973 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-02 09:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 40.026316 | 164 | 0.608153 |
2cf36141692dd986988c8b9efd2d632ac1b36845 | 423 | py | Python | swagger/swagger_server/test/__init__.py | mcclown/AutoReef.APIGateway | b77dd6e50beba3d0bb36dfc948e8514a7e5a425d | [
"MIT"
] | null | null | null | swagger/swagger_server/test/__init__.py | mcclown/AutoReef.APIGateway | b77dd6e50beba3d0bb36dfc948e8514a7e5a425d | [
"MIT"
] | 5 | 2018-03-12T13:24:49.000Z | 2018-03-12T13:37:14.000Z | swagger/swagger_server/test/__init__.py | mcclown/AutoReef.APIGateway | b77dd6e50beba3d0bb36dfc948e8514a7e5a425d | [
"MIT"
] | null | null | null | import logging
import connexion
from flask_testing import TestCase
from swagger.swagger_server.encoder import JSONEncoder
class BaseTestCase(TestCase):
def create_app(self):
logging.getLogger('connexion.operation').setLevel('ERROR')
app = connexion.App(__name__, specification_dir='../swagger/')... | 24.882353 | 70 | 0.723404 |
c47ad3a1d836bf9c4e3579766609192e22e791ff | 10,968 | py | Python | _nt.py | gndu91/Windows-Sound-Manager | cdcf7a0044aed14abf5a4c48babf8f7ce2ff4fab | [
"MIT"
] | null | null | null | _nt.py | gndu91/Windows-Sound-Manager | cdcf7a0044aed14abf5a4c48babf8f7ce2ff4fab | [
"MIT"
] | null | null | null | _nt.py | gndu91/Windows-Sound-Manager | cdcf7a0044aed14abf5a4c48babf8f7ce2ff4fab | [
"MIT"
] | null | null | null | # Code found in the Python Mailing List:
# https://mail.python.org/pipermail/python-win32/2014-March/013080.html
# Author: Tim Roberts timr at probo.com
# Tested on my computer (Windows 10, Python 3.7, AMD64)
import operator
import random
import unittest
from ctypes.wintypes import BOOL
import comtypes.client
from c... | 33.747692 | 108 | 0.591265 |
8bd28155c7551f3e6204599c3605beb018b92473 | 37,999 | py | Python | scripts/python/catalyst/tests/test_build_isothermal.py | coelectrolyzer/cats | 21f8e6f5f176767ec403ad2738c80a5a71fba959 | [
"MIT"
] | null | null | null | scripts/python/catalyst/tests/test_build_isothermal.py | coelectrolyzer/cats | 21f8e6f5f176767ec403ad2738c80a5a71fba959 | [
"MIT"
] | null | null | null | scripts/python/catalyst/tests/test_build_isothermal.py | coelectrolyzer/cats | 21f8e6f5f176767ec403ad2738c80a5a71fba959 | [
"MIT"
] | null | null | null | ''' Testing of building an isothermal model '''
import sys
sys.path.append('../..')
import unittest
import pytest
from catalyst.isothermal_monolith_catalysis import *
import logging
__author__ = "Austin Ladshaw"
_log = logging.getLogger(__name__)
# Start test class
class TestBasicIsothermalCatalystB... | 43.626866 | 132 | 0.609279 |
04e5e53bf10d135544089dd3f65440b068532eee | 350 | py | Python | django_pivot/tests/test_sqlite_settings.py | thatch/django-pivot | b230376b56d8cc2a11e8620f5a2950e5e171e747 | [
"MIT"
] | 187 | 2016-11-17T01:21:12.000Z | 2022-03-19T11:51:03.000Z | django_pivot/tests/test_sqlite_settings.py | thatch/django-pivot | b230376b56d8cc2a11e8620f5a2950e5e171e747 | [
"MIT"
] | 22 | 2017-10-17T17:57:50.000Z | 2022-02-11T03:29:27.000Z | django_pivot/tests/test_sqlite_settings.py | thatch/django-pivot | b230376b56d8cc2a11e8620f5a2950e5e171e747 | [
"MIT"
] | 15 | 2017-11-01T05:29:24.000Z | 2022-02-24T23:09:52.000Z | BACKEND = 'sqlite'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
INSTALLED_APPS = (
'django_pivot.tests.pivot',
)
SITE_ID = 1,
SECRET_KEY = 'secret'
MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middlewar... | 15.909091 | 48 | 0.634286 |
568dbf50fde914c45f79fde0aece6c7a86a0f4ce | 1,287 | py | Python | aiida/cmdline/params/types/node.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 1 | 2016-09-12T10:51:00.000Z | 2016-09-12T10:51:00.000Z | aiida/cmdline/params/types/node.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | 17 | 2020-03-11T17:04:05.000Z | 2020-05-01T09:34:45.000Z | aiida/cmdline/params/types/node.py | louisponet/aiida-core | 3214236df66a3792ee57fe38a06c0c3bb65861ab | [
"MIT",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | 39 | 113 | 0.534577 |
c2cc176f7ed165eda293198e4d0d3cd69d5e9d8f | 4,344 | py | Python | 2d_triangular/filling_1over3_BC_P_P/2d_triangular.py | ryuikaneko/tight_binding_shell_condition | 37ed5f1497b6e757873831ea515a29e4a9f2e50e | [
"MIT"
] | null | null | null | 2d_triangular/filling_1over3_BC_P_P/2d_triangular.py | ryuikaneko/tight_binding_shell_condition | 37ed5f1497b6e757873831ea515a29e4a9f2e50e | [
"MIT"
] | null | null | null | 2d_triangular/filling_1over3_BC_P_P/2d_triangular.py | ryuikaneko/tight_binding_shell_condition | 37ed5f1497b6e757873831ea515a29e4a9f2e50e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
from __future__ import print_function
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
def ene(kx,ky):
return -2.0*(np.cos(kx)+np.cos(ky)+np.cos(kx+ky))
def calc_k_ene(Lx,Ly,BCx,BCy):
if BCx == 'AP' or BCx == 'antiperiodic':
... | 35.606557 | 116 | 0.642495 |
bde33fa7f6bb5ebaf5009e45cc3769409e98f2cf | 2,492 | py | Python | src/mem/probes/BaseMemProbe.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | 135 | 2016-10-21T03:31:49.000Z | 2022-03-25T01:22:20.000Z | src/mem/probes/BaseMemProbe.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | 35 | 2017-03-10T17:57:46.000Z | 2022-02-18T17:34:16.000Z | src/mem/probes/BaseMemProbe.py | mandaltj/gem5_chips | b9c0c602241ffda7851c1afb32fa01f295bb98fd | [
"BSD-3-Clause"
] | 48 | 2016-12-08T12:03:13.000Z | 2022-02-16T09:16:13.000Z | # Copyright (c) 2015 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | 49.84 | 74 | 0.775682 |
bc6d74ede8a803e44b6ddd29b2d9fce6eee1d6ce | 1,088 | py | Python | hotel/migrations/0003_feedback.py | ssd-course-project/hotel | 3920fe522daceb2554d8850c62202988b745827b | [
"MIT"
] | null | null | null | hotel/migrations/0003_feedback.py | ssd-course-project/hotel | 3920fe522daceb2554d8850c62202988b745827b | [
"MIT"
] | 27 | 2019-03-10T05:59:58.000Z | 2019-05-16T07:57:06.000Z | hotel/migrations/0003_feedback.py | ssd-course-project/hotel | 3920fe522daceb2554d8850c62202988b745827b | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-04-09 13:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('clients', '0001_initial'),
('hotel', '0002_auto_20190403_1917'),
]
operations = [
migrations.Creat... | 36.266667 | 144 | 0.568015 |
7e17b4316da04d14f2e9c734941138762a5994a0 | 154,122 | py | Python | greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | greykite/tests/algo/forecast/silverkite/test_forecast_silverkite.py | briancpark/greykite | 2f484978a7ed206ebd9356e02fc1fb881cd25205 | [
"BSD-2-Clause"
] | null | null | null | import datetime
from datetime import timedelta
import matplotlib
import numpy as np
import modin.pandas as pd
import pytest
from pandas.util.testing import assert_frame_equal
from greykite.algo.changepoint.adalasso.changepoint_detector import ChangepointDetector
from greykite.algo.changepoint.adalasso.changepoints_ut... | 37.710301 | 130 | 0.657414 |
2b07c02968b627100df8ed249950c0b4bb15146f | 57 | py | Python | netxlib/linux/cpu.py | vargyropoulos/netxlib | c0f05edf2e7800353a6628beca8dc661b05e885e | [
"MIT"
] | null | null | null | netxlib/linux/cpu.py | vargyropoulos/netxlib | c0f05edf2e7800353a6628beca8dc661b05e885e | [
"MIT"
] | null | null | null | netxlib/linux/cpu.py | vargyropoulos/netxlib | c0f05edf2e7800353a6628beca8dc661b05e885e | [
"MIT"
] | null | null | null | # write a cpu check (from container)
# maybe system load
| 19 | 36 | 0.736842 |
2589a18d11c4307461adcd39755d2673671e66b1 | 1,845 | py | Python | train_agent.py | turalnovruzov/tictactoe-ai | d07939ea4e27320cdda28d36bfc50bf89c3b1833 | [
"MIT"
] | null | null | null | train_agent.py | turalnovruzov/tictactoe-ai | d07939ea4e27320cdda28d36bfc50bf89c3b1833 | [
"MIT"
] | null | null | null | train_agent.py | turalnovruzov/tictactoe-ai | d07939ea4e27320cdda28d36bfc50bf89c3b1833 | [
"MIT"
] | null | null | null | import argparse
from qagent import QAgent
def check_episodes(episodes):
"""
Checks the validity of the episodes command line argument
"""
episodes = int(episodes)
if episodes < 0:
raise argparse.ArgumentTypeError(f'{episodes} is an invalid episodes value')
return episodes
def check_al... | 34.811321 | 119 | 0.686721 |
cf4fc4f0f7309c2f727842e07f319798c4a6de35 | 2,973 | py | Python | q1.py | GeoffNN/RL_TP1 | 46b95f8b7c462bf132a7b4480ef1c641ce584479 | [
"Unlicense"
] | null | null | null | q1.py | GeoffNN/RL_TP1 | 46b95f8b7c462bf132a7b4480ef1c641ce584479 | [
"Unlicense"
] | null | null | null | q1.py | GeoffNN/RL_TP1 | 46b95f8b7c462bf132a7b4480ef1c641ce584479 | [
"Unlicense"
] | null | null | null | from scipy.stats import bernoulli, randint
import numpy as np
class TreeCut:
def __init__(self, growth_param=5, replanting_cost=30, linear_wood_value=10,
maintenance_cost=3, max_height=40, proba_of_dying=.1,
sappling_height=1, gamma=1. / (1 + 0.05)):
self.growth... | 43.086957 | 108 | 0.592667 |
a1ba1e846fb9586ecbf0ccdddc9a44d5403dcf97 | 2,033 | py | Python | model-optimizer/extensions/front/onnx/rnn_ext.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/extensions/front/onnx/rnn_ext.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/extensions/front/onnx/rnn_ext.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from extensions.ops.RNN import RNN
from mo.front.extractor import FrontExtractorOp
from mo.front.onnx.extractors.utils import onnx_attr
class RNNFrontExtractor(FrontExtractorOp):
op = 'RNN'
enabled = True
... | 38.358491 | 116 | 0.586326 |
27fc36fd128eabd72d201a101b2c634a5ba15ece | 48 | py | Python | math/freecodecamp/program.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | math/freecodecamp/program.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | math/freecodecamp/program.py | spideynolove/Other-repo | 34066f177994415d031183ab9dd219d787e6e13a | [
"MIT"
] | null | null | null | import numpy as np
print("Hello freecodecamp!") | 16 | 28 | 0.770833 |
891a7a6e323babc58f18690310620efbf32108fd | 383 | py | Python | lab/migrations/0015_labcode_test.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | null | null | null | lab/migrations/0015_labcode_test.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | 8 | 2020-06-05T23:56:56.000Z | 2022-03-12T00:02:52.000Z | lab/migrations/0015_labcode_test.py | bernardobgam/edtech_experiment | 88a64b925b6692261649418260a0bdf7b4a5a9d1 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.1 on 2019-09-08 00:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lab', '0014_labprogress_receipt'),
]
operations = [
migrations.AddField(
model_name='labcode',
name='test',
... | 20.157895 | 53 | 0.5953 |
0aa5963dfc4cc777826f7f7daa4ff69ff518541f | 6,846 | py | Python | scripts/fast_parameters.py | divadnauj-GB/nvbitfi | 8f7e48a4ffd3f8e819c5fc0891fb62422080aa15 | [
"Apache-2.0"
] | null | null | null | scripts/fast_parameters.py | divadnauj-GB/nvbitfi | 8f7e48a4ffd3f8e819c5fc0891fb62422080aa15 | [
"Apache-2.0"
] | null | null | null | scripts/fast_parameters.py | divadnauj-GB/nvbitfi | 8f7e48a4ffd3f8e819c5fc0891fb62422080aa15 | [
"Apache-2.0"
] | null | null | null | # set parameters for fi
# it is an easier way to set all parameters for SASSIFI, it is the same as setting it on specific_param.py
from os import environ
benchmark = environ['BENCHMARK']
NVBITFI_HOME = environ['NVBITFI_HOME']
THRESHOLD_JOBS = int(environ['FAULTS'])
ADDITIONAL_PARAMETERS = environ['ADDITIONAL_PARAMETE... | 37.823204 | 106 | 0.620508 |
1e2ba857ed3f3b3cd8f0476b85731a6405079248 | 36,365 | py | Python | visitor-counter/venv/Lib/site-packages/flask_sqlalchemy/__init__.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | visitor-counter/venv/Lib/site-packages/flask_sqlalchemy/__init__.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | 8 | 2020-06-06T01:02:06.000Z | 2022-03-12T00:24:13.000Z | visitor-counter/venv/Lib/site-packages/flask_sqlalchemy/__init__.py | justnclrk/Python | 0922961cbd94694a69ae8132a5c33baf552d8d89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
flask_sqlalchemy
~~~~~~~~~~~~~~~~
Adds basic SQLAlchemy support to your application.
:copyright: (c) 2014 by Armin Ronacher, Daniel Neuhäuser.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import functools
import os
import sys
... | 36.621349 | 123 | 0.612705 |
a305eaaef0b2c4406156c21bb56dd19b134c118c | 104 | py | Python | DescriptiveStatistics/mode.py | sv549/statscalc | 338be993adf33f8e835990a67f401214931d4c3f | [
"MIT"
] | null | null | null | DescriptiveStatistics/mode.py | sv549/statscalc | 338be993adf33f8e835990a67f401214931d4c3f | [
"MIT"
] | null | null | null | DescriptiveStatistics/mode.py | sv549/statscalc | 338be993adf33f8e835990a67f401214931d4c3f | [
"MIT"
] | null | null | null | import statistics
class Mode:
@staticmethod
def mode(num):
return statistics.mode(num) | 14.857143 | 35 | 0.673077 |
db9e094810abeaf242cc10be1c67b6019ec23a5a | 132 | py | Python | code/otherStrats/kjhSkewedRandom2.py | kjh618/carykh-prisoners-dilemma-tournament | e44821eeaf4c6d824e0278370d51fab76adf543a | [
"MIT"
] | 1 | 2021-07-01T10:41:28.000Z | 2021-07-01T10:41:28.000Z | code/otherStrats/kjhSkewedRandom2.py | kjh618/carykh-prisoners-dilemma-tournament | e44821eeaf4c6d824e0278370d51fab76adf543a | [
"MIT"
] | null | null | null | code/otherStrats/kjhSkewedRandom2.py | kjh618/carykh-prisoners-dilemma-tournament | e44821eeaf4c6d824e0278370d51fab76adf543a | [
"MIT"
] | null | null | null | import random
def strategy(history, memory):
if random.random() < 0.2:
return 1, None
else:
return 0, None
| 16.5 | 30 | 0.590909 |
d916438cc9417c23078abb93f65f74db9f37a4ae | 9,925 | py | Python | datalad/support/tests/test_fileinfo.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | null | null | null | datalad/support/tests/test_fileinfo.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | null | null | null | datalad/support/tests/test_fileinfo.py | christinerogers/datalad | 8b91f3767b45371e213aa7ade146a290a13c00f2 | [
"MIT"
] | null | null | null | # ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Test file info g... | 38.173077 | 87 | 0.605239 |
f4c2a42c0d069841009e30e8a8b799327c8ef1c3 | 6,963 | py | Python | get_translations.py | nomad-vagabond/BookDict | e2f17ef0db32854ad7b9fabe6a2179cc88376d40 | [
"MIT"
] | null | null | null | get_translations.py | nomad-vagabond/BookDict | e2f17ef0db32854ad7b9fabe6a2179cc88376d40 | [
"MIT"
] | null | null | null | get_translations.py | nomad-vagabond/BookDict | e2f17ef0db32854ad7b9fabe6a2179cc88376d40 | [
"MIT"
] | null | null | null | import json, random, time, re, os
import lingvo_api
_sleeptimes = [1,3,10,30,60]
def translate_words_recursive(words, dumpfile, srclang='En', dstlang='Uk', stime_idx=0):
if stime_idx > 4:
return
translations = []
delayed = []
stimes = [st for st in _sleeptimes[:stime_idx+1]]
... | 33.315789 | 89 | 0.516588 |
c82d5ed3d1a674e3cb8da2971712b339e678778f | 4,285 | py | Python | isovar/nucleotide_counts.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | isovar/nucleotide_counts.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | isovar/nucleotide_counts.py | carnivorouspeanut/isovar_comp | 74fcc12ef52d08eb4cfa85bdcda8903970babbda | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016-2018. Mount Sinai School of Medicine
#
# 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 ... | 37.920354 | 80 | 0.711785 |
a778c6d74e22a7ddaae5415945df773f99194e15 | 16,799 | py | Python | sample_apps/python/QueryExample.py | jmgray24/amazon-timestream-tools | 7c7b80b56c9435cc00e029d8c59d6c19c19b3ad3 | [
"MIT-0"
] | 143 | 2020-10-01T03:18:02.000Z | 2022-03-28T18:17:17.000Z | sample_apps/python/QueryExample.py | jmgray24/amazon-timestream-tools | 7c7b80b56c9435cc00e029d8c59d6c19c19b3ad3 | [
"MIT-0"
] | 36 | 2020-10-02T17:31:09.000Z | 2022-03-13T18:45:31.000Z | sample_apps/python/QueryExample.py | jmgray24/amazon-timestream-tools | 7c7b80b56c9435cc00e029d8c59d6c19c19b3ad3 | [
"MIT-0"
] | 106 | 2020-10-01T13:46:36.000Z | 2022-03-28T18:17:10.000Z | from Constant import DATABASE_NAME, TABLE_NAME, ONE_GB_IN_BYTES
class QueryExample:
HOSTNAME = "host-24Gju"
def __init__(self, client):
self.client = client
self.paginator = client.get_paginator('query')
# See records ingested into this table so far
SELECT_ALL = f"SELECT * FROM {DATA... | 45.898907 | 121 | 0.61843 |
31d8af533c5c69ec3d9046807a13c6a98041aeaf | 2,238 | py | Python | src/Application/PythonScriptModule/pymodules_old/simiangrid/auth.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | null | null | null | src/Application/PythonScriptModule/pymodules_old/simiangrid/auth.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | null | null | null | src/Application/PythonScriptModule/pymodules_old/simiangrid/auth.py | antont/tundra | 5c9b0a3957071f08ab425dff701cdbb34f9e1868 | [
"Apache-2.0"
] | null | null | null | #httplib was ok and httplib2 especially had nice api, but they don't work thru proxies and stuff
#-- curl is the most robust thing
#import httplib
import curl #a high level wrapper over pycurl bindings
import json
import hashlib #only 'cause has a hardcoded pwd here now - for real this comes from connection or launcher... | 33.909091 | 128 | 0.693476 |
98e0c84112a2ae32aee84a4cb48cdfe7b569ef38 | 4,646 | py | Python | tests/test_helper.py | yiskw713/pytorch_template | cfff5da9bd87da81ecbe05bb53397c5414a63163 | [
"MIT"
] | 10 | 2020-11-20T05:51:14.000Z | 2021-12-07T00:49:10.000Z | tests/test_helper.py | pqy000/plant-recognition | 40028c213b4ba3fbb20de35d12252e136e40b5bf | [
"MIT"
] | 4 | 2021-01-25T15:42:25.000Z | 2021-05-25T00:05:11.000Z | tests/test_helper.py | pqy000/plant-recognition | 40028c213b4ba3fbb20de35d12252e136e40b5bf | [
"MIT"
] | 2 | 2020-11-26T07:16:45.000Z | 2021-09-22T02:45:31.000Z | import copy
import numpy as np
import pytest
import torch
import torch.optim as optim
from pytest_mock import MockFixture
from torchvision import transforms
from src.libs.dataset import get_dataloader
from src.libs.helper import do_one_iteration, evaluate, train
from src.libs.loss_fn import get_criterion
from src.lib... | 26.855491 | 77 | 0.632587 |
51eb618624f4c40d4755f6f0ba09568d41cab000 | 2,665 | py | Python | commands/chat.py | zbylyrcxr/DennisMUD | cb9be389e3be3e267fd78b1520ed2902941742da | [
"MIT"
] | 2 | 2022-02-21T17:55:03.000Z | 2022-02-22T06:25:04.000Z | commands/chat.py | zbylyrcxr/DennisMUD | cb9be389e3be3e267fd78b1520ed2902941742da | [
"MIT"
] | 3 | 2022-02-09T18:18:29.000Z | 2022-03-07T08:15:54.000Z | commands/chat.py | zbylyrcxr/DennisMUD | cb9be389e3be3e267fd78b1520ed2902941742da | [
"MIT"
] | 1 | 2022-03-07T08:10:59.000Z | 2022-03-07T08:10:59.000Z | #######################
# Dennis MUD #
# chat.py #
# Copyright 2018-2020 #
# Michael D. Reiley #
#######################
# **********
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal i... | 41.640625 | 176 | 0.677298 |
691f0fc5d2d2d8ff4451f536dd0082e4fc03141d | 4,849 | py | Python | src/assets/handle/TSSStageHandle.py | 5trobl/oaisys | e52e3b0e64e5c4f57963e4aabb07946930f62299 | [
"MIT"
] | null | null | null | src/assets/handle/TSSStageHandle.py | 5trobl/oaisys | e52e3b0e64e5c4f57963e4aabb07946930f62299 | [
"MIT"
] | 1 | 2021-11-22T15:42:37.000Z | 2021-11-22T15:42:37.000Z | src/assets/handle/TSSStageHandle.py | 5trobl/oaisys | e52e3b0e64e5c4f57963e4aabb07946930f62299 | [
"MIT"
] | null | null | null | # blender imports
import bpy
# utility imports
import numpy as np
import csv
import random
import importlib
from src.TSSBase import TSSBase
class TSSStageHandle(TSSBase):
"""docstring for TSSStageHandle"""
def __init__(self):
super(TSSStageHandle, self).__init__()
# class vars ###############... | 30.689873 | 120 | 0.427098 |
80bf0cff254853870b23c1c734f115e68731333c | 5,501 | py | Python | esrally/utils/net.py | tomcallahan/rally | 4d05fa88ea0920ec1f3178c3705201a53f6420db | [
"Apache-2.0"
] | null | null | null | esrally/utils/net.py | tomcallahan/rally | 4d05fa88ea0920ec1f3178c3705201a53f6420db | [
"Apache-2.0"
] | null | null | null | esrally/utils/net.py | tomcallahan/rally | 4d05fa88ea0920ec1f3178c3705201a53f6420db | [
"Apache-2.0"
] | null | null | null | import logging
import os
import certifi
import urllib3
import urllib.error
from esrally import exceptions
__HTTP = None
logger = logging.getLogger("rally.net")
def init():
global __HTTP
proxy_url = os.getenv("http_proxy")
if proxy_url and len(proxy_url) > 0:
logger.info("Rally connects via prox... | 42.643411 | 140 | 0.662061 |
9aee3dc438168bc2e52ef58786d1e6a60f5a2420 | 12,209 | py | Python | facenet_pytorch/models/utils/detect_face.py | ashvah/facial-attributes-recognition | 1d0ecef47f68dfa8673d479ea585a0873c2bdcfd | [
"MIT"
] | 1 | 2022-03-02T09:02:56.000Z | 2022-03-02T09:02:56.000Z | facenet_pytorch/models/utils/detect_face.py | ashvah/facial-attributes-recognition | 1d0ecef47f68dfa8673d479ea585a0873c2bdcfd | [
"MIT"
] | null | null | null | facenet_pytorch/models/utils/detect_face.py | ashvah/facial-attributes-recognition | 1d0ecef47f68dfa8673d479ea585a0873c2bdcfd | [
"MIT"
] | null | null | null | import torch
from torch.nn.functional import interpolate
from torchvision.transforms import functional as F
from torchvision.ops.boxes import batched_nms
from PIL import Image
import numpy as np
import os
import math
# OpenCV is optional, but required if using numpy arrays instead of PIL
try:
import cv2
except:
... | 32.298942 | 99 | 0.572037 |
8c11e3c8ecf97965b022398c3d9ee90fd33eebff | 1,666 | py | Python | src/library/forms.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | src/library/forms.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | src/library/forms.py | klown/clusive | 3c89dae967dfe190c2cdf269915c6ace968d1bfb | [
"bzip2-1.0.6"
] | null | null | null | import logging
from django import forms
from library.models import Book
from roster.models import Period, ClusiveUser
logger = logging.getLogger(__name__)
class UploadForm(forms.Form):
file = forms.FileField(label='File')
class MetadataForm(forms.ModelForm):
cover = forms.FileField(required=False, label=... | 30.290909 | 125 | 0.669268 |
5ebb9069060617a57ae7350b891eed25887f7d32 | 2,568 | py | Python | invitation/migrations/0002_auto_20200211_2020.py | tiagocordeiro/django-easy-party | 6e10a0e325e2cbc90426f48546f37bc60b0ec6b7 | [
"MIT"
] | null | null | null | invitation/migrations/0002_auto_20200211_2020.py | tiagocordeiro/django-easy-party | 6e10a0e325e2cbc90426f48546f37bc60b0ec6b7 | [
"MIT"
] | 184 | 2020-01-31T19:43:31.000Z | 2022-03-18T16:09:50.000Z | invitation/migrations/0002_auto_20200211_2020.py | tiagocordeiro/django-easy-party | 6e10a0e325e2cbc90426f48546f37bc60b0ec6b7 | [
"MIT"
] | 1 | 2020-01-29T17:51:47.000Z | 2020-01-29T17:51:47.000Z | # Generated by Django 3.0.3 on 2020-02-11 23:20
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('invitation', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='InviteCategory',
... | 47.555556 | 136 | 0.593847 |
9758bf355c05862b26bd3e91b0c0f1c77f1e1de4 | 11,566 | py | Python | src/interventions_labeling_lib/compared_terms_finder.py | MariyaIvanina/usaid_data_processing | a57d51f83f4ffbe36368589c6ccb1238d6390699 | [
"Apache-2.0"
] | 3 | 2021-09-20T10:07:07.000Z | 2021-12-11T13:33:40.000Z | src/interventions_labeling_lib/compared_terms_finder.py | MariyaIvanina/usaid_data_processing | a57d51f83f4ffbe36368589c6ccb1238d6390699 | [
"Apache-2.0"
] | null | null | null | src/interventions_labeling_lib/compared_terms_finder.py | MariyaIvanina/usaid_data_processing | a57d51f83f4ffbe36368589c6ccb1238d6390699 | [
"Apache-2.0"
] | null | null | null | import nltk
from allennlp.predictors.predictor import Predictor
from text_processing import text_normalizer
import re
import spacy
from interventions_labeling_lib import hearst_pattern_finder
from interventions_labeling_lib import hyponym_statistics
import os
import pickle
from text_processing import concepts_merger
n... | 55.07619 | 202 | 0.5894 |
089c0b65db07ff5f470083b045737b16426f4f24 | 1,060 | py | Python | python/loanStreetClient.py | McGuire00/LoanStreet | 8a87e7de87e09e2181cb8fd50f15d1d65d631d87 | [
"MIT"
] | null | null | null | python/loanStreetClient.py | McGuire00/LoanStreet | 8a87e7de87e09e2181cb8fd50f15d1d65d631d87 | [
"MIT"
] | null | null | null | python/loanStreetClient.py | McGuire00/LoanStreet | 8a87e7de87e09e2181cb8fd50f15d1d65d631d87 | [
"MIT"
] | null | null | null | import requests
# home page
# http://localhost:3000/
def get_home_page(link):
"""performs a GET request to the / endpoint """
# returns message: "Welcome"
get = requests.get(link)
print(get.text)
# get_info("http://localhost:3000/")
def get_all_loans(link):
""" performs a GET request to the /a... | 23.555556 | 85 | 0.667925 |
fb7b9d68d63444d6433a979e0b4ab9f5b4ec151e | 16,764 | py | Python | mcpi_e/minecraft.py | stoneskin/mcpi_e | 9c9bd1c1c20f8b117ecb97af9893f251237d2329 | [
"MIT"
] | 2 | 2020-05-23T18:20:34.000Z | 2021-10-09T09:09:13.000Z | mcpi_e/minecraft.py | stoneskin/mcpi_e | 9c9bd1c1c20f8b117ecb97af9893f251237d2329 | [
"MIT"
] | null | null | null | mcpi_e/minecraft.py | stoneskin/mcpi_e | 9c9bd1c1c20f8b117ecb97af9893f251237d2329 | [
"MIT"
] | 2 | 2021-03-07T10:40:23.000Z | 2021-11-07T14:36:40.000Z | from .connection import Connection
from .vec3 import Vec3
from .event import BlockEvent, ChatEvent, ProjectileEvent
from .entity import Entity
from .block import Block
import math
from .util import flatten
import sys
from .logger import *
import mcpi_e.settings as settings
""" Minecraft PI low level api v0.1_1
N... | 40.788321 | 205 | 0.617872 |
f7bdded42b6ce80fcb118efc440779f27dcd7ec2 | 1,488 | py | Python | tests/test_empty_repo.py | BB-Open/datenadler_rdf4j | b63df5292b99a0f49b455b6728246c59d7a8b0d7 | [
"MIT"
] | 2 | 2021-12-29T17:59:46.000Z | 2022-01-29T07:50:57.000Z | tests/test_empty_repo.py | BB-Open/datenadler_rdf4j | b63df5292b99a0f49b455b6728246c59d7a8b0d7 | [
"MIT"
] | null | null | null | tests/test_empty_repo.py | BB-Open/datenadler_rdf4j | b63df5292b99a0f49b455b6728246c59d7a8b0d7 | [
"MIT"
] | null | null | null | from http import HTTPStatus
from unittest import TestCase
from pyrdf4j.api_graph import APIGraph
from pyrdf4j.errors import URINotReachable
from pyrdf4j.rdf4j import RDF4J
from tests.constants import AUTH, RDF4J_BASE_TEST
class TestEmpty(TestCase):
def setUp(self):
self.rdf4j = RDF4J(RDF4J_BASE_TEST)
... | 33.818182 | 113 | 0.672715 |
21add1500c80472f2d12983dadb27d14be7b7fbd | 21,915 | py | Python | src/lib/model/networks/dla.py | jie311/TraDeS | 896491a159abe65f61c6ad05662cda6e28d137a6 | [
"MIT"
] | 475 | 2021-03-13T16:33:36.000Z | 2022-03-30T06:00:39.000Z | src/lib/model/networks/dla.py | jie311/TraDeS | 896491a159abe65f61c6ad05662cda6e28d137a6 | [
"MIT"
] | 50 | 2021-03-17T04:48:20.000Z | 2022-03-08T13:55:32.000Z | src/lib/model/networks/dla.py | jie311/TraDeS | 896491a159abe65f61c6ad05662cda6e28d137a6 | [
"MIT"
] | 98 | 2021-03-14T12:12:49.000Z | 2022-03-19T16:19:13.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import math
import logging
import numpy as np
from os.path import join
import torch
from torch import nn
import torch.nn.functional as F
import torch.utils.model_zoo as model_zoo
from .base_model im... | 34.620853 | 106 | 0.559115 |
6557955fd8e4636a144792b64b4cc0e636a5d7c0 | 1,462 | py | Python | WeatherStationSensorsReader/sensors/rainfall_sensor.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | WeatherStationSensorsReader/sensors/rainfall_sensor.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | WeatherStationSensorsReader/sensors/rainfall_sensor.py | weather-station-project/weather-station-sensors-reader | cda7902ee382248b41d14b9a2c0543817decbb4a | [
"MIT"
] | null | null | null | import logging
from gpiozero import Button
from health_check.health_check_file_manager import register_success_for_class_into_health_check_file
from sensors.sensor import Sensor
class RainfallSensor(Sensor):
"""Represents the sensor which measures rainfall"""
BUCKET_SIZE_IN_MM = 0.2794
def __init__(se... | 31.782609 | 110 | 0.690834 |
22d1234329d8dc4f29fe9fde42889fb6ec7a06d3 | 2,823 | py | Python | GunsApp/app.py | rabest265/GunViolence | dbe51d40fb959f624d482619549f6e21a80409d3 | [
"CNRI-Python",
"OML"
] | null | null | null | GunsApp/app.py | rabest265/GunViolence | dbe51d40fb959f624d482619549f6e21a80409d3 | [
"CNRI-Python",
"OML"
] | null | null | null | GunsApp/app.py | rabest265/GunViolence | dbe51d40fb959f624d482619549f6e21a80409d3 | [
"CNRI-Python",
"OML"
] | null | null | null | from flask import Flask, render_template, redirect, jsonify
from flask_pymongo import PyMongo
from datetime import datetime
import json
import os
# from bson.json_util import loads
# Create an instance of Flask
app = Flask(__name__)
# Use PyMongo to establish Mongo connection
MONGO_URI = os.environ.get('MONGO_URI')
i... | 26.138889 | 75 | 0.676585 |
e99f43bdc9b2e5bc8f245ccbff0d79feef5b358d | 6,076 | py | Python | 2021/python/day-05.py | tadhg-ohiggins/advent-of-code | d0f113955940e69cbe0953607f62862f8a8bb830 | [
"CC0-1.0"
] | 1 | 2021-12-04T18:09:44.000Z | 2021-12-04T18:09:44.000Z | 2021/python/day-05.py | tadhg-ohiggins/advent-of-code | d0f113955940e69cbe0953607f62862f8a8bb830 | [
"CC0-1.0"
] | null | null | null | 2021/python/day-05.py | tadhg-ohiggins/advent-of-code | d0f113955940e69cbe0953607f62862f8a8bb830 | [
"CC0-1.0"
] | null | null | null | from collections import Counter
from functools import partial
import aoc
from tadhg_utils import (
splitstrip,
splitstriplines,
lmap,
lconcat,
lcompact,
)
INPUT, TEST = aoc.get_inputs(__file__)
TA1 = 5
TA2 = 12
A1 = 6311
A2 = 19929
def parse_line(line):
coords = splitstrip(line, "->")
ra... | 27.493213 | 79 | 0.597597 |
150aefabe4df5271deca4e75545c64a03ae64d8c | 14,282 | py | Python | learning/pg_agent.py | arihant72600/DeepMimic | c8cda14662bfa23737c6c648507da66ac392314b | [
"MIT"
] | null | null | null | learning/pg_agent.py | arihant72600/DeepMimic | c8cda14662bfa23737c6c648507da66ac392314b | [
"MIT"
] | null | null | null | learning/pg_agent.py | arihant72600/DeepMimic | c8cda14662bfa23737c6c648507da66ac392314b | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
import torch
import torch.nn as nn
import torch.nn.functional as F
import copy
from learning.tf_agent import TFAgent
from learning.solvers.mpi_solver import MPISolver
import learning.tf_util as TFUtil
import learning.nets.net_builder as NetBuilder
from learning.tf_distributio... | 39.128767 | 139 | 0.658171 |
873fdbd0f5f40d1993f95429144f65c1f494c5d2 | 1,128 | py | Python | perceiver/tokenizer.py | felixyu7/perceiver-io-1 | 895f09e75e5a4b5e90dfef5d3a86ea26c2f48f4e | [
"Apache-2.0"
] | null | null | null | perceiver/tokenizer.py | felixyu7/perceiver-io-1 | 895f09e75e5a4b5e90dfef5d3a86ea26c2f48f4e | [
"Apache-2.0"
] | null | null | null | perceiver/tokenizer.py | felixyu7/perceiver-io-1 | 895f09e75e5a4b5e90dfef5d3a86ea26c2f48f4e | [
"Apache-2.0"
] | null | null | null | from typing import Iterable
from tokenizers import decoders, Tokenizer
from tokenizers.models import WordPiece
from tokenizers.normalizers import Normalizer, Sequence, Lowercase, StripAccents, NFD
from tokenizers.pre_tokenizers import Whitespace
from tokenizers.trainers import WordPieceTrainer
PAD_TOKEN = '[PAD]'
PA... | 27.512195 | 92 | 0.781915 |
077030d214f19b1bdeff2b6afe9b9fcaed2aefe0 | 1,756 | py | Python | differential_game_exp.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | 1 | 2021-09-03T16:33:12.000Z | 2021-09-03T16:33:12.000Z | differential_game_exp.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | null | null | null | differential_game_exp.py | Faiz/mapr2 | 30fb37e1807d47f3678b5cab80ac60c74c4e37f7 | [
"Apache-2.0"
] | null | null | null | from pgagent import PGAgent
from maci.environments.differential_game import DifferentialGame
import numpy as np
import tensorflow as tf
GAME_NAME = "ma_softq"
AGENT_NUM = 2
MOVING_WINDOW_LEN = 5 # 5 mini batches => 5 * T, 500 games.
def play_differential_game(alpha=0.001, beta=0.001, discount=0.9, num_agents=2, episo... | 39.909091 | 110 | 0.553531 |
a1551adfa9824ecb4452145e307ce8dfe0f2443b | 1,195 | py | Python | mini_lambda/__init__.py | semiversus/python-mini-lambda | 35ec4b6304b08ffd28939ffef7ead6b150dc1525 | [
"BSD-3-Clause"
] | null | null | null | mini_lambda/__init__.py | semiversus/python-mini-lambda | 35ec4b6304b08ffd28939ffef7ead6b150dc1525 | [
"BSD-3-Clause"
] | null | null | null | mini_lambda/__init__.py | semiversus/python-mini-lambda | 35ec4b6304b08ffd28939ffef7ead6b150dc1525 | [
"BSD-3-Clause"
] | null | null | null | from mini_lambda.utils_init import __remove_all_external_symbols, __get_all_submodules_symbols
__PACKAGE_NAME = 'mini_lambda'
__SUBMODULES_TO_EXPORT = ['base', 'generated', 'generated2', 'goodies', 'goodies_generated', 'main']
# TODO we could rather rely on a regexp mechanism
# (1) allow users to do
# import <pac... | 35.147059 | 114 | 0.774895 |
ff480f58b6b4d3a83998b31cad918cebee147fdc | 2,287 | py | Python | ravens/plot.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | 1 | 2022-03-20T19:03:02.000Z | 2022-03-20T19:03:02.000Z | ravens/plot.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | null | null | null | ravens/plot.py | YunchuZhang/Learning-to-use-different-tools-for-objects-rearrangement | 3759664cd77b5810834937c478a9a44ad36ac90c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Ravens Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.763889 | 74 | 0.675557 |
0c204e70cb10f2db4c018111a27532d82126da7d | 5,235 | py | Python | flask-sp/flask_sp/saml/metadata.py | ThePalaceProject/circulation-saml-test | 3c150e7d162b41c661ec99d70977b64ce90eb24b | [
"MIT"
] | null | null | null | flask-sp/flask_sp/saml/metadata.py | ThePalaceProject/circulation-saml-test | 3c150e7d162b41c661ec99d70977b64ce90eb24b | [
"MIT"
] | null | null | null | flask-sp/flask_sp/saml/metadata.py | ThePalaceProject/circulation-saml-test | 3c150e7d162b41c661ec99d70977b64ce90eb24b | [
"MIT"
] | null | null | null | import logging
import os
import click
from defusedxml.lxml import fromstring
from flask.cli import with_appcontext
from onelogin.saml2.constants import OneLogin_Saml2_Constants
from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser
from onelogin.saml2.utils import OneLogin_Saml2_Utils
from one... | 33.557692 | 120 | 0.714613 |
605b688b3056264f3939673855c721718b4004e9 | 251 | py | Python | grpc_benchmark/multiple_clients.py | mpetyx/python-rpc-frameworks-comparison | 5b69a5aef1f8ead2fb88e744b6b1787b27165898 | [
"MIT"
] | null | null | null | grpc_benchmark/multiple_clients.py | mpetyx/python-rpc-frameworks-comparison | 5b69a5aef1f8ead2fb88e744b6b1787b27165898 | [
"MIT"
] | null | null | null | grpc_benchmark/multiple_clients.py | mpetyx/python-rpc-frameworks-comparison | 5b69a5aef1f8ead2fb88e744b6b1787b27165898 | [
"MIT"
] | null | null | null | __author__ = 'mpetyx (Michael Petychakis)'
__version__ = "1.0.0"
__maintainer__ = "Michael Petychakis"
__email__ = "hello@apilama.com"
__status__ = "Production"
from client import Client
for number in range(1,100000):
Client().squareRoot(number) | 25.1 | 42 | 0.752988 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.