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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7096801f14d2d26bd55f170d586739f77960dfb | 618 | py | Python | chat/migrations/0001_initial.py | bionikspoon/django_channels_chat | b756bb6a8a361ef190ea70120f70c7b420559d74 | [
"MIT"
] | null | null | null | chat/migrations/0001_initial.py | bionikspoon/django_channels_chat | b756bb6a8a361ef190ea70120f70c7b420559d74 | [
"MIT"
] | null | null | null | chat/migrations/0001_initial.py | bionikspoon/django_channels_chat | b756bb6a8a361ef190ea70120f70c7b420559d74 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-25 23:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ChatMes... | 24.72 | 114 | 0.590615 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ChatMessage',
fields=[
('id', models.AutoField(auto... | true | true |
f70969aa61bc9bce48678cb70237665201eecd01 | 2,621 | py | Python | homeassistant/components/bbox/device_tracker.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/bbox/device_tracker.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/bbox/device_tracker.py | zalke/home-assistant | a31e49c857722c0723dc5297cd83cbce0f8716f6 | [
"Apache-2.0"
] | 3 | 2019-04-28T16:35:45.000Z | 2020-05-28T15:21:59.000Z | """Support for French FAI Bouygues Bbox routers."""
from collections import namedtuple
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST
import homeassistant... | 28.48913 | 75 | 0.660053 | from collections import namedtuple
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN, PLATFORM_SCHEMA, DeviceScanner)
from homeassistant.const import CONF_HOST
import homeassistant.helpers.config_validation as cv
from homeassistant.... | true | true |
f7096a6d4471f4bf32467c0baac5db6cb57c25b5 | 1,353 | py | Python | data_structures/sorting_algos/mergesort/test_mergesort.py | jeremyCtown/data-structures-and-algorithms | d4ba8741f858fb5298f8ce560240373fb7742e20 | [
"MIT"
] | null | null | null | data_structures/sorting_algos/mergesort/test_mergesort.py | jeremyCtown/data-structures-and-algorithms | d4ba8741f858fb5298f8ce560240373fb7742e20 | [
"MIT"
] | null | null | null | data_structures/sorting_algos/mergesort/test_mergesort.py | jeremyCtown/data-structures-and-algorithms | d4ba8741f858fb5298f8ce560240373fb7742e20 | [
"MIT"
] | null | null | null | import pytest
from mergesort import mergesort, merge
def test_empty_list_returns_empty_list():
"""Test mergesort on empty list returns same."""
empty = []
assert mergesort(empty) == []
def test_list_with_one_value():
"""Test mergesort on empty list returns same."""
lst = [8]
assert mergesort... | 23.736842 | 68 | 0.601626 | import pytest
from mergesort import mergesort, merge
def test_empty_list_returns_empty_list():
empty = []
assert mergesort(empty) == []
def test_list_with_one_value():
lst = [8]
assert mergesort(lst) == [8]
def test_list_with_two_values():
lst = [8, 3]
assert mergesort(lst) == [3, 8]
def... | true | true |
f7096bdce2180e86cf1d57c069d0bf48eacda9db | 2,648 | py | Python | model/encoder.py | project-delphi/ACS-QG | 03aa5b79030b5ba4c09a99363a58454743876592 | [
"MIT"
] | 63 | 2020-02-11T06:40:17.000Z | 2022-03-03T08:07:16.000Z | model/encoder.py | project-delphi/ACS-QG | 03aa5b79030b5ba4c09a99363a58454743876592 | [
"MIT"
] | 18 | 2020-02-11T06:30:50.000Z | 2022-03-24T08:39:49.000Z | model/encoder.py | project-delphi/ACS-QG | 03aa5b79030b5ba4c09a99363a58454743876592 | [
"MIT"
] | 17 | 2020-02-24T14:29:16.000Z | 2022-01-12T06:42:13.000Z | """
Implement input sentence encoder.
"""
import torch.nn as nn
from torch.nn.utils.rnn import pad_packed_sequence as unpack
from torch.nn.utils.rnn import pack_padded_sequence as pack
from .config import *
from common.constants import DEVICE
from util.tensor_utils import to_sorted_tensor, to_original_tensor
class En... | 44.133333 | 96 | 0.673338 | import torch.nn as nn
from torch.nn.utils.rnn import pad_packed_sequence as unpack
from torch.nn.utils.rnn import pack_padded_sequence as pack
from .config import *
from common.constants import DEVICE
from util.tensor_utils import to_sorted_tensor, to_original_tensor
class Encoder(nn.Module):
def __init__(self, ... | true | true |
f7096c3f584c384ca7d480068e8e6659333d3299 | 356 | py | Python | backend/backend/utils.py | reidy-p/DublinBusPredictions | a6b1fc8a5c28500a3292883ea0dfcde1770d78d1 | [
"MIT"
] | null | null | null | backend/backend/utils.py | reidy-p/DublinBusPredictions | a6b1fc8a5c28500a3292883ea0dfcde1770d78d1 | [
"MIT"
] | null | null | null | backend/backend/utils.py | reidy-p/DublinBusPredictions | a6b1fc8a5c28500a3292883ea0dfcde1770d78d1 | [
"MIT"
] | null | null | null | from dublinbus.serializers import UserSerializer
def my_jwt_response_handler(token, user=None, request=None):
''' JWT response handler
Adds a new ‘user’ field with the user’s serialized data when a token is generated
'''
response = UserSerializer(user, context={'request': request}).data
response["... | 32.363636 | 85 | 0.727528 | from dublinbus.serializers import UserSerializer
def my_jwt_response_handler(token, user=None, request=None):
response = UserSerializer(user, context={'request': request}).data
response["token"] = token
return response
| true | true |
f7096d295eeb57b3737ef0aea08fc63bc3d5f3d0 | 4,713 | py | Python | python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | 8 | 2016-08-15T07:02:27.000Z | 2016-08-24T09:34:00.000Z | python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | 1 | 2022-01-28T07:23:22.000Z | 2022-01-28T07:23:22.000Z | python/paddle/fluid/tests/unittests/distribution/test_distribution_dirichlet_static.py | RangeKing/Paddle | 2d87300809ae75d76f5b0b457d8112cb88dc3e27 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 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... | 44.046729 | 80 | 0.591767 |
import unittest
import numpy as np
import paddle
import scipy.stats
from config import ATOL, DEVICES, RTOL
from parameterize import TEST_CASE_NAME, parameterize_cls, place, xrand
paddle.enable_static()
@place(DEVICES)
@parameterize_cls((TEST_CASE_NAME, 'concentration'),
[('test-one-dim', np.rand... | true | true |
f7096ddd23613e7d847f5b1698c484bd8f0b6508 | 7,244 | py | Python | src/datadog_api_client/v2/model/api_key_update_data.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v2/model/api_key_update_data.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | src/datadog_api_client/v2/model/api_key_update_data.py | rchenzheng/datadog-api-client-python | 2e86ac098c6f0c7fdd90ed218224587c0f8eafef | [
"Apache-2.0"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
import re # noqa: F401
import sys # noqa: F401
from datadog_api_client.v2.model_uti... | 39.369565 | 108 | 0.587659 |
import re import sys
from datadog_api_client.v2.model_utils import ( ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)... | true | true |
f7096dfb774ef917c1fa89ce59bb06b35dcfd16b | 13,101 | py | Python | nmt/utils/iterator_utils_test.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | nmt/utils/iterator_utils_test.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | nmt/utils/iterator_utils_test.py | luckmoon/nmt | 4f6a4acf8d8e086f9d894444a2877ac1f0856ad0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 40.813084 | 81 | 0.558507 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from tensorflow.python.ops import lookup_ops
from ..utils import iterator_utils
class IteratorUtilsTest(tf.test.TestCase):
def testGetIterator(self):
tf.set_random_see... | true | true |
f7096e12c17cddb1193c96063117037bd1a0d6c7 | 1,392 | py | Python | misc/graph.py | OlegSomov/light-motion-analysis | 4f510250aaa32929a6ccff3c796b53151addb9e9 | [
"MIT"
] | null | null | null | misc/graph.py | OlegSomov/light-motion-analysis | 4f510250aaa32929a6ccff3c796b53151addb9e9 | [
"MIT"
] | null | null | null | misc/graph.py | OlegSomov/light-motion-analysis | 4f510250aaa32929a6ccff3c796b53151addb9e9 | [
"MIT"
] | null | null | null | import os
import matplotlib
import json
from datetime import datetime
from matplotlib import pyplot
def show_results_graph(timer, name=None):
with (open('light_plot.json', 'r')) as f:
data = json.load(f)
with (open('light_plot_imporved.json', 'r')) as f:
data_improved = json.load(f)
os.r... | 30.933333 | 121 | 0.631466 | import os
import matplotlib
import json
from datetime import datetime
from matplotlib import pyplot
def show_results_graph(timer, name=None):
with (open('light_plot.json', 'r')) as f:
data = json.load(f)
with (open('light_plot_imporved.json', 'r')) as f:
data_improved = json.load(f)
os.r... | true | true |
f7096e518971a640e24c74a8afad2c115a27cae1 | 1,941 | py | Python | IfxPy/tests/test_148_CallSPDiffBindPattern_01.py | deokershesh/IfxPy | 7c44a2aea85c115b6f595ffa82c038f660fbf1ad | [
"Apache-2.0"
] | null | null | null | IfxPy/tests/test_148_CallSPDiffBindPattern_01.py | deokershesh/IfxPy | 7c44a2aea85c115b6f595ffa82c038f660fbf1ad | [
"Apache-2.0"
] | null | null | null | IfxPy/tests/test_148_CallSPDiffBindPattern_01.py | deokershesh/IfxPy | 7c44a2aea85c115b6f595ffa82c038f660fbf1ad | [
"Apache-2.0"
] | null | null | null | #
#
#
import unittest, sys
import IfxPy
import config
from testfunctions import IfxPyTestFunctions
class IfxPyTestCase(unittest.TestCase):
def test_148_CallSPDiffBindPattern_01(self):
obj = IfxPyTestFunctions()
obj.assert_expect(self.run_test_148)
def run_test_148(self):
conn = IfxPy.connect(conf... | 22.835294 | 128 | 0.564657 |
import unittest, sys
import IfxPy
import config
from testfunctions import IfxPyTestFunctions
class IfxPyTestCase(unittest.TestCase):
def test_148_CallSPDiffBindPattern_01(self):
obj = IfxPyTestFunctions()
obj.assert_expect(self.run_test_148)
def run_test_148(self):
conn = IfxPy.connect(config.Conn... | false | true |
f7096eb7eef28d54b1ae656d37094eb075a9cb64 | 6,618 | py | Python | horovod/common/elastic.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | 7,676 | 2019-02-12T02:57:22.000Z | 2022-03-31T21:05:40.000Z | horovod/common/elastic.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | 2,431 | 2019-02-12T01:34:21.000Z | 2022-03-31T21:43:38.000Z | horovod/common/elastic.py | Infi-zc/horovod | 94cd8561a21d449fc8c80c8fef422025b84dfc22 | [
"Apache-2.0"
] | 1,557 | 2019-02-12T07:52:15.000Z | 2022-03-31T21:05:43.000Z | # Copyright 2020 Uber Technologies, 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 applica... | 37.602273 | 109 | 0.663342 |
import functools
import queue
from horovod.common.exceptions import HorovodInternalError, HostsUpdatedInterrupt
from horovod.runner.elastic.worker import HostUpdateResult, WorkerNotificationManager
notification_manager = WorkerNotificationManager()
class State(object):
def __init__(self, bcast_object, get_ran... | true | true |
f70970e710b91e652b69cabb5611ea3fb3a4a51b | 3,331 | py | Python | tests/performance/WorkerThreadsBuildTimePerformance/run.py | xpybuild/xpybuild | c71a73e47414871c8192381d0356ab62f5a58127 | [
"Apache-2.0"
] | 9 | 2017-02-06T16:45:46.000Z | 2021-12-05T09:42:58.000Z | tests/performance/WorkerThreadsBuildTimePerformance/run.py | xpybuild/xpybuild | c71a73e47414871c8192381d0356ab62f5a58127 | [
"Apache-2.0"
] | 15 | 2019-01-11T19:39:34.000Z | 2022-01-08T11:11:35.000Z | tests/performance/WorkerThreadsBuildTimePerformance/run.py | xpybuild/xpybuild | c71a73e47414871c8192381d0356ab62f5a58127 | [
"Apache-2.0"
] | 5 | 2017-02-06T16:51:17.000Z | 2020-12-02T17:36:30.000Z | import multiprocessing
import random
import time
from pysys.constants import *
from xpybuild.xpybuild_basetest import XpybuildBaseTest
class PySysTest(XpybuildBaseTest):
buildRoot = None # can override this with -XbuildRoot=path to measure your own build
def execute(self):
buildroot = self.buildRoot if self.buil... | 40.621951 | 223 | 0.709997 | import multiprocessing
import random
import time
from pysys.constants import *
from xpybuild.xpybuild_basetest import XpybuildBaseTest
class PySysTest(XpybuildBaseTest):
buildRoot = None
def execute(self):
buildroot = self.buildRoot if self.buildRoot else self.input
assert os.path.isdir(buildroot), self.buildr... | true | true |
f709711aa64e6d3bbb5a25ff10f73af015d6369a | 723 | py | Python | karmagrambot/config.py | patrickelectric/karmagrambot | b76d79172905c5ce906c0ff60591d75dd2994565 | [
"MIT"
] | 6 | 2019-05-31T18:57:08.000Z | 2021-05-03T19:02:28.000Z | karmagrambot/config.py | patrickelectric/karmagrambot | b76d79172905c5ce906c0ff60591d75dd2994565 | [
"MIT"
] | 20 | 2019-05-23T22:57:44.000Z | 2021-11-19T01:43:16.000Z | karmagrambot/config.py | patrickelectric/karmagrambot | b76d79172905c5ce906c0ff60591d75dd2994565 | [
"MIT"
] | 8 | 2019-05-31T18:57:17.000Z | 2021-11-18T19:57:26.000Z | import json
from os import environ
from pathlib import Path
try:
CONFIG_DIR = Path(environ['XDG_CONFIG_HOME'], __package__)
except KeyError:
CONFIG_DIR = Path.home() / '.config' / __package__
if not CONFIG_DIR.exists():
CONFIG_DIR.mkdir()
CONFIG_FILE = CONFIG_DIR / 'config.json'
with open(CONFIG_FILE) a... | 21.264706 | 76 | 0.679115 | import json
from os import environ
from pathlib import Path
try:
CONFIG_DIR = Path(environ['XDG_CONFIG_HOME'], __package__)
except KeyError:
CONFIG_DIR = Path.home() / '.config' / __package__
if not CONFIG_DIR.exists():
CONFIG_DIR.mkdir()
CONFIG_FILE = CONFIG_DIR / 'config.json'
with open(CONFIG_FILE) a... | true | true |
f709713726d342f65a2d86eaded3bf3a8690609d | 230 | py | Python | tests/themes/golden/demo_basic_button.py | Rahuum/glooey | 932edca1c8fdd710f1941038e47ac8d25a31a1a8 | [
"MIT"
] | 86 | 2016-11-28T12:34:28.000Z | 2022-03-17T13:49:49.000Z | tests/themes/golden/demo_basic_button.py | Rahuum/glooey | 932edca1c8fdd710f1941038e47ac8d25a31a1a8 | [
"MIT"
] | 57 | 2017-03-07T10:11:52.000Z | 2022-01-16T19:35:33.000Z | tests/themes/golden/demo_basic_button.py | Rahuum/glooey | 932edca1c8fdd710f1941038e47ac8d25a31a1a8 | [
"MIT"
] | 9 | 2017-03-15T18:55:50.000Z | 2022-02-17T14:52:49.000Z | #!/usr/bin/env python3
import pyglet
import run_demos
import glooey.themes.golden as golden
window = pyglet.window.Window()
gui = golden.Gui(window)
button = golden.BasicButton('Lorem Ipsum')
gui.add(button)
pyglet.app.run()
| 15.333333 | 42 | 0.756522 |
import pyglet
import run_demos
import glooey.themes.golden as golden
window = pyglet.window.Window()
gui = golden.Gui(window)
button = golden.BasicButton('Lorem Ipsum')
gui.add(button)
pyglet.app.run()
| true | true |
f70971933fba0cc7545a7ef491245651e48915fc | 16,353 | py | Python | tests/test_lex.py | Chaformbintrano/hy | 1b220a93a509acd2c5c3c4159e841b5eb12a7a95 | [
"MIT"
] | null | null | null | tests/test_lex.py | Chaformbintrano/hy | 1b220a93a509acd2c5c3c4159e841b5eb12a7a95 | [
"MIT"
] | null | null | null | tests/test_lex.py | Chaformbintrano/hy | 1b220a93a509acd2c5c3c4159e841b5eb12a7a95 | [
"MIT"
] | null | null | null | # Copyright 2019 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import sys
import traceback
import pytest
from math import isnan
from hy.models import (HyExpression, HyInteger, HyFloat, HyComplex, HySymbol,
HyString, HyDict, H... | 33.237805 | 105 | 0.597994 | import sys
import traceback
import pytest
from math import isnan
from hy.models import (HyExpression, HyInteger, HyFloat, HyComplex, HySymbol,
HyString, HyDict, HyList, HySet, HyKeyword)
from hy.lex import tokenize
from hy.lex.exceptions import LexException, PrematureEndOfInput
from hy.errors i... | true | true |
f70971dadca4fb414382ea607136ad5493b59e79 | 3,068 | py | Python | vendor/github.com/elastic/beats/metricbeat/tests/system/test_kubernetes.py | plinde/mqttbeat | 64e3bf19a45686a5cc6aecae58d9d2e140e7c915 | [
"Apache-2.0"
] | 35 | 2017-07-05T07:48:03.000Z | 2022-01-10T16:29:37.000Z | vendor/github.com/elastic/beats/metricbeat/tests/system/test_kubernetes.py | plinde/mqttbeat | 64e3bf19a45686a5cc6aecae58d9d2e140e7c915 | [
"Apache-2.0"
] | 8 | 2017-07-20T21:13:17.000Z | 2020-01-10T08:08:34.000Z | vendor/github.com/elastic/beats/metricbeat/tests/system/test_kubernetes.py | plinde/mqttbeat | 64e3bf19a45686a5cc6aecae58d9d2e140e7c915 | [
"Apache-2.0"
] | 19 | 2017-08-03T16:49:27.000Z | 2022-01-27T01:48:35.000Z | import os
import metricbeat
import unittest
KUBERNETES_FIELDS = metricbeat.COMMON_FIELDS + ["kubernetes"]
class Test(metricbeat.BaseTest):
@unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")
def test_kubelet_node(self):
""" Kubernetes kubelet node metricset tests """
self.... | 36.094118 | 79 | 0.659061 | import os
import metricbeat
import unittest
KUBERNETES_FIELDS = metricbeat.COMMON_FIELDS + ["kubernetes"]
class Test(metricbeat.BaseTest):
@unittest.skipUnless(metricbeat.INTEGRATION_TESTS, "integration test")
def test_kubelet_node(self):
self._test_metricset('node', 1, self.get_kubelet_hosts())
... | true | true |
f709722cba9996c6b9ab92c49c7def3b7f426a8a | 2,240 | py | Python | oneflow/python/test/ops/test_function_input_output.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-04-14T03:19:35.000Z | 2021-04-14T03:19:35.000Z | oneflow/python/test/ops/test_function_input_output.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/ops/test_function_input_output.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 law or agr... | 33.939394 | 72 | 0.691071 | import unittest
import numpy as np
import oneflow as flow
import oneflow.typing as oft
import oneflow._oneflow_internal
from typing import Tuple
@flow.unittest.skip_unless_1n4d()
class TestFunctionInputOutput(flow.unittest.TestCase):
def test_FixedTensorDef(test_case):
@flow.global_function()
def ... | true | true |
f70972932e906ce90dd1294411cbbd58bc445a32 | 158 | py | Python | tests/test_contrib_sentry.py | gtors/stories | 0614624f472151f20617afa4e6c4a0af9b409b6d | [
"BSD-2-Clause"
] | null | null | null | tests/test_contrib_sentry.py | gtors/stories | 0614624f472151f20617afa4e6c4a0af9b409b6d | [
"BSD-2-Clause"
] | null | null | null | tests/test_contrib_sentry.py | gtors/stories | 0614624f472151f20617afa4e6c4a0af9b409b6d | [
"BSD-2-Clause"
] | null | null | null | import pytest
pytest.importorskip("foo")
from stories.contrib.sentry.django import ( # FIXME: # isort:skip # pragma: no cover # noqa
DjangoClient,
)
| 19.75 | 94 | 0.708861 | import pytest
pytest.importorskip("foo")
from stories.contrib.sentry.django import ( DjangoClient,
)
| true | true |
f7097307a99544d97a4ccf6bbdb873a3320a9c8c | 8,779 | py | Python | scripts/update_forecast_hub.py | ConsultingMD/covid-data-public | 2b7091f7cc3877df45a7887709e999b0ebdf30ec | [
"MIT"
] | null | null | null | scripts/update_forecast_hub.py | ConsultingMD/covid-data-public | 2b7091f7cc3877df45a7887709e999b0ebdf30ec | [
"MIT"
] | null | null | null | scripts/update_forecast_hub.py | ConsultingMD/covid-data-public | 2b7091f7cc3877df45a7887709e999b0ebdf30ec | [
"MIT"
] | null | null | null | import enum
from typing import Any
import click
import pandas as pd
import numpy as np
import structlog
import pathlib
import pydantic
import datetime
import zoltpy.util
from covidactnow.datapublic import common_init, common_df
from scripts import helpers
from covidactnow.datapublic.common_fields import (
GetB... | 37.517094 | 100 | 0.663971 | import enum
from typing import Any
import click
import pandas as pd
import numpy as np
import structlog
import pathlib
import pydantic
import datetime
import zoltpy.util
from covidactnow.datapublic import common_init, common_df
from scripts import helpers
from covidactnow.datapublic.common_fields import (
GetB... | true | true |
f709733239a4148a5fa9de69a8f2a8c2f75394e3 | 1,280 | py | Python | tethys/core/pipes/filters/filter_base.py | tethys-platform/tethys | c27daf5a832b05f9d771b04355001c331bc08766 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2020-05-20T19:03:14.000Z | 2020-06-03T20:43:34.000Z | tethys/core/pipes/filters/filter_base.py | tethys-platform/tethys | c27daf5a832b05f9d771b04355001c331bc08766 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tethys/core/pipes/filters/filter_base.py | tethys-platform/tethys | c27daf5a832b05f9d771b04355001c331bc08766 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2020 Konstruktor, 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 la... | 32 | 74 | 0.70625 |
from abc import abstractmethod
from typing import Any
from serobj.utils.serobj_calls import SerobjCallsBase
class FilterBase(SerobjCallsBase):
_SEROBJ__ATTRS = []
@abstractmethod
def execute(self, data_packet: Any, **kwargs) -> float:
raise NotImplementedError
| true | true |
f70973aa106803b09683a40d97d6be0f8cce325f | 369 | py | Python | 2017/future/first_unique_character.py | littlepea/beijing-python-meetup | 393d7723bc092ae548fe4e6ed82aa30ee3c7801d | [
"MIT"
] | 10 | 2016-11-15T10:39:36.000Z | 2020-01-14T04:59:08.000Z | 2017/future/first_unique_character.py | littlepea/beijing-python-meetup | 393d7723bc092ae548fe4e6ed82aa30ee3c7801d | [
"MIT"
] | 7 | 2017-01-10T05:40:05.000Z | 2020-06-28T05:59:20.000Z | 2017/future/first_unique_character.py | littlepea/beijing-python-meetup | 393d7723bc092ae548fe4e6ed82aa30ee3c7801d | [
"MIT"
] | 3 | 2017-09-19T09:12:31.000Z | 2018-10-31T06:35:21.000Z | """
Find the first non-repeated character in a string
https://www.codeeval.com/open_challenges/12/
"""
import unittest
def first_unique_character(s):
return
class FirstUniqueCharacterTest(unittest.TestCase):
def test_yellow(self):
self.assertEquals('y', first_unique_character('yellow'))
if __name... | 17.571429 | 64 | 0.731707 | import unittest
def first_unique_character(s):
return
class FirstUniqueCharacterTest(unittest.TestCase):
def test_yellow(self):
self.assertEquals('y', first_unique_character('yellow'))
if __name__ == '__main__':
unittest.main(exit=False)
| true | true |
f70974bd8c96a08043d013ab757fa388f47f81f6 | 1,832 | py | Python | tests/models.py | charkins/boolean_parser | 10d42610cd13e4af5afec1fdfda53a4de0e2d00c | [
"BSD-3-Clause"
] | 6 | 2020-09-25T06:55:37.000Z | 2022-03-24T20:17:11.000Z | tests/models.py | charkins/boolean_parser | 10d42610cd13e4af5afec1fdfda53a4de0e2d00c | [
"BSD-3-Clause"
] | 6 | 2020-11-10T16:32:30.000Z | 2022-03-31T20:59:33.000Z | tests/models.py | charkins/boolean_parser | 10d42610cd13e4af5afec1fdfda53a4de0e2d00c | [
"BSD-3-Clause"
] | 1 | 2020-12-16T12:19:11.000Z | 2020-12-16T12:19:11.000Z | # !/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: models.py
# Project: tests
# Author: Brian Cherinka
# Created: Friday, 15th February 2019 2:44:13 pm
# License: BSD 3-clause "New" or "Revised" License
# Copyright (c) 2019 Brian Cherinka
# Last Modified: Sunday, 3rd March 2019 4:47:18 pm
# Modified By: Brian... | 29.079365 | 79 | 0.704694 |
from __future__ import print_function, division, absolute_import
from sqlalchemy import Column, String, BigInteger, Integer, Float
from .database import Base, engine, Session
import factory
import factory.fuzzy
from pytest_factoryboy import register
class ModelA(Base):
__tablename__ = 'modela'
pk = Column(... | true | true |
f7097552e3f4f3c653e56165e572f774956c3add | 6,585 | py | Python | env/lib/python3.6/site-packages/scipy/optimize/tests/test__spectral.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/lib/python3.7/site-packages/scipy/optimize/tests/test__spectral.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/lib/python3.7/site-packages/scipy/optimize/tests/test__spectral.py | John1001Song/Big-Data-Robo-Adviser | 9444dce96954c546333d5aecc92a06c3bfd19aa5 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | from __future__ import division, absolute_import, print_function
import itertools
import numpy as np
from numpy import exp
from numpy.testing import assert_, assert_equal
from scipy.optimize import root
def test_performance():
# Compare performance results to those listed in
# [Cheng & Li, IMA J. Num. An. ... | 31.208531 | 120 | 0.528929 | from __future__ import division, absolute_import, print_function
import itertools
import numpy as np
from numpy import exp
from numpy.testing import assert_, assert_equal
from scipy.optimize import root
def test_performance():
#
# Where the results disagree, the largest limits are taken... | true | true |
f70975b2a600c129a02d2b7302e2595d0a4aa9c1 | 138 | py | Python | src/apps/cecyrd/config.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | src/apps/cecyrd/config.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | 48 | 2017-04-21T17:35:23.000Z | 2020-08-29T04:19:35.000Z | src/apps/cecyrd/config.py | SGC-Tlaxcala/cerebro | 6c842f66d849065a70002fccdb1eaca1e3d61d99 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class CecyrdConfig(AppConfig):
name = 'apps.cecyrd'
verbose_name = 'Evaluación del proveedor'
| 19.714286 | 45 | 0.746377 | from django.apps import AppConfig
class CecyrdConfig(AppConfig):
name = 'apps.cecyrd'
verbose_name = 'Evaluación del proveedor'
| true | true |
f70975e19b9a44269656d1320aa5ab33699c0fbe | 120,184 | py | Python | pandas/core/indexes/multi.py | FlingeR/pandas | 01f399854f9febefa9e97005f3720aa312409b98 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/multi.py | FlingeR/pandas | 01f399854f9febefa9e97005f3720aa312409b98 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/multi.py | FlingeR/pandas | 01f399854f9febefa9e97005f3720aa312409b98 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
)
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import algos as libalgos, index as libindex, lib
from pandas.... | 33.769036 | 88 | 0.537601 | from sys import getsizeof
from typing import (
TYPE_CHECKING,
Any,
Hashable,
Iterable,
List,
Optional,
Sequence,
Tuple,
Union,
)
import warnings
import numpy as np
from pandas._config import get_option
from pandas._libs import algos as libalgos, index as libindex, lib
from pandas.... | true | true |
f70976272c40dc0ae0eee0a064546febb929a4e0 | 347 | py | Python | src/sql/master/stock_item_group.py | springmaple/yotimes_sql_bridge | 0d1d17c63d867bb2c2ad286851343c1884fdddf8 | [
"Apache-2.0"
] | null | null | null | src/sql/master/stock_item_group.py | springmaple/yotimes_sql_bridge | 0d1d17c63d867bb2c2ad286851343c1884fdddf8 | [
"Apache-2.0"
] | 4 | 2020-06-02T14:29:17.000Z | 2021-05-16T09:13:52.000Z | src/sql/master/stock_item_group.py | springmaple/yotimes_sql_bridge | 0d1d17c63d867bb2c2ad286851343c1884fdddf8 | [
"Apache-2.0"
] | null | null | null | from sql.entity import Entity
class StockItemGroup(Entity):
def __init__(self, data):
super().__init__(data)
self.code = self._get_str('Code') # Primary Key
self.description = self._get_str('Description')
self.is_active = self._get_bool('IsActive')
self.last_modified = sel... | 31.545455 | 58 | 0.67147 | from sql.entity import Entity
class StockItemGroup(Entity):
def __init__(self, data):
super().__init__(data)
self.code = self._get_str('Code') self.description = self._get_str('Description')
self.is_active = self._get_bool('IsActive')
self.last_modified = self._get_int('La... | true | true |
f70977cc983222645bc9a20cd05075c26c497868 | 456 | py | Python | src/slime/core/utils.py | ihmeuw-msca/SLIME | 255dfc6fc1880545f1ca9a5062eff823571cc025 | [
"MIT"
] | null | null | null | src/slime/core/utils.py | ihmeuw-msca/SLIME | 255dfc6fc1880545f1ca9a5062eff823571cc025 | [
"MIT"
] | null | null | null | src/slime/core/utils.py | ihmeuw-msca/SLIME | 255dfc6fc1880545f1ca9a5062eff823571cc025 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
utils
~~~~~
"""
import numpy as np
def sizes_to_indices(sizes):
"""Converting sizes to corresponding indices.
Args:
sizes (numpy.dnarray):
An array consist of non-negative number.
Returns:
list{range}:
List the indices.
"""
... | 19 | 52 | 0.537281 | import numpy as np
def sizes_to_indices(sizes):
u_id = np.cumsum(sizes)
l_id = np.insert(u_id[:-1], 0, 0)
return [
np.arange(l, u) for l, u in zip(l_id, u_id)
]
| true | true |
f70978299ac9e682f5cdb99a7396541fd08c115c | 2,119 | py | Python | youtube_dl/extractor/unistra.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 1 | 2015-02-19T13:13:47.000Z | 2015-02-19T13:13:47.000Z | youtube_dl/extractor/unistra.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 2 | 2019-05-20T12:46:30.000Z | 2020-11-07T12:50:32.000Z | youtube_dl/extractor/unistra.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | 5 | 2020-10-25T09:18:58.000Z | 2021-05-23T22:57:55.000Z | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_v... | 31.626866 | 97 | 0.511562 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_v... | true | true |
f70978813547c167df85dc88b5887caeeabba537 | 2,408 | py | Python | lab-12-2-char-seq-rnn.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | lab-12-2-char-seq-rnn.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | lab-12-2-char-seq-rnn.py | KANG91/Deep_Learning | e3e9de769ab835215d0ebeee79ff869afbe64ebf | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
tf.set_random_seed(777) # reproducibility
sample = " if you want you"
idx2char = list(set(sample)) # index -> char
char2idx = {c: i for i, c in enumerate(idx2char)} # char -> idex
# hyper parameters
dic_size = len(char2idx) # RNN input size (one hot size)
rnn_hidden_size... | 36.484848 | 75 | 0.71387 | import tensorflow as tf
import numpy as np
tf.set_random_seed(777)
sample = " if you want you"
idx2char = list(set(sample)) char2idx = {c: i for i, c in enumerate(idx2char)}
dic_size = len(char2idx) rnn_hidden_size = len(char2idx) num_classes = len(char2idx) batch_size = 1 sequence_length = len(sample) - 1
s... | true | true |
f70979275ff6133599e91195e91f814fe1e7645d | 10,392 | py | Python | p2_continuous-control/agent_ddpg.py | zhulingchen/deep-reinforcement-learning | 193486659e17861208fa0a8703487e7be5868ff9 | [
"MIT"
] | null | null | null | p2_continuous-control/agent_ddpg.py | zhulingchen/deep-reinforcement-learning | 193486659e17861208fa0a8703487e7be5868ff9 | [
"MIT"
] | 4 | 2020-09-26T00:50:40.000Z | 2022-02-10T00:43:36.000Z | p2_continuous-control/agent_ddpg.py | zhulingchen/deep-reinforcement-learning | 193486659e17861208fa0a8703487e7be5868ff9 | [
"MIT"
] | null | null | null | import numpy as np
import random
import copy
from collections import namedtuple, deque
import torch
import torch.nn.functional as F
import torch.optim as optim
from model_ddpg import Actor, Critic
from replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
BUFFER_SIZE = int(1e6) # replay buffer size
START_SIZE = ... | 44.410256 | 124 | 0.610277 | import numpy as np
import random
import copy
from collections import namedtuple, deque
import torch
import torch.nn.functional as F
import torch.optim as optim
from model_ddpg import Actor, Critic
from replay_buffer import ReplayBuffer, PrioritizedReplayBuffer
BUFFER_SIZE = int(1e6) START_SIZE = 1024 BATCH_SIZE... | true | true |
f7097ac4b4a333a6d31d512970f1db16724cdd27 | 30,578 | py | Python | src/python/system/environment.py | acrofrank/clusterfuzz | 4b3c8b6e3beff5299f642ee139cad57c1061974f | [
"Apache-2.0"
] | 1 | 2019-11-09T23:09:00.000Z | 2019-11-09T23:09:00.000Z | src/python/system/environment.py | acrofrank/clusterfuzz | 4b3c8b6e3beff5299f642ee139cad57c1061974f | [
"Apache-2.0"
] | null | null | null | src/python/system/environment.py | acrofrank/clusterfuzz | 4b3c8b6e3beff5299f642ee139cad57c1061974f | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.588843 | 80 | 0.715482 |
from builtins import range
import ast
import functools
import os
import re
import six
import socket
import sys
import yaml
try:
from shlex import quote
except ImportError:
from pipes import quote
SUPPORTED_MEMORY_TOOLS_FOR_OPTIONS = [
'HWASAN', 'ASAN', 'CFI', 'MSAN', 'TSAN', 'UBSAN'
]
SANITIZER_NAME_MAP = {... | true | true |
f7097b11985e8d3d6942661393042492e18ebdfc | 18,311 | py | Python | python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py | muxiaoqi/Paddle | 9291c7019ae6287b5b88da138bf6bb1d3d1d8bba | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py | muxiaoqi/Paddle | 9291c7019ae6287b5b88da138bf6bb1d3d1d8bba | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/dygraph/dygraph_to_static/loop_transformer.py | muxiaoqi/Paddle | 9291c7019ae6287b5b88da138bf6bb1d3d1d8bba | [
"Apache-2.0"
] | null | null | null | # 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 app... | 36.476096 | 103 | 0.597837 |
from __future__ import print_function
import copy
import gast
from collections import defaultdict
from paddle.fluid import unique_name
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import AstNodeWrapper
from paddle.fluid.dygraph.dygraph_to_static.static_analysis import StaticAnalysisVisitor
from paddle... | true | true |
f7097b887ec1a020df4865f96866666a50dcd027 | 1,589 | py | Python | api/tests/test_models.py | SP-Vita-Tolstikova/avt_checktwfriends | 2b5a77b1284b24ed189d8fb741a25221a15d0ab5 | [
"MIT"
] | null | null | null | api/tests/test_models.py | SP-Vita-Tolstikova/avt_checktwfriends | 2b5a77b1284b24ed189d8fb741a25221a15d0ab5 | [
"MIT"
] | null | null | null | api/tests/test_models.py | SP-Vita-Tolstikova/avt_checktwfriends | 2b5a77b1284b24ed189d8fb741a25221a15d0ab5 | [
"MIT"
] | null | null | null | """
Test module for NotFollowerTwFriend model
"""
from django.test import TestCase
from ..models import NotFollowerTwFriend
# Create your tests here.
class NotFollowerTwFriendTestCase(TestCase):
"""
Test class for NotFollowerTwFriend model
"""
def setUp(self):
NotFollowerTwFriend.objects.creat... | 44.138889 | 91 | 0.709251 | from django.test import TestCase
from ..models import NotFollowerTwFriend
class NotFollowerTwFriendTestCase(TestCase):
def setUp(self):
NotFollowerTwFriend.objects.create(
id_str='123456789',
screen_name='tw_user',
name='Twitter User',
created_at='Mon Jan 01... | true | true |
f7097b8c2b03efc35c14a367968343a8798ac543 | 1,798 | py | Python | app/templating/summary/block.py | uk-gov-mirror/ONSdigital.eq-survey-runner | b3a67a82347d024177f7fa6bf05499f47ece7ea5 | [
"MIT"
] | 27 | 2015-10-02T17:27:54.000Z | 2021-04-05T12:39:16.000Z | app/templating/summary/block.py | uk-gov-mirror/ONSdigital.eq-survey-runner | b3a67a82347d024177f7fa6bf05499f47ece7ea5 | [
"MIT"
] | 1,836 | 2015-09-16T09:59:03.000Z | 2022-03-30T14:27:06.000Z | app/templating/summary/block.py | uk-gov-mirror/ONSdigital.eq-survey-runner | b3a67a82347d024177f7fa6bf05499f47ece7ea5 | [
"MIT"
] | 20 | 2016-09-09T16:56:12.000Z | 2021-11-12T06:09:27.000Z | from flask import url_for
from app.questionnaire.rules import evaluate_skip_conditions
from app.templating.summary.question import Question
class Block:
def __init__(self, block_schema, group_id, answer_store, metadata, schema, group_instance):
self.id = block_schema['id']
self.title = block_sch... | 40.863636 | 121 | 0.640156 | from flask import url_for
from app.questionnaire.rules import evaluate_skip_conditions
from app.templating.summary.question import Question
class Block:
def __init__(self, block_schema, group_id, answer_store, metadata, schema, group_instance):
self.id = block_schema['id']
self.title = block_sch... | true | true |
f7097c0f0380fec1555929058faf1457682eb112 | 15,917 | py | Python | logicqubit/gates.py | clnrp/logicqubit | 516022186e2611eaf64a0683bcd70500695c6bbd | [
"Apache-2.0"
] | null | null | null | logicqubit/gates.py | clnrp/logicqubit | 516022186e2611eaf64a0683bcd70500695c6bbd | [
"Apache-2.0"
] | null | null | null | logicqubit/gates.py | clnrp/logicqubit | 516022186e2611eaf64a0683bcd70500695c6bbd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
# Author Cleoner S. Pietralonga
# e-mail: cleonerp@gmail.com
# Apache License
from cmath import *
from logicqubit.hilbert import *
"""
In this class, the numerical definition of operators is performed,
and the quantum gates methods performs the tensor product with the matri... | 39.594527 | 120 | 0.540177 |
from cmath import *
from logicqubit.hilbert import *
class Gates(Hilbert):
def __init__(self, number_of_qubits=1):
self.__number_of_qubits = number_of_qubits
def ID(self):
M = Matrix([[1, 0], [0, 1]], self.getCuda())
return M
def P0(self):
M = Matrix([[1, 0], [... | true | true |
f7097ce5e9c1d1df1ec6a26a98baacb0e39f483a | 2,709 | py | Python | plugins/module_utils/zpa_trusted_networks.py | willguibr/zpacloud_ansible | 1d95e004ffccbcef787640ccea625bb051083414 | [
"Apache-2.0"
] | 1 | 2022-02-23T08:26:45.000Z | 2022-02-23T08:26:45.000Z | plugins/module_utils/zpa_trusted_networks.py | willguibr/zpacloud_ansible | 1d95e004ffccbcef787640ccea625bb051083414 | [
"Apache-2.0"
] | 2 | 2022-02-23T21:08:09.000Z | 2022-03-01T16:45:29.000Z | plugins/module_utils/zpa_trusted_networks.py | willguibr/zpacloud-ansible | 1d95e004ffccbcef787640ccea625bb051083414 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.willguibr.zpacloud.plugins.module_utils.zpa_client import (
ZPAClientHelper,
delete_none,
)
class TrustedNetworksService:
def __init__(self, module, customer_id):
self.module = module
... | 33.036585 | 86 | 0.590993 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible_collections.willguibr.zpacloud.plugins.module_utils.zpa_client import (
ZPAClientHelper,
delete_none,
)
class TrustedNetworksService:
def __init__(self, module, customer_id):
self.module = module
... | true | true |
f7097d15c9ecb42b5428f69937bba55aab9bc051 | 204 | py | Python | showdown/admin.py | sunshinejen/boardgameshowdown- | 5e9b9765aba1680464d0a0ccb591019f510ed284 | [
"Apache-2.0"
] | null | null | null | showdown/admin.py | sunshinejen/boardgameshowdown- | 5e9b9765aba1680464d0a0ccb591019f510ed284 | [
"Apache-2.0"
] | null | null | null | showdown/admin.py | sunshinejen/boardgameshowdown- | 5e9b9765aba1680464d0a0ccb591019f510ed284 | [
"Apache-2.0"
] | 1 | 2019-10-16T05:57:13.000Z | 2019-10-16T05:57:13.000Z | from django.contrib import admin
from .models import BoardGame, Participant, Event
# Register your models here.
admin.site.register(BoardGame)
admin.site.register(Participant)
admin.site.register(Event)
| 25.5 | 49 | 0.818627 | from django.contrib import admin
from .models import BoardGame, Participant, Event
admin.site.register(BoardGame)
admin.site.register(Participant)
admin.site.register(Event)
| true | true |
f7097e8a7d68efba02074bc095cee9e2b8faf45a | 6,536 | py | Python | chb/simulation/SimSharedMemory.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/simulation/SimSharedMemory.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | chb/simulation/SimSharedMemory.py | kestreltechnology/CodeHawk-Binary | aa0b2534e0318e5fb3770ec7b4d78feb0feb2394 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# CodeHawk Binary Analyzer
# Author: Henny Sipma
# ------------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2021 Aarno Labs LLC
#
# Permission is hereby granted, free of ... | 36.926554 | 87 | 0.564259 |
from typing import Dict, List, Optional, TYPE_CHECKING
from chb.simulation.SimMemory import SimMemory
import chb.simulation.SimSymbolicValue as SSV
import chb.simulation.SimUtil as SU
import chb.simulation.SimValue as SV
import chb.util.fileutil as UF
if TYPE_CHECKING:
from chb.simulation.SimulationState import... | true | true |
f7097ff6a7ec39265a96dc285dc2098161c3638d | 7,274 | py | Python | src/compas/datastructures/mesh/remesh.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | src/compas/datastructures/mesh/remesh.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | src/compas/datastructures/mesh/remesh.py | mpopescu/compas | 55f259607deea501f862cbaea79bd97d7e56ead6 | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.datastructures.mesh.smoothing import mesh_smooth_area
from compas.datastructures.mesh.operations import trimesh_collapse_edge
from compas.datastructures.mesh.operations import trimesh_swap_edge
from... | 30.057851 | 111 | 0.532444 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.datastructures.mesh.smoothing import mesh_smooth_area
from compas.datastructures.mesh.operations import trimesh_collapse_edge
from compas.datastructures.mesh.operations import trimesh_swap_edge
from... | true | true |
f7098021d6e538e37a267ecd884e0a951ed9d92e | 7,124 | py | Python | tests/samsung_multiroom/service/tunein/test_player_tuneinplayer.py | krygal/samsung_multiroom | 49172c4e54d092bfc6dab07245b526c442eb18bc | [
"MIT"
] | 6 | 2019-04-05T19:10:39.000Z | 2021-11-23T17:26:49.000Z | tests/samsung_multiroom/service/tunein/test_player_tuneinplayer.py | krygal/samsung_multiroom | 49172c4e54d092bfc6dab07245b526c442eb18bc | [
"MIT"
] | 3 | 2020-09-25T06:58:00.000Z | 2021-12-13T19:57:50.000Z | tests/samsung_multiroom/service/tunein/test_player_tuneinplayer.py | krygal/samsung_multiroom | 49172c4e54d092bfc6dab07245b526c442eb18bc | [
"MIT"
] | 4 | 2019-04-05T18:58:11.000Z | 2021-07-22T19:54:56.000Z | import unittest
from unittest.mock import MagicMock
from samsung_multiroom.service import REPEAT_ALL
from samsung_multiroom.service import REPEAT_OFF
from samsung_multiroom.service.tunein import TuneInPlayer
def _get_player():
api = MagicMock()
api.get_preset_list.return_value = [
{
'kind... | 29.196721 | 81 | 0.570606 | import unittest
from unittest.mock import MagicMock
from samsung_multiroom.service import REPEAT_ALL
from samsung_multiroom.service import REPEAT_OFF
from samsung_multiroom.service.tunein import TuneInPlayer
def _get_player():
api = MagicMock()
api.get_preset_list.return_value = [
{
'kind... | true | true |
f7098042ebd4d6b3712d3077e4abbae48228ad11 | 620 | py | Python | examples/sample.py | rayattack/supersql | 0a592e7f303ac18b8df7bebac226b26f38f6d192 | [
"MIT"
] | 2 | 2019-11-04T00:19:30.000Z | 2020-10-04T01:24:04.000Z | examples/sample.py | tersoo/supersql | 4d20bd72a9de50e485ce79285c355a1a7ac04b55 | [
"MIT"
] | 2 | 2021-03-31T14:07:04.000Z | 2021-03-31T14:07:20.000Z | examples/sample.py | tersoo/supersql | 4d20bd72a9de50e485ce79285c355a1a7ac04b55 | [
"MIT"
] | 2 | 2021-03-30T21:40:14.000Z | 2022-03-17T20:52:25.000Z |
query += f"""
SELECT country,"""
for days in test_days_list:
query += f"""
P_alive_{days}d,
pcii_forecast_{days}d,
n_order_forecast_{days}d,
COALESCE(s{days}d.pcii_actual, 0) pcii_actual_{days}d,
CAST(COALESCE(s{days}d.n_order_actual, 0) AS DOUBLE) n_order_actual_{days}d,
CASE WHEN s{days}d.n_order_actual>0 THEN true... | 25.833333 | 80 | 0.724194 |
query += f"""
SELECT country,"""
for days in test_days_list:
query += f"""
P_alive_{days}d,
pcii_forecast_{days}d,
n_order_forecast_{days}d,
COALESCE(s{days}d.pcii_actual, 0) pcii_actual_{days}d,
CAST(COALESCE(s{days}d.n_order_actual, 0) AS DOUBLE) n_order_actual_{days}d,
CASE WHEN s{days}d.n_order_actual>0 THEN true... | false | true |
f709807e8a6d21ec7d63e906aec6a61cbd27f4f0 | 7,733 | py | Python | src/egypt_model_test.py | DylanFouche/EGYPT | baa3d7cd1dc657a89a4e072b4d175e8255114961 | [
"MIT"
] | 1 | 2021-03-14T22:44:09.000Z | 2021-03-14T22:44:09.000Z | src/egypt_model_test.py | DylanFouche/EGYPT | baa3d7cd1dc657a89a4e072b4d175e8255114961 | [
"MIT"
] | null | null | null | src/egypt_model_test.py | DylanFouche/EGYPT | baa3d7cd1dc657a89a4e072b4d175e8255114961 | [
"MIT"
] | null | null | null | import egypt_model
import unittest
class TestAggregateMethods(unittest.TestCase):
def test_aggregates(self):
model = egypt_model.EgyptModel(31, 30, starting_settlements=9, starting_households=5, starting_household_size=5, starting_grain=1000)
self.assertEqual(egypt_model.compute_total_population(... | 43.201117 | 146 | 0.709298 | import egypt_model
import unittest
class TestAggregateMethods(unittest.TestCase):
def test_aggregates(self):
model = egypt_model.EgyptModel(31, 30, starting_settlements=9, starting_households=5, starting_household_size=5, starting_grain=1000)
self.assertEqual(egypt_model.compute_total_population(... | true | true |
f709816f89e0bcceb3dc86f45da921b110797cce | 403 | py | Python | lantz/drivers/sutter/__init__.py | noelniles/lantz | 08b5d23674566e200e24d8baf13e454a0917cb58 | [
"BSD-3-Clause"
] | 88 | 2015-02-10T09:49:53.000Z | 2021-11-21T20:17:44.000Z | lantz/drivers/sutter/__init__.py | varses/awsch | 6fbff4dd293d4110d002d477d2642a7e75cc9ace | [
"BSD-3-Clause"
] | 34 | 2015-02-08T05:35:21.000Z | 2021-01-04T17:45:00.000Z | lantz/drivers/sutter/__init__.py | varses/awsch | 6fbff4dd293d4110d002d477d2642a7e75cc9ace | [
"BSD-3-Clause"
] | 38 | 2015-02-11T07:25:52.000Z | 2021-11-05T02:41:53.000Z | # -*- coding: utf-8 -*-
"""
lantz.drivers.sutter
~~~~~~~~~~~~~~~~~~~~
:company: Sutter Instrument.
:description: Biomedical and scientific instrumentation.
:website: http://www.sutter.com/
---
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE ... | 21.210526 | 68 | 0.62531 |
from .lambda103 import Lambda103
__all__ = ['Lambda103', ]
| true | true |
f709817624225eac19cd625a3048f72b03e64a4b | 382 | py | Python | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | wsgi.py | iamsayem/smart-editor | 012ad2775cd33247642c629a2a92ec89e4462412 | [
"MIT"
] | null | null | null | """
WSGI config for editor 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.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTIN... | 22.470588 | 78 | 0.782723 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
application = get_wsgi_application()
| true | true |
f7098178cdc1fe45aac531ccf83efb684e2e1369 | 12,691 | py | Python | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/docker/target_types.py | xyzst/pants | d6a357fe67ee7e8e1aefeae625e107f5609f1717 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os
import re
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import Callable, ClassVar, Iterator, Optional, cast
fro... | 38.574468 | 120 | 0.643685 |
from __future__ import annotations
import os
import re
from abc import ABC, abstractmethod
from textwrap import dedent
from typing import Callable, ClassVar, Iterator, Optional, cast
from typing_extensions import final
from pants.backend.docker.registries import ALL_DEFAULT_REGISTRIES
from pants.base.build_environm... | true | true |
f70982161030e47bcbd5ca140e005db20ffc06d5 | 1,694 | py | Python | test/writing/test_minimize.py | backwardn/policy_sentry | 6676fba80b00bcfb3d3884ce5777168a9bbcbf71 | [
"MIT"
] | 1 | 2020-07-20T16:16:30.000Z | 2020-07-20T16:16:30.000Z | test/writing/test_minimize.py | avineshwar/policy_sentry | 1b52b50d97293109ac54350a6c09e48643c7170d | [
"MIT"
] | 14 | 2020-05-06T21:34:17.000Z | 2021-03-05T01:04:06.000Z | test/writing/test_minimize.py | Mohib-hub/policy_sentry | d04a69eb7cce2e184c986e0a364b57eea01ef4da | [
"MIT"
] | null | null | null | import unittest
from policy_sentry.writing.minimize import minimize_statement_actions
from policy_sentry.querying.all import get_all_actions
class MinimizeWildcardActionsTestCase(unittest.TestCase):
def test_minimize_statement_actions(self):
actions_to_minimize = [
"kms:CreateGrant",
... | 37.644444 | 101 | 0.656434 | import unittest
from policy_sentry.writing.minimize import minimize_statement_actions
from policy_sentry.querying.all import get_all_actions
class MinimizeWildcardActionsTestCase(unittest.TestCase):
def test_minimize_statement_actions(self):
actions_to_minimize = [
"kms:CreateGrant",
... | true | true |
f709848ee6e175d33f02d22031606644dbbc1dcf | 3,364 | py | Python | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 1 | 2022-03-24T04:47:38.000Z | 2022-03-24T04:47:38.000Z | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 1 | 2021-09-22T12:53:39.000Z | 2021-09-22T12:53:39.000Z | ckanext/example_theme_docs/custom_emails/test_custom_emails.py | robin-NEC/ckan | 71a82c4b0bb499fd3a6d1ccfd038b2231f50f92a | [
"BSD-3-Clause"
] | 2 | 2018-01-21T17:03:08.000Z | 2019-07-23T08:49:52.000Z | # encoding: utf-8
import os
import pytest
import ckan.model as model
import ckan.lib.mailer as mailer
from ckan.tests import factories
from ckan.lib.base import render
from ckan.common import config
from ckan.tests.lib.test_mailer import MailerBase
@pytest.mark.usefixtures("with_request_context", "clean_db", "wit... | 32.660194 | 77 | 0.636445 |
import os
import pytest
import ckan.model as model
import ckan.lib.mailer as mailer
from ckan.tests import factories
from ckan.lib.base import render
from ckan.common import config
from ckan.tests.lib.test_mailer import MailerBase
@pytest.mark.usefixtures("with_request_context", "clean_db", "with_plugins")
@pytes... | true | true |
f709850ca1f40d6a987f9f5e257bf3085fc0b583 | 2,646 | py | Python | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | .history/mercari/mercari_search_20201124185000.py | KustomApe/nerdape | aef6fb2d1f8c364b26d91bf8570b4487a24de69a | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pandas as pd
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import PyQt5
import time
"""[Initial Settings]
初期設定
"""
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.a... | 37.267606 | 93 | 0.637188 | from selenium import webdriver
from selenium.webdriver.support.ui import Select
import pandas as pd
import re
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import PyQt5
import time
options = webdriver.ChromeOptions()
options.add_argument('--headeless')
options.add_argument('--disable-gpu')
op... | true | true |
f70985406baacff2698cda8db75a4fcb1039b24d | 14,992 | py | Python | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | Feature_Extraction.py | peiyan1234/NTU_UpperTUC_biomed | f96766aa3f4de8cd9f37d252bd0f063d8f841069 | [
"MIT"
] | null | null | null | import argparse
import os
import glob
import copy
import csv
import json
import numpy as np
from PIL import Image
import nrrd
import radiomics
from radiomics import featureextractor
import SimpleITK as sitk
_pwd_ = os.getcwd()
data_Table = {}
Feature_Table = {}
hyperparameters = {}
hyperparameters['setting'] = ... | 28.02243 | 116 | 0.480123 | import argparse
import os
import glob
import copy
import csv
import json
import numpy as np
from PIL import Image
import nrrd
import radiomics
from radiomics import featureextractor
import SimpleITK as sitk
_pwd_ = os.getcwd()
data_Table = {}
Feature_Table = {}
hyperparameters = {}
hyperparameters['setting'] = ... | true | true |
f70985996cf54c23bb1a95550c2daac3207fa3fb | 209 | py | Python | backend/common/context_processors.py | olegpobedynskyi/Boilerplate-React-Django | 79281a6254be3402bbe1c8216c98b84750f54646 | [
"MIT"
] | 3 | 2020-02-06T01:06:29.000Z | 2020-05-20T14:25:22.000Z | backend/common/context_processors.py | olegpobedynskyi/Boilerplate-React-Django | 79281a6254be3402bbe1c8216c98b84750f54646 | [
"MIT"
] | 19 | 2020-02-11T04:54:40.000Z | 2022-02-26T23:03:01.000Z | backend/common/context_processors.py | davidpierre21/repository-monitor | 0be5fbf1d5d404aa9e4952a0f02a44f1662efa91 | [
"MIT"
] | 2 | 2021-01-28T16:00:01.000Z | 2021-06-15T03:49:20.000Z | from django.conf import settings
def sentry_dsn(request):
return {
'SENTRY_DSN': settings.SENTRY_DSN
}
def commit_sha(request):
return {
'COMMIT_SHA': settings.COMMIT_SHA
}
| 14.928571 | 41 | 0.650718 | from django.conf import settings
def sentry_dsn(request):
return {
'SENTRY_DSN': settings.SENTRY_DSN
}
def commit_sha(request):
return {
'COMMIT_SHA': settings.COMMIT_SHA
}
| true | true |
f70985d82af1b1b1998df20a8a2b05d172b02237 | 3,927 | py | Python | Software/PitftGraphicLib.py | Hackin7/BlockComPi | 36938e219b42c5d220db0a64e4718e95720c4850 | [
"X11"
] | null | null | null | Software/PitftGraphicLib.py | Hackin7/BlockComPi | 36938e219b42c5d220db0a64e4718e95720c4850 | [
"X11"
] | null | null | null | Software/PitftGraphicLib.py | Hackin7/BlockComPi | 36938e219b42c5d220db0a64e4718e95720c4850 | [
"X11"
] | null | null | null | #Based on gerthvh's menu_8button.py
#BlockComPhone PitftGraphicLib v0.1 For Portrait Pitft Only
import sys, pygame
from pygame.locals import *
import time
import subprocess
import os
from subprocess import *
#os.system('adafruit-pitft-touch-cal -f') #Confirm orentation #But TOO Laggy
os.environ["SDL_FBDEV"] =... | 36.027523 | 148 | 0.645531 | #BlockComPhone PitftGraphicLib v0.1 For Portrait Pitft Only
import sys, pygame
from pygame.locals import *
import time
import subprocess
import os
from subprocess import *
#os.system('adafruit-pitft-touch-cal -f') #Confirm orentation #But TOO Laggy
os.environ["SDL_FBDEV"] = "/dev/fb1"
os.environ["SDL_MOUSEDEV... | false | true |
f70985e843e47bc768ffb3a11799ccf0e11fff29 | 1,454 | py | Python | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | mlcollect/cnn/lenet.py | sanghuynh1501/mlcollect | e85fe6a08e14fa6502166c1a7bfffdcd8c3a25b2 | [
"MIT"
] | null | null | null | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
clas... | 35.463415 | 78 | 0.652682 | from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D
from tensorflow.keras.layers import MaxPooling2D
from tensorflow.keras.layers import Activation
from tensorflow.keras.layers import Flatten
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
clas... | true | true |
f709888e7bb1e2b7e0336cde6b0426fffa9cbec5 | 896 | py | Python | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | 2 | 2020-01-23T02:03:19.000Z | 2020-12-13T09:05:45.000Z | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | null | null | null | lightutils/sys/path.py | smilelight/lightUtils | e9b7ed35ed50cf6b7c6284fe60918ce4dc71beac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import sys
from ..common.file import get_file_name
from ..common.log import logger
def add_sys_path(file_path: str, project_name: str):
if not os.path.exists(file_path):
raise FileNotFoundError("{} not found".format(file_path))
flag = False
parent_path = os.path.... | 28.903226 | 68 | 0.637277 | import os
import sys
from ..common.file import get_file_name
from ..common.log import logger
def add_sys_path(file_path: str, project_name: str):
if not os.path.exists(file_path):
raise FileNotFoundError("{} not found".format(file_path))
flag = False
parent_path = os.path.abspath(file_path)
p... | true | true |
f70988d5b64503f0de01827901e8b85c32db26c7 | 2,832 | py | Python | theano/gof/__init__.py | JimmyRetza/Theano | 72d83bce0d547d54ab3513bcba35c166979f7a6f | [
"BSD-3-Clause"
] | 9 | 2018-10-29T20:25:25.000Z | 2021-11-17T11:03:17.000Z | theano/gof/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | theano/gof/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2020-01-06T20:28:42.000Z | 2020-01-06T20:28:42.000Z | """
gof.py
gof stands for Graph Optimization Framework.
The gof submodule of theano implements a framework
for manipulating programs described as graphs. The
gof module defines basic theano graph concepts:
-Apply nodes, which represent the application
of an Op to Variables. Together these make up a
graph.
-Th... | 31.120879 | 77 | 0.784958 | from __future__ import absolute_import, print_function, division
from theano.gof.cc import \
CLinker, OpWiseCLinker, DualLinker, HideC
from theano.gof.fg import \
CachedConstantError, InconsistencyError, MissingInputError, FunctionGraph
from theano.gof.destroyhandler import \
DestroyHandler
from theano.... | true | true |
f7098960057372652381a92072a1f17f38411d41 | 8,769 | py | Python | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | models.py | mattj241/FSWD_Capstone | a677f44ec5b6fc3c360d1cb94399c8d99bb6df00 | [
"MIT"
] | null | null | null | import os
import enum
from typing import Counter
from sqlalchemy import Column, String, Integer, create_engine
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import... | 28.015974 | 83 | 0.638841 | import os
import enum
from typing import Counter
from sqlalchemy import Column, String, Integer, create_engine
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import... | true | true |
f7098a56d5bc500eb89b46ae24674e262cb9574f | 3,747 | py | Python | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 136 | 2016-01-03T10:58:24.000Z | 2022-03-20T23:01:24.000Z | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 27 | 2016-04-30T05:41:18.000Z | 2022-02-26T12:00:36.000Z | pdf2pdfocr_multibackground.py | browntownington/pdf2pdfocr | 21b8dc2bdaa9d059b2c858c27dd05a9a26235371 | [
"Apache-2.0"
] | 22 | 2016-04-30T04:34:54.000Z | 2021-08-30T21:01:13.000Z | #!/usr/bin/env python3
##############################################################################
# Copyright (c) 2016: Leonardo Cardoso
# https://github.com/LeoFCardoso/pdf2pdfocr
##############################################################################
# Emulate pdftk multibackground operator
# $1 - first fi... | 39.03125 | 103 | 0.621564 | import datetime
import sys
from PyPDF2 import PdfFileWriter, PdfFileReader
__author__ = 'Leonardo F. Cardoso'
verbose_mode = False
def debug(param):
try:
if verbose_mode:
tstamp = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
print("[{0}] [DEBUG]\t{1}".format(tstamp,... | true | true |
f7098a7742e9c2007808daa26f100d2b2cd86f4a | 2,913 | py | Python | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | 1 | 2022-01-18T09:19:38.000Z | 2022-01-18T09:19:38.000Z | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | null | null | null | echoscope/__main__.py | treeyh/echoscope | ef8933ce9a5dfe2ac8fb6e82bad8d5fa0d72a6da | [
"MIT"
] | 1 | 2022-01-18T09:19:39.000Z | 2022-01-18T09:19:39.000Z | # -*- coding: UTF-8 -*-
import sys
import logging
import argparse
import shutil
from typing import Dict, List
from echoscope.util import file_util, log_util
from echoscope.config import config
from echoscope.model import config_model
from echoscope.source import source, mysql_source, clickhouse_source
from echoscope... | 26.724771 | 97 | 0.727085 |
import sys
import logging
import argparse
import shutil
from typing import Dict, List
from echoscope.util import file_util, log_util
from echoscope.config import config
from echoscope.model import config_model
from echoscope.source import source, mysql_source, clickhouse_source
from echoscope.generate import generat... | true | true |
f7098bc064dde2d58d31e842acddea9c250a8fbc | 600 | py | Python | db_downgrade.py | EddyCodeIt/SPA_Project_2016_Data_Rep-Quering | 1a23e14ecf41117aaaeedb277d6c5b17a03bab56 | [
"Apache-2.0"
] | null | null | null | db_downgrade.py | EddyCodeIt/SPA_Project_2016_Data_Rep-Quering | 1a23e14ecf41117aaaeedb277d6c5b17a03bab56 | [
"Apache-2.0"
] | null | null | null | db_downgrade.py | EddyCodeIt/SPA_Project_2016_Data_Rep-Quering | 1a23e14ecf41117aaaeedb277d6c5b17a03bab56 | [
"Apache-2.0"
] | null | null | null | # code source: https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-iv-database
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_UR... | 50 | 106 | 0.83 |
from migrate.versioning import api
from config import SQLALCHEMY_DATABASE_URI
from config import SQLALCHEMY_MIGRATE_REPO
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO)
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1)
print 'Current database version: ' + str(api.db_version(SQ... | false | true |
f7098c2080949e808ba6e5b35267749e8ad64cbe | 3,540 | py | Python | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 7 | 2019-12-21T00:14:14.000Z | 2021-03-11T14:51:37.000Z | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 29 | 2019-10-09T11:16:21.000Z | 2020-06-23T09:32:09.000Z | lib/kubernetes/client/models/v1_rolling_update_stateful_set_strategy.py | splunkenizer/splunk_as_a_service_app | 97c4aaf927d2171bf131126cf9b70489ac75bc5a | [
"Apache-2.0"
] | 1 | 2021-05-07T10:13:31.000Z | 2021-05-07T10:13:31.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteri... | 27.874016 | 108 | 0.55452 |
from pprint import pformat
from six import iteritems
import re
class V1RollingUpdateStatefulSetStrategy(object):
swagger_types = {
'partition': 'int'
}
attribute_map = {
'partition': 'partition'
}
def __init__(self, partition=None):
self._partit... | true | true |
f7098c6d7d019f59843b2349c02ec2b299bce038 | 18,212 | py | Python | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | optuna/visualization/matplotlib/_contour.py | keisukefukuda/optuna | ac4ea8d0c74726f8a603ba2cb0bfb7f4112f736e | [
"MIT"
] | null | null | null | from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
import scipy
from optuna._experimental import experimental
from optuna.logging import get_logger
from optuna.study import Study
from optuna.study... | 34.82218 | 99 | 0.621623 | from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Union
import numpy as np
import scipy
from optuna._experimental import experimental
from optuna.logging import get_logger
from optuna.study import Study
from optuna.study... | true | true |
f7098cc1020c0449102ed02912eddc4ceb9787ee | 58 | py | Python | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | hello world.py | RJ722/Repo-with-spaces | 7efd9dcb35a760d7fd02ef88f9bdde3b26a846bb | [
"MIT"
] | null | null | null | import this
def hello_world():
print("Hello World")
| 9.666667 | 24 | 0.672414 | import this
def hello_world():
print("Hello World")
| true | true |
f7098d8278771772864212ad3ce454b1a9c954ea | 710 | py | Python | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-05-24T10:08:51.000Z | 2021-05-24T10:08:51.000Z | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/_api/v2/compat/v2/sysconfig/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-01-28T01:57:41.000Z | 2021-01-28T01:57:41.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""System configuration library.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tenso... | 37.368421 | 82 | 0.856338 |
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.framework.versions import CXX11_ABI_FLAG
from tensorflow.python.framework.versions import MONOLITHIC_BUILD
from tensorflow.python.platform.sysconfig import get_build_info
from tensorflow.python.platform.sysconfig impor... | true | true |
f7098dfc12b93cf391e09b7933418a63cee34e7a | 5,447 | py | Python | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-MGX82XX-MODULE-RSRC-PART-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-MGX82XX-MODULE-RSRC-PART-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MGX82XX-MODULE-RSRC-PART-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:50:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using... | 123.795455 | 705 | 0.77382 | OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint = mibBuilder.impo... | true | true |
f7098ebb8ff1dfc1223860cb85b7c2ab64d03675 | 5,733 | py | Python | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | mlpipeline_analyzer/visualizer/PipelineDiagram.py | sravankr96/ml-pipeline-analyzer-ws | 6e6e336f2172643fdeb8034ea324362841dcade1 | [
"MIT"
] | null | null | null | from diagrams import Cluster, Diagram
from graphviz import Digraph
from .PipelineNode import PipelineNode
import sklearn
from sklearn import *
import regex as re
import warnings
#warnings.filterwarnings("ignore")
class PipelineDiagram:
def __init__(self, pipeline, file_name='ml_pipeline.png'):
self.pipe =... | 39.267123 | 136 | 0.570382 | from diagrams import Cluster, Diagram
from graphviz import Digraph
from .PipelineNode import PipelineNode
import sklearn
from sklearn import *
import regex as re
import warnings
class PipelineDiagram:
def __init__(self, pipeline, file_name='ml_pipeline.png'):
self.pipe = pipeline
self.title = 'Mac... | true | true |
f7098fb90676aab0b7bddddef5e52fc6f77ed958 | 1,642 | py | Python | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 5,279 | 2016-12-29T04:00:44.000Z | 2022-03-31T22:56:45.000Z | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 14,149 | 2016-12-28T00:43:50.000Z | 2022-03-31T23:50:22.000Z | sdks/python/apache_beam/typehints/row_type.py | NarimanAB/beam | 6cedbac5bb42304f4af88634edd276b0b78e4e4e | [
"Apache-2.0",
"BSD-3-Clause"
] | 3,763 | 2016-12-29T04:06:10.000Z | 2022-03-31T22:25:49.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 us... | 32.196078 | 74 | 0.727771 |
from apache_beam.typehints import typehints
class RowTypeConstraint(typehints.TypeConstraint):
def __init__(self, fields):
self._fields = tuple(fields)
def _consistent_with_check_(self, sub):
return self == sub
def type_check(self, instance):
from apache_beam import Row
return isinstance(ins... | true | true |
f70990d5f14342ae48272d9f8af48d74029ae394 | 18,002 | py | Python | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 493 | 2021-04-11T19:38:09.000Z | 2022-03-31T16:24:55.000Z | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 134 | 2021-04-10T00:09:00.000Z | 2022-03-31T06:41:05.000Z | external-deps/python-lsp-server/test/plugins/test_completion.py | Earthman100/spyder | 949ce0f9100a69504c70a5678e8589a05aee7d38 | [
"MIT"
] | 69 | 2021-04-14T21:09:17.000Z | 2022-03-30T05:55:38.000Z | # Copyright 2017-2020 Palantir Technologies, Inc.
# Copyright 2021- Python Language Server Contributors.
import math
import os
import sys
from pathlib import Path
from typing import NamedTuple, Dict
import pytest
from pylsp import uris, lsp
from pylsp.workspace import Document
from pylsp.plugins.jedi_completion imp... | 35.577075 | 116 | 0.679313 |
import math
import os
import sys
from pathlib import Path
from typing import NamedTuple, Dict
import pytest
from pylsp import uris, lsp
from pylsp.workspace import Document
from pylsp.plugins.jedi_completion import pylsp_completions as pylsp_jedi_completions
from pylsp.plugins.jedi_completion import pylsp_completio... | true | true |
f709914a96349d3d19379fbb812de6ce94a78611 | 1,591 | py | Python | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | 1 | 2022-01-11T21:05:33.000Z | 2022-01-11T21:05:33.000Z | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | null | null | null | youtube_mp3.py | sliatecinos/saladeaula | 35ee1a47f3a62c6e17d831b8b08bf209eab3305d | [
"Unlicense"
] | null | null | null | # ================================================================
# YouTube Downloader (.MP4 para .MP3) :: github.com/sliatecinos
# ================================================================
from pytube import YouTube
from pydub import AudioSegment
import os
import time
link = input('\nEntre com o link:')
yt... | 27.431034 | 83 | 0.615965 |
from pytube import YouTube
from pydub import AudioSegment
import os
import time
link = input('\nEntre com o link:')
yt = YouTube(link)
print('Titulo:\t',yt.title)
print('Nro. de views:\t',yt.views)
print('Tamanho:\t',yt.length)
print('Avaliaçoes:\t',yt.rating)
print('Publicado por:\t',yt.author)
video = yt.st... | true | true |
f709916599da40d4a4b314b76e753b26221d2c76 | 2,398 | py | Python | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | 3 | 2020-12-13T12:50:14.000Z | 2021-09-19T09:28:42.000Z | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | null | null | null | how_to_use_custom_keras_objects.py | XiaowanYi/Attention_vgg16 | 32c68ae048ea3f3de96c74a1df78d1f58894eee7 | [
"MIT"
] | 1 | 2021-05-29T08:43:28.000Z | 2021-05-29T08:43:28.000Z | """
This script has a few examples about how to use custom keras objects
which are defined in `keras_custom_objects`
"""
'''
1. Use a custom EarlyStopping criteria:
In our case, it is RelativeEarlyStopping which is to terminate training
if the monitored improvement between two epochs is le... | 47.96 | 115 | 0.610926 |
import keras_custom_objects as KO
custom_earlystopping = KO.RelativeEarlyStopping(monitor='val_loss',
min_perc_delta=0.001, patience=patience,
verbose=2,
... | true | true |
f7099171822142f65064fc71bc2ffdaf986681bf | 689 | py | Python | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | 1 | 2021-06-28T20:37:09.000Z | 2021-06-28T20:37:09.000Z | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | 2 | 2020-09-30T14:10:54.000Z | 2020-09-30T14:11:43.000Z | nw/tests/__init__.py | valhuber/Logic-Bank | 3f31b47786ce3fae53fd96af8795cd693e20547b | [
"BSD-3-Clause"
] | null | null | null | import os
from shutil import copyfile
from logic_bank.util import prt
def setup_db():
""" copy db/database-gold.db over db/database.db"""
print("\n" + prt("restoring database-gold\n"))
basedir = os.path.abspath(os.path.dirname(__file__))
basedir = os.path.dirname(basedir)
print("\n**************... | 32.809524 | 96 | 0.555878 | import os
from shutil import copyfile
from logic_bank.util import prt
def setup_db():
print("\n" + prt("restoring database-gold\n"))
basedir = os.path.abspath(os.path.dirname(__file__))
basedir = os.path.dirname(basedir)
print("\n********************************\n"
" IMPORTANT - create da... | true | true |
f70991fbf0ccbff4d648e3f23be1363474a8332b | 6,435 | py | Python | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | 6 | 2020-05-14T09:47:04.000Z | 2021-06-05T03:03:45.000Z | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | null | null | null | py_work/AI/ML/FeatureSelection.py | kotori-y/kotori_work | 51ebfdf49571ae34c246dc5b37cc86e25f4ccf3d | [
"MIT"
] | 4 | 2020-04-20T13:17:27.000Z | 2021-08-07T19:44:50.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun Mar 24 21:46:41 2019
You are not expected to understand my codes!
@Author: Kotori_Y
@Blog: blog.moyule.me
@Weibo: Kotori-Y
@Mail: yzjkid9@gmail.com
I love Megumi forerver!
"""
print(__doc__)
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection ... | 30.9375 | 141 | 0.524165 |
print(__doc__)
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split,KFold
from sklearn.metrics import accuracy_score,precision_score,recall_score
import pandas as pd
import time
import os
from tqdm import tqdm
kf = KFold(n_splits=5)
start = time.clock()
... | true | true |
f70993686240ee83242c38feb61999ddede668e5 | 8,456 | py | Python | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 3 | 2019-11-22T04:38:06.000Z | 2022-01-19T08:27:18.000Z | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 28 | 2018-02-01T20:39:42.000Z | 2018-04-26T17:25:23.000Z | anvil/utils/generic.py | AndresMWeber/Anvil | 9cd202183ac998983c2bf6e55cc46bbc0ca1a78e | [
"Apache-2.0"
] | 1 | 2018-03-11T06:47:26.000Z | 2018-03-11T06:47:26.000Z | from six import iteritems, itervalues
from collections import OrderedDict, MutableMapping, Iterable
from functools import wraps
import anvil.config as cfg
def to_list(query):
if isinstance(query, list):
return query
elif isinstance(query, str):
return [query]
elif isinstance(query, dict):
... | 31.670412 | 117 | 0.626301 | from six import iteritems, itervalues
from collections import OrderedDict, MutableMapping, Iterable
from functools import wraps
import anvil.config as cfg
def to_list(query):
if isinstance(query, list):
return query
elif isinstance(query, str):
return [query]
elif isinstance(query, dict):
... | true | true |
f709949ef53472ddbc169d6ea68a3922395cec12 | 49,392 | py | Python | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | 1 | 2022-02-22T09:27:22.000Z | 2022-02-22T09:27:22.000Z | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | null | null | null | core/domain/rights_manager.py | mzaman07/oppia | cac5737ba63a0a209d47d20f3b464495da12bd59 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# 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 requi... | 35.381089 | 80 | 0.695396 |
from __future__ import absolute_import from __future__ import unicode_literals
import copy
import logging
from constants import constants
from core.domain import activity_services
from core.domain import change_domain
from core.domain import role_services
from core.domain import subscription_services
from core.do... | true | true |
f709949f002c77e7ca71cbfadd25bd0c223af1b8 | 18,637 | py | Python | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | 3 | 2019-02-28T16:05:33.000Z | 2020-05-03T21:29:03.000Z | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | null | null | null | vispy/visuals/line/line.py | jni/vispy | 8b61cd439076aa3f50ac5f6dacb4c0af8c1d0684 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Line visual implementing Agg- and GL-based drawing modes.
"""
from __future__ import division
import numpy as np
from ... import gloo, glsl
from ...color ... | 33.823956 | 78 | 0.540806 |
from __future__ import division
import numpy as np
from ... import gloo, glsl
from ...color import Color, ColorArray, get_colormap
from ...ext.six import string_types
from ..shaders import Function
from ..visual import Visual, CompoundVisual
from ...util.profiler import Profiler
from .dash_atlas import DashAtlas
... | true | true |
f7099500a68960bb66d8067e80352e61f0cd79d0 | 723 | py | Python | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | 2 | 2019-02-19T18:43:37.000Z | 2021-09-06T16:36:55.000Z | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | 1 | 2021-09-13T18:30:22.000Z | 2021-09-13T18:30:22.000Z | main.py | valknight/PlexDiscordPresence | 3fcd236ab8abcef2b11e37dffe5a463b272b5881 | [
"MIT"
] | null | null | null | import tautulli
import config
import time
from config import client_id
from pypresence import Presence
RPC = Presence(client_id)
def main():
RPC.connect()
print("Check discord")
while True:
current_activity = tautulli.get_my_activity()
if current_activity is not None:
to_send =... | 28.92 | 74 | 0.655602 | import tautulli
import config
import time
from config import client_id
from pypresence import Presence
RPC = Presence(client_id)
def main():
RPC.connect()
print("Check discord")
while True:
current_activity = tautulli.get_my_activity()
if current_activity is not None:
to_send =... | true | true |
f70995ff867a7704a1fe14f6760f10b07cb7ae8b | 663 | py | Python | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | tests/trestle/core/remote/__init__.py | degenaro/compliance-trestle | 9feb6908c80c3873cf310079144fbbbe20002c54 | [
"Apache-2.0"
] | null | null | null | # -*- mode:python; coding:utf-8 -*-
# Copyright (c) 2020 IBM Corp. 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
#
#... | 39 | 74 | 0.742081 | true | true | |
f7099645b764655b7a6b01b5a8b89fb66d9a99e8 | 102 | py | Python | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | null | null | null | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | null | null | null | diffpy.pdffit2/run_test.py | st3107/conda-recipes | 61a8fbefa807f43f1023397fd00310551da200a9 | [
"BSD-3-Clause"
] | 1 | 2020-12-01T18:11:29.000Z | 2020-12-01T18:11:29.000Z | #!/usr/bin/env python
import diffpy.pdffit2.tests
assert diffpy.pdffit2.tests.test().wasSuccessful()
| 20.4 | 50 | 0.784314 |
import diffpy.pdffit2.tests
assert diffpy.pdffit2.tests.test().wasSuccessful()
| true | true |
f709975689be0cff9a6ae96e30974f303f6430bd | 2,473 | py | Python | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 3,326 | 2018-01-26T22:42:25.000Z | 2022-02-16T13:16:39.000Z | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | src/slim/nets/nets_factory_test.py | nghugo88/tf-pose-estimation | 0df660feeb52957f40f4a5e18920adc317af3653 | [
"Apache-2.0"
] | 2,580 | 2017-05-14T14:33:41.000Z | 2022-03-31T15:04:14.000Z | # Copyright 2016 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 agree... | 39.887097 | 80 | 0.698342 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from nets import nets_factory
class NetworksTest(tf.test.TestCase):
def testGetNetworkFnFirstHalf(self):
batch_size = 5
num_classes = 1000
for net in nets_factory.ne... | true | true |
f709978d4de03e050175f1392140b62ad12c1672 | 4,168 | py | Python | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | gale/classification/model/meta_arch/common.py | benihime91/litcv | 1da107e1dcf1f20d6da4ac3f126e22d409a7f92e | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/04b_classification.model.meta_arch.common.ipynb (unless otherwise specified).
__all__ = ['GeneralizedImageClassifier']
# Cell
import logging
from collections import namedtuple
from typing import *
import torch
from omegaconf import DictConfig, OmegaConf
from pytorch_li... | 33.344 | 125 | 0.648992 |
__all__ = ['GeneralizedImageClassifier']
import logging
from collections import namedtuple
from typing import *
import torch
from omegaconf import DictConfig, OmegaConf
from pytorch_lightning.core.memory import get_human_readable_count
from torch.nn import Module
from ..backbones import ImageClassificationBackbone
... | true | true |
f709983851a949a8e91eea102571610f8c22f66c | 1,811 | py | Python | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | 1 | 2019-02-21T20:48:01.000Z | 2019-02-21T20:48:01.000Z | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | null | null | null | RSA/multi_power.py | dev-alberto/Computational-Number-Theory | 89644a4d69553bc726409b1f85d5bc897e8491ec | [
"MIT"
] | null | null | null | from util import getPrime, inv, gcd
from random import randrange
from time import time
from datetime import timedelta
def gen_keys():
p = getPrime(512)
q = getPrime(512)
p_s = p ** 2
n = p_s * q
phi = (p_s - p) * (q - 1)
e = randrange(1, phi)
g = gcd(e, phi)
while g != 1:
e = r... | 19.684783 | 57 | 0.539481 | from util import getPrime, inv, gcd
from random import randrange
from time import time
from datetime import timedelta
def gen_keys():
p = getPrime(512)
q = getPrime(512)
p_s = p ** 2
n = p_s * q
phi = (p_s - p) * (q - 1)
e = randrange(1, phi)
g = gcd(e, phi)
while g != 1:
e = r... | true | true |
f709998f3e0fc54cc0e672fbc903c33dd1f1b011 | 4,504 | py | Python | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 2 | 2018-06-27T07:59:12.000Z | 2021-04-29T00:22:08.000Z | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 11 | 2018-06-18T06:55:46.000Z | 2020-07-19T10:33:42.000Z | handbook_tools/commands/toc.py | uribench/software-engineering-handbook-tools | 30b48ed0b48aabbec451be0ef6e2519b3c54cefa | [
"Unlicense"
] | 1 | 2019-07-05T13:07:11.000Z | 2019-07-05T13:07:11.000Z | """
'toc' sub-command of the 'handbook' command.
This module composes a TOC for the Handbook from configuration files.
"""
import os
import sys
from urllib.request import pathname2url
from handbook_tools.lib.command_base import CommandBase
from handbook_tools.lib.navigation_tree import NavigationTree
__version__ = '... | 36.322581 | 89 | 0.60524 |
import os
import sys
from urllib.request import pathname2url
from handbook_tools.lib.command_base import CommandBase
from handbook_tools.lib.navigation_tree import NavigationTree
__version__ = '0.6.8'
class Toc(CommandBase):
def __init__(self, command_args=None, global_args=None):
super().__init__(comma... | true | true |
f7099a27cae14071fac72802c976debd492c90a6 | 4,060 | py | Python | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2022-02-06T00:04:04.000Z | 2022-02-06T00:04:04.000Z | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2021-03-25T22:38:27.000Z | 2021-03-25T22:38:27.000Z | translate/cloud-client/beta_snippets_test.py | Cuciu/python-test | baee855ce20a2a1344ffb208a40ebc20014fba5f | [
"Apache-2.0"
] | 1 | 2020-02-17T03:55:51.000Z | 2020-02-17T03:55:51.000Z | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 30.074074 | 79 | 0.734236 |
import os
import pytest
import uuid
import beta_snippets
from google.cloud import storage
PROJECT_ID = os.environ['GCLOUD_PROJECT']
@pytest.fixture(scope='function')
def bucket():
bucket_name = str(uuid.uuid1())
storage_client = storage.Client()
bucket = storage_client.create_bucket(bucket_name)
yi... | true | true |
f7099a55a30bdd3116b8fe67a61658fa8e908227 | 6,145 | py | Python | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | Snake.py | JoaoSantos2007/jogoCobrinha | d4a09a339d929d7a19984a45f27127153b009bb3 | [
"MIT"
] | null | null | null | import pygame # importa a biblioteca Pygame
import random # importa a biblioteca Random
from audioplayer import AudioPlayer
inicio = False
source = "/home/joao/Arquivos/jogoCobrinha/"
# Começar partida
def iniciar(inicio, tela, fonte, texto):
texto = fonte.render("Pressione T para iniciar: ", True, cor_pontos)
... | 29.261905 | 80 | 0.552482 | import pygame import random from audioplayer import AudioPlayer
inicio = False
source = "/home/joao/Arquivos/jogoCobrinha/"
def iniciar(inicio, tela, fonte, texto):
texto = fonte.render("Pressione T para iniciar: ", True, cor_pontos)
tela.blit(imagem, [0, 263])
tela.blit(texto, [150, 150])
for event... | true | true |
f7099a6152e7bc1aa632fc5d51076615ce91b95a | 608 | py | Python | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | app/model.py | SayAkhan/testkakao | f1753733ce6f9c62829ac9f33eea4fec4c8ba03a | [
"MIT"
] | null | null | null | #from app import db
from datetime import datetime, timedelta
#class User(db.Model):
# id = db.Column(db.Integer, primary_key=True)
# user_key = db.Column(db.String(32), index=True, unique=True)
# join_date = db.Column(db.String())
# last_active_date = db.Column(db.String())
# def __init__(self, user_k... | 30.4 | 65 | 0.625 | from datetime import datetime, timedelta
| true | true |
f7099a668e8105f9d5648b4e92033cd303825672 | 26,111 | py | Python | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 402 | 2020-09-22T16:38:16.000Z | 2022-03-30T09:56:03.000Z | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 259 | 2020-09-23T09:32:33.000Z | 2022-03-30T18:15:01.000Z | InnerEye/ML/pipelines/inference.py | JacopoTeneggi/InnerEye-DeepLearning | 988d9fa318a19cfd435370248970d976ee2e78b0 | [
"MIT"
] | 112 | 2020-09-23T00:12:58.000Z | 2022-03-31T07:39:55.000Z | # ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | 52.537223 | 119 | 0.655547 | from __future__ import annotations
import logging
from enum import Enum
from pathlib import Path
from typing import Any, Dict, Optional
import numpy as np
import torch
from radio import CTImagesMaskedBatch
from radio.batchflow import Dataset, action, inbatch_parallel
from InnerEye.Common.type_annotations import Tupl... | true | true |
f7099b9af35d02543cd8c55b0aed90da402ab7ff | 6,986 | py | Python | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | qualcoder/GUI/ui_dialog_report_compare_coder_file.py | ericbrasiln/QualCoder | 46108a0e43034bdeed77319bb09dc1a3227a8c3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_dialog_report_compare_coder_file.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_reportCompareCoderFile(object):
... | 57.735537 | 144 | 0.73862 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog_reportCompareCoderFile(object):
def setupUi(self, Dialog_reportCompareCoderFile):
Dialog_reportCompareCoderFile.setObjectName("Dialog_reportCompareCoderFile")
Dialog_reportCompareCoderFile.setWindowModality(QtCore.Qt.NonModal)
D... | true | true |
f7099beab38b1d30053511639c2dc6a1ef187290 | 1,884 | py | Python | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | app/misc/modular.py | Cicadadenis/999 | f1de12723c89d77fc4e020ba9343289665330776 | [
"MIT"
] | null | null | null | import glob
import logging
from importlib import import_module
from os.path import basename, isdir, isfile
from pathlib import Path
from aiogram import Dispatcher
class ModuleManager:
def __init__(self, dp: Dispatcher):
self.dp = dp
self.root = Path(__file__).parent.parent
def load_path(sel... | 26.914286 | 78 | 0.565817 | import glob
import logging
from importlib import import_module
from os.path import basename, isdir, isfile
from pathlib import Path
from aiogram import Dispatcher
class ModuleManager:
def __init__(self, dp: Dispatcher):
self.dp = dp
self.root = Path(__file__).parent.parent
def load_path(sel... | true | true |
f7099c4ecec5f13d588cfea1db3c144e28b6d645 | 1,887 | py | Python | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 69 | 2015-09-06T14:33:32.000Z | 2022-02-16T03:17:39.000Z | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 186 | 2015-08-31T08:10:56.000Z | 2022-03-16T17:11:57.000Z | entities/entity-processor.py | surma-dump/html-build | eeeeae3624cc7ee6733a0c5f9d077546a8b81e90 | [
"CC-BY-4.0"
] | 72 | 2015-08-28T03:36:52.000Z | 2022-03-13T21:27:13.000Z | import xml.dom.minidom
import sys
# this uses 658 MB
document = xml.dom.minidom.parse(sys.stdin)
sets = []
entities = {}
for group in document.getElementsByTagName('group'):
if (group.getAttribute('name') == 'html5' or group.getAttribute('name') == 'mathml'):
for set in group.getElementsByTagName('set'):
... | 46.02439 | 176 | 0.559618 | import xml.dom.minidom
import sys
document = xml.dom.minidom.parse(sys.stdin)
sets = []
entities = {}
for group in document.getElementsByTagName('group'):
if (group.getAttribute('name') == 'html5' or group.getAttribute('name') == 'mathml'):
for set in group.getElementsByTagName('set'):
sets.append(set.ge... | true | true |
f7099c6369dc7fa62011c26919d9fafb65c149ad | 1,068 | py | Python | discovery/ModStatus.py | Nirj2004/spghetti-master | 2d684dc35ed75a970876841aa1b48d6eafac75bd | [
"BSL-1.0"
] | 3 | 2021-07-22T15:05:50.000Z | 2022-02-27T11:04:42.000Z | discovery/ModStatus.py | Nirj2004/spghetti-master | 2d684dc35ed75a970876841aa1b48d6eafac75bd | [
"BSL-1.0"
] | null | null | null | discovery/ModStatus.py | Nirj2004/spghetti-master | 2d684dc35ed75a970876841aa1b48d6eafac75bd | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Spaghetti: Web Server Security Scanner
#
# @url: https://github.com/m4ll0k/Spaghetti
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'doc/LICENSE'
from lib.net import http
from lib.net import utils
from lib.utils import printer
class ModStatus():
def __ini... | 31.411765 | 125 | 0.674157 |
from lib.net import http
from lib.net import utils
from lib.utils import printer
class ModStatus():
def __init__(self,url,agent,proxy,redirect):
self.url = url
self.printer = printer.Printer()
self.http = http.Http(agent=agent,proxy=proxy,redirect=redirect)
self.checker = utils.Checker()
def Run(self):
... | false | true |
f7099c93ad2bd1e3a69de77ee2572adef4df10e2 | 1,154 | py | Python | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | 3 | 2018-05-31T08:30:30.000Z | 2018-09-02T09:07:51.000Z | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | null | null | null | util/metric.py | smartdolphin/variational-autoencoder | 999e00c1f630d1e3b6b433c965f87d236ba18668 | [
"MIT"
] | 1 | 2018-09-02T09:07:53.000Z | 2018-09-02T09:07:53.000Z | from collections import Counter
import numpy as np
from sklearn.metrics import accuracy_score, confusion_matrix
def __majority(arr):
counter = Counter(arr)
value, _ = counter.most_common(1)[0]
return value
def clustering_accuracy(y_true, y_clustering):
clustering_labels = list(set(y_clustering))
... | 33.941176 | 60 | 0.733969 | from collections import Counter
import numpy as np
from sklearn.metrics import accuracy_score, confusion_matrix
def __majority(arr):
counter = Counter(arr)
value, _ = counter.most_common(1)[0]
return value
def clustering_accuracy(y_true, y_clustering):
clustering_labels = list(set(y_clustering))
... | true | true |
f7099df0b81adf9edb8587839dbb5f4204a4277b | 430 | py | Python | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | app/core/migrations/0006_recipe_image.py | Plachey/recipe-app-api | 226317d0af02e3add2239ea46eeeff45ce55d151 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-14 14:07
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
... | 21.5 | 93 | 0.62093 |
import core.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0005_recipe'),
]
operations = [
migrations.AddField(
model_name='recipe',
name='image',
field=models.ImageField(null=True, up... | true | true |
f7099e207c4fe793f5a10e86c872264015378602 | 4,347 | py | Python | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | null | null | null | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | 2 | 2022-02-23T22:57:46.000Z | 2022-02-24T11:41:49.000Z | xrpl/core/binarycodec/types/currency.py | antonyggvzvmnxxcx/xrpl-py | fda7ce2a28807374b40324478e42e17d97a063d7 | [
"ISC"
] | 1 | 2022-02-21T07:36:36.000Z | 2022-02-21T07:36:36.000Z | """Codec for currency property inside an XRPL issued currency amount json."""
from __future__ import annotations # Requires Python 3.7+
from typing import Optional, Type
from typing_extensions import Final
from xrpl.constants import HEX_CURRENCY_REGEX, ISO_CURRENCY_REGEX
from xrpl.core.binarycodec.exceptions import... | 33.183206 | 86 | 0.645503 | from __future__ import annotations
from typing import Optional, Type
from typing_extensions import Final
from xrpl.constants import HEX_CURRENCY_REGEX, ISO_CURRENCY_REGEX
from xrpl.core.binarycodec.exceptions import XRPLBinaryCodecException
from xrpl.core.binarycodec.types.hash160 import Hash160
_CURRENCY_CODE_LEN... | true | true |
f7099e28f13d0d0ebf689edd59f647a14c4109a6 | 833 | py | Python | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | python/functions.py | felipesud/side-projects | 82ce8559cd64ce726eeebe5c8f7f5f07228ac44a | [
"MIT"
] | null | null | null | #We’ve already seen a few python functions such as print and input, but now we’re going to dive into writing our own functions. To get started, we’ll write a function that takes in a number and squares it:
def square(x):
return x * x
#Notice how we use the def keyword to indicate we’re defining a function, that... | 32.038462 | 205 | 0.728691 |
def square(x):
return x * x
for i in range(10):
print(f"The square of {i} is {square(i)}")
| true | true |
f7099e513b3ccd63804c178e2f0d32173e3f1c4e | 55 | py | Python | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | pre_commit_hooks/loaderon_hooks/tests/testing_samples/check_model_name_samples/error.py | alvaroscelza/pre-commit-hooks | fc9a7a376dc733a1e3cc00b5ed35936bcb3c3b3b | [
"MIT"
] | null | null | null | class SomeClass(object):
_name = "some.model.name"
| 18.333333 | 29 | 0.690909 | class SomeClass(object):
_name = "some.model.name"
| true | true |
f709a042ad90eee2b99eba0e4d74e9980bc62785 | 8,682 | py | Python | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | apps/news/views.py | dawang-youy/Django-blog | 529e7ef16d65170dc56cd628c34c5c9806138eed | [
"Apache-2.0"
] | null | null | null | import logging
import json
from django.shortcuts import render,HttpResponse
from django.http import Http404
from django.views import View
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from . import models
from . import constants
from utils.json_fun import to_json_data
from utils.res_code import... | 35.008065 | 115 | 0.585695 | import logging
import json
from django.shortcuts import render,HttpResponse
from django.http import Http404
from django.views import View
from django.core.paginator import Paginator,EmptyPage,PageNotAnInteger
from . import models
from . import constants
from utils.json_fun import to_json_data
from utils.res_code import... | true | true |
f709a16aaacdecfd6b39728f922d2694addb5ca8 | 3,463 | py | Python | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/feature_management/v4_0/models/contributed_feature.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 59.706897 | 230 | 0.663298 |
from msrest.serialization import Model
class ContributedFeature(Model):
_attribute_map = {
'_links': {'key': '_links', 'type': 'ReferenceLinks'},
'default_state': {'key': 'defaultState', 'type': 'bool'},
'default_value_rules': {'key': 'defaultValueRules', 'type': '[ContributedFeatureValu... | true | true |
f709a1ceea0ffc10aa2fbd792d7b6518d912934a | 1,709 | py | Python | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | numpy-arrays/code.py | patelshival/ga-dsmp | c355d28daf50c51b1610930f963dcd17b770e17a | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
# Path of the file has been stored in variable called 'path'
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
data = np.genfromtxt(path, delimiter=",", skip_header=1)
print("\nData: \n\n", data)
print("\nType of data: \n\n", type(dat... | 20.590361 | 61 | 0.626682 | import numpy as np
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
data = np.genfromtxt(path, delimiter=",", skip_header=1)
print("\nData: \n\n", data)
print("\nType of data: \n\n", type(data))
census = np.concatenate((data, new_record), axis=0)
print(census)
age=census[:,0]
print(age)
max_a... | true | true |
f709a1ff552f62232b89d6d9363ed677443a46fd | 3,345 | py | Python | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | RecoTracker/TrackProducer/test/refitFromMINIAOD.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
process = cms.Process('RECO2',Run2_2016)
options = VarParsing.VarParsing('analysis')
options.register('globalTag',
"auto:run2_mc", # default value
... | 39.821429 | 115 | 0.75994 | import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
process = cms.Process('RECO2',Run2_2016)
options = VarParsing.VarParsing('analysis')
options.register('globalTag',
"auto:run2_mc", V... | true | true |
f709a34963612148e07d6218f601266cbad70915 | 1,709 | py | Python | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2021-09-28T12:56:56.000Z | 2021-09-28T12:56:56.000Z | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | null | null | null | domains/explore/problems/training/problem346_EE.py | patras91/rae_release | 0e5faffb7eb732fdb8e3bbf2c6d2f2cbd520aa30 | [
"BSD-3-Clause"
] | 1 | 2022-03-31T16:30:39.000Z | 2022-03-31T16:30:39.000Z | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | 29.465517 | 221 | 0.486834 | __author__ = 'patras'
from domain_exploreEnv import *
from timer import DURATION
from state import state, rv
DURATION.TIME = {
'survey': 5,
'monitor': 5,
'screen': 5,
'sample': 5,
'process': 5,
'fly': 3,
'deposit': 1,
'transferData': 1,
'take': 2,
'put': 2,
'move': 10,
'... | true | true |
f709a3cce919ff24eb1d2474804b1ef4b4319607 | 2,597 | py | Python | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 1 | 2020-11-26T18:53:46.000Z | 2020-11-26T18:53:46.000Z | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | null | null | null | Lib/importlib/test/benchmark.py | ystk/debian-python3.1 | 6241444a6994140621d1b143a2d6b311b184366a | [
"PSF-2.0"
] | 2 | 2018-08-06T04:37:38.000Z | 2022-02-27T18:07:12.000Z | from . import util
from .source import util as source_util
import gc
import decimal
import imp
import importlib
import sys
import timeit
def bench_cache(import_, repeat, number):
"""Measure the time it takes to pull from sys.modules."""
name = '<benchmark import>'
with util.uncache(name):
module =... | 31.289157 | 77 | 0.58298 | from . import util
from .source import util as source_util
import gc
import decimal
import imp
import importlib
import sys
import timeit
def bench_cache(import_, repeat, number):
name = '<benchmark import>'
with util.uncache(name):
module = imp.new_module(name)
sys.modules[name] = module
... | true | true |
f709a461b1f54fd83eb4c7764434dd937ee90766 | 13,269 | py | Python | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 3 | 2018-11-27T06:30:23.000Z | 2021-05-30T15:56:32.000Z | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 3 | 2020-09-26T01:09:47.000Z | 2022-02-10T02:12:08.000Z | Server/ChatBot/venv/Lib/site-packages/tensorflow/core/framework/tensor_pb2.py | sozuer53/BBC | 31bb128cb1e1a19db955fd673d67cf0e92bac3a4 | [
"Apache-2.0"
] | 6 | 2020-04-13T15:33:30.000Z | 2020-06-21T19:26:55.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/core/framework/tensor.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf im... | 53.504032 | 1,407 | 0.768332 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.p... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.