hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f779d1a50579fde9db8bc58276c16828fc7d24b5 | 184 | py | Python | apogee/factors/__init__.py | markdouthwaite/apogee | 2e8f58809b2af76137793215f4e7853b047d9183 | [
"MIT"
] | 4 | 2019-01-02T06:08:28.000Z | 2019-11-11T08:58:01.000Z | apogee/factors/__init__.py | markdouthwaite/Apogee | 2e8f58809b2af76137793215f4e7853b047d9183 | [
"MIT"
] | 3 | 2019-10-17T11:56:53.000Z | 2020-05-17T16:04:45.000Z | apogee/factors/__init__.py | markdouthwaite/apogee | 2e8f58809b2af76137793215f4e7853b047d9183 | [
"MIT"
] | null | null | null | """
The MIT License
Copyright (c) 2017-2020 Mark Douthwaite
"""
from .discrete import DiscreteFactor
from .set import FactorSet
__all__ = [
"FactorSet",
"DiscreteFactor",
]
| 13.142857 | 39 | 0.701087 |
from .discrete import DiscreteFactor
from .set import FactorSet
__all__ = [
"FactorSet",
"DiscreteFactor",
]
| true | true |
f779d22701ca8a48b53988db04f65de08e230e0f | 7,693 | py | Python | pyslobs/slobs/scene.py | UnkoMamire/PySLOBS | 31725558eac39f1125f32bf6955330e3907d170f | [
"MIT"
] | null | null | null | pyslobs/slobs/scene.py | UnkoMamire/PySLOBS | 31725558eac39f1125f32bf6955330e3907d170f | [
"MIT"
] | null | null | null | pyslobs/slobs/scene.py | UnkoMamire/PySLOBS | 31725558eac39f1125f32bf6955330e3907d170f | [
"MIT"
] | null | null | null | from typing import Optional, Any
from ..apibase import SlobsClass
from .scenenode import (
SceneNode,
)
from .factories import (
scenenode_factory,
sceneitem_factory,
sceneitemfolder_factory,
selection_factory,
source_factory,
register,
)
from .typedefs import ISceneNodeAddOptions, ISourceAd... | 36.287736 | 103 | 0.653711 | from typing import Optional, Any
from ..apibase import SlobsClass
from .scenenode import (
SceneNode,
)
from .factories import (
scenenode_factory,
sceneitem_factory,
sceneitemfolder_factory,
selection_factory,
source_factory,
register,
)
from .typedefs import ISceneNodeAddOptions, ISourceAd... | true | true |
f779d3ca1eeb6b657df17cbbfb4c643e5f51cd95 | 2,257 | py | Python | RobotArm/RobotArm.py | Sophic-Technical-Solutions/PublicStemProjects | d640cd4a4b0498519a99a04a56015096667be5ee | [
"Apache-2.0"
] | null | null | null | RobotArm/RobotArm.py | Sophic-Technical-Solutions/PublicStemProjects | d640cd4a4b0498519a99a04a56015096667be5ee | [
"Apache-2.0"
] | null | null | null | RobotArm/RobotArm.py | Sophic-Technical-Solutions/PublicStemProjects | d640cd4a4b0498519a99a04a56015096667be5ee | [
"Apache-2.0"
] | null | null | null | # Motor B controls Left-Right movement
# Motor C controls the height of arm
# Motor A controls the fingers
# Direction keys - to move the arm
# Space will open the claw
# Z will close the claw
# The light sensor will be configured to also close if a certain
# threshold is reached with an object being in front of it
... | 32.710145 | 100 | 0.717324 |
from __future__ import print_function from __future__ import division
import time import brickpi3 import sys import curses
BP = brickpi3.BrickPi3()
PORT_MOTOR_LATERAL = BP.PORT_B
PORT_MOTOR_VERTICAL = BP.PORT_C
PORT_MOTOR_CLAW = BP.PORT_A
stdscr = curses.initscr() curses.cbreak() stdscr.k... | true | true |
f779d3e1522099e1595d46591975498ebd65b434 | 6,592 | py | Python | pokedex/tests/test_lookup.py | OpulentOwl/pokedex | 66a4198bcfd3a03e2fe8482fc25e9c02ad3807ec | [
"MIT"
] | null | null | null | pokedex/tests/test_lookup.py | OpulentOwl/pokedex | 66a4198bcfd3a03e2fe8482fc25e9c02ad3807ec | [
"MIT"
] | null | null | null | pokedex/tests/test_lookup.py | OpulentOwl/pokedex | 66a4198bcfd3a03e2fe8482fc25e9c02ad3807ec | [
"MIT"
] | null | null | null | # Encoding: UTF-8
import os
import pytest
parametrize = pytest.mark.parametrize
@parametrize(
('input', 'table', 'id'),
[
# Simple lookups
(u'Eevee', 'pokemon_species', 133),
(u'Scratch', 'moves', 10),
(u'Master Ball', 'items', 1),
(u'normal', 'types', 1),
(u'... | 26.796748 | 73 | 0.633647 | import os
import pytest
parametrize = pytest.mark.parametrize
@parametrize(
('input', 'table', 'id'),
[
(u'Eevee', 'pokemon_species', 133),
(u'Scratch', 'moves', 10),
(u'Master Ball', 'items', 1),
(u'normal', 'types', 1),
(u'Run Away', 'abilities', 50),
... | true | true |
f779d41e4ac0475818fd7dfc805803974db19d8d | 1,093 | py | Python | dpctl/dptensor/__init__.py | adarshyoga/dpctl | 91a53bc6884aca8476157c3ea7e556c78d618aaf | [
"Apache-2.0"
] | null | null | null | dpctl/dptensor/__init__.py | adarshyoga/dpctl | 91a53bc6884aca8476157c3ea7e556c78d618aaf | [
"Apache-2.0"
] | null | null | null | dpctl/dptensor/__init__.py | adarshyoga/dpctl | 91a53bc6884aca8476157c3ea7e556c78d618aaf | [
"Apache-2.0"
] | null | null | null | # Data Parallel Control (dpCtl)
#
# Copyright 2020-2021 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.... | 35.258065 | 95 | 0.741995 |
import dpctl.dptensor.numpy_usm_shared
| true | true |
f779d4308f596199219a2cf01a2d0824d9923564 | 110 | py | Python | agda/pconsc/admin.py | NBISweden/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | 1 | 2015-03-09T22:43:39.000Z | 2015-03-09T22:43:39.000Z | agda/pconsc/admin.py | BILS/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | 1 | 2018-09-29T22:16:02.000Z | 2018-10-01T07:08:38.000Z | agda/pconsc/admin.py | BILS/agda | a67e94b127ee7f97419152d5abe6a770bcee4f07 | [
"MIT"
] | null | null | null | from django.contrib import admin
from pconsc.models import PredictallJob
admin.site.register(PredictallJob)
| 18.333333 | 39 | 0.845455 | from django.contrib import admin
from pconsc.models import PredictallJob
admin.site.register(PredictallJob)
| true | true |
f779d4e88dbdf67aa534e1399c8514e2ff7a7516 | 2,970 | py | Python | bin/builder.py | racker/docker-ubuntu-with-updates | e8b1d45719b4b929ade7f50a6822ca05eef2117b | [
"Apache-2.0"
] | 3 | 2015-02-27T20:38:07.000Z | 2019-04-27T15:12:12.000Z | bin/builder.py | racker/docker-ubuntu-with-updates | e8b1d45719b4b929ade7f50a6822ca05eef2117b | [
"Apache-2.0"
] | null | null | null | bin/builder.py | racker/docker-ubuntu-with-updates | e8b1d45719b4b929ade7f50a6822ca05eef2117b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from shipper import Shipper, run, command
import subprocess
# DOCKER_URL = "/var/run/docker.sock"
DOCKER_HOST = "localhost:4243"
DOCKER_URL = "tcp://127.0.0.1:4243"
s = Shipper([DOCKER_HOST])
def pmk(t):
rootdir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
ret... | 30 | 101 | 0.646465 |
import os
from shipper import Shipper, run, command
import subprocess
DOCKER_HOST = "localhost:4243"
DOCKER_URL = "tcp://127.0.0.1:4243"
s = Shipper([DOCKER_HOST])
def pmk(t):
rootdir = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
return os.path.join(rootdir, t)
def splitimage(name):
ret... | false | true |
f779d6d382340eee3e12f9801a92b71ea5190768 | 9,054 | py | Python | resources/db.py | JushBJJ/Rane | 02470486ddad0da89e138f302dce609d9770420d | [
"MIT"
] | null | null | null | resources/db.py | JushBJJ/Rane | 02470486ddad0da89e138f302dce609d9770420d | [
"MIT"
] | 1 | 2021-05-08T14:29:49.000Z | 2021-05-08T16:20:10.000Z | resources/db.py | JushBJJ/Rane | 02470486ddad0da89e138f302dce609d9770420d | [
"MIT"
] | 1 | 2021-04-14T12:08:26.000Z | 2021-04-14T12:08:26.000Z | from flask import current_app as app
from typing import Any
import resources.db_utils as db_utils
import sqlite3
import shutil
def get_user_by_id(data: dict) -> Any:
user_id = data["id"]
data = {
"filename": "accounts",
"folder": "server",
"table": "accounts",
"select": "user... | 27.688073 | 115 | 0.568699 | from flask import current_app as app
from typing import Any
import resources.db_utils as db_utils
import sqlite3
import shutil
def get_user_by_id(data: dict) -> Any:
user_id = data["id"]
data = {
"filename": "accounts",
"folder": "server",
"table": "accounts",
"select": "user... | true | true |
f779d7206f199a52a24127b5eaf48382c35f6789 | 739 | py | Python | bnw/xmpp/parser_basexmpp.py | l29ah/bnw | d03db025e12c96de42c9a7a4ede329d7c9d216c5 | [
"BSD-2-Clause"
] | 23 | 2015-01-14T13:22:37.000Z | 2022-01-11T11:38:43.000Z | bnw/xmpp/parser_basexmpp.py | l29ah/bnw | d03db025e12c96de42c9a7a4ede329d7c9d216c5 | [
"BSD-2-Clause"
] | 31 | 2015-01-27T19:57:45.000Z | 2018-10-04T22:35:22.000Z | bnw/xmpp/parser_basexmpp.py | l29ah/bnw | d03db025e12c96de42c9a7a4ede329d7c9d216c5 | [
"BSD-2-Clause"
] | 11 | 2015-01-02T10:29:14.000Z | 2018-06-28T13:09:53.000Z | # -*- coding: utf-8 -*-
from twisted.internet import defer
import re
import base
class BaseXmppParser(base.BaseParser):
def formatResult(self, request, result):
if not isinstance(result, dict):
return 'ERROR. Parser has got a strange shit from handler.'
ok = result.get('ok')
... | 26.392857 | 71 | 0.518268 |
from twisted.internet import defer
import re
import base
class BaseXmppParser(base.BaseParser):
def formatResult(self, request, result):
if not isinstance(result, dict):
return 'ERROR. Parser has got a strange shit from handler.'
ok = result.get('ok')
if ok is None:
... | true | true |
f779d74c10071704fefe0b8026d5d17a7592c4b9 | 629 | py | Python | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/tests/test_testing.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/tests/test_testing.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 21 | 2021-04-13T01:17:40.000Z | 2022-03-11T16:06:50.000Z | Funções Analíticas/Virtualenv/Lib/site-packages/matplotlib/tests/test_testing.py | Leonardo-Maciel/PSO_Maciel | 3939448da45716260f3ac7811afdd13be670f346 | [
"MIT"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import warnings
import pytest
from matplotlib.testing.decorators import check_figures_equal
@pytest.mark.xfail(
strict=True, reason="testing that warnings fail tests"
)
def test_warn_to_fail():
warnings.warn("This should fail the test")
@pytest.mark.parametrize("a", [1])
@check_figures_equal(extensions=["pn... | 25.16 | 70 | 0.72337 | import warnings
import pytest
from matplotlib.testing.decorators import check_figures_equal
@pytest.mark.xfail(
strict=True, reason="testing that warnings fail tests"
)
def test_warn_to_fail():
warnings.warn("This should fail the test")
@pytest.mark.parametrize("a", [1])
@check_figures_equal(extensions=["pn... | true | true |
f779d762fb3026afa8b33d2883b28177779c06f1 | 7,978 | py | Python | python/paddle/fluid/tests/unittests/test_dataloader_unkeep_order.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 17,085 | 2016-11-18T06:40:52.000Z | 2022-03-31T22:52:32.000Z | python/paddle/fluid/tests/unittests/test_dataloader_unkeep_order.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 29,769 | 2016-11-18T06:35:22.000Z | 2022-03-31T16:46:15.000Z | python/paddle/fluid/tests/unittests/test_dataloader_unkeep_order.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 4,641 | 2016-11-18T07:43:33.000Z | 2022-03-31T15:15:02.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 37.106977 | 80 | 0.540486 |
import paddle.fluid as fluid
import unittest
import numpy as np
import os
import six
from paddle.fluid.reader import keep_data_loader_order
keep_data_loader_order(False)
def create_reader(shape, batch_number):
def __impl__():
idx = 0
for _ in six.moves.range(batch_number):
yield np.o... | true | true |
f779d7e7c70a13f244003b35215ee87b867c4e9f | 215 | py | Python | tgbot/views/states.py | islambegk/ecoin_ru_bot | 17fc447a46390208e76c4e86aadb5f4e50e00a07 | [
"Unlicense"
] | null | null | null | tgbot/views/states.py | islambegk/ecoin_ru_bot | 17fc447a46390208e76c4e86aadb5f4e50e00a07 | [
"Unlicense"
] | null | null | null | tgbot/views/states.py | islambegk/ecoin_ru_bot | 17fc447a46390208e76c4e86aadb5f4e50e00a07 | [
"Unlicense"
] | null | null | null | from aiogram.dispatcher.filters.state import StatesGroup, State
class MenuSG(StatesGroup):
main = State()
about = State()
contacts = State()
materials = State()
faq = State()
ask = State()
| 19.545455 | 63 | 0.646512 | from aiogram.dispatcher.filters.state import StatesGroup, State
class MenuSG(StatesGroup):
main = State()
about = State()
contacts = State()
materials = State()
faq = State()
ask = State()
| true | true |
f779d7ec2c32acf3e90ffee40b538c64aa9c36a8 | 5,080 | py | Python | openGaussBase/testcase/SECURITY/PRIVATEGRANT/Opengauss_Function_Security_Privategrant_Case0002.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PRIVATEGRANT/Opengauss_Function_Security_Privategrant_Case0002.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SECURITY/PRIVATEGRANT/Opengauss_Function_Security_Privategrant_Case0002.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 46.605505 | 140 | 0.628346 | import os
import sys
import unittest
from yat.test import Node
from yat.test import macro
from testcase.utils.CommonSH import *
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
logger = Logger()
class Privategrant(unittest.TestCase):
def setUp(self):
logger.info('---... | true | true |
f779d8d1fc3cb2fc944e90d441a3184c01c016ad | 377 | py | Python | driver/views.py | alexyvassili/news-driver | 77f2b6c00f6df8d31da6b00c851db0ddd7201132 | [
"MIT"
] | null | null | null | driver/views.py | alexyvassili/news-driver | 77f2b6c00f6df8d31da6b00c851db0ddd7201132 | [
"MIT"
] | null | null | null | driver/views.py | alexyvassili/news-driver | 77f2b6c00f6df8d31da6b00c851db0ddd7201132 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
from driver.mailoperator import get_new_mails
def index(request):
new_mails = get_new_mails()
template = loader.get_template('driver/index.html')
context = {
'new_mails': new_mails,
}
... | 26.928571 | 58 | 0.750663 | from django.shortcuts import render
from django.template import loader
from django.http import HttpResponse
from driver.mailoperator import get_new_mails
def index(request):
new_mails = get_new_mails()
template = loader.get_template('driver/index.html')
context = {
'new_mails': new_mails,
}
... | true | true |
f779daccf7a924987658ad7dd3fbc7be61524951 | 4,493 | py | Python | tests/tests/test_bootstrapping.py | 0lmi/integration | a7203bb5fcc261b21cee282815eee923fe11e2b0 | [
"Apache-2.0"
] | null | null | null | tests/tests/test_bootstrapping.py | 0lmi/integration | a7203bb5fcc261b21cee282815eee923fe11e2b0 | [
"Apache-2.0"
] | 66 | 2021-02-01T06:47:58.000Z | 2022-02-28T16:03:48.000Z | tests/tests/test_bootstrapping.py | alfrunes/integration | bb0027c4ea152b832cdd6cbc37c959df4870889d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Northern.tech AS
#
# 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... | 36.233871 | 111 | 0.630091 |
import time
import pytest
from .. import conftest
from ..common_setup import (
standard_setup_one_client,
standard_setup_one_client_bootstrapped,
)
from .common_update import common_update_procedure
from ..MenderAPI import devauth, logger
from .mendertesting import MenderTesting
class TestBootstrapping(Men... | true | true |
f779db79374acd5f5849d3214e8145147e3cb069 | 79,968 | py | Python | tests/block_tools.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | null | null | null | tests/block_tools.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | null | null | null | tests/block_tools.py | luzofex/melati-blockchain | bddc95ed3a8c5631488cd44a9e76b764c19b4568 | [
"Apache-2.0"
] | null | null | null | import copy
import logging
import os
import random
import shutil
import sys
import tempfile
import time
from argparse import Namespace
from dataclasses import replace
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Any
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
... | 43.579292 | 120 | 0.604567 | import copy
import logging
import os
import random
import shutil
import sys
import tempfile
import time
from argparse import Namespace
from dataclasses import replace
from pathlib import Path
from typing import Callable, Dict, List, Optional, Tuple, Any
from blspy import AugSchemeMPL, G1Element, G2Element, PrivateKey
... | true | true |
f779dc0311eb2094d56f8104c3940f1ae589ee36 | 397 | py | Python | kalachakra/kalachakra/wsgi.py | tony-mikhailov/Kalachakra | 7a46be7e75bad0500914e5a7c44662c6740ebaa2 | [
"MIT"
] | null | null | null | kalachakra/kalachakra/wsgi.py | tony-mikhailov/Kalachakra | 7a46be7e75bad0500914e5a7c44662c6740ebaa2 | [
"MIT"
] | 3 | 2021-03-19T01:19:04.000Z | 2021-06-04T22:44:35.000Z | kalachakra/kalachakra/wsgi.py | tony-mikhailov/Kalachakra | 7a46be7e75bad0500914e5a7c44662c6740ebaa2 | [
"MIT"
] | null | null | null | """
WSGI config for kalachakra project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'kalachakra.settings')
application = get_wsgi_application()
| true | true |
f779dc337540cc54a62a156c30cefce099de33b6 | 1,435 | py | Python | mlapp/MLAPP_CODE/MLAPP-C6-Code/bootstrapDemo.py | xishansnow/MLAPP | 2f30cd94fd852a3f66fe92a124f65722bd2af509 | [
"MIT"
] | null | null | null | mlapp/MLAPP_CODE/MLAPP-C6-Code/bootstrapDemo.py | xishansnow/MLAPP | 2f30cd94fd852a3f66fe92a124f65722bd2af509 | [
"MIT"
] | null | null | null | mlapp/MLAPP_CODE/MLAPP-C6-Code/bootstrapDemo.py | xishansnow/MLAPP | 2f30cd94fd852a3f66fe92a124f65722bd2af509 | [
"MIT"
] | null | null | null | import numpy as np
from unidrnd import unid_rnd
import matplotlib.pyplot as plt
from scipy import stats
plt.rcParams["figure.figsize"]=(10,15)
# 真实的模型参数值
theta = 0.7
# 采样的样本数量
n_samples = [10, 100]
x_label = ['(a)','(b)','(c)','(d)']
for index,n_sample in enumerate(n_samples):
B = 10000 # 重复试验的次数
... | 32.613636 | 120 | 0.596516 | import numpy as np
from unidrnd import unid_rnd
import matplotlib.pyplot as plt
from scipy import stats
plt.rcParams["figure.figsize"]=(10,15)
theta = 0.7
n_samples = [10, 100]
x_label = ['(a)','(b)','(c)','(d)']
for index,n_sample in enumerate(n_samples):
B = 10000 X = np.random.rand(n_sample) <... | true | true |
f779dce8e045233b1258b657a8ddd51046b717d4 | 709 | py | Python | python/nvstrings/tests/test_url.py | williamBlazing/cudf | 072785e24fd59b6f4eeaad3b54592a8c803ee96b | [
"Apache-2.0"
] | 2 | 2019-12-25T14:20:17.000Z | 2019-12-25T14:33:02.000Z | python/nvstrings/tests/test_url.py | CZZLEGEND/cudf | 5d2465d6738d00628673fffdc1fac51fad7ef9a7 | [
"Apache-2.0"
] | 17 | 2018-11-14T20:57:01.000Z | 2019-02-19T22:42:23.000Z | python/nvstrings/tests/test_url.py | CZZLEGEND/cudf | 5d2465d6738d00628673fffdc1fac51fad7ef9a7 | [
"Apache-2.0"
] | 1 | 2021-10-03T20:29:10.000Z | 2021-10-03T20:29:10.000Z | # Copyright (c) 2019, NVIDIA CORPORATION.
import urllib.parse
from utils import assert_eq
import nvstrings
urls1 = ["http://www.hellow.com", "/home/nvidia/nfs", "123.45 ~ABCDEF"]
urls2 = [
"http://www.hellow.com?k1=acc%C3%A9nted&k2=a%2F/b.c",
"%2Fhome%2fnfs",
"987%20ZYX",
]
def test_encode_url():
... | 21.484848 | 71 | 0.64598 |
import urllib.parse
from utils import assert_eq
import nvstrings
urls1 = ["http://www.hellow.com", "/home/nvidia/nfs", "123.45 ~ABCDEF"]
urls2 = [
"http://www.hellow.com?k1=acc%C3%A9nted&k2=a%2F/b.c",
"%2Fhome%2fnfs",
"987%20ZYX",
]
def test_encode_url():
s = nvstrings.to_device(urls1)
got = s... | true | true |
f779dd6b040d1da6574532a1fefe7d5f2da97758 | 755 | py | Python | build.py | NyamuKoong/plasmid | fa362251c74f15600203f9ef7106a170a5fbd2c3 | [
"MIT"
] | 1 | 2016-10-22T06:35:21.000Z | 2016-10-22T06:35:21.000Z | build.py | NyamuKoong/plasmid | fa362251c74f15600203f9ef7106a170a5fbd2c3 | [
"MIT"
] | null | null | null | build.py | NyamuKoong/plasmid | fa362251c74f15600203f9ef7106a170a5fbd2c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
import time
options = {
'l' : False, # Auto loop
'u' : False, # Uglify
}
if len(sys.argv) > 1:
for argv in sys.argv:
if argv in options:
options[argv] = True
def build():
os.system('coffee -b --compile --output js/ coffee/')
if options['u']:
os.chdir('./js')
... | 20.405405 | 86 | 0.584106 | import os
import sys
import time
options = {
'l' : False, 'u' : False, }
if len(sys.argv) > 1:
for argv in sys.argv:
if argv in options:
options[argv] = True
def build():
os.system('coffee -b --compile --output js/ coffee/')
if options['u']:
os.chdir('./js')
jses = [f for f in os.listdir('.') if os.pa... | true | true |
f779dec034ba3d417f2a89a60a3e3e7a3280b179 | 3,450 | py | Python | seahub/api2/endpoints/admin/group_libraries.py | jjzhang166/seahub | 8ced28759fc1e158196a7743eb149882451f9143 | [
"Apache-2.0"
] | null | null | null | seahub/api2/endpoints/admin/group_libraries.py | jjzhang166/seahub | 8ced28759fc1e158196a7743eb149882451f9143 | [
"Apache-2.0"
] | null | null | null | seahub/api2/endpoints/admin/group_libraries.py | jjzhang166/seahub | 8ced28759fc1e158196a7743eb149882451f9143 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012-2016 Seafile Ltd.
import logging
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
import seaserv
from seaserv im... | 31.944444 | 78 | 0.671884 | import logging
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAdminUser
from rest_framework.response import Response
from rest_framework.views import APIView
from rest_framework import status
import seaserv
from seaserv import seafile_api, ccnet_api
from seahu... | true | true |
f779dede5e85823e7e4264081b26a7fc8c12a2e4 | 2,852 | py | Python | users/migrations/0001_initial.py | babu-thomas/forum-site | 7502c00a3f9a2e801df6de6fd652e192af8cc460 | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | babu-thomas/forum-site | 7502c00a3f9a2e801df6de6fd652e192af8cc460 | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | babu-thomas/forum-site | 7502c00a3f9a2e801df6de6fd652e192af8cc460 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-01 09:28
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
import users.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
... | 63.377778 | 329 | 0.662693 |
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
import users.models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.Creat... | true | true |
f779df10d39818a71d00ef1a794315deadef0ecf | 11,880 | py | Python | data_utils/configure_data.py | Sunmingzhen/CogView | 6bc71b7cc07a209d258729674019f7d15a0ac4bb | [
"Apache-2.0"
] | null | null | null | data_utils/configure_data.py | Sunmingzhen/CogView | 6bc71b7cc07a209d258729674019f7d15a0ac4bb | [
"Apache-2.0"
] | null | null | null | data_utils/configure_data.py | Sunmingzhen/CogView | 6bc71b7cc07a209d258729674019f7d15a0ac4bb | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
'''
@File : configure_data.py
@Time : 2021/01/11 23:28:38
@Author : Ming Ding
@Contact : dm18@mails.tsinghua.edu.cn
'''
# here put the import lib
import os
import ipdb
import sys
import math
import random
from tqdm import tqdm
import copy
import numpy as np
import torch
impor... | 34.83871 | 131 | 0.583081 |
import os
import ipdb
import sys
import math
import random
from tqdm import tqdm
import copy
import numpy as np
import torch
import torch.nn.functional as F
from bisect import bisect_right
from .unified_tokenizer import get_tokenizer
from .datasets import get_dataset_by_type
from torch.utils import data
from .sample... | true | true |
f779dff20ef04cd4d9342d61bd2a38bfeecdc733 | 16,796 | py | Python | far_ws/src/follow_ahead_rl/old_script/plot_bag.py | Evoiis/Robot-Follow-Ahead-with-Obstacle-Avoidance | 72a407eafc7cdebf0639314c4f4ad0dd6902e6e8 | [
"Unlicense"
] | null | null | null | far_ws/src/follow_ahead_rl/old_script/plot_bag.py | Evoiis/Robot-Follow-Ahead-with-Obstacle-Avoidance | 72a407eafc7cdebf0639314c4f4ad0dd6902e6e8 | [
"Unlicense"
] | 5 | 2021-03-26T01:30:13.000Z | 2021-04-22T22:19:03.000Z | far_ws/src/follow_ahead_rl/old_script/plot_bag.py | Evoiis/Robot-Follow-Ahead-with-Obstacle-Avoidance | 72a407eafc7cdebf0639314c4f4ad0dd6902e6e8 | [
"Unlicense"
] | 1 | 2021-05-05T00:57:43.000Z | 2021-05-05T00:57:43.000Z | #!/usr/bin/env python
import argparse
import copy
import traceback
from os import listdir
from os.path import isfile, join
#from cv_bridge import CvBridge
import math
import matplotlib.pyplot as plt
import pandas as pd
import random
# u
import numpy as np
import cv2 as cv
import rospy
# Brings in the SimpleAction... | 40.76699 | 251 | 0.707192 | import argparse
import copy
import traceback
from os import listdir
from os.path import isfile, join
import math
import matplotlib.pyplot as plt
import pandas as pd
import random
import numpy as np
import cv2 as cv
import rospy
import actionlib
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from sq... | true | true |
f779dffe4a635dcd48aa01cee5d7c17e297759b3 | 3,738 | py | Python | split_UI.py | gcp-lopo/PDFTools | f25be07f794125d4d13e5b36a4d983744db889a3 | [
"MIT"
] | 1 | 2020-07-27T03:22:10.000Z | 2020-07-27T03:22:10.000Z | split_UI.py | gcp-lopo/PDFTools | f25be07f794125d4d13e5b36a4d983744db889a3 | [
"MIT"
] | null | null | null | split_UI.py | gcp-lopo/PDFTools | f25be07f794125d4d13e5b36a4d983744db889a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\split_UI.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Split_Dialog(object):
def setupUi(self, Split_Dialog):
S... | 55.791045 | 113 | 0.734885 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Split_Dialog(object):
def setupUi(self, Split_Dialog):
Split_Dialog.setObjectName("Split_Dialog")
Split_Dialog.resize(611, 331)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Ignored, QtWidgets.QSizePolicy.Ignored)
size... | true | true |
f779e28e7ddc12c1b1e4fc448125eaa39ff3453e | 1,957 | py | Python | src/torch/utils/data/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 51 | 2020-01-26T23:32:57.000Z | 2022-03-20T14:49:57.000Z | src/torch/utils/data/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 2 | 2020-12-19T20:00:28.000Z | 2021-03-03T20:22:45.000Z | src/torch/utils/data/distributed.py | warcraft12321/Hyperfoods | b995cd7afe10fcbd338158c80f53ce637bfffc0c | [
"MIT"
] | 33 | 2020-02-18T16:15:48.000Z | 2022-03-24T15:12:05.000Z | import math
import torch
from . import Sampler
from torch.distributed import get_world_size, get_rank
class DistributedSampler(Sampler):
"""Sampler that restricts data loading to a subset of the dataset.
It is especially useful in conjunction with
:class:`torch.nn.parallel.DistributedDataParallel`. In su... | 33.169492 | 86 | 0.664793 | import math
import torch
from . import Sampler
from torch.distributed import get_world_size, get_rank
class DistributedSampler(Sampler):
def __init__(self, dataset, num_replicas=None, rank=None):
if num_replicas is None:
num_replicas = get_world_size()
if rank is None:
ran... | true | true |
f779e2d5309a3a92d841cdc0bd1ca90c456d7b09 | 42,510 | py | Python | comprehend/amazon/api.py | stockdillon/AMPED_MSU_Capstone | b31849a6d7e34f5de406c157b62a9e199ca49e03 | [
"ADSL"
] | 3 | 2018-04-05T22:56:29.000Z | 2021-07-02T23:43:51.000Z | comprehend/amazon/api.py | stockdillon/AMPED_MSU_Capstone | b31849a6d7e34f5de406c157b62a9e199ca49e03 | [
"ADSL"
] | 1 | 2017-07-17T10:47:24.000Z | 2017-07-17T10:53:09.000Z | comprehend/amazon/api.py | stockdillon/AMPED_MSU_Capstone | b31849a6d7e34f5de406c157b62a9e199ca49e03 | [
"ADSL"
] | 3 | 2018-01-08T16:18:14.000Z | 2020-03-04T17:52:57.000Z | # !/usr/bin/python
#
# Copyright (C) 2012 Yoav Aviram.
#
# 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 ... | 28.957766 | 111 | 0.585203 | import datetime
from itertools import islice
import bottlenose
from lxml import objectify, etree
import dateutil.parser
from decimal import Decimal
DOMAINS = {
'CA': 'ca',
'DE': 'de',
'ES': 'es',
'FR': 'fr',
'IN': 'in',
'IT': 'it',
'JP': 'co.jp',
'UK': 'co.uk',
'US': 'com',
'C... | true | true |
f779e45c87ee697763d4edbdc305778939ad9e58 | 1,007 | py | Python | rockleton-fortune/wsgi.py | MwanzanFelipe/rockleton-fortune | 581b34270d1e6f1db4359a07c8443a9db051d789 | [
"BSD-3-Clause"
] | null | null | null | rockleton-fortune/wsgi.py | MwanzanFelipe/rockleton-fortune | 581b34270d1e6f1db4359a07c8443a9db051d789 | [
"BSD-3-Clause"
] | null | null | null | rockleton-fortune/wsgi.py | MwanzanFelipe/rockleton-fortune | 581b34270d1e6f1db4359a07c8443a9db051d789 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 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 a... | 33.566667 | 78 | 0.774578 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "rockleton-fortune.settings")
application = get_wsgi_application()
| true | true |
f779e51ee6088b671da1bbd59094bf0833bd0d88 | 1,422 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/point_of_sale/models/res_partner.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/point_of_sale/models/res_partner.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/point_of_sale/models/res_partner.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
barcode = fields.Char(string='Barcode', help="BarCode", oldname='ean13')
pos_order_count = fields.Integer(
... | 40.628571 | 122 | 0.64557 | from odoo import api, fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
barcode = fields.Char(string='Barcode', help="BarCode", oldname='ean13')
pos_order_count = fields.Integer(
compute='_compute_pos_order',
help="The number of point of sale orders related to this c... | true | true |
f779e5be5b0c59538a7d4c7e13349c8922a09fe3 | 8,622 | py | Python | login/linepy/object.py | ZarifTurkey/TheneonS2-Selfbot | f8b827b55d04aac1aa0df57206867d727614e0e9 | [
"MIT"
] | 3 | 2020-11-08T10:13:55.000Z | 2020-11-13T12:19:54.000Z | login/linepy/object.py | ZarifTurkey/TheneonS2-Selfbot | f8b827b55d04aac1aa0df57206867d727614e0e9 | [
"MIT"
] | null | null | null | login/linepy/object.py | ZarifTurkey/TheneonS2-Selfbot | f8b827b55d04aac1aa0df57206867d727614e0e9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime
import json, time, ntpath
def loggedIn(func):
def checkLogin(*args, **kwargs):
if args[0].isLogin:
return func(*args, **kwargs)
else:
args[0].callback.other('You want to call the function, you must login to LINE')
ret... | 40.669811 | 138 | 0.544537 | from datetime import datetime
import json, time, ntpath
def loggedIn(func):
def checkLogin(*args, **kwargs):
if args[0].isLogin:
return func(*args, **kwargs)
else:
args[0].callback.other('You want to call the function, you must login to LINE')
return checkLogin
clas... | true | true |
f779e6c124fedd748359be76c39a2fa050d64bdc | 2,300 | py | Python | src/talker.py | GAVLab/ros_icm20948 | 0d6e444c09dc796672ea267819832ebc5a03da71 | [
"BSD-3-Clause"
] | 5 | 2021-04-01T07:47:46.000Z | 2022-03-29T02:10:06.000Z | src/talker.py | GAVLab/ros_icm20948 | 0d6e444c09dc796672ea267819832ebc5a03da71 | [
"BSD-3-Clause"
] | 1 | 2021-06-03T18:23:47.000Z | 2021-06-03T18:23:47.000Z | src/talker.py | GAVLab/ros_icm20948 | 0d6e444c09dc796672ea267819832ebc5a03da71 | [
"BSD-3-Clause"
] | 1 | 2021-06-14T17:46:48.000Z | 2021-06-14T17:46:48.000Z | #!/usr/bin/env python3
import rospy
import time
import sys
import board
import busio
from sensor_msgs.msg import MagneticField,Imu
from std_msgs.msg import Float64
import qwiic_icm20948
def icm20948_node():
# Initialize ROS node
raw_pub = rospy.Publisher('icm20948/raw', Imu, queue_size=10)
mag_pub = rosp... | 31.944444 | 105 | 0.615217 |
import rospy
import time
import sys
import board
import busio
from sensor_msgs.msg import MagneticField,Imu
from std_msgs.msg import Float64
import qwiic_icm20948
def icm20948_node():
raw_pub = rospy.Publisher('icm20948/raw', Imu, queue_size=10)
mag_pub = rospy.Publisher('icm20948/mag', MagneticField, qu... | true | true |
f779e88ed7b16da17351159b1390d5f411337953 | 17,777 | py | Python | lemur/plugins/lemur_acme/plugin.py | terraflubb/lemur | 9c69d323f910353295f8f73799dbdc9f25cb9ab5 | [
"Apache-2.0"
] | null | null | null | lemur/plugins/lemur_acme/plugin.py | terraflubb/lemur | 9c69d323f910353295f8f73799dbdc9f25cb9ab5 | [
"Apache-2.0"
] | 66 | 2021-11-10T17:41:41.000Z | 2022-03-28T16:57:03.000Z | lemur/plugins/lemur_acme/plugin.py | douglasc-nflx/lemur | 5ea0b959289896ce546b257ed7a74c5ecdb3e38d | [
"Apache-2.0"
] | null | null | null | """
.. module: lemur.plugins.lemur_acme.plugin
:platform: Unix
:synopsis: This module is responsible for communicating with an ACME CA.
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
Snippets from https://raw.githubusercontent.com/alex/let... | 37.823404 | 126 | 0.555718 |
from acme.errors import PollError, WildcardUnsupportedError
from acme.messages import Error as AcmeError
from botocore.exceptions import ClientError
from flask import current_app
from sentry_sdk import capture_exception
from lemur.authorizations import service as authorization_service
from lemur.common.utils import c... | true | true |
f779e93e3e795badd537f362eaaf0833d62f8b51 | 9,367 | py | Python | tests/ontarget/test_mpfexp.py | tempstabilizer2018group/compact_2012_mpfshell | 26867e3e201366174236d39441d6d113773bedad | [
"MIT"
] | 4 | 2018-09-09T01:37:43.000Z | 2019-04-22T08:44:15.000Z | tests/ontarget/test_mpfexp.py | tempstabilizer2018group/compact_2012_mpfshell | 26867e3e201366174236d39441d6d113773bedad | [
"MIT"
] | null | null | null | tests/ontarget/test_mpfexp.py | tempstabilizer2018group/compact_2012_mpfshell | 26867e3e201366174236d39441d6d113773bedad | [
"MIT"
] | null | null | null | ##
# The MIT License (MIT)
#
# Copyright (c) 2016 Stefan Wendler
#
# 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,... | 29 | 83 | 0.567524 |
import os
import pytest
from mp.mpfshell import RemoteIOError
@pytest.mark.usefixtures("mpsetup")
class TestMpfexp:
def __create_local_file(self, file, data=b""):
with open(file, "wb") as f:
f.write(data)
def test_directory_handling(self, mpfexp):
assert "/" == mpfexp.pwd()
... | true | true |
f779e9500162fd34f6101b29587cbfc61fb73f05 | 1,789 | py | Python | kornia/filters/laplacian.py | varunagrawal/kornia | b8fd8b6bce1707ea8a0b2fd5ba9498fe10d586b8 | [
"Apache-2.0"
] | null | null | null | kornia/filters/laplacian.py | varunagrawal/kornia | b8fd8b6bce1707ea8a0b2fd5ba9498fe10d586b8 | [
"Apache-2.0"
] | null | null | null | kornia/filters/laplacian.py | varunagrawal/kornia | b8fd8b6bce1707ea8a0b2fd5ba9498fe10d586b8 | [
"Apache-2.0"
] | null | null | null | from typing import Tuple
import torch
import torch.nn as nn
import kornia
from kornia.filters.kernels import get_laplacian_kernel2d
class Laplacian(nn.Module):
r"""Creates an operator that returns a tensor using a Laplacian filter.
The operator smooths the given tensor with a laplacian kernel by convolving... | 29.327869 | 79 | 0.623812 | from typing import Tuple
import torch
import torch.nn as nn
import kornia
from kornia.filters.kernels import get_laplacian_kernel2d
class Laplacian(nn.Module):
def __init__(self,
kernel_size: int, border_type: str = 'reflect') -> None:
super(Laplacian, self).__init__()
self.ker... | true | true |
f779eccb21033c44b2f5841ec044e50acf96c99c | 1,698 | py | Python | python/ml-arima-covid.py | ing-a-zepeda/covid19mexico | 9988a1e69f549ebc00cdf71fc9a9be696a371eea | [
"MIT"
] | null | null | null | python/ml-arima-covid.py | ing-a-zepeda/covid19mexico | 9988a1e69f549ebc00cdf71fc9a9be696a371eea | [
"MIT"
] | null | null | null | python/ml-arima-covid.py | ing-a-zepeda/covid19mexico | 9988a1e69f549ebc00cdf71fc9a9be696a371eea | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import lag_plot
from pandas import datetime
from statsmodels.tsa.arima_model import ARIMA
from sklearn.metrics import mean_squared_error
df = pd.read_csv("corona2.csv")
df.head(6)
plt.figure()
lag_plot(df['InfectadosDia'], lag... | 33.294118 | 126 | 0.746172 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import lag_plot
from pandas import datetime
from statsmodels.tsa.arima_model import ARIMA
from sklearn.metrics import mean_squared_error
df = pd.read_csv("corona2.csv")
df.head(6)
plt.figure()
lag_plot(df['InfectadosDia'], lag... | true | true |
f779ed979c3a12d8ee6b22a79fd6310008efac85 | 577 | py | Python | spikeinterface/sortingcomponents/clustering/method_list.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/clustering/method_list.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/sortingcomponents/clustering/method_list.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | from .dummy import DummyClustering
from .position import PositionClustering
from .sliding_hdbscan import SlidingHdbscanClustering
from .sliding_nn import SlidingNNClustering
from .position_and_pca import PositionAndPCAClustering
from .position_ptp_scaled import PositionPTPScaledClustering
clustering_methods = {
"... | 33.941176 | 60 | 0.828423 | from .dummy import DummyClustering
from .position import PositionClustering
from .sliding_hdbscan import SlidingHdbscanClustering
from .sliding_nn import SlidingNNClustering
from .position_and_pca import PositionAndPCAClustering
from .position_ptp_scaled import PositionPTPScaledClustering
clustering_methods = {
"... | true | true |
f779ede984b6e3926304220d7eae28502535e98e | 1,451 | py | Python | se/commands/print_toc.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | se/commands/print_toc.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | se/commands/print_toc.py | jggimi/tools | b4aa35f986b22ab1b92dae1e0bfad9c4d94b6cf7 | [
"CC0-1.0"
] | null | null | null | """
This module implements the `se print_toc` command.
"""
import argparse
import se
from se.se_epub import SeEpub
def print_toc() -> int:
"""
Entry point for `se print-toc`
The meat of this function is broken out into the generate_toc.py module for readability
and maintainability.
"""
parser = argparse.Arg... | 29.02 | 137 | 0.725706 |
import argparse
import se
from se.se_epub import SeEpub
def print_toc() -> int:
parser = argparse.ArgumentParser(description="Build a table of contents for an SE source directory and print to stdout.")
parser.add_argument("-i", "--in-place", action="store_true", help="overwrite the existing toc.xhtml file instea... | true | true |
f779ee8467ea3df6680b515eeeb6f269508e7348 | 24,053 | py | Python | fbcrawl/items.py | ahmad-rzk/fbcrawl | c2adacf60abbc7fd50ca447942f157ab6955f60e | [
"Apache-2.0"
] | null | null | null | fbcrawl/items.py | ahmad-rzk/fbcrawl | c2adacf60abbc7fd50ca447942f157ab6955f60e | [
"Apache-2.0"
] | 1 | 2019-05-13T11:43:34.000Z | 2019-05-13T11:43:34.000Z | fbcrawl/items.py | ahmad-rzk/fbcrawl | c2adacf60abbc7fd50ca447942f157ab6955f60e | [
"Apache-2.0"
] | 1 | 2020-05-20T11:06:37.000Z | 2020-05-20T11:06:37.000Z | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://doc.scrapy.org/en/latest/topics/items.html
import scrapy
from scrapy.loader.processors import TakeFirst, Join, MapCompose
from datetime import datetime, timedelta
def comments_strip(string,loader_context):
... | 38.795161 | 149 | 0.464225 |
import scrapy
from scrapy.loader.processors import TakeFirst, Join, MapCompose
from datetime import datetime, timedelta
def comments_strip(string,loader_context):
lang = loader_context['lang']
if lang == 'it':
if string[0].rfind('Commenta') != -1:
return
else:
return s... | true | true |
f779eea6e432620100a4e3d31569695f19c56dc7 | 1,693 | py | Python | api4jenkins/view.py | pquentin/api4jenkins | b8d2904358de14a520a8a50d93d81168543aa7e8 | [
"Apache-2.0"
] | null | null | null | api4jenkins/view.py | pquentin/api4jenkins | b8d2904358de14a520a8a50d93d81168543aa7e8 | [
"Apache-2.0"
] | null | null | null | api4jenkins/view.py | pquentin/api4jenkins | b8d2904358de14a520a8a50d93d81168543aa7e8 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from .item import Item
from .mix import ConfigurationMixIn, DeletionMixIn, DescriptionMixIn
class Views(Item):
'''
classdocs
'''
def __init__(self, owner):
'''
Constructor
'''
self.owner = owner
super().__init__(owner.jenkins, owner.url)
... | 26.453125 | 75 | 0.61075 |
from .item import Item
from .mix import ConfigurationMixIn, DeletionMixIn, DescriptionMixIn
class Views(Item):
def __init__(self, owner):
self.owner = owner
super().__init__(owner.jenkins, owner.url)
def get(self, name):
for item in self.api_json(tree='views[name,url]')['views']:
... | true | true |
f779f022e65d478d13abdd52f602e5cd205a7235 | 39,937 | py | Python | tests/components/automation/test_numeric_state.py | jasperro/core | 26d7b2164e8a971506790ae5af06f31abdf278b5 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/automation/test_numeric_state.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/automation/test_numeric_state.py | winterscar/core | 5a55d508791aae65f16396691d014c73fb2095f0 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """The tests for numeric state automation."""
from datetime import timedelta
from unittest.mock import patch
import pytest
import voluptuous as vol
import homeassistant.components.automation as automation
from homeassistant.components.automation import numeric_state
from homeassistant.core import Context
from homeass... | 32.155395 | 93 | 0.542154 | from datetime import timedelta
from unittest.mock import patch
import pytest
import voluptuous as vol
import homeassistant.components.automation as automation
from homeassistant.components.automation import numeric_state
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
impo... | true | true |
f779f097a997755f0a1c33a9ac4fa3dd9b94a67a | 21,492 | py | Python | src/sagemaker/predictor.py | anirudh2290/sagemaker-python-sdk | 5b15f3006efe90fbba43da7841ff5f0ad790a78e | [
"Apache-2.0"
] | null | null | null | src/sagemaker/predictor.py | anirudh2290/sagemaker-python-sdk | 5b15f3006efe90fbba43da7841ff5f0ad790a78e | [
"Apache-2.0"
] | 1 | 2019-04-23T19:32:17.000Z | 2019-04-23T19:32:17.000Z | src/sagemaker/predictor.py | anirudh2290/sagemaker-python-sdk | 5b15f3006efe90fbba43da7841ff5f0ad790a78e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 43.156627 | 100 | 0.658059 | from __future__ import print_function, absolute_import
from sagemaker.deprecations import (
deprecated_class,
deprecated_deserialize,
deprecated_serialize,
removed_kwargs,
renamed_kwargs,
renamed_warning,
)
from sagemaker.deserializers import ( BytesDeserializer,
CSVDeserializer,
J... | true | true |
f779f0ccc4ad8d3073242cc47b53aa38c4f22526 | 226 | py | Python | pook/__init__.py | Megarushing/pook | 0f2dfe017c2524acc1dfe0df043840d2826fc8ca | [
"MIT"
] | null | null | null | pook/__init__.py | Megarushing/pook | 0f2dfe017c2524acc1dfe0df043840d2826fc8ca | [
"MIT"
] | null | null | null | pook/__init__.py | Megarushing/pook | 0f2dfe017c2524acc1dfe0df043840d2826fc8ca | [
"MIT"
] | null | null | null | from .api import * # noqa
from .api import __all__ as api_exports
# Delegate to API export
__all__ = api_exports
# Package metadata
__author__ = 'Tomas Aparicio'
__license__ = 'MIT'
# Current version
__version__ = '1.0.1'
| 17.384615 | 39 | 0.738938 | from .api import * from .api import __all__ as api_exports
__all__ = api_exports
__author__ = 'Tomas Aparicio'
__license__ = 'MIT'
__version__ = '1.0.1'
| true | true |
f779f0f44df0285c6822108744ca2869863672f2 | 1,042 | py | Python | blazar/policies/__init__.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 1 | 2022-02-22T11:34:45.000Z | 2022-02-22T11:34:45.000Z | blazar/policies/__init__.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 19 | 2017-05-23T21:34:09.000Z | 2022-02-21T19:15:29.000Z | blazar/policies/__init__.py | 4sarathbabu/blazar | 16ed6ad588e3508d1436aa3b2f1aae4ed5f4928b | [
"Apache-2.0"
] | 4 | 2018-08-20T19:39:02.000Z | 2022-02-22T11:36:39.000Z | # 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
# d... | 32.5625 | 78 | 0.723608 |
import itertools
from blazar.policies import base
from blazar.policies import devices
from blazar.policies import floatingips
from blazar.policies import leases
from blazar.policies import networks
from blazar.policies import oshosts
def list_rules():
return itertools.chain(
base.list_rules(),
l... | true | true |
f779f23ad18acc477c98813d09493b8ffcb4d3fe | 6,308 | py | Python | tests/testclasses.py | samv/normalize | fcb92074122cb89a434c3509f015c1978cbe4c9d | [
"MIT"
] | null | null | null | tests/testclasses.py | samv/normalize | fcb92074122cb89a434c3509f015c1978cbe4c9d | [
"MIT"
] | null | null | null | tests/testclasses.py | samv/normalize | fcb92074122cb89a434c3509f015c1978cbe4c9d | [
"MIT"
] | null | null | null | #
# This file is a part of the normalize python library
#
# normalize is free software: you can redistribute it and/or modify
# it under the terms of the MIT License.
#
# normalize is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FI... | 26.504202 | 71 | 0.626506 |
import copy
from datetime import datetime
import types
from normalize import RecordList
from normalize.coll import list_of
from normalize.record import Record
from normalize.record.json import JsonRecordList
from normalize.property import Property
from normalize.property import SafeProperty
from normalize.property.co... | true | true |
f779f28f2a630f3e277c38f9232dd6f24f2e5c17 | 10,728 | py | Python | neutron/api/rpc/handlers/resources_rpc.py | igor-toga/local-snat | 7adfe5668d309ff56350acee0d0b986e670abe7c | [
"Apache-2.0"
] | null | null | null | neutron/api/rpc/handlers/resources_rpc.py | igor-toga/local-snat | 7adfe5668d309ff56350acee0d0b986e670abe7c | [
"Apache-2.0"
] | null | null | null | neutron/api/rpc/handlers/resources_rpc.py | igor-toga/local-snat | 7adfe5668d309ff56350acee0d0b986e670abe7c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Mellanox Technologies, Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 40.179775 | 79 | 0.678878 |
import collections
from neutron_lib import exceptions
from oslo_log import helpers as log_helpers
import oslo_messaging
from neutron._i18n import _
from neutron.api.rpc.callbacks.consumer import registry as cons_registry
from neutron.api.rpc.callbacks.producer import registry as prod_registry
from neutron.api.rpc.ca... | true | true |
f779f2ac7818c640859234068880f982f852c12c | 71,185 | py | Python | ppci/arch/x86_64/instructions.py | kl4w3i/ppci | f3be0d4ebc1ac57907fd9c21e886ab70b2805c21 | [
"BSD-2-Clause"
] | 161 | 2020-05-31T03:29:42.000Z | 2022-03-07T08:36:19.000Z | ppci/arch/x86_64/instructions.py | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 74 | 2020-05-26T18:05:48.000Z | 2021-02-13T21:55:39.000Z | ppci/arch/x86_64/instructions.py | pfalcon/ppci | ea72967c8984757b4665a2fb0db095f32687eabf | [
"BSD-2-Clause"
] | 19 | 2020-05-27T19:22:11.000Z | 2022-02-17T18:53:52.000Z | """ X86 target descriptions and encodings.
See for a reference: http://ref.x86asm.net/coder64.html
"""
from ..generic_instructions import Label, RegisterUseDef
from ..isa import Isa
from ..encoding import Instruction, Operand, Syntax, Constructor, Relocation
from .. import effects
from ...utils.bitfun import wrap_neg... | 27.806641 | 79 | 0.62412 |
from ..generic_instructions import Label, RegisterUseDef
from ..isa import Isa
from ..encoding import Instruction, Operand, Syntax, Constructor, Relocation
from .. import effects
from ...utils.bitfun import wrap_negative
from ..token import Token, u8, u16, u32, u64, bit_range, bit
from .registers import rcx, al, cl, r... | true | true |
f779f36daef92c6aca4c0e8b1d80a3eb87bcfdbc | 15,083 | py | Python | test/torchaudio_unittest/librosa_compatibility_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | 1 | 2021-04-20T09:04:24.000Z | 2021-04-20T09:04:24.000Z | test/torchaudio_unittest/librosa_compatibility_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | null | null | null | test/torchaudio_unittest/librosa_compatibility_test.py | adefossez/audio | 19fc580da97baf179395bb257647c5c25b993e42 | [
"BSD-2-Clause"
] | 1 | 2019-09-11T08:27:18.000Z | 2019-09-11T08:27:18.000Z | """Test suites for numerical compatibility with librosa"""
import os
import unittest
from distutils.version import StrictVersion
import torch
import torchaudio
import torchaudio.functional as F
from torchaudio._internal.module_utils import is_module_available
LIBROSA_AVAILABLE = is_module_available('librosa')
if LIB... | 43.466859 | 118 | 0.640456 | import os
import unittest
from distutils.version import StrictVersion
import torch
import torchaudio
import torchaudio.functional as F
from torchaudio._internal.module_utils import is_module_available
LIBROSA_AVAILABLE = is_module_available('librosa')
if LIBROSA_AVAILABLE:
import numpy as np
import librosa
... | true | true |
f779f495e667a882be0443bcbe69c3e1720a54d2 | 4,021 | py | Python | src/sentry/db/mixin.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | src/sentry/db/mixin.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/db/mixin.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import six
from django.db import transaction
from uuid import uuid4
from sentry.models import OrganizationOption
logger = logging.getLogger("sentry.deletions")
def delete_pending_deletion_option(instance, **kwargs):
if hasattr(instance, "delete_pending_del... | 32.168 | 91 | 0.608058 | from __future__ import absolute_import
import logging
import six
from django.db import transaction
from uuid import uuid4
from sentry.models import OrganizationOption
logger = logging.getLogger("sentry.deletions")
def delete_pending_deletion_option(instance, **kwargs):
if hasattr(instance, "delete_pending_del... | true | true |
f779f4a79b013bea67fbc7cc75e7514051769bac | 1,571 | py | Python | KNOWNALGO/W03/W0301.py | F35H/RandFunc | 58868e65389447237013024cf49124d5f1da3a8e | [
"MIT"
] | null | null | null | KNOWNALGO/W03/W0301.py | F35H/RandFunc | 58868e65389447237013024cf49124d5f1da3a8e | [
"MIT"
] | null | null | null | KNOWNALGO/W03/W0301.py | F35H/RandFunc | 58868e65389447237013024cf49124d5f1da3a8e | [
"MIT"
] | null | null | null | import time
from os import system
from statistics import stdev
from statistics import variance
import matplotlib as mpl
import matplotlib.pyplot as plt
import W0302
from W0303 import seedList
if __name__ == "__main__":
system("cls")
tStr = str( time.time() )
t = int( tStr[-4:-2])
MD... | 24.936508 | 57 | 0.578612 | import time
from os import system
from statistics import stdev
from statistics import variance
import matplotlib as mpl
import matplotlib.pyplot as plt
import W0302
from W0303 import seedList
if __name__ == "__main__":
system("cls")
tStr = str( time.time() )
t = int( tStr[-4:-2])
MD... | true | true |
f779f545d8289039417d2b4cab731f56d422bd7c | 1,482 | py | Python | python_algorithms/union_find.py | BhanukaUOM/Data-Structures-and-Algoritms | 1b39c323ca181173988ac28ff0a13e2270fe8f25 | [
"MIT"
] | 6 | 2018-04-10T15:28:41.000Z | 2021-03-10T02:26:13.000Z | python_algorithms/union_find.py | BhanukaUOM/Data-Structures-and-Algoritms | 1b39c323ca181173988ac28ff0a13e2270fe8f25 | [
"MIT"
] | 1 | 2018-10-18T14:49:45.000Z | 2019-02-19T11:23:24.000Z | python_algorithms/union_find.py | BhanukaUOM/Data-Structures-and-Algoritms | 1b39c323ca181173988ac28ff0a13e2270fe8f25 | [
"MIT"
] | 18 | 2018-04-17T01:39:38.000Z | 2021-08-25T06:32:08.000Z | class UnionFind:
def __init__(self, values):
self.ids = []
self.weights = []
for i, v in enumerate(values):
self.ids.append(v)
def union(self, p, q):
pid = self.ids[p]
qid = self.ids[q]
for i, val in enumerate(self.ids):
if self.ids[i] =... | 21.478261 | 51 | 0.523617 | class UnionFind:
def __init__(self, values):
self.ids = []
self.weights = []
for i, v in enumerate(values):
self.ids.append(v)
def union(self, p, q):
pid = self.ids[p]
qid = self.ids[q]
for i, val in enumerate(self.ids):
if self.ids[i] =... | true | true |
f779f6bb1011add372e6945243f69353a1989b16 | 1,427 | py | Python | pypv/lib/nummath/deriv.py | TomLXXVI/pypv | df3dfba586bdec171e3fa9795b7bae48f76f83f2 | [
"MIT"
] | 3 | 2020-02-06T19:00:59.000Z | 2020-02-06T19:01:21.000Z | pypv/lib/nummath/deriv.py | TomLXXVI/pypv | df3dfba586bdec171e3fa9795b7bae48f76f83f2 | [
"MIT"
] | null | null | null | pypv/lib/nummath/deriv.py | TomLXXVI/pypv | df3dfba586bdec171e3fa9795b7bae48f76f83f2 | [
"MIT"
] | 1 | 2022-03-09T06:26:28.000Z | 2022-03-09T06:26:28.000Z | import numpy as np
class Deriv:
"""
Calculate the derivative with given order of the function f(t) at point t.
"""
def __init__(self, f, dt, o=1):
"""
Initialize the differentiation solver.
Params:
- f the name of the function object ('def f(t):...')
... | 34.804878 | 82 | 0.486335 | import numpy as np
class Deriv:
def __init__(self, f, dt, o=1):
self.f = f
self.dt = dt
self.o = o
self.co = np.array([
[-3.0, 4.0, -1.0, 0.0, 0.0, 0.0],
[2.0, -5.0, 4.0, -1.0, 0.0, 0.0],
[-5.0, 18.0, -24.0, 14.0, -3.0, 0.0],
... | true | true |
f779f6bc525fff099878046a17f64913b2588660 | 5,430 | py | Python | altair/utils/headless.py | hugovk/altair | a3c9f06790f7a8c5c7e2c98278d0f69e4630b5be | [
"BSD-3-Clause"
] | 1 | 2022-03-13T21:42:09.000Z | 2022-03-13T21:42:09.000Z | altair/utils/headless.py | RoyMachineLearning/altair | 74a765b373694776e63d224d99536975cc173810 | [
"BSD-3-Clause"
] | null | null | null | altair/utils/headless.py | RoyMachineLearning/altair | 74a765b373694776e63d224d99536975cc173810 | [
"BSD-3-Clause"
] | null | null | null | """
Utilities that use selenium + chrome headless to save figures
"""
import contextlib
import os
import tempfile
@contextlib.contextmanager
def temporary_filename(**kwargs):
"""Create and clean-up a temporary file
Arguments are the same as those passed to tempfile.mkstemp
We could use tempfile.NamedTe... | 31.754386 | 85 | 0.594107 |
import contextlib
import os
import tempfile
@contextlib.contextmanager
def temporary_filename(**kwargs):
filedescriptor, filename = tempfile.mkstemp(**kwargs)
os.close(filedescriptor)
try:
yield filename
finally:
if os.path.exists(filename):
os.remove(filename)
HTML_TEM... | true | true |
f779f78b5b3d9bc25c4c55520c140a520d1c44dc | 61,215 | py | Python | rllib/algorithms/algorithm_config.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/algorithm_config.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | rllib/algorithms/algorithm_config.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | import copy
import gym
from typing import (
Any,
Callable,
Dict,
Optional,
Type,
TYPE_CHECKING,
Union,
)
from ray.rllib.algorithms.callbacks import DefaultCallbacks
from ray.rllib.env.env_context import EnvContext
from ray.rllib.evaluation.collectors.sample_collector import SampleCollector
... | 48.854749 | 88 | 0.637801 | import copy
import gym
from typing import (
Any,
Callable,
Dict,
Optional,
Type,
TYPE_CHECKING,
Union,
)
from ray.rllib.algorithms.callbacks import DefaultCallbacks
from ray.rllib.env.env_context import EnvContext
from ray.rllib.evaluation.collectors.sample_collector import SampleCollector
... | true | true |
f779f7f2d26a8be67b5b49c0fb529e7c2f45925d | 1,007 | py | Python | main.py | MartimChaves/glcm_sat_img | d56ddb41890f0e63840487ca71f070d62e23b698 | [
"MIT"
] | 2 | 2022-01-31T17:27:51.000Z | 2022-02-04T03:21:41.000Z | main.py | MartimChaves/glcm_sat_img | d56ddb41890f0e63840487ca71f070d62e23b698 | [
"MIT"
] | null | null | null | main.py | MartimChaves/glcm_sat_img | d56ddb41890f0e63840487ca71f070d62e23b698 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
import pickle
from SatImages import SatImage
import uvicorn
def load_models():
"""
load the models from disk
and put them in a dictionary
Returns:
dict: loaded models
"""
models = {
"knn": pickle.load(open("./model_weights/clf.bin", 'rb'))
}
p... | 24.560976 | 74 | 0.643496 | from fastapi import FastAPI
import pickle
from SatImages import SatImage
import uvicorn
def load_models():
models = {
"knn": pickle.load(open("./model_weights/clf.bin", 'rb'))
}
print("Models loaded from disk")
return models
def get_prediction(feats, clf):
pred = clf.predict(feats)[0] ... | true | true |
f779f7f3bf0efc2e3e65ce82701d1d153f7b0162 | 18,297 | py | Python | fileio/lis.py | adrianopls/GRIPy-X | 21c7fa1f32f8dbb0a5dff93c2bac5acf1f9181ca | [
"Apache-2.0"
] | 1 | 2019-11-08T13:18:14.000Z | 2019-11-08T13:18:14.000Z | fileio/lis.py | adrianopls/GRIPy-X | 21c7fa1f32f8dbb0a5dff93c2bac5acf1f9181ca | [
"Apache-2.0"
] | null | null | null | fileio/lis.py | adrianopls/GRIPy-X | 21c7fa1f32f8dbb0a5dff93c2bac5acf1f9181ca | [
"Apache-2.0"
] | null | null | null | import os
import struct
from collections import OrderedDict
from pathlib import PurePath
import numpy as np
import app
from fileio.tif import TIFFile
PRA = {
"Physical Record Type": (1, 1),
"Checksum Type": (2, 2),
"File Number Presence": (5, 1),
"Record Number Presence": (6, 1),
"Parity Error":... | 39.179872 | 140 | 0.43089 | import os
import struct
from collections import OrderedDict
from pathlib import PurePath
import numpy as np
import app
from fileio.tif import TIFFile
PRA = {
"Physical Record Type": (1, 1),
"Checksum Type": (2, 2),
"File Number Presence": (5, 1),
"Record Number Presence": (6, 1),
"Parity Error":... | true | true |
f779f85063064dc8a3658fa7ea858623706eecd9 | 111 | py | Python | Example5_Optimisation.py | benjaminirving/Mesh-Silhouette-Projection | efdc3ac9adb20da3d15f14f0b63bcd359c1ecc14 | [
"BSD-3-Clause"
] | 7 | 2018-05-10T14:58:50.000Z | 2021-11-14T18:16:24.000Z | Example5_Optimisation.py | benjaminirving/Mesh-Silhouette-Projection | efdc3ac9adb20da3d15f14f0b63bcd359c1ecc14 | [
"BSD-3-Clause"
] | null | null | null | Example5_Optimisation.py | benjaminirving/Mesh-Silhouette-Projection | efdc3ac9adb20da3d15f14f0b63bcd359c1ecc14 | [
"BSD-3-Clause"
] | 4 | 2016-01-03T05:50:27.000Z | 2018-06-27T14:33:11.000Z | #Real data cannot be provided for due to patient privacy. We will post a suitable demo example at some point.
| 55.5 | 110 | 0.783784 | true | true | |
f779f8cce831c01cdfb2bccd8246b7d46b259601 | 29,315 | py | Python | mi/dataset/parser/test/test_velpt_ab.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/test/test_velpt_ab.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/parser/test/test_velpt_ab.py | ronkyo/mi-dataset | 5ee2d3a5b66c17500e5f7f1b3e4ba7a996a34c45 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_velpt_ab
@file mi-dataset/mi/dataset/parser/test/test_velpt_ab_dcl.py
@author Chris Goodrich
@brief Test code for the velpt_ab parser
"""
__author__ = 'Chris Goodrich'
from mi.logging import log
import os
import re
from nose.plugins.attrib import attr
... | 40.942737 | 120 | 0.62248 |
__author__ = 'Chris Goodrich'
from mi.logging import log
import os
import re
from nose.plugins.attrib import attr
from mi.core.exceptions import ConfigurationException
from mi.dataset.test.test_parser import ParserUnitTestCase
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.parser.v... | true | true |
f779f96f017543a67a7e06e95e9d16184ff710de | 2,754 | py | Python | tests/models/torchvision_models/faster_rcnn/test_show_results.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | null | null | null | tests/models/torchvision_models/faster_rcnn/test_show_results.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | null | null | null | tests/models/torchvision_models/faster_rcnn/test_show_results.py | bluseking/-first-agnostic-computer-vision-framework-to-offer-a-curated-collection-with-hundreds-of-high-qualit | 2d91eacfab7fcaf09c93352f1e7816ccb2c252b9 | [
"Apache-2.0"
] | 1 | 2021-05-29T12:21:37.000Z | 2021-05-29T12:21:37.000Z | import pytest
from icevision.all import *
@pytest.fixture(scope="session")
def fake_faster_rcnn_model():
class FakeFasterRCNNModel(nn.Module):
def __init__(self):
super().__init__()
# hack for the function `model_device` to work
self.layer = nn.Linear(1, 1)
def... | 30.263736 | 82 | 0.64016 | import pytest
from icevision.all import *
@pytest.fixture(scope="session")
def fake_faster_rcnn_model():
class FakeFasterRCNNModel(nn.Module):
def __init__(self):
super().__init__()
self.layer = nn.Linear(1, 1)
def forward(self, *args, **kwargs):
re... | true | true |
f779fa3304f9bd27d4439745ceebde721533c8d1 | 1,962 | py | Python | base/site-packages/mobileadmin/templatetags/mobile_admin_modify.py | edisonlz/fastor | 342078a18363ac41d3c6b1ab29dbdd44fdb0b7b3 | [
"Apache-2.0"
] | 285 | 2019-12-23T09:50:21.000Z | 2021-12-08T09:08:49.000Z | mobileadmin/templatetags/mobile_admin_modify.py | jezdez-archive/django-mobileadmin | 4d5874916ecca91610b9fbdf3c50b34c2567b83e | [
"BSD-3-Clause"
] | null | null | null | mobileadmin/templatetags/mobile_admin_modify.py | jezdez-archive/django-mobileadmin | 4d5874916ecca91610b9fbdf3c50b34c2567b83e | [
"BSD-3-Clause"
] | 9 | 2019-12-23T12:59:25.000Z | 2022-03-15T05:12:11.000Z | import re
from django import template
from django.template.loader import render_to_string
register = template.Library()
admin_re = re.compile(r'^admin\/')
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the a... | 40.040816 | 128 | 0.727319 | import re
from django import template
from django.template.loader import render_to_string
register = template.Library()
admin_re = re.compile(r'^admin\/')
def prepopulated_fields_js(context):
prepopulated_fields = []
if context['add'] and 'adminform' in context:
prepopulated_fields.extend(context['adm... | true | true |
f779faa71c05ada681d20db9e8861792ed556c52 | 7,616 | py | Python | benchmarking/experiments/pos_finetuning.py | ltgoslo/norBERT | d75d5c12d9b7f9cc11c65757f2228b7e6070b69b | [
"CC0-1.0"
] | 19 | 2021-01-18T13:51:08.000Z | 2022-03-05T07:32:26.000Z | benchmarking/experiments/pos_finetuning.py | ltgoslo/norBERT | d75d5c12d9b7f9cc11c65757f2228b7e6070b69b | [
"CC0-1.0"
] | 2 | 2021-02-05T16:09:44.000Z | 2021-06-16T18:56:47.000Z | benchmarking/experiments/pos_finetuning.py | ltgoslo/norBERT | d75d5c12d9b7f9cc11c65757f2228b7e6070b69b | [
"CC0-1.0"
] | 1 | 2021-04-29T20:26:55.000Z | 2021-04-29T20:26:55.000Z | #!/bin/env python3
import argparse
import numpy as np
import pandas as pd
import data_preparation.data_preparation_pos as data_preparation_pos
import fine_tuning
import utils.model_utils as model_utils
import utils.pos_utils as pos_utils
def test(training_lang,
test_lang,
split="test",
sho... | 40.296296 | 100 | 0.646928 |
import argparse
import numpy as np
import pandas as pd
import data_preparation.data_preparation_pos as data_preparation_pos
import fine_tuning
import utils.model_utils as model_utils
import utils.pos_utils as pos_utils
def test(training_lang,
test_lang,
split="test",
short_model_name="ltgo... | true | true |
f779fafb795e3b1741f65605f4703534ad9e6263 | 422 | py | Python | ex/kbi/validate.py | Supermaxman/covid19-vaccine-nlp | 83d3535cf479bca656af1cd5b08e5e8d3099061b | [
"Apache-2.0"
] | null | null | null | ex/kbi/validate.py | Supermaxman/covid19-vaccine-nlp | 83d3535cf479bca656af1cd5b08e5e8d3099061b | [
"Apache-2.0"
] | null | null | null | ex/kbi/validate.py | Supermaxman/covid19-vaccine-nlp | 83d3535cf479bca656af1cd5b08e5e8d3099061b | [
"Apache-2.0"
] | null | null | null |
from pytorch_lightning.utilities.cli import LightningCLI
from pytorch_gleam.data.datasets import KbiMisinfoStanceDataModule
from pytorch_gleam.modeling.models import KbiLanguageModel
if __name__ == '__main__':
cli = LightningCLI(
KbiLanguageModel,
KbiMisinfoStanceDataModule,
run=False,
subclass_mode_model=T... | 21.1 | 66 | 0.810427 |
from pytorch_lightning.utilities.cli import LightningCLI
from pytorch_gleam.data.datasets import KbiMisinfoStanceDataModule
from pytorch_gleam.modeling.models import KbiLanguageModel
if __name__ == '__main__':
cli = LightningCLI(
KbiLanguageModel,
KbiMisinfoStanceDataModule,
run=False,
subclass_mode_model=T... | true | true |
f779fb609304e7a5959fcb5d00f55a1cfcc718bd | 2,081 | py | Python | submarine-sdk/pysubmarine/submarine/ml/tensorflow/input/input.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 544 | 2019-10-29T02:35:31.000Z | 2022-03-31T21:22:44.000Z | submarine-sdk/pysubmarine/submarine/ml/tensorflow/input/input.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 545 | 2019-10-29T03:21:38.000Z | 2022-03-30T05:21:15.000Z | submarine-sdk/pysubmarine/submarine/ml/tensorflow/input/input.py | akizminet/submarine | aa6e865f27167a26050d8daa293e0b4f41a144b6 | [
"Apache-2.0"
] | 220 | 2019-10-29T05:14:03.000Z | 2022-03-28T07:29:30.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use t... | 35.271186 | 81 | 0.69678 |
import logging
import tensorflow as tf
logger = logging.getLogger(__name__)
AUTOTUNE = tf.data.experimental.AUTOTUNE
def libsvm_input_fn(
filepath,
batch_size=256,
num_epochs=3, perform_shuffle=False,
delimiter=" ",
**kwargs
):
def _input_fn():
def decode_libsvm(line):
... | true | true |
f779fbb27aaaa8f26f08c5dcbb9880f762ebd6ce | 10,401 | py | Python | flask_jwt_extended/config.py | 8451/flask-jwt-extended | 0fefc3d71a3a1fd573ea8a55eaa19fc65b33b817 | [
"MIT"
] | null | null | null | flask_jwt_extended/config.py | 8451/flask-jwt-extended | 0fefc3d71a3a1fd573ea8a55eaa19fc65b33b817 | [
"MIT"
] | null | null | null | flask_jwt_extended/config.py | 8451/flask-jwt-extended | 0fefc3d71a3a1fd573ea8a55eaa19fc65b33b817 | [
"MIT"
] | null | null | null | import datetime
from warnings import warn
from six import raise_from
# In Python 2.7 collections.abc is a part of the collections module.
try:
from collections.abc import Sequence, Set
except ImportError: # pragma: no cover
from collections import Sequence, Set
from flask import current_app
# Older versions... | 32.914557 | 88 | 0.653495 | import datetime
from warnings import warn
from six import raise_from
try:
from collections.abc import Sequence, Set
except ImportError: from collections import Sequence, Set
from flask import current_app
try:
from jwt.algorithms import requires_cryptography
except ImportError: requires_cryptography... | true | true |
f779fc39c47d97a9b03189a03657e3c4c31fc066 | 10,910 | py | Python | ravel/store/simulation_store.py | gigaquads/pybiz | e9654592246be06a777934e889e03407c5c1673e | [
"MIT"
] | 2 | 2021-02-26T15:30:44.000Z | 2021-05-22T14:06:17.000Z | ravel/store/simulation_store.py | gigaquads/ravel | e9654592246be06a777934e889e03407c5c1673e | [
"MIT"
] | null | null | null | ravel/store/simulation_store.py | gigaquads/ravel | e9654592246be06a777934e889e03407c5c1673e | [
"MIT"
] | null | null | null | import bisect
import time
import numpy as np
import BTrees.OOBTree
from copy import deepcopy
from collections import defaultdict, Counter
from threading import RLock
from functools import reduce
from typing import Text, Dict, List, Set, Tuple, Type
from BTrees.OOBTree import BTree
from appyratus.utils.dict_utils im... | 32.088235 | 80 | 0.532172 | import bisect
import time
import numpy as np
import BTrees.OOBTree
from copy import deepcopy
from collections import defaultdict, Counter
from threading import RLock
from functools import reduce
from typing import Text, Dict, List, Set, Tuple, Type
from BTrees.OOBTree import BTree
from appyratus.utils.dict_utils im... | true | true |
f779fccdb3b6acc40c0263877c817c0f59ad5415 | 9,220 | py | Python | homeassistant/components/hue/migration.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 1 | 2018-08-01T02:37:08.000Z | 2018-08-01T02:37:08.000Z | homeassistant/components/hue/migration.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 18 | 2021-11-24T06:26:13.000Z | 2022-03-31T06:25:15.000Z | homeassistant/components/hue/migration.py | PiotrMachowski/core | b9d7d0cae2ccd2d88e90e49cc09e154a27ed809b | [
"Apache-2.0"
] | 3 | 2021-11-14T13:29:33.000Z | 2021-12-27T17:05:22.000Z | """Various helpers to handle config entry and api schema migrations."""
import logging
from aiohue import HueBridgeV2
from aiohue.discovery import is_v2_bridge
from aiohue.v2.models.device import DeviceArchetypes
from aiohue.v2.models.resource import ResourceTypes
from homeassistant import core
from homeassistant.co... | 42.685185 | 96 | 0.597831 |
import logging
from aiohue import HueBridgeV2
from aiohue.discovery import is_v2_bridge
from aiohue.v2.models.device import DeviceArchetypes
from aiohue.v2.models.resource import ResourceTypes
from homeassistant import core
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant... | true | true |
f779fe340106843aed1e27ab375022cb6b0ebdc0 | 132 | py | Python | sourced/ml/utils/__init__.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 122 | 2017-11-15T15:19:19.000Z | 2022-03-23T13:36:34.000Z | sourced/ml/utils/__init__.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 176 | 2017-11-14T18:11:21.000Z | 2019-05-16T04:12:31.000Z | sourced/ml/utils/__init__.py | vmarkovtsev/ml | 22699b2f44901b84507d15e732003955024e6755 | [
"Apache-2.0"
] | 58 | 2017-11-14T18:07:08.000Z | 2021-01-28T11:41:21.000Z | # flake8: noqa
from sourced.ml.utils.bigartm import install_bigartm
from sourced.ml.utils.pickleable_logger import PickleableLogger
| 33 | 63 | 0.856061 | from sourced.ml.utils.bigartm import install_bigartm
from sourced.ml.utils.pickleable_logger import PickleableLogger
| true | true |
f779fe5511e9149ea0af803ae62b4969613d0963 | 53,820 | py | Python | scripts/build.py | vojtechjelinek/oppia | f6a6ad66dc6472af0f2c51945ed08da70029b1c8 | [
"Apache-2.0"
] | null | null | null | scripts/build.py | vojtechjelinek/oppia | f6a6ad66dc6472af0f2c51945ed08da70029b1c8 | [
"Apache-2.0"
] | null | null | null | scripts/build.py | vojtechjelinek/oppia | f6a6ad66dc6472af0f2c51945ed08da70029b1c8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.198835 | 80 | 0.688294 |
from __future__ import absolute_import
from __future__ import unicode_literals
import argparse
import collections
import fnmatch
import hashlib
import json
import os
import re
import shutil
import subprocess
import threading
from core import python_utils
from scripts import common
from scripts import servers
ASSET... | true | true |
f779fe6b26d6e105d18f0ab609d05552568bd1cc | 2,758 | py | Python | Experiments/xenobot/e.circle_push/cppn/objectives.py | liusida/EvoSoRo | 38ee81b2cecfd86e2d9e2c02dda7d41ced8c63a1 | [
"CC0-1.0"
] | 6 | 2020-02-03T22:17:40.000Z | 2021-09-13T02:46:40.000Z | Experiments/xenobot/e.circle_push/cppn/objectives.py | liusida/EvoSoRo | 38ee81b2cecfd86e2d9e2c02dda7d41ced8c63a1 | [
"CC0-1.0"
] | 16 | 2020-01-21T01:55:45.000Z | 2021-03-05T15:18:51.000Z | Experiments/xenobot/e.circle_push/cppn/objectives.py | liusida/EvoSoRo | 38ee81b2cecfd86e2d9e2c02dda7d41ced8c63a1 | [
"CC0-1.0"
] | 2 | 2020-01-24T23:11:44.000Z | 2020-03-23T18:12:09.000Z | from tools.utilities import xml_format
class ObjectiveDict(dict):
"""A dictionary describing the objectives for optimization. See self.add_objective()."""
def __init__(self):
super(ObjectiveDict, self).__init__()
self.max_rank = 0
def add_objective(self, name, maximize, tag, meta_func=No... | 47.551724 | 118 | 0.565627 | from tools.utilities import xml_format
class ObjectiveDict(dict):
def __init__(self):
super(ObjectiveDict, self).__init__()
self.max_rank = 0
def add_objective(self, name, maximize, tag, meta_func=None, node_func=None, output_node_name=None):
curr_rank = self.max_rank
... | true | true |
f779ff9f461a3725020db1c1559eb01768c6cf30 | 360 | py | Python | sketch/models/MSSliceLayer.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | 2 | 2018-10-22T12:43:51.000Z | 2018-12-02T02:41:55.000Z | sketch/models/MSSliceLayer.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | null | null | null | sketch/models/MSSliceLayer.py | shrredd/sketch | eebcd5077ae355f914bc77ac44d06410f9caa132 | [
"MIT",
"Unlicense"
] | null | null | null | from sketch.models import MSLayer
class MSSliceLayer(MSLayer):
"""
Subclass of MSLayer representing a slice in the document.
Although it may have a style attribute, this is never used.
MSSliceLayer has —like MSLayer— a frame property that is an
MSRect which determines its position in the canvas o... | 27.692308 | 78 | 0.727778 | from sketch.models import MSLayer
class MSSliceLayer(MSLayer):
pass
| true | true |
f779fffcca7aba85c4d57e399b18ad73b43bac10 | 3,044 | py | Python | tests/tasks/test_sequence_tagging.py | Yoark/Transformer-Attention | b8c62cb8618a03150ccfd73f705893d2b931b224 | [
"Apache-2.0"
] | 262 | 2018-02-28T08:11:37.000Z | 2022-03-03T04:18:10.000Z | tests/tasks/test_sequence_tagging.py | Yoark/Transformer-Attention | b8c62cb8618a03150ccfd73f705893d2b931b224 | [
"Apache-2.0"
] | 16 | 2018-06-05T05:40:52.000Z | 2020-10-27T08:28:07.000Z | tests/tasks/test_sequence_tagging.py | Yoark/Transformer-Attention | b8c62cb8618a03150ccfd73f705893d2b931b224 | [
"Apache-2.0"
] | 49 | 2018-07-25T09:08:14.000Z | 2021-06-09T17:09:21.000Z | from torchnlp.tasks.sequence_tagging import Tagger, hparams_tagging_base, VOCABS_FILE
import torch
import torch.nn as nn
import torchtext
from torchtext import data
from torchtext import datasets
import pytest
def udpos_dataset(batch_size):
# Setup fields with batch dimension first
inputs = data.Field(init_... | 38.531646 | 103 | 0.709921 | from torchnlp.tasks.sequence_tagging import Tagger, hparams_tagging_base, VOCABS_FILE
import torch
import torch.nn as nn
import torchtext
from torchtext import data
from torchtext import datasets
import pytest
def udpos_dataset(batch_size):
inputs = data.Field(init_token="<bos>", eos_token="<eos>", batch_fi... | true | true |
f77a00ff090b3ca8750dde9b2fe37fec8fb66338 | 45,691 | py | Python | swift/cli/recon.py | hbhdytf/mac | 51252356b22a792599a401f40ede0b9fda9fccdc | [
"Apache-2.0"
] | null | null | null | swift/cli/recon.py | hbhdytf/mac | 51252356b22a792599a401f40ede0b9fda9fccdc | [
"Apache-2.0"
] | null | null | null | swift/cli/recon.py | hbhdytf/mac | 51252356b22a792599a401f40ede0b9fda9fccdc | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# 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
... | 41.650866 | 79 | 0.509772 |
"""
cmdline utility to perform cluster reconnaissance
"""
from __future__ import print_function
from eventlet.green import urllib2
from six.moves.urllib.parse import urlparse
from swift.common.utils import SWIFT_CONF_FILE
from swift.common.ring import Ring
from hashlib import md5
import eventlet
import json
impo... | false | true |
f77a010b4f4c2f8f0ea2e87512d87c2a17ed2306 | 575 | py | Python | release/stubs.min/System/__init___parts/MTAThreadAttribute.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/MTAThreadAttribute.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/__init___parts/MTAThreadAttribute.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class MTAThreadAttribute:
"""
Indicates that the COM threading model for an application is multithreaded apartment (MTA).
MTAThreadAttribute()
"""
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return MTAThreadAttribute()
instance=ZZZ()
"""hardcoded/returns an instance of the class""... | 38.333333 | 215 | 0.714783 | class MTAThreadAttribute:
return MTAThreadAttribute()
"""hardcoded/returns an instance of the class"""
def __init__(self,*args):
pass
| true | true |
f77a014fa5e11e96f1cd0e84be19d64c5bf02000 | 21,865 | py | Python | computation_graph/graph_test.py | hyroai/computation-graph | 357ea2cfd98c3ea1162b3f373c38738f8ae08b6b | [
"MIT"
] | 23 | 2020-04-19T14:30:40.000Z | 2021-12-03T14:45:44.000Z | computation_graph/graph_test.py | hyroai/computation-graph | 357ea2cfd98c3ea1162b3f373c38738f8ae08b6b | [
"MIT"
] | 7 | 2020-07-20T20:21:27.000Z | 2021-12-30T17:24:28.000Z | computation_graph/graph_test.py | hyroai/computation-graph | 357ea2cfd98c3ea1162b3f373c38738f8ae08b6b | [
"MIT"
] | null | null | null | import asyncio
import functools
import json
import gamla
import pytest
from computation_graph import base_types, composers, graph, run
pytestmark = pytest.mark.asyncio
_ROOT_VALUE = "root"
class _GraphTestError(Exception):
pass
def _node1(arg1):
return f"node1({arg1})"
async def _node1_async(arg1):
... | 29.388441 | 102 | 0.669655 | import asyncio
import functools
import json
import gamla
import pytest
from computation_graph import base_types, composers, graph, run
pytestmark = pytest.mark.asyncio
_ROOT_VALUE = "root"
class _GraphTestError(Exception):
pass
def _node1(arg1):
return f"node1({arg1})"
async def _node1_async(arg1):
... | true | true |
f77a01f9b8c6fa04acd3fa18f26185887232653e | 14,677 | py | Python | sunpy/image/tests/test_transform.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null | sunpy/image/tests/test_transform.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null | sunpy/image/tests/test_transform.py | dgarciabriseno/sunpy | 40f6d7d5ba9d63ac7ffd3ea8587642867caeae25 | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import pytest
import skimage.data as images
from matplotlib.figure import Figure
from skimage import transform as tf
from astropy.coordinates.matrix_utilities import rotation_matrix
from sunpy.image.transform import _rotation_registry, affine_transform
from sunpy.tests.helpers import figure_test
fr... | 40.544199 | 100 | 0.648225 | import numpy as np
import pytest
import skimage.data as images
from matplotlib.figure import Figure
from skimage import transform as tf
from astropy.coordinates.matrix_utilities import rotation_matrix
from sunpy.image.transform import _rotation_registry, affine_transform
from sunpy.tests.helpers import figure_test
fr... | true | true |
f77a026c93f64946b57df4af17662a581de71d45 | 8,804 | py | Python | env/lib/python3.5/site-packages/nltk/translate/chrf_score.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 7 | 2020-11-29T02:33:23.000Z | 2021-06-28T04:45:31.000Z | env/lib/python3.5/site-packages/nltk/translate/chrf_score.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 6 | 2020-09-05T01:40:23.000Z | 2022-03-12T00:40:58.000Z | env/lib/python3.5/site-packages/nltk/translate/chrf_score.py | Udolf15/recommedMeMovies | be5ae74acd98e3f93beaaa5bb55623974fb24247 | [
"MIT"
] | 3 | 2020-09-24T18:26:36.000Z | 2021-06-30T10:55:26.000Z | # -*- coding: utf-8 -*-
# Natural Language Toolkit: ChrF score
#
# Copyright (C) 2001-2019 NLTK Project
# Authors: Maja Popovic
# Contributors: Liling Tan, Aleš Tamchyna (Memsource)
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
""" ChrF score implementation """
from __future__ import division
fr... | 39.128889 | 96 | 0.659814 |
from __future__ import division
from collections import Counter, defaultdict
import re
from nltk.util import ngrams
def sentence_chrf(
reference, hypothesis, min_len=1, max_len=6, beta=3.0, ignore_whitespace=True
):
return corpus_chrf(
[reference],
[hypothesis],
min_len,
max_... | true | true |
f77a03a622e475accd496b19e80965b91586a048 | 936 | py | Python | interviews/distinct_bt/distinct_bt.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | 1 | 2021-01-28T07:32:17.000Z | 2021-01-28T07:32:17.000Z | interviews/distinct_bt/distinct_bt.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | null | null | null | interviews/distinct_bt/distinct_bt.py | zarkle/data-structures-and-algorithms | 0485b95f5aabc0ee255cd7e50b48a6ccec851e00 | [
"MIT"
] | 1 | 2020-04-10T08:01:50.000Z | 2020-04-10T08:01:50.000Z | def distinct_values_bt(bin_tree):
"""Find distinct values in a binary tree."""
distinct = {}
result = []
def _walk(node=None):
if node is None:
return
if node.left is not None:
_walk(node.left)
if distinct.get(node.val):
distinct[node.val] =... | 22.285714 | 63 | 0.540598 | def distinct_values_bt(bin_tree):
distinct = {}
result = []
def _walk(node=None):
if node is None:
return
if node.left is not None:
_walk(node.left)
if distinct.get(node.val):
distinct[node.val] = distinct[node.val] + 1
else:
... | true | true |
f77a03c98283c035021fc832eb8b0d35e7a90a69 | 7,917 | py | Python | sktime/forecasting/tests/test_all_forecasters.py | ee14b104/sktime | 4a84a8257ccd15aa7736557aef5d34e015e16fd1 | [
"BSD-3-Clause"
] | null | null | null | sktime/forecasting/tests/test_all_forecasters.py | ee14b104/sktime | 4a84a8257ccd15aa7736557aef5d34e015e16fd1 | [
"BSD-3-Clause"
] | null | null | null | sktime/forecasting/tests/test_all_forecasters.py | ee14b104/sktime | 4a84a8257ccd15aa7736557aef5d34e015e16fd1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
# test API provided through BaseForecaster
__author__ = ["Markus Löning"]
__all__ = [
"test_raises_not_fitted_error",
"test_score",
"test_predict_time_index",
"test_update_predict_... | 35.186667 | 88 | 0.746242 |
__author__ = ["Markus Löning"]
__all__ = [
"test_raises_not_fitted_error",
"test_score",
"test_predict_time_index",
"test_update_predict_predicted_indices",
"test_bad_y_input",
"test_fitted_params",
"test_predict_time_index_in_sample_full",
"test_predict_pred_interval",
"test_updat... | true | true |
f77a0417aa1b4d34a97816fd5ec082dc4b5a7855 | 500 | py | Python | django_summernote/test_settings.py | nidico/django-summernote | 140fd1c68a0e0cc3e191fc1d8f22d8ebc6fc20ec | [
"MIT"
] | null | null | null | django_summernote/test_settings.py | nidico/django-summernote | 140fd1c68a0e0cc3e191fc1d8f22d8ebc6fc20ec | [
"MIT"
] | null | null | null | django_summernote/test_settings.py | nidico/django-summernote | 140fd1c68a0e0cc3e191fc1d8f22d8ebc6fc20ec | [
"MIT"
] | null | null | null | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'django_summernote.db',
}
}
MIDDLEWARE_CLASSES = (
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
)
STATIC_URL = '/'
ME... | 20 | 48 | 0.69 | DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'django_summernote.db',
}
}
MIDDLEWARE_CLASSES = (
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
)
STATIC_URL = '/'
ME... | true | true |
f77a04f135ec7169af9f6a9f1de591cf142a003a | 45 | py | Python | ERP/__init__.py | cheikhmbackeseck37/insuris-v4 | 687088aaafc884c87fe1e72ae494feb305c22d88 | [
"MIT"
] | 12 | 2019-08-02T07:58:16.000Z | 2022-01-31T23:45:08.000Z | ERP/__init__.py | domambia/csdigital-gs1kenya-internal-erp | 6736d0e9a3a51653689f8ae921cf811f378d9d8e | [
"MIT"
] | 8 | 2019-08-02T08:06:18.000Z | 2022-03-11T23:45:17.000Z | ERP/__init__.py | cheikhmbackeseck37/insuris | 3362ca445d489e23d57a76bbd6d263f3a5f0b519 | [
"MIT"
] | 11 | 2019-07-31T16:23:36.000Z | 2022-01-29T08:30:07.000Z | import pymysql
pymysql.install_as_MySQLdb()
| 15 | 28 | 0.844444 | import pymysql
pymysql.install_as_MySQLdb()
| true | true |
f77a04fe095ad1c00c76bd61942d645d644506a5 | 1,706 | py | Python | examples/search_vms.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | 3 | 2022-01-14T00:37:58.000Z | 2022-03-26T12:26:32.000Z | examples/search_vms.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | 29 | 2021-07-20T12:42:44.000Z | 2022-03-28T13:01:33.000Z | examples/search_vms.py | oliel/python-ovirt-engine-sdk4 | c0b13982b45dee664ebc063bda7686124b402c14 | [
"Apache-2.0"
] | 12 | 2021-07-20T12:27:07.000Z | 2022-02-24T11:10:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | 28.433333 | 74 | 0.733294 |
import logging
import ovirtsdk4 as sdk
import ovirtsdk4.types as types
logging.basicConfig(level=logging.DEBUG, filename='example.log')
connection = sdk.Connection(
url='https://engine40.example.com/ovirt-engine/api',
username='admin@internal',
password='redhat123',
ca_file='ca.pem',
debug=Tru... | true | true |
f77a05097cfde28fa345f51142dc4f589ecd0e96 | 4,662 | py | Python | api_ai/api.py | modi975/flask-assistant | 0d1807eb9098ed529f329b158a3735bd7786960d | [
"Apache-2.0"
] | null | null | null | api_ai/api.py | modi975/flask-assistant | 0d1807eb9098ed529f329b158a3735bd7786960d | [
"Apache-2.0"
] | null | null | null | api_ai/api.py | modi975/flask-assistant | 0d1807eb9098ed529f329b158a3735bd7786960d | [
"Apache-2.0"
] | null | null | null | import os
import requests
import json
from . import logger
from .models import Intent, Entity
class ApiAi(object):
"""Interface for making and recieving API-AI requests.
Use the developer access token for managing entities and intents and the client access token for making queries.
"""
def __init_... | 33.782609 | 116 | 0.636851 | import os
import requests
import json
from . import logger
from .models import Intent, Entity
class ApiAi(object):
def __init__(self, dev_token=None, client_token=None):
self._dev_token = dev_token or os.getenv('DEV_ACCESS_TOKEN')
self._client_token = client_token or os.getenv('CLIENT_ACCESS_T... | true | true |
f77a0536f2fdcf5ee642e3c86657b11a24c8cef8 | 462 | py | Python | packages/python/plotly/plotly/validators/layout/scene/xaxis/title/font/_size.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/xaxis/title/font/_size.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/layout/scene/xaxis/title/font/_size.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="layout.scene.xaxis.title.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | 30.8 | 87 | 0.632035 | import _plotly_utils.basevalidators
class SizeValidator(_plotly_utils.basevalidators.NumberValidator):
def __init__(
self, plotly_name="size", parent_name="layout.scene.xaxis.title.font", **kwargs
):
super(SizeValidator, self).__init__(
plotly_name=plotly_name,
parent_n... | true | true |
f77a0553ee411e14a7783f0e7652281df37e6fc6 | 20,334 | py | Python | docopt.py | dotmpe/docopt-mpe | 3e0816de1b028a82ba036fa326d66c661b8925ef | [
"MIT"
] | null | null | null | docopt.py | dotmpe/docopt-mpe | 3e0816de1b028a82ba036fa326d66c661b8925ef | [
"MIT"
] | null | null | null | docopt.py | dotmpe/docopt-mpe | 3e0816de1b028a82ba036fa326d66c661b8925ef | [
"MIT"
] | null | null | null | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... | 34.406091 | 82 | 0.5599 | import sys
import re
__all__ = ['docopt']
__version__ = '0.6.2'
class DocoptLanguageError(Exception):
class DocoptExit(SystemExit):
usage = ''
def __init__(self, message=''):
SystemExit.__init__(self, (message + '\n' + self.usage).strip())
class Pattern(object):
def __eq__(self, other):... | true | true |
f77a05749d195956e924e1ee0228e1ea81fa7a1f | 4,845 | py | Python | scripts/calculate_within_person_sfs.py | sarahbald/BIG_2021_microbiome_evolution | 8adb48e9596a30f2db5b49a0f47f0ddc1188fcdf | [
"BSD-2-Clause"
] | null | null | null | scripts/calculate_within_person_sfs.py | sarahbald/BIG_2021_microbiome_evolution | 8adb48e9596a30f2db5b49a0f47f0ddc1188fcdf | [
"BSD-2-Clause"
] | null | null | null | scripts/calculate_within_person_sfs.py | sarahbald/BIG_2021_microbiome_evolution | 8adb48e9596a30f2db5b49a0f47f0ddc1188fcdf | [
"BSD-2-Clause"
] | 2 | 2021-06-18T06:55:57.000Z | 2021-06-29T17:07:59.000Z | import parse_midas_data
#import pylab
import sys
import numpy
import bz2
import calculate_snp_prevalences
################################################################################
#
# Standard header to read in argument information
#
############################################################################... | 35.108696 | 246 | 0.659856 | import parse_midas_data
import sys
import numpy
import bz2
import calculate_snp_prevalences
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("species_name", help="name of species to process")
parser.add_argument("--debug", help="Loads only a subset of SNPs for speed", action="store_true")
parse... | true | true |
f77a070936763508223ad6604d7f3aa980477867 | 4,004 | py | Python | lsassy/parser.py | pretech86/lsassy | 8935fb6f0829055820e1c3d79016f522d04e3b6e | [
"MIT"
] | null | null | null | lsassy/parser.py | pretech86/lsassy | 8935fb6f0829055820e1c3d79016f522d04e3b6e | [
"MIT"
] | null | null | null | lsassy/parser.py | pretech86/lsassy | 8935fb6f0829055820e1c3d79016f522d04e3b6e | [
"MIT"
] | 1 | 2020-05-14T23:20:30.000Z | 2020-05-14T23:20:30.000Z | import json
from lsassy.log import Logger
class Parser():
def __init__(self, pypydump):
self.pypydump = pypydump
self.log = Logger()
self.credentials = []
def _parse(self, raw=False):
ssps = ['msv_creds', 'wdigest_creds', 'ssp_creds', 'livessp_creds', 'kerberos_creds', 'cr... | 43.053763 | 125 | 0.505994 | import json
from lsassy.log import Logger
class Parser():
def __init__(self, pypydump):
self.pypydump = pypydump
self.log = Logger()
self.credentials = []
def _parse(self, raw=False):
ssps = ['msv_creds', 'wdigest_creds', 'ssp_creds', 'livessp_creds', 'kerberos_creds', 'cr... | true | true |
f77a07cfa3732ae4e952df60a109940c53cf457c | 351 | py | Python | novice/03-02/latihan/user.py | anisarizqi/praxis-academy | 8db4d61b60d05c8e877711b4210bfe743f308f44 | [
"MIT"
] | null | null | null | novice/03-02/latihan/user.py | anisarizqi/praxis-academy | 8db4d61b60d05c8e877711b4210bfe743f308f44 | [
"MIT"
] | null | null | null | novice/03-02/latihan/user.py | anisarizqi/praxis-academy | 8db4d61b60d05c8e877711b4210bfe743f308f44 | [
"MIT"
] | null | null | null | from flask import Flask, escape
app = Flask(__name__)
@app.route('/user/username')
def show_user_profile(username):
return 'User %s' % escape(username)
@app.route('/post/<int:post_id>')
def show_post(post_id):
return 'Post %d' % post_id
@app.route('/path/<path:subpath>')
def show_subpath(subpath):
return... | 25.071429 | 41 | 0.700855 | from flask import Flask, escape
app = Flask(__name__)
@app.route('/user/username')
def show_user_profile(username):
return 'User %s' % escape(username)
@app.route('/post/<int:post_id>')
def show_post(post_id):
return 'Post %d' % post_id
@app.route('/path/<path:subpath>')
def show_subpath(subpath):
return... | true | true |
f77a09a400bdc0362c3261184fe573d58a53d452 | 7,591 | py | Python | kubernetes/client/models/v2alpha1_cron_job.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2019-07-12T05:38:06.000Z | 2019-07-12T05:38:06.000Z | kubernetes/client/models/v2alpha1_cron_job.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v2alpha1_cron_job.py | woqer/python | 3a6fe8231cefe1fa39a0a69d4b2f33044ab32745 | [
"Apache-2.0"
] | 1 | 2021-05-18T12:25:56.000Z | 2021-05-18T12:25:56.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.3
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 31.761506 | 281 | 0.613885 |
from pprint import pformat
from six import iteritems
import re
class V2alpha1CronJob(object):
swagger_types = {
'api_version': 'str',
'kind': 'str',
'metadata': 'V1ObjectMeta',
'spec': 'V2alpha1CronJobSpec',
'status': 'V2alpha1CronJobStatus'
}
attribute_map = ... | true | true |
f77a0a7c75be3f1b0d2053d3bb55ab67981c3a6c | 361 | py | Python | Source/facelock/Dataset/faceCheck.py | geo-petrini/Face-Away-PC-Lock | 7baf05d281021a096d9cd91289f788832dacb7fc | [
"MIT"
] | null | null | null | Source/facelock/Dataset/faceCheck.py | geo-petrini/Face-Away-PC-Lock | 7baf05d281021a096d9cd91289f788832dacb7fc | [
"MIT"
] | null | null | null | Source/facelock/Dataset/faceCheck.py | geo-petrini/Face-Away-PC-Lock | 7baf05d281021a096d9cd91289f788832dacb7fc | [
"MIT"
] | null | null | null | import face_recognition
import cv2
import numpy as np
from time import sleep
import os,sys
path = './Dataset/'
if len(sys.argv) == 2:
path = sys.argv[1]
files = os.listdir(path)
for name in files:
full_path = os.path.join(path, name)
if os.path.isdir(full_path):
print('Directory: ' + name)
... | 16.409091 | 40 | 0.631579 | import face_recognition
import cv2
import numpy as np
from time import sleep
import os,sys
path = './Dataset/'
if len(sys.argv) == 2:
path = sys.argv[1]
files = os.listdir(path)
for name in files:
full_path = os.path.join(path, name)
if os.path.isdir(full_path):
print('Directory: ' + name)
... | true | true |
f77a0b0f4b8a38c5bc6ee465f537a8fe5c9c1f4d | 1,622 | py | Python | torch_geometric/datasets/karate.py | YukeWang96/pytorch_geometric | ef85bdd95a84fb29ff8f44df166a66042db0e12e | [
"MIT"
] | 2 | 2020-06-23T20:18:46.000Z | 2021-12-03T20:33:51.000Z | torch_geometric/datasets/karate.py | HenrryBryant/pytorch_geometric | 3c4466a3f38a2eba92073c730a09953ab5082c3d | [
"MIT"
] | null | null | null | torch_geometric/datasets/karate.py | HenrryBryant/pytorch_geometric | 3c4466a3f38a2eba92073c730a09953ab5082c3d | [
"MIT"
] | null | null | null | import torch
import numpy as np
import networkx as nx
from torch_geometric.data import InMemoryDataset, Data
class KarateClub(InMemoryDataset):
r"""Zachary's karate club network from the `"An Information Flow Model for
Conflict and Fission in Small Groups"
<http://www1.ind.ku.dk/complexLearning/zachary197... | 36.044444 | 79 | 0.65598 | import torch
import numpy as np
import networkx as nx
from torch_geometric.data import InMemoryDataset, Data
class KarateClub(InMemoryDataset):
def __init__(self, transform=None):
super(KarateClub, self).__init__('.', transform, None, None)
G = nx.karate_club_graph()
adj = nx.to_scipy_s... | true | true |
f77a0b459d9faae353c4057b689ff2a792ebe79d | 1,708 | py | Python | setup.py | rickyHong/Cirq-repl | 5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf | [
"Apache-2.0"
] | null | null | null | setup.py | rickyHong/Cirq-repl | 5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf | [
"Apache-2.0"
] | null | null | null | setup.py | rickyHong/Cirq-repl | 5b31440d5b5bf5a66ee85ef5e44373ac89aa0eaf | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 33.490196 | 74 | 0.704333 |
import io
from setuptools import find_packages, setup
__version__ = ''
exec(open('cirq/_version.py').read())
description = ('A framework for creating, editing, and invoking '
'Noisy Intermediate Scale Quantum (NISQ) circuits.')
long_description = io.open('README.rst', encoding='utf-8').read()
requir... | true | true |
f77a0b82aa122d4550e84136080ee05184aebc60 | 20,408 | py | Python | open_gpias/StimulusFrontEnd.py | rgerum/open_gpias | 53936c10794328d89df179b2f0a56bccdc1883d8 | [
"DOC"
] | null | null | null | open_gpias/StimulusFrontEnd.py | rgerum/open_gpias | 53936c10794328d89df179b2f0a56bccdc1883d8 | [
"DOC"
] | null | null | null | open_gpias/StimulusFrontEnd.py | rgerum/open_gpias | 53936c10794328d89df179b2f0a56bccdc1883d8 | [
"DOC"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# StimulusFrontEnd.py
# Copyright (c) 2018, Richard Gerum, Achim Schilling, Hinrich Rahlfs, Matthias Streb
#
# This file is part of ASR-Setup.
#
# ASR-Setup is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | 40.653386 | 157 | 0.613583 |
import os
import sys
import time
import numpy as np
from qtpy import QtCore, QtGui, QtWidgets
import qtawesome as qta
from threading import Thread
from . import StimulusBackend
from . import gui_helpers
from .MeasurementPlot import plotWidget
class measurementGui(QtWidgets.QWidget):
timeString = ... | true | true |
f77a0c29b0cdaa8c1fe74d1182187833d31dd6f7 | 6,784 | py | Python | binance/depthcache.py | lostoli/python-binance | 15a61ae1285a7ae9e2fb900b3a70c4cb206448df | [
"MIT"
] | 1 | 2019-07-12T11:13:39.000Z | 2019-07-12T11:13:39.000Z | binance/depthcache.py | lostoli/python-binance | 15a61ae1285a7ae9e2fb900b3a70c4cb206448df | [
"MIT"
] | null | null | null | binance/depthcache.py | lostoli/python-binance | 15a61ae1285a7ae9e2fb900b3a70c4cb206448df | [
"MIT"
] | 1 | 2018-12-06T16:15:04.000Z | 2018-12-06T16:15:04.000Z | from operator import itemgetter
import time
from .websockets import SocketManager
class DepthCache:
def __init__(self, symbol):
"""Intialise the DepthCache
:param symbol: Symbol to create depth cache for
:type symbol: string
"""
self.symbol = symbol
self._bids =... | 26.092308 | 107 | 0.521374 | from operator import itemgetter
import time
from .websockets import SocketManager
class DepthCache:
def __init__(self, symbol):
self.symbol = symbol
self._bids = {}
self._asks = {}
def add_bid(self, bid):
self._bids[bid[0]] = float(bid[1])
if bid[1] == "0.00000000":
... | true | true |
f77a0c5024df9a7fe25ec5b69e3d4cb78c8f2bad | 1,171 | py | Python | recipes/Python/578354_Dynamically_create_dictionary_ascending/recipe-578354.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/578354_Dynamically_create_dictionary_ascending/recipe-578354.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/578354_Dynamically_create_dictionary_ascending/recipe-578354.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | #!/usr/bin/env python
"""
Create a dictionary of ascending (sequential) directories.
"""
def make_pathdict(keys, fspath = None):
"""Quickly create a dictionary of ascending path components.
:param keys: list of dictionary keys (base -> root order)
:returns: dictionary of keyed paths
NOTICE: Thi... | 26.022222 | 78 | 0.648164 |
def make_pathdict(keys, fspath = None):
from os import path as os_path
_cache = {}
fspath = os_path.abspath(fspath or __file__)
tokenz = fspath.rsplit(os_path.sep, len(keys))
for idx, key in enumerate(keys):
_cache[key] = os_path.join(*tokenz[:-(idx + 1)])
retur... | true | true |
f77a0e5698ec181c731b56c76d3b109630781984 | 5,821 | py | Python | ansys/dpf/core/operators/min_max/min_max_by_entity.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 11 | 2021-01-31T15:50:02.000Z | 2021-10-01T23:15:38.000Z | ansys/dpf/core/operators/min_max/min_max_by_entity.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 46 | 2021-01-14T05:00:50.000Z | 2021-10-06T18:30:37.000Z | ansys/dpf/core/operators/min_max/min_max_by_entity.py | TheGoldfish01/pydpf-core | 75ca8a180454f94cedafbc68c1d6f20dcfc4c795 | [
"MIT"
] | 3 | 2021-06-30T07:18:30.000Z | 2021-09-15T08:43:11.000Z | """
min_max_by_entity
=================
"""
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs, _modify_output_spec_with_one_type
from ansys.dpf.core.operators.specification import PinSpecification, Specification
"""Oper... | 32.702247 | 149 | 0.622573 | from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs, _modify_output_spec_with_one_type
from ansys.dpf.core.operators.specification import PinSpecification, Specification
class min_max_by_entity(Operator):
def __init_... | true | true |
f77a0e6ae0af6e564e07ca5b8b5d6748683153ec | 36,711 | py | Python | tests/pytests/unit/utils/jinja/test_custom_extensions.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 1 | 2022-03-12T00:03:19.000Z | 2022-03-12T00:03:19.000Z | tests/pytests/unit/utils/jinja/test_custom_extensions.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | 2 | 2022-03-02T16:11:35.000Z | 2022-03-03T08:04:30.000Z | tests/pytests/unit/utils/jinja/test_custom_extensions.py | tomdoherty/salt | f87d5d7abbf9777773c4d91fdafecb8b1a728e76 | [
"Apache-2.0"
] | null | null | null | """
Tests for salt.utils.jinja
"""
import ast
import itertools
import os
import pprint
import random
import re
import pytest
import salt.config
import salt.loader
# dateutils is needed so that the strftime jinja filter is loaded
import salt.utils.dateutils # pylint: disable=unused-import
import salt.utils.files
imp... | 30.490864 | 134 | 0.590749 |
import ast
import itertools
import os
import pprint
import random
import re
import pytest
import salt.config
import salt.loader
import salt.utils.dateutils import salt.utils.files
import salt.utils.json
import salt.utils.stringutils
import salt.utils.yaml
from jinja2 import DictLoader, Environment, exceptions
from ... | true | true |
f77a0f114e4887d3840ca2bf466df84214b4f0d3 | 10,421 | py | Python | python-backend/app/api/mines/mine/models/mine.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | null | null | null | python-backend/app/api/mines/mine/models/mine.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | null | null | null | python-backend/app/api/mines/mine/models/mine.py | ActionAnalytics/mds | 7ac61b0b73b1d310db7dcf2d830b5746b851fe4a | [
"Apache-2.0"
] | null | null | null | import uuid
from sqlalchemy.orm import validates
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.schema import FetchedValue
from app.extensions import db
from ....utils.models_mixins import AuditMixin, Base
# FIXME: Model import from outside of its namespace
# This breaks micro-service architecture and... | 41.517928 | 187 | 0.641973 | import uuid
from sqlalchemy.orm import validates
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.schema import FetchedValue
from app.extensions import db
from ....utils.models_mixins import AuditMixin, Base
from ....permits.permit.models.permit import Permit
class Mine(AuditMixin, Base):
__table... | true | true |
f77a0f709e613fcf6a4f8806d925a9926f40c7be | 1,967 | py | Python | online_judges/maximizing_xor/maximizing_xor_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | online_judges/maximizing_xor/maximizing_xor_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | online_judges/maximizing_xor/maximizing_xor_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# This notebook was prepared by [Donne Martin](http://donnemartin.com). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# # Challenge Notebook
# ## Problem: Maximizing XOR
#
# See the [HackerRank problem page](https://www.ha... | 26.581081 | 300 | 0.720895 |
# ## Code
# In[ ]:
class Solution(object):
def max_xor(self, lower, upper):
# TODO: Implement me
pass
# ## Unit Test
#
# **The following unit test is expected to fail until you solve the challenge.**
# In[ ]:
# %load test_maximizing_xor.py
import unittest
class TestMaximizingXor(u... | true | true |
f77a0f9a566976aaad8cd56072274d08f4630a64 | 538 | py | Python | adminmgr/media/code/python/map2/BD_058_217_267_1417_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/python/map2/BD_058_217_267_1417_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/python/map2/BD_058_217_267_1417_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | #!/usr/bin/python
import sys
import csv
infile = sys.stdin
#next(infile)
count = 0
for line in infile:
line = line.strip()
my_list = line.split(',') #splitting line based on comma
if(my_list[0] == 'ball'): #checking if the line is a delivery
# print('Hello World')
#print(out)
key_list = my_list[4]+','+my_list[... | 33.625 | 101 | 0.693309 | import sys
import csv
infile = sys.stdin
count = 0
for line in infile:
line = line.strip()
my_list = line.split(',') if(my_list[0] == 'ball'): key_list = my_list[4]+','+my_list[6] val_list = my_list[7]+','+my_list[8] print('%s\t%s' % (key_list,val_list)) | true | true |
f77a10effc6284a7d913906abe32cdb5283c895f | 6,999 | py | Python | nlp_toolkit/labeler.py | stevewyl/nlp_toolkit | 257dabd300b29957a0be38e7a8049a54f2095ccc | [
"MIT"
] | 37 | 2018-11-10T13:40:28.000Z | 2021-08-09T02:29:42.000Z | nlp_toolkit/labeler.py | stevewyl/nlp_toolkit | 257dabd300b29957a0be38e7a8049a54f2095ccc | [
"MIT"
] | 1 | 2019-01-04T10:46:21.000Z | 2019-03-20T16:05:52.000Z | nlp_toolkit/labeler.py | stevewyl/nlp_toolkit | 257dabd300b29957a0be38e7a8049a54f2095ccc | [
"MIT"
] | 5 | 2018-11-23T09:30:24.000Z | 2020-04-18T15:40:48.000Z | """
Sequence Labeler Wrapper
"""
import sys
import time
import numpy as np
from copy import deepcopy
from nlp_toolkit.models import Word_RNN, IDCNN, Char_RNN
from nlp_toolkit.trainer import Trainer
from nlp_toolkit.utilities import logger
from nlp_toolkit.sequence import BasicIterator
from nlp_toolkit.data import Data... | 41.660714 | 94 | 0.587941 |
import sys
import time
import numpy as np
from copy import deepcopy
from nlp_toolkit.models import Word_RNN, IDCNN, Char_RNN
from nlp_toolkit.trainer import Trainer
from nlp_toolkit.utilities import logger
from nlp_toolkit.sequence import BasicIterator
from nlp_toolkit.data import Dataset
from typing import List, Dict... | true | true |
f77a121faacb0596d8a720114bc5dfdc7af30fec | 5,961 | py | Python | theano/PBP_net/PBP_net.py | DoktorBotti/Probabilistic-Backpropagation | 56c9ca818f88fd11e4c38585eefaceb3c28e2184 | [
"BSD-3-Clause"
] | 200 | 2015-03-18T20:23:41.000Z | 2022-02-16T15:13:01.000Z | theano/PBP_net/PBP_net.py | DoktorBotti/Probabilistic-Backpropagation | 56c9ca818f88fd11e4c38585eefaceb3c28e2184 | [
"BSD-3-Clause"
] | 1 | 2018-07-09T11:55:07.000Z | 2018-07-09T11:55:07.000Z | theano/PBP_net/PBP_net.py | DoktorBotti/Probabilistic-Backpropagation | 56c9ca818f88fd11e4c38585eefaceb3c28e2184 | [
"BSD-3-Clause"
] | 74 | 2015-03-25T16:17:38.000Z | 2021-12-28T11:25:41.000Z |
import numpy as np
import pickle
import gzip
import pbp
class PBP_net:
def __init__(self, X_train, y_train, n_hidden, n_epochs = 40,
normalize = False):
"""
Constructor for the class implementing a Bayesian neural network
trained with the probabilistic back propagation... | 30.106061 | 82 | 0.581614 |
import numpy as np
import pickle
import gzip
import pbp
class PBP_net:
def __init__(self, X_train, y_train, n_hidden, n_epochs = 40,
normalize = False):
if normalize:
self.std_X_train = np.std(X_train, 0)
self.std_X_train[ self.std_X_train == 0 ] = 1
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.