hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
95a45656cf826b1ea77f0a0d35223bd0566d4828 | 12,902 | py | Python | var/spack/repos/builtin/packages/qgis/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2018-11-16T02:42:57.000Z | 2019-06-06T19:18:50.000Z | var/spack/repos/builtin/packages/qgis/package.py | lcnzg/spack | 5b9f60f9bb159113bfd8a0c8f3f4a8a0c2f55d7e | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 32 | 2020-12-15T17:29:20.000Z | 2022-03-21T15:08:31.000Z | var/spack/repos/builtin/packages/qgis/package.py | hainest/spack | c592e17d49118f253b552ef6165745ded8ac0ea5 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-07-19T20:31:27.000Z | 2021-07-19T21:14:14.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Qgis(CMakePackage):
"""QGIS is a free and open-source cross-platform desktop geographic
... | 54.902128 | 124 | 0.62998 |
09c525a64e292de4058eda70b024d804ffd250bb | 4,053 | py | Python | image_tag_suggestion/predictor.py | CVxTz/TagSuggestionImages | 8246ab5cef3b4dd484d8106d68e930b83cb5da73 | [
"MIT"
] | 3 | 2020-09-04T18:46:32.000Z | 2021-03-21T10:41:16.000Z | image_tag_suggestion/predictor.py | CVxTz/TagSuggestionImages | 8246ab5cef3b4dd484d8106d68e930b83cb5da73 | [
"MIT"
] | 3 | 2020-11-13T18:39:34.000Z | 2022-02-10T01:13:58.000Z | image_tag_suggestion/predictor.py | CVxTz/TagSuggestionImages | 8246ab5cef3b4dd484d8106d68e930b83cb5da73 | [
"MIT"
] | 2 | 2020-04-21T09:47:14.000Z | 2020-08-30T17:35:26.000Z | import argparse
import json
import numpy as np
import pandas as pd
import yaml
from tensorflow.keras.applications.mobilenet_v2 import preprocess_input
from tensorflow.keras.models import load_model
from preprocessing_utilities import (
read_img_from_path,
resize_img,
read_from_file,
)
from utils import do... | 29.583942 | 87 | 0.649149 |
35c862351b02177b2abfb7dfc07a7eb265131deb | 167 | py | Python | src/testAdministrator/urls.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | src/testAdministrator/urls.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | src/testAdministrator/urls.py | perrons93/ots | 6102cc5e2e7a927036ab71fb719bada0fd225f7f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.splash_page, name=''),
url(r'^welcome/', views.splash_page, name='')
]
| 18.555556 | 49 | 0.646707 |
83ef2c5556b020afcf47de4da624a14efadac732 | 4,137 | py | Python | disambiguation_model/utils/utils_simmc2_mm_disambiguation.py | JChiyah/exloring-mm-in-simmc2 | 1825bc118e15bdeeaa58cfe528d86d0bbdd73f99 | [
"MIT"
] | null | null | null | disambiguation_model/utils/utils_simmc2_mm_disambiguation.py | JChiyah/exloring-mm-in-simmc2 | 1825bc118e15bdeeaa58cfe528d86d0bbdd73f99 | [
"MIT"
] | null | null | null | disambiguation_model/utils/utils_simmc2_mm_disambiguation.py | JChiyah/exloring-mm-in-simmc2 | 1825bc118e15bdeeaa58cfe528d86d0bbdd73f99 | [
"MIT"
] | null | null | null | import json
import ast
import os
import random
from .utils_function import get_input_example
def read_langs(args, dtype, _data):
print(("Reading [SIMMC2 Multimodal Disambiguation] for read_langs {}".format(dtype)))
features = ast.literal_eval(args["simmc2_input_features"])
if args["simmc2_max_turns"] <= 0... | 40.165049 | 100 | 0.658932 |
bd06d36bb3c5ca0d1043afc52da6bfd311ae2af3 | 69,672 | py | Python | tests/action/test_alter_field.py | Mohsen-Khodabakhshi/mongoengine-migrate | 1a7a26a47a474f70743c04700ce2a42f1872f166 | [
"Apache-2.0"
] | 15 | 2020-08-05T22:25:54.000Z | 2022-02-08T20:50:35.000Z | tests/action/test_alter_field.py | Mohsen-Khodabakhshi/mongoengine-migrate | 1a7a26a47a474f70743c04700ce2a42f1872f166 | [
"Apache-2.0"
] | 36 | 2020-10-22T09:05:01.000Z | 2022-02-21T14:50:17.000Z | tests/action/test_alter_field.py | Mohsen-Khodabakhshi/mongoengine-migrate | 1a7a26a47a474f70743c04700ce2a42f1872f166 | [
"Apache-2.0"
] | 5 | 2020-10-23T04:06:32.000Z | 2022-02-21T14:35:33.000Z | import itertools
import re
from copy import deepcopy
from unittest.mock import patch
import bson
import jsonpath_rw
import mongoengine
import pytest
from bson import ObjectId
from mongoengine_migrate.actions import AlterField
from mongoengine_migrate.exceptions import SchemaError, InconsistencyError
from mongoengine_... | 40.45993 | 105 | 0.654093 |
e08252a5e735572501738124f6eef34460624de2 | 156 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.14-list-with-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.14-list-with-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-006/ph-6.14-list-with-loop.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | saarc = ["Bangladesh", "Afghanistan", "Bhutan", "Nepal", "India", "Pakistan", "Sri Lanka"]
for country in saarc:
print(country, "is a member of SAARC")
| 39 | 90 | 0.660256 |
d58f002dfa4f68cd0e45a59e73a9f7b441f58759 | 11,810 | py | Python | scripts/perf/html_report.py | micmelesse/rocFFT | 0be729965fa2f7bb81b2bb140bb9cf1c3d5cb256 | [
"MIT"
] | null | null | null | scripts/perf/html_report.py | micmelesse/rocFFT | 0be729965fa2f7bb81b2bb140bb9cf1c3d5cb256 | [
"MIT"
] | null | null | null | scripts/perf/html_report.py | micmelesse/rocFFT | 0be729965fa2f7bb81b2bb140bb9cf1c3d5cb256 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from plotly import graph_objs as go
import pandas as pd
import numpy as np
import math
import sys
import functools
import glob
import os
import shutil
import random
class Sample:
def __init__(self, data, batch):
self.data = data
self.batch = batch
# returns a dict that maps ... | 31.662198 | 114 | 0.587976 |
501e5428de25fc49f28add139cc65edd699495cf | 12,442 | py | Python | deucevalere/tests/test_convenience_functions_cleanup.py | BenjamenMeyer/deuce-valere | e9ba7d96825e81e51ddd5f99f1464990969a8f07 | [
"Apache-2.0"
] | null | null | null | deucevalere/tests/test_convenience_functions_cleanup.py | BenjamenMeyer/deuce-valere | e9ba7d96825e81e51ddd5f99f1464990969a8f07 | [
"Apache-2.0"
] | null | null | null | deucevalere/tests/test_convenience_functions_cleanup.py | BenjamenMeyer/deuce-valere | e9ba7d96825e81e51ddd5f99f1464990969a8f07 | [
"Apache-2.0"
] | null | null | null | """
Deuce Valere - Tests - Functions - Vault Cleanup
"""
import ddt
from deuceclient.tests import *
import httpretty
from deucevalere import vault_validate, vault_cleanup
from deucevalere.tests import *
from deucevalere.tests.client_base import TestValereClientBase
from deucevalere.tests.client_base import calculate_r... | 40.527687 | 78 | 0.506269 |
bc33ad8765eb0426af55824d7689afa5dbf9193b | 21,471 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.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/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.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/v2019_11_01/aio/operations_async/_bastion_hosts_operations_async.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 ... | 47.502212 | 193 | 0.662661 |
c0ac2fe086f5a0750a39877315d70143e39c903c | 5,304 | py | Python | YorForger/modules/helper_funcs/extraction.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null | YorForger/modules/helper_funcs/extraction.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null | YorForger/modules/helper_funcs/extraction.py | Voidxtoxic/kita | b2a3007349727280e149dcca017413d7dc2e7648 | [
"MIT"
] | null | null | null |
from typing import List, Optional
from telegram import Message, MessageEntity
from telegram.error import BadRequest
from YorForger import LOGGER
from YorForger.modules.users import get_user_id
def id_from_reply(message):
prev_message = message.reply_to_message
if not prev_message:
return None, None... | 31.760479 | 114 | 0.609163 |
8ceca4ccd10c33f4a1b63f37f0ac78ffd00bb483 | 3,602 | py | Python | catalyst/rl/wrappers/raw_trajectory.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | 1 | 2019-12-15T18:29:15.000Z | 2019-12-15T18:29:15.000Z | catalyst/rl/wrappers/raw_trajectory.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | null | null | null | catalyst/rl/wrappers/raw_trajectory.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | 1 | 2020-04-16T10:20:00.000Z | 2020-04-16T10:20:00.000Z | import numpy as np
from gym.core import Wrapper
from catalyst.rl.utils.buffer import get_buffer
from catalyst.utils.dynamic_array import DynamicArray
class RawTrajectoryWrapper(Wrapper):
def __init__(
self,
env,
allow_early_resets=False,
initial_capacity=1e3,
):
"""
... | 32.45045 | 76 | 0.60161 |
55883a45a1cea35da580cf89940785edf5ff78f6 | 3,026 | py | Python | xlsxwriter/test/comparison/test_chart_order01.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_order01.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_order01.py | alecxe/XlsxWriter | b58796258c504c8b343d9b0e77f8571eb994b31a | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-04-12T16:44:58.000Z | 2020-04-12T16:44:58.000Z | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013, John McNamara, jmcnamara@cpan.org
#
import unittest
import os
from ...workbook import Workbook
from ..helperfunctions import _compare_xlsx_files
class TestCompareXLSXFiles(unittest.TestC... | 29.960396 | 79 | 0.546927 |
6ac8d9c7d8b307162e84c0b07b4b47ccb989807c | 10,192 | py | Python | sdk/python/pulumi_azure_native/synapse/latest/get_sql_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/latest/get_sql_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/synapse/latest/get_sql_pool.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 37.888476 | 317 | 0.65571 |
9ee5f7aa5ea653d891a1f124d83a33a3d95c13d9 | 8,793 | py | Python | tests/integration/numbers/v2/regulatory_compliance/test_supporting_document.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | tests/integration/numbers/v2/regulatory_compliance/test_supporting_document.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | tests/integration/numbers/v2/regulatory_compliance/test_supporting_document.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class SupportingDocumentTestCas... | 37.417021 | 138 | 0.532355 |
dc04d7e458f285b64443641b68ec1c696ef86853 | 571 | py | Python | lie_detection.py | nishantkumar1292/gaze_detection | 2365e59b4fe07d322afe4710a32c637aa3c102df | [
"MIT"
] | null | null | null | lie_detection.py | nishantkumar1292/gaze_detection | 2365e59b4fe07d322afe4710a32c637aa3c102df | [
"MIT"
] | null | null | null | lie_detection.py | nishantkumar1292/gaze_detection | 2365e59b4fe07d322afe4710a32c637aa3c102df | [
"MIT"
] | null | null | null | import os
import subprocess
import json
def get_lie_detection(video_path):
current_path = os.path.dirname(os.path.abspath(__file__))
abs_video_path = os.path.join(current_path, video_path)
command = "/home/ubuntu/vdohireai/bin/lie_detection.sh {}".format(abs_video_path)
print(command)
subprocess.call(command, she... | 30.052632 | 82 | 0.781086 |
3574b90643039800b121666b57190646d0a622a1 | 2,210 | py | Python | autobuild.py | karaoulanis/nemesis-code | 1ed488b389a552802ea910c9d8045f4cb0e57200 | [
"BSL-1.0"
] | 2 | 2019-07-02T11:59:42.000Z | 2020-08-17T11:51:55.000Z | autobuild.py | karaoulanis/nemesis-code | 1ed488b389a552802ea910c9d8045f4cb0e57200 | [
"BSL-1.0"
] | null | null | null | autobuild.py | karaoulanis/nemesis-code | 1ed488b389a552802ea910c9d8045f4cb0e57200 | [
"BSL-1.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import subprocess as sp
import argparse
import os
import shutil
import time
import re
def print_title(title):
print('# '+'-'*77+'\n'+'# '+title+'\n'+'# '+'-'*77)
def get_revision(url):
command = 'svn info {0}'.format(url)
proc = sp.Popen([comm... | 27.974684 | 81 | 0.591855 |
cfffb2c5dcc5e34b54fca2b342480b8291bef9b8 | 1,526 | py | Python | conftest.py | jayvdb/astropy | bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f | [
"BSD-3-Clause"
] | 1 | 2020-02-03T15:24:35.000Z | 2020-02-03T15:24:35.000Z | conftest.py | jayvdb/astropy | bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f | [
"BSD-3-Clause"
] | 1 | 2019-10-26T13:59:37.000Z | 2019-10-27T08:53:42.000Z | conftest.py | jayvdb/astropy | bc6d8f106dd5b60bf57a8e6e29c4e2ae2178991f | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# This file is the main file used when running tests with pytest directly,
# in particular if running e.g. ``pytest docs/``.
from importlib.util import find_spec
import os
import pkg_resources
import tempfile
try:
from pytest_astropy_header.display ... | 37.219512 | 76 | 0.752949 |
a87f0626b32fc3442a09325c7d384034c15e9e21 | 2,013 | py | Python | karapace/protobuf/location.py | instaclustr/karapace | 60e9d788be360dd7f1d29f6ecb3dc9f881233302 | [
"Apache-2.0"
] | 1 | 2021-09-29T07:17:47.000Z | 2021-09-29T07:17:47.000Z | karapace/protobuf/location.py | instaclustr/karapace | 60e9d788be360dd7f1d29f6ecb3dc9f881233302 | [
"Apache-2.0"
] | 9 | 2021-04-20T05:02:26.000Z | 2022-02-04T01:04:22.000Z | karapace/protobuf/location.py | instaclustr/karapace | 60e9d788be360dd7f1d29f6ecb3dc9f881233302 | [
"Apache-2.0"
] | 1 | 2021-04-03T16:48:42.000Z | 2021-04-03T16:48:42.000Z | # Ported from square/wire:
# wire-library/wire-schema/src/commonMain/kotlin/com/squareup/wire/schema/Location.kt
from typing import Optional
class Location:
""" Locates a .proto file, or a self.position within a .proto file, on the file system """
def __init__(self, base: str, path: str, line: int = -1, colu... | 33 | 94 | 0.545951 |
e1c59b1df5309c3b864e506ea3dda7bd792354cc | 22,431 | py | Python | train_tasks.py | amitakamath/vilbert-multi-task | 5a11b8265fab3598fcdcd7f7c33453b914d8ff2c | [
"MIT"
] | null | null | null | train_tasks.py | amitakamath/vilbert-multi-task | 5a11b8265fab3598fcdcd7f7c33453b914d8ff2c | [
"MIT"
] | null | null | null | train_tasks.py | amitakamath/vilbert-multi-task | 5a11b8265fab3598fcdcd7f7c33453b914d8ff2c | [
"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.
import argparse
import json
import logging
import os
import random
from io import open
import numpy as np
from tensorboardX import SummaryWrit... | 33.231111 | 145 | 0.572645 |
2be250b3cb240cfa693e9abe7039edc378a50f49 | 45,795 | py | Python | core/process.py | Sketch98/oil | 2d5c51432b9699e48178236da2e5b3bf1a33d79f | [
"Apache-2.0"
] | null | null | null | core/process.py | Sketch98/oil | 2d5c51432b9699e48178236da2e5b3bf1a33d79f | [
"Apache-2.0"
] | null | null | null | core/process.py | Sketch98/oil | 2d5c51432b9699e48178236da2e5b3bf1a33d79f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Andy Chu. 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
"""
process.py - Launch processes and manipulate... | 30.550367 | 105 | 0.623671 |
7e3ae4121f5515b0081af35ea8f397ce69beae04 | 530 | py | Python | leetcode/single_number_leetcode_136/test_single_number.py | Williano/Interview-Prep | 0ad688637215080c7e4d26c640d74c89227e7cfb | [
"MIT"
] | null | null | null | leetcode/single_number_leetcode_136/test_single_number.py | Williano/Interview-Prep | 0ad688637215080c7e4d26c640d74c89227e7cfb | [
"MIT"
] | null | null | null | leetcode/single_number_leetcode_136/test_single_number.py | Williano/Interview-Prep | 0ad688637215080c7e4d26c640d74c89227e7cfb | [
"MIT"
] | null | null | null | import unittest
from single_number_leetcode_136.single_number import Solution
class TestSingleNumber(unittest.TestCase):
def setUp(self) -> None:
self.solution = Solution()
self.data_1 = [2, 2, 1]
self.data_2 = [4, 1, 2, 1, 2]
self.data_3 = [1]
def test_single_number(self):
... | 29.444444 | 69 | 0.681132 |
ecea62e76fe9dab982abc08ace7403e2f97e4fc8 | 1,327 | py | Python | regesion-linear-simple/regresion_linear_simple.py | Pa7ry/data-preprocessing | 81f74c22b5b30e358b456b3a797df8deb41aba12 | [
"MIT"
] | null | null | null | regesion-linear-simple/regresion_linear_simple.py | Pa7ry/data-preprocessing | 81f74c22b5b30e358b456b3a797df8deb41aba12 | [
"MIT"
] | null | null | null | regesion-linear-simple/regresion_linear_simple.py | Pa7ry/data-preprocessing | 81f74c22b5b30e358b456b3a797df8deb41aba12 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Regresión lineal simple
# Importar librerías
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importar dataset
dataset = pd.read_csv('Salary_Data.csv')
# Crear variable con las filas y columnas indicadas
X = dataset.iloc[:, :-1].values
y = dataset.iloc[:, 1].values
#... | 30.159091 | 92 | 0.76639 |
34285dc3b458f3a7fb6fdaf7297a39e0cf96a453 | 1,520 | py | Python | tests/test_swagger.py | tristaaan/rigor | 0eddcb1ee8e0779fce8db4f70de27478d39d5187 | [
"MIT"
] | 74 | 2018-02-08T14:39:52.000Z | 2021-12-14T18:25:07.000Z | tests/test_swagger.py | tristaaan/rigor | 0eddcb1ee8e0779fce8db4f70de27478d39d5187 | [
"MIT"
] | 12 | 2018-02-21T12:29:59.000Z | 2021-09-08T15:26:56.000Z | tests/test_swagger.py | tristaaan/rigor | 0eddcb1ee8e0779fce8db4f70de27478d39d5187 | [
"MIT"
] | 6 | 2018-02-25T02:51:31.000Z | 2021-09-08T13:48:33.000Z | from rigor.swagger import Swagger, VAR
import pytest
import os.path
DATA_DIR = os.path.join(os.path.dirname(__file__), "swagger")
@pytest.fixture()
def swagger_json():
json = open(os.path.join(DATA_DIR, "swagger_petstore_simple.json")).read()
return Swagger.loads(json)
def test_swagger_paths(swagger_json)... | 28.148148 | 78 | 0.703289 |
403d04bb1a3004206729c43e5dae9822a4264ca4 | 1,870 | py | Python | watcher/decision_engine/strategy/strategies/__init__.py | jjmike2001/ForbeginTest000 | 03a2c0142ac032fd2ba0ad0b97ca1887445534ac | [
"Apache-2.0"
] | null | null | null | watcher/decision_engine/strategy/strategies/__init__.py | jjmike2001/ForbeginTest000 | 03a2c0142ac032fd2ba0ad0b97ca1887445534ac | [
"Apache-2.0"
] | null | null | null | watcher/decision_engine/strategy/strategies/__init__.py | jjmike2001/ForbeginTest000 | 03a2c0142ac032fd2ba0ad0b97ca1887445534ac | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
# Copyright (c) 2016 b<>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
#
# Unless required by applicable law or a... | 47.948718 | 78 | 0.831551 |
e60554a4b87ca71abed3e1b37b161061ae58121f | 388 | py | Python | gedgo/middleware.py | gthole/gedgo | a2561f443fe3e012386fc9e346720ca51062055f | [
"MIT"
] | 32 | 2015-03-31T10:21:22.000Z | 2021-11-27T08:48:30.000Z | gedgo/middleware.py | gthole/gedgo | a2561f443fe3e012386fc9e346720ca51062055f | [
"MIT"
] | 11 | 2017-05-03T17:12:23.000Z | 2022-02-16T16:15:06.000Z | gedgo/middleware.py | gthole/gedgo | a2561f443fe3e012386fc9e346720ca51062055f | [
"MIT"
] | 9 | 2015-03-28T00:11:58.000Z | 2021-05-07T23:53:30.000Z | import json
import time
import re
IGNORE_PATTERNS = [
r'^/gedgo/media/',
r'^/gedgo/\d+/(?:timeline|pedigree)'
]
IGNORE_PATTERNS = [re.compile(p) for p in IGNORE_PATTERNS]
class SimpleTrackerMiddleware(object):
"""
Lightweight user page view tracking.
"""
def process_response(self, request, r... | 19.4 | 58 | 0.667526 |
ba129c863dff24c1757b2099e887c1fdf794c17b | 518 | py | Python | events/migrations/0022_event_ics_file.py | obrienadam/ccse | a889ddf09dd92b9c4d46fd3bf38da644f70cd023 | [
"MIT"
] | null | null | null | events/migrations/0022_event_ics_file.py | obrienadam/ccse | a889ddf09dd92b9c4d46fd3bf38da644f70cd023 | [
"MIT"
] | 5 | 2021-03-18T22:51:01.000Z | 2022-01-13T01:07:00.000Z | events/migrations/0022_event_ics_file.py | obrienadam/ccse | a889ddf09dd92b9c4d46fd3bf38da644f70cd023 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-11 23:52
from __future__ import unicode_literals
from django.db import migrations, models
import events.models
class Migration(migrations.Migration):
dependencies = [
('events', '0021_auto_20170801_0917'),
]
operations = [
... | 23.545455 | 98 | 0.644788 |
54a54f47d259fbb1d6b88942fb57b0f3b7be507f | 2,146 | py | Python | inputs/submission_csv.py | a2edap/WE-Validate | 6e4be8228c9b4f66fb1a056f7566030b79441f2e | [
"BSD-3-Clause"
] | 1 | 2022-01-21T08:09:03.000Z | 2022-01-21T08:09:03.000Z | inputs/submission_csv.py | a2edap/WE-Validate | 6e4be8228c9b4f66fb1a056f7566030b79441f2e | [
"BSD-3-Clause"
] | null | null | null | inputs/submission_csv.py | a2edap/WE-Validate | 6e4be8228c9b4f66fb1a056f7566030b79441f2e | [
"BSD-3-Clause"
] | null | null | null | # This is a parser for benchmark exercise submissions in csv format
import os
import pathlib
import pandas as pd
class submission_csv:
def __init__(self, info, conf):
self.path = os.path.join(
(pathlib.Path(os.getcwd()).parent), str(info['path'])
)
self.file = info['file... | 28.613333 | 82 | 0.538677 |
3bd4cd1cb5229638581458d224896ea9f60970fb | 3,179 | py | Python | debexpo/settings/test.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 3 | 2016-02-17T08:47:07.000Z | 2017-05-20T20:43:23.000Z | debexpo/settings/test.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 44 | 2015-01-11T00:54:24.000Z | 2019-08-17T21:06:25.000Z | debexpo/settings/test.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 8 | 2015-01-12T00:57:32.000Z | 2017-01-20T23:01:52.000Z | # test.py - Django settings for debexpo project in tests
#
# This file is part of debexpo
# https://salsa.debian.org/mentors.debian.net-team/debexpo
#
# Copyright © 2019 Baptiste Beauplat <lyknode@cilg.org>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software a... | 31.79 | 69 | 0.7257 |
a679c1fc395acd8602f7f9550a1e73a1462193ab | 117,817 | py | Python | pymatgen/analysis/phase_diagram.py | molllyn1/pymatgen | 8ba60e6114cd8cd4ea818d3c9e84b71ebef0c654 | [
"MIT"
] | null | null | null | pymatgen/analysis/phase_diagram.py | molllyn1/pymatgen | 8ba60e6114cd8cd4ea818d3c9e84b71ebef0c654 | [
"MIT"
] | null | null | null | pymatgen/analysis/phase_diagram.py | molllyn1/pymatgen | 8ba60e6114cd8cd4ea818d3c9e84b71ebef0c654 | [
"MIT"
] | 1 | 2021-06-09T20:07:41.000Z | 2021-06-09T20:07:41.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module defines tools to generate and analyze phase diagrams.
"""
import collections
import itertools
import json
import logging
import math
import os
import re
from functools import lru_cache
import ... | 38.922035 | 120 | 0.560955 |
6938a1741859e5343476d8ffa054e88fef606865 | 4,401 | py | Python | tensor2tensor/data_generators/generator_utils_test.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2022-03-25T03:07:28.000Z | 2022-03-25T03:07:28.000Z | tensor2tensor/data_generators/generator_utils_test.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2022-01-05T06:08:00.000Z | 2022-01-05T06:08:29.000Z | tensor2tensor/data_generators/generator_utils_test.py | fangyihao/teamnet | 4f906b80f17626b0b2aedf9b6f495dbd0eb47dd6 | [
"Apache-2.0"
] | 1 | 2021-07-15T07:25:08.000Z | 2021-07-15T07:25:08.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 35.491935 | 79 | 0.705521 |
77023efac8eefb584f766af1aa169c8f29675537 | 6,314 | py | Python | perma_web/perma/tests/test_views_auth.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 317 | 2015-02-12T16:53:34.000Z | 2022-03-14T23:38:04.000Z | perma_web/perma/tests/test_views_auth.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 2,069 | 2015-01-06T20:09:24.000Z | 2022-03-31T15:44:36.000Z | perma_web/perma/tests/test_views_auth.py | rachelaus/perma | 36c05080520ea3ffce465dbc383795c060fa4112 | [
"MIT",
"Unlicense"
] | 69 | 2015-01-12T18:56:07.000Z | 2022-02-22T19:57:10.000Z | from axes.models import AccessAttempt
from axes.utils import reset as reset_login_attempts
import datetime
from time import sleep
from django.conf import settings
from django.core import mail
from django.test.utils import override_settings
from django.urls import reverse
from .utils import PermaTestCase
class AuthV... | 42.093333 | 132 | 0.681501 |
529b4408fe0f51ec45de9b4cccdd01ba2c727208 | 2,540 | py | Python | src/etl/tweeter/fetch_tweets.py | gunnerVivek/Abusive-language-detection-in-Online-content | 8f33a8b0194eb77e3018f16c153291bd451fb072 | [
"MIT"
] | null | null | null | src/etl/tweeter/fetch_tweets.py | gunnerVivek/Abusive-language-detection-in-Online-content | 8f33a8b0194eb77e3018f16c153291bd451fb072 | [
"MIT"
] | null | null | null | src/etl/tweeter/fetch_tweets.py | gunnerVivek/Abusive-language-detection-in-Online-content | 8f33a8b0194eb77e3018f16c153291bd451fb072 | [
"MIT"
] | null | null | null | '''
This Module impliments functions to fetch
tweets by Tweet Id.
Requirements:- Tweepy
'''
import time
from pandas import DataFrame
import tweepy
import prepare_tweet_ids
from etl.definations_configurations import API_KEY, API_KEY_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET
# TODO: Implement LOG
clas... | 25.148515 | 101 | 0.609843 |
3df2dd5148ab52e025101bb4894b369e7ccbd62a | 3,653 | py | Python | gather_dataset_from_api.py | eleweek/twitter_sentiment_analysis | 9feb96eb7815ebe1fca0cfe1793766a8c332821e | [
"MIT"
] | 2 | 2017-06-30T14:46:13.000Z | 2018-07-21T12:02:14.000Z | gather_dataset_from_api.py | eleweek/twitter_sentiment_analysis | 9feb96eb7815ebe1fca0cfe1793766a8c332821e | [
"MIT"
] | null | null | null | gather_dataset_from_api.py | eleweek/twitter_sentiment_analysis | 9feb96eb7815ebe1fca0cfe1793766a8c332821e | [
"MIT"
] | null | null | null | import logging
FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s"
logging.basicConfig(level=logging.INFO, format=FORMAT)
import twitter
from urllib.parse import urlencode
import time
api = twitter.Api(consumer_key='gU4KnfHFn3jPavX1pZxJX1gvg',
consumer_secret='reowuNxMSdbZgOOmR6E0FL2YgEtfziMAYG... | 38.861702 | 101 | 0.585546 |
b1006412ff91503a103fae233be721dbebbeb518 | 2,974 | py | Python | fz/function_fill_data.py | panos1998/Thesis_Code | 3f95730b1b2139011b060f002d5ce449a886079b | [
"Apache-2.0"
] | null | null | null | fz/function_fill_data.py | panos1998/Thesis_Code | 3f95730b1b2139011b060f002d5ce449a886079b | [
"Apache-2.0"
] | null | null | null | fz/function_fill_data.py | panos1998/Thesis_Code | 3f95730b1b2139011b060f002d5ce449a886079b | [
"Apache-2.0"
] | null | null | null | from typing import List
import numpy as np
from arfftocsv import processing
def function_fill_data(categorical: List[str], continuous: List[str]):
all_labels = ['LeicGender','LeicRace','raeducl','mstat','shlt','hlthlm',
'mobilb','lgmusa','grossa','finea','LeicHBP','LeicAge','hearte',
'psyche','bmicat','physActiv... | 57.192308 | 90 | 0.580027 |
aaff4fcfb6eec34f2b42d5197c7337376188aa1e | 4 | py | Python | utils/__init__.py | luowensheng/MCN | 14e2ac46d255cbfa62f1d0403c10336c3ef5d18b | [
"MIT"
] | 132 | 2021-08-12T08:20:41.000Z | 2022-03-29T09:53:11.000Z | utils/__init__.py | luowensheng/MCN | 14e2ac46d255cbfa62f1d0403c10336c3ef5d18b | [
"MIT"
] | 12 | 2020-05-03T16:32:57.000Z | 2021-11-16T09:06:44.000Z | utils/__init__.py | luowensheng/MCN | 14e2ac46d255cbfa62f1d0403c10336c3ef5d18b | [
"MIT"
] | 25 | 2020-03-30T04:47:17.000Z | 2022-03-18T07:42:39.000Z | #git | 4 | 4 | 0.75 |
7f25ec81507808645645ba75561e0de864323482 | 1,327 | py | Python | openpype/hosts/harmony/plugins/publish/extract_workfile.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | 87 | 2021-05-07T08:40:46.000Z | 2022-03-19T00:36:25.000Z | openpype/hosts/harmony/plugins/publish/extract_workfile.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | 1,019 | 2021-04-26T06:22:56.000Z | 2022-03-31T16:30:43.000Z | openpype/hosts/harmony/plugins/publish/extract_workfile.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | 33 | 2021-04-29T12:35:54.000Z | 2022-03-25T14:48:42.000Z | # -*- coding: utf-8 -*-
"""Extract work file."""
import os
import shutil
from zipfile import ZipFile
import openpype.api
class ExtractWorkfile(openpype.api.Extractor):
"""Extract and zip complete workfile folder into zip."""
label = "Extract Workfile"
hosts = ["harmony"]
families = ["workfile"]
... | 30.159091 | 76 | 0.587038 |
42d8a2b4ab3b3c4e58ff04ea58b13f68d189bde3 | 27,811 | py | Python | beetsplug/replaygain.py | dreewoo/beets | e9834ef51cdb36567ecc926c85358f7c3d0e681a | [
"MIT"
] | null | null | null | beetsplug/replaygain.py | dreewoo/beets | e9834ef51cdb36567ecc926c85358f7c3d0e681a | [
"MIT"
] | null | null | null | beetsplug/replaygain.py | dreewoo/beets | e9834ef51cdb36567ecc926c85358f7c3d0e681a | [
"MIT"
] | null | null | null | # This file is part of beets.
# Copyright 2015, Fabrice Laporte, Yevgeny Bezman, and Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without... | 36.16515 | 79 | 0.592859 |
fa58de70ff1cccca3e9acbfe5cd35f0f6dae2109 | 960 | py | Python | erm/views/base.py | simonwoerpel/bruecken.medienrevolte.de | e221656f7b5100d06487f2419dc1aefa01944d87 | [
"MIT"
] | null | null | null | erm/views/base.py | simonwoerpel/bruecken.medienrevolte.de | e221656f7b5100d06487f2419dc1aefa01944d87 | [
"MIT"
] | 3 | 2020-06-05T17:52:44.000Z | 2021-06-10T19:46:49.000Z | erm/views/base.py | simonwoerpel/bruecken.medienrevolte.de | e221656f7b5100d06487f2419dc1aefa01944d87 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.shortcuts import render
from django.views.generic import ListView, DetailView
from erm.views.dynamic import BaseFilterView
from erm.settings import RootModel
class DynamicDetailView(DetailView):
context_object_name = 'object'
def get_object(self):
return BaseFilt... | 25.263158 | 75 | 0.7125 |
f9c0724f4120710b9bb78e49e320b9e80e637bf7 | 1,320 | py | Python | app/routers/external_contents.py | yamatteo/vue-fastapi-boilerplate | 5fa3de29a6e7ec4a8df9b3a4073f462307f62cb6 | [
"MIT"
] | 2 | 2020-03-11T02:58:44.000Z | 2020-03-27T16:00:25.000Z | app/routers/external_contents.py | yamatteo/vue-fastapi-boilerplate | 5fa3de29a6e7ec4a8df9b3a4073f462307f62cb6 | [
"MIT"
] | 7 | 2021-03-10T07:59:29.000Z | 2022-02-26T23:46:17.000Z | app/routers/external_contents.py | yamatteo/vue-fastapi-boilerplate | 5fa3de29a6e7ec4a8df9b3a4073f462307f62cb6 | [
"MIT"
] | 1 | 2020-03-11T02:58:48.000Z | 2020-03-11T02:58:48.000Z | from typing import List
from fastapi import APIRouter, Depends, Body
from fastapi import UploadFile, File
from starlette.responses import Response
from models import ExternalContent
from routers import admin_only
from schemas import *
router = APIRouter()
@router.post("/browse", dependencies=[Depends(admin_only)])... | 35.675676 | 121 | 0.793182 |
d39d449e29963dd6a88c9905667296b0133eb75e | 2,018 | py | Python | goose/extractors/microdata.py | sujoykroy/python-goose | 4667ee629524555eb60c9a5938a1fa702520c2c6 | [
"Apache-2.0"
] | 1 | 2020-11-15T12:40:51.000Z | 2020-11-15T12:40:51.000Z | goose/extractors/microdata.py | sujoykroy/python-goose | 4667ee629524555eb60c9a5938a1fa702520c2c6 | [
"Apache-2.0"
] | null | null | null | goose/extractors/microdata.py | sujoykroy/python-goose | 4667ee629524555eb60c9a5938a1fa702520c2c6 | [
"Apache-2.0"
] | 1 | 2021-09-08T14:29:25.000Z | 2021-09-08T14:29:25.000Z | from goose.extractors import BaseExtractor
class MicroDataExtractor(BaseExtractor):
def extract(self):
item_scopes = {}
nodes = self.parser.getElementsByXPath(
self.article.doc, '//*[@itemscope]')
for node in nodes:
item_type = self.parser.getAttri... | 39.568627 | 80 | 0.535679 |
016ec3797375e53b81a491f35cc91927933ccffe | 4,471 | py | Python | django_sentinel/sentinel.py | operasoftware/django-sentinel | 0b4ee938aa6a547b948a1e24039751459251a451 | [
"MIT"
] | null | null | null | django_sentinel/sentinel.py | operasoftware/django-sentinel | 0b4ee938aa6a547b948a1e24039751459251a451 | [
"MIT"
] | null | null | null | django_sentinel/sentinel.py | operasoftware/django-sentinel | 0b4ee938aa6a547b948a1e24039751459251a451 | [
"MIT"
] | 1 | 2022-03-16T14:16:08.000Z | 2022-03-16T14:16:08.000Z | # -*- coding: utf-8 -*-
import logging
import random
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from redis.sentinel import Sentinel
from django_redis.client import DefaultClient
DJANGO_REDIS_LOGGER = getattr(settings, "DJANGO_REDIS_LOGGER", False)
class SentinelClien... | 35.768 | 95 | 0.62335 |
0a2d717248e87dcb05be03c1a4bc470d43b911c7 | 2,187 | py | Python | guillotina_volto/scripts.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | 1 | 2020-11-14T13:09:49.000Z | 2020-11-14T13:09:49.000Z | guillotina_volto/scripts.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | 4 | 2021-05-14T20:21:03.000Z | 2021-11-18T01:27:04.000Z | guillotina_volto/scripts.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | null | null | null | import requests
from requests.auth import HTTPBasicAuth
auth = HTTPBasicAuth("root", "root")
def initdb():
groot = "http://localhost:8081/db"
resp = requests.get(groot, auth=auth,)
assert resp.status_code == 200
# Create container
resp = requests.post(
f"{groot}/",
auth=auth,
... | 27 | 87 | 0.582533 |
d97c54b2fb727fa4be1956dc17bdfa722797436d | 877 | py | Python | 2021/src/Pre-processing/Isotropic/Noise/src/modules/createAWGN.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null | 2021/src/Pre-processing/Isotropic/Noise/src/modules/createAWGN.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null | 2021/src/Pre-processing/Isotropic/Noise/src/modules/createAWGN.py | tansyab1/PhD-project | 15f170c1976e58697454cd992687d808d1b2284a | [
"MIT"
] | null | null | null |
import cv2
import numpy as np
from skimage.util import random_noise
import os
def create_noise(image, var=0.01, mean=0):
noise_img = random_noise(img, mode='gaussian',
mean=mean, var=var, clip=True)
return np.array(255*noise_img, dtype='uint8')
if __name__ == "__main__":
sa... | 32.481481 | 107 | 0.646522 |
85fdd0636f5f37b220b7c8c1961bf5c0865c262a | 6,453 | py | Python | purity_fb/purity_fb_1dot11/models/_replica_link_built_in.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot11/models/_replica_link_built_in.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot11/models/_replica_link_built_in.py | mabdelhafez/purity_fb_python_client | a9856875b3df43b4302a2e4addd1a6b71f51f5ce | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Pure Storage FlashBlade REST 1.11 Python SDK
Pure Storage FlashBlade REST 1.11 Python SDK, developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.11
Contact... | 27.34322 | 205 | 0.580195 |
7db9fde68e197f3f88490adea05a94dec5906bf1 | 213 | py | Python | JFit/JFit.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | 1 | 2021-03-02T12:51:42.000Z | 2021-03-02T12:51:42.000Z | JFit/JFit.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | null | null | null | JFit/JFit.py | J-Fit/JFit | 85c67aaca0295a75714db2011e35222dabf50c38 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@ author: Jinnan Zhang
@ email: jinnan.zhang@ihep.ac.cn
@ date: 2020.12.09
try to do global analysis of neutrino from JUNO
'''
if __name__ == "__main__":
pass | 19.363636 | 47 | 0.652582 |
9f646beff5e5f2ab7c61d776ec8c4d6d47f43b7c | 2,552 | py | Python | 1893/slu.py | matrixjoeq/timus_solutions | 8f5f33099bd51f5a40e342a18600b988f4ea31db | [
"MIT"
] | null | null | null | 1893/slu.py | matrixjoeq/timus_solutions | 8f5f33099bd51f5a40e342a18600b988f4ea31db | [
"MIT"
] | null | null | null | 1893/slu.py | matrixjoeq/timus_solutions | 8f5f33099bd51f5a40e342a18600b988f4ea31db | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
1893. A380
Time limit: 1.0 second
Memory limit: 64 MB
[Description]
There was no limit to Jack's joy! He managed to buy on the Internet tickets to
the ICPC semifinal contest, which was to be held very soon in the mysterious
overseas city of Saint Petersburg. Now he was go... | 36.985507 | 80 | 0.685737 |
a1000e4ab74cda2fb597e12af1c9c2e4b44dcaeb | 3,106 | py | Python | contrib/zmq/zmq_sub.py | fujicoin/fujicoin-0.20.0 | 2bed6d064ce44ada8bf3263fc2138029b78a8011 | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | fujicoin/fujicoin-0.20.0 | 2bed6d064ce44ada8bf3263fc2138029b78a8011 | [
"MIT"
] | null | null | null | contrib/zmq/zmq_sub.py | fujicoin/fujicoin-0.20.0 | 2bed6d064ce44ada8bf3263fc2138029b78a8011 | [
"MIT"
] | 1 | 2021-07-18T11:40:12.000Z | 2021-07-18T11:40:12.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Fujicoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""
ZMQ example using python3's asyncio
Fujicoin should be started with the command line argume... | 36.116279 | 107 | 0.644559 |
31de7943aadf641ac0bb4f953e8dd2ae0c81c998 | 1,889 | py | Python | src/aft_lambda/aft_customizations/aft_customizations_invoke_account_provisioning_framework.py | andrew-glenn/terraform-aws-control_tower_account_factory | 3e6d35c176cfd3cc4b42f9ce4a76f1c198a18eda | [
"Apache-2.0"
] | null | null | null | src/aft_lambda/aft_customizations/aft_customizations_invoke_account_provisioning_framework.py | andrew-glenn/terraform-aws-control_tower_account_factory | 3e6d35c176cfd3cc4b42f9ce4a76f1c198a18eda | [
"Apache-2.0"
] | null | null | null | src/aft_lambda/aft_customizations/aft_customizations_invoke_account_provisioning_framework.py | andrew-glenn/terraform-aws-control_tower_account_factory | 3e6d35c176cfd3cc4b42f9ce4a76f1c198a18eda | [
"Apache-2.0"
] | 2 | 2022-03-20T17:51:27.000Z | 2022-03-22T09:08:29.000Z | # Copyright Amazon.com, Inc. or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
import inspect
from typing import Any, Dict, Union
import aft_common.aft_utils as utils
from aft_common.customizations import (
build_invoke_event,
get_account_metadata_record,
get_account_request_r... | 33.140351 | 88 | 0.663314 |
439ad2b5ff4c60d8796cbbe5e7c033028818f897 | 9,266 | py | Python | Packs/FeedUnit42/Integrations/FeedUnit42/FeedUnit42.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | null | null | null | Packs/FeedUnit42/Integrations/FeedUnit42/FeedUnit42.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | 1 | 2020-07-29T21:48:58.000Z | 2020-07-29T21:48:58.000Z | Packs/FeedUnit42/Integrations/FeedUnit42/FeedUnit42.py | mchasepan/content | 177c7fe86c4872141107f48075c6578daffc4bd4 | [
"MIT"
] | 2 | 2020-07-15T06:41:52.000Z | 2020-07-19T18:45:23.000Z | from typing import List, Dict
from taxii2client.common import TokenAuth
from taxii2client.v20 import Server, as_pages
from CommonServerPython import *
# disable insecure warnings
requests.packages.urllib3.disable_warnings()
UNIT42_TYPES_TO_DEMISTO_TYPES = {
'ipv4-addr': FeedIndicatorType.IP,
'ipv6-addr': Fe... | 37.212851 | 114 | 0.591517 |
41a624f4c1476f8cba5f0b983441fbe95f9b31cf | 652 | py | Python | yama/config.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | 1 | 2021-10-30T00:54:34.000Z | 2021-10-30T00:54:34.000Z | yama/config.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | null | null | null | yama/config.py | vitovitolo/yama | 1d96530ac0b2700838dd9c65e6245e35b7f639cd | [
"MIT"
] | null | null | null | import os.path
import yaml
class Config:
"""
Configuration class definition
"""
def __init__(self, config_file):
self.config_file = config_file
if self.check_config():
self.config = self.get_config()
def get_config(self):
try:
return yaml.safe_load(o... | 22.482759 | 57 | 0.567485 |
d9130637f37aa67dccc5076d10b6043a6f6dd312 | 9,926 | py | Python | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 3 | 2020-02-11T14:22:51.000Z | 2020-11-26T19:09:03.000Z | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 1 | 2019-11-22T02:06:47.000Z | 2021-05-10T07:22:26.000Z | test/test_random_tester.py | shanefeng123/agilkia | 0ac4e9dd29f9ab0026037f71d7f28d017e54949b | [
"MIT"
] | 4 | 2019-12-12T10:44:07.000Z | 2022-03-10T14:09:27.000Z | # -*- coding: utf-8 -*-
"""
Unit tests for the RandomTester class.
@author: m.utting@uq.edu.au
"""
import unittest
import random
from pathlib import Path
import sklearn.utils.estimator_checks
from typing import Tuple, List, Set, Dict, Optional, Any
import agilkia
THIS_DIR = Path(__file__).parent
WSDL_EG = "http://... | 42.969697 | 107 | 0.590872 |
0a1acc16fda8652986e6d5298d2282b346b72bbe | 445 | py | Python | todo/bucketlist/migrations/0002_auto_20160413_2246.py | NdagiStanley/not-by-might | 5216c066c0869056e47259b33e42f375366f022c | [
"MIT"
] | 1 | 2019-01-15T20:18:50.000Z | 2019-01-15T20:18:50.000Z | todo/bucketlist/migrations/0002_auto_20160413_2246.py | NdagiStanley/not-by-might | 5216c066c0869056e47259b33e42f375366f022c | [
"MIT"
] | 17 | 2018-09-24T16:46:30.000Z | 2019-01-21T17:19:26.000Z | todo/bucketlist/migrations/0002_auto_20160413_2246.py | NdagiStanley/not-by-might | 5216c066c0869056e47259b33e42f375366f022c | [
"MIT"
] | 1 | 2016-04-13T11:16:27.000Z | 2016-04-13T11:16:27.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bucketlist', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='bucketlistitem',
n... | 22.25 | 89 | 0.624719 |
ca95a3cc815276c495fbc04a05212642e28b9c48 | 19,854 | py | Python | ctparse/time/rules.py | gabrielelanaro/ctparse | 15836ab6341d53e9042f4b0702a39d505b8aed72 | [
"MIT"
] | null | null | null | ctparse/time/rules.py | gabrielelanaro/ctparse | 15836ab6341d53e9042f4b0702a39d505b8aed72 | [
"MIT"
] | null | null | null | ctparse/time/rules.py | gabrielelanaro/ctparse | 15836ab6341d53e9042f4b0702a39d505b8aed72 | [
"MIT"
] | null | null | null | from dateutil.relativedelta import relativedelta
from dateutil.rrule import rrule, MONTHLY
from .. rule import rule, predicate, dimension, _regex_to_join
from .. types import Time, Interval, pod_hours
@rule(r'at|on|am|um|gegen|den|dem|der|the|ca\.?|approx\.?|about|(in|of)( the)?|around',
dimension(Time))
def ru... | 32.600985 | 94 | 0.585474 |
27458b9012a4adab55a4d403cc4c1d249907eb78 | 6,441 | py | Python | NodeClassifier/utils/training_utils.py | alshaboti/PoseidonMLOld | a83a5e958add50a00fcab374dff5131bae2fd52e | [
"Apache-2.0"
] | null | null | null | NodeClassifier/utils/training_utils.py | alshaboti/PoseidonMLOld | a83a5e958add50a00fcab374dff5131bae2fd52e | [
"Apache-2.0"
] | null | null | null | NodeClassifier/utils/training_utils.py | alshaboti/PoseidonMLOld | a83a5e958add50a00fcab374dff5131bae2fd52e | [
"Apache-2.0"
] | null | null | null | '''
Contains utilities required for parsing pcaps into model training features
'''
import os
import json
import numpy as np
from sklearn.model_selection import cross_val_score
from sklearn.decomposition import PCA
from sklearn.linear_model import RandomizedLogisticRegression
from sklearn.linear_model import LogisticR... | 34.629032 | 79 | 0.587642 |
3bf962bc76b7ae54cadc59d345610b6df8826071 | 12,629 | py | Python | test/python/transpiler/test_add_barrier_before_measuremets.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | test/python/transpiler/test_add_barrier_before_measuremets.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | test/python/transpiler/test_add_barrier_before_measuremets.py | ismaila-at-za-ibm/qiskit-terra | 08303ec98ac7b33fde55266dc3a74466fbdcae95 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018, IBM.
#
# This source code is licensed under the Apache License, Version 2.0 found in
# the LICENSE.txt file in the root directory of this source tree.
"""Test the Add Barrier Before Measurments pass"""
import unittest
from qiskit.transpiler.passes import BarrierBeforeFinalMe... | 34.98338 | 99 | 0.465437 |
3bc59409171a5ccb8f701c30629527ff16618582 | 4,001 | py | Python | src/livestreamer/utils.py | rzr/livestreamer | 96e3c70977901f203ef27272459465c2005cc789 | [
"BSD-2-Clause",
"MIT"
] | 1 | 2016-01-15T09:03:17.000Z | 2016-01-15T09:03:17.000Z | src/livestreamer/utils.py | huangbong/livestreamer | 14d242614362208cc66023ada68d71262448a69a | [
"BSD-2-Clause",
"MIT"
] | null | null | null | src/livestreamer/utils.py | huangbong/livestreamer | 14d242614362208cc66023ada68d71262448a69a | [
"BSD-2-Clause",
"MIT"
] | null | null | null | from .compat import urljoin, urlparse, parse_qsl
from .exceptions import PluginError
import hashlib
import hmac
import json
import re
import requests
import zlib
try:
import xml.etree.cElementTree as ET
except ImportError:
import xml.etree.ElementTree as ET
SWF_KEY = b"Genuine Adobe Flash Player 001"
def ur... | 27.033784 | 93 | 0.580105 |
fd25b8b8d7e7791b4f285f4606ca91c2fc17270a | 5,571 | py | Python | snow_noise_detect.py | alexchungio/Video-Quality-Diagnosis | 8e407e6c62b3ea3a8902cf81acef9685e14b3d42 | [
"Apache-2.0"
] | 6 | 2021-05-20T05:45:52.000Z | 2022-02-21T09:32:12.000Z | snow_noise_detect.py | alexchungio/Video-Quality-Diagnosis | 8e407e6c62b3ea3a8902cf81acef9685e14b3d42 | [
"Apache-2.0"
] | 1 | 2021-01-13T03:59:18.000Z | 2021-01-13T03:59:18.000Z | snow_noise_detect.py | alexchungio/Video-Quality-Diagnosis | 8e407e6c62b3ea3a8902cf81acef9685e14b3d42 | [
"Apache-2.0"
] | 3 | 2021-07-01T02:33:44.000Z | 2022-03-05T07:52:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------
# @ File : snow_noise_detect.py
# @ Description:
# @ Author : Alex Chung
# @ Contact : yonganzhong@outlook.com
# @ License : Copyright (c) 2017-2018
# @ Time : 2020/11/27 下午2:00
# @ Software :... | 29.632979 | 109 | 0.580327 |
39236dd8ec47af15842458b7622d7dc37d5d9c5b | 1,825 | py | Python | tests/test_cli_serve_get.py | eumiro/datasette | 90eba4c3ca569c57e96bce314e7ac8caf67d884e | [
"Apache-2.0"
] | 1 | 2020-11-03T17:40:11.000Z | 2020-11-03T17:40:11.000Z | tests/test_cli_serve_get.py | eumiro/datasette | 90eba4c3ca569c57e96bce314e7ac8caf67d884e | [
"Apache-2.0"
] | null | null | null | tests/test_cli_serve_get.py | eumiro/datasette | 90eba4c3ca569c57e96bce314e7ac8caf67d884e | [
"Apache-2.0"
] | 1 | 2021-01-02T18:15:21.000Z | 2021-01-02T18:15:21.000Z | from datasette.cli import cli, serve
from datasette.plugins import pm
from click.testing import CliRunner
import textwrap
import json
def test_serve_with_get(tmp_path_factory):
plugins_dir = tmp_path_factory.mktemp("plugins_for_serve_with_get")
(plugins_dir / "init_for_serve_with_get.py").write_text(
... | 26.838235 | 81 | 0.573151 |
886dc18e1135fb30d0e558348d6794cfe596812c | 48,095 | py | Python | keystone/tests/unit/test_v3_domain_config.py | 10088/keystone | 1561da645b6512decdc0d307d2ec79a8a4c9cc87 | [
"Apache-2.0"
] | 615 | 2015-01-07T12:32:52.000Z | 2022-03-24T03:49:47.000Z | keystone/tests/unit/test_v3_domain_config.py | 10088/keystone | 1561da645b6512decdc0d307d2ec79a8a4c9cc87 | [
"Apache-2.0"
] | 11 | 2015-04-13T18:52:40.000Z | 2021-08-21T06:13:05.000Z | keystone/tests/unit/test_v3_domain_config.py | 10088/keystone | 1561da645b6512decdc0d307d2ec79a8a4c9cc87 | [
"Apache-2.0"
] | 696 | 2015-01-15T00:31:07.000Z | 2022-03-16T09:56:00.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... | 39.584362 | 79 | 0.608566 |
005d671c8f297c3892f3b5723682252298ee51bd | 747 | py | Python | netmiko/cisco/cisco_nxos_ssh.py | rollerr/netmiko | 96a6fce610710077dc6b9959a7371dd42b0ea5cb | [
"MIT"
] | 1 | 2021-11-16T11:37:00.000Z | 2021-11-16T11:37:00.000Z | netmiko/cisco/cisco_nxos_ssh.py | rollerr/netmiko | 96a6fce610710077dc6b9959a7371dd42b0ea5cb | [
"MIT"
] | null | null | null | netmiko/cisco/cisco_nxos_ssh.py | rollerr/netmiko | 96a6fce610710077dc6b9959a7371dd42b0ea5cb | [
"MIT"
] | 1 | 2016-10-03T08:57:35.000Z | 2016-10-03T08:57:35.000Z | from __future__ import print_function
from __future__ import unicode_literals
import re
import time
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoNxosSSH(CiscoSSHConnection):
def session_preparation(self):
"""
Prepare the session after the connection has been established.... | 29.88 | 84 | 0.663989 |
182f2ce741965ca16c7dedfc7eb70cd955c48039 | 5,903 | py | Python | test/vpp_l2.py | mnaser/vpp | 8934a04596d1421c35b194949b2027ca1fe71aef | [
"Apache-2.0"
] | 1 | 2018-12-22T07:01:19.000Z | 2018-12-22T07:01:19.000Z | test/vpp_l2.py | mnaser/vpp | 8934a04596d1421c35b194949b2027ca1fe71aef | [
"Apache-2.0"
] | 1 | 2021-06-02T00:52:13.000Z | 2021-06-02T00:52:13.000Z | test/vpp_l2.py | mnaser/vpp | 8934a04596d1421c35b194949b2027ca1fe71aef | [
"Apache-2.0"
] | null | null | null | """
L2/BD Types
"""
from vpp_object import *
from vpp_ip import VppIpAddress
from vpp_lo_interface import VppLoInterface
from vpp_papi import MACAddress
class L2_PORT_TYPE:
NORMAL = 0
BVI = 1
UU_FWD = 2
class BRIDGE_FLAGS:
NONE = 0
LEARN = 1
FWD = 2
FLOOD = 4
UU_FLOOD = 8
ARP... | 26.710407 | 77 | 0.57259 |
a2250053fc632108613d4d261226f58c56603daf | 8,311 | py | Python | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/get_player_public_recor_5ea27d.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/get_player_public_recor_5ea27d.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | accelbyte_py_sdk/api/cloudsave/operations/public_player_record/get_player_public_recor_5ea27d.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template file: justice_py_sdk_codegen/__main__.py
# pylint: disable=duplicate-code
# pylint: disable=li... | 29.895683 | 171 | 0.616171 |
14de6f7d2eacd3bed8295ea53b7f526fb147e1b5 | 2,400 | py | Python | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805224759.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805224759.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | my_classes/ModulesPackages_PackageNamespaces/.history/import_varients_20210805224759.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """Import Variants and some misconceptions
# module1.py
import math
sys.modules
is math in sys.modules? math <module object> ________
if not, load and insert ref \
... | 43.636364 | 96 | 0.34125 |
d0a0587d44b121362e4426e018fe51c3cec51c81 | 1,221 | py | Python | LeetCode/Medium/shortest-distance-to-target-color.py | shrey199325/LeetCodeSolution | fede0d98d2aeeedc3cd501ac5042f2217494f4c6 | [
"Unlicense"
] | null | null | null | LeetCode/Medium/shortest-distance-to-target-color.py | shrey199325/LeetCodeSolution | fede0d98d2aeeedc3cd501ac5042f2217494f4c6 | [
"Unlicense"
] | null | null | null | LeetCode/Medium/shortest-distance-to-target-color.py | shrey199325/LeetCodeSolution | fede0d98d2aeeedc3cd501ac5042f2217494f4c6 | [
"Unlicense"
] | 1 | 2020-09-18T09:38:26.000Z | 2020-09-18T09:38:26.000Z | """
5070. Shortest Distance to Target Color
"""
class Solution(object):
def shortestDistanceColor(self, colors, queries):
"""
:type colors: List[int]
:type queries: List[List[int]]
:rtype: List[int]
"""
res = []
col_len = len(colors) # 5
for i, j in ... | 27.133333 | 109 | 0.45864 |
36bd32a6b2279db076234fc3c74d96b991c92bad | 2,045 | py | Python | model-optimizer/extensions/front/mxnet/custom_test.py | shinh/dldt | 693ab4e79a428e0801f17f4511b129a3fa8f4a62 | [
"Apache-2.0"
] | 1 | 2021-02-20T21:48:36.000Z | 2021-02-20T21:48:36.000Z | model-optimizer/extensions/front/mxnet/custom_test.py | erinpark33/dldt | edd86d090592f7779f4dbb2681546e1f4e81284f | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/front/mxnet/custom_test.py | erinpark33/dldt | edd86d090592f7779f4dbb2681546e1f4e81284f | [
"Apache-2.0"
] | 1 | 2021-02-19T01:06:12.000Z | 2021-02-19T01:06:12.000Z | """
Copyright (c) 2018-2019 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 35.258621 | 94 | 0.65379 |
d77c5c5073ca4f9e4019c964b881dd9c9a50df29 | 1,771 | py | Python | test/service/test_data_source_service.py | xellos00/plugin-azure-monitor | 5409707b2ea068ba35b408e01580c356e6b536c8 | [
"Apache-2.0"
] | null | null | null | test/service/test_data_source_service.py | xellos00/plugin-azure-monitor | 5409707b2ea068ba35b408e01580c356e6b536c8 | [
"Apache-2.0"
] | null | null | null | test/service/test_data_source_service.py | xellos00/plugin-azure-monitor | 5409707b2ea068ba35b408e01580c356e6b536c8 | [
"Apache-2.0"
] | 3 | 2020-11-23T10:08:28.000Z | 2020-12-28T04:41:41.000Z | import unittest
from unittest.mock import patch
from spaceone.core.unittest.result import print_data
from spaceone.core.unittest.runner import RichTestRunner
from spaceone.core import config
from spaceone.core.transaction import Transaction
from spaceone.monitoring.connector.azure_connector import AzureConnector
from ... | 32.2 | 77 | 0.700734 |
23a7addd72f9d349243108c6069a8a65a42c716b | 33,721 | py | Python | cdd/tests/mocks/methods.py | SamuelMarks/docstring2class | a70745134bcb069fffdf1d9210c17129925c8fd5 | [
"Apache-2.0",
"MIT"
] | 4 | 2021-05-28T14:50:58.000Z | 2022-03-01T23:22:14.000Z | cdd/tests/mocks/methods.py | SamuelMarks/docstring2class | a70745134bcb069fffdf1d9210c17129925c8fd5 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-02-19T04:13:38.000Z | 2021-02-19T04:13:38.000Z | cdd/tests/mocks/methods.py | SamuelMarks/docstring2class | a70745134bcb069fffdf1d9210c17129925c8fd5 | [
"Apache-2.0",
"MIT"
] | null | null | null | """
Mocks for methods
"""
from ast import (
Assign,
Attribute,
BinOp,
Call,
ClassDef,
Expr,
FunctionDef,
If,
Index,
Load,
Mult,
Name,
Pass,
Return,
Store,
Subscript,
Tuple,
arguments,
fix_missing_locations,
keyword,
)
from functools import... | 31.752354 | 108 | 0.408351 |
93303204eacb6a9d978567b615297aaf3b97a982 | 3,379 | py | Python | python2.7/site-packages/twisted/python/threadable.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 19 | 2015-05-01T19:59:03.000Z | 2021-12-09T08:03:16.000Z | python2.7/site-packages/twisted/python/threadable.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 1 | 2015-04-21T22:05:02.000Z | 2015-04-22T22:27:15.000Z | python2.7/site-packages/twisted/python/threadable.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 30 | 2015-03-25T19:40:07.000Z | 2021-05-28T22:59:26.000Z | # -*- test-case-name: twisted.python.threadable -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A module that will allow your program to be multi-threaded,
micro-threaded, and single-threaded. Currently microthreads are
unimplemented. The idea is to abstract away some commo... | 27.92562 | 96 | 0.660846 |
dc0765e72a4f8ac19068c8184d0525e02d6a4534 | 2,620 | py | Python | tests/sett/fixtures/SushiClawUSDCMiniDeploy.py | sajanrajdev/badger-system | 9fd707935da69ca6fa576b1ddde7bb9c65141f94 | [
"MIT"
] | null | null | null | tests/sett/fixtures/SushiClawUSDCMiniDeploy.py | sajanrajdev/badger-system | 9fd707935da69ca6fa576b1ddde7bb9c65141f94 | [
"MIT"
] | null | null | null | tests/sett/fixtures/SushiClawUSDCMiniDeploy.py | sajanrajdev/badger-system | 9fd707935da69ca6fa576b1ddde7bb9c65141f94 | [
"MIT"
] | null | null | null | from tests.sett.fixtures.SettMiniDeployBase import SettMiniDeployBase
from config.badger_config import sett_config, claw_config
from scripts.systems.sushiswap_system import SushiswapSystem
from scripts.systems.claw_system import connect_claw
from scripts.systems.claw_minimal import deploy_claw_minimal
from helpers.regi... | 31.190476 | 75 | 0.625191 |
5b808e874e286bd30985ad0281b256fcaeb614dd | 6,239 | py | Python | code/AlexaClient/alexa.py | prajitdas/BaeBotClients | 56700a15c2f57f5d7917eedf49f2955c257ac00c | [
"MIT"
] | null | null | null | code/AlexaClient/alexa.py | prajitdas/BaeBotClients | 56700a15c2f57f5d7917eedf49f2955c257ac00c | [
"MIT"
] | null | null | null | code/AlexaClient/alexa.py | prajitdas/BaeBotClients | 56700a15c2f57f5d7917eedf49f2955c257ac00c | [
"MIT"
] | null | null | null | """
This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well
as testing instructions are located at http://amzn.to/1LzFrj6
For additional samples, visit the Alexa Skills Kit Getting Started guide at
http://amzn.to/1LG... | 34.469613 | 84 | 0.661644 |
776150f66238f2bba62b5796162d781c11109054 | 4,942 | py | Python | moksha/api/widgets/global_resources/widget.py | lmacken/moksha | b75325b8fd0fb3ea2d393ddb81c27f32ae7e0b96 | [
"Apache-2.0"
] | 1 | 2019-06-27T11:36:50.000Z | 2019-06-27T11:36:50.000Z | moksha/api/widgets/global_resources/widget.py | lmacken/moksha | b75325b8fd0fb3ea2d393ddb81c27f32ae7e0b96 | [
"Apache-2.0"
] | null | null | null | moksha/api/widgets/global_resources/widget.py | lmacken/moksha | b75325b8fd0fb3ea2d393ddb81c27f32ae7e0b96 | [
"Apache-2.0"
] | null | null | null | # This file is part of Moksha.
# Copyright (C) 2008-2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 38.913386 | 116 | 0.624646 |
3e5afaffb5fa92090efe4d24853146ddb9318e13 | 952 | py | Python | lolz/urls.py | python-frederick/rest-demo | ba6dda4bee739b5647e32b25f2f46ff79b0a9a94 | [
"BSD-2-Clause"
] | null | null | null | lolz/urls.py | python-frederick/rest-demo | ba6dda4bee739b5647e32b25f2f46ff79b0a9a94 | [
"BSD-2-Clause"
] | null | null | null | lolz/urls.py | python-frederick/rest-demo | ba6dda4bee739b5647e32b25f2f46ff79b0a9a94 | [
"BSD-2-Clause"
] | null | null | null | """lolz URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based ... | 31.733333 | 79 | 0.715336 |
d7c8f4b6b9b34b5184e49184ee4d1aac1ea12f0f | 9,419 | py | Python | Scraper/src/preprocess.py | leondz/Political-Stance-in-Danish | 0941f6454beaa9ea71d61441f2b39d6d27189df7 | [
"CC-BY-4.0"
] | null | null | null | Scraper/src/preprocess.py | leondz/Political-Stance-in-Danish | 0941f6454beaa9ea71d61441f2b39d6d27189df7 | [
"CC-BY-4.0"
] | null | null | null | Scraper/src/preprocess.py | leondz/Political-Stance-in-Danish | 0941f6454beaa9ea71d61441f2b39d6d27189df7 | [
"CC-BY-4.0"
] | 1 | 2020-05-27T16:34:17.000Z | 2020-05-27T16:34:17.000Z | import nltk
import pandas as pd
# Generates feature vectors for all quotes in a given quote dataset passed as 'rawQuotes'. Includes either just the
# 'national policy' subset or the full dataset, generates features for use in generation of average word embedding
# vectors or full word embedding matrices, and includes... | 48.803109 | 123 | 0.631914 |
7a3974dd9da0d0acabc2378375a321f61b05da0a | 522 | py | Python | chart app/views.py | saidasaduakas/chartapp | 999c9e5323b3fe5e17cb115d3f9af7a5ec8ded55 | [
"MIT"
] | null | null | null | chart app/views.py | saidasaduakas/chartapp | 999c9e5323b3fe5e17cb115d3f9af7a5ec8ded55 | [
"MIT"
] | null | null | null | chart app/views.py | saidasaduakas/chartapp | 999c9e5323b3fe5e17cb115d3f9af7a5ec8ded55 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from . models import Product
from . forms import ProductForm
# Create your views here.
def index(request):
products = Product.objects.all()
if request.method=='POST' :
form =ProductForm(request.POST)
if form.is_valid():
form.save()
... | 29 | 58 | 0.624521 |
1ceb41e8189721c76a2e6254c5a92ab2d0a25d70 | 9,774 | py | Python | docs/conf.py | feynmanliang/RayleighMachine | efbfb813943e18237177e034be9a228701905981 | [
"MIT"
] | null | null | null | docs/conf.py | feynmanliang/RayleighMachine | efbfb813943e18237177e034be9a228701905981 | [
"MIT"
] | null | null | null | docs/conf.py | feynmanliang/RayleighMachine | efbfb813943e18237177e034be9a228701905981 | [
"MIT"
] | null | null | null | # This file is execfile()d with the current directory set to its containing dir.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# All configuration values have a default; values that are comme... | 34.055749 | 91 | 0.698997 |
768ea4f1c2211899bd2574c2b88ceb1d45663922 | 38,888 | py | Python | tests/lib/__init__.py | AbhinavOmprakash/pip | 5b2464c11f263afc3cc4be97610974a067a84903 | [
"MIT"
] | null | null | null | tests/lib/__init__.py | AbhinavOmprakash/pip | 5b2464c11f263afc3cc4be97610974a067a84903 | [
"MIT"
] | null | null | null | tests/lib/__init__.py | AbhinavOmprakash/pip | 5b2464c11f263afc3cc4be97610974a067a84903 | [
"MIT"
] | null | null | null | import json
import os
import re
import shutil
import site
import subprocess
import sys
import textwrap
from base64 import urlsafe_b64encode
from contextlib import contextmanager
from hashlib import sha256
from io import BytesIO
from textwrap import dedent
from typing import List, Optional
from zipfile import ZipFile
i... | 31.719413 | 88 | 0.611628 |
36d2083664a65e7648ec3bbeb2033be091006c45 | 4,450 | py | Python | doc/examples/plot_gabor.py | odebeir/scikits-image | 13b2170dfd3ee9065ba6d65f29ff37f6b3bf948e | [
"BSD-3-Clause"
] | null | null | null | doc/examples/plot_gabor.py | odebeir/scikits-image | 13b2170dfd3ee9065ba6d65f29ff37f6b3bf948e | [
"BSD-3-Clause"
] | null | null | null | doc/examples/plot_gabor.py | odebeir/scikits-image | 13b2170dfd3ee9065ba6d65f29ff37f6b3bf948e | [
"BSD-3-Clause"
] | 1 | 2019-09-17T08:10:52.000Z | 2019-09-17T08:10:52.000Z | """
=============================================
Gabor filter banks for texture classification
=============================================
In this example, we will see how to classify textures based on Gabor filter
banks. Frequency and orientation representations of the Gabor filter are similar
to those of the huma... | 33.712121 | 80 | 0.663371 |
36e8218dd6d4d2ea200d88121c483cb21b081219 | 2,130 | py | Python | corpus/files.py | github-te/core-utilities | 06b9d7e1c037eafa9873cc3d82dbb99144341993 | [
"MIT"
] | null | null | null | corpus/files.py | github-te/core-utilities | 06b9d7e1c037eafa9873cc3d82dbb99144341993 | [
"MIT"
] | null | null | null | corpus/files.py | github-te/core-utilities | 06b9d7e1c037eafa9873cc3d82dbb99144341993 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import glob
import os
import sys
from .outputs import stdout, stderr
def cat(filenames=[]):
"""Reads files in command-line order, printing them to stdout.
A dash ("-") as a filename treats stdin as a file, printing it line-by-line
until it encounters ^C.
For a UNIX domain so... | 28.026316 | 79 | 0.574178 |
1f225581f7b6ebed25e151f04e45edd62b751438 | 3,336 | py | Python | py/py_sparkling/ml/models.py | LazyBrainAI/sparkling-water | c99fecc53af4e400d499479a475f954c52575a74 | [
"Apache-2.0"
] | null | null | null | py/py_sparkling/ml/models.py | LazyBrainAI/sparkling-water | c99fecc53af4e400d499479a475f954c52575a74 | [
"Apache-2.0"
] | null | null | null | py/py_sparkling/ml/models.py | LazyBrainAI/sparkling-water | c99fecc53af4e400d499479a475f954c52575a74 | [
"Apache-2.0"
] | null | null | null | from pyspark.ml.util import JavaMLReadable, JavaMLWritable
from pyspark.ml.wrapper import JavaModel
from pysparkling.initializer import *
from pyspark.sql import SparkSession
from pyspark.sql.functions import udf
from pyspark.sql.types import DoubleType
from .util import JavaH2OMLReadable
class H2OGBMModel(JavaModel, ... | 37.066667 | 146 | 0.741906 |
696382fb65541a3216ea094323a92d3a6951a410 | 3,175 | py | Python | cnn/scripts/create_crossvalidation_sets.py | indexing-initiative/selective-indexing | e5cff7bf8914111a991a52aecd639e51b16d7a8d | [
"BSD-3-Clause"
] | null | null | null | cnn/scripts/create_crossvalidation_sets.py | indexing-initiative/selective-indexing | e5cff7bf8914111a991a52aecd639e51b16d7a8d | [
"BSD-3-Clause"
] | null | null | null | cnn/scripts/create_crossvalidation_sets.py | indexing-initiative/selective-indexing | e5cff7bf8914111a991a52aecd639e51b16d7a8d | [
"BSD-3-Clause"
] | null | null | null | from contextlib import closing
from helper import load_ids_from_file, random_permutation, write_ids_to_file
from mysql.connector import connect
from settings import get_config
SELECT_ARTICLE_IDS = 'SELECT DISTINCT a.id FROM articles AS a INNER JOIN journal_indexing_periods AS p ON a.journal_id = p.journal_id LEFT JOI... | 42.905405 | 454 | 0.704567 |
5a24208d7ffdcc9ae56785e651fa65c1f41de3ad | 3,511 | py | Python | pineboolib/fllegacy/fltranslations.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | null | null | null | pineboolib/fllegacy/fltranslations.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | 1 | 2017-10-30T22:00:48.000Z | 2017-11-11T19:34:32.000Z | pineboolib/fllegacy/fltranslations.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | 1 | 2017-10-30T20:16:38.000Z | 2017-10-30T20:16:38.000Z | """Fltranslations mdoule."""
# -*- coding: utf-8 -*-
import os
from pineboolib import logging
from pineboolib.core import decorators
from PyQt5 import QtCore, Qt
from typing import Any, Union
"""
Esta clase gestiona las diferenetes trducciones de módulos y aplicación
"""
class FLTranslations(object):
"""
... | 30.798246 | 95 | 0.594133 |
29f80adce50811ca079962f3848267ba1dee5b3e | 51,808 | py | Python | cinder/backup/manager.py | inspur-storage/cinder-test | 8efee51cae17cec98abee3b3a896a626b5974e5b | [
"Apache-2.0"
] | null | null | null | cinder/backup/manager.py | inspur-storage/cinder-test | 8efee51cae17cec98abee3b3a896a626b5974e5b | [
"Apache-2.0"
] | null | null | null | cinder/backup/manager.py | inspur-storage/cinder-test | 8efee51cae17cec98abee3b3a896a626b5974e5b | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | 46.051556 | 79 | 0.569256 |
4f06d36947313b1581be01eed98da37f8c7baf4f | 14,756 | py | Python | Lib/site-packages/wheel/bdist_wheel.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 72 | 2018-07-02T07:47:15.000Z | 2022-03-29T10:02:14.000Z | Lib/site-packages/wheel/bdist_wheel.py | Lucas11200/LocaPy | 5d1f214c091aa3703b2ff7d3c0713a91ed4a1f48 | [
"bzip2-1.0.6"
] | 51 | 2021-04-08T11:39:59.000Z | 2021-05-07T12:01:27.000Z | virtual/lib/python3.6/site-packages/wheel/bdist_wheel.py | eyern/instagram_clone | c18da15b35d28d91c3f63904af9d5da4e8e3e8ae | [
"MIT"
] | 29 | 2018-09-17T06:10:32.000Z | 2022-03-19T13:15:30.000Z | """
Create a wheel (.whl) distribution.
A wheel is a built archive format.
"""
import os
import shutil
import sys
import re
from email.generator import Generator
from distutils.core import Command
from distutils.sysconfig import get_python_version
from distutils import log as logger
from glob import iglob
from shutil... | 39.560322 | 98 | 0.584305 |
d6b0e7e1a78e03f82e88d87f44d86a7e9a3e3c50 | 1,554 | py | Python | democracy/issue/urls.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | 2 | 2016-05-09T04:57:34.000Z | 2017-03-03T14:22:24.000Z | democracy/issue/urls.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | null | null | null | democracy/issue/urls.py | spreeker/democracygame | 525139955cb739c295051f317ab670049511bcf8 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls.defaults import *
from issue.models import Issue
from django.views.decorators.cache import cache_page
urlpatterns = patterns('issue.views',
url(r'^vote/(?P<issue_id>\d+)$', 'record_vote', name='vote' ),
url(r'^multiply/(?P<issue_id>\d+)$', 'record_multiply', name='multiply' ),
url(r'^... | 47.090909 | 103 | 0.621622 |
26bdb66d30f90dae3c4dc44b2139aa53309e37f6 | 1,909 | py | Python | keras/layers/regularization/spatial_dropout_test.py | shraddhazpy/keras | 21a78464c191c40a90ed4e3ddfed747ae994703e | [
"Apache-2.0"
] | 1 | 2022-02-04T09:53:06.000Z | 2022-02-04T09:53:06.000Z | keras/layers/regularization/spatial_dropout_test.py | shraddhazpy/keras | 21a78464c191c40a90ed4e3ddfed747ae994703e | [
"Apache-2.0"
] | 1 | 2022-02-03T12:41:50.000Z | 2022-02-03T12:47:45.000Z | keras/layers/regularization/spatial_dropout_test.py | shraddhazpy/keras | 21a78464c191c40a90ed4e3ddfed747ae994703e | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 30.790323 | 80 | 0.647983 |
d5b492f28e5a66d0f653670b910e694f22a5d36a | 2,533 | py | Python | setup.py | sheacode/pyejabberd | 21ac7b2d2d59c8284b113df9c5da7710fcefaf9f | [
"MIT"
] | null | null | null | setup.py | sheacode/pyejabberd | 21ac7b2d2d59c8284b113df9c5da7710fcefaf9f | [
"MIT"
] | null | null | null | setup.py | sheacode/pyejabberd | 21ac7b2d2d59c8284b113df9c5da7710fcefaf9f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import, print_function
import io
import sys
import os
import re
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import relpath
from os.path import splitext
try: # for pi... | 32.896104 | 113 | 0.656139 |
1dc7a447bec141be57b18335dc18b6fe406c5689 | 7,693 | py | Python | inception_v4.py | faizao/Inception-v4 | e522b146d514cb40619ab38733d9f8fe018ea76f | [
"MIT"
] | null | null | null | inception_v4.py | faizao/Inception-v4 | e522b146d514cb40619ab38733d9f8fe018ea76f | [
"MIT"
] | null | null | null | inception_v4.py | faizao/Inception-v4 | e522b146d514cb40619ab38733d9f8fe018ea76f | [
"MIT"
] | null | null | null | from tensorflow.keras.layers import Input, concatenate, Dropout, Dense, Flatten, Activation
from tensorflow.keras.layers import MaxPooling2D, Convolution2D, AveragePooling2D, BatchNormalization
from tensorflow.keras.models import Model
from tensorflow.keras import backend as K
from tensorflow.keras.utils import get_fi... | 30.772 | 145 | 0.621474 |
58b05e6a53d7c3f3ef6768c9d74b33e89cf3a91a | 11,240 | py | Python | Briefly/api/tasks.py | q815101630/Briefly2.0 | d92ba52308ef8c644fe8fb453169d0bee1a7f47e | [
"MIT"
] | null | null | null | Briefly/api/tasks.py | q815101630/Briefly2.0 | d92ba52308ef8c644fe8fb453169d0bee1a7f47e | [
"MIT"
] | null | null | null | Briefly/api/tasks.py | q815101630/Briefly2.0 | d92ba52308ef8c644fe8fb453169d0bee1a7f47e | [
"MIT"
] | 1 | 2021-10-06T03:50:19.000Z | 2021-10-06T03:50:19.000Z | from celery import shared_task
from django.core.mail import send_mail
from django.template.loader import render_to_string
from django.conf import settings
from .speech_to_text_celery import amazon_transcribe, load_json_output, read_output, summarize
from json import dumps
from .quiz_generation import Quiz_generation
fr... | 36.375405 | 174 | 0.700267 |
6bc95496c6befbdb232b0c713d834d46c45009a1 | 3,321 | py | Python | tests/pipelines/test_regression.py | AyushExel/catalyst | e4aaf0781b86d3417888836759575cf818a980bc | [
"Apache-2.0"
] | 1 | 2021-09-26T08:48:39.000Z | 2021-09-26T08:48:39.000Z | tests/pipelines/test_regression.py | Ran485/catalyst | 84bc7576c981278f389279d87dda85dd66a758b6 | [
"Apache-2.0"
] | null | null | null | tests/pipelines/test_regression.py | Ran485/catalyst | 84bc7576c981278f389279d87dda85dd66a758b6 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader, TensorDataset
from catalyst import dl
from catalyst.settings import IS_CUDA_AVAILABLE, NUM_CUDA_DEVICES, SETTINGS
def train_experiment(device, engine=None):
with TemporaryDirect... | 29.131579 | 96 | 0.699187 |
1b918f0149fe12ff7556bbbea1651cb58b965eec | 3,605 | py | Python | StravaAPI/swagger_client/models/redirect_pathsupdate.py | jonberthet/EuroTrip_2018 | e9b057c6264df76d2b34ad711ff1f6343be5ca5e | [
"MIT"
] | null | null | null | StravaAPI/swagger_client/models/redirect_pathsupdate.py | jonberthet/EuroTrip_2018 | e9b057c6264df76d2b34ad711ff1f6343be5ca5e | [
"MIT"
] | null | null | null | StravaAPI/swagger_client/models/redirect_pathsupdate.py | jonberthet/EuroTrip_2018 | e9b057c6264df76d2b34ad711ff1f6343be5ca5e | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Platform API
The REST API for Platform.sh.
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class RedirectPathsupdate(object):
"""
NOTE: This class is auto generated by the swagger... | 25.034722 | 77 | 0.528155 |
9f175382cc662099e0e8660652ee5aa1521f2f4d | 2,105 | py | Python | ppocr/data/imaug/__init__.py | Topdu/PaddleOCR | ee3424359b56a75af7750b0242d7db5b6c8b6545 | [
"Apache-2.0"
] | null | null | null | ppocr/data/imaug/__init__.py | Topdu/PaddleOCR | ee3424359b56a75af7750b0242d7db5b6c8b6545 | [
"Apache-2.0"
] | null | null | null | ppocr/data/imaug/__init__.py | Topdu/PaddleOCR | ee3424359b56a75af7750b0242d7db5b6c8b6545 | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.890625 | 97 | 0.714964 |
38894a9c3d0f7397f494777fb4988188d4046046 | 2,350 | py | Python | frappe/desk/doctype/note/test_note.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 3 | 2017-12-09T22:05:11.000Z | 2019-10-22T12:03:43.000Z | frappe/desk/doctype/note/test_note.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 17 | 2021-03-22T18:47:14.000Z | 2022-03-15T12:21:00.000Z | frappe/desk/doctype/note/test_note.py | chentaoz/frappe | ee3c4943bf6177ad3b410cdb0d802af486751a65 | [
"MIT"
] | 2 | 2021-05-06T06:14:40.000Z | 2021-05-06T10:05:29.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
test_records = frappe.get_test_records('Note')
class TestNote(unittest.TestCase):
def insert_note(self):
frappe.db.sql('delete from tabVersi... | 30.519481 | 85 | 0.691915 |
e8e2f3ec8d4df29b0010915de4772c954d5874ad | 662 | py | Python | asst6_hil00/pascal.py | hibalubbad/hiba.baddie | 69001ad56c8a51f6e36a802bae061128d9fd5a71 | [
"MIT"
] | null | null | null | asst6_hil00/pascal.py | hibalubbad/hiba.baddie | 69001ad56c8a51f6e36a802bae061128d9fd5a71 | [
"MIT"
] | null | null | null | asst6_hil00/pascal.py | hibalubbad/hiba.baddie | 69001ad56c8a51f6e36a802bae061128d9fd5a71 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 16 16:03:05 2018
@author: Hiba Lubbad
"""
n = int(input())
def generatepascal(n):
pascal = []
pascalIndex = 0
pascal.append([1])
for i in range(n):
ls = []
ls.append(1)
for j in range(1, len(pascal[pascalIndex... | 21.354839 | 71 | 0.555891 |
caf353506ee84611ac993358da1285c868b382c4 | 879 | py | Python | PythonDesafios/d071.py | adaatii/Python-Curso-em-Video- | 30b37713b3685469558babb93b557b53210f010c | [
"MIT"
] | null | null | null | PythonDesafios/d071.py | adaatii/Python-Curso-em-Video- | 30b37713b3685469558babb93b557b53210f010c | [
"MIT"
] | null | null | null | PythonDesafios/d071.py | adaatii/Python-Curso-em-Video- | 30b37713b3685469558babb93b557b53210f010c | [
"MIT"
] | null | null | null | # Crie um programa que simule o funcionamento de um caixa eletrônico.
# No início, pergunte ao usuário qual será o valor a ser sacado (número inteiro)
# e o programa vai informar quantas cédulas de cada valor serão entregues. OBS:
# considere que o caixa possui cédulas de R$50, R$20, R$10 e R$1.
print('='*30)
print('{... | 29.3 | 80 | 0.575654 |
a7837502be9378e99512258e582c200379c0bb1a | 838 | py | Python | django_blog/blog/templatetags/blog_tags.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null | django_blog/blog/templatetags/blog_tags.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null | django_blog/blog/templatetags/blog_tags.py | Song2017/web-python | 4eef069c6e3d7c9a0ca7cd69381579f1cb428c69 | [
"MIT"
] | null | null | null | from django import template
from django.db.models.aggregates import Count
from blog.models import Post, Category, Tag
# register = template.Library()
# @register.simple_tag 装饰器将函数装饰为一个模板标签
register = template.Library()
@register.simple_tag
def get_recent_posts(num=5):
return Post.objects.all().order_by("-create... | 23.942857 | 69 | 0.74105 |
6e962acc2890275b33b63cbb6685bed0c72b378a | 974 | py | Python | [5] KB_Nils/solvers/recursive_sat.py | nexus127127/IndependentStudy_Spring2019 | 0100d2b58e8a220d64a7cfb695b89b0bc2eda5c3 | [
"MIT"
] | null | null | null | [5] KB_Nils/solvers/recursive_sat.py | nexus127127/IndependentStudy_Spring2019 | 0100d2b58e8a220d64a7cfb695b89b0bc2eda5c3 | [
"MIT"
] | null | null | null | [5] KB_Nils/solvers/recursive_sat.py | nexus127127/IndependentStudy_Spring2019 | 0100d2b58e8a220d64a7cfb695b89b0bc2eda5c3 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
from sys import stderr
from solvers.watchlist import update_watchlist
def solve(instance, watchlist, assignment, d, verbose):
"""
Recursively solve SAT by assigning to variables d, d+1, ..., n-1. Assumes
variables 0, ..., d-1 are assi... | 29.515152 | 77 | 0.553388 |
8a0fd2c0f9ec28dff1b5e932d3106eb9bc6a2088 | 733 | py | Python | extra/fetch.py | PaulDodd/dnd | b8e96223e688e885f591bc1f55a4084919e3f5ea | [
"MIT"
] | null | null | null | extra/fetch.py | PaulDodd/dnd | b8e96223e688e885f591bc1f55a4084919e3f5ea | [
"MIT"
] | null | null | null | extra/fetch.py | PaulDodd/dnd | b8e96223e688e885f591bc1f55a4084919e3f5ea | [
"MIT"
] | null | null | null | import urllib.request
import html5lib as html
import bs4 as bs
# soup = BeautifulSoup(html_doc, 'html.parser')
def _fetch(url):
try:
data = urllib.request.urlopen(url)
return data.read();
except e:
raise(e)
return data.read();
def _parse(htmldoc):
soup = bs.BeautifulSoup(htmldo... | 24.433333 | 65 | 0.601637 |
bb12e8cee399a3d589f83a7e0128b1330149a792 | 7,174 | py | Python | tensorforce/core/memories/replay.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | null | null | null | tensorforce/core/memories/replay.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | null | null | null | tensorforce/core/memories/replay.py | vbelus/tensorforce | 85504f49f33b4114cdbb19d73cc196539a702a2c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 47.509934 | 125 | 0.646083 |
3de09ae99d438c066cb0800b79fd7de6c734e930 | 9,746 | py | Python | cosmo.py | tos-1/MUSCLE | fd7e6115742028f324b28157344ed6bb7e3e6ade | [
"MIT"
] | null | null | null | cosmo.py | tos-1/MUSCLE | fd7e6115742028f324b28157344ed6bb7e3e6ade | [
"MIT"
] | null | null | null | cosmo.py | tos-1/MUSCLE | fd7e6115742028f324b28157344ed6bb7e3e6ade | [
"MIT"
] | null | null | null | '''
Cosmological module to compute linear theory related quantities.
The transfer functions of Eisenstein and Hu power spectrum were plagiarized from COLOSSUS.
There is the possibility to use Class
'''
import numpy as N
import math as M
from scipy.integrate import romberg,quad
import scipy.interpolate
try:... | 30.361371 | 132 | 0.512621 |
9b95c90a91e95902fbc1cf8351bc1e7d7fcc82dc | 1,334 | py | Python | mysqldb.py | Feners4/Flask-API-Framework | 017422cf6a89d939d7ba2b4fb1af41b551145f59 | [
"MIT"
] | null | null | null | mysqldb.py | Feners4/Flask-API-Framework | 017422cf6a89d939d7ba2b4fb1af41b551145f59 | [
"MIT"
] | null | null | null | mysqldb.py | Feners4/Flask-API-Framework | 017422cf6a89d939d7ba2b4fb1af41b551145f59 | [
"MIT"
] | null | null | null | import pymysql.cursors
# Connect to the database
connection = pymysql.connect(host='127.0.0.1',
user='root',
password='Tulipanes5',
db='clients',
charset='utf8mb4',
cursorcla... | 33.35 | 106 | 0.589955 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.