hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c2f2330481d30ae8177192c0a4d12370917af9b | 15,734 | py | Python | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 14 | 2020-11-16T03:57:19.000Z | 2022-03-30T01:44:53.000Z | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | null | null | null | GTSRB/train_watermarked_vgg.py | THUYimingLi/Open-sourced_Dataset_Protection | 910962c57e7d132497443b26c8e5da1dcb5ba4eb | [
"Apache-2.0"
] | 5 | 2020-11-16T03:56:00.000Z | 2022-03-19T06:37:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
This is the implement of two most important label-inconsistent backdoor attacks, including BadNets [1] and
Blended Attack [2] on MNIST dataset.
Reference:
[1] Badnets: Evaluating backdooring attacks on deep neural networks. IEEE Access 2019.
[2] Targeted Back... | 37.551313 | 176 | 0.65082 |
from __future__ import print_function
import argparse
import os
import shutil
import time
import random
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim as optim
import torch.utils.data as data
import torchvision.transforms as transforms
import gt... | true | true |
1c2f2397e10b6ee71825879c89041f0aa6475ace | 2,128 | py | Python | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | pvlib/test/test_surfrad.py | sjanzou/pvlib-python | 17751ca69f271891ee83082772b3261138e34dd0 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import os
from pandas import Timestamp, DatetimeIndex
from pandas.util.testing import network
from pvlib.iotools import surfrad
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
testfile = os.path.join(test_dir, '../data/surfrad-slv16001.dat')
network_testfile =... | 32.242424 | 78 | 0.699248 | import inspect
import os
from pandas import Timestamp, DatetimeIndex
from pandas.util.testing import network
from pvlib.iotools import surfrad
test_dir = os.path.dirname(
os.path.abspath(inspect.getfile(inspect.currentframe())))
testfile = os.path.join(test_dir, '../data/surfrad-slv16001.dat')
network_testfile =... | true | true |
1c2f24ca1f8cf87e4151939c8e28a2b8c430feea | 1,163 | py | Python | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 1 | 2021-04-20T07:10:06.000Z | 2021-04-20T07:10:06.000Z | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 2 | 2019-09-18T08:11:22.000Z | 2020-11-24T18:50:28.000Z | Packs/CommonScripts/Scripts/RunPollingCommand/RunPollingCommand_test.py | Gil-nuriel/content | b5237605d24ad915566f96c2cac392b1a93be80a | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | import pytest
from RunPollingCommand import prepare_arg_dict
IDS_ARGS = [
# sanity
(
('ids', ['a', 'b', 'c'], None, None),
{'ids': 'a,b,c'},
),
# single ID
(
('ids', 'a', None, None),
{'ids': 'a'},
),
# numeric IDs
(
('ids', [1, 2, 3], None, None... | 24.229167 | 88 | 0.483233 | import pytest
from RunPollingCommand import prepare_arg_dict
IDS_ARGS = [
(
('ids', ['a', 'b', 'c'], None, None),
{'ids': 'a,b,c'},
),
(
('ids', 'a', None, None),
{'ids': 'a'},
),
(
('ids', [1, 2, 3], None, None),
{'ids': '1,2,3'},
... | true | true |
1c2f25b44f7e259e539f14d9e7e009f5c9a4208e | 1,629 | py | Python | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | null | null | null | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | 6 | 2022-01-30T12:55:13.000Z | 2022-03-08T14:47:36.000Z | views/__init__.py | jftsang/pypew | 238b227493d41d10b7d4da9849f46d40c87039dc | [
"MIT"
] | null | null | null | import os
from tempfile import TemporaryDirectory
from traceback import format_exc
import pandas as pd
from flask import (flash, make_response, render_template, send_file)
from forms import UpdateTextsForm
from models import FEASTS_CSV
from utils import logger
from .feast_views import *
from .pew_sheet_views import *... | 25.061538 | 84 | 0.685697 | import os
from tempfile import TemporaryDirectory
from traceback import format_exc
import pandas as pd
from flask import (flash, make_response, render_template, send_file)
from forms import UpdateTextsForm
from models import FEASTS_CSV
from utils import logger
from .feast_views import *
from .pew_sheet_views import *... | true | true |
1c2f25bc1e0474a82211285206167478ae439650 | 3,357 | py | Python | moya/namespaces.py | moyaproject/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 129 | 2015-02-16T12:02:50.000Z | 2021-11-06T00:20:01.000Z | moya/namespaces.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 5 | 2015-02-19T15:56:41.000Z | 2015-09-08T18:58:35.000Z | moya/namespaces.py | liaohandel/moya | 78b91d87b4519f91dfdd2b40dab44e72f201a843 | [
"MIT"
] | 14 | 2015-02-19T17:20:34.000Z | 2022-03-28T01:38:09.000Z | from __future__ import unicode_literals
"""XML namespaces"""
admin = "http://moyaproject.com/admin"
auth = "http://moyaproject.com/auth"
blog = "http://moyaproject.com/blog"
comments = "http://moyaproject.com/comments"
db = "http://moyaproject.com/db"
default = "http://moyaproject.com"
email = "http://moyaproject.co... | 34.255102 | 80 | 0.627942 | from __future__ import unicode_literals
admin = "http://moyaproject.com/admin"
auth = "http://moyaproject.com/auth"
blog = "http://moyaproject.com/blog"
comments = "http://moyaproject.com/comments"
db = "http://moyaproject.com/db"
default = "http://moyaproject.com"
email = "http://moyaproject.com/email"
feedback = "... | true | true |
1c2f26f100c28e13893b2f00da4bf3f5f3d16cf2 | 13,557 | py | Python | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | services/storage/tests/unit/test_rest.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | null | null | null | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
import json
import os
import sys
from pathlib import Path
from typing import Any, Dict
from urllib.parse import quote
import pytest
import simcore_service_storage.meta
from aiohttp import web
from aiohttp.test_u... | 30.881549 | 172 | 0.651914 |
import json
import os
import sys
from pathlib import Path
from typing import Any, Dict
from urllib.parse import quote
import pytest
import simcore_service_storage.meta
from aiohttp import web
from aiohttp.test_utils import TestClient
from simcore_service_storage.access_layer import AccessRights
from simcore_servic... | true | true |
1c2f2750fa44f2fe21985ee9cadce4bf03d52400 | 6,013 | py | Python | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 6 | 2021-05-20T16:48:27.000Z | 2022-03-15T15:43:40.000Z | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | 25 | 2021-06-25T13:37:21.000Z | 2022-01-03T15:54:26.000Z | tests/snapshots/test_snapshot.py | IndicoDataSolutions/Indico-Solutions-Toolkit | c9a38681c84e86a48bcde0867359ddd2f52ce236 | [
"MIT"
] | null | null | null | import pytest
import os
import tempfile
from copy import deepcopy
import pandas as pd
from pandas.util.testing import assert_frame_equal
from indico_toolkit import ToolkitInputError
from indico_toolkit.snapshots import Snapshot
# TODO: tests for exception handling
def test_instantiation_wo_params(snapshot_csv_path):... | 34.959302 | 87 | 0.729752 | import pytest
import os
import tempfile
from copy import deepcopy
import pandas as pd
from pandas.util.testing import assert_frame_equal
from indico_toolkit import ToolkitInputError
from indico_toolkit.snapshots import Snapshot
def test_instantiation_wo_params(snapshot_csv_path):
snap = Snapshot(snapshot_csv_pa... | true | true |
1c2f2836f7ba4fa41f03b0e014f4625b9574f535 | 6,959 | py | Python | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/update_instance_shape_config_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 40.225434 | 245 | 0.699813 |
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class UpdateInstanceShapeConfigDetails(object):
BASELINE_OCPU_UTILIZATION_BASELINE_1_8 = "BASELINE_1_8"
... | true | true |
1c2f2892c020fb625b3bc82f8a9c4d88de484d6c | 919 | py | Python | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | wave2.0/division2B/hw1/A_interactor.py | stanislav-kudriavtsev/Yandex-Algorithms-Training | 0ad882e04847f6c2a973716a419befb21aa1df20 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""https://contest.yandex.ru/contest/28730/problems/A/"""
# pylint: disable=invalid-name
# pylint: disable=too-many-return-statements
def solve(ret: int, inter: int, check: int) -> int:
"""
Return the final decision.
Parameters
----------
return_co... | 19.145833 | 71 | 0.526659 |
def solve(ret: int, inter: int, check: int) -> int:
if inter == 0:
if ret:
return 3
return check
if inter == 1:
return check
if inter == 4:
if ret:
return 3
return 4
if inter == 6:
return 0
if inter == 7:
return ... | true | true |
1c2f28df8e9b7f3a8f79ee73f179528d1523295b | 2,172 | py | Python | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | paper2remarkable/providers/tandfonline.py | hukkelas/paper2remarkable | acc63b4b7328413f41f791caca2a611762f4f3b7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Provider for Taylor and Francis Online
Author: G.J.J. van den Burg
License: See LICENSE file
Copyright: 2020, G.J.J. van den Burg
"""
import re
from ._base import Provider
from ._info import Informer
from ..exceptions import URLResolutionError
from ..log import Logger
logger = Logger()
... | 28.96 | 91 | 0.587477 |
import re
from ._base import Provider
from ._info import Informer
from ..exceptions import URLResolutionError
from ..log import Logger
logger = Logger()
class TandFOnlineInformer(Informer):
meta_title_key = "dc.Title"
meta_author_key = "dc.Creator"
meta_date_key = "dc.Date"
def _format_authors(s... | true | true |
1c2f291af7d0a5541bcac4ca900ac1d3d7c23f0b | 7,067 | py | Python | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 10 | 2020-11-28T05:01:04.000Z | 2021-12-21T19:34:00.000Z | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2022-03-12T07:20:39.000Z | 2022-03-16T05:11:38.000Z | python/handwritten_baseline/pipeline/model/feature_extr/tfidf.py | UKPLab/cdcr-beyond-corpus-tailored | 52bf98692c7464f25628baea24addd1a988f9a1f | [
"Apache-2.0"
] | 1 | 2021-12-21T19:34:08.000Z | 2021-12-21T19:34:08.000Z | import pprint
from typing import Optional, List, Tuple, Set, Any, Dict
import numpy as np
from overrides import overrides
from sklearn.feature_extraction.text import TfidfVectorizer
from python import TOKEN, DOCUMENT_ID, SENTENCE_IDX
from python.handwritten_baseline import LEMMA
from python.handwritten_baseline.pipel... | 50.120567 | 137 | 0.685015 | import pprint
from typing import Optional, List, Tuple, Set, Any, Dict
import numpy as np
from overrides import overrides
from sklearn.feature_extraction.text import TfidfVectorizer
from python import TOKEN, DOCUMENT_ID, SENTENCE_IDX
from python.handwritten_baseline import LEMMA
from python.handwritten_baseline.pipel... | true | true |
1c2f2958c02a6c73b748d3b9c3776bf0c674cd1e | 1,333 | py | Python | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | 1 | 2015-07-20T10:40:25.000Z | 2015-07-20T10:40:25.000Z | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | null | null | null | setup.py | evildmp/facts | bcfb0ce33cf70f208d3db3abe1bc2969ef468f01 | [
"MIT"
] | null | null | null | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'facts',
version ... | 32.512195 | 78 | 0.629407 | import os
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name = 'facts',
version = '0.0.1',
description='A simple fac... | true | true |
1c2f296504fafdd4718d57268a30f1951299cc1b | 133 | py | Python | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 4 | 2016-01-05T21:18:17.000Z | 2018-07-02T23:19:26.000Z | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | null | null | null | dynamo/__init__.py | gutard/django-dynamo | eef3c2ae1928eef8f50c4d9685316a6eb372ea3c | [
"BSD-3-Clause"
] | 3 | 2015-06-27T15:36:01.000Z | 2021-12-13T18:20:33.000Z |
# import dynamo signals to make sure that they are connected for use by
# other apps
from dynamo.signals import *
version = '0.25'
| 19 | 71 | 0.744361 |
from dynamo.signals import *
version = '0.25'
| true | true |
1c2f2988c850ffb00fb533c65656e4736c3f8c50 | 5,055 | py | Python | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | 2 | 2019-04-07T04:01:57.000Z | 2019-07-11T11:59:55.000Z | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | tests/test_coordinates/test_velocity_transform.py | bibek22/einsteinpy | 78bf5d942cbb12393852f8e4d7a8426f1ffe6f23 | [
"MIT"
] | null | null | null | import sys
from io import StringIO
from unittest import mock
import astropy.units as u
import numpy as np
import pytest
from numpy.testing import assert_allclose
from einsteinpy import coordinates
@pytest.fixture()
def cartesian_differential():
return coordinates.CartesianDifferential(
10 / np.sqrt(2) *... | 29.051724 | 88 | 0.699308 | import sys
from io import StringIO
from unittest import mock
import astropy.units as u
import numpy as np
import pytest
from numpy.testing import assert_allclose
from einsteinpy import coordinates
@pytest.fixture()
def cartesian_differential():
return coordinates.CartesianDifferential(
10 / np.sqrt(2) *... | true | true |
1c2f2afdfe1c155e69711d6df88d944adfbce20b | 110 | py | Python | src/python/services/api/schemas/common/base.py | benlague/CS411 | afff0affb0a353c4fd14b6229dd83ef5ab7520aa | [
"MIT"
] | 4 | 2021-12-10T20:30:22.000Z | 2022-01-06T17:08:20.000Z | fastlane_web/web_api/schemas/common/base.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | fastlane_web/web_api/schemas/common/base.py | dgkatz/fastlane | 1cfe630651c955434f8019a17be0c4ff1fe42c31 | [
"MIT"
] | null | null | null | from marshmallow import Schema, EXCLUDE
class BaseSchema(Schema):
class Meta:
unknown = EXCLUDE
| 15.714286 | 39 | 0.709091 | from marshmallow import Schema, EXCLUDE
class BaseSchema(Schema):
class Meta:
unknown = EXCLUDE
| true | true |
1c2f2b4d69afab3f7b372e60201f16a6f9e5216d | 30,580 | py | Python | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 8 | 2018-07-17T13:13:21.000Z | 2022-03-01T17:02:34.000Z | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | 1 | 2021-03-10T07:55:59.000Z | 2021-03-10T07:55:59.000Z | saleor/graphql/checkout/mutations.py | elwoodxblues/saleor | 5e4e4a4259a011d24b04ebd24c77c689de843fa1 | [
"CC-BY-4.0"
] | null | null | null | from typing import List, Optional, Tuple
import graphene
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import transaction
from django.utils import timezone
from ...checkout import models
from ...checkout.error_codes import CheckoutErrorCode
from... | 36.018846 | 88 | 0.643165 | from typing import List, Optional, Tuple
import graphene
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.db import transaction
from django.utils import timezone
from ...checkout import models
from ...checkout.error_codes import CheckoutErrorCode
from... | true | true |
1c2f2bcadeab8e03b1eced3d3248600da24dceb3 | 254 | py | Python | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | 1 | 2019-12-24T04:28:10.000Z | 2019-12-24T04:28:10.000Z | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | null | null | null | spider/__init__.py | CCYYGO/PSpider | 5978fdfeecdbcb449f562194c91913ece3f12035 | [
"BSD-2-Clause"
] | null | null | null | # _*_ coding: utf-8 _*_
"""
define WebSpider, and also define utilities and instances for web_spider
"""
__version__ = "2.5.3"
from .utilities import *
from .concurrent import TPEnum, WebSpider
from .instances import Fetcher, Parser, Saver, Proxieser
| 21.166667 | 72 | 0.748031 |
__version__ = "2.5.3"
from .utilities import *
from .concurrent import TPEnum, WebSpider
from .instances import Fetcher, Parser, Saver, Proxieser
| true | true |
1c2f2dc160dc28e6805357962b8f8d9df566c32e | 1,416 | py | Python | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | src/stack/python/test_stack.py | SamyuelDanyo/data-structures | 057fbebd5f4be3af81727c09970f843df7c43007 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#################################################
""" test_stack.py
# # Test for Stack(LIFO) Implementation
# Tests:
# - Capacity, size.
# - Push, Pop, Peek.
# - Delete_mid.
"""
#################################################
# ### Author: Samyuel Danyo
# ### Date: 02/06/2020
... | 30.782609 | 72 | 0.531073 | true | true | |
1c2f2dff5e72218d9f9d7885c6a6a23e047231d4 | 1,345 | py | Python | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | hyperparams.py | kotsonis/banana-DDQN_RL | 7c7abd771e2758cff178ce65dc6f3afcbb35805a | [
"MIT"
] | null | null | null | std_learn_params = {
# Unity Environment parameters
"banana_location": "./Banana_Windows_x86_64/Banana.exe",
# MDP learning parameters
"n_episodes": 2000, # maximum episodes to train on
"max_t":1000, # maximum scenes in an episodic training
"eps_start":0.975, # s... | 51.730769 | 108 | 0.572491 | std_learn_params = {
"banana_location": "./Banana_Windows_x86_64/Banana.exe",
"n_episodes": 2000,
"max_t":1000,
"eps_start":0.975,
"eps_end":0.05,
"eps_decay":0.99,
'early_stop': 13,
"gamma": 1, ... | true | true |
1c2f2f3f821253be8de0a4ac64cc0e7883dd55ee | 10,787 | py | Python | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | tests/test_functions.py | vrthra/PyVM | 61fdf22533aceea2cc1f463f7cdbbc13eda6ff25 | [
"MIT"
] | null | null | null | """Test functions etc, for Bytevm."""
from __future__ import print_function
from . import vmtest
import six
PY3 = six.PY3
class TestFunctions(vmtest.VmTestCase):
def test_functions(self):
self.assert_ok("""\
def fn(a, b=17, c="Hello", d=[]):
d.append(99)
print... | 27.103015 | 82 | 0.370539 |
from __future__ import print_function
from . import vmtest
import six
PY3 = six.PY3
class TestFunctions(vmtest.VmTestCase):
def test_functions(self):
self.assert_ok("""\
def fn(a, b=17, c="Hello", d=[]):
d.append(99)
print(a, b, c, d)
fn(1)
... | true | true |
1c2f304c2cdde31005f56751f34965b6155440a8 | 1,341 | py | Python | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 29 | 2020-09-14T22:34:25.000Z | 2022-03-26T18:59:26.000Z | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 1 | 2020-10-16T07:25:21.000Z | 2020-10-31T01:37:45.000Z | dataset.py | ChangLee0903/SERIL-Noise-Adaptive-Speech-Enhancement-using-Regularization-based-Incremental-Learning | 73c5dbd8a272a534cc0af455a9f61567dc67fb66 | [
"MIT"
] | 7 | 2020-09-28T08:45:41.000Z | 2021-09-23T09:02:44.000Z | import torch
import os
import numpy as np
import random
from librosa import load
def read(data, normalize=False, sr=16000):
data, sr = load(data, sr=sr)
if normalize:
data /= np.abs(data).max()
return data, sr
class SpeechDataset(torch.utils.data.Dataset):
def __init__(self, noisy_path, clean... | 31.928571 | 77 | 0.635347 | import torch
import os
import numpy as np
import random
from librosa import load
def read(data, normalize=False, sr=16000):
data, sr = load(data, sr=sr)
if normalize:
data /= np.abs(data).max()
return data, sr
class SpeechDataset(torch.utils.data.Dataset):
def __init__(self, noisy_path, clean... | true | true |
1c2f3121196c82423b918dd94b690ac627e0664a | 8,741 | py | Python | scripts/ontonotes5_to_json.py | shingiyeon/cs474 | fd984740abff0eb54150a8a958804de46f56bea8 | [
"Apache-2.0"
] | 107 | 2018-05-16T14:14:48.000Z | 2021-09-30T03:33:04.000Z | scripts/ontonotes5_to_json.py | shingiyeon/cs474 | fd984740abff0eb54150a8a958804de46f56bea8 | [
"Apache-2.0"
] | 11 | 2018-11-07T09:18:28.000Z | 2020-12-10T15:08:19.000Z | scripts/ontonotes5_to_json.py | shingiyeon/cs474 | fd984740abff0eb54150a8a958804de46f56bea8 | [
"Apache-2.0"
] | 28 | 2018-07-06T09:13:31.000Z | 2021-10-12T09:48:56.000Z | #!/usr/bin/env python
import itertools
import re
import os
import sys
import json
import tempfile
import subprocess
import collections
BEGIN_DOCUMENT_REGEX = re.compile(r"#begin document \((.*)\); part (\d+)")
def flatten(l):
return [item for sublist in l for item in sublist]
def get_doc_key(doc_id, part):
r... | 32.860902 | 122 | 0.655531 |
import itertools
import re
import os
import sys
import json
import tempfile
import subprocess
import collections
BEGIN_DOCUMENT_REGEX = re.compile(r"#begin document \((.*)\); part (\d+)")
def flatten(l):
return [item for sublist in l for item in sublist]
def get_doc_key(doc_id, part):
return "{}_{}".format(... | false | true |
1c2f33edbb6f8768974ca054915c523175e95c05 | 2,563 | py | Python | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | 1 | 2020-08-09T19:45:14.000Z | 2020-08-09T19:45:14.000Z | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | null | null | null | quart/utils.py | SmartManoj/quart | 317562ea660edb7159efc20fa57b95223d408ea0 | [
"MIT"
] | null | null | null | import asyncio
from datetime import datetime, timedelta, timezone
from http.cookies import SimpleCookie
from os import PathLike
from pathlib import Path
from typing import Callable, List, Optional, TYPE_CHECKING, Union
from wsgiref.handlers import format_date_time
from .globals import current_app
from .typing import F... | 32.0375 | 99 | 0.671479 | import asyncio
from datetime import datetime, timedelta, timezone
from http.cookies import SimpleCookie
from os import PathLike
from pathlib import Path
from typing import Callable, List, Optional, TYPE_CHECKING, Union
from wsgiref.handlers import format_date_time
from .globals import current_app
from .typing import F... | true | true |
1c2f3708c08ea5ad6a991257dbb4736fffb2c251 | 843 | py | Python | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | flask_resty/fields.py | sloria/flask-resty | 6a9a6948289277681c71f2f50b08f8c70fef4e2b | [
"MIT"
] | null | null | null | from marshmallow import fields, ValidationError
import marshmallow.utils
# -----------------------------------------------------------------------------
class RelatedItem(fields.Nested):
def _deserialize(self, value, attr, data):
if self.many and not marshmallow.utils.is_collection(value):
se... | 38.318182 | 79 | 0.623962 | from marshmallow import fields, ValidationError
import marshmallow.utils
class RelatedItem(fields.Nested):
def _deserialize(self, value, attr, data):
if self.many and not marshmallow.utils.is_collection(value):
self.fail('type', input=value, type=value.__class__.__name__)
d... | true | true |
1c2f3768d54c480684ca5f4e4efefe9e576b4ae4 | 405 | py | Python | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 9 | 2020-06-23T05:55:30.000Z | 2020-07-09T10:07:25.000Z | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 3 | 2020-06-17T16:36:26.000Z | 2021-02-16T06:29:23.000Z | expensetracker/asgi.py | Aasess/ExpenseTracker | 9feb83b2b66d5d87a994bf6997d9cc33ca6ec066 | [
"MIT"
] | 5 | 2020-06-23T03:27:33.000Z | 2020-08-16T19:37:53.000Z | """
ASGI config for expensetracker project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'expensetracker.settings')
application = get_asgi_application()
| true | true |
1c2f379724bd0df6af5464ff9cc000f65cf0265f | 427 | py | Python | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | projects/serializers.py | Joannsaj/projects | 13d806fa01b8de1053b30b0bcaad937a29694844 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import Profile, Project
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('profile_pic', 'contact', 'user', 'bio', 'name')
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
mod... | 35.583333 | 94 | 0.676815 | from rest_framework import serializers
from .models import Profile, Project
class ProfileSerializer(serializers.ModelSerializer):
class Meta:
model = Profile
fields = ('profile_pic', 'contact', 'user', 'bio', 'name')
class ProjectSerializer(serializers.ModelSerializer):
class Meta:
mod... | true | true |
1c2f37db70dfd7d9a354f7f90a9a0edb627afee5 | 947 | bzl | Python | docs/docs.bzl | Mivik/jflex | 5544d565e8534541056ffdc4d91374a38663c842 | [
"BSD-3-Clause"
] | 486 | 2015-02-15T18:06:12.000Z | 2022-03-28T12:37:00.000Z | docs/docs.bzl | Mivik/jflex | 5544d565e8534541056ffdc4d91374a38663c842 | [
"BSD-3-Clause"
] | 472 | 2015-02-15T06:11:37.000Z | 2022-03-13T21:26:12.000Z | docs/docs.bzl | regisd/jflex | 19fe94f9c72e409945b56971f636ad85506ee77d | [
"BSD-3-Clause"
] | 129 | 2015-03-01T06:24:32.000Z | 2022-03-30T20:51:19.000Z | """Helpers to build the docs."""
load("@bazel_pandoc//:pandoc.bzl", "pandoc")
VERSION = "1.9.0-SNAPSHOT"
RELEASE_DATE = "21 September 2018"
UNICODE_VER = "12.0"
DOC_SECTIONS = [
"intro",
"installing",
"maven-plugin",
"ant-task",
"example",
"lex-specs",
"generated-class",
"encodings"... | 23.675 | 65 | 0.503696 |
load("@bazel_pandoc//:pandoc.bzl", "pandoc")
VERSION = "1.9.0-SNAPSHOT"
RELEASE_DATE = "21 September 2018"
UNICODE_VER = "12.0"
DOC_SECTIONS = [
"intro",
"installing",
"maven-plugin",
"ant-task",
"example",
"lex-specs",
"generated-class",
"encodings",
"performance",
"porting... | true | true |
1c2f38103d50270abb98bbd24bc72fa08347e488 | 2,362 | py | Python | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | setup.py | tylerhuntington222/biosteam | 234959180a3210d95e39a012454f455723c92686 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# BioSTEAM: The Biorefinery Simulation and Techno-Economic Analysis Modules
# Copyright (C) 2020, Yoel Cortes-Pena <yoelcortes@gmail.com>
#
# This module is under the UIUC open-source license. See
# github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/LICENSE.txt
# for license details.
fro... | 43.740741 | 163 | 0.562235 |
from setuptools import setup
setup(
name='biosteam',
packages=['biosteam'],
license='MIT',
version='2.20.9',
description='The Biorefinery Simulation and Techno-Economic Analysis Modules',
long_description=open('README.rst').read(),
author='Yoel Cortes-Pena',
install_requires=['... | true | true |
1c2f390cd745c7857fcea188e21f791aca7da079 | 539 | py | Python | manage.py | alexandre/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 77 | 2015-05-18T11:02:28.000Z | 2019-05-30T09:36:52.000Z | manage.py | alexandre-old/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 11 | 2015-05-03T22:12:17.000Z | 2018-03-26T13:17:19.000Z | manage.py | alexandre/flask-rest-template | 206729ea7c229c4ff428dc9161d23fb3e1912026 | [
"Unlicense"
] | 21 | 2015-08-20T02:35:13.000Z | 2019-02-26T04:59:01.000Z | #!/usr/bin/env python
import os
from flask.ext.script import Manager, Shell, Server
from app import create_app
from app.extensions import db
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
# access python shell with context
manager.add_command(
"shell",
Shell(make_context=lam... | 20.730769 | 73 | 0.703154 |
import os
from flask.ext.script import Manager, Shell, Server
from app import create_app
from app.extensions import db
app = create_app(os.getenv('FLASK_CONFIG') or 'default')
manager = Manager(app)
manager.add_command(
"shell",
Shell(make_context=lambda: {'app': app, 'db': db}), use_ipython=True)
manag... | true | true |
1c2f3a1e9b824f0c633b51319c90a11656c514c8 | 7,825 | py | Python | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 16 | 2016-05-31T06:53:04.000Z | 2020-02-12T05:23:18.000Z | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 2 | 2019-02-18T11:54:14.000Z | 2021-12-21T14:48:57.000Z | egs/wsj/s5/steps/nnet3/report/nnet3_log_parse_lib.py | jxzhanggg/kaldi-trunk | 03fbab26e5714a990e1b6dee9475d4a282a42ccc | [
"Apache-2.0"
] | 7 | 2016-08-27T09:28:24.000Z | 2019-12-16T10:30:12.000Z | # Copyright 2016 Vijayaditya Peddinti.
# Apache 2.0.
from __future__ import division
import sys, glob, re, math, datetime, argparse
import imp
ntl = imp.load_source('ntl', 'steps/nnet3/nnet3_train_lib.py')
#exp/nnet3/lstm_self_repair_ld5_sp/log/progress.9.log:component name=Lstm3_i type=SigmoidComponent, dim=1280, s... | 50.160256 | 624 | 0.662364 |
from __future__ import division
import sys, glob, re, math, datetime, argparse
import imp
ntl = imp.load_source('ntl', 'steps/nnet3/nnet3_train_lib.py')
def ParseProgressLogsForNonlinearityStats(exp_dir):
progress_log_files = "%s/log/progress.*.log" % (exp_dir)
stats_per_component_per_iter = {}
progr... | true | true |
1c2f3c6ca70178903816b9e32cbce3f9d96baa46 | 1,893 | py | Python | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_memory_unit_all_of.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 49.815789 | 1,052 | 0.777602 |
from __future__ import absolute_import
import unittest
import intersight
from intersight.models.memory_unit_all_of import MemoryUnitAllOf
from intersight.rest import ApiException
class TestMemoryUnitAllOf(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def testMe... | true | true |
1c2f3ca8fc71d788090cc8b3b9b4b65ce270ba1e | 497 | py | Python | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | 1 | 2022-01-24T13:45:05.000Z | 2022-01-24T13:45:05.000Z | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | 24 | 2021-07-13T09:36:25.000Z | 2022-03-02T15:01:50.000Z | datafactory/util/metrics.py | sdsc-bw/pre_processing | df4eea6d9191ecfe0697e00cf5c5990c9a348e58 | [
"MIT"
] | null | null | null | from sklearn.metrics import f1_score
from .constants import logger
def relative_absolute_error(pred, y):
dis = abs((pred-y)).sum()
dis2 = abs((y.mean() - y)).sum()
if dis2 == 0 :
return 1
return dis/dis2
def get_score(y_pred, y_test, mtype='C'):
if mtype == 'C':
score = f1_sco... | 27.611111 | 60 | 0.617706 | from sklearn.metrics import f1_score
from .constants import logger
def relative_absolute_error(pred, y):
dis = abs((pred-y)).sum()
dis2 = abs((y.mean() - y)).sum()
if dis2 == 0 :
return 1
return dis/dis2
def get_score(y_pred, y_test, mtype='C'):
if mtype == 'C':
score = f1_sco... | true | true |
1c2f3ceb96d4495575d36dcdf147a06a93bc9071 | 9,177 | py | Python | kaleidoscope/transformations.py | andrewasheridan/kaleidoscope | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | 1 | 2020-12-22T16:53:38.000Z | 2020-12-22T16:53:38.000Z | kaleidoscope/transformations.py | andrewasheridan/super-duper-chainsaw | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | null | null | null | kaleidoscope/transformations.py | andrewasheridan/super-duper-chainsaw | a84ffbec9dda98f438b0e94f1350d6c810031c94 | [
"MIT"
] | 1 | 2020-12-22T16:54:00.000Z | 2020-12-22T16:54:00.000Z | # _ __ _ _
# | | / _| | | (_)
# | |_ _ __ __ _ _ __ ___| |_ ___ _ __ _ __ ___ __ _| |_ _ ___ _ __ ___
# | __| '__/ _` | '_ \/ __| _/ _ \| '__| '_ ` _ \ / _` | __| |/ _ \| '_ \/ __|
# | |_| | | (_| | | | \__ \ |... | 33.370909 | 120 | 0.610875 |
# | |_| | | (_| | | | \__ \ || (_) | | | | | | | | (_| | |_| | (_) | | | \__ \
# \__|_| \__,_|_| |_|___/_| \___/|_| |_| |_| |_|\__,_|\__|_|\___/|_| |_|___/
#
import cv2
import numpy as np
import random
def random_square_crop_with_resize(
image, new_side_len=400, interpolation=cv2.INTER_LANCZOS4
):
... | true | true |
1c2f3d678fa05dc788e74d46380faf513e8b1297 | 5,714 | py | Python | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | src/04_visualization/licence_vis_synthesis.py | aakanksha023/EVAN | 981327e4e8c408144b409f1e39f207ad96376c2d | [
"MIT"
] | null | null | null | # author: Jasmine Qin
# date: 2020-06-09
"""
This script performs data wrangling and synthesizing needed for
visualization of the business licence file.
Usage: src/04_visualization/licence_vis_synthesis.py
"""
# load packages
import pandas as pd
import json
import re
from joblib import load
import warnings
warnings... | 33.22093 | 81 | 0.611481 |
import pandas as pd
import json
import re
from joblib import load
import warnings
warnings.filterwarnings("ignore")
def main():
licence_df = pd.read_csv(
"data/processed/03_cleaned_combined_licences.csv",
low_memory=False)
parking = pd.read_csv(
"data/raw/parking-meters.csv... | true | true |
1c2f3d6980edffcca618a76d1dba702fda36f9cb | 6,030 | py | Python | pyamg/krylov/_bicgstab.py | isuruf/pyamg | 9f831a4c49762983bd7d3d9adeaa3738ba79ff4e | [
"MIT"
] | null | null | null | pyamg/krylov/_bicgstab.py | isuruf/pyamg | 9f831a4c49762983bd7d3d9adeaa3738ba79ff4e | [
"MIT"
] | 1 | 2019-12-06T17:06:29.000Z | 2019-12-06T17:06:29.000Z | pyamg/krylov/_bicgstab.py | lexeyV/pyamg | cabbb008fa26d4c9d8c24decf06374185864c88b | [
"MIT"
] | null | null | null | import numpy as np
from scipy.sparse.linalg.isolve.utils import make_system
from pyamg.util.linalg import norm
__all__ = ['bicgstab']
def bicgstab(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None,
callback=None, residuals=None):
"""Biconjugate Gradient Algorithm with Stabilization.
So... | 30.301508 | 75 | 0.567496 | import numpy as np
from scipy.sparse.linalg.isolve.utils import make_system
from pyamg.util.linalg import norm
__all__ = ['bicgstab']
def bicgstab(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None,
callback=None, residuals=None):
A, M, x, b, postprocess = make_system(A, M, x0, b)
... | true | true |
1c2f3e20153ac6c97651d529554e861b3d977580 | 899 | py | Python | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/spanner/operations/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2016 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.296296 | 74 | 0.765295 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Operations(base.Group):
pass
| true | true |
1c2f3ec69e5661d66eaf27f41fb089bf715ab8cc | 21,579 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | openapi-env-ppe/azure-sdk-for-python | 93c10270978f1d8c9d3728609866a8408c437630 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | openapi-env-ppe/azure-sdk-for-python | 93c10270978f1d8c9d3728609866a8408c437630 | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/aio/_text_analytics_client_async.py | test-repo-tih/azure-sdk-for-python | 18bc3d8e57339ed6a444e38dd5cb3574cc5f9c69 | [
"MIT"
] | null | null | null | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import ( # pylint: disable=unused-import
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.d... | 52.249395 | 118 | 0.667269 |
from typing import (
Union,
Optional,
Any,
List,
Dict,
TYPE_CHECKING
)
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.exceptions import HttpResponseError
from ._base_client_async import AsyncTextAnalyticsClientBase
from .._request_handlers import _... | true | true |
1c2f3ed030714ef125b6db7b53b582104d5a5c35 | 221 | py | Python | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 64 | 2018-12-17T04:35:36.000Z | 2019-04-07T04:58:17.000Z | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 307 | 2018-12-20T06:46:24.000Z | 2019-04-09T04:38:35.000Z | setup.py | Golden-Retrieval/AI-Vision | eab471fe40ce17178e2eebdb7f41666229e85873 | [
"Unlicense"
] | 47 | 2018-12-30T12:49:43.000Z | 2019-05-06T06:51:44.000Z | #nsml: nsml/ml:cuda9.0-cudnn7-tf-1.11torch0.4keras2.2
from distutils.core import setup
setup(
name='nsml vision hackathon',
version='1.0',
description='nsml vision hackathon',
install_requires=[
]
)
| 18.416667 | 53 | 0.687783 |
from distutils.core import setup
setup(
name='nsml vision hackathon',
version='1.0',
description='nsml vision hackathon',
install_requires=[
]
)
| true | true |
1c2f40240c79b048a674983f13443ad88f30d61c | 54,916 | py | Python | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | Syntney.py | lotts/Syntney | 926f87937b6bcde679f27a89973cbd6c974c7c9f | [
"MIT"
] | null | null | null | import os
from Bio import SeqIO
import numpy as np
#from colour import Color
import argparse
import subprocess
from subprocess import run, PIPE
from ete3 import *
import shutil
import sys
import tempfile
import re
def check_NCBI_format(fasta_header):
tmp_header = ""
p = re.compile(r'.{0,20}:c?... | 48.59823 | 321 | 0.586059 | import os
from Bio import SeqIO
import numpy as np
import argparse
import subprocess
from subprocess import run, PIPE
from ete3 import *
import shutil
import sys
import tempfile
import re
def check_NCBI_format(fasta_header):
tmp_header = ""
p = re.compile(r'.{0,20}:c?\d*-\d*')
q = re.comp... | true | true |
1c2f4147e9c1a7505fdb20d1f991ede7ff4c2812 | 7,766 | py | Python | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | F29.BioEntity/WebAPI/biophens_api.py | foundation29org/F29.BioEntity | 531947fb85465f363e63e268b9e3ca17283d76dd | [
"MIT"
] | null | null | null | from flask import current_app, request, make_response, jsonify
from flask_restplus import Resource
from ._api import *
'''
ALL
'''
@API.route('/diseases/<string:lan>/all')
class diseases_all(Resource):
def get(self, lan):
bio = get_bio_phens(lan)
res = bio.all_conds()
return jsonify(re... | 36.805687 | 152 | 0.631599 | from flask import current_app, request, make_response, jsonify
from flask_restplus import Resource
from ._api import *
@API.route('/diseases/<string:lan>/all')
class diseases_all(Resource):
def get(self, lan):
bio = get_bio_phens(lan)
res = bio.all_conds()
return jsonify(res)
@API.route('... | true | true |
1c2f414d2dae9da8fdc876b9da180bef3242e346 | 1,027 | py | Python | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 7 | 2020-10-30T22:49:49.000Z | 2021-07-15T20:56:13.000Z | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 2 | 2020-11-13T19:01:28.000Z | 2021-03-24T04:55:34.000Z | test/num_one_forms_bracket.py | mevangelista-alvarado/NumericalPoissonGrometry- | 76f41be4eb11248c3206b5e371c7aa9eb9d73b44 | [
"MIT"
] | 1 | 2021-02-23T05:41:02.000Z | 2021-02-23T05:41:02.000Z | import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry
npg = NumPoissonGeometry(6, 'x')
P = {(1, 4): 1, (2, 5): 1, (3, 6): 1, (5, 6): 'x2**2'}
alpha = {(5,): 1}
beta = {(6,): 1}
num_one_forms_bracket_res = dict()
j = 2
for mesh_path in ['6Qmesh_10... | 31.121212 | 134 | 0.64557 | import datetime
import time
import numpy as np
import statistics as stat
from numpoisson.numpoisson import NumPoissonGeometry
npg = NumPoissonGeometry(6, 'x')
P = {(1, 4): 1, (2, 5): 1, (3, 6): 1, (5, 6): 'x2**2'}
alpha = {(5,): 1}
beta = {(6,): 1}
num_one_forms_bracket_res = dict()
j = 2
for mesh_path in ['6Qmesh_10... | true | true |
1c2f4172b2d025aa2a39f945978201ec2cc8e9f6 | 7 | py | Python | test/tokenize/t09.py | timmartin/skulpt | 2e3a3fbbaccc12baa29094a717ceec491a8a6750 | [
"MIT"
] | 2,671 | 2015-01-03T08:23:25.000Z | 2022-03-31T06:15:48.000Z | test/tokenize/t09.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | 972 | 2015-01-05T08:11:00.000Z | 2022-03-29T13:47:15.000Z | test/tokenize/t09.py | csev/skulpt | 9aa25b7dbf29f23ee8d3140d01a6f4353d12e66f | [
"MIT"
] | 845 | 2015-01-03T19:53:36.000Z | 2022-03-29T18:34:22.000Z | x = 0L
| 3.5 | 6 | 0.428571 | x = 0L
| false | true |
1c2f41f14f2035b26a2ad8d5b1f03ba69975cbb2 | 905 | py | Python | ad_manager/utils.py | mhulse/django-ad-manager | c1335d2e304e20dd84ad766d57fcccbfbae60dd8 | [
"Apache-2.0"
] | 1 | 2015-11-08T08:58:10.000Z | 2015-11-08T08:58:10.000Z | ad_manager/utils.py | registerguard/django-ad-manager | fb94bc49388f01a95ee4b1065bd4d0589725d048 | [
"Apache-2.0"
] | null | null | null | ad_manager/utils.py | registerguard/django-ad-manager | fb94bc49388f01a95ee4b1065bd4d0589725d048 | [
"Apache-2.0"
] | null | null | null | from django import http
from django.template import loader
from django.template import RequestContext
# https://bitbucket.org/chris1610/satchmo/src/7e5842d3c520/satchmo/apps/satchmo_store/shop/templates/404.html?at=default
def bad_or_missing(request, msg):
"""
Return an HTTP 404 response for a date reque... | 26.617647 | 120 | 0.609945 | from django import http
from django.template import loader
from django.template import RequestContext
def bad_or_missing(request, msg):
if request.is_ajax():
resp = http.HttpResponse()
resp.status_code = 404
resp.content = {
'message': msg
... | true | true |
1c2f421cc5afd3815f6ae661773e0d4e6b555263 | 830 | py | Python | src/y0/cli.py | y0-causal-inference/y0 | 3a84c35c78e79d502570510109fd0dc919ad1bfd | [
"BSD-3-Clause"
] | 8 | 2021-02-09T22:47:11.000Z | 2022-03-29T17:26:52.000Z | src/y0/cli.py | altdeep/y0 | 3e9e8d47b08b51f64216000db31d8f4c0fd388a3 | [
"BSD-3-Clause"
] | 61 | 2021-01-11T20:03:01.000Z | 2022-03-19T20:09:20.000Z | src/y0/cli.py | y0-causal-inference/y0 | 3a84c35c78e79d502570510109fd0dc919ad1bfd | [
"BSD-3-Clause"
] | 4 | 2021-01-12T01:19:36.000Z | 2021-12-01T04:02:20.000Z | # -*- coding: utf-8 -*-
"""Command line interface for :mod:`y0`.
Why does this file exist, and why not put this in ``__main__``? You might be tempted to import things from ``__main__``
later, but that will cause problems--the code will get executed twice:
- When you run ``python3 -m y0`` python will execute``__main_... | 25.151515 | 119 | 0.691566 |
import logging
import click
__all__ = ["main"]
logger = logging.getLogger(__name__)
@click.group()
@click.version_option()
def main():
if __name__ == "__main__":
main()
| true | true |
1c2f4264208bb43bc506d2cfa41c00bf63d87532 | 2,589 | py | Python | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/mediapipe/facemesh.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# Src: https://google.github.io/mediapipe/solutions/face_mesh#python-solution-api
import cv2
import mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
# For static images:
IMAGE_FILES = []
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radi... | 35.958333 | 81 | 0.71881 |
mediapipe as mp
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
IMAGE_FILES = []
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=1)
with mp_face_mesh.FaceMesh(
static_image_mode=True,
max_num_faces=1,
min_detection_confidence=0.5) as face_mesh:
for idx, f... | true | true |
1c2f4272084c82989e16b417f3133fb32a81846e | 1,843 | py | Python | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | setup.py | pkkid/django-redsocks | 615805c6b99aeedd59a2a66ea3bd25f7b606b968 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages
from redsocks import __version__
try:
from pypandoc import convert
except ImportError:
import io
def convert(filename, fmt):
with io.open(filename, encoding='utf-8') as... | 28.796875 | 69 | 0.625068 |
from __future__ import unicode_literals
from setuptools import setup, find_packages
from redsocks import __version__
try:
from pypandoc import convert
except ImportError:
import io
def convert(filename, fmt):
with io.open(filename, encoding='utf-8') as fd:
return fd.read()
DESCRIPTI... | true | true |
1c2f427681f97710b040b23048dd6a7063946361 | 14,519 | py | Python | CONFidence CTF 2016/Teaser/Bubblegum/solution/exploit.py | IMULMUL/ctf-tasks | 9c1549c71aa5fc876f3a46751de226320dc879af | [
"Apache-2.0"
] | 581 | 2019-02-20T08:53:36.000Z | 2022-03-20T13:29:29.000Z | CONFidence CTF 2016/Teaser/Bubblegum/solution/exploit.py | Ma3k4H3d/ctf-tasks | 67b3564307a20a9175bcf695ce9643fb80d4652f | [
"Apache-2.0"
] | null | null | null | CONFidence CTF 2016/Teaser/Bubblegum/solution/exploit.py | Ma3k4H3d/ctf-tasks | 67b3564307a20a9175bcf695ce9643fb80d4652f | [
"Apache-2.0"
] | 61 | 2019-02-20T10:57:42.000Z | 2021-07-02T06:53:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Filename: exploit.py
# Author: Mateusz Jurczyk
# Task: Bubblegum
# Competition: Teaser CONFidence CTF 2016
# Category: Software exploitation
# Scoring: 500 pts (hard)
# Number of solves: 0 out of 44 teams (1 a... | 39.134771 | 153 | 0.669812 |
import os
import random
import sys
import struct
import socket
import string
import telnetlib
import time
def read_until(s, text):
buffer = ""
while len(buffer) < len(text):
buffer += s.recv(1)
while buffer[-len(text):] != text:
buffer += s.recv(1)
return buffer[:-len(text)]
... | false | true |
1c2f42a28ebb4e804087a5088d68bb37cc17aec5 | 14,991 | py | Python | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | ds4se/ds/prediction/eval/traceability.py | rmclanton/ds4se | d9e1cf771a66478ac99c5341dbfeddbbf0abe5b2 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/9.0_ds.prediction.eval.traceability.ipynb (unless otherwise specified).
__all__ = ['SupervisedVectorEvaluation', 'ManifoldEntropy']
# Cell
from prg import prg
# Cell
import ds4se as ds
from ....mining.ir import VectorizationType
from ....mining.ir import SimilarityMetr... | 41.071233 | 127 | 0.615169 |
__all__ = ['SupervisedVectorEvaluation', 'ManifoldEntropy']
from prg import prg
import ds4se as ds
from ....mining.ir import VectorizationType
from ....mining.ir import SimilarityMetric
from ....mining.ir import EntropyMetric
from ....mining.ir import DistanceMetric
from ...description.eval.traceability import... | true | true |
1c2f42c274483c6e58fe8b55527b6c91924688b6 | 2,563 | py | Python | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | 1 | 2021-12-27T08:14:31.000Z | 2021-12-27T08:14:31.000Z | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | null | null | null | dash_mantine_components/Spoiler.py | lenamax2355/dash-mantine-components | f24e48f3e2f88521cf2c14a070384458132a14d8 | [
"MIT"
] | null | null | null | # AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Spoiler(Component):
"""A Spoiler component.
Hide long sections of content under spoiler. For more information, see: https://mantine.dev/core/spoiler/
Keyword arguments:
- children (string; optiona... | 37.691176 | 261 | 0.684354 |
from dash.development.base_component import Component, _explicitize_args
class Spoiler(Component):
@_explicitize_args
def __init__(self, children=None, hideLabel=Component.UNDEFINED, id=Component.UNDEFINED, initialState=Component.UNDEFINED, maxHeight=Component.UNDEFINED, loading_state=Component.UNDEFINED, s... | true | true |
1c2f42dd0b1fe3d10529645039af19067969efa5 | 33,314 | py | Python | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | 14 | 2020-06-05T23:06:45.000Z | 2022-03-12T00:00:18.000Z | web/transiq/supplier/services.py | manibhushan05/transiq | 763fafb271ce07d13ac8ce575f2fee653cf39343 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import pandas as pd
from django.contrib.auth.models import User
from django.db.models import Count
from api.utils import get_or_none
from authentication.models import Profile
from broker.models import Broker
from driver.models import Driver as d_Driver
from fileupload.models import Owner... | 51.569659 | 129 | 0.617128 | from datetime import datetime
import pandas as pd
from django.contrib.auth.models import User
from django.db.models import Count
from api.utils import get_or_none
from authentication.models import Profile
from broker.models import Broker
from driver.models import Driver as d_Driver
from fileupload.models import Owner... | true | true |
1c2f445208e6e280e4e703eb7f963c9f3a32c49b | 855 | py | Python | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | 3 | 2018-05-30T12:38:58.000Z | 2018-10-23T11:30:48.000Z | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | 2 | 2020-09-25T05:36:37.000Z | 2021-06-25T15:22:34.000Z | tests/conftest.py | BNMetrics/fetchme | f33e7368b33d74bc2777ac6d698555fe92e9539b | [
"Apache-2.0"
] | null | null | null | import pytest
import mock
import shutil
from pathlib import Path
@pytest.fixture
def tmp_config(mock_home_dir):
project_dir = Path(__file__).parent.parent
mock_config_path = mock_home_dir / '.fetchmerc'
shutil.copyfile(project_dir / 'cfg/.fetchmerc', mock_config_path)
with open(mock_config_path, 'a... | 23.75 | 77 | 0.575439 | import pytest
import mock
import shutil
from pathlib import Path
@pytest.fixture
def tmp_config(mock_home_dir):
project_dir = Path(__file__).parent.parent
mock_config_path = mock_home_dir / '.fetchmerc'
shutil.copyfile(project_dir / 'cfg/.fetchmerc', mock_config_path)
with open(mock_config_path, 'a... | true | true |
1c2f44848af40cc8407c8c14930e0d336a2f5d87 | 2,490 | py | Python | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | test/test_hidden.py | Freso/beets | ef7cca4c1205466086c658a9f50cefb09b5da450 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Fabrice Laporte.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation ... | 33.2 | 79 | 0.63494 |
from __future__ import division, absolute_import, print_function
from test._common import unittest
import sys
import tempfile
from beets.util import hidden
import subprocess
import errno
import ctypes
class HiddenFileTest(unittest.TestCase):
def setUp(self):
pass
def test_osx_hidden(... | true | true |
1c2f47059c8e0b8a6d29ebd5ce959f2c94607e78 | 10,674 | py | Python | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 122 | 2021-03-09T15:45:22.000Z | 2022-03-28T09:25:51.000Z | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 9 | 2021-03-14T02:46:13.000Z | 2021-11-13T06:59:26.000Z | tests/test_transforms.py | cattidea/PaTTA | 0a50eb9b6459c91e3a488f8772e124c164cb0d75 | [
"MIT"
] | 16 | 2021-03-10T02:39:52.000Z | 2021-11-03T14:32:16.000Z | import cv2
import numpy as np
import paddle
import patta as tta
import pytest
@pytest.mark.parametrize(
"transform",
[
tta.HorizontalFlip(),
tta.VerticalFlip(),
tta.HorizontalShift(shifts=[0.1, 0.2, 0.4]),
tta.VerticalShift(shifts=[0.1, 0.2, 0.4]),
tta.Rotate90(angles=[... | 36.554795 | 120 | 0.55846 | import cv2
import numpy as np
import paddle
import patta as tta
import pytest
@pytest.mark.parametrize(
"transform",
[
tta.HorizontalFlip(),
tta.VerticalFlip(),
tta.HorizontalShift(shifts=[0.1, 0.2, 0.4]),
tta.VerticalShift(shifts=[0.1, 0.2, 0.4]),
tta.Rotate90(angles=[... | true | true |
1c2f474a8aa68e48585c6b0f9ba36c039760f8c8 | 3,830 | py | Python | measure_mate/migrations/0001_initial.py | niche-tester/measure-mate | c3acba57747bcb89fe0c6b9509ec90f04a581506 | [
"MIT"
] | 15 | 2015-12-14T02:20:31.000Z | 2022-01-30T04:36:39.000Z | measure_mate/migrations/0001_initial.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 1,403 | 2017-02-16T01:00:04.000Z | 2022-03-15T21:12:13.000Z | measure_mate/migrations/0001_initial.py | rloomans/measure-mate | e89f9c8e1faa1920496f1c997f6d87ec0f9bd7c2 | [
"MIT"
] | 10 | 2015-12-18T01:30:46.000Z | 2022-01-30T04:36:41.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Assessment',
fields=[
('id', models.AutoField(v... | 37.184466 | 135 | 0.536292 |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Assessment',
fields=[
('id', models.AutoField(verbose_name='ID', seria... | true | true |
1c2f4903ed0f5a94ab7a56b2b885e62f9d8cc28b | 856 | py | Python | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 3 | 2019-05-06T15:14:43.000Z | 2019-12-23T07:26:52.000Z | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 4 | 2020-02-25T06:39:47.000Z | 2022-02-26T03:22:42.000Z | download/Cost-Function-Of-ML/costFunctionExam1.py | chenjian158978/chenjian.github.io | 1742e518d43470aa88690f2f40094859e7d7f261 | [
"Apache-2.0"
] | 5 | 2017-02-26T09:06:25.000Z | 2019-10-01T17:15:39.000Z | # -*- coding:utf8 -*-
"""
@author: chenjian158978@gmail.com
@date: Tue, May 23 2017
@time: 19:05:20 GMT+8
"""
import matplotlib.pyplot as plt
import numpy as np
def calcu_cost(theta, X, Y):
""" 计算代价函数的值
:param theta: 斜率
:param X: x值
:param Y: y值
:return: J值
"""
m = X.shape[0]
h = ... | 17.469388 | 47 | 0.598131 |
import matplotlib.pyplot as plt
import numpy as np
def calcu_cost(theta, X, Y):
m = X.shape[0]
h = np.dot(X, theta)
return np.dot((h - Y).T, (h - Y)) / (2 * m)
X = np.array([[0, 1, 2, 4]]).T
Y = np.array([[0, 1, 2, 4]]).T
theta = np.array([np.linspace(-2, 4, 101)]).T
J_list = []
for i in range(10... | true | true |
1c2f4905406663f456667777b14afcb3fbbb2224 | 704 | py | Python | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 9 | 2020-08-12T10:01:00.000Z | 2022-01-05T04:37:48.000Z | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 1 | 2021-02-16T10:19:31.000Z | 2021-02-16T10:19:31.000Z | question_bank/build-an-array-with-stack-operations/build-an-array-with-stack-operations.py | yatengLG/leetcode-python | 5d48aecb578c86d69835368fad3d9cc21961c226 | [
"Apache-2.0"
] | 4 | 2020-08-12T10:13:31.000Z | 2021-11-05T01:26:58.000Z | # -*- coding: utf-8 -*-
# @Author : LG
"""
执行用时:28 ms, 在所有 Python3 提交中击败了99.57% 的用户
内存消耗:13.4 MB, 在所有 Python3 提交中击败了38.43% 的用户
解题思路:
用下标去查看target元素
见代码注释
"""
class Solution:
def buildArray(self, target: List[int], n: int) -> List[str]:
i = 0
N = len(target)
result = []
for... | 24.275862 | 75 | 0.482955 |
class Solution:
def buildArray(self, target: List[int], n: int) -> List[str]:
i = 0
N = len(target)
result = []
for num in range(1, n+1):
if num == target[i]:
i += 1
result.append('Push')
else:
result.appen... | true | true |
1c2f4971647180e7f5027c908f7a6137bf303b5f | 27,315 | py | Python | mai_version/fold/fold_file_parser.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 16 | 2019-03-06T06:11:33.000Z | 2022-02-07T21:30:25.000Z | mai_version/fold/fold_file_parser.py | joschout/tilde | 1403b50842b83f2edd6b16b1fbe24b9bec2d0048 | [
"Apache-2.0"
] | 4 | 2019-10-08T14:48:23.000Z | 2020-03-26T00:31:57.000Z | mai_version/fold/fold_file_parser.py | krishnangovindraj/tilde | 5243a02d92f375d56ffc49ab8c3d1a87e31e99b9 | [
"Apache-2.0"
] | 4 | 2019-08-14T05:40:47.000Z | 2020-08-05T13:21:16.000Z | import time
from math import sqrt
from statistics import mean, variance
from typing import Set, List, Tuple
from problog.engine import DefaultEngine, GenericEngine
from problog.logic import Constant
from mai_version.classification.classification_helper import get_keys_classifier, do_labeled_examples_get_correctly_cla... | 53.664047 | 157 | 0.646385 | import time
from math import sqrt
from statistics import mean, variance
from typing import Set, List, Tuple
from problog.engine import DefaultEngine, GenericEngine
from problog.logic import Constant
from mai_version.classification.classification_helper import get_keys_classifier, do_labeled_examples_get_correctly_cla... | true | true |
1c2f49a98f4323879a647210d79f92f18591350c | 630 | py | Python | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | 1 | 2017-06-28T06:43:37.000Z | 2017-06-28T06:43:37.000Z | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | null | null | null | project_name/accounts/views.py | danrobinson/project_template | 192cf2edc811943564dfe7883bd25a8a77950cbc | [
"MIT"
] | null | null | null | # Create your views here.
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView, CreateView, UpdateView, DeleteView
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from em... | 35 | 82 | 0.790476 |
from django.views.generic.base import TemplateView
from django.views.generic.detail import DetailView
from django.views.generic.edit import FormView, CreateView, UpdateView, DeleteView
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from emailusernames.forms import... | true | true |
1c2f49e4ce83fd985358a0b8c4471afa0792dc59 | 2,120 | py | Python | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 412 | 2016-02-20T12:04:34.000Z | 2022-03-30T21:07:39.000Z | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 20 | 2018-09-21T13:47:59.000Z | 2021-04-10T04:21:30.000Z | graphbrain/utils/lemmas.py | vishalbelsare/graphbrain | efad1f96dcb616595b13bd4e3ada806862fe7de7 | [
"MIT"
] | 51 | 2017-01-25T17:19:30.000Z | 2022-03-29T07:32:53.000Z | import graphbrain.constants as const
def lemma(hg, atom, same_if_none=False):
"""Returns the lemma of the given atom if it exists, None otherwise.
Keyword argument:
same_if_none -- if False, returns None when lemma does not exist. If True,
returns atom items when lemma does not exist. (default: False... | 29.444444 | 78 | 0.634906 | import graphbrain.constants as const
def lemma(hg, atom, same_if_none=False):
if atom.is_atom():
satom = atom.simplify()
for lemma_edge in hg.search((const.lemma_pred, satom, '*')):
return lemma_edge[2]
if same_if_none:
return atom
else:
return None
def deep_l... | true | true |
1c2f4a8d8e8d18087601f036286b95767fbbc42c | 6,623 | py | Python | var/spack/repos/builtin/packages/py-scipy/package.py | FrankD412/spack | b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-07-30T02:03:30.000Z | 2021-07-30T02:03:30.000Z | var/spack/repos/builtin/packages/py-scipy/package.py | FrankD412/spack | b70bf073b5f647dd5a7f1917ed55dfd39d1a2a0c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13 | 2021-05-12T06:10:02.000Z | 2022-03-25T21:00:29.000Z | var/spack/repos/builtin/packages/py-scipy/package.py | Kerilk/spack | e027942b55407a4a5fe323b93d8e57200c873a43 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # 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)
import platform
class PyScipy(PythonPackage):
"""SciPy (pronounced "Sigh Pie") is a Scientific Library for Python.
... | 59.666667 | 140 | 0.696965 |
import platform
class PyScipy(PythonPackage):
homepage = "https://www.scipy.org/"
pypi = "scipy/scipy-1.5.4.tar.gz"
git = "https://github.com/scipy/scipy.git"
maintainers = ['adamjstewart']
version('master', branch='master')
version('1.6.3', sha256='a75b014d3294fce26852a9d04ea27b5671d... | true | true |
1c2f4ab76cdcfe10466615eb6c2953691babf2b2 | 377 | py | Python | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 3 | 2021-04-16T23:47:59.000Z | 2021-09-10T06:00:18.000Z | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 708 | 2020-10-31T08:02:40.000Z | 2022-03-31T09:39:25.000Z | padinfo/view/closable_embed.py | bitwalk/pad-cogs | 40e4911841d165caf615c7459eb7b0a20aa4cbe1 | [
"MIT"
] | 20 | 2020-11-01T23:11:29.000Z | 2022-02-07T07:04:15.000Z | from padinfo.view.components.view_state_base import ViewStateBase
class ClosableEmbedViewState(ViewStateBase):
def __init__(self, original_author_id, menu_type, raw_query,
color, view_type, props):
super().__init__(original_author_id, menu_type, raw_query)
self.color = color
... | 34.272727 | 66 | 0.710875 | from padinfo.view.components.view_state_base import ViewStateBase
class ClosableEmbedViewState(ViewStateBase):
def __init__(self, original_author_id, menu_type, raw_query,
color, view_type, props):
super().__init__(original_author_id, menu_type, raw_query)
self.color = color
... | true | true |
1c2f4b64da660b7d848a1aa1f2f021cd7fb920cf | 13,758 | py | Python | core/controllers/library.py | aasiffaizal/oppia | 1a8634a435bec10f407e9f3c95f62bd467c5b5f7 | [
"Apache-2.0"
] | 1 | 2021-02-23T04:23:56.000Z | 2021-02-23T04:23:56.000Z | core/controllers/library.py | arpit1912/oppia | 00303a0830e775f8491ec57ac625ed44eafd73a4 | [
"Apache-2.0"
] | null | null | null | core/controllers/library.py | arpit1912/oppia | 00303a0830e775f8491ec57ac625ed44eafd73a4 | [
"Apache-2.0"
] | 1 | 2020-12-09T21:33:49.000Z | 2020-12-09T21:33:49.000Z | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 39.085227 | 115 | 0.66296 |
from __future__ import absolute_import
from __future__ import unicode_literals
import json
import logging
import string
from constants import constants
from core.controllers import acl_decorators
from core.controllers import base
from core.domain import collection_services
from core.domain import exp_s... | true | true |
1c2f4b85cac45680e581cb5f7f143bbdc49b2354 | 681 | py | Python | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | SS/p145_postorderTraversal.py | MTandHJ/leetcode | f3832ed255d259cb881666ec8bd3de090d34e883 | [
"MIT"
] | null | null | null | from typing import List
import collections
class TreeNode:
def __init__(self, left=None, right=None, val=0) -> None:
self.val = val
self.left = left
self.right = right
class Solution:
def postorderTraversal(self, root: TreeNode) -> List[int]:
if not root:
return []... | 21.967742 | 62 | 0.499266 | from typing import List
import collections
class TreeNode:
def __init__(self, left=None, right=None, val=0) -> None:
self.val = val
self.left = left
self.right = right
class Solution:
def postorderTraversal(self, root: TreeNode) -> List[int]:
if not root:
return []... | true | true |
1c2f4bf38fe1a0fc3577344d3270481ceebc80d4 | 12,015 | py | Python | UKBB_results_summ_funcs.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | 1 | 2022-01-17T13:13:02.000Z | 2022-01-17T13:13:02.000Z | UKBB_results_summ_funcs.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | null | null | null | UKBB_results_summ_funcs.py | yochaiedlitz/T2DM_UKB_predictions | 1e6b22e3d51d515eb065d7d5f46408f86f33d0b8 | [
"MIT"
] | null | null | null | """
This package contains functions for plotting the results for UKBB Diabetes article
"""
import pandas as pd
import numpy as np
import os
import UKBB_Func
import pickle
from sklearn.metrics import average_precision_score, precision_recall_curve, roc_auc_score, roc_curve, auc
import matplotlib.pyplot as plt
from matpl... | 34.725434 | 201 | 0.600333 | """
This package contains functions for plotting the results for UKBB Diabetes article
"""
import pandas as pd
import numpy as np
import os
import UKBB_Func
import pickle
from sklearn.metrics import average_precision_score, precision_recall_curve, roc_auc_score, roc_curve, auc
import matplotlib.pyplot as plt
from matpl... | false | true |
1c2f4ca5ce1f0579712660b8f09e0d19ed6634aa | 31,286 | py | Python | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/appservice/tests/latest/test_staticapp_commands_thru_mock.py | Xinyue-Wang/azure-cli | 35d5702039d21247712eeedfdbe8f128f5f90fa3 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 50.871545 | 138 | 0.740555 |
import unittest
from unittest import mock
from azure.cli.command_modules.appservice.static_sites import \
list_staticsites, show_staticsite, delete_staticsite, create_staticsites, CLIError, disconnect_staticsite, \
reconnect_staticsite, list_staticsite_environments, show_staticsite_environment, list_static... | true | true |
1c2f4d74c7cdd282900ad475bba9d5debd255c19 | 1,809 | py | Python | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | 5 | 2021-01-11T01:51:57.000Z | 2021-12-11T17:19:08.000Z | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | null | null | null | tensorflow/python/eager/tensor.py | SWMaestro8th/tensorflow | 084d29e67a72e369958c18ae6abfe2752fcddcbf | [
"Apache-2.0"
] | 3 | 2020-07-02T13:46:32.000Z | 2021-01-11T01:52:01.000Z | # Copyright 2017 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... | 32.303571 | 80 | 0.726921 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework.ops import _tensor_from_handle
from tensorflow.python.framework.ops import convert_n_to_eager_tensor
from tensorflow.python.framework.ops i... | true | true |
1c2f4f06d496fb200aa0f3fdf76cf1b97fd86cff | 485 | py | Python | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | binary_search_trees/reconstruct_bst.py | maanavshah/coding-interview | 4c842cdbc6870da79684635f379966d1caec2162 | [
"MIT"
] | null | null | null | # O(n^2) time | O(n) space
def reconstructBst(array):
if len(array) == 0:
return None
currValue = array[0]
rightSubTreeIdx = len(array)
for idx in range(1, len(array)):
value = array[idx]
if value >= currValue:
rightSubTreeIdx = idx
break
le... | 26.944444 | 58 | 0.62268 |
def reconstructBst(array):
if len(array) == 0:
return None
currValue = array[0]
rightSubTreeIdx = len(array)
for idx in range(1, len(array)):
value = array[idx]
if value >= currValue:
rightSubTreeIdx = idx
break
leftSubTree = reconstructBst... | true | true |
1c2f4f6962078375353088f4b4bd41164c5cbe9d | 1,066 | py | Python | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null | container-scripts/set-credentials.py | companieshouse/chips-tuxedo-proxy-domain | 3406f0197e8060648e5751eb453fb4601a82ee1c | [
"MIT"
] | null | null | null |
domain_name = os.environ.get("DOMAIN_NAME", "wldomain")
admin_name = os.environ.get("ADMIN_NAME", "wladmin")
admin_pass = os.environ.get("ADMIN_PASSWORD")
domain_path = '/apps/oracle/%s' % domain_name
domain_credential = os.environ.get("DOMAIN_CREDENTIAL", "domain_credential")
ldap_credential = os.environ.get("... | 28.810811 | 77 | 0.718574 |
domain_name = os.environ.get("DOMAIN_NAME", "wldomain")
admin_name = os.environ.get("ADMIN_NAME", "wladmin")
admin_pass = os.environ.get("ADMIN_PASSWORD")
domain_path = '/apps/oracle/%s' % domain_name
domain_credential = os.environ.get("DOMAIN_CREDENTIAL", "domain_credential")
ldap_credential = os.environ.get("... | true | true |
1c2f512c329b877cdf63760a5622029c361a14bf | 3,397 | py | Python | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | null | null | null | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | 4 | 2020-06-20T15:42:13.000Z | 2022-02-23T21:28:35.000Z | views.py | audacious-software/Simple-Messaging-Django | 7cdcd700ce828abe9e2bb30c467d510315f2bbd3 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=no-member, line-too-long
import importlib
import json
import arrow
import phonenumbers
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.core.management import call_command
from django.http import Http404, HttpResponse
from django.s... | 34.663265 | 117 | 0.678246 |
import importlib
import json
import arrow
import phonenumbers
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.core.management import call_command
from django.http import Http404, HttpResponse
from django.shortcuts import render
from django.utils i... | true | true |
1c2f51e30a52edf948c881404405939a9de755d9 | 2,180 | py | Python | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | 1 | 2021-06-01T18:55:58.000Z | 2021-06-01T18:55:58.000Z | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | null | null | null | samples/server/petstore/python-fastapi/src/openapi_server/security_api.py | pgadura/openapi-generator | 3c866fb4a34e86d0ea2fef401a30206d7452bd2a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
from typing import List
from fastapi import APIRouter, Depends, Response, Security, status
from fastapi.openapi.models import OAuthFlowImplicit, OAuthFlows
from fastapi.security import (
HTTPAuthorizationCredentials,
HTTPBasic,
HTTPBasicCredentials,
HTTPBearer,
OAuth2,
OAuth2Au... | 25.952381 | 122 | 0.698624 |
from typing import List
from fastapi import APIRouter, Depends, Response, Security, status
from fastapi.openapi.models import OAuthFlowImplicit, OAuthFlows
from fastapi.security import (
HTTPAuthorizationCredentials,
HTTPBasic,
HTTPBasicCredentials,
HTTPBearer,
OAuth2,
OAuth2AuthorizationCode... | true | true |
1c2f52c6038e6acd197d60dd2e1f55aea0bdf4e4 | 7,922 | py | Python | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/zha/fan.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Fans on Zigbee Home Automation networks."""
from __future__ import annotations
from abc import abstractmethod
import functools
import math
from zigpy.exceptions import ZigbeeException
from zigpy.zcl.clusters import hvac
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanE... | 35.208889 | 96 | 0.686317 | from __future__ import annotations
from abc import abstractmethod
import functools
import math
from zigpy.exceptions import ZigbeeException
from zigpy.zcl.clusters import hvac
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
FanEntity,
FanEntityFeature,
NotValidPreset... | true | true |
1c2f55a77d0082d3ba51ac40a1c53a3b253923d4 | 329 | py | Python | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | exercicios_python_brasil/estrutura_sequencial/16_calculadora_tintas.py | MartinaLima/Python | 94dee598bd799cfe8de4c6369cea84e97e5ed024 | [
"MIT"
] | null | null | null | print('\033[1m>>> CALCULADORA DE TINTAS - LOJA ABC <<<\033[m')
area = float(input('ÁREA A SER PINTADA (m²): '))
litros = (area/3)
lata = (litros/18)
preco = lata*80
print('-'*40)
print(f'QUANTIDADE NECESSÁRIA: {litros:.2f} litro(s)')
print(f'LATA (18 LITROS): {lata:.2f} lata(s).')
print(f'VALOR TOTAL: R$ {preco... | 32.9 | 63 | 0.6231 | print('\033[1m>>> CALCULADORA DE TINTAS - LOJA ABC <<<\033[m')
area = float(input('ÁREA A SER PINTADA (m²): '))
litros = (area/3)
lata = (litros/18)
preco = lata*80
print('-'*40)
print(f'QUANTIDADE NECESSÁRIA: {litros:.2f} litro(s)')
print(f'LATA (18 LITROS): {lata:.2f} lata(s).')
print(f'VALOR TOTAL: R$ {preco... | true | true |
1c2f566d1d53012897e74ed2df7f16d2a8991fad | 1,545 | py | Python | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 18 | 2020-11-13T11:54:23.000Z | 2022-03-23T15:25:10.000Z | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 9 | 2020-11-17T07:54:58.000Z | 2022-02-09T23:29:52.000Z | setup.py | joshuafuller/adsbxcot | 49718e0f004be040fb2712952464ccec4ba8e19a | [
"Apache-2.0"
] | 7 | 2021-05-06T22:00:39.000Z | 2022-01-31T06:25:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup for the ADS-B Exchange Cursor-on-Target Gateway.
Source:: https://github.com/ampledata/adsbxcot
"""
import os
import sys
import setuptools
__title__ = "adsbxcot"
__version__ = "1.5.0"
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyrig... | 24.52381 | 74 | 0.631068 |
import os
import sys
import setuptools
__title__ = "adsbxcot"
__version__ = "1.5.0"
__author__ = "Greg Albrecht W2GMD <oss@undef.net>"
__copyright__ = "Copyright 2021 Orion Labs, Inc."
__license__ = "Apache License, Version 2.0"
def publish():
if sys.argv[-1] == 'publish':
os.system('python setup.py... | true | true |
1c2f56ff0c6fe054d1c581114ff4f7162b4b35f5 | 5,236 | py | Python | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | 1 | 2020-06-23T15:57:30.000Z | 2020-06-23T15:57:30.000Z | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | null | null | null | ranksvm.py | jrplatin/NBA-RankSVM | 74bec6cf79bc4554e8a456450d45d892e034a425 | [
"BSD-4-Clause-UC"
] | null | null | null | from sklearn import svm
from itertools import permutations
import numpy as np
from operator import itemgetter
from itertools import combinations
import numpy as np
# Get all permutation pairs out of an array
def get_pairs(arr):
return permutations(arr, 2)
# Transform data to pairs, where label of (x1, x2) is ... | 31.926829 | 110 | 0.618029 | from sklearn import svm
from itertools import permutations
import numpy as np
from operator import itemgetter
from itertools import combinations
import numpy as np
def get_pairs(arr):
return permutations(arr, 2)
def data_to_pairs(X, y):
X_pairs = []
y_pairs = []
pairs = get_pairs(np.arange... | true | true |
1c2f572cc0fd7450967f7d9eb62c73d81cbd22a6 | 19,495 | py | Python | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | terrorizer1980/Empire | 9259e5106986847d2bb770c4289c0c0f1adf2344 | [
"BSD-3-Clause"
] | 49 | 2015-09-02T15:20:09.000Z | 2022-03-05T18:18:23.000Z | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | rmusser01/Empire | c1bdbd0fdafd5bf34760d5b158dfd0db2bb19556 | [
"BSD-3-Clause"
] | 1 | 2020-11-04T08:15:12.000Z | 2020-11-04T08:15:12.000Z | lib/modules/python/situational_awareness/host/osx/HijackScanner.py | InfinitelyFreedom/Empire | 3a922f60d92658fb716efb3be5a1c15074114766 | [
"BSD-3-Clause"
] | 24 | 2015-09-08T11:45:23.000Z | 2022-02-07T23:53:58.000Z | from builtins import object
class Module(object):
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'Dylib Hijack Vulnerability Scanner',
... | 31.596434 | 222 | 0.532136 | from builtins import object
class Module(object):
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Dylib Hijack Vulnerability Scanner',
'Author': ['@patrickwardle','@xorrior'],
'Description': ('This modu... | true | true |
1c2f57cef9fb7678921c729910c67d1be947e38b | 756 | py | Python | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | 4 | 2016-05-06T20:52:42.000Z | 2018-11-18T08:29:33.000Z | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | null | null | null | django_semantic_ui/urls.py | valbertovc/django_semantic_ui | b4bd87983c1e78c442cef7168721225f6893c67a | [
"MIT"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = (
url(r'^admin/', include(admi... | 54 | 129 | 0.768519 | from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns = (
url(r'^admin/', include(admi... | true | true |
1c2f583b482610b2b4f3242d6c3c16518d744bec | 7,278 | py | Python | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | models.py | Chianugoogidi/deit | a286bfc817e9e285291ab8b2e9dff277d6447bda | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_ti... | 38.919786 | 116 | 0.690849 |
import torch
import torch.nn as nn
from functools import partial
from timm.models.vision_transformer import VisionTransformer, _cfg
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
__all__ = [
'deit_tiny_patch16_224', 'deit_small_patch16_224', 'deit_base_patch16_224'... | true | true |
1c2f5972b1791976318abf04c19d13a3a96213ae | 5,802 | py | Python | BERT.py | china-zyy/NLP-Tutorials | 3216c5616770af11185a6d6d238cf1e8bda4edd6 | [
"MIT"
] | null | null | null | BERT.py | china-zyy/NLP-Tutorials | 3216c5616770af11185a6d6d238cf1e8bda4edd6 | [
"MIT"
] | 2 | 2021-08-25T16:13:10.000Z | 2022-02-10T02:27:17.000Z | BERT.py | hades12580/NLP-Tutorials | 670160b5a9344b240c90dbaf0e62de3120c6d9e5 | [
"MIT"
] | 1 | 2021-09-23T17:25:21.000Z | 2021-09-23T17:25:21.000Z | # [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https://arxiv.org/pdf/1810.04805.pdf)
import numpy as np
import tensorflow as tf
import utils
import time
from GPT import GPT
import os
import pickle
class BERT(GPT):
def __init__(self, model_dim, max_len, n_layer, n_head, n_voca... | 40.291667 | 122 | 0.610479 |
import numpy as np
import tensorflow as tf
import utils
import time
from GPT import GPT
import os
import pickle
class BERT(GPT):
def __init__(self, model_dim, max_len, n_layer, n_head, n_vocab, lr, max_seg=3, drop_rate=0.1, padding_idx=0):
super().__init__(model_dim, max_len, n_layer, n_head, n_vocab, lr... | true | true |
1c2f59f39c0d409f389961cf1d7651c68a90c8d9 | 7,092 | py | Python | src/ObjectDetection.py | mzur/unknot | 07cc75d1fc94b1767e12bd9d55c1eac13be1fbfe | [
"MIT"
] | null | null | null | src/ObjectDetection.py | mzur/unknot | 07cc75d1fc94b1767e12bd9d55c1eac13be1fbfe | [
"MIT"
] | null | null | null | src/ObjectDetection.py | mzur/unknot | 07cc75d1fc94b1767e12bd9d55c1eac13be1fbfe | [
"MIT"
] | 1 | 2022-01-26T08:13:09.000Z | 2022-01-26T08:13:09.000Z | import numpy as np
import os.path
import imgaug.augmenters as iaa
import json
from pyvips import Image as VipsImage
from . import PatchesCollection
from . import Dataset as ImageDataset
from . import utils
from .mrcnn import config as mrcnn_config
from .mrcnn import utils as mrcnn_utils
from .mrcnn import model as mr... | 34.764706 | 98 | 0.654822 | import numpy as np
import os.path
import imgaug.augmenters as iaa
import json
from pyvips import Image as VipsImage
from . import PatchesCollection
from . import Dataset as ImageDataset
from . import utils
from .mrcnn import config as mrcnn_config
from .mrcnn import utils as mrcnn_utils
from .mrcnn import model as mr... | true | true |
1c2f5c3293a33761af41af44889aab4c1a8debe8 | 8,223 | py | Python | test/IECoreScene/SmoothSkinningDataTest.py | aitorvfx/cortex | c0c27794fc67ccfce68b064e284747165c49ef1c | [
"BSD-3-Clause"
] | 5 | 2015-09-13T14:49:30.000Z | 2017-02-04T21:04:59.000Z | test/IECoreScene/SmoothSkinningDataTest.py | aitorvfx/cortex | c0c27794fc67ccfce68b064e284747165c49ef1c | [
"BSD-3-Clause"
] | 1 | 2018-11-07T19:40:15.000Z | 2018-11-07T19:40:15.000Z | test/IECoreScene/SmoothSkinningDataTest.py | aitorvfx/cortex | c0c27794fc67ccfce68b064e284747165c49ef1c | [
"BSD-3-Clause"
] | 3 | 2015-02-03T17:13:40.000Z | 2022-01-07T15:55:00.000Z | ##########################################################################
#
# Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Redistribution and use in source and binary ... | 47.531792 | 126 | 0.661802 | on, IECoreScene.SmoothSkinningData(ok_jn, ok_ip, ok_pio, iv_pic3, ok_pii, ok_piw).validate )
def tearDown( self ) :
if os.path.isfile("test/IECore/ssd.fio"):
os.remove("test/IECore/ssd.fio")
if __name__ == "__main__":
unittest.main()
| true | true |
1c2f5c3e47e8669740635666bf04fe5e71169c9e | 512 | py | Python | displ/pwscf/extractQEBands_test.py | tflovorn/displ | 094c194c54f02d463353075c6ca82f457f1247fa | [
"MIT"
] | 4 | 2018-04-09T20:39:24.000Z | 2021-06-19T12:21:52.000Z | displ/pwscf/extractQEBands_test.py | tflovorn/displ | 094c194c54f02d463353075c6ca82f457f1247fa | [
"MIT"
] | null | null | null | displ/pwscf/extractQEBands_test.py | tflovorn/displ | 094c194c54f02d463353075c6ca82f457f1247fa | [
"MIT"
] | 4 | 2018-04-09T20:39:41.000Z | 2021-06-19T12:21:53.000Z | import unittest
from displ.pwscf.extractQEBands import extractQEBands
class TestExtractQEBands(unittest.TestCase):
def test_ExtractQEBandsTa(self):
nbnd, nks, evlist = extractQEBands("test_data/Ta110_bands_test.dat")
self.assertEqual(nbnd, 112)
self.assertEqual(nks, 181)
self.assert... | 34.133333 | 76 | 0.681641 | import unittest
from displ.pwscf.extractQEBands import extractQEBands
class TestExtractQEBands(unittest.TestCase):
def test_ExtractQEBandsTa(self):
nbnd, nks, evlist = extractQEBands("test_data/Ta110_bands_test.dat")
self.assertEqual(nbnd, 112)
self.assertEqual(nks, 181)
self.assert... | true | true |
1c2f5c6a7204ca7918540349bdc9cb4d1d0fa24b | 1,075 | py | Python | data/migrations/versions/d42c175b439a_backfill_state_id_and_make_it_unique.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 2,027 | 2019-11-12T18:05:48.000Z | 2022-03-31T22:25:04.000Z | data/migrations/versions/d42c175b439a_backfill_state_id_and_make_it_unique.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 496 | 2019-11-12T18:13:37.000Z | 2022-03-31T10:43:45.000Z | data/migrations/versions/d42c175b439a_backfill_state_id_and_make_it_unique.py | giuseppe/quay | a1b7e4b51974edfe86f66788621011eef2667e6a | [
"Apache-2.0"
] | 249 | 2019-11-12T18:02:27.000Z | 2022-03-22T12:19:19.000Z | """
Backfill state_id and make it unique.
Revision ID: d42c175b439a
Revises: 3e8cc74a1e7b
Create Date: 2017-01-18 15:11:01.635632
"""
# revision identifiers, used by Alembic.
revision = "d42c175b439a"
down_revision = "3e8cc74a1e7b"
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade(op, table... | 31.617647 | 96 | 0.712558 |
revision = "d42c175b439a"
down_revision = "3e8cc74a1e7b"
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade(op, tables, tester):
# empty.
conn = op.get_bind()
conn.execute("update queueitem set state_id = id where state_id = ''")
# ### commands auto generated by Alembic... | true | true |
1c2f5c71d6e86238f8d4f38b52e27d16894fa8e5 | 14,253 | py | Python | ami/flowchart/FlowchartGraphicsView.py | chuckie82/ami | 7adb72c709afe4c1af53ef7f0d2b0e3639c63bf3 | [
"BSD-3-Clause-LBNL"
] | 6 | 2018-05-31T21:37:15.000Z | 2022-01-24T15:22:46.000Z | ami/flowchart/FlowchartGraphicsView.py | chuckie82/ami | 7adb72c709afe4c1af53ef7f0d2b0e3639c63bf3 | [
"BSD-3-Clause-LBNL"
] | 68 | 2019-06-06T21:00:49.000Z | 2022-03-14T22:35:29.000Z | ami/flowchart/FlowchartGraphicsView.py | chuckie82/ami | 7adb72c709afe4c1af53ef7f0d2b0e3639c63bf3 | [
"BSD-3-Clause-LBNL"
] | 2 | 2020-12-13T01:53:05.000Z | 2021-07-19T04:56:51.000Z | from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
from pyqtgraph.widgets.GraphicsView import GraphicsView
from pyqtgraph.graphicsItems.ViewBox import ViewBox
from pyqtgraph import GridItem, GraphicsWidget
from ami.flowchart.Node import NodeGraphicsItem, find_nearest
from ami.flowchart.library.common import SourceNode
... | 34.59466 | 102 | 0.601207 | from pyqtgraph.Qt import QtGui, QtCore, QtWidgets
from pyqtgraph.widgets.GraphicsView import GraphicsView
from pyqtgraph.graphicsItems.ViewBox import ViewBox
from pyqtgraph import GridItem, GraphicsWidget
from ami.flowchart.Node import NodeGraphicsItem, find_nearest
from ami.flowchart.library.common import SourceNode
... | true | true |
1c2f5c7f8953b6491c7c1611f124d3706f3c0b55 | 1,727 | py | Python | SoftLayer/CLI/block/snapshot/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 126 | 2015-01-05T05:09:22.000Z | 2021-07-02T00:16:35.000Z | SoftLayer/CLI/block/snapshot/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 969 | 2015-01-05T15:55:31.000Z | 2022-03-31T19:55:20.000Z | SoftLayer/CLI/block/snapshot/list.py | dvzrv/softlayer-python | 9a5f6c6981bcc370084537b4d1769383499ce90d | [
"MIT"
] | 176 | 2015-01-22T11:23:40.000Z | 2022-02-11T13:16:58.000Z | """List block storage snapshots."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import columns as column_helper
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
COLUMNS = [
column_helper.Column('id', (... | 30.839286 | 87 | 0.65663 |
import click
import SoftLayer
from SoftLayer.CLI import columns as column_helper
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
COLUMNS = [
column_helper.Column('id', ('id',), mask='id'),
column_helper.Column('name', ('notes',), mask='notes'),
... | true | true |
1c2f5df2b341f8429bcdc733f4d4efc8edbf36a8 | 5,513 | py | Python | contrib/seeds/makeseeds.py | ctscoin/cts-core-original | 73eaf46e6cf5a1fb26099bb1ab8ae5d1e846780a | [
"MIT"
] | 1 | 2018-09-23T14:58:24.000Z | 2018-09-23T14:58:24.000Z | contrib/seeds/makeseeds.py | ctscoin/cts-core-original | 73eaf46e6cf5a1fb26099bb1ab8ae5d1e846780a | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | ctscoin/cts-core-original | 73eaf46e6cf5a1fb26099bb1ab8ae5d1e846780a | [
"MIT"
] | 1 | 2018-09-04T02:36:33.000Z | 2018-09-04T02:36:33.000Z | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
#... | 32.052326 | 186 | 0.566842 |
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
""
}
import re
import sys
import dns.resolver
import collections
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})... | true | true |
1c2f5fdb8b40a19e7373e6298e3f6b6169e9e8b4 | 6,354 | py | Python | ppcls/utils/config.py | PaddlePaddle/PaddleImgClass | f5265a1f2ab7aa113ae5245223f0528e3239a5e7 | [
"Apache-2.0"
] | 7 | 2020-03-30T04:32:01.000Z | 2020-03-30T07:51:00.000Z | ppcls/utils/config.py | PaddlePaddle/PaddleClassification | 51c1bdb27af15441995bf9840f7020cca9b7d9a8 | [
"Apache-2.0"
] | null | null | null | ppcls/utils/config.py | PaddlePaddle/PaddleClassification | 51c1bdb27af15441995bf9840f7020cca9b7d9a8 | [
"Apache-2.0"
] | 1 | 2020-04-07T17:03:24.000Z | 2020-04-07T17:03:24.000Z | # 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 applic... | 29.691589 | 105 | 0.581523 |
import os
import copy
import argparse
import yaml
from ppcls.utils import logger
from ppcls.utils import check
__all__ = ['get_config']
class AttrDict(dict):
def __getattr__(self, key):
return self[key]
def __setattr__(self, key, value):
if key in self.__dict__:
self... | true | true |
1c2f60243d397014305e83077634402f45c35613 | 7,252 | py | Python | calico_node/tests/st/libnetwork/test_labeling.py | ketkulka/calico | c5f432f127e0ccd00fa2ec90c2ee72378d2deef3 | [
"Apache-2.0"
] | 2 | 2015-03-06T14:26:51.000Z | 2019-09-04T15:00:43.000Z | calico_node/tests/st/libnetwork/test_labeling.py | ketkulka/calico | c5f432f127e0ccd00fa2ec90c2ee72378d2deef3 | [
"Apache-2.0"
] | null | null | null | calico_node/tests/st/libnetwork/test_labeling.py | ketkulka/calico | c5f432f127e0ccd00fa2ec90c2ee72378d2deef3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Tigera, Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 39.846154 | 86 | 0.579288 |
import json
import yaml
from nose_parameterized import parameterized
from unittest import skip
from tests.st.test_base import TestBase
from tests.st.utils.docker_host import DockerHost
from tests.st.utils.network import NETWORKING_LIBNETWORK
from tests.st.utils.utils import ETCD_CA, ETCD_CERT, \
ETCD... | true | true |
1c2f60784233e4fd75c444a1734a897e8f6f2993 | 1,457 | py | Python | utils.py | pgiraud/bheka | dca033e9061633c0780907c8be6630a429f232f1 | [
"MIT"
] | null | null | null | utils.py | pgiraud/bheka | dca033e9061633c0780907c8be6630a429f232f1 | [
"MIT"
] | null | null | null | utils.py | pgiraud/bheka | dca033e9061633c0780907c8be6630a429f232f1 | [
"MIT"
] | null | null | null | import os
import ConfigParser
import geojson
import shapely
from shapely.geometry import Polygon
from shapely.prepared import prep
from math import floor, ceil
# Maximum resolution
MAXRESOLUTION = 156543.0339
# X/Y axis limit
max = MAXRESOLUTION * 256 / 2
class TileBuilder(object):
def __init__(self, paramete... | 26.017857 | 77 | 0.597804 | import os
import ConfigParser
import geojson
import shapely
from shapely.geometry import Polygon
from shapely.prepared import prep
from math import floor, ceil
MAXRESOLUTION = 156543.0339
max = MAXRESOLUTION * 256 / 2
class TileBuilder(object):
def __init__(self, parameter):
self.a = parameter
... | true | true |
1c2f6096b0aea8e254bd451f6ea9579d7c99bf6c | 1,254 | py | Python | main/geo/generate/python/trifocal.py | jooink/BoofCV | 2b34e3b167f545e5bbc327bc7032adfdb7a1c3a0 | [
"Apache-2.0"
] | 1 | 2022-02-26T06:27:29.000Z | 2022-02-26T06:27:29.000Z | main/geo/generate/python/trifocal.py | dewmal/BoofCV | 19a970ab712b5a062f59f751145c77c36c2daa3f | [
"Apache-2.0"
] | 2 | 2021-05-18T20:53:57.000Z | 2022-02-01T01:05:11.000Z | main/geo/generate/python/trifocal.py | silwalprabin/BoofCV | 8a601eead55aa2e9461c7a15ece21e30b4515b42 | [
"Apache-2.0"
] | null | null | null | from sage.all import *
from utilsymbolic import *
Xa=symVector(3,'xa')
Xb=symVector(3,'xb')
Xc=symVector(3,'xc')
# Set the z coordinate to 1
Xa[2] = 1
Xb[2] = 1
Xc[2] = 1
T1=symMatrix(3,3,'t1')
T2=symMatrix(3,3,'t2')
T3=symMatrix(3,3,'t3')
XCb = symCrossMat3x3(Xb)
XCc = symCrossMat3x3(Xc)
insideSum = multScalarM... | 25.08 | 96 | 0.542265 | from sage.all import *
from utilsymbolic import *
Xa=symVector(3,'xa')
Xb=symVector(3,'xb')
Xc=symVector(3,'xc')
Xa[2] = 1
Xb[2] = 1
Xc[2] = 1
T1=symMatrix(3,3,'t1')
T2=symMatrix(3,3,'t2')
T3=symMatrix(3,3,'t3')
XCb = symCrossMat3x3(Xb)
XCc = symCrossMat3x3(Xc)
insideSum = multScalarMatrix(Xa[0],T1) + multScala... | false | true |
1c2f632c34820217849c7161d89ddc6085cbe221 | 3,010 | py | Python | spark_auto_mapper_fhir/backbone_elements/test_report_teardown.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/backbone_elements/test_report_teardown.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/backbone_elements/test_report_teardown.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.string import FhirString
from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase
from spark_auto_mapper_fhir.base_types.fh... | 43 | 115 | 0.718272 | from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.string import FhirString
from spark_auto_mapper_fhir.extensions.extension_base import ExtensionBase
from spark_auto_mapper_fhir.base_types.fh... | true | true |
1c2f64085dc9bb8ab8b33047eb5099bbb908243d | 1,168 | py | Python | tests/python/test_native_functions.py | winnerineast/taichi | 57ae0abc374e0df8f0b54bde4bcb92d9d97ed269 | [
"MIT"
] | null | null | null | tests/python/test_native_functions.py | winnerineast/taichi | 57ae0abc374e0df8f0b54bde4bcb92d9d97ed269 | [
"MIT"
] | null | null | null | tests/python/test_native_functions.py | winnerineast/taichi | 57ae0abc374e0df8f0b54bde4bcb92d9d97ed269 | [
"MIT"
] | null | null | null | import taichi as ti
@ti.all_archs
def test_abs():
x = ti.var(ti.f32)
N = 16
@ti.layout
def place():
ti.root.dense(ti.i, N).place(x)
@ti.kernel
def func():
for i in range(N):
x[i] = abs(-i)
print(x[i])
ti.static_print(x[i])
func()
for i in range(N):
assert x[i] == i
@... | 14.78481 | 56 | 0.516267 | import taichi as ti
@ti.all_archs
def test_abs():
x = ti.var(ti.f32)
N = 16
@ti.layout
def place():
ti.root.dense(ti.i, N).place(x)
@ti.kernel
def func():
for i in range(N):
x[i] = abs(-i)
print(x[i])
ti.static_print(x[i])
func()
for i in range(N):
assert x[i] == i
@... | true | true |
1c2f664fdcc5106e6c749e61b4c37cde48aa3eab | 7,195 | py | Python | lib/dataset/COCOKeypoints.py | ducongju/HigherHRNet-Human-Pose-Estimation | 6986494e992fd58bced00543645fe8c49ec94c35 | [
"MIT"
] | null | null | null | lib/dataset/COCOKeypoints.py | ducongju/HigherHRNet-Human-Pose-Estimation | 6986494e992fd58bced00543645fe8c49ec94c35 | [
"MIT"
] | null | null | null | lib/dataset/COCOKeypoints.py | ducongju/HigherHRNet-Human-Pose-Estimation | 6986494e992fd58bced00543645fe8c49ec94c35 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (leoxiaobin@gmail.com)
# Modified by Bowen Cheng (bcheng9@illinois.edu)
# ------------------------------------------------------------------------------
fro... | 39.751381 | 108 | 0.54663 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import numpy as np
import pycocotools
from .COCODataset import CocoDataset
from .target_generators import HeatmapGenerator
logger = logging.getLogger(__name__)
class CocoKeypoints(Co... | true | true |
1c2f67eaa12319964a62ea23974494926d2481ac | 3,046 | py | Python | scripts/print_handlers_md.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | scripts/print_handlers_md.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | scripts/print_handlers_md.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... | 35.011494 | 79 | 0.684504 |
from __future__ import print_function
import os
import sys
sys.path.append(os.getcwd())
os.environ["FRESHMAKER_DEVELOPER_ENV"] = "1"
def load_module(mod_name):
__import__(mod_name)
try:
return sys.modules[mod_name]
except AttributeError:
raise ImportError("%r... | true | true |
1c2f6a4b4184922a65c21a503ba64ca6d19a0edf | 106,877 | py | Python | yarGen.py | p-g-krish/yarGen | 70cb03fd91b877982b9f1bff414cb98dd54e7cf5 | [
"BSD-3-Clause"
] | null | null | null | yarGen.py | p-g-krish/yarGen | 70cb03fd91b877982b9f1bff414cb98dd54e7cf5 | [
"BSD-3-Clause"
] | null | null | null | yarGen.py | p-g-krish/yarGen | 70cb03fd91b877982b9f1bff414cb98dd54e7cf5 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# -*- coding: utf-8 -*-
#
# yarGen
# A Rule Generator for YARA Rules
#
# Florian Roth
__version__ = "0.22.0"
import os
import sys
if sys.version_info[0] > 2:
raise Exception("Some modules require Python 2, so please use that version instead of Python 3")
import... | 43.182626 | 135 | 0.532781 |
__version__ = "0.22.0"
import os
import sys
if sys.version_info[0] > 2:
raise Exception("Some modules require Python 2, so please use that version instead of Python 3")
import argparse
import re
import traceback
import operator
import datetime
import time
import scandir
import pefile
import cPickle as p... | true | true |
1c2f6afbc8e9ef22187334b1035854ca8b2f15e1 | 392 | py | Python | tests/abilities/test_health.py | vishwatejharer/warriorpy | 57a8dccfe23796ef213288972b20a7e883e79b24 | [
"MIT"
] | 46 | 2015-02-02T19:32:05.000Z | 2022-03-16T16:24:14.000Z | tests/abilities/test_health.py | vishwatejharer/warriorpy | 57a8dccfe23796ef213288972b20a7e883e79b24 | [
"MIT"
] | 5 | 2015-07-06T15:26:43.000Z | 2020-04-21T08:12:04.000Z | tests/abilities/test_health.py | vishwatejharer/warriorpy | 57a8dccfe23796ef213288972b20a7e883e79b24 | [
"MIT"
] | 10 | 2015-02-10T02:56:22.000Z | 2021-05-15T22:37:38.000Z | import unittest
from pythonwarrior.units.warrior import Warrior
from pythonwarrior.abilities.health import Health
class TestHealth(unittest.TestCase):
def setUp(self):
self.warrior = Warrior()
self.health = Health(self.warrior)
def test_should_return_the_amount_of_health(self):
self.... | 26.133333 | 54 | 0.732143 | import unittest
from pythonwarrior.units.warrior import Warrior
from pythonwarrior.abilities.health import Health
class TestHealth(unittest.TestCase):
def setUp(self):
self.warrior = Warrior()
self.health = Health(self.warrior)
def test_should_return_the_amount_of_health(self):
self.... | true | true |
1c2f6b8f8a0f1859eee2807fbf87a4134a1b435c | 1,886 | py | Python | reflex_behaviors/src/turn_detector.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | 7 | 2018-08-09T02:40:58.000Z | 2022-02-07T03:32:23.000Z | reflex_behaviors/src/turn_detector.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | null | null | null | reflex_behaviors/src/turn_detector.py | ehwa009/social_mind | 0507f47b29371ef167b30b60bdd446fde118b626 | [
"Apache-2.0"
] | 2 | 2018-08-09T02:41:06.000Z | 2018-08-27T03:54:10.000Z | #!/usr/bin/python
#-*- encoding: utf8 -*-
import rospy
from std_msgs.msg import Bool, String, Empty
from mind_msgs.msg import RaisingEvents, SetIdleMotion
class TurnDetectorNode:
def __init__(self):
rospy.Subscriber('raising_events', RaisingEvents, self.handle_raising_events)
rospy.Subscriber('rob... | 34.290909 | 111 | 0.660657 |
import rospy
from std_msgs.msg import Bool, String, Empty
from mind_msgs.msg import RaisingEvents, SetIdleMotion
class TurnDetectorNode:
def __init__(self):
rospy.Subscriber('raising_events', RaisingEvents, self.handle_raising_events)
rospy.Subscriber('robot_is_saying', Bool, self.handle_robot_i... | true | true |
1c2f6caf6f6e11179416b9ab70168e3b0a53bc9c | 9,281 | py | Python | dsl_parser/tests/test_deployment_update.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 6 | 2018-10-13T20:36:40.000Z | 2021-07-04T17:19:13.000Z | dsl_parser/tests/test_deployment_update.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 97 | 2018-05-25T12:10:19.000Z | 2022-03-30T10:16:40.000Z | dsl_parser/tests/test_deployment_update.py | mistio/cloudify-common | 3b706ba31a3371052fbdd12486d4a0befbcf491b | [
"Apache-2.0"
] | 15 | 2018-10-13T20:36:42.000Z | 2021-09-06T15:19:11.000Z | ########
# Copyright (c) 2018 Cloudify Platform Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 40.352174 | 79 | 0.620623 | from dsl_parser import constants
from dsl_parser.multi_instance import modify_deployment
from dsl_parser.tests.abstract_test_parser import AbstractTestParser
class BaseDeploymentUpdateTest(AbstractTestParser):
@staticmethod
def modify_multi(plan, modified_nodes):
return modify_deployment(
... | true | true |
1c2f6d30e79eec7063eef49c70ac7be3368730fc | 16,385 | py | Python | Fairness_attack/defenses.py | Ninarehm/attack | 0d5a6b842d4e81484540151d879036e9fe2184f1 | [
"MIT"
] | 8 | 2021-03-08T17:13:42.000Z | 2022-03-31T00:57:53.000Z | Fairness_attack/defenses.py | lutai14/attack | 773024c7b86be112521a2243f2f809a54891c81f | [
"MIT"
] | null | null | null | Fairness_attack/defenses.py | lutai14/attack | 773024c7b86be112521a2243f2f809a54891c81f | [
"MIT"
] | 1 | 2022-02-10T22:36:11.000Z | 2022-02-10T22:36:11.000Z | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import sys
import numpy as np
from sklearn import metrics, model_selection, neighbors
import scipy.linalg as slin
import scipy.sparse as sparse
import uppe... | 34.936034 | 131 | 0.603967 | from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import copy
import sys
import numpy as np
from sklearn import metrics, model_selection, neighbors
import scipy.linalg as slin
import scipy.sparse as sparse
import uppe... | true | true |
1c2f6d943cfc6ffe509c5db07d44559569799c6f | 71 | py | Python | PycharmProjects/PythonExercicios/ex001.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex001.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | PycharmProjects/PythonExercicios/ex001.py | RodrigoMASRamos/Projects.py | ed15981b320914c9667305dcd5fb5b7906fd9b00 | [
"MIT"
] | null | null | null | #Crie um programa que escreva "Olá,Mundo!" na tela.
print('Olá,mundo!') | 35.5 | 51 | 0.71831 |
print('Olá,mundo!') | true | true |
1c2f6ed35f058502d9614cd6295c3e6bd26ed8f5 | 399 | py | Python | coursegroup/asgi.py | Samyak-jain09/CourseRoom | 2ba951bea983e1bd60b873a0b07db9bac9e30531 | [
"MIT"
] | null | null | null | coursegroup/asgi.py | Samyak-jain09/CourseRoom | 2ba951bea983e1bd60b873a0b07db9bac9e30531 | [
"MIT"
] | null | null | null | coursegroup/asgi.py | Samyak-jain09/CourseRoom | 2ba951bea983e1bd60b873a0b07db9bac9e30531 | [
"MIT"
] | null | null | null | """
ASGI config for coursegroup project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'coursegroup.settings')
application = get_asgi_application()
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.