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
417k
max_line_length
int64
1
987k
alphanum_fraction
float64
0
1
content_no_comment
stringlengths
0
1.01M
is_comment_constant_removed
bool
1 class
is_sharp_comment_removed
bool
1 class
f731817c0c67a924ce2ccfc634deaf68c68b5c57
54,791
py
Python
numpy/polynomial/hermite.py
ivanov/numpy
6d2665626e40f346bb5af8d780579f5a429ff9ba
[ "BSD-3-Clause" ]
null
null
null
numpy/polynomial/hermite.py
ivanov/numpy
6d2665626e40f346bb5af8d780579f5a429ff9ba
[ "BSD-3-Clause" ]
null
null
null
numpy/polynomial/hermite.py
ivanov/numpy
6d2665626e40f346bb5af8d780579f5a429ff9ba
[ "BSD-3-Clause" ]
null
null
null
""" Objects for dealing with Hermite series. This module provides a number of objects (mostly functions) useful for dealing with Hermite series, including a `Hermite` class that encapsulates the usual arithmetic operations. (General information on how this module represents and works with such polynomials is in the d...
31.291262
79
0.597416
from __future__ import division, absolute_import import numpy as np import numpy.linalg as la from . import polyutils as pu import warnings from .polytemplate import polytemplate __all__ = ['hermzero', 'hermone', 'hermx', 'hermdomain', 'hermline', 'hermadd', 'hermsub', 'hermmulx', 'hermmul', 'hermdiv', 'hermpow',...
true
true
f73182b901161d28b67b66626d7189fdce69c7df
368
py
Python
utilities/models.py
codes-dev/qubwebs-blog
0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0
[ "MIT" ]
null
null
null
utilities/models.py
codes-dev/qubwebs-blog
0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0
[ "MIT" ]
null
null
null
utilities/models.py
codes-dev/qubwebs-blog
0ba9372b2ec83ad181dbd31eb009a17a4a7acaf0
[ "MIT" ]
null
null
null
from django.db import models # Create your models here. class TimeStampMixin(models.Model): """ An abstract base class model that provides self-updating ``created_at`` and ``updated_at`` fields. """ created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_no...
24.533333
60
0.701087
from django.db import models class TimeStampMixin(models.Model): created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Meta: abstract = True
true
true
f73182c1280def3ee7b87cc1f8310cdf39c87b12
16,051
py
Python
fairseq/fairseq/data/indexed_dataset.py
oguzdemirbasci/DynamicVocabAbstractiveSummariser
2e8ba9efd6eddd7d1870d540638f05c80bfe9894
[ "MIT" ]
null
null
null
fairseq/fairseq/data/indexed_dataset.py
oguzdemirbasci/DynamicVocabAbstractiveSummariser
2e8ba9efd6eddd7d1870d540638f05c80bfe9894
[ "MIT" ]
null
null
null
fairseq/fairseq/data/indexed_dataset.py
oguzdemirbasci/DynamicVocabAbstractiveSummariser
2e8ba9efd6eddd7d1870d540638f05c80bfe9894
[ "MIT" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from functools import lru_cache import os import shutil import struct import numpy as np import torch from . import FairseqDataset def __b...
30.631679
105
0.592611
from functools import lru_cache import os import shutil import struct import numpy as np import torch from . import FairseqDataset def __best_fitting_dtype(vocab_size=None): if vocab_size is not None and vocab_size < 65500: return np.uint16 else: return np.int32 def get_available_dataset_...
true
true
f731833e514a80da7c83975fe621231e7f8586e1
994
py
Python
assets/code/practice-example-four.py
david-story/david-story.github.io
4a02854207b86946befd933d6f23773f6239d7da
[ "MIT" ]
null
null
null
assets/code/practice-example-four.py
david-story/david-story.github.io
4a02854207b86946befd933d6f23773f6239d7da
[ "MIT" ]
null
null
null
assets/code/practice-example-four.py
david-story/david-story.github.io
4a02854207b86946befd933d6f23773f6239d7da
[ "MIT" ]
null
null
null
""" Practice File 4 Created by David Story Description: Some nice examples of things you can do with functions from the following libraries: - sys - os - time - datetime """ import sys import os import time import datetime # get the time print(time.time()) # get the current date print(datetime.date....
19.490196
97
0.740443
import sys import os import time import datetime print(time.time()) print(datetime.date.today()) print(os.getcwd()) your_working_directory = os.getcwd() os.chdir("C:\\") print(os.getcwd()) os.chdir(your_working_directory) print(os.getcwd()) computer_cpu_count = os.cpu_count() print("This computer has this ma...
true
true
f731835a4a4d1abb694ef9dec2e9777f59218f60
390
py
Python
NewRelicApiParser/REST/AlertsViolations/__init__.py
Bharat23/newrelic-api-parser
c55d508387fde33af9bdc93f16aae3cb2a2e5f13
[ "MIT" ]
null
null
null
NewRelicApiParser/REST/AlertsViolations/__init__.py
Bharat23/newrelic-api-parser
c55d508387fde33af9bdc93f16aae3cb2a2e5f13
[ "MIT" ]
1
2021-07-30T17:32:37.000Z
2021-07-30T17:32:37.000Z
NewRelicApiParser/REST/AlertsViolations/__init__.py
Bharat23/newrelic-api-parser
c55d508387fde33af9bdc93f16aae3cb2a2e5f13
[ "MIT" ]
null
null
null
from NewRelicApiParser.Base import BaseNewRelic class AlertsViolations(BaseNewRelic): def __init__(self, API_KEY): super().__init__(API_KEY) def get_list(self, options: dict = {}) -> dict: """ fetch the alert violations for new relic """ url = self.BASE_URI + '/alerts_...
30
55
0.651282
from NewRelicApiParser.Base import BaseNewRelic class AlertsViolations(BaseNewRelic): def __init__(self, API_KEY): super().__init__(API_KEY) def get_list(self, options: dict = {}) -> dict: url = self.BASE_URI + '/alerts_violations.json' return super().get_data(url, options=options)
true
true
f731839f44074592ff4c8fc120911ce2b706f06b
2,652
py
Python
utils/audio.py
deciding/Voicefilter
dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c
[ "Apache-2.0", "MIT" ]
3
2020-03-25T06:27:20.000Z
2021-02-28T12:59:14.000Z
utils/audio.py
deciding/Voicefilter
dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c
[ "Apache-2.0", "MIT" ]
null
null
null
utils/audio.py
deciding/Voicefilter
dda34da9d1cfca48102b2d1b4274bfd76e5a2e1c
[ "Apache-2.0", "MIT" ]
null
null
null
# adapted from Keith Ito's tacotron implementation # https://github.com/keithito/tacotron/blob/master/util/audio.py import librosa import numpy as np class Audio(): def __init__(self, hp): self.hp = hp self.mel_basis = librosa.filters.mel(sr=hp.audio.sample_rate, ...
36.833333
86
0.549397
# https://github.com/keithito/tacotron/blob/master/util/audio.py import librosa import numpy as np class Audio(): def __init__(self, hp): self.hp = hp self.mel_basis = librosa.filters.mel(sr=hp.audio.sample_rate, n_fft=hp.embedder.n_fft, ...
true
true
f73183abb453edfa3f42627d23629fd71241bbd0
1,790
py
Python
keymint_cli/verb/__init__.py
keymint/keymint_cli
977995ade32cf2b3a6394bda1c05f80a9fcc3369
[ "Apache-2.0" ]
null
null
null
keymint_cli/verb/__init__.py
keymint/keymint_cli
977995ade32cf2b3a6394bda1c05f80a9fcc3369
[ "Apache-2.0" ]
null
null
null
keymint_cli/verb/__init__.py
keymint/keymint_cli
977995ade32cf2b3a6394bda1c05f80a9fcc3369
[ "Apache-2.0" ]
null
null
null
# Copyright 2016-2017 Dirk Thomas # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
31.964286
74
0.721229
from keymint_cli.plugin_system import instantiate_extensions from keymint_cli.plugin_system import PLUGIN_SYSTEM_VERSION from keymint_cli.plugin_system import satisfies_version class VerbExtension: NAME = None EXTENSION_POINT_VERSION = '0.1' def __init__(self): super(VerbExtension, self).__init...
true
true
f7318473c64262e9daec3211788af8404125cccc
722
py
Python
webview/monitor/migrations/0002_auto_20191022_1952.py
dw0rdptr/2019_IoT_GoToDouble
7f8a3005710b57199e918be1a0d8b9047918bce2
[ "MIT" ]
4
2019-10-23T04:43:09.000Z
2019-10-24T11:25:37.000Z
webview/monitor/migrations/0002_auto_20191022_1952.py
dw0rdptr/2019_IoT_GoToDouble
7f8a3005710b57199e918be1a0d8b9047918bce2
[ "MIT" ]
10
2019-10-22T12:06:42.000Z
2019-10-24T17:39:31.000Z
webview/monitor/migrations/0002_auto_20191022_1952.py
epikjjh/2019_IoT_GoToDouble
1d80eb87b7d59da90a7d0a9225209bfb4704a045
[ "MIT" ]
5
2019-10-22T08:04:26.000Z
2019-10-24T17:31:40.000Z
# Generated by Django 2.2.6 on 2019-10-22 10:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('monitor', '0001_initial'), ] operations = [ migrations.CreateModel( name='Sposition', fields=[ ('id'...
26.740741
114
0.548476
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('monitor', '0001_initial'), ] operations = [ migrations.CreateModel( name='Sposition', fields=[ ('id', models.AutoField(auto_created=True, primary_ke...
true
true
f73184b05282cc90c8544a41fce552460381a5d0
17,311
py
Python
src/k2hash/tests/test_k2hash.py
ggtakec/k2hash_python
9d20d36aaf28d0dd2497d39b43286d50e7200fcc
[ "MIT" ]
1
2022-03-02T10:27:43.000Z
2022-03-02T10:27:43.000Z
src/k2hash/tests/test_k2hash.py
ggtakec/k2hash_python
9d20d36aaf28d0dd2497d39b43286d50e7200fcc
[ "MIT" ]
null
null
null
src/k2hash/tests/test_k2hash.py
ggtakec/k2hash_python
9d20d36aaf28d0dd2497d39b43286d50e7200fcc
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # K2hash Python Driver # # Copyright (c) 2022 Yahoo Japan Corporation # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limit...
34.691383
80
0.617122
import unittest import k2hash import logging import ctypes import time class TestK2hashIterator(unittest.TestCase): def test_K2hashIterator_construct(self): db = k2hash.K2hash() self.assertTrue(isinstance(db, k2hash.K2hash)) key = "hello" val = "world" self.assertTrue(db.se...
true
true
f73184b337ca7e743751238f2a113e71bb8c75e0
7,364
py
Python
tests/rundb/test_sqldb.py
EdmondIguazio/mlrun
e63b34a610788ebe522ce7a46642e26927e39882
[ "Apache-2.0" ]
null
null
null
tests/rundb/test_sqldb.py
EdmondIguazio/mlrun
e63b34a610788ebe522ce7a46642e26927e39882
[ "Apache-2.0" ]
null
null
null
tests/rundb/test_sqldb.py
EdmondIguazio/mlrun
e63b34a610788ebe522ce7a46642e26927e39882
[ "Apache-2.0" ]
1
2021-05-05T14:19:46.000Z
2021-05-05T14:19:46.000Z
# Copyright 2019 Iguazio # # 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, softwa...
33.022422
85
0.629957
from collections import defaultdict from contextlib import contextmanager from datetime import datetime, timedelta from unittest.mock import Mock import pytest from sqlalchemy.orm import Session from mlrun.api.db.sqldb.db import SQLDB from mlrun.api.db.sqldb.models import _tagged from tests.conftest import new_run ...
true
true
f731851b0bbc67a1b6af6e831923eba84d6c28aa
10,964
py
Python
rustplus/api/rust_api.py
olijeffers0n/rustplus.py
0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23
[ "MIT" ]
25
2021-05-03T11:08:55.000Z
2022-03-14T00:56:50.000Z
rustplus/api/rust_api.py
olijeffers0n/rustplus.py
0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23
[ "MIT" ]
9
2021-06-15T10:38:42.000Z
2022-03-26T11:45:03.000Z
rustplus/api/rust_api.py
olijeffers0n/rustplus.py
0ecaaecc345848b47abe27bc1fd8b7ef7aebfd23
[ "MIT" ]
13
2021-06-08T18:35:17.000Z
2022-03-26T00:44:08.000Z
import asyncio from asyncio.futures import Future from typing import List from PIL import Image from io import BytesIO from importlib import resources from datetime import datetime from collections import defaultdict from .base_rust_api import BaseRustSocket from .structures import RustTime, RustInfo, RustMap, RustMar...
36.915825
265
0.639639
import asyncio from asyncio.futures import Future from typing import List from PIL import Image from io import BytesIO from importlib import resources from datetime import datetime from collections import defaultdict from .base_rust_api import BaseRustSocket from .structures import RustTime, RustInfo, RustMap, RustMar...
true
true
f73185ddbd238f0f843033c23cdf25d8077121c5
989
py
Python
tests/sparseml/onnx/test_imports.py
clementpoiret/sparseml
8442a6ef8ba11fb02f5e51472dd68b72438539b9
[ "Apache-2.0" ]
922
2021-02-04T17:51:54.000Z
2022-03-31T20:49:26.000Z
tests/sparseml/onnx/test_imports.py
clementpoiret/sparseml
8442a6ef8ba11fb02f5e51472dd68b72438539b9
[ "Apache-2.0" ]
197
2021-02-04T22:17:21.000Z
2022-03-31T13:58:55.000Z
tests/sparseml/onnx/test_imports.py
clementpoiret/sparseml
8442a6ef8ba11fb02f5e51472dd68b72438539b9
[ "Apache-2.0" ]
80
2021-02-04T22:20:14.000Z
2022-03-30T19:36:15.000Z
# Copyright (c) 2021 - present / Neuralmagic, 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 b...
30.90625
76
0.695652
def test_imports(): from sparseml.onnx import ( check_onnx_install, check_onnxruntime_install, detect_framework, framework_info, is_supported, onnx, onnx_err, onnxruntime, onnxruntime_err, require_onnx, require_onnxruntime...
true
true
f73186d8775e20db4e181ff54bb6713045cc02fc
7,745
py
Python
demo/demo.py
hummat/detectron2
ef2f4df474b4a07049cada4793392e8e36c3e746
[ "Apache-2.0" ]
null
null
null
demo/demo.py
hummat/detectron2
ef2f4df474b4a07049cada4793392e8e36c3e746
[ "Apache-2.0" ]
null
null
null
demo/demo.py
hummat/detectron2
ef2f4df474b4a07049cada4793392e8e36c3e746
[ "Apache-2.0" ]
null
null
null
# Copyright (c) Facebook, Inc. and its affiliates. import argparse import glob import multiprocessing as mp import numpy as np import os import tempfile import time import warnings import cv2 import tqdm from detectron2.config import get_cfg from detectron2.data.detection_utils import read_image from detectron2.utils....
39.116162
128
0.628922
import argparse import glob import multiprocessing as mp import numpy as np import os import tempfile import time import warnings import cv2 import tqdm from detectron2.config import get_cfg from detectron2.data.detection_utils import read_image from detectron2.utils.logger import setup_logger from predictor import V...
true
true
f731877388c6e4f2d7121cb542ca1fe6ff75cc62
1,466
py
Python
xcc/util.py
BastianZim/xanadu-cloud-client
3a2d9d5373d90339a1047ee939bacef1bd4019ed
[ "Apache-2.0" ]
3
2021-11-12T21:44:35.000Z
2022-02-10T15:07:20.000Z
xcc/util.py
BastianZim/xanadu-cloud-client
3a2d9d5373d90339a1047ee939bacef1bd4019ed
[ "Apache-2.0" ]
2
2021-11-08T16:39:56.000Z
2022-01-20T14:47:29.000Z
xcc/util.py
BastianZim/xanadu-cloud-client
3a2d9d5373d90339a1047ee939bacef1bd4019ed
[ "Apache-2.0" ]
2
2021-12-01T19:07:05.000Z
2022-01-20T14:26:47.000Z
""" This module contains utilities which are shared between other modules. """ from typing import Any, Callable class cached_property: # pylint: disable=invalid-name """Descriptor that transforms a class method into a property whose value is computed once and then cached for subsequent accesses. Args: ...
31.191489
79
0.645975
from typing import Any, Callable class cached_property: def __init__(self, func: Callable[[Any], Any]) -> None: self.func = func self.caches = {} self.__doc__ = func.__doc__ def __get__(self, instance: Any, _) -> Any: if instance is None: return self ...
true
true
f73187898e8bb312c2b27b9f5d0d2fa9a2a19d87
79,267
py
Python
flaml/model.py
rserran/FLAML
7d6822aa40883550e72c4ee24adb765c6e937ce7
[ "MIT" ]
null
null
null
flaml/model.py
rserran/FLAML
7d6822aa40883550e72c4ee24adb765c6e937ce7
[ "MIT" ]
null
null
null
flaml/model.py
rserran/FLAML
7d6822aa40883550e72c4ee24adb765c6e937ce7
[ "MIT" ]
null
null
null
# ! # * Copyright (c) FLAML authors. All rights reserved. # * Licensed under the MIT License. See LICENSE file in the # * project root for license information. from contextlib import contextmanager from functools import partial import signal import os from typing import Callable, List import numpy as np im...
36.646787
144
0.541121
from contextlib import contextmanager from functools import partial import signal import os from typing import Callable, List import numpy as np import time from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier from sklearn.ensemble import ExtraTreesRegressor, ExtraTreesClassifier from skl...
true
true
f7318945e70a68298c48631812fa81322c407bc9
12,916
py
Python
env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py
Raniac/NEURO-LEARN
3c3acc55de8ba741e673063378e6cbaf10b64c7a
[ "Apache-2.0" ]
8
2019-05-29T09:38:30.000Z
2021-01-20T03:36:59.000Z
env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py
Raniac/neurolearn_dev
3c3acc55de8ba741e673063378e6cbaf10b64c7a
[ "Apache-2.0" ]
12
2021-03-09T03:01:16.000Z
2022-03-11T23:59:36.000Z
env/lib/python3.6/site-packages/nibabel/tests/test_image_load_save.py
Raniac/NEURO-LEARN
3c3acc55de8ba741e673063378e6cbaf10b64c7a
[ "Apache-2.0" ]
1
2020-07-17T12:49:49.000Z
2020-07-17T12:49:49.000Z
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the NiBabel package for the # copyright and license terms. # ### ### ### #...
38.440476
79
0.650743
from __future__ import division, print_function, absolute_import from io import BytesIO import shutil from os.path import dirname, join as pjoin from tempfile import mkdtemp import numpy as np from .. import analyze as ana from .. import spm99analyze as spm99 from .. import spm2analyze as spm2 from .. import nifti1 ...
true
true
f7318a7c9b9961d14143aebdcada5b709c5812c1
2,945
py
Python
tests/integration/qbs/test_qbs_submission_data.py
nealedj/eq-survey-runner
b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34
[ "MIT" ]
null
null
null
tests/integration/qbs/test_qbs_submission_data.py
nealedj/eq-survey-runner
b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34
[ "MIT" ]
1
2018-11-05T12:00:51.000Z
2018-11-05T12:00:51.000Z
tests/integration/qbs/test_qbs_submission_data.py
nealedj/eq-survey-runner
b8e6cddae6068f6c8fd60e21d31d58aaa79bbb34
[ "MIT" ]
null
null
null
from tests.integration.integration_test_case import IntegrationTestCase class TestQbsSubmissionData(IntegrationTestCase): def test_submission_data_2_0001(self): self.submission_data('2', '0001') def submission_data(self, eq_id, form_type_id): self.launchSurvey(eq_id, form_type_id, roles=['dum...
38.75
84
0.529372
from tests.integration.integration_test_case import IntegrationTestCase class TestQbsSubmissionData(IntegrationTestCase): def test_submission_data_2_0001(self): self.submission_data('2', '0001') def submission_data(self, eq_id, form_type_id): self.launchSurvey(eq_id, form_type_id, roles=['dum...
true
true
f7318bf8ab84bb950ae4d28f761bd4399b07f385
46,765
py
Python
src/transformers/configuration_utils.py
elusenji/transformers
af14c61973effd8b8077ac61b3f24bdd4a632f25
[ "Apache-2.0" ]
3
2022-01-15T08:06:07.000Z
2022-03-10T07:13:18.000Z
src/transformers/configuration_utils.py
arron1227/transformers
b18dfd95e1f60ae65a959a7b255fc06522170d1b
[ "Apache-2.0" ]
null
null
null
src/transformers/configuration_utils.py
arron1227/transformers
b18dfd95e1f60ae65a959a7b255fc06522170d1b
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
50.284946
129
0.653459
import copy import json import os import re import warnings from typing import Any, Dict, List, Optional, Tuple, Union from packaging import version from requests import HTTPError from . import __version__ from .dynamic_module_utils import custom_object_save from .utils import ( CONFIG_NAME, HUGGINGFACE_CO...
true
true
f7318c2b9fdaa9f536243ae29bdfe008ac0eb2a0
22,340
py
Python
addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
inaber0420/glTF-Modo-IO
57f99aee4e9b6177d25b465b87d731b54a625532
[ "Apache-2.0" ]
1,084
2018-07-14T07:09:50.000Z
2022-03-30T16:34:05.000Z
addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
inaber0420/glTF-Modo-IO
57f99aee4e9b6177d25b465b87d731b54a625532
[ "Apache-2.0" ]
1,375
2018-07-13T22:09:24.000Z
2022-03-31T00:36:36.000Z
addons/io_scene_gltf2/blender/exp/gltf2_blender_extract.py
inaber0420/glTF-Modo-IO
57f99aee4e9b6177d25b465b87d731b54a625532
[ "Apache-2.0" ]
235
2018-07-13T22:04:28.000Z
2022-03-30T09:15:53.000Z
# Copyright 2018-2021 The glTF-Blender-IO authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
37.35786
120
0.616025
import numpy as np from mathutils import Vector from . import gltf2_blender_export_keys from ...io.com.gltf2_io_debug import print_console from io_scene_gltf2.blender.exp import gltf2_blender_gather_skins def extract_primitives(glTF, blender_mesh, library, blender_object, blender_vertex_groups, modifiers, export_se...
true
true
f7318c381216a7a0a5e30f0ca35e0f3c326d7ead
184
py
Python
beecrowd exercises/beecrowd-1145.py
pachecosamuel/Python-Exercises
de542536dd1a2bc0ad27e81824713cda8ad34054
[ "MIT" ]
null
null
null
beecrowd exercises/beecrowd-1145.py
pachecosamuel/Python-Exercises
de542536dd1a2bc0ad27e81824713cda8ad34054
[ "MIT" ]
null
null
null
beecrowd exercises/beecrowd-1145.py
pachecosamuel/Python-Exercises
de542536dd1a2bc0ad27e81824713cda8ad34054
[ "MIT" ]
null
null
null
n1,n2 = list(map(int,input().split())) cont = 1 for i in range(1,(int((n2/n1))+1)): r = "" for y in range(n1): r += str(cont) + " " cont += 1 print(r[:-1])
20.444444
38
0.451087
n1,n2 = list(map(int,input().split())) cont = 1 for i in range(1,(int((n2/n1))+1)): r = "" for y in range(n1): r += str(cont) + " " cont += 1 print(r[:-1])
true
true
f7318c8d58133c98fa8052706364e5c9c4e4f7bb
116
py
Python
ComStream/tf_idf/__init__.py
alimpfard/ComStream
1bfde3a01ba0b996b4c41e0e9112089618789469
[ "MIT" ]
null
null
null
ComStream/tf_idf/__init__.py
alimpfard/ComStream
1bfde3a01ba0b996b4c41e0e9112089618789469
[ "MIT" ]
null
null
null
ComStream/tf_idf/__init__.py
alimpfard/ComStream
1bfde3a01ba0b996b4c41e0e9112089618789469
[ "MIT" ]
null
null
null
from . import Agent from . import Coordinator from . import DataManager from . import DataPoint from . import Utils
19.333333
25
0.784483
from . import Agent from . import Coordinator from . import DataManager from . import DataPoint from . import Utils
true
true
f7318c9eae78d9ecd4097a5f77c09245d4f5b3b0
14,635
py
Python
appmetrics/statistics.py
avalente/appmetrics
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
[ "Apache-2.0" ]
60
2015-01-19T05:32:32.000Z
2021-06-08T07:35:02.000Z
appmetrics/statistics.py
alexKeleon/appmetrics
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
[ "Apache-2.0" ]
6
2015-03-02T19:25:02.000Z
2021-03-27T17:26:07.000Z
appmetrics/statistics.py
alexKeleon/appmetrics
366fc7e1ca897e49a2227cbfa43bfa02a47f1acc
[ "Apache-2.0" ]
12
2015-01-19T05:04:14.000Z
2020-09-08T07:49:54.000Z
## Module statistics.py ## ## Copyright (c) 2014 Antonio Valente <y3sman@gmail.com> ## ## 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 ...
28.362403
99
0.624804
from __future__ import division import collections import math import operator import functools from fractions import Fraction from decimal import Decimal from .exceptions import StatisticsError from .py3comp import xrange, iteritems def isfinite(n): return not (math.isinf(n) or math.isnan(n)) def sum(da...
true
true
f7318cbf69b4247d05d82297d5c1cf2c37526fa4
6,137
py
Python
lavaplayer/websocket.py
xArty4/lavaplayer
1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c
[ "MIT" ]
null
null
null
lavaplayer/websocket.py
xArty4/lavaplayer
1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c
[ "MIT" ]
null
null
null
lavaplayer/websocket.py
xArty4/lavaplayer
1fae7c74e5e3c1eaf45b06fc05fc5fb16a2e4d3c
[ "MIT" ]
null
null
null
import asyncio import aiohttp import logging from lavaplayer.exceptions import NodeError from .objects import ( Info, PlayerUpdateEvent, TrackStartEvent, TrackEndEvent, TrackExceptionEvent, TrackStuckEvent, WebSocketClosedEvent, ) from .emitter import Emitter import typing as t if t.TYPE_CH...
40.111111
175
0.570311
import asyncio import aiohttp import logging from lavaplayer.exceptions import NodeError from .objects import ( Info, PlayerUpdateEvent, TrackStartEvent, TrackEndEvent, TrackExceptionEvent, TrackStuckEvent, WebSocketClosedEvent, ) from .emitter import Emitter import typing as t if t.TYPE_CH...
true
true
f7318d4e874e77b247071f0e8f618b2b791be9d7
629
py
Python
skl2onnx/operator_converters/id_op.py
xiaowuhu/sklearn-onnx
e85674a67a0a043e19c2ffe181e5d31eca8ce40b
[ "Apache-2.0" ]
323
2018-12-18T20:23:19.000Z
2022-03-25T09:47:31.000Z
skl2onnx/operator_converters/id_op.py
xiaowuhu/sklearn-onnx
e85674a67a0a043e19c2ffe181e5d31eca8ce40b
[ "Apache-2.0" ]
408
2019-01-02T12:16:10.000Z
2022-03-21T14:01:28.000Z
skl2onnx/operator_converters/id_op.py
xiaowuhu/sklearn-onnx
e85674a67a0a043e19c2ffe181e5d31eca8ce40b
[ "Apache-2.0" ]
70
2018-12-20T19:36:07.000Z
2022-03-14T06:41:36.000Z
# SPDX-License-Identifier: Apache-2.0 from ..common._apply_operation import apply_identity from ..common._registration import register_converter from ..common._topology import Scope, Operator from ..common._container import ModelComponentContainer def convert_sklearn_identity(scope: Scope, operator: Operator, ...
33.105263
66
0.761526
from ..common._apply_operation import apply_identity from ..common._registration import register_converter from ..common._topology import Scope, Operator from ..common._container import ModelComponentContainer def convert_sklearn_identity(scope: Scope, operator: Operator, container: Mod...
true
true
f7318d62eadf54fe70b5a57ab76350ff07135c26
177
py
Python
tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py
AaronJGaut/pyspoke
37bbe8b42c5abe129a3736b255c8a2ee17a4fb59
[ "MIT" ]
null
null
null
tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py
AaronJGaut/pyspoke
37bbe8b42c5abe129a3736b255c8a2ee17a4fb59
[ "MIT" ]
null
null
null
tests/cases/core/layer3_pubsub/rpc/timeout/bad_call.py
AaronJGaut/pyspoke
37bbe8b42c5abe129a3736b255c8a2ee17a4fb59
[ "MIT" ]
null
null
null
import spoke try: spoke.call("junk", None, timeout=2) except TimeoutError: print("Got expected TimeoutError") else: raise TestFailure("Didn't get a TimeoutError")
17.7
50
0.711864
import spoke try: spoke.call("junk", None, timeout=2) except TimeoutError: print("Got expected TimeoutError") else: raise TestFailure("Didn't get a TimeoutError")
true
true
f7318e0ce7bdc535165b2bde29c259ad0a74e64c
9,150
py
Python
tests/providers/test_internet.py
shirakia/faker
4eb4ef24f5edbcbadd38f941025b671f5b6ebe60
[ "MIT" ]
1
2019-01-16T14:02:54.000Z
2019-01-16T14:02:54.000Z
tests/providers/test_internet.py
shirakia/faker
4eb4ef24f5edbcbadd38f941025b671f5b6ebe60
[ "MIT" ]
null
null
null
tests/providers/test_internet.py
shirakia/faker
4eb4ef24f5edbcbadd38f941025b671f5b6ebe60
[ "MIT" ]
1
2019-11-07T03:33:43.000Z
2019-11-07T03:33:43.000Z
# coding=utf-8 from __future__ import unicode_literals from itertools import cycle import unittest import mock import pytest import six from email_validator import validate_email from faker import Faker from faker.providers.person.ja_JP import Provider as JaProvider from faker.utils import text class TestIntern...
31.6609
80
0.628962
from __future__ import unicode_literals from itertools import cycle import unittest import mock import pytest import six from email_validator import validate_email from faker import Faker from faker.providers.person.ja_JP import Provider as JaProvider from faker.utils import text class TestInternetProvider(unit...
true
true
f7318f9b6f7017b7889c28a18c24f5841345d651
2,324
py
Python
project-chat/chatApp/migrations/0001_initial.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
project-chat/chatApp/migrations/0001_initial.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
project-chat/chatApp/migrations/0001_initial.py
Torkvamedo/smx
a5aef4f430f56ac67100c505902f55e18fba5978
[ "Unlicense" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-06-17 19:23 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.Crea...
38.098361
144
0.577883
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Ban', fields=[ ('i...
true
true
f731902b159345554e51c2ec9585cd8075fabbd5
846
py
Python
setup.py
kenlowrie/avscript
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
[ "Apache-2.0" ]
1
2021-09-30T19:29:30.000Z
2021-09-30T19:29:30.000Z
setup.py
kenlowrie/avscript
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
[ "Apache-2.0" ]
7
2018-07-16T22:52:55.000Z
2020-05-20T23:48:36.000Z
setup.py
kenlowrie/avscript
7e3550adc46a01785ea89cdcd9ddaa5ac35bdbdd
[ "Apache-2.0" ]
1
2018-05-24T22:58:44.000Z
2018-05-24T22:58:44.000Z
from setuptools import setup from sys import version_info setup(name='avscript', version='0.3.8', description='Audio/Visual Script Parser', url='https://github.com/kenlowrie/avscript', author='Ken Lowrie', author_email='ken@kenlowrie.com', license='Apache', packages=['avscript...
38.454545
107
0.630024
from setuptools import setup from sys import version_info setup(name='avscript', version='0.3.8', description='Audio/Visual Script Parser', url='https://github.com/kenlowrie/avscript', author='Ken Lowrie', author_email='ken@kenlowrie.com', license='Apache', packages=['avscript...
true
true
f73190671897a2b17be262536826df2b282c304f
24,050
py
Python
test/galaxy_selenium/navigates_galaxy.py
Galaxyinternship/Galaxy
204be086a8c16d6684584cefa9053ed7c86a1784
[ "CC-BY-3.0" ]
null
null
null
test/galaxy_selenium/navigates_galaxy.py
Galaxyinternship/Galaxy
204be086a8c16d6684584cefa9053ed7c86a1784
[ "CC-BY-3.0" ]
null
null
null
test/galaxy_selenium/navigates_galaxy.py
Galaxyinternship/Galaxy
204be086a8c16d6684584cefa9053ed7c86a1784
[ "CC-BY-3.0" ]
null
null
null
"""A mixing that extends a HasDriver class with Galaxy-specific utilities. Implementer must provide a self.build_url method to target Galaxy. """ from __future__ import print_function import contextlib import random import string import time from functools import partial, wraps import requests import yaml from .da...
40.083333
156
0.669023
from __future__ import print_function import contextlib import random import string import time from functools import partial, wraps import requests import yaml from .data import NAVIGATION_DATA from .has_driver import exception_indicates_stale_element, HasDriver from . import sizzle DEFAULT_PASSWORD = '123456' ...
true
true
f7319258f8ed765fde12cec23303820fd0ad703d
14,348
py
Python
Lib/warnings.py
adamwen829/cpython
0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667
[ "PSF-2.0" ]
2
2017-05-05T02:07:59.000Z
2017-08-18T09:24:48.000Z
Lib/warnings.py
adamwen829/cpython
0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667
[ "PSF-2.0" ]
null
null
null
Lib/warnings.py
adamwen829/cpython
0f1c7c760c6b2804f5d05cae9ca045d1fdf3d667
[ "PSF-2.0" ]
3
2016-04-21T07:58:27.000Z
2016-05-06T21:34:44.000Z
"""Python part of the warnings subsystem.""" import sys __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefilter", "resetwarnings", "catch_warnings"] def showwarning(message, category, filename, lineno, file=None, line=None): """Hook to write a wa...
34.995122
79
0.617299
import sys __all__ = ["warn", "warn_explicit", "showwarning", "formatwarning", "filterwarnings", "simplefilter", "resetwarnings", "catch_warnings"] def showwarning(message, category, filename, lineno, file=None, line=None): if file is None: file = sys.stderr try: file.w...
true
true
f731926d323d02ff6850d4318c6001330ae3775c
737
py
Python
benchmarks/__init__.py
cedric05/dothttp
ae68f2c3dbb8f1053a0feeab0ac829aa5d3a2a6e
[ "Apache-2.0" ]
10
2021-02-09T17:21:49.000Z
2021-12-05T19:10:53.000Z
benchmarks/__init__.py
cedric05/dothttp
ae68f2c3dbb8f1053a0feeab0ac829aa5d3a2a6e
[ "Apache-2.0" ]
60
2021-02-07T17:20:47.000Z
2022-03-12T06:26:23.000Z
benchmarks/__init__.py
cedric05/dothttp
ae68f2c3dbb8f1053a0feeab0ac829aa5d3a2a6e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 import os from dothttp import Config from dothttp.request_base import RequestCompiler def run_model(): """ main use case is to check benchmarks for loading from file to textx model modifying http.tx would increase or lower performance. """ filename = os.path.join(os...
28.346154
110
0.671642
import os from dothttp import Config from dothttp.request_base import RequestCompiler def run_model(): filename = os.path.join(os.path.dirname(__file__), "../examples/example.http") envs = [] target = "1" nocookie = False curl = False properties = [] config = Config(file=filename, env=env...
true
true
f73192bc3cb337f8236fb50957755b303a00785e
6,757
py
Python
cheating/client.py
totu/challenge-fi-2021
7e41581e3dd5a61b838ecb7aadfde501b94802c5
[ "Unlicense" ]
null
null
null
cheating/client.py
totu/challenge-fi-2021
7e41581e3dd5a61b838ecb7aadfde501b94802c5
[ "Unlicense" ]
null
null
null
cheating/client.py
totu/challenge-fi-2021
7e41581e3dd5a61b838ecb7aadfde501b94802c5
[ "Unlicense" ]
null
null
null
import pygame from pygame.locals import * from _thread import * import os import random import socket import json import math from gamelogic import objects, world, common SOCK_COUNT = 2 pygame.init() W, H = 800, 437 win = pygame.display.set_mode((W, H)) pygame.display.set_caption("Projekt Kyyber 2021 Client") bg_o...
31.282407
113
0.547432
import pygame from pygame.locals import * from _thread import * import os import random import socket import json import math from gamelogic import objects, world, common SOCK_COUNT = 2 pygame.init() W, H = 800, 437 win = pygame.display.set_mode((W, H)) pygame.display.set_caption("Projekt Kyyber 2021 Client") bg_o...
true
true
f73192e61c63b58e1cc57017f11c01d7531dc764
3,051
py
Python
pyaz/pyaz_utils.py
py-az-cli/py-az-cli
9a7dc44e360c096a5a2f15595353e9dad88a9792
[ "MIT" ]
null
null
null
pyaz/pyaz_utils.py
py-az-cli/py-az-cli
9a7dc44e360c096a5a2f15595353e9dad88a9792
[ "MIT" ]
null
null
null
pyaz/pyaz_utils.py
py-az-cli/py-az-cli
9a7dc44e360c096a5a2f15595353e9dad88a9792
[ "MIT" ]
1
2022-02-03T09:12:01.000Z
2022-02-03T09:12:01.000Z
"""Utility functions for the pyaz generated code to use.""" import json import logging import shlex import shutil import subprocess from typing import Dict def _call_az(command: str, parameters: Dict) -> object: """ Call an az command (supplied as a string, and parameters as dictionary). Calls az cli vi...
28.514019
87
0.621763
import json import logging import shlex import shutil import subprocess from typing import Dict def _call_az(command: str, parameters: Dict) -> object: params = _get_params(parameters) commands = command.split() commands.extend(params) full_command = " ".join(commands) print(f"Exec...
true
true
f731932dfc82782e68c3b57938cdc030d69e56ef
53,591
py
Python
electrum/wallet_db.py
L-47/qtum-electrum
dd1b0a8b6ef6e96015a6210de36b23949eaad359
[ "MIT" ]
1
2020-07-21T18:37:59.000Z
2020-07-21T18:37:59.000Z
electrum/wallet_db.py
L-47/qtum-electrum
dd1b0a8b6ef6e96015a6210de36b23949eaad359
[ "MIT" ]
null
null
null
electrum/wallet_db.py
L-47/qtum-electrum
dd1b0a8b6ef6e96015a6210de36b23949eaad359
[ "MIT" ]
null
null
null
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
39.088986
153
0.582038
import os import ast import json import copy import threading from collections import defaultdict from functools import reduce from typing import Dict, Optional, List, Tuple, Set, Iterable, NamedTuple, Sequence, TYPE_CHECKING, Union import binascii from . import util, bitcoin from .util import profiler, WalletFileExce...
true
true
f7319439ecbf5ae98691f76abcedaa8bb60c23b1
4,513
py
Python
lib/bindings/samples/server/API/social_api.py
tlalexander/stitchEm
cdff821ad2c500703e6cb237ec61139fce7bf11c
[ "MIT" ]
182
2019-04-19T12:38:30.000Z
2022-03-20T16:48:20.000Z
lib/bindings/samples/server/API/social_api.py
doymcc/stitchEm
20693a55fa522d7a196b92635e7a82df9917c2e2
[ "MIT" ]
107
2019-04-23T10:49:35.000Z
2022-03-02T18:12:28.000Z
lib/bindings/samples/server/API/social_api.py
doymcc/stitchEm
20693a55fa522d7a196b92635e7a82df9917c2e2
[ "MIT" ]
59
2019-06-04T11:27:25.000Z
2022-03-17T23:49:49.000Z
from concurrent.futures import ThreadPoolExecutor from tornado.concurrent import run_on_executor from API.handlers import APIHandler from API.schema import api import errors from social.social_factory import SOCIAL_NETWORKS class SocialAPI(APIHandler): """REST interface related to social networks """ execu...
39.587719
114
0.561489
from concurrent.futures import ThreadPoolExecutor from tornado.concurrent import run_on_executor from API.handlers import APIHandler from API.schema import api import errors from social.social_factory import SOCIAL_NETWORKS class SocialAPI(APIHandler): executor = ThreadPoolExecutor(1) def __init__(self, extra...
true
true
f7319447be1c583c56c689293955c02433bab7f1
4,941
py
Python
docs/source/conf.py
Geofroy/meerkat_dev
ebff9d16b3edc6efdc580f940ca8d60e733d9da1
[ "MIT" ]
null
null
null
docs/source/conf.py
Geofroy/meerkat_dev
ebff9d16b3edc6efdc580f940ca8d60e733d9da1
[ "MIT" ]
4
2017-11-06T13:11:03.000Z
2018-05-04T14:57:18.000Z
docs/source/conf.py
meerkat-code/meerkat_dev
c3f4bef39a72aa99a460ed1a0022c7ea594e037c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/stable/config import os import sys # -- Path setup --------------------------------------...
30.5
79
0.65088
import os import sys project = 'meerkat_dev' copyright = '2018, Meerkat Developers' author = 'Jonathan Berry' version = '' release = '' extensions = [ 'sphinx.ext.autodoc', 'sphinxcontrib.autohttp.flask', 'sphinxcontrib.napoleon' ] templates_path = ['_templates'] source_suffix = '.rst' master_...
true
true
f731958aa03e65b62779fd052badafaa8d11eb1d
8,117
py
Python
07_train/privacy/tensorflow_privacy/privacy/membership_inference_attack/membership_inference_attack.py
ichen20/oreilly_book
8098d8096d9decca6aa5afbb267b9f05ce0570f2
[ "Apache-2.0" ]
2,327
2020-03-01T09:47:34.000Z
2021-11-25T12:38:42.000Z
07_train/privacy/tensorflow_privacy/privacy/membership_inference_attack/membership_inference_attack.py
ichen20/oreilly_book
8098d8096d9decca6aa5afbb267b9f05ce0570f2
[ "Apache-2.0" ]
209
2020-03-01T17:14:12.000Z
2021-11-08T20:35:42.000Z
07_train/privacy/tensorflow_privacy/privacy/membership_inference_attack/membership_inference_attack.py
ichen20/oreilly_book
8098d8096d9decca6aa5afbb267b9f05ce0570f2
[ "Apache-2.0" ]
686
2020-03-03T17:24:51.000Z
2021-11-25T23:39:12.000Z
# Copyright 2020, The TensorFlow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
41.203046
105
0.756684
from typing import Iterable import numpy as np from sklearn import metrics from tensorflow_privacy.privacy.membership_inference_attack import models from tensorflow_privacy.privacy.membership_inference_attack.data_structures import AttackInputData from tensorflow_privacy.privacy.membership_inference_attack.data_stru...
true
true
f73196366aa14046b85680925a5d5d15177b1086
1,779
py
Python
chainer/snap2model.py
fujibo/poseHG
e582a6ca1badc9a894b8b7e2a5e0acf9eb348c5c
[ "BSD-3-Clause" ]
null
null
null
chainer/snap2model.py
fujibo/poseHG
e582a6ca1badc9a894b8b7e2a5e0acf9eb348c5c
[ "BSD-3-Clause" ]
null
null
null
chainer/snap2model.py
fujibo/poseHG
e582a6ca1badc9a894b8b7e2a5e0acf9eb348c5c
[ "BSD-3-Clause" ]
1
2018-06-30T07:07:25.000Z
2018-06-30T07:07:25.000Z
import numpy as np import tempfile def snap2model_parser(path_snapshot, path_model=None): """convert snapshot to model :param path_snapshot: str :param path_model: str, default None :return: file descriptor (path_model is None) or None (otherwise) """ snapshot = np.load(path_snapshot) mo...
29.65
91
0.658797
import numpy as np import tempfile def snap2model_parser(path_snapshot, path_model=None): snapshot = np.load(path_snapshot) model = dict() for key in snapshot.keys(): parse = key.split('/') if parse[0] == 'updater' and parse[1] == 'optimizer:main': if parse[2] == 'model': ...
true
true
f73196906eb86fee01bdd6f96402a0ac464b613b
1,524
py
Python
symengine/__init__.py
Meldanya/symengine.py
ec3ce7aef387878abd10a3991e4c3610c98cc70d
[ "MIT" ]
null
null
null
symengine/__init__.py
Meldanya/symengine.py
ec3ce7aef387878abd10a3991e4c3610c98cc70d
[ "MIT" ]
1
2015-10-17T13:22:48.000Z
2015-10-18T11:43:13.000Z
symengine/__init__.py
Meldanya/symengine.py
ec3ce7aef387878abd10a3991e4c3610c98cc70d
[ "MIT" ]
null
null
null
from .lib.symengine_wrapper import ( have_mpfr, have_mpc, have_flint, have_piranha, have_llvm, I, E, pi, oo, zoo, nan, Symbol, Dummy, S, sympify, SympifyError, Integer, Rational, Float, Number, RealNumber, RealDouble, ComplexDouble, add, Add, Mul, Pow, function_symbol, Max, Min, DenseMatrix, Matrix,...
33.866667
93
0.723097
from .lib.symengine_wrapper import ( have_mpfr, have_mpc, have_flint, have_piranha, have_llvm, I, E, pi, oo, zoo, nan, Symbol, Dummy, S, sympify, SympifyError, Integer, Rational, Float, Number, RealNumber, RealDouble, ComplexDouble, add, Add, Mul, Pow, function_symbol, Max, Min, DenseMatrix, Matrix,...
true
true
f731975854283587ddab9488f9c9c75d42aa8ed2
7,107
py
Python
databricks/koalas/missing/series.py
dennyglee/koalas
9781c1ece43b1fa2dce78a0813602e03db0b1fa3
[ "Apache-2.0" ]
1
2019-05-29T05:46:19.000Z
2019-05-29T05:46:19.000Z
databricks/koalas/missing/series.py
dennyglee/koalas
9781c1ece43b1fa2dce78a0813602e03db0b1fa3
[ "Apache-2.0" ]
null
null
null
databricks/koalas/missing/series.py
dennyglee/koalas
9781c1ece43b1fa2dce78a0813602e03db0b1fa3
[ "Apache-2.0" ]
null
null
null
# # Copyright (C) 2019 Databricks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
47.066225
95
0.74307
from databricks.koalas.missing import _unsupported_function, _unsupported_property, common def unsupported_function(method_name, deprecated=False, reason=""): return _unsupported_function(class_name='pd.Series', method_name=method_name, deprecated=deprecated, reason=reason) def...
true
true
f73197e08ced9d0164ad4b85df778656c785b84a
3,279
py
Python
cube_root.py
scottwedge/CSC110
8d1e39de183e3ea477dac993d0fa9b721feca1ca
[ "MIT" ]
null
null
null
cube_root.py
scottwedge/CSC110
8d1e39de183e3ea477dac993d0fa9b721feca1ca
[ "MIT" ]
1
2020-09-04T02:04:33.000Z
2020-09-04T02:04:33.000Z
cube_root.py
scottwedge/CSC110
8d1e39de183e3ea477dac993d0fa9b721feca1ca
[ "MIT" ]
1
2020-09-04T01:51:55.000Z
2020-09-04T01:51:55.000Z
# Sample program illustrating programmer-defined functions # along with code that calls the functions # # The 'cube_root' function uses a 'return' statement. Its # only job is to calculate and "return" the cube root of a # number. It does not print anything. Notice that statements # that "call" the 'cube_root' func...
35.641304
79
0.643489
# used in different ways. # # CSC 110 # Winter 2013 # The cube_root function calculates and RETURNS the cube root # of a number. If the value of 'x' is negative, a negative # real number is returned. def cube_root(x): if x < 0: result = -( (-x)**(1.0/3.0) ) else: result = x ** (1.0/3.0) ...
true
true
f73198cc95d621ef4641d770730e34b065a75e7a
1,470
py
Python
MultiMediaAnalyse/Task2/main.py
wsh-nie/Assignments
e1f800ca9abe54218f9b695dce843ec96a99710c
[ "MIT" ]
null
null
null
MultiMediaAnalyse/Task2/main.py
wsh-nie/Assignments
e1f800ca9abe54218f9b695dce843ec96a99710c
[ "MIT" ]
null
null
null
MultiMediaAnalyse/Task2/main.py
wsh-nie/Assignments
e1f800ca9abe54218f9b695dce843ec96a99710c
[ "MIT" ]
null
null
null
import cv2 def SIFT(imgname1, imgname2): sift = cv2.xfeatures2d.SIFT_create() img1 = cv2.imread(imgname1) img2 = cv2.imread(imgname2) kp1, des1 = sift.detectAndCompute(img1, None) kp2, des2 = sift.detectAndCompute(img2, None) FLANN_INDEX_KDTREE = 0 index_params = dict(algorithm=FLANN_IND...
25.344828
66
0.646259
import cv2 def SIFT(imgname1, imgname2): sift = cv2.xfeatures2d.SIFT_create() img1 = cv2.imread(imgname1) img2 = cv2.imread(imgname2) kp1, des1 = sift.detectAndCompute(img1, None) kp2, des2 = sift.detectAndCompute(img2, None) FLANN_INDEX_KDTREE = 0 index_params = dict(algorithm=FLANN_IND...
true
true
f73198d4417ffcba32dc97836964e3ca95693c56
3,900
py
Python
romp/lib/loss_funcs/params_loss.py
vltmedia/ROMP
1d2d96bd39f67a0a86ce7e397e3af856b3c5ee00
[ "MIT" ]
385
2021-03-30T15:40:31.000Z
2022-03-31T21:52:52.000Z
romp/lib/loss_funcs/params_loss.py
vltmedia/ROMP
1d2d96bd39f67a0a86ce7e397e3af856b3c5ee00
[ "MIT" ]
154
2021-03-31T11:28:27.000Z
2022-03-31T08:00:45.000Z
romp/lib/loss_funcs/params_loss.py
vltmedia/ROMP
1d2d96bd39f67a0a86ce7e397e3af856b3c5ee00
[ "MIT" ]
102
2021-04-15T06:43:00.000Z
2022-03-31T12:40:08.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import time import pickle import numpy as np import config import constants from config import args from utils import batch_rodrigues, rotation_matrix_to_angle_axis def ba...
42.857143
120
0.691538
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import torch.nn as nn import time import pickle import numpy as np import config import constants from config import args from utils import batch_rodrigues, rotation_matrix_to_angle_axis def ba...
true
true
f7319a140d0f0b8ef8a302e45f0ea738b572ba7a
63,805
py
Python
ironic/drivers/modules/drac/raid.py
inmotionhosting/ironic
1c7b5f82592e23ab66dddca56e0b059d3cb0710b
[ "Apache-2.0" ]
1
2021-02-27T02:48:59.000Z
2021-02-27T02:48:59.000Z
ironic/drivers/modules/drac/raid.py
inmotionhosting/ironic
1c7b5f82592e23ab66dddca56e0b059d3cb0710b
[ "Apache-2.0" ]
null
null
null
ironic/drivers/modules/drac/raid.py
inmotionhosting/ironic
1c7b5f82592e23ab66dddca56e0b059d3cb0710b
[ "Apache-2.0" ]
null
null
null
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under...
40.926876
79
0.635797
from collections import defaultdict import math from futurist import periodics from ironic_lib import metrics_utils from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import units from ironic.common import exception from ironic.common.i18n import _ from ironic.common import raid ...
true
true
f7319a3273ea4a13ac90d44d92e546e36cb45026
20,249
py
Python
Decompiler/BattleActionScript.py
AGraber/EDDecompiler
6e00c7c6ba8a12cea7722fcef34ed8ff4ac6bc66
[ "MIT" ]
5
2021-05-23T19:34:38.000Z
2021-12-05T05:57:36.000Z
Decompiler/BattleActionScript.py
AGraber/EDDecompiler
6e00c7c6ba8a12cea7722fcef34ed8ff4ac6bc66
[ "MIT" ]
null
null
null
Decompiler/BattleActionScript.py
AGraber/EDDecompiler
6e00c7c6ba8a12cea7722fcef34ed8ff4ac6bc66
[ "MIT" ]
1
2021-05-06T05:50:14.000Z
2021-05-06T05:50:14.000Z
from Assembler.Assembler2s import * from Base.EDAOBase import * import Instruction.ActionOpTableEDAO as edao import BattleMonsterStatus as MSFile INVALID_ACTION_OFFSET = 0xFFFF EMPTY_ACTION = INVALID_ACTION_OFFSET class CharacterPositionFactor: def __init__(self, fs = None): if fs == None: ...
31.056748
125
0.521754
from Assembler.Assembler2s import * from Base.EDAOBase import * import Instruction.ActionOpTableEDAO as edao import BattleMonsterStatus as MSFile INVALID_ACTION_OFFSET = 0xFFFF EMPTY_ACTION = INVALID_ACTION_OFFSET class CharacterPositionFactor: def __init__(self, fs = None): if fs == None: ...
true
true
f7319b025a15cca212a3758b38a253304ad2ede4
2,382
py
Python
src/streamlink/plugins/huya.py
melmorabity/streamlink
24c59a23103922977991acc28741a323d8efa7a1
[ "BSD-2-Clause" ]
null
null
null
src/streamlink/plugins/huya.py
melmorabity/streamlink
24c59a23103922977991acc28741a323d8efa7a1
[ "BSD-2-Clause" ]
null
null
null
src/streamlink/plugins/huya.py
melmorabity/streamlink
24c59a23103922977991acc28741a323d8efa7a1
[ "BSD-2-Clause" ]
null
null
null
import base64 import logging import re from html import unescape as html_unescape from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HTTPStream from streamlink.utils.parse import parse_json log = logging.getLogger(__name__) @pluginmatcher(re....
31.76
111
0.554156
import base64 import logging import re from html import unescape as html_unescape from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate from streamlink.stream import HTTPStream from streamlink.utils.parse import parse_json log = logging.getLogger(__name__) @pluginmatcher(re....
true
true
f7319b3ce9b7c689f47a1cdeca8dd710ca242644
6,175
py
Python
salt/netapi/rest_cherrypy/event_processor.py
styro/salt
d087d94dca02ca8bf53a6c21b94944bc7957522c
[ "Apache-2.0" ]
3
2016-09-03T06:26:42.000Z
2019-06-30T13:04:53.000Z
salt/netapi/rest_cherrypy/event_processor.py
styro/salt
d087d94dca02ca8bf53a6c21b94944bc7957522c
[ "Apache-2.0" ]
null
null
null
salt/netapi/rest_cherrypy/event_processor.py
styro/salt
d087d94dca02ca8bf53a6c21b94944bc7957522c
[ "Apache-2.0" ]
1
2021-12-02T15:30:00.000Z
2021-12-02T15:30:00.000Z
# encoding: utf-8 from __future__ import absolute_import import json import logging import salt.ext.six as six import salt.netapi logger = logging.getLogger(__name__) class SaltInfo(object): ''' Class to handle processing and publishing of "real time" Salt upates. ''' def __init__(self, handler): ...
29.830918
78
0.545263
from __future__ import absolute_import import json import logging import salt.ext.six as six import salt.netapi logger = logging.getLogger(__name__) class SaltInfo(object): def __init__(self, handler): self.handler = handler self.jobs = {} # This represents a "real time" view ...
true
true
f7319b609eb62f710cfd393ed8f31297d6216369
2,636
py
Python
equality/wallet/puzzles/prefarm/spend_prefarm.py
grayfallstown/equality-blockchain
019425b703f6b013e441481ac43389a80415f2f1
[ "Apache-2.0" ]
10
2021-07-04T15:14:12.000Z
2021-10-17T14:52:56.000Z
equality/wallet/puzzles/prefarm/spend_prefarm.py
grayfallstown/equality-blockchain
019425b703f6b013e441481ac43389a80415f2f1
[ "Apache-2.0" ]
11
2021-07-04T19:31:36.000Z
2022-01-11T02:46:23.000Z
equality/wallet/puzzles/prefarm/spend_prefarm.py
grayfallstown/equality-blockchain
019425b703f6b013e441481ac43389a80415f2f1
[ "Apache-2.0" ]
11
2021-07-04T21:49:17.000Z
2021-10-04T17:45:38.000Z
import asyncio from blspy import G2Element from clvm_tools import binutils from equality.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from equality.rpc.full_node_rpc_client import FullNodeRpcClient from equality.types.blockchain_format.program import Program from equality.types.c...
41.1875
113
0.725721
import asyncio from blspy import G2Element from clvm_tools import binutils from equality.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward from equality.rpc.full_node_rpc_client import FullNodeRpcClient from equality.types.blockchain_format.program import Program from equality.types.c...
true
true
f7319cdf9d302bcce6db295df0177ccd74b1ba86
457
py
Python
server/src/views/tests/test_delete.py
budtmo/GIoT
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
[ "Apache-2.0" ]
null
null
null
server/src/views/tests/test_delete.py
budtmo/GIoT
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
[ "Apache-2.0" ]
null
null
null
server/src/views/tests/test_delete.py
budtmo/GIoT
4cfdeacbe53b2bee10613519d86fa1bb0d9057b4
[ "Apache-2.0" ]
null
null
null
from src.views.tests import BaseTest class TestDeleteDevice(BaseTest): """Tests to delete device from the list.""" def test_delete_device(self): self.register_device() res = self.test_app.delete('/device/{id}'.format(id=1)) self.assertEqual(res.status_code, 204) def test_delete_n...
30.466667
63
0.682713
from src.views.tests import BaseTest class TestDeleteDevice(BaseTest): def test_delete_device(self): self.register_device() res = self.test_app.delete('/device/{id}'.format(id=1)) self.assertEqual(res.status_code, 204) def test_delete_non_existing_device(self): res = self.tes...
true
true
f7319ce68a4eb20de0f2eff9b0d27c720c5108bd
596
py
Python
sherlockpipe/search_zones/SearchZone.py
LuisCerdenoMota/SHERLOCK
5fb52795d3ab44e27bc7dbc6f2c2e6c214995ba1
[ "MIT" ]
1
2021-01-14T16:44:48.000Z
2021-01-14T16:44:48.000Z
sherlockpipe/search_zones/SearchZone.py
martindevora/SHERLOCK
5e7492552cbce29e960684a44fd6ad875c8cf60e
[ "MIT" ]
null
null
null
sherlockpipe/search_zones/SearchZone.py
martindevora/SHERLOCK
5e7492552cbce29e960684a44fd6ad875c8cf60e
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from sherlockpipe.star.starinfo import StarInfo class SearchZone(ABC): """ Abstract class to be implemented for calculating minimum and maximum search periods for an input star. """ def __init__(self): pass @abstractmethod def calculate_period_rang...
28.380952
106
0.692953
from abc import ABC, abstractmethod from sherlockpipe.star.starinfo import StarInfo class SearchZone(ABC): def __init__(self): pass @abstractmethod def calculate_period_range(self, star_info: StarInfo): pass
true
true
f7319d88946b78f26293dd74a23f8a820010f76c
4,775
py
Python
.environment/lib/python3.8/site-packages/docplex/mp/engine_factory.py
LuisMi1245/QPath-and-Snakes
48f784da67d9720c955890a28543c9863e02a455
[ "MIT" ]
null
null
null
.environment/lib/python3.8/site-packages/docplex/mp/engine_factory.py
LuisMi1245/QPath-and-Snakes
48f784da67d9720c955890a28543c9863e02a455
[ "MIT" ]
null
null
null
.environment/lib/python3.8/site-packages/docplex/mp/engine_factory.py
LuisMi1245/QPath-and-Snakes
48f784da67d9720c955890a28543c9863e02a455
[ "MIT" ]
null
null
null
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2015, 2016 # -------------------------------------------------------------------------- # gendoc: ignore...
39.46281
115
0.553927
from docplex.mp.engine import NoSolveEngine, ZeroSolveEngine from docplex.mp.utils import is_string from docplex.mp.error_handler import docplex_fatal class EngineFactory(object): _default_engine_map = {"nosolve": NoSolveEngine, "zero": ZeroSolveEngine ...
true
true
f7319da39f77cefd4e939a349a31747373e82aa7
4,711
py
Python
simple_api/django_object/django_object.py
karlosss/simple_api
03f87035c648f161d5e7a59b24f4e04bd34399f1
[ "MIT" ]
2
2020-11-13T14:00:06.000Z
2020-12-19T11:50:22.000Z
simple_api/django_object/django_object.py
karlosss/simple_api
03f87035c648f161d5e7a59b24f4e04bd34399f1
[ "MIT" ]
5
2021-02-04T14:27:43.000Z
2021-06-04T23:22:24.000Z
simple_api/django_object/django_object.py
karlosss/simple_api
03f87035c648f161d5e7a59b24f4e04bd34399f1
[ "MIT" ]
1
2021-01-06T13:54:38.000Z
2021-01-06T13:54:38.000Z
from copy import deepcopy from simple_api.django_object.actions import DetailAction, ListAction, CreateAction, UpdateAction, DeleteAction from simple_api.django_object.datatypes import create_associated_list_type from simple_api.django_object.filters import generate_filters from simple_api.django_object.converter impo...
39.923729
115
0.68478
from copy import deepcopy from simple_api.django_object.actions import DetailAction, ListAction, CreateAction, UpdateAction, DeleteAction from simple_api.django_object.datatypes import create_associated_list_type from simple_api.django_object.filters import generate_filters from simple_api.django_object.converter impo...
true
true
f7319df270d89691854f3a1b9a62c1231d3c7bfe
8,177
py
Python
python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
L-Net-1992/Paddle
4d0ca02ba56760b456f3d4b42a538555b9b6c307
[ "Apache-2.0" ]
11
2016-08-29T07:43:26.000Z
2016-08-29T07:51:24.000Z
python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
L-Net-1992/Paddle
4d0ca02ba56760b456f3d4b42a538555b9b6c307
[ "Apache-2.0" ]
null
null
null
python/paddle/fluid/tests/unittests/xpu/test_expand_v2_op_xpu.py
L-Net-1992/Paddle
4d0ca02ba56760b456f3d4b42a538555b9b6c307
[ "Apache-2.0" ]
1
2021-12-09T08:59:17.000Z
2021-12-09T08:59:17.000Z
# Copyright (c) 2018 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...
33.239837
97
0.559863
from __future__ import print_function import unittest import sys import numpy as np sys.path.append("..") from op_test import OpTest from op_test_xpu import XPUOpTest import paddle.fluid as fluid from paddle.fluid import Program, program_guard import paddle from xpu.get_test_cover_info import create_test_class, get_x...
true
true
f7319df5d2cfd54a36d3021fcea5ac6d789dee56
7,191
py
Python
mapillary_tools/commands/process.py
kudarisenmon/mapillary_tools
ef3201847ece95a0bbeb95187e38a0a84309a2b7
[ "BSD-2-Clause" ]
null
null
null
mapillary_tools/commands/process.py
kudarisenmon/mapillary_tools
ef3201847ece95a0bbeb95187e38a0a84309a2b7
[ "BSD-2-Clause" ]
null
null
null
mapillary_tools/commands/process.py
kudarisenmon/mapillary_tools
ef3201847ece95a0bbeb95187e38a0a84309a2b7
[ "BSD-2-Clause" ]
null
null
null
import inspect from mapillary_tools.process_user_properties import process_user_properties from mapillary_tools.process_import_meta_properties import process_import_meta_properties from mapillary_tools.process_geotag_properties import process_geotag_properties from mapillary_tools.process_sequence_properties import pro...
67.205607
216
0.667779
import inspect from mapillary_tools.process_user_properties import process_user_properties from mapillary_tools.process_import_meta_properties import process_import_meta_properties from mapillary_tools.process_geotag_properties import process_geotag_properties from mapillary_tools.process_sequence_properties import pro...
true
true
f7319e3e7b4ea41930c29754506d03bd52eac137
1,166
py
Python
envs/cell_place_gym/native/acp_state.py
Yvette1993/spinningup
5094cf291fa24cf93d58b4507dab56dafe73dac1
[ "MIT" ]
null
null
null
envs/cell_place_gym/native/acp_state.py
Yvette1993/spinningup
5094cf291fa24cf93d58b4507dab56dafe73dac1
[ "MIT" ]
null
null
null
envs/cell_place_gym/native/acp_state.py
Yvette1993/spinningup
5094cf291fa24cf93d58b4507dab56dafe73dac1
[ "MIT" ]
null
null
null
import numpy as np from cell_place_gym.native.acp_placement import * class acp_placement_state (object): def __init__ (self, place): self.place = place self.design = place.design l_inst_count = len (self.design.instances) # Non-Placed Nets Matrix self.c_matrix = np.z...
34.294118
71
0.542882
import numpy as np from cell_place_gym.native.acp_placement import * class acp_placement_state (object): def __init__ (self, place): self.place = place self.design = place.design l_inst_count = len (self.design.instances) self.c_matrix = np.zeros (shape = (l_inst_cou...
true
true
f7319e483d3b8d072192a8a4e21ee30c26c57e8a
2,638
py
Python
homeassistant/components/sonos/entity.py
DavidDeSloovere/core
909a20b36d4df6724c955c2ae28cb82fe6d50c2e
[ "Apache-2.0" ]
1
2019-08-19T18:18:50.000Z
2019-08-19T18:18:50.000Z
homeassistant/components/sonos/entity.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
70
2020-08-05T07:20:00.000Z
2022-03-31T06:01:46.000Z
homeassistant/components/sonos/entity.py
jagadeeshvenkatesh/core
1bd982668449815fee2105478569f8e4b5670add
[ "Apache-2.0" ]
1
2021-10-29T22:10:26.000Z
2021-10-29T22:10:26.000Z
"""Entity representing a Sonos player.""" from __future__ import annotations import logging from pysonos.core import SoCo import homeassistant.helpers.device_registry as dr from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, async_dispatcher_send, ) from homeassistant.helpers.entity impo...
29.311111
86
0.628886
from __future__ import annotations import logging from pysonos.core import SoCo import homeassistant.helpers.device_registry as dr from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, async_dispatcher_send, ) from homeassistant.helpers.entity import DeviceInfo, Entity from .const import ...
true
true
f7319eef72e8d23633c8d8b5b9c928a276dda952
912
py
Python
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/n/not_in_loop.py
ciskoinch8/vimrc
5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8
[ "MIT" ]
463
2015-01-15T08:17:42.000Z
2022-03-28T15:10:20.000Z
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/n/not_in_loop.py
ciskoinch8/vimrc
5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8
[ "MIT" ]
52
2015-01-06T02:43:59.000Z
2022-03-14T11:15:21.000Z
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/n/not_in_loop.py
ciskoinch8/vimrc
5bf77a7e7bc70fac5173ab2e9ea05d7dda3e52b8
[ "MIT" ]
249
2015-01-07T22:49:49.000Z
2022-03-18T02:32:06.000Z
"""Test that not-in-loop is detected properly.""" # pylint: disable=missing-docstring, invalid-name, too-few-public-methods # pylint: disable=useless-else-on-loop, using-constant-test, useless-object-inheritance # pylint: disable=no-else-continue while True: def ala(): continue # [not-in-loop] while True:...
16.285714
87
0.612939
while True: def ala(): continue while True: pass else: continue def lala(): continue while True: class A(object): continue for _ in range(10): pass else: continue for _ in range(42): pass else: break if True: continue else: break for _ in range(10): ...
true
true
f7319f7dedc4d4bfa733e08b15bd1217c7611f0d
860
py
Python
wagtail_localize/migrations/0004_one_source_per_objectlocale.py
KalobTaulien/wagtail-localize
e513d18dea5f76f6941f1acf55f945150de767eb
[ "BSD-3-Clause" ]
123
2019-11-21T12:55:04.000Z
2022-03-23T08:08:47.000Z
wagtail_localize/migrations/0004_one_source_per_objectlocale.py
KalobTaulien/wagtail-localize
e513d18dea5f76f6941f1acf55f945150de767eb
[ "BSD-3-Clause" ]
334
2019-11-20T10:40:08.000Z
2022-03-27T17:33:01.000Z
wagtail_localize/migrations/0004_one_source_per_objectlocale.py
KalobTaulien/wagtail-localize
e513d18dea5f76f6941f1acf55f945150de767eb
[ "BSD-3-Clause" ]
41
2020-01-16T17:24:52.000Z
2022-03-28T13:09:59.000Z
# Generated by Django 3.0.8 on 2020-08-05 09:33 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('wagtail_localize', '0003_delete_translation_sources'), ] operations = [ migrat...
27.741935
74
0.626744
from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): dependencies = [ ('wagtail_localize', '0003_delete_translation_sources'), ] operations = [ migrations.AddField( model_name='translati...
true
true
f731a03ce0e6675d8bd15187040163106262826b
23,980
py
Python
awx/main/models/notifications.py
sganesh999/awx
783a6dc5111e1757982bf7f5e1bb4bb197d4f199
[ "Apache-2.0" ]
null
null
null
awx/main/models/notifications.py
sganesh999/awx
783a6dc5111e1757982bf7f5e1bb4bb197d4f199
[ "Apache-2.0" ]
null
null
null
awx/main/models/notifications.py
sganesh999/awx
783a6dc5111e1757982bf7f5e1bb4bb197d4f199
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. from copy import deepcopy import datetime import logging import json from django.db import models from django.conf import settings from django.core.mail.message import EmailMessage from django.db import connection from django.utils.translation import ugettext_...
49.240246
160
0.544287
from copy import deepcopy import datetime import logging import json from django.db import models from django.conf import settings from django.core.mail.message import EmailMessage from django.db import connection from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_str, for...
true
true
f731a055821f656efbcb5c83ad2f7ff8e59dd572
818
py
Python
manage.py
neosergio/WisdomBox
f41bd828f5e264c7ad05262b29c8f02cf904b54a
[ "MIT" ]
null
null
null
manage.py
neosergio/WisdomBox
f41bd828f5e264c7ad05262b29c8f02cf904b54a
[ "MIT" ]
2
2017-02-09T14:52:43.000Z
2017-02-10T19:31:38.000Z
manage.py
neosergio/WisdomBox
f41bd828f5e264c7ad05262b29c8f02cf904b54a
[ "MIT" ]
null
null
null
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wisdom.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
35.565217
77
0.640587
import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wisdom.settings") try: from django.core.management import execute_from_command_line except ImportError: try: import django except ImportError: ...
true
true
f731a0e7d3248ef87117117d791e52aa967f0a12
2,465
py
Python
forecaster.py
Adri1bo/HEMS_API
dca26e55696f9f2e36f29968a8c3a90871d6bc16
[ "MIT" ]
1
2021-02-17T08:47:47.000Z
2021-02-17T08:47:47.000Z
forecaster.py
Adri1bo/HEMS_API
dca26e55696f9f2e36f29968a8c3a90871d6bc16
[ "MIT" ]
null
null
null
forecaster.py
Adri1bo/HEMS_API
dca26e55696f9f2e36f29968a8c3a90871d6bc16
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Sun Jun 7 17:58:57 2020 @author: adria.bove """ from BBDD import BBDD import analytics import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt class consumption: def __init__(self, nom): self.nom_BBDD=nom ...
30.8125
111
0.577688
from BBDD import BBDD import analytics import pandas as pd import matplotlib.pyplot as plt import numpy as np import datetime as dt class consumption: def __init__(self, nom): self.nom_BBDD=nom def forecaster(self,timestamp): self.timestamp=str(timestamp) thi...
true
true
f731a16e0fc215d4c3817488810ef1839361e054
49,894
py
Python
cogs/TwitchAlert.py
SnowyJaguar1034/KoalaBot
840a5e30476492c60157687804a2445903279207
[ "MIT" ]
null
null
null
cogs/TwitchAlert.py
SnowyJaguar1034/KoalaBot
840a5e30476492c60157687804a2445903279207
[ "MIT" ]
13
2021-07-02T04:11:14.000Z
2022-03-25T04:08:55.000Z
cogs/TwitchAlert.py
SnowyJaguar1034/KoalaBot
840a5e30476492c60157687804a2445903279207
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ Koala Bot Base Cog code and additional base cog functions Commented using reStructuredText (reST) """ # Futures # Built-in/Generic Imports import os import time import re import aiohttp import logging from concurrent.futures import ThreadPoolExecutor logging.basicConfig(filename='TwitchAle...
44.94955
120
0.615445
import os import time import re import aiohttp import logging from concurrent.futures import ThreadPoolExecutor logging.basicConfig(filename='TwitchAlert.log') import KoalaBot from utils.KoalaColours import * from utils.KoalaUtils import error_embed, is_channel_in_guild, extract_id from utils import KoalaDBManager ...
true
true
f731a1ae7561e1b6b771c407eeb69465e2d4177b
3,929
py
Python
openstack/tests/unit/cloud/test_limits.py
NeCTAR-RC/openstacksdk
60a24f6c4717a1f9a0e545c9a07e68afaedc5a27
[ "Apache-2.0" ]
99
2018-03-28T15:41:45.000Z
2022-01-23T17:22:13.000Z
openstack/tests/unit/cloud/test_limits.py
NeCTAR-RC/openstacksdk
60a24f6c4717a1f9a0e545c9a07e68afaedc5a27
[ "Apache-2.0" ]
5
2018-05-25T16:54:23.000Z
2021-11-21T02:27:16.000Z
openstack/tests/unit/cloud/test_limits.py
NeCTAR-RC/openstacksdk
60a24f6c4717a1f9a0e545c9a07e68afaedc5a27
[ "Apache-2.0" ]
104
2018-04-06T14:33:54.000Z
2022-03-01T01:58:09.000Z
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
40.927083
75
0.423772
from openstack.tests.unit import base class TestLimits(base.TestCase): def test_get_compute_limits(self): self.register_uris([ dict(method='GET', uri=self.get_mock_url( 'compute', 'public', append=['limits']), json={ ...
true
true
f731a2121c3590ca3b044f3b321708cb81eb5991
9,878
py
Python
GlutWrapper.py
kosystem/PythonGlutWrapper
e619b62927d6875f1bd3d2da8b5f2291487c8920
[ "MIT" ]
null
null
null
GlutWrapper.py
kosystem/PythonGlutWrapper
e619b62927d6875f1bd3d2da8b5f2291487c8920
[ "MIT" ]
null
null
null
GlutWrapper.py
kosystem/PythonGlutWrapper
e619b62927d6875f1bd3d2da8b5f2291487c8920
[ "MIT" ]
null
null
null
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import sys from math import * import time ESCAPE = '\033' class Camera(object): """docstring for Camera""" def __init__(self): self.lock_x = 0 self.lock_y = 0 self.lock_z = 0 self.distance = 300 ...
27.983003
74
0.571877
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * import sys from math import * import time ESCAPE = '\033' class Camera(object): def __init__(self): self.lock_x = 0 self.lock_y = 0 self.lock_z = 0 self.distance = 300 self.pan = 0.0 self.ti...
true
true
f731a2862378f2a67c66b8effa16a59cf7ae26f1
867
py
Python
py/pe/pe8.py
kittttttan/pe
6f87e4527793198c393700fedbdd52274fec5b44
[ "MIT" ]
null
null
null
py/pe/pe8.py
kittttttan/pe
6f87e4527793198c393700fedbdd52274fec5b44
[ "MIT" ]
null
null
null
py/pe/pe8.py
kittttttan/pe
6f87e4527793198c393700fedbdd52274fec5b44
[ "MIT" ]
1
2016-09-01T22:47:28.000Z
2016-09-01T22:47:28.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Discover the largest product of five consecutive digits in the 1000-digit number. """ def pe8(fname="../../res/pe8.txt", n=5): """ Discover the largest product of five consecutive digits in the 1000-digit number. >>> pe8() 40824 """ with op...
20.642857
65
0.500577
def pe8(fname="../../res/pe8.txt", n=5): with open(fname, 'r') as f: s = f.read() s = s.replace('\n', '') ls = len(s) if ls < n: raise ValueError m = 0 for x in range(ls - n + 1): t = 1 for y in range(n): t *= int(s[x + y]) if m < t: ...
true
true
f731a3593f56de78afad7e6ff95b896326f0909e
2,885
py
Python
ExcelPixelator.py
nibble-4bits/excel-pixel-art
793c04c69f5035034dc42e26948b3e6390c81668
[ "MIT" ]
2
2021-01-02T02:46:30.000Z
2021-06-30T00:37:06.000Z
ExcelPixelator.py
nibble-4bits/excel-pixel-art
793c04c69f5035034dc42e26948b3e6390c81668
[ "MIT" ]
null
null
null
ExcelPixelator.py
nibble-4bits/excel-pixel-art
793c04c69f5035034dc42e26948b3e6390c81668
[ "MIT" ]
1
2021-06-30T00:37:13.000Z
2021-06-30T00:37:13.000Z
from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl.styles import PatternFill from PIL import Image class ExcelPixelator: def __init__(self, input_path, output_path, file_name, cell_size, pixel_size): self.image = Image.open(input_path).convert('RGB') self.outp...
38.986486
126
0.586828
from openpyxl import Workbook from openpyxl.utils import get_column_letter from openpyxl.styles import PatternFill from PIL import Image class ExcelPixelator: def __init__(self, input_path, output_path, file_name, cell_size, pixel_size): self.image = Image.open(input_path).convert('RGB') self.outp...
true
true
f731a40b7f102fd430b7e6b6d58a594d1b5f7c7b
3,806
py
Python
scripts/spectral_clustering_demo.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
4,895
2016-08-17T22:28:34.000Z
2022-03-31T17:07:15.000Z
scripts/spectral_clustering_demo.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
446
2016-09-17T14:35:29.000Z
2022-03-31T19:59:33.000Z
scripts/spectral_clustering_demo.py
vipavlovic/pyprobml
59a2edc682d0163955db5e2f27491ad772b60141
[ "MIT" ]
1,160
2016-08-18T23:19:27.000Z
2022-03-31T12:44:07.000Z
import superimport import itertools import matplotlib.pyplot as plt import numpy as np from scipy.linalg import eigh from sklearn.cluster import KMeans from sklearn.metrics.pairwise import rbf_kernel import pyprobml_utils as pml plt.style.use('classic') def spectral_clustering_demo(): np.random.seed(0) num_c...
35.90566
99
0.633211
import superimport import itertools import matplotlib.pyplot as plt import numpy as np from scipy.linalg import eigh from sklearn.cluster import KMeans from sklearn.metrics.pairwise import rbf_kernel import pyprobml_utils as pml plt.style.use('classic') def spectral_clustering_demo(): np.random.seed(0) num_c...
true
true
f731a4104b7ef8d6f39fe8aa8ecf2aad84c9136c
5,770
py
Python
run_fits.py
ruizca/pseudoXspec
a8ad2ca3744fe73e5ace78aedbabc49e32e2202a
[ "MIT" ]
null
null
null
run_fits.py
ruizca/pseudoXspec
a8ad2ca3744fe73e5ace78aedbabc49e32e2202a
[ "MIT" ]
null
null
null
run_fits.py
ruizca/pseudoXspec
a8ad2ca3744fe73e5ace78aedbabc49e32e2202a
[ "MIT" ]
null
null
null
#!/usr/bin/env python """ Created on Fri Jun 19 10:46:32 2015 @author: ruizca """ import argparse import logging import subprocess from itertools import count from pathlib import Path from astropy.coordinates.sky_coordinate import SkyCoord from astropy.table import Table from astropy.units import UnitTypeError from ...
25.874439
90
0.629116
import argparse import logging import subprocess from itertools import count from pathlib import Path from astropy.coordinates.sky_coordinate import SkyCoord from astropy.table import Table from astropy.units import UnitTypeError from gdpyc import GasMap from tqdm.contrib import tzip logging.basicConfig(level=loggin...
true
true
f731a56cb0c8590006223c1be11722be665011fc
1,998
py
Python
nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssoarec_args.py
culbertm/NSttyPython
ff9f6aedae3fb8495342cd0fc4247c819cf47397
[ "Apache-2.0" ]
null
null
null
nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssoarec_args.py
culbertm/NSttyPython
ff9f6aedae3fb8495342cd0fc4247c819cf47397
[ "Apache-2.0" ]
null
null
null
nitro-python/nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnssoarec_args.py
culbertm/NSttyPython
ff9f6aedae3fb8495342cd0fc4247c819cf47397
[ "Apache-2.0" ]
null
null
null
# # Copyright (c) 2008-2016 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
27.75
101
0.698699
class dnssoarec_args : def __init__(self) : self._type = None self._nodeid = None @property def type(self) : try : return self._type except Exception as e: raise e @type.setter def type(self, type) : try : self._type = type except Exception as e: raise e @property def nodeid(self) : ...
true
true
f731a5771e4fe79a045785785375a014bc97a2e2
717
py
Python
bot_v_bot.py
garybake/man_alphagb
e69c954e3f42dd556f9b5b7b9edcbf2856389d2f
[ "MIT" ]
null
null
null
bot_v_bot.py
garybake/man_alphagb
e69c954e3f42dd556f9b5b7b9edcbf2856389d2f
[ "MIT" ]
null
null
null
bot_v_bot.py
garybake/man_alphagb
e69c954e3f42dd556f9b5b7b9edcbf2856389d2f
[ "MIT" ]
null
null
null
import time # from dlgo.agent import naive from dlgo.agent import naive from dlgo import gotypes from dlgo import goboard_slow as goboard from dlgo.utils import print_board, print_move def main(): board_size = 9 game = goboard.GameState.new_game(board_size) bots = { gotypes.Player.black: naive.Ra...
25.607143
59
0.666667
import time from dlgo.agent import naive from dlgo import gotypes from dlgo import goboard_slow as goboard from dlgo.utils import print_board, print_move def main(): board_size = 9 game = goboard.GameState.new_game(board_size) bots = { gotypes.Player.black: naive.RandomBot(), gotypes.Play...
true
true
f731a5baeb0a5f98871e45535782937905736879
187,564
bzl
Python
go_third_party.bzl
enp0s3/project-infra
a53795f5df0dbb22c94ba04da47e9ba2fdfe60ed
[ "Apache-2.0" ]
16
2017-07-30T10:51:51.000Z
2021-09-02T17:58:03.000Z
go_third_party.bzl
enp0s3/project-infra
a53795f5df0dbb22c94ba04da47e9ba2fdfe60ed
[ "Apache-2.0" ]
1,946
2017-07-03T13:00:30.000Z
2022-03-31T18:55:19.000Z
go_third_party.bzl
enp0s3/project-infra
a53795f5df0dbb22c94ba04da47e9ba2fdfe60ed
[ "Apache-2.0" ]
103
2017-07-03T09:53:36.000Z
2022-03-22T20:12:00.000Z
load("@bazel_gazelle//:deps.bzl", "go_repository") def go_deps(): go_repository( name = "ag_pack_amqp", build_file_proto_mode = "disable", importpath = "pack.ag/amqp", sum = "h1:cuNDWLUTbKRtEZwhB0WQBXf9pGbm87pUBXQhvcFxBWg=", version = "v0.11.2", ) go_repository( ...
38.474667
81
0.641536
load("@bazel_gazelle//:deps.bzl", "go_repository") def go_deps(): go_repository( name = "ag_pack_amqp", build_file_proto_mode = "disable", importpath = "pack.ag/amqp", sum = "h1:cuNDWLUTbKRtEZwhB0WQBXf9pGbm87pUBXQhvcFxBWg=", version = "v0.11.2", ) go_repository( ...
true
true
f731a62bb6c4d06bd43c8c0f54f539302a734f73
539
py
Python
regexlib/python_re2_test_file/regexlib_7018.py
yetingli/ReDoS-Benchmarks
f5b5094d835649e957bf3fec6b8bd4f6efdb35fc
[ "MIT" ]
1
2022-01-24T14:43:23.000Z
2022-01-24T14:43:23.000Z
regexlib/python_re2_test_file/regexlib_7018.py
yetingli/ReDoS-Benchmarks
f5b5094d835649e957bf3fec6b8bd4f6efdb35fc
[ "MIT" ]
null
null
null
regexlib/python_re2_test_file/regexlib_7018.py
yetingli/ReDoS-Benchmarks
f5b5094d835649e957bf3fec6b8bd4f6efdb35fc
[ "MIT" ]
null
null
null
# 7018 # ^([a-zA-Z](?:(?:(?:\w[\.\_]?)*)\w)+)([a-zA-Z0-9])$ # EXPONENT # nums:5 # EXPONENT AttackString:"a"+"_"*32+"!1 __EOA(iii)" import re2 as re from time import perf_counter regex = """^([a-zA-Z](?:(?:(?:\w[\.\_]?)*)\w)+)([a-zA-Z0-9])$""" REGEX = re.compile(regex) for i in range(0, 150000): ATTACK = "a" + "_"...
28.368421
64
0.541744
import re2 as re from time import perf_counter regex = """^([a-zA-Z](?:(?:(?:\w[\.\_]?)*)\w)+)([a-zA-Z0-9])$""" REGEX = re.compile(regex) for i in range(0, 150000): ATTACK = "a" + "_" * i * 1 + "!1 __EOA(iii)" LEN = len(ATTACK) BEGIN = perf_counter() m = REGEX.search(ATTACK) DURATION = perf_co...
true
true
f731a7aa0c3b474639722781f113b0d34999a1c2
1,011
py
Python
nova/api/openstack/compute/legacy_v2/contrib/used_limits_for_admin.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
7
2015-09-22T11:27:16.000Z
2015-11-02T12:33:46.000Z
nova/api/openstack/compute/legacy_v2/contrib/used_limits_for_admin.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
9
2015-05-20T11:20:17.000Z
2017-07-27T08:21:33.000Z
nova/api/openstack/compute/legacy_v2/contrib/used_limits_for_admin.py
ebalduf/nova-backports
6bf97ec73467de522d34ab7a17ca0e0874baa7f9
[ "Apache-2.0" ]
13
2015-05-05T09:34:04.000Z
2017-11-08T02:03:46.000Z
# Copyright 2013 OpenStack Foundation # # 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 ...
38.884615
78
0.721068
from nova.api.openstack import extensions class Used_limits_for_admin(extensions.ExtensionDescriptor): name = "UsedLimitsForAdmin" alias = "os-used-limits-for-admin" namespace = ("http://docs.openstack.org/compute/ext/used_limits_for_admin" "/api/v1.1") updated = "2013-05-02T00:00:00...
true
true
f731a834130281feea54b8acb4fe90404145a770
1,064
py
Python
checkov/terraform/checks/resource/aws/PasswordPolicyExpiration.py
gustavotabares/checkov
79250dba0fc5227ef3027b3c1300739f063b0d05
[ "Apache-2.0" ]
null
null
null
checkov/terraform/checks/resource/aws/PasswordPolicyExpiration.py
gustavotabares/checkov
79250dba0fc5227ef3027b3c1300739f063b0d05
[ "Apache-2.0" ]
null
null
null
checkov/terraform/checks/resource/aws/PasswordPolicyExpiration.py
gustavotabares/checkov
79250dba0fc5227ef3027b3c1300739f063b0d05
[ "Apache-2.0" ]
null
null
null
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck class PasswordPolicyExpiration(BaseResourceCheck): def __init__(self): name = "Ensure IAM password policy expires passwords within 90 days or less" ...
38
106
0.698308
from checkov.common.models.enums import CheckResult, CheckCategories from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck class PasswordPolicyExpiration(BaseResourceCheck): def __init__(self): name = "Ensure IAM password policy expires passwords within 90 days or less" ...
true
true
f731aa3598934a92decae817cbccea150452d087
1,898
py
Python
python_modules/dagster/dagster_tests/api_tests/test_api_snapshot_execution_plan.py
JPeer264/dagster-fork
32cc87a36134be7c442fa85d6867eb1d3301aea0
[ "Apache-2.0" ]
1
2020-09-19T16:35:59.000Z
2020-09-19T16:35:59.000Z
python_modules/dagster/dagster_tests/api_tests/test_api_snapshot_execution_plan.py
JPeer264/dagster-fork
32cc87a36134be7c442fa85d6867eb1d3301aea0
[ "Apache-2.0" ]
null
null
null
python_modules/dagster/dagster_tests/api_tests/test_api_snapshot_execution_plan.py
JPeer264/dagster-fork
32cc87a36134be7c442fa85d6867eb1d3301aea0
[ "Apache-2.0" ]
null
null
null
from dagster.api.snapshot_execution_plan import sync_get_external_execution_plan from dagster.core.snap.execution_plan_snapshot import ExecutionPlanSnapshot from .utils import get_foo_pipeline_handle def test_execution_plan_snapshot_api(): pipeline_handle = get_foo_pipeline_handle() execution_plan_snapshot ...
33.892857
95
0.74236
from dagster.api.snapshot_execution_plan import sync_get_external_execution_plan from dagster.core.snap.execution_plan_snapshot import ExecutionPlanSnapshot from .utils import get_foo_pipeline_handle def test_execution_plan_snapshot_api(): pipeline_handle = get_foo_pipeline_handle() execution_plan_snapshot ...
true
true
f731aa9055ffb5d097e1f239a5baee16564f7fec
1,564
py
Python
improved-ver1/6.Real_Estate_Own_Data_Prediction_improved1.py
ARAN1218/RealEstateRentPrediction_AI
da537f3204fa1bc80a499a03b2fd015926ccc755
[ "MIT" ]
1
2021-06-26T04:44:14.000Z
2021-06-26T04:44:14.000Z
improved-ver1/6.Real_Estate_Own_Data_Prediction_improved1.py
ARAN1218/RealEstateRentPrediction_AI
da537f3204fa1bc80a499a03b2fd015926ccc755
[ "MIT" ]
1
2021-08-06T15:58:27.000Z
2021-11-27T14:59:00.000Z
improved-ver1/6.Real_Estate_Own_Data_Prediction_improved1.py
ARAN1218/RealEstateRentPrediction_AI
da537f3204fa1bc80a499a03b2fd015926ccc755
[ "MIT" ]
null
null
null
#必要なライブラリをインポート import numpy as np import pandas as pd import xgboost as xgb from sklearn.preprocessing import LabelEncoder #numpyのリスト表示制限を解除しておく np.set_printoptions(threshold=np.inf) #既に学習データとREDP関数を用いてAIが作成されているものとする #model = RERL(df_l) #住所と路線と間取りはラベルエンコーディングの都合により学習データ/テストデータにあったものしか使えない為、予め確保しておいた使える要素を表示させる ...
22.342857
74
0.671995
import numpy as np import pandas as pd import xgboost as xgb from sklearn.preprocessing import LabelEncoder np.set_printoptions(threshold=np.inf) print(adressC,'\n','\n',stationC,'\n','\n',layoutC) def REODP(address,station,access,mc_fees,k_fees,s_fees,area,layout,age): d_try = { '住所':address, ...
true
true
f731aaf8a13f76df61485cd65cdaf166bf910a5e
7,617
py
Python
modules/filter_bed.py
hillerlab/TOGA
c4bce48c760d51739a8a63132316f49de77e0c71
[ "MIT" ]
32
2020-07-20T03:18:28.000Z
2022-03-28T09:04:48.000Z
modules/filter_bed.py
hillerlab/TOGA
c4bce48c760d51739a8a63132316f49de77e0c71
[ "MIT" ]
28
2020-07-20T14:03:55.000Z
2022-02-28T08:08:39.000Z
modules/filter_bed.py
hillerlab/TOGA
c4bce48c760d51739a8a63132316f49de77e0c71
[ "MIT" ]
5
2020-07-23T13:03:32.000Z
2021-09-16T15:39:23.000Z
#!/usr/bin/env python3 """Filter bed-12 file. Remove: - incomplete annotations - genes without CDS """ import argparse import sys import re from collections import Counter try: from modules.common import die from modules.common import eprint except ImportError: from common import die from commom impor...
37.895522
97
0.616516
import argparse import sys import re from collections import Counter try: from modules.common import die from modules.common import eprint except ImportError: from common import die from commom import eprint __author__ = "Bogdan Kirilenko, 2020." __version__ = "1.0" __email__ = "bogdan.kirilenko@senck...
true
true
f731abd403e3a3f072d4bde30a655735bb7f1420
8,680
py
Python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
2
2019-05-17T21:24:53.000Z
2020-02-12T11:13:42.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
15
2019-07-12T18:18:04.000Z
2019-07-25T20:55:51.000Z
sdk/network/azure-mgmt-network/azure/mgmt/network/v2017_09_01/operations/_default_security_rules_operations.py
LianwMS/azure-sdk-for-python
612d7bca9de86ee1bd1fa59291d7bf897ba9213f
[ "MIT" ]
2
2020-05-21T22:51:22.000Z
2020-05-26T20:53:01.000Z
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
48.222222
236
0.673272
from typing import TYPE_CHECKING import warnings from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from a...
true
true
f731ac74f48315280995265c0525ff9726f39e0d
1,156
py
Python
02_ukb/src/01_data_preparation/02_qdec_table/01_creat_qdec_table.py
Lifebrain/p025_education_brain
507cca3514b8ddbf65df7a047dba5bae1295badf
[ "MIT" ]
null
null
null
02_ukb/src/01_data_preparation/02_qdec_table/01_creat_qdec_table.py
Lifebrain/p025_education_brain
507cca3514b8ddbf65df7a047dba5bae1295badf
[ "MIT" ]
null
null
null
02_ukb/src/01_data_preparation/02_qdec_table/01_creat_qdec_table.py
Lifebrain/p025_education_brain
507cca3514b8ddbf65df7a047dba5bae1295badf
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Purpose: Create qdec table import pandas as pd import numpy as np import glob import os.path as op import os data_csv = op.join(os.environ['TABULAR_DATA_DIR'],'data.csv') output_file = op.join(os.environ['QDEC_DATA_DIR'],'qdec.table.dat') fs_dir = "/cluster/projects/p23/data/open_datasets/u...
31.243243
113
0.675606
import pandas as pd import numpy as np import glob import os.path as op import os data_csv = op.join(os.environ['TABULAR_DATA_DIR'],'data.csv') output_file = op.join(os.environ['QDEC_DATA_DIR'],'qdec.table.dat') fs_dir = "/cluster/projects/p23/data/open_datasets/ukb_long/bids/derivatives/freesurfer.7.1.0/recon" df...
true
true
f731ad39fbfd6798ad047b1f2307e945dfddf5eb
14,114
py
Python
utime/callbacks/callbacks.py
amiyapatanaik/U-Time
a9ed4892da77d165a71dbfef1d069d782c909757
[ "MIT" ]
1
2022-03-15T12:31:30.000Z
2022-03-15T12:31:30.000Z
utime/callbacks/callbacks.py
amiyapatanaik/U-Time
a9ed4892da77d165a71dbfef1d069d782c909757
[ "MIT" ]
null
null
null
utime/callbacks/callbacks.py
amiyapatanaik/U-Time
a9ed4892da77d165a71dbfef1d069d782c909757
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd from carbontracker.tracker import CarbonTracker from tensorflow.keras.callbacks import Callback from utime.utils import get_memory_usage from mpunet.utils import highlighted from mpunet.logging import ScreenLogger from collections import defaultdict from datetime import timedelta ...
41.511765
102
0.568372
import numpy as np import pandas as pd from carbontracker.tracker import CarbonTracker from tensorflow.keras.callbacks import Callback from utime.utils import get_memory_usage from mpunet.utils import highlighted from mpunet.logging import ScreenLogger from collections import defaultdict from datetime import timedelta ...
true
true
f731ad77a89b21efe9c339549c926df276f7e654
3,152
py
Python
stackalytics/processor/config.py
duongmn89/stackalytics
7b2412cddf5f48f42f92bc3400754a6c21742f0c
[ "Apache-2.0" ]
null
null
null
stackalytics/processor/config.py
duongmn89/stackalytics
7b2412cddf5f48f42f92bc3400754a6c21742f0c
[ "Apache-2.0" ]
null
null
null
stackalytics/processor/config.py
duongmn89/stackalytics
7b2412cddf5f48f42f92bc3400754a6c21742f0c
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2013 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
44.394366
78
0.63769
import copy from oslo_config import cfg CONNECTION_OPTS = [ cfg.StrOpt('runtime-storage-uri', default='memcached://127.0.0.1:11211', help='Storage URI'), ] PROCESSOR_OPTS = [ cfg.StrOpt('default-data-uri', default='https://raw.githubusercontent.com/stackalytics/' ...
true
true
f731ad9e1174078405c48bb42fee69eb69fa5af1
1,103
py
Python
piqa/model/tokenizers.py
AndrzejGretkowski/masters-piqa
5924cb5261bbcc2bb9970622c12c29f49bdea6e7
[ "MIT" ]
null
null
null
piqa/model/tokenizers.py
AndrzejGretkowski/masters-piqa
5924cb5261bbcc2bb9970622c12c29f49bdea6e7
[ "MIT" ]
null
null
null
piqa/model/tokenizers.py
AndrzejGretkowski/masters-piqa
5924cb5261bbcc2bb9970622c12c29f49bdea6e7
[ "MIT" ]
null
null
null
from transformers import AlbertTokenizerFast, RobertaTokenizerFast, DistilBertTokenizerFast from piqa.model.tokenizers_base import BaseTokenizerPIQA class PIQATokenizer(object): tokenizer_mapping = dict() @classmethod def register(cls, *args): def decorator(fn): for arg in args: ...
27.575
101
0.724388
from transformers import AlbertTokenizerFast, RobertaTokenizerFast, DistilBertTokenizerFast from piqa.model.tokenizers_base import BaseTokenizerPIQA class PIQATokenizer(object): tokenizer_mapping = dict() @classmethod def register(cls, *args): def decorator(fn): for arg in args: ...
true
true
f731ae5909a825418b54595ca18abd70d6832fb9
1,895
py
Python
home/urls.py
Paphra/recruitment-cms
2894d5285a6da4ff47c114377968c8fda95c24b6
[ "MIT" ]
2
2021-02-07T12:08:47.000Z
2021-02-22T07:12:53.000Z
home/urls.py
Paphra/recruitment-cms
2894d5285a6da4ff47c114377968c8fda95c24b6
[ "MIT" ]
null
null
null
home/urls.py
Paphra/recruitment-cms
2894d5285a6da4ff47c114377968c8fda95c24b6
[ "MIT" ]
null
null
null
from django.urls import path from . import views from files import views as files from finances import views as finances from others import views as others from operations import views as operations urlpatterns = [ path('clients/<int:client_id>/pay-reg-fee', views.pay_reg_fee, name='pay-reg-fee'), path('clie...
39.479167
87
0.692876
from django.urls import path from . import views from files import views as files from finances import views as finances from others import views as others from operations import views as operations urlpatterns = [ path('clients/<int:client_id>/pay-reg-fee', views.pay_reg_fee, name='pay-reg-fee'), path('clie...
true
true
f731afae0e47cb38488bcaa0764e4ae4aadbc6ac
6,801
py
Python
kerberos.py
bbhunter/kerberoast
e983ba1d5290e94c71e04fc15dc2cee482873f18
[ "Apache-2.0" ]
1,011
2015-03-17T21:52:07.000Z
2022-03-31T09:25:41.000Z
kerberos.py
bbhunter/kerberoast
e983ba1d5290e94c71e04fc15dc2cee482873f18
[ "Apache-2.0" ]
16
2015-07-08T09:12:27.000Z
2022-03-05T19:04:26.000Z
kerberos.py
bbhunter/kerberoast
e983ba1d5290e94c71e04fc15dc2cee482873f18
[ "Apache-2.0" ]
274
2015-04-28T21:24:23.000Z
2022-03-29T18:37:27.000Z
#!/usr/bin/env python3 -tt import hashlib import hmac from pyasn1.type import univ, char, useful, tag from pyasn1.codec.ber import encoder, decoder import datetime import base64 import sys #REF: http://tools.ietf.org/id/draft-brezak-win2k-krb-rc4-hmac-03.txt #T = 1 for TS-ENC-TS in the AS-Request #T = 8 for the AS-...
34.522843
97
0.551242
import hashlib import hmac from pyasn1.type import univ, char, useful, tag from pyasn1.codec.ber import encoder, decoder import datetime import base64 import sys def ntlmhash(s): hash = hashlib.new('md4', s.encode('utf-16le')).digest() return hash def rc4crypt(key, data): x = 0 box = list(rang...
true
true
f731b06c3942398040ef6910dde20647365a1923
992
py
Python
IPAddressPool/IPAddressPool/ip/IpAcquire.py
ruxuezhuimeng/spider
badf61a66e99cf1936b5c404ad85f1b00838943e
[ "MIT" ]
1
2020-06-17T05:56:19.000Z
2020-06-17T05:56:19.000Z
IPAddressPool/IPAddressPool/ip/IpAcquire.py
ruxuezhuimeng/spider
badf61a66e99cf1936b5c404ad85f1b00838943e
[ "MIT" ]
null
null
null
IPAddressPool/IPAddressPool/ip/IpAcquire.py
ruxuezhuimeng/spider
badf61a66e99cf1936b5c404ad85f1b00838943e
[ "MIT" ]
null
null
null
from config.SourceUrl import getUrl from ip.Ip2Db import insert import threading import requests from Log import log header = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' } def acquireIp(): aUrl = getUrl() log.info('获...
26.810811
134
0.566532
from config.SourceUrl import getUrl from ip.Ip2Db import insert import threading import requests from Log import log header = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36' } def acquireIp(): aUrl = getUrl() log.info('获...
true
true
f731b08e6a086de9df0318dd73e3fdb7854f1ed6
1,413
py
Python
models/diabetes/train.py
aditya9126/pipelines-azureml
0c747f12e02ee3d3976746663bd1da0ab5935887
[ "CC-BY-4.0", "MIT" ]
null
null
null
models/diabetes/train.py
aditya9126/pipelines-azureml
0c747f12e02ee3d3976746663bd1da0ab5935887
[ "CC-BY-4.0", "MIT" ]
null
null
null
models/diabetes/train.py
aditya9126/pipelines-azureml
0c747f12e02ee3d3976746663bd1da0ab5935887
[ "CC-BY-4.0", "MIT" ]
null
null
null
# new update import pickle import os import numpy as np from sklearn.datasets import load_diabetes from sklearn.linear_model import Ridge from sklearn.metrics import mean_squared_error from sklearn.model_selection import train_test_split from azureml.core.run import Run from utils import mylib os.makedirs('./outputs...
31.4
99
0.643312
import pickle import os import numpy as np from sklearn.datasets import load_diabetes from sklearn.linear_model import Ridge from sklearn.metrics import mean_squared_error from sklearn.model_selection import train_test_split from azureml.core.run import Run from utils import mylib os.makedirs('./outputs', exist_ok=T...
true
true
f731b0a7f4cf43d68c7253dd502f524c7bafe510
1,522
py
Python
src/ewaluacja2021/management/commands/raport_3n_to_xlsx.py
iplweb/bpp
f027415cc3faf1ca79082bf7bacd4be35b1a6fdf
[ "BSD-3-Clause" ]
null
null
null
src/ewaluacja2021/management/commands/raport_3n_to_xlsx.py
iplweb/bpp
f027415cc3faf1ca79082bf7bacd4be35b1a6fdf
[ "BSD-3-Clause" ]
41
2019-11-07T00:07:02.000Z
2022-02-27T22:09:39.000Z
src/ewaluacja2021/management/commands/raport_3n_to_xlsx.py
iplweb/bpp
f027415cc3faf1ca79082bf7bacd4be35b1a6fdf
[ "BSD-3-Clause" ]
null
null
null
# -*- encoding: utf-8 -*- import os from argparse import FileType from django.core.management import BaseCommand from ewaluacja2021.reports import load_data, rekordy from ewaluacja2021.util import autor2fn from ewaluacja2021.xlsy import AutorskiXLSX, CalosciowyXLSX from bpp.models import Autor from bpp.util import p...
30.44
82
0.635348
import os from argparse import FileType from django.core.management import BaseCommand from ewaluacja2021.reports import load_data, rekordy from ewaluacja2021.util import autor2fn from ewaluacja2021.xlsy import AutorskiXLSX, CalosciowyXLSX from bpp.models import Autor from bpp.util import pbar class Command(BaseCo...
true
true
f731b0e7750a7bea8517170165c3c68c3dc22cf8
844
py
Python
setup.py
jbarbadillo/pycoinmon
035e64652c533a569c6b236f54e12aff35ad82b1
[ "MIT" ]
null
null
null
setup.py
jbarbadillo/pycoinmon
035e64652c533a569c6b236f54e12aff35ad82b1
[ "MIT" ]
null
null
null
setup.py
jbarbadillo/pycoinmon
035e64652c533a569c6b236f54e12aff35ad82b1
[ "MIT" ]
null
null
null
from setuptools import setup from pycoinmon.metadata import Metadata metadata = Metadata() setup( name = 'pycoinmon', packages = ['pycoinmon'], version = metadata.get_version(), license = 'MIT', description = 'Python Port Based on COINMON', url = 'https://github.com/RDCH106/pycoinmon', key...
40.190476
115
0.575829
from setuptools import setup from pycoinmon.metadata import Metadata metadata = Metadata() setup( name = 'pycoinmon', packages = ['pycoinmon'], version = metadata.get_version(), license = 'MIT', description = 'Python Port Based on COINMON', url = 'https://github.com/RDCH106/pycoinmon', key...
true
true
f731b187b5cb80cd697134e200a8839565bad37f
453
py
Python
card.py
yehudareisler/risky-game
ea919bd07a2acf75dfd184b5c59ad80d41f47428
[ "MIT" ]
3
2021-01-21T02:06:12.000Z
2022-03-14T10:26:43.000Z
card.py
yehudareisler/risky-game
ea919bd07a2acf75dfd184b5c59ad80d41f47428
[ "MIT" ]
null
null
null
card.py
yehudareisler/risky-game
ea919bd07a2acf75dfd184b5c59ad80d41f47428
[ "MIT" ]
1
2021-08-29T07:47:12.000Z
2021-08-29T07:47:12.000Z
from enum import Enum class Card: card_type = None territory_name = '' def __init__(self, territory_name, card_type): self.territory_name = territory_name self.card_type = card_type def __str__(self): return f'Card of {self.territory_name} with {self.card_type} type' class ...
18.875
74
0.646799
from enum import Enum class Card: card_type = None territory_name = '' def __init__(self, territory_name, card_type): self.territory_name = territory_name self.card_type = card_type def __str__(self): return f'Card of {self.territory_name} with {self.card_type} type' class ...
true
true
f731b1ea9b5a643b7fe01d0c7b531d8169710a1a
401
py
Python
mmtbx/command_line/ntc_validation.py
dperl-sol/cctbx_project
b9e390221a2bc4fd00b9122e97c3b79c632c6664
[ "BSD-3-Clause-LBNL" ]
155
2016-11-23T12:52:16.000Z
2022-03-31T15:35:44.000Z
mmtbx/command_line/ntc_validation.py
dperl-sol/cctbx_project
b9e390221a2bc4fd00b9122e97c3b79c632c6664
[ "BSD-3-Clause-LBNL" ]
590
2016-12-10T11:31:18.000Z
2022-03-30T23:10:09.000Z
mmtbx/command_line/ntc_validation.py
dperl-sol/cctbx_project
b9e390221a2bc4fd00b9122e97c3b79c632c6664
[ "BSD-3-Clause-LBNL" ]
115
2016-11-15T08:17:28.000Z
2022-02-09T15:30:14.000Z
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function # LIBTBX_SET_DISPATCHER_NAME cctbx.development.ntc_validation from iotbx.cli_parser import run_program from mmtbx.programs.ntc_validation import Program # ==========================================================================...
33.416667
79
0.645885
from __future__ import absolute_import, division, print_function from iotbx.cli_parser import run_program from mmtbx.programs.ntc_validation import Program if (__name__ == '__main__'): results = run_program(program_class=Program)
true
true
f731b41b93060edbb8a60d852567a8c02dfe18c9
19,457
py
Python
hive/indexer/cached_post.py
RailCoin/hivemind
cd78b952b55911b63a59c762d1d4530a25d7d8f5
[ "MIT" ]
null
null
null
hive/indexer/cached_post.py
RailCoin/hivemind
cd78b952b55911b63a59c762d1d4530a25d7d8f5
[ "MIT" ]
null
null
null
hive/indexer/cached_post.py
RailCoin/hivemind
cd78b952b55911b63a59c762d1d4530a25d7d8f5
[ "MIT" ]
1
2020-03-24T12:26:08.000Z
2020-03-24T12:26:08.000Z
"""Manages cached post data.""" import math import collections import logging import ujson as json from toolz import partition_all from hive.db.adapter import Db from hive.utils.post import post_basic, post_legacy, post_payout, post_stats from hive.utils.timer import Timer from hive.indexer.accounts import Accounts ...
38.991984
83
0.582412
import math import collections import logging import ujson as json from toolz import partition_all from hive.db.adapter import Db from hive.utils.post import post_basic, post_legacy, post_payout, post_stats from hive.utils.timer import Timer from hive.indexer.accounts import Accounts log = logging.getLogger(__name_...
true
true
f731b44538e1b9c630d1af353fa35d3677a745d9
1,210
py
Python
BotClean_Large.py
Aditya148/Hackerrank-Artificial-Intelligence
5abbe561115b75cb28397661b7b0d7d53486ffee
[ "MIT" ]
null
null
null
BotClean_Large.py
Aditya148/Hackerrank-Artificial-Intelligence
5abbe561115b75cb28397661b7b0d7d53486ffee
[ "MIT" ]
null
null
null
BotClean_Large.py
Aditya148/Hackerrank-Artificial-Intelligence
5abbe561115b75cb28397661b7b0d7d53486ffee
[ "MIT" ]
null
null
null
import math def update_position(posr, posc, dirties): nearest_dirt = [] for i in range(len(dirties)): # Euclidean distance result = math.sqrt(((dirties[i][0] - posr) ** 2) + ((dirties[i][1] - posc) ** 2)) nearest_dirt.append(result) return [x for (y,x) in sorted(zip(nearest_dirt,dir...
22.407407
89
0.539669
import math def update_position(posr, posc, dirties): nearest_dirt = [] for i in range(len(dirties)): result = math.sqrt(((dirties[i][0] - posr) ** 2) + ((dirties[i][1] - posc) ** 2)) nearest_dirt.append(result) return [x for (y,x) in sorted(zip(nearest_dirt,dirties))] def next...
true
true
f731b4a38a9bc8969c194157663764cf285ad1bc
4,079
py
Python
AC_Network.py
pasindubawantha/just-copy
919b1723c87cadc5946f891da53f4abc7d50ff6e
[ "Apache-2.0" ]
1
2020-07-30T19:29:06.000Z
2020-07-30T19:29:06.000Z
AC_Network.py
pasindubawantha/just-copy
919b1723c87cadc5946f891da53f4abc7d50ff6e
[ "Apache-2.0" ]
null
null
null
AC_Network.py
pasindubawantha/just-copy
919b1723c87cadc5946f891da53f4abc7d50ff6e
[ "Apache-2.0" ]
null
null
null
import tensorflow as tf import tensorflow.contrib.slim as slim #import tensorflow.nn as slim import numpy as np from helpers import * class AC_Network(): def __init__(self,s_size,a_size,scope,trainer,s_shape): with tf.variable_scope(scope): #Input and visual encoding layers self.inp...
53.671053
109
0.617308
import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np from helpers import * class AC_Network(): def __init__(self,s_size,a_size,scope,trainer,s_shape): with tf.variable_scope(scope): self.inputs = tf.placeholder(shape=[None,s_size],dtype=tf.float32) ...
true
true
f731b554fa6750e8f70b9ce4eeb1ca9577514c53
7,291
py
Python
tests/pipeline/test_node_run.py
andmikey/kedro
9b4e4135720609d44ffdf5248246fe805f0b5469
[ "Apache-2.0" ]
1
2021-11-19T05:36:47.000Z
2021-11-19T05:36:47.000Z
tests/pipeline/test_node_run.py
andmikey/kedro
9b4e4135720609d44ffdf5248246fe805f0b5469
[ "Apache-2.0" ]
null
null
null
tests/pipeline/test_node_run.py
andmikey/kedro
9b4e4135720609d44ffdf5248246fe805f0b5469
[ "Apache-2.0" ]
1
2021-11-19T05:36:49.000Z
2021-11-19T05:36:49.000Z
# Copyright 2018-2019 QuantumBlack Visual Analytics Limited # # 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 # # THE SOFTWARE IS PROVIDED "AS IS"...
42.888235
86
0.665478
import pytest from kedro.io import LambdaDataSet from kedro.pipeline import node @pytest.fixture def mocked_dataset(mocker): load = mocker.Mock(return_value=42) save = mocker.Mock() return LambdaDataSet(load, save) def one_in_one_out(arg): return arg def one_in_dict_out(arg): return dict(re...
true
true
f731b5fbc7cc5db0a0a57a78bcbce234f1e07f3c
2,103
py
Python
beta_rec/recommenders/userKNN.py
mengzaiqiao/TVBR
cdac86a753c41f8f3c55a025be8d88dd305325f5
[ "MIT" ]
126
2020-03-19T02:30:23.000Z
2022-03-15T11:10:46.000Z
beta_rec/recommenders/userKNN.py
mengzaiqiao/TVBR
cdac86a753c41f8f3c55a025be8d88dd305325f5
[ "MIT" ]
174
2020-03-15T17:28:10.000Z
2022-03-15T22:38:51.000Z
beta_rec/recommenders/userKNN.py
mengzaiqiao/TVBR
cdac86a753c41f8f3c55a025be8d88dd305325f5
[ "MIT" ]
38
2020-03-19T00:38:47.000Z
2022-02-24T11:03:12.000Z
import os import time from munch import munchify from ray import tune from ..core.recommender import Recommender from ..models.userKNN import UserKNNEngine from ..utils.monitor import Monitor def tune_train(config): """Train the model with a hyper-parameter tuner (ray). Args: config (dict): All the...
27.311688
86
0.611032
import os import time from munch import munchify from ray import tune from ..core.recommender import Recommender from ..models.userKNN import UserKNNEngine from ..utils.monitor import Monitor def tune_train(config): data = config["data"] train_engine = UserKNN(munchify(config)) result = train_engine.tra...
true
true
f731b60bb39975a9d09169527228d3f67c163104
2,647
py
Python
sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py
yrbahn/feast
b5648f0cb6109594fcc8881237ddd583960d244f
[ "Apache-2.0" ]
null
null
null
sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py
yrbahn/feast
b5648f0cb6109594fcc8881237ddd583960d244f
[ "Apache-2.0" ]
null
null
null
sdk/python/tests/integration/feature_repos/universal/data_sources/redshift.py
yrbahn/feast
b5648f0cb6109594fcc8881237ddd583960d244f
[ "Apache-2.0" ]
null
null
null
from typing import Dict import pandas as pd from feast import RedshiftSource from feast.data_source import DataSource from feast.infra.offline_stores.redshift import RedshiftOfflineStoreConfig from feast.infra.utils import aws_utils from feast.repo_config import FeastConfigBaseModel from tests.integration.feature_rep...
33.0875
90
0.656215
from typing import Dict import pandas as pd from feast import RedshiftSource from feast.data_source import DataSource from feast.infra.offline_stores.redshift import RedshiftOfflineStoreConfig from feast.infra.utils import aws_utils from feast.repo_config import FeastConfigBaseModel from tests.integration.feature_rep...
true
true
f731b61e890831d1cd4fbf37958278bb584384cb
2,988
py
Python
setup.py
NeilBotelho/pip
d01bfcfaa13a4f06fa0ce61fa18cf06012f2e78f
[ "MIT" ]
null
null
null
setup.py
NeilBotelho/pip
d01bfcfaa13a4f06fa0ce61fa18cf06012f2e78f
[ "MIT" ]
1
2021-10-04T12:25:25.000Z
2021-10-05T07:30:54.000Z
setup.py
NeilBotelho/pip
d01bfcfaa13a4f06fa0ce61fa18cf06012f2e78f
[ "MIT" ]
1
2020-06-01T19:13:16.000Z
2020-06-01T19:13:16.000Z
# The following comment should be removed at some point in the future. # mypy: disallow-untyped-defs=False import codecs import os import sys from setuptools import find_packages, setup def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) # intentionally *not* adding an encoding option to o...
33.2
76
0.598728
import codecs import os import sys from setuptools import find_packages, setup def read(rel_path): here = os.path.abspath(os.path.dirname(__file__)) with codecs.open(os.path.join(here, rel_path), 'r') as fp: return fp.read() def get_version(rel_path): for line in read(rel_path).splitli...
true
true
f731b631d25327869866e36afed8e0d2ed3b20d4
184
py
Python
domain/message.py
wazatoki/IotLoggerClientSample
e69f0f5f4caa3714041f4d5e8a16cde03bbbd912
[ "MIT" ]
null
null
null
domain/message.py
wazatoki/IotLoggerClientSample
e69f0f5f4caa3714041f4d5e8a16cde03bbbd912
[ "MIT" ]
2
2021-04-06T18:18:36.000Z
2021-06-02T02:26:19.000Z
domain/message.py
wazatoki/IotLoggerClientSample
e69f0f5f4caa3714041f4d5e8a16cde03bbbd912
[ "MIT" ]
null
null
null
class message_data: device_id = "" message = "" def get_Data(self): return { "deviceID": self.device_id, "message": self.message }
18.4
39
0.505435
class message_data: device_id = "" message = "" def get_Data(self): return { "deviceID": self.device_id, "message": self.message }
true
true
f731b70415e7f66bf51834ee97e333db6e5dc6c6
52,857
py
Python
Lib/test/test_array.py
chexca/cpython
cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa
[ "CNRI-Python-GPL-Compatible" ]
1,318
2019-07-11T10:34:39.000Z
2022-03-29T15:05:19.000Z
Lib/test/test_array.py
chexca/cpython
cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa
[ "CNRI-Python-GPL-Compatible" ]
387
2020-12-15T14:54:04.000Z
2022-03-31T07:00:21.000Z
Lib/test/test_array.py
chexca/cpython
cfc6ce4d40f2f01314b7e283fb972a7bb3ed3faa
[ "CNRI-Python-GPL-Compatible" ]
66
2019-11-11T15:33:12.000Z
2022-03-01T07:55:55.000Z
"""Test the arraymodule. Roger E. Masse """ import unittest from test import support from test.support import _2G import weakref import pickle import operator import struct import sys import array from array import _array_reconstructor as array_reconstructor sizeof_wchar = array.array('u').itemsize class ArrayS...
34.751479
92
0.572999
import unittest from test import support from test.support import _2G import weakref import pickle import operator import struct import sys import array from array import _array_reconstructor as array_reconstructor sizeof_wchar = array.array('u').itemsize class ArraySubclass(array.array): pass class ArraySubc...
true
true
f731b7992515f911392bdff02585fa6debdfa83b
1,504
py
Python
apps/contrib/models/mixins.py
vicobits/django-wise
3fdc01eabdff459b31e016f9f6d1cafc19c5a292
[ "MIT" ]
5
2020-04-11T20:11:48.000Z
2021-03-16T23:58:01.000Z
apps/contrib/models/mixins.py
victoraguilarc/django-wise
3fdc01eabdff459b31e016f9f6d1cafc19c5a292
[ "MIT" ]
5
2020-04-11T20:17:56.000Z
2021-06-16T19:18:29.000Z
apps/contrib/models/mixins.py
victoraguilarc/django-wise
3fdc01eabdff459b31e016f9f6d1cafc19c5a292
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import uuid from django.db import models class TimeStampedModelMixin(models.Model): """Timestamp extra field. An abstract base class model that provides self updating 'created' and 'modified' fields https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.DateFie...
25.491525
100
0.691489
import uuid from django.db import models class TimeStampedModelMixin(models.Model): created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) class Meta: abstract = True ordering = ['-created_at', '-updated_at'] class UUIDModelMixin(models.M...
true
true